:root {
    --primary: #6366f1;           /* Indigo */
    --primary-hover: #4f46e5;
    --bg-main: #f8fafc;          /* Slate 50 */
    --bg-card: #ffffff;          /* White */
    --text-main: #0f172a;        /* Slate 900 */
    --text-muted: #64748b;       /* Slate 500 */
    --border: #e2e8f0;           /* Slate 200 */
    --success: #10b981;          /* Emerald 500 */
    --danger: #ef4444;           /* Red 500 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sidebar & Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 60%, #0f172a 100%);
    border-right: none;
    padding: 1.75rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    scrollbar-width: none; /* Firefox */
}
.sidebar::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Logo */
.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, #a5b4fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
    user-select: none;
}
.sidebar .logo i {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
    animation: spin-slow 8s linear infinite;
}
@keyframes spin-slow {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}


.main-content {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
}

.main-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    margin: 0;
}

/* Navigation */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: rgba(148, 163, 184, 0.85);
    text-decoration: none;
    border-radius: 0.65rem;
    margin-bottom: 0.2rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-link:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #e2e8f0;
    transform: translateX(3px);
}
.nav-link:hover i { opacity: 1; transform: scale(1.1); }

.nav-link.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(139,92,246,0.85));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    font-weight: 600;
}
.nav-link.active i { opacity: 1; }
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: #a5b4fc;
    border-radius: 0 3px 3px 0;
}

.nav-section-header {
    font-size: 0.62rem;
    color: rgba(100, 116, 139, 0.7);
    font-weight: 700;
    padding: 1.25rem 0.85rem 0.4rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
}

.nav-section-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    border-radius: 0.5rem;
}
.nav-section-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
}
.rotate-icon {
    color: rgba(148, 163, 184, 0.5);
    transition: transform 0.3s ease;
}
[aria-expanded="true"] .rotate-icon {
    transform: rotate(90deg);
}

/* Logout link style */
.sidebar hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 1.5rem 0 1rem;
}

/* Cards & Stats */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

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

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stats-grid > div {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Loading Spinner */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    vertical-align: middle;
    margin-right: 8px;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.syncing .loader {
    display: inline-block;
}

.syncing span {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar nav {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .nav-link {
        margin-bottom: 0;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .main-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
/* Spotlight Search */
.spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.spotlight-modal {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    overflow: hidden;
    border: 1px solid var(--border);
    animation: spotlightIn 0.2s ease-out;
}

@keyframes spotlightIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.spotlight-input-container {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.spotlight-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.25rem;
    font-family: inherit;
    color: var(--text-main);
    background: transparent;
}

.spotlight-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.spotlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.spotlight-item:hover, .spotlight-item.active {
    background: #f1f5f9;
}

.spotlight-item i {
    font-size: 1.25rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.spotlight-item .item-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.spotlight-item .item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.spotlight-footer {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.spotlight-footer kbd {
    background: white;
    border: 1px solid var(--border);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 700;
}
