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

:root {
    --navy: #1a2744;
    --navy-light: #243460;
    --navy-lighter: #2e4370;
    --teal: #2dd4bf;
    --teal-dark: #1ab8a4;
    --teal-light: #7dd3fc;
    --white: #ffffff;
    --grey-50: #f8fafc;
    --grey-100: #f1f5f9;
    --grey-200: #e2e8f0;
    --grey-300: #cbd5e1;
    --grey-400: #94a3b8;
    --grey-500: #64748b;
    --grey-600: #475569;
    --grey-700: #334155;
    --grey-800: #1e293b;
    --grey-900: #0f172a;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --shadow: rgba(26, 39, 68, 0.08);
    --shadow-lg: rgba(26, 39, 68, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    --gradient-card: linear-gradient(145deg, var(--white) 0%, #fefefe 100%);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--grey-50);
    color: var(--navy);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--gradient-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.sidebar-logo svg {
    width: 36px;
    height: 36px;
}

.sidebar-logo h1 {
    color: var(--white);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    padding: 24px 0;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0 20px;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--teal);
    transform: scaleY(0);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.nav-item.active {
    background: rgba(45, 212, 191, 0.15);
    color: var(--teal);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.nav-item-badge {
    background: var(--teal);
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--grey-200);
    padding: 0 32px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    color: var(--navy);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--grey-600);
    font-size: 14px;
}

.breadcrumb i {
    font-size: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search {
    position: relative;
}

.header-search input {
    background: var(--grey-100);
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    width: 280px;
    transition: all 0.2s;
    outline: none;
}

.header-search input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--grey-100);
    color: var(--grey-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.header-btn:hover {
    background: var(--grey-200);
    color: var(--navy);
}

.header-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--grey-100);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--grey-600);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: var(--grey-50);
}

.user-dropdown-item i {
    width: 16px;
    margin-right: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 16px;
}

.user-info h4 {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
}

.user-info p {
    color: var(--grey-500);
    font-size: 12px;
}

/* Content Area */
.content {
    flex: 1;
    padding: 32px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--grey-200);
    border-radius: 20px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px var(--shadow-lg);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.primary { background: var(--gradient-accent); }
.stat-icon.success { background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%); }
.stat-icon.warning { background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); }
.stat-icon.info { background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%); }

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
}

.stat-change.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--grey-600);
    font-size: 14px;
    font-weight: 500;
}

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.dashboard-card {
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 24px;
}

.card-title {
    color: var(--navy);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subtitle {
    color: var(--grey-600);
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.card-btn {
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--grey-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.card-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
}

/* AI Staff List */
.staff-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.staff-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--grey-200);
    border-radius: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.staff-item:hover {
    border-color: var(--teal);
    background: rgba(45, 212, 191, 0.02);
}

.staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
}

.staff-info {
    flex: 1;
}

.staff-name {
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.staff-role {
    color: var(--grey-600);
    font-size: 14px;
}

.staff-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.staff-status.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.staff-status.busy {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.staff-status.offline {
    background: var(--grey-100);
    color: var(--grey-500);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: var(--grey-50);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--grey-100);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--teal);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--navy);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-time {
    color: var(--grey-500);
    font-size: 12px;
}

/* Chart placeholder */
.chart-container {
    height: 300px;
    background: var(--grey-50);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-500);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.quick-action {
    background: var(--white);
    border: 2px solid var(--grey-200);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
}

.quick-action:hover {
    border-color: var(--teal);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(45, 212, 191, 0.15);
}

.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-accent);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.quick-action h3 {
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.quick-action p {
    color: var(--grey-600);
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 0 16px;
    }

    .content {
        padding: 16px;
    }

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

    .header-search input {
        width: 200px;
    }
}

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

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}
