:root {
    /* Premium v3.4 Color Palette */
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.7);
    --accent-primary: #818cf8;
    /* Soft Indigo */
    --accent-secondary: #c084fc;
    /* Soft Purple */
    --accent-cyan: #22d3ee;
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 80px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --drawer-width: 480px;

    /* Effects */
    --glass-blur: blur(24px);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}




* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Global Input Styles - Fix for invisible text */
input,
select,
textarea {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

option {
    background: #0f172a;
    /* Dark background for dropdown options */
    color: white;
}

.bg-dark {
    background-color: var(--bg-dark);
}

.text-light {
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Glassmorphism Utility */
.glass {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-premium);
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Auth View */
.auth-view {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent);
    position: relative;
    overflow: hidden;
}

/* Animated Background Orbs */
.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #22d3ee, #818cf8);
    bottom: -250px;
    left: -250px;
    animation-delay: 7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #c084fc, #f472b6);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
        max-width: 90%;
        border-radius: 20px;
    }

    .logo {
        font-size: 2rem;
    }

    .fast-login-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header .logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-icon {
    color: var(--accent-primary);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 18px;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.input-with-icon input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.demo-hints {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.demo-hints span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.fast-login-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.fast-login-grid .btn-fast {
    flex: 1 1 calc(33.333% - 8px);
    /* 3 per row on Desktop */
    min-width: 80px;
}

@media (max-width: 480px) {
    .fast-login-grid .btn-fast {
        flex: 1 1 100%;
        /* Stack vertically on Mobile */
    }
}

.btn-fast {
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-fast:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-fast i {
    width: 16px;
    height: 16px;
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.role-selector input[type="radio"] {
    display: none;
}

.role-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.role-option i {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.role-option span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
}

.role-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.role-selector input[type="radio"]:checked+.role-option {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(192, 132, 252, 0.2));
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

.role-selector input[type="radio"]:checked+.role-option i,
.role-selector input[type="radio"]:checked+.role-option span {
    color: var(--accent-primary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -8px 0 16px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.link-btn:hover {
    background: rgba(129, 140, 248, 0.1);
    color: var(--accent-primary);
}

/* Button Loading State */
.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary.loading #login-btn-text,
.btn-primary.loading #login-btn-icon {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: block !important;
}

.btn-block {
    width: 100%;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.icon-inline {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icon-inline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.error-box {
    margin: 8px 0 16px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    background: rgba(248, 113, 113, 0.08);
    font-size: 0.9rem;
}

/* App View Layout */
.app-view {
    display: block;
    width: 100%;
    min-height: 100vh;
}


/* Sidebar Overhaul */
.sidebar {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-right: 1px solid var(--border-glass);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
}



body.sidebar-open .sidebar {
    width: var(--sidebar-width);
}

body:not(.sidebar-open) .sidebar {
    width: 80px;
}

.sidebar-header {
    padding: 24px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}

body:not(.sidebar-open) .logo span,
body:not(.sidebar-open) .nav-item span,
body:not(.sidebar-open) .user-info,
body:not(.sidebar-open) .nav-section-title {
    display: none;
}

body:not(.sidebar-open) .sidebar-toggle-btn {
    transform: rotate(180deg);
}


.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
}




.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    margin: 32px 24px 12px 24px;
    letter-spacing: 0.1em;
    transition: opacity 0.3s;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
}

.sidebar-nav ul {
    list-style: none;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.3s, transform 0.3s;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(95deg, var(--accent-primary) 0%, rgba(99, 102, 241, 0.5) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.nav-item.active i {
    color: #fff;
}

body:not(.sidebar-open) .nav-item {
    justify-content: center;
    padding: 12px;
    margin: 4px 12px;
    border-radius: 12px;
}

body:not(.sidebar-open) .nav-item i {
    margin: 0;
}


.sidebar-footer {
    margin-top: auto;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 16px;
    margin: 0 12px 12px 12px;
    transition: all 0.3s;
}

body:not(.sidebar-open) .user-pill {
    justify-content: center;
    padding: 8px;
    margin: 0 12px 12px 12px;
}

body:not(.sidebar-open) #logout-btn {
    display: none;
}


.avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

#logout-btn:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* --- Advanced Task Module Styles (Premium Upgrade) --- */

/* Analytics Header */
.task-analytics-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.task-analytics-header .glass {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.6));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.task-analytics-header .glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.task-analytics-header .glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* Mode Toggle (Pill Shape) */
.mode-toggle {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 50px;
    padding: 6px;
    display: inline-flex;
    border: 1px solid var(--border-glass);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-toggle-btn {
    padding: 10px 24px;
    border-radius: 40px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: content-box;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.mode-toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
    transform: scale(1.05);
}

/* Animations */
@keyframes pulse-urgent {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4);
        border-color: rgba(248, 113, 113, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(248, 113, 113, 0);
        border-color: rgba(248, 113, 113, 0.2);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
        border-color: rgba(248, 113, 113, 0.6);
    }
}

.task-card.critical {
    animation: pulse-urgent 2s infinite;
}

/* Priority Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-critical {
    background: rgba(248, 113, 113, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-high {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-medium {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.badge-low {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Task Card (Premium) */
.task-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.task-card:hover {
    transform: translateY(-6px) scale(1.01);
    background: rgba(30, 41, 59, 0.7);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    border-color: rgba(129, 140, 248, 0.3);
}

/* Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    padding-bottom: 32px;
    height: calc(100vh - 280px);
    align-items: flex-start;
    padding-right: 24px;
}

.kanban-column {
    min-width: 340px;
    max-width: 340px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

.kanban-tasks {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
    scroll-behavior: smooth;
}

.kanban-tasks::-webkit-scrollbar {
    width: 4px;
}

.kanban-tasks::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-tasks::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Mobile Responsiveness for Tasks */
@media (max-width: 768px) {
    .kanban-board {
        scroll-snap-type: x mandatory;
        gap: 16px;
        height: auto;
        min-height: 60vh;
    }

    .kanban-column {
        min-width: 88vw;
        scroll-snap-align: center;
    }

    .task-analytics-header {
        display: flex;
        overflow-x: auto;
        padding-bottom: 12px;
        gap: 16px;
    }

    .task-analytics-header .glass {
        min-width: 260px;
        flex-shrink: 0;
    }

    /* Force Task Card List View to Stack on Mobile */
    #task-view-container .task-card {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    /* Adjust the color strip */
    #task-view-container .task-card>div:first-child {
        width: 100% !important;
        height: 4px !important;
        order: -1;
    }

    /* Adjust the action buttons area */
    #task-view-container .task-card>div:last-child {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 8px;
    }

    /* User pill adjustment */
    #task-view-container .task-card .user-pill {
        align-self: flex-start;
    }
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}



.top-bar {
    height: var(--topbar-height);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    z-index: 40;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    gap: 10px;
    width: 400px;
    transition: width 0.3s;
}

.search-box:focus-within {
    width: 500px;
    border-color: var(--accent-primary);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    max-height: 400px;
    border-radius: var(--radius-md);
    padding: 12px;
    overflow-y: auto;
    z-index: 1000;
}


.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
}

.icon-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
}

.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-danger);
    border-radius: 50%;
}

.content-scroll {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
}


.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.section-card {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Side Drawer */
.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-width);
    height: 100vh;
    z-index: 500;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.side-drawer:not(.hidden) {
    transform: translateX(0);
}

.drawer-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
}

.drawer-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Sync Banner */
.sync-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--accent-warning);
    border-top: none;
}

/* Skeleton Loaders */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}


/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    /* Ensure high z-index */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    /* Darker background */
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.animate-slide-in {
    transform: translateX(0);
}

.toast i {
    width: 20px;
    height: 20px;
}

.toast.success i {
    color: var(--accent-success);
}

.toast.error i {
    color: var(--accent-danger);
}

.toast.info i {
    color: var(--accent-primary);
}

/* Activity Feed */
.activity-item {
    transition: transform 0.2s;
}

.activity-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
    overflow: hidden;
}

/* Status Dots */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.status-dot.success {
    background: var(--accent-success);
    box-shadow: 0 0 10px var(--accent-success);
}

.status-dot.warning {
    background: var(--accent-warning);
    box-shadow: 0 0 10px var(--accent-warning);
}

/* Grid Table */
.table-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 2000;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        width: var(--sidebar-width) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        /* Ensure flex layout is maintained */
        flex-direction: column;
    }

    /* Add overlay when sidebar Open on mobile */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1900;
        animation: fadeIn 0.3s;
    }

    body.sidebar-open .sidebar {
        left: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        width: var(--sidebar-width) !important;
    }

    /* Ensure content inside sidebar is visible */
    body.sidebar-open .logo span,
    body.sidebar-open .nav-item span,
    body.sidebar-open .user-info,
    body.sidebar-open .nav-section-title {
        display: block !important;
        opacity: 1;
    }

    body.sidebar-open .sidebar {
        left: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar-toggle-btn {
        display: none;
        /* Default hidden on mobile closed state */
    }

    body.sidebar-open .sidebar-toggle-btn {
        display: flex;
        /* Show when open to allow closing */
        position: absolute;
        top: 24px;
        right: 24px;
    }

    body:not(.sidebar-open) .sidebar {
        width: 0 !important;
    }

    .top-bar {
        padding: 0 16px;
    }

    .search-box {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .dashboard-sections,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .top-bar-actions .btn span {
        display: none;
    }

    .view-title h2 {
        font-size: 1.1rem;
    }
}

@media (min-width: 1025px) {
    .app-view {
        display: flex;
    }

    .mobile-only {
        display: none;
    }
}

.hidden {
    display: none !important;
}

.animate-fade {
    animation: fadeByKey 0.3s ease-in-out;
}

@keyframes fadeByKey {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Page Responsive */
@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .settings-sidebar {
        display: flex;
        overflow-x: auto;
        padding: 12px !important;
        white-space: nowrap;
    }

    .settings-sidebar ul {
        display: flex;
        gap: 12px;
    }

    .settings-sidebar .nav-item {
        margin-bottom: 0;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.05);
    }

    .settings-sidebar .nav-item.active {
        background: var(--accent-primary);
        color: white;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- CLIENT PROFILE STYLES --- */
.client-profile-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid var(--border-glass);
}

.client-tab-btn {
    transition: all 0.2s ease;
    white-space: nowrap;
}

.client-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.client-overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .client-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* Chat Interface */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Timeline */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid #0f172a;
    /* Match bg color */
    z-index: 10;
}