@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0F172A;
    --primary-light: #1E293B;
    --accent: #10B981;
    --accent-hover: #059669;
    --finance: #3F51B5;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --bg-app: #F8FAFC;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(226, 232, 240, 0.8);
    --nav-bg: rgba(255, 255, 255, 0.8);
    
    --glass-blur: blur(12px);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    --card-radius: 24px;
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    
    --sidebar-width: 280px;
    --topbar-height: 80px;
}

[data-theme="dark"] {
    --primary: #10B981;
    --primary-light: #1E293B;
    --accent: #10B981;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --bg-app: #020617;
    --bg-card: rgba(30, 41, 59, 0.4);
    --border-color: rgba(51, 65, 85, 0.5);
    --nav-bg: rgba(2, 6, 23, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
    transition: background-color 0.3s var(--ease-out);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Base Layout */
.main-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar (Desktop Only) */
.desktop-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: 30px;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.desktop-sidebar::-webkit-scrollbar {
    width: 4px;
}

.desktop-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.desktop-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

[data-theme="dark"] .desktop-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 1024px) {
    .desktop-sidebar {
        display: flex;
    }
    .main-layout {
        padding-left: var(--sidebar-width);
    }
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-text {
    font-family: 'Outfit';
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    border-radius: 16px;
    transition: all 0.2s var(--ease-out);
}

.sidebar-nav .nav-item i {
    font-size: 20px;
}

.sidebar-nav .nav-item:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-main);
}

.sidebar-nav .nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.sidebar-footer {
    margin-top: auto;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 1024px) {
    .top-bar {
        padding: 0 40px;
    }
}

.top-bar-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-info h1 {
    font-size: 24px;
    letter-spacing: -0.5px;
}

.view-pill {
    font-size: 11px;
    padding: 4px 12px;
    background: var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
}

.view-pill.mgmt-active {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Actions */
.top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-small img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 2px solid var(--bg-card);
    object-fit: cover;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    padding: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .content-wrapper {
        padding: 40px;
    }
}

/* Responsive Grids */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .responsive-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Glass & Cards */
.glass {
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Mobile Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

@media (min-width: 1024px) {
    .mobile-only {
        display: none !important;
    }
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
}

.bottom-nav .nav-item.active {
    color: var(--accent);
}

.bottom-nav .nav-item i {
    font-size: 20px;
}

/* Buttons */
.glass-btn {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.glass-btn:hover {
    background: var(--border-color);
}

/* AI FAB */
.fab-ai {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    cursor: pointer;
    border: none;
    z-index: 500;
    transition: transform 0.3s;
}

@media (min-width: 1024px) {
    .fab-ai {
        bottom: 30px;
        right: 30px;
    }
}

.fab-ai:active { transform: scale(0.9); }

/* Utilities */
.status-badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--accent); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.btn {
    padding: 14px 28px;
    border-radius: 18px;
    font-family: 'Outfit';
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary { 
    background: var(--accent); 
    color: #FFFFFF !important; 
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.social-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* Fix global input/select/textarea colors */
input, select, textarea {
    color: var(--text-main) !important;
}
input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Garantir contraste no logo no dark mode */
[data-theme="dark"] .logo-icon {
    background: var(--accent);
    color: #020617;
}
[data-theme="dark"] .logo-text {
    color: #F8FAFC;
}

/* AI Assistant Enhancements */
.chip-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0 15px;
    scrollbar-width: none;
}
.chip-container::-webkit-scrollbar { display: none; }

.chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.chip:hover {
    background: var(--primary);
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
