/* ============================================================
   Academy SaaS — Premium Design System
   ============================================================ */

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

/* ============================================================
   THEME SYSTEM — CSS Custom Properties
   ============================================================ */

/* Default: Indigo */
:root,
[data-theme="indigo"] {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-rgb: 79, 70, 229;
    --sidebar-gradient: linear-gradient(180deg, #1E1B4B 0%, #312E81 50%, #3730A3 100%);
    --sidebar-active-bg: rgba(99, 102, 241, 0.25);
    --btn-gradient: linear-gradient(135deg, #4F46E5, #7C3AED);
    --stat-gradient-1: linear-gradient(135deg, #818CF8, #6366F1);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #FB923C, #EA580C);
    --stat-gradient-4: linear-gradient(135deg, #38BDF8, #0284C7);
}

/* Edusphere / Aurora Neon Theme */
[data-theme="edusphere"] {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-rgb: 99, 102, 241;
    --sidebar-gradient: linear-gradient(180deg, #0B0F19 0%, #111827 50%, #151E32 100%);
    --sidebar-active-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 100%);
    --sidebar-active-border: rgba(139, 92, 246, 0.6);
    --btn-gradient: linear-gradient(135deg, #6366F1, #A855F7);
    --stat-gradient-1: linear-gradient(135deg, #60A5FA, #3B82F6);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #FBBF24, #F97316);
    --stat-gradient-4: linear-gradient(135deg, #38BDF8, #06B6D4);
}

[data-theme="emerald"] {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #34D399;
    --primary-50: #ECFDF5;
    --primary-100: #D1FAE5;
    --primary-rgb: 5, 150, 105;
    --sidebar-gradient: linear-gradient(180deg, #022C22 0%, #064E3B 50%, #047857 100%);
    --sidebar-active-bg: rgba(52, 211, 153, 0.25);
    --btn-gradient: linear-gradient(135deg, #059669, #0D9488);
    --stat-gradient-1: linear-gradient(135deg, #34D399, #10B981);
    --stat-gradient-2: linear-gradient(135deg, #818CF8, #6366F1);
    --stat-gradient-3: linear-gradient(135deg, #FB923C, #EA580C);
    --stat-gradient-4: linear-gradient(135deg, #38BDF8, #0284C7);
}

[data-theme="rose"] {
    --primary: #E11D48;
    --primary-dark: #BE123C;
    --primary-light: #FB7185;
    --primary-50: #FFF1F2;
    --primary-100: #FFE4E6;
    --primary-rgb: 225, 29, 72;
    --sidebar-gradient: linear-gradient(180deg, #4C0519 0%, #881337 50%, #BE123C 100%);
    --sidebar-active-bg: rgba(251, 113, 133, 0.25);
    --btn-gradient: linear-gradient(135deg, #E11D48, #DB2777);
    --stat-gradient-1: linear-gradient(135deg, #FB7185, #F43F5E);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #818CF8, #6366F1);
    --stat-gradient-4: linear-gradient(135deg, #38BDF8, #0284C7);
}

[data-theme="amber"] {
    --primary: #D97706;
    --primary-dark: #B45309;
    --primary-light: #FBBF24;
    --primary-50: #FFFBEB;
    --primary-100: #FEF3C7;
    --primary-rgb: 217, 119, 6;
    --sidebar-gradient: linear-gradient(180deg, #451A03 0%, #78350F 50%, #92400E 100%);
    --sidebar-active-bg: rgba(251, 191, 36, 0.25);
    --btn-gradient: linear-gradient(135deg, #D97706, #EA580C);
    --stat-gradient-1: linear-gradient(135deg, #FBBF24, #F59E0B);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #818CF8, #6366F1);
    --stat-gradient-4: linear-gradient(135deg, #38BDF8, #0284C7);
}

[data-theme="cyan"] {
    --primary: #0891B2;
    --primary-dark: #0E7490;
    --primary-light: #22D3EE;
    --primary-50: #ECFEFF;
    --primary-100: #CFFAFE;
    --primary-rgb: 8, 145, 178;
    --sidebar-gradient: linear-gradient(180deg, #083344 0%, #164E63 50%, #155E75 100%);
    --sidebar-active-bg: rgba(34, 211, 238, 0.25);
    --btn-gradient: linear-gradient(135deg, #0891B2, #0284C7);
    --stat-gradient-1: linear-gradient(135deg, #22D3EE, #06B6D4);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #FB923C, #EA580C);
    --stat-gradient-4: linear-gradient(135deg, #818CF8, #6366F1);
}

[data-theme="slate"] {
    --primary: #475569;
    --primary-dark: #334155;
    --primary-light: #94A3B8;
    --primary-50: #F8FAFC;
    --primary-100: #F1F5F9;
    --primary-rgb: 71, 85, 105;
    --sidebar-gradient: linear-gradient(180deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    --sidebar-active-bg: rgba(148, 163, 184, 0.25);
    --btn-gradient: linear-gradient(135deg, #475569, #64748B);
    --stat-gradient-1: linear-gradient(135deg, #94A3B8, #64748B);
    --stat-gradient-2: linear-gradient(135deg, #34D399, #059669);
    --stat-gradient-3: linear-gradient(135deg, #FB923C, #EA580C);
    --stat-gradient-4: linear-gradient(135deg, #818CF8, #6366F1);
}

/* ============================================================
   BASE & TYPOGRAPHY
   ============================================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F1F5F9;
    color: #0F172A;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--sidebar-gradient);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 50%, #8B5CF6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: #FFFFFF;
}

.sidebar-brand-text small {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94A3B8;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 0.85rem 0;
}

.sidebar-section-label {
    padding: 0.75rem 1.25rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 1.25rem;
    margin: 0.2rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: #fff;
    background: var(--sidebar-active-bg, linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 100%));
    border-color: var(--sidebar-active-border, rgba(139, 92, 246, 0.4));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

.sidebar-link .sidebar-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-link:hover .sidebar-icon-box {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.sidebar-link.active .sidebar-icon-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.6) 100%);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .sidebar-link {
    margin: 0;
    padding: 0.5rem 0.5rem;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */

.top-navbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 68px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-search {
    position: relative;
    flex: 0 1 450px;
}

.navbar-search input {
    width: 100%;
    padding: 0.65rem 1.25rem 0.65rem 2.8rem;
    border: 1px solid #E2E8F0;
    border-radius: 999px;
    background: #F8FAFC;
    font-size: 0.875rem;
    font-family: inherit;
    color: #0F172A;
    transition: all 0.2s ease;
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}

.navbar-search svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: #94A3B8;
    fill: none;
    stroke-width: 2;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.navbar-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.navbar-icon-btn:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-1px);
}

.navbar-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: #64748B;
    fill: none;
    stroke-width: 1.8;
}

.navbar-icon-btn:hover svg {
    stroke: var(--primary);
}

.badge-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.navbar-divider {
    width: 1px;
    height: 32px;
    background: #E2E8F0;
    margin: 0 0.5rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.navbar-user:hover {
    background: #F1F5F9;
}

.navbar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--btn-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
    overflow: hidden;
}

.navbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-user-info {
    text-align: left;
}

.navbar-user-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}

.navbar-user-role {
    font-size: 0.6875rem;
    color: #94A3B8;
    font-weight: 500;
}

.navbar-user-chevron {
    width: 16px;
    height: 16px;
    stroke: #94A3B8;
    fill: none;
    stroke-width: 2;
    margin-left: 2px;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.12), 0 8px 12px -6px rgba(0,0,0,0.08);
    padding: 0.6rem;
    display: none;
    z-index: 1001;
    animation: dropdownIn 0.2s ease;
}

.user-dropdown.open {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    stroke: #64748B;
    fill: none;
    stroke-width: 1.8;
}

.dropdown-item.danger {
    color: #DC2626;
}

.dropdown-item.danger svg {
    stroke: #DC2626;
}

.dropdown-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 0.4rem 0;
}

/* Theme Picker */
.theme-picker,
.theme-picker-direct {
    padding: 0.65rem 0.85rem;
    display: block;
}

.theme-picker-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-swatches {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.theme-swatch {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-swatch:hover {
    transform: scale(1.15);
}

.theme-swatch.active {
    border-color: #0F172A;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0F172A;
}

.theme-swatch[data-theme="edusphere"]{ background: linear-gradient(135deg, #06B6D4, #6366F1, #A855F7); }
.theme-swatch[data-theme="indigo"]   { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.theme-swatch[data-theme="emerald"]  { background: linear-gradient(135deg, #059669, #0D9488); }
.theme-swatch[data-theme="rose"]     { background: linear-gradient(135deg, #E11D48, #DB2777); }
.theme-swatch[data-theme="amber"]    { background: linear-gradient(135deg, #D97706, #EA580C); }
.theme-swatch[data-theme="cyan"]     { background: linear-gradient(135deg, #0891B2, #0284C7); }
.theme-swatch[data-theme="slate"]    { background: linear-gradient(135deg, #475569, #64748B); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.main-content {
    margin-left: 260px;
    padding-top: 68px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-wrapper {
    padding: 1.75rem 2rem;
    max-width: 1400px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748B;
    margin-top: 0.2rem;
}

/* ============================================================
   CARDS & GLOWING STAT CARDS
   ============================================================ */

.card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

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

.card-body {
    padding: 1.75rem;
}

.card-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.01em;
}

/* Ambient Glowing Stat Cards (Matching Mockup Design) */
.stat-card {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 22px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
}

/* Ambient Glow Shadows */
.stat-card.glow-blue {
    box-shadow: 0 18px 40px -12px rgba(59, 130, 246, 0.25), 0 4px 15px -3px rgba(99, 102, 241, 0.12);
}
.stat-card.glow-blue:hover {
    box-shadow: 0 24px 50px -10px rgba(59, 130, 246, 0.35), 0 8px 20px -3px rgba(99, 102, 241, 0.18);
}

.stat-card.glow-mint {
    box-shadow: 0 18px 40px -12px rgba(16, 185, 129, 0.25), 0 4px 15px -3px rgba(5, 150, 105, 0.12);
}
.stat-card.glow-mint:hover {
    box-shadow: 0 24px 50px -10px rgba(16, 185, 129, 0.35), 0 8px 20px -3px rgba(5, 150, 105, 0.18);
}

.stat-card.glow-amber {
    box-shadow: 0 18px 40px -12px rgba(249, 115, 22, 0.25), 0 4px 15px -3px rgba(217, 119, 6, 0.12);
}
.stat-card.glow-amber:hover {
    box-shadow: 0 24px 50px -10px rgba(249, 115, 22, 0.35), 0 8px 20px -3px rgba(217, 119, 6, 0.18);
}

.stat-card.glow-cyan {
    box-shadow: 0 18px 40px -12px rgba(6, 182, 212, 0.25), 0 4px 15px -3px rgba(14, 165, 233, 0.12);
}
.stat-card.glow-cyan:hover {
    box-shadow: 0 24px 50px -10px rgba(6, 182, 212, 0.35), 0 8px 20px -3px rgba(14, 165, 233, 0.18);
}

.stat-card.glow-rose {
    box-shadow: 0 18px 40px -12px rgba(239, 68, 68, 0.25), 0 4px 15px -3px rgba(225, 29, 72, 0.12);
}
.stat-card.glow-rose:hover {
    box-shadow: 0 24px 50px -10px rgba(239, 68, 68, 0.35), 0 8px 20px -3px rgba(225, 29, 72, 0.18);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.stat-icon svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-icon-blue { background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%); }
.stat-icon-mint { background: linear-gradient(135deg, #34D399 0%, #059669 100%); }
.stat-icon-amber{ background: linear-gradient(135deg, #FBBF24 0%, #F97316 100%); }
.stat-icon-cyan { background: linear-gradient(135deg, #38BDF8 0%, #06B6D4 100%); }
.stat-icon-rose { background: linear-gradient(135deg, #FB7185 0%, #E11D48 100%); }

.stat-content {
    width: 100%;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8125rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.trend-up {
    color: #10B981;
}

.trend-down {
    color: #EF4444;
}

/* ============================================================
   REVENUE OVERVIEW CHART & RECENT ACTIVITIES
   ============================================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.timeframe-select {
    padding: 0.45rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #F8FAFC;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.timeframe-select:hover,
.timeframe-select:focus {
    border-color: var(--primary);
    background: #fff;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 240px;
    margin-top: 0.5rem;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Recent Activities List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    transition: transform 0.15s ease;
}

.activity-item:hover {
    transform: translateX(4px);
}

.activity-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.activity-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon-wrap.icon-blue {
    background: #EEF2FF;
    color: #4F46E5;
}
.activity-icon-wrap.icon-amber {
    background: #FFFBEB;
    color: #D97706;
}
.activity-icon-wrap.icon-mint {
    background: #ECFDF5;
    color: #059669;
}

.activity-icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.activity-info {
    display: flex;
    flex-direction: column;
}

.activity-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}

.activity-date {
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
    margin-top: 2px;
}

/* Overlapping Avatar Stack */
.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    margin-left: -10px;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, z-index 0.2s ease;
}

.avatar-stack-item:hover {
    transform: scale(1.2);
    z-index: 10;
}

.avatar-stack-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-stack-item:first-child {
    margin-left: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    line-height: 1.4;
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-primary {
    background: var(--btn-gradient);
    color: #fff;
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    filter: brightness(1.05);
}

.btn-secondary {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    border-radius: 8px;
}

.btn-sm svg {
    width: 15px;
    height: 15px;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #F8FAFC;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    border-bottom: 1px solid #E2E8F0;
    text-align: left;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

.data-table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    color: #334155;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES / STATUS PILLS
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active,
.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-inactive,
.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-frozen {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-pending {
    background: #FEF9C3;
    color: #854D0E;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    color: #fff;
    background: var(--btn-gradient);
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
    border-radius: 8px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.125rem;
    border-radius: 14px;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #0F172A;
    background: #fff;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-control::placeholder {
    color: #94A3B8;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.3rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: alertIn 0.3s ease;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: var(--primary-50);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 1.5;
}

.empty-state h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: #94A3B8;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* ============================================================
   ANIMATIONS & TRANSITIONS
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: 0.05s; }
.animate-in:nth-child(3) { animation-delay: 0.1s; }
.animate-in:nth-child(4) { animation-delay: 0.15s; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
}

.login-brand {
    flex: 1;
    background: var(--sidebar-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    padding: 3rem;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    border-radius: 50%;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-brand-logo svg {
    width: 44px;
    height: 44px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.5;
}

.login-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.login-brand p {
    font-size: 1.0625rem;
    opacity: 0.7;
    max-width: 320px;
    line-height: 1.6;
}

/* Floating shapes */
.login-shapes span {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    animation: float 8s ease-in-out infinite;
}

.login-shapes span:nth-child(1) {
    width: 60px; height: 60px;
    top: 15%; left: 10%;
    animation-delay: 0s;
}

.login-shapes span:nth-child(2) {
    width: 40px; height: 40px;
    top: 70%; right: 15%;
    animation-delay: 2s;
}

.login-shapes span:nth-child(3) {
    width: 80px; height: 80px;
    bottom: 20%; left: 25%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(6deg); }
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #fff;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-form-wrapper h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.login-form-wrapper p {
    color: #64748B;
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.login-form-wrapper .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9375rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #94A3B8;
    fill: none;
    stroke-width: 2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    stroke: #64748B;
    fill: none;
    stroke-width: 2;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .top-navbar {
        left: 0;
    }

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

    .sidebar-toggle {
        display: flex;
    }

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

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .login-page {
        flex-direction: column;
    }

    .login-brand {
        min-height: 200px;
        padding: 2rem;
    }

    .login-brand h1 {
        font-size: 1.5rem;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-muted { color: #64748B; }
.text-primary { color: var(--primary); }
.text-success { color: #059669; }
.text-danger { color: #DC2626; }
.text-warning { color: #D97706; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ============================================================
   ATTENDANCE ROLL CALL COMPONENTS
   ============================================================ */

.att-btn-group {
    display: inline-flex;
    background: #F1F5F9;
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
}

.att-btn {
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 4px;
}

.att-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #0F172A;
}

.att-btn.active.att-p {
    background: #10B981;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.att-btn.active.att-a {
    background: #EF4444;
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.att-btn.active.att-l {
    background: #F59E0B;
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.att-btn.active.att-e {
    background: #3B82F6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* ============================================================
   LEVELS & BELTS HIERARCHY
   ============================================================ */

.level-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* ============================================================
   MEMBER 360° PROFILE
   ============================================================ */

.profile-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 20px;
    padding: 2rem;
    color: #fff;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.profile-hero::after {
    content: '';
    position: absolute;
    right: -10%;
    top: -30%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.profile-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.profile-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.profile-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-tag {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #E2E8F0;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 1.5rem;
}

.nav-tab-btn {
    border: none;
    background: transparent;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

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

.nav-tab-btn.active {
    color: var(--primary);
}

.nav-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #E2E8F0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.timeline-content {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0F172A;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94A3B8;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: #0F172A;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #F8FAFC;
}

