/**
 * ==============================================================================
 * EduMi Core Common CSS Bundle (common.bundle.css)
 * ==============================================================================
 * Foundational shell stylesheet delivered to all authenticated users.
 * Modules included:
 *   1. Design System Tokens & Color Variables
 *   2. Responsive Breakpoint Rules & Grid System
 *   3. Modern Base Design (Typography, Inputs, Buttons)
 *   4. Application Shell Navigation & Sidebar
 *   5. Base Viewport & Content Containers
 *   6. Toast Notifications & System Alerts
 *   7. Universal Classroom Card Foundation
 *   8. Attendance UI Base
 * ==============================================================================
 */

/* --- Module: design_tokens.css --- */
/* static/css/design_tokens.css - Centralized Design System Tokens with Responsive System */

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BASE - Mobile First Approach
   ══════════════════════════════════════════════════════════════ */
:root {
    /* ── Typography & Weights ── */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* ── Typography Scale (Mobile Base) ── */
    --font-size-xs: 0.6875rem;  /* 11px */
    --font-size-sm: 0.8125rem;  /* 13px */
    --font-size-md: 0.875rem;   /* 14px */
    --font-size-lg: 0.9375rem;  /* 15px */
    --font-size-xl: 1.125rem;   /* 18px */
    --font-size-2xl: 1.375rem;  /* 22px */
    --font-size-3xl: 1.625rem;  /* 26px */

    /* ── Spacing Scale (Mobile Base) ── */
    --space-2xs: 0.25rem;  /* 4px */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 0.625rem;  /* 10px */
    --space-md: 0.875rem;  /* 14px */
    --space-lg: 1.25rem;   /* 20px */
    --space-xl: 1.75rem;   /* 28px */
    --space-2xl: 2.25rem;  /* 36px */

    /* ── Layout & Component Dimensions ── */
    --container-max-width: 100%;
    --container-padding: 1rem;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 56px;
    
    --btn-height-sm: 32px;
    --btn-height-md: 38px;
    --btn-height-lg: 44px;
    --input-height-md: 38px;

    /* ── Border Radius Scale ── */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-full: 9999px;

    /* ── Colors (Light Mode Default - Violet Brand) ── */
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-primary-light: #a78bfa;
    --color-primary-bg: rgba(124, 58, 237, 0.09);

    --color-secondary: #8b5cf6;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-warning: #f59e0b;
    --color-info: #06b6d4;

    --color-bg-app: #f8fafc;
    --color-bg-subtle: #f8fafc;
    --color-bg-card: #ffffff;
    --color-surface: #ffffff;
    --color-bg-hover: #f1f5f9;
    --color-border: #e2e8f0;

    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;

    /* ── Elevation & Shadows ── */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ══════════════════════════════════════════════════════════════
   TABLET BREAKPOINT - 768px and above
   ══════════════════════════════════════════════════════════════ */
@media screen and (min-width: 768px) {
    :root {
        --font-size-xs: 0.75rem;    /* 12px */
        --font-size-sm: 0.8125rem;  /* 13px */
        --font-size-md: 0.875rem;   /* 14px */
        --font-size-lg: 1rem;       /* 16px */
        --font-size-xl: 1.125rem;   /* 18px */
        --font-size-2xl: 1.375rem;  /* 22px */
        --font-size-3xl: 1.625rem;  /* 26px */

        --space-sm: 0.75rem;   /* 12px */
        --space-md: 1rem;      /* 16px */
        --space-lg: 1.5rem;    /* 24px */
        --space-xl: 2rem;      /* 32px */
        --space-2xl: 2.5rem;   /* 40px */

        --container-padding: 1.5rem;
        --topbar-height: 60px;
        --btn-height-sm: 34px;
        --btn-height-md: 40px;
        --btn-height-lg: 46px;
        --input-height-md: 40px;
    }
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP BREAKPOINT - 1024px and above
   ══════════════════════════════════════════════════════════════ */
@media screen and (min-width: 1024px) {
    :root {
        --font-size-xs: 0.75rem;    /* 12px */
        --font-size-sm: 0.8125rem;  /* 13px */
        --font-size-md: 0.9375rem;  /* 15px */
        --font-size-lg: 1rem;       /* 16px */
        --font-size-xl: 1.125rem;   /* 18px */
        --font-size-2xl: 1.5rem;    /* 24px */
        --font-size-3xl: 1.75rem;   /* 28px */

        --container-max-width: 1280px;
        --container-padding: 2rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   LARGE DESKTOP BREAKPOINT - 1440px and above
   ══════════════════════════════════════════════════════════════ */
@media screen and (min-width: 1440px) {
    :root {
        --font-size-xs: 0.75rem;    /* 12px */
        --font-size-sm: 0.84375rem; /* 13.5px */
        --font-size-md: 0.9375rem;  /* 15px */
        --font-size-lg: 1.0625rem;  /* 17px */
        --font-size-xl: 1.25rem;    /* 20px */
        --font-size-2xl: 1.5rem;    /* 24px */
        --font-size-3xl: 1.875rem;  /* 30px */

        --container-max-width: 1360px;
    }
}

/* ══════════════════════════════════════════════════════════════
   XL DESKTOP BREAKPOINT - 1920px and above (Full HD)
   ══════════════════════════════════════════════════════════════ */
@media screen and (min-width: 1920px) {
    :root {
        --font-size-xs: 0.8125rem;  /* 13px */
        --font-size-sm: 0.875rem;   /* 14px */
        --font-size-md: 1rem;       /* 16px */
        --font-size-lg: 1.125rem;   /* 18px */
        --font-size-xl: 1.375rem;   /* 22px */
        --font-size-2xl: 1.75rem;   /* 28px */
        --font-size-3xl: 2.125rem;  /* 34px */

        --container-max-width: 1600px;
        --container-padding: 2.5rem;
        --topbar-height: 64px;
    }
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE TOKEN OVERRIDES
   ══════════════════════════════════════════════════════════════ */
body.dark-mode,
html.dark-mode {
    --color-bg-app: #0f172a;
    --color-bg-subtle: #0f172a;
    --color-bg-card: #1e293b;
    --color-surface: #1e293b;
    --color-surface-dark: #1e293b;
    --color-bg-hover: #334155;
    --color-border: #334155;
    --color-border-dark: #334155;

    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;

    --color-primary-bg: rgba(102, 126, 234, 0.18);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}


/* --- Module: responsive_global.css --- */
/* ══════════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL CSS - Mobile First Design System
   Apply this after design_tokens.css for complete responsive behavior
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   BASE RESET & FOUNDATION
   ══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-md);
    line-height: 1.6;
    color: var(--color-text-main);
    background: var(--color-bg-app);
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   CONTAINER SYSTEM - Responsive Widths
   ══════════════════════════════════════════════════════════════ */
.container,
.content-area {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY - Responsive Font Sizes
   ══════════════════════════════════════════════════════════════ */
h1, .h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--color-text-main);
}

h2, .h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    margin-bottom: var(--space-sm);
    color: var(--color-text-main);
}

h3, .h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    color: var(--color-text-main);
}

h4, .h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    color: var(--color-text-main);
}

p {
    font-size: var(--font-size-md);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    color: var(--color-text-main);
}

small, .text-sm {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.text-xs {
    font-size: var(--font-size-xs);
}

/* ══════════════════════════════════════════════════════════════
   BUTTON SYSTEM - Responsive Sizes
   ══════════════════════════════════════════════════════════════ */
.btn,
button[class*="btn-"],
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
    height: var(--btn-height-md);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn-sm {
    height: var(--btn-height-sm);
    padding: 0 var(--space-sm);
    font-size: var(--font-size-sm);
}

.btn-lg {
    height: var(--btn-height-lg);
    padding: 0 var(--space-lg);
    font-size: var(--font-size-lg);
}

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

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

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

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

/* Mobile Touch Targets */
@media screen and (max-width: 767px) {
    .btn,
    button[class*="btn-"] {
        min-height: 44px; /* iOS touch target guideline */
        height: auto;
        padding: var(--space-sm) var(--space-md);
    }
}

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS - Responsive Inputs
   ══════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    height: var(--input-height-md);
    padding: 0 var(--space-md);
    font-size: var(--font-size-md);
    font-family: var(--font-family-base);
    color: var(--color-text-main);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

textarea {
    height: auto;
    min-height: 100px;
    padding: var(--space-sm) var(--space-md);
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* Mobile Input Improvements */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
}

/* ══════════════════════════════════════════════════════════════
   CARD SYSTEM - Responsive Cards
   ══════════════════════════════════════════════════════════════ */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg));
}

@media screen and (max-width: 767px) {
    .card {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }
    
    .card-header,
    .card-footer {
        padding: var(--space-sm) var(--space-md);
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
    }
}

/* ══════════════════════════════════════════════════════════════
   GRID SYSTEM - Responsive Grids
   ══════════════════════════════════════════════════════════════ */
.grid {
    display: grid;
    gap: var(--space-lg);
}

/* Mobile: 1 column */
.grid-cols-1 {
    grid-template-columns: 1fr;
}

/* Tablet and up: responsive columns */
@media screen and (min-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop: more columns */
@media screen and (min-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Auto-fit grid for flexible layouts */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

@media screen and (min-width: 768px) {
    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Dashboard-specific grids (legacy support) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-lg);
}

@media screen and (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--space-md);
}

@media screen and (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media screen and (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ══════════════════════════════════════════════════════════════
   STAT CARDS - Dashboard Statistics
   ══════════════════════════════════════════════════════════════ */
.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 4px;
}

@media screen and (max-width: 767px) {
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-number {
        font-size: var(--font-size-xl);
    }
}

/* ══════════════════════════════════════════════════════════════
   TABLE SYSTEM - Responsive Tables
   ══════════════════════════════════════════════════════════════ */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

thead {
    background: var(--color-bg-hover);
    border-bottom: 2px solid var(--color-border);
}

thead th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--color-bg-hover);
}

tbody td {
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-main);
}

@media screen and (max-width: 767px) {
    table {
        font-size: var(--font-size-xs);
    }
    
    thead th,
    tbody td {
        padding: var(--space-xs) var(--space-sm);
    }
}

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES - Spacing & Layout
   ══════════════════════════════════════════════════════════════ */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Responsive display utilities */
@media screen and (max-width: 767px) {
    .mobile-hidden { display: none !important; }
}

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

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .tablet-hidden { display: none !important; }
}

@media screen and (min-width: 1024px) {
    .desktop-hidden { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER - Responsive Header Section
   ══════════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-lg) 0;
}

.page-header h1 {
    margin: 0;
}

@media screen and (max-width: 767px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        padding: var(--space-md) 0;
    }
    
    .page-header .btn {
        width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE IMAGES & MEDIA
   ══════════════════════════════════════════════════════════════ */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-fluid {
    width: 100%;
    height: auto;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

/* ══════════════════════════════════════════════════════════════
   BADGE SYSTEM
   ══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.badge-primary {
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* ══════════════════════════════════════════════════════════════
   ALERT SYSTEM
   ══════════════════════════════════════════════════════════════ */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-sm);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-success);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--color-info);
    color: var(--color-info);
}

/* ══════════════════════════════════════════════════════════════
   LOADING & SKELETON STATES
   ══════════════════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-hover) 25%,
        var(--color-border) 50%,
        var(--color-bg-hover) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-card {
    height: 200px;
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR CUSTOMIZATION
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════════════
   UNIVERSAL MULTI-DEVICE RESPONSIVE SUITE (MOBILE / TABLET / LAPTOP)
   ══════════════════════════════════════════════════════════════ */

/* Universal Media & Viewport Scaling */
img, video, canvas, iframe, embed, object {
    max-width: 100% !important;
    height: auto;
}

/* Universal Table Wrapper Touch Scrolling */
.admin-table-wrapper,
.table-wrapper,
.table-responsive,
.table-container {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Tablet & Mobile Layout Adjustments (max-width: 992px) */
@media screen and (max-width: 992px) {
    .admin-container,
    .admin-page-container,
    .content-area {
        padding-left: clamp(0.75rem, 3vw, 1.25rem) !important;
        padding-right: clamp(0.75rem, 3vw, 1.25rem) !important;
    }

    .admin-header,
    .profile-hero,
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .admin-header-actions,
    .profile-hero-content,
    .btn-action-group {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .kpi-grid,
    .stat-mini-grid,
    .admin-stats-grid,
    .classroom-grid,
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)) !important;
    }
}

/* Mobile Screen Adjustments (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 0.9rem !important;
    }

    h1, .h1 {
        font-size: 1.5rem !important;
    }

    h2, .h2 {
        font-size: 1.25rem !important;
    }

    .admin-card {
        margin-bottom: 1.25rem !important;
        border-radius: 0.75rem !important;
    }

    .admin-card-header {
        padding: 1rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .admin-card-body,
    .tab-panel {
        padding: 1rem !important;
    }

    .btn-action,
    .btn-primary,
    .btn-secondary {
        min-height: 38px !important;
        font-size: 0.82rem !important;
        padding: 0.4rem 0.85rem !important;
    }

    .admin-modal-content,
    .modal-dialog {
        width: 95vw !important;
        max-width: 540px !important;
        margin: 0.5rem auto !important;
    }

    .tab-nav {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        gap: 0.25rem !important;
    }

    .tab-btn {
        padding: 0.6rem 0.85rem !important;
        font-size: 0.8rem !important;
    }

    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
}

/* --------------------------------------------------------------
   GLOBAL RESPONSIVE UTILITIES & TABLE CONTAINER WRAPPERS
   -------------------------------------------------------------- */
.table-responsive,
.data-table-wrapper,
.admin-table-container,
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    border-radius: var(--radius-md, 8px);
    margin-bottom: var(--space-md, 1rem);
    position: relative;
}

/* Touch targets & Mobile input fluidity */
@media (pointer: coarse) {
    button,
    .btn,
    .btn-action,
    .topbar-icon-btn,
    .mobile-menu-btn,
    .nav-item,
    .tab-btn,
    input[type="button"],
    input[type="submit"] {
        min-height: 42px;
    }
}

/* Fluid responsive media & images */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Modal and dialog responsiveness */
.modal,
.modal-dialog,
.admin-modal-content {
    box-sizing: border-box;
}

/* Small Smartphone Screen Adjustments (max-width: 480px) */
@media screen and (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
    }

    .container,
    .content-area {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .kpi-grid,
    .stat-mini-grid,
    .admin-stats-grid,
    .classroom-grid,
    .card-grid {
        grid-template-columns: 1fr !important;
    }

    .btn-action,
    .btn-primary,
    .btn-action-primary,
    .btn-action-secondary {
        width: 100% !important;
        justify-content: center !important;
    }

    .status-pill,
    .role-badge {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    .modal-dialog {
        width: calc(100vw - 1rem) !important;
        max-width: 100% !important;
        margin: 0.5rem auto !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════════ */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .sidebar,
    .topbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   UNIVERSAL APPLICATION BREADCRUMBS
   ══════════════════════════════════════════════════════════════ */
.app-breadcrumbs {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md, 1rem);
    font-size: var(--font-size-xs, 0.8125rem);
    color: var(--color-text-muted, #64748b);
    line-height: 1.4;
}

.app-breadcrumbs-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.app-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text-muted, #64748b);
    text-decoration: none;
    font-weight: var(--font-weight-medium, 500);
    transition: color 0.15s ease;
}

.app-breadcrumb-link:hover {
    color: var(--color-primary, #7c3aed);
}

.app-breadcrumb-icon {
    width: 14px;
    height: 14px;
    opacity: 0.75;
}

.app-breadcrumb-sep {
    width: 13px;
    height: 13px;
    opacity: 0.45;
    color: var(--color-text-muted, #94a3b8);
}

.app-breadcrumb-current {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text-main, #0f172a);
    font-weight: var(--font-weight-semibold, 600);
}

body.dark-mode .app-breadcrumb-current {
    color: #f8fafc;
}

body.dark-mode .app-breadcrumb-link {
    color: #94a3b8;
}

body.dark-mode .app-breadcrumb-link:hover {
    color: var(--color-primary-light, #a78bfa);
}


/* --- Module: modern_design.css --- */
/* Modern Professional Design System */
@import url('design_tokens.css');

:root {
    --primary: var(--color-primary);
    --primary-dark: var(--color-primary-hover);
    --success: var(--color-success);
    --danger: var(--color-danger);
    --warning: var(--color-warning);
    --info: var(--color-info);
    --gray-50: var(--color-bg-app);
    --gray-100: var(--color-bg-hover);
    --gray-200: var(--color-border);
    --gray-300: #d1d5db;
    --gray-500: var(--color-text-muted);
    --gray-700: #374151;
    --gray-900: var(--color-text-main);
    --radius: var(--radius-md);
    --shadow: var(--shadow-sm);
    --shadow-lg: var(--shadow-md);
    --bg-main: var(--color-bg-app);
    --bg-card: var(--color-bg-card);
    --text-main: var(--color-text-main);
    --text-muted: var(--color-text-muted);
    --border-color: var(--color-border);
    --sidebar-bg: var(--color-bg-card);
    --topbar-bg: var(--color-bg-card);
    --input-bg: var(--color-bg-card);
    --hover-bg: var(--color-bg-hover);
    --notification-unread-bg: var(--color-primary-bg);
    --notification-header-bg: var(--color-bg-app);
}

body.dark-mode {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-500: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-900: #f1f5f9;
    --sidebar-bg: #1e293b;
    --topbar-bg: #1e293b;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --input-bg: #0f172a;
    --hover-bg: #334155;
    --notification-unread-bg: #2d2a4a;
    --notification-header-bg: #162032;
}

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

/* Suppress browser native password reveal/clear buttons (Edge, IE, Safari) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(13px, 1vw, 16px);
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-main);
}

/* Container */
.dashboard-container,
.admin-container {
    max-width: 100%;
    margin: 0;
    padding: 12px;
}

/* Headers */
.dashboard-header,
.admin-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: clamp(12px, 2vw, 20px) clamp(16px, 3vw, 24px);
    margin-bottom: clamp(12px, 2vw, 20px);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: 12px;
}

.dashboard-header h1,
.admin-header h1 {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.dashboard-header p {
    font-size: clamp(12px, 1.5vw, 14px);
    color: var(--gray-500);
    margin: 2px 0 0 0;
}

/* Stat Cards - Updated to use responsive tokens */
.stat-card {
    background: var(--bg-card, var(--color-bg-card));
    border-radius: var(--radius, var(--radius-md));
    padding: var(--space-md);
    border: 1px solid var(--border-color, var(--color-border));
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.stat-info h3 {
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    color: var(--gray-900);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* Sections */
.quick-actions,
.admin-section,
.content-section {
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.quick-actions h2,
.admin-section h2,
.content-section h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 12vw, 160px), 1fr));
    gap: clamp(8px, 1.5vw, 16px);
}

.action-btn {
    padding: 14px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}

.action-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.action-btn p {
    color: var(--text-main);
    font-weight: 600;
    font-size: 12px;
    margin: 0;
}

/* Tables */
.data-table,
.users-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead,
.users-table thead {
    background: var(--gray-50);
}

.data-table th,
.users-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td,
.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tbody tr:hover,
.users-table tbody tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-teacher {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-student {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-live {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-ended {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-scheduled {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Buttons */
/* Icons */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    vertical-align: middle;
}

.sidebar-nav-icon .icon {
    width: 20px;
    height: 20px;
}

/* Redundant removal - consolidating "double double" */
.btn-primary, .button-main {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-add-camera:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Detail Sections */
.detail-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--primary);
    color: white;
}

.section-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.table-container {
    padding: 16px;
    overflow-x: auto;
}

/* Meeting Cards */
.meetings-list {
    display: grid;
    gap: 10px;
}

.meeting-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.meeting-card:hover {
    box-shadow: var(--shadow-lg);
}

.meeting-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.meeting-header-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.meeting-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.detail-item-small {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item-small .icon {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-item-small .icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--gray-700);
}

.detail-item-small .label {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item-small .value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.detail-item-small .value.code {
    font-family: monospace;
    font-size: 12px;
}

/* Responsive Design Improvements */

/* Medium Screens / Tablets (iPad sized) */
@media (max-width: 1024px) {
    /* Tablet-specific overrides can go here */
}

/* Mobile Screens */
@media (max-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .meeting-details-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Large Screens / TV (2560px and up) */
@media (min-width: 2000px) {
    :root {
        --radius: 12px;
    }

    .dashboard-container,
    .admin-container {
        max-width: 2200px;
        margin: 0 auto;
        padding: 40px;
    }

    .stat-card {
        padding: 30px;
        gap: 24px;
    }

    .shapes-illustration {
        display: none !important;
        /* Hide decorative shapes on tablet/mobile to save space */
    }

    .stat-icon {
        width: 60px;
        height: 60px;
    }

    .stat-icon svg {
        width: 32px;
        height: 32px;
    }

    .stat-number {
        font-size: 36px;
    }

    .action-btn {
        padding: 30px 20px;
    }

    .action-btn svg {
        width: 40px;
        height: 40px;
    }
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Avatar */
.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Completion Banner */
.completion-banner {
    background: var(--primary);
    color: white;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
}

.completion-info h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 700;
}

.completion-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 12px;
}

.completion-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    font-size: 13px;
    min-width: 35px;
}

.btn-complete {
    background: white;
    color: var(--primary);
    padding: 7px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    transition: transform 0.2s;
}

.btn-complete:hover {
    transform: translateY(-1px);
}

/* ── Centralized Shared Components ── */
.stat-card-component {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card-component:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.stat-card-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-size-lg);
}

.stat-card-icon-box svg {
    width: 22px;
    height: 22px;
}

.stat-card-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.stat-card-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-main);
    margin: 0;
    line-height: 1;
}

/* Shared Hero Banner Component */
.hero-banner-component {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    color: var(--color-text-inverse);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.hero-banner-category {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: var(--space-2xs);
}

.hero-banner-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--space-xs) 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #ffffff !important;
}

.hero-banner-subtitle {
    font-size: var(--font-size-md);
    opacity: 0.88;
    margin: 0;
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.9) !important;
}

.hero-banner-btn {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: 0 var(--space-lg);
    height: var(--btn-height-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    border: none;
}

.hero-banner-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    color: var(--color-text-inverse);
}

/* ══════════════════════════════════════════════════════════════
   HOME DASHBOARD PREMIUM STYLING
   ══════════════════════════════════════════════════════════════ */
.dashboard-welcome-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--container-padding);
}

.welcome-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    color: var(--color-text-inverse);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome-hero::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-hero h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
    color: white;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    max-width: fit-content;
}

.user-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.user-details h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    margin: 0 0 var(--space-2xs) 0;
}

.user-details .badge {
    padding: 4px 10px;
    font-weight: 600;
    font-size: var(--font-size-xs);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-decoration: none;
    color: var(--color-text-main);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: var(--space-xs);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.feature-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0 0 2px 0;
}

.feature-card p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}


/* --- Module: sidebar.css --- */
/* Modern Sidebar Navigation - Fully Responsive */

html {
    scrollbar-gutter: stable;
}

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
}

/* Mobile override */
@media screen and (max-width: 767px) {
    :root {
        --sidebar-width: 280px;
    }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT CONTAINER
   ══════════════════════════════════════════════════════════════ */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR - STABLE LAYOUT PREVENTION
   ══════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg, var(--color-bg-card));
    border-right: 1px solid var(--border-color, var(--color-border));
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Prevent layout shift during content changes */
    contain: layout style;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

/* Dark mode scrollbar */
body.dark-mode .sidebar::-webkit-scrollbar-thumb {
    background: #334155;
}

body.dark-mode .sidebar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

body.dark-mode .sidebar::-webkit-scrollbar-track {
    background: #0f172a;
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR LOGO
   ══════════════════════════════════════════════════════════════ */
.topbar-logo {
    display: flex;
    align-items: center;
    color: var(--text-main, var(--color-text-main));
}

.topbar-logo img {
    height: 32px;
    width: auto;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION - STABLE LAYOUT
   ══════════════════════════════════════════════════════════════ */
.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-xs);
    overflow-y: auto;
}

.sidebar-nav-section {
    margin-bottom: 1.25rem;
}

.sidebar-nav-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.85rem;
    margin-bottom: 0.4rem;
    white-space: nowrap;
}
body.dark-mode .sidebar-nav-title {
    color: #94a3b8;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.85rem;
    margin: 3px 8px;
    border-radius: var(--radius-lg, 0.5rem);
    text-decoration: none;
    color: var(--color-text-secondary, #475569);
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 40px;
}
body.dark-mode .sidebar-nav-item {
    color: #cbd5e1;
}

.sidebar-nav-item:hover {
    background: var(--color-primary-bg, rgba(124, 58, 237, 0.08)) !important;
    color: var(--color-primary, #7c3aed) !important;
    transform: translateX(2px);
}

.sidebar-nav-item:hover .sidebar-nav-icon,
.sidebar-nav-item:hover .sidebar-nav-text,
.sidebar-nav-item:hover .sidebar-nav-icon svg {
    color: var(--color-primary, #7c3aed) !important;
    stroke: var(--color-primary, #7c3aed) !important;
}

.sidebar-nav-item.active {
    background: var(--color-primary-bg, rgba(124, 58, 237, 0.12)) !important;
    color: var(--color-primary, #7c3aed) !important;
    font-weight: 700;
}

.sidebar-nav-item.active .sidebar-nav-icon,
.sidebar-nav-item.active .sidebar-nav-text,
.sidebar-nav-item.active .sidebar-nav-icon svg {
    color: var(--color-primary, #7c3aed) !important;
    stroke: var(--color-primary, #7c3aed) !important;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--color-primary, #7c3aed);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.sidebar-nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.sidebar-nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    color: inherit;
}

.sidebar-nav-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR FOOTER
   ══════════════════════════════════════════════════════════════ */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color, var(--color-border));
}

.sidebar-footer-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted, var(--color-text-muted));
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    transition: all 0.2s;
}

.sidebar-footer-item:hover {
    background: var(--hover-bg, var(--color-bg-hover));
    color: var(--text-main, var(--color-text-main));
}

.sidebar-footer-item.logout {
    color: var(--color-danger);
}

.sidebar-footer-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg, var(--color-bg-card));
    border-bottom: 1px solid var(--border-color, var(--color-border));
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    gap: var(--space-md);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    flex: 1;
}

.topbar-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-main, var(--color-text-main));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--text-muted, var(--color-text-muted));
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* Command Palette Trigger Button (Ctrl+K) */
.topbar-cmd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: 320px;
    min-width: 260px;
    max-width: 420px;
    height: 38px;
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--border-color, var(--color-border, #e2e8f0));
    border-radius: var(--radius-lg, 0.625rem);
    padding: 0.45rem 1rem 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    outline: none;
    line-height: 1;
}

.topbar-cmd-btn:hover {
    background: var(--color-bg-hover, #f8fafc);
    border-color: var(--color-primary, #8b5cf6);
    color: var(--color-text-main, #0f172a);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

.topbar-cmd-btn:active {
    transform: translateY(0);
}

.topbar-cmd-btn .cmd-btn-text {
    font-size: 0.8125rem;
    color: inherit;
    font-family: inherit;
}

.topbar-cmd-btn .cmd-kbd {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    background: var(--color-bg-hover, #f1f5f9);
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    line-height: 1;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

body.dark-mode .topbar-cmd-btn {
    background: #111111;
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

body.dark-mode .topbar-cmd-btn:hover {
    background: #1a1a1a;
    border-color: var(--color-primary, #8b5cf6);
    color: #f8fafc;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}

body.dark-mode .topbar-cmd-btn .cmd-kbd {
    background: #222222;
    border-color: #333333;
    color: #cbd5e1;
}

@media (max-width: 640px) {
    .topbar-cmd-btn .cmd-btn-text,
    .topbar-cmd-btn .cmd-kbd {
        display: none;
    }
    .topbar-cmd-btn {
        width: auto;
        min-width: unset;
        padding: 0.4rem;
        border-radius: var(--radius-md, 0.375rem);
    }
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 300px;
    max-width: 100%;
    padding: var(--space-xs) var(--space-sm) var(--space-xs) 36px;
    border: 1px solid var(--border-color, var(--color-border));
    background: var(--bg-card, var(--color-bg-card));
    color: var(--text-main, var(--color-text-main));
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: all 0.2s;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, var(--color-text-muted));
    pointer-events: none;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, var(--color-text-muted));
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: var(--hover-bg, var(--color-bg-hover));
    color: var(--text-main, var(--color-text-main));
}

.topbar-icon-btn .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
    border: 2px solid var(--topbar-bg, var(--color-bg-card));
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--color-danger);
    color: var(--color-text-inverse);
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--topbar-bg, var(--color-bg-card));
    box-shadow: var(--shadow-sm);
}

.notification-btn {
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION DROPDOWN
   ══════════════════════════════════════════════════════════════ */
.notification-wrapper {
    position: relative;
}

.topbar-user-wrapper {
    position: relative;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-lg, 0.75rem);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid transparent;
}

.topbar-user:hover,
.topbar-user-wrapper.active .topbar-user {
    background: var(--hover-bg, var(--color-bg-hover));
    border-color: var(--color-border);
}

.topbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--color-primary);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.2);
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
}

.topbar-user-name {
    font-size: var(--font-size-sm, 13px);
    font-weight: var(--font-weight-bold, 700);
    color: var(--text-main, var(--color-text-main));
    white-space: nowrap;
    line-height: 1.2;
}

.topbar-user-role {
    font-size: var(--font-size-xs, 11px);
    color: var(--text-muted, var(--color-text-muted));
    white-space: nowrap;
}

.topbar-user-chevron {
    color: var(--color-text-muted);
    transition: transform 0.25s ease;
    margin-left: 0.15rem;
}

.topbar-user-wrapper.active .topbar-user-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* User Profile Dropdown Floating Menu */
.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: var(--bg-card, var(--color-bg-card, #ffffff));
    border: 1px solid var(--border-color, var(--color-border, #e2e8f0));
    border-radius: var(--radius-xl, 0.85rem);
    box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.15), 0 6px 12px -2px rgba(15, 23, 42, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
    padding: 0.45rem;
    overflow: hidden;
}

body.dark-mode .topbar-user-dropdown {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
}

.topbar-user-wrapper.active .topbar-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.topbar-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-main, #1e293b);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

body.dark-mode .topbar-user-dropdown-item {
    color: #f1f5f9;
}

.topbar-user-dropdown-item i,
.topbar-user-dropdown-item svg {
    color: var(--color-text-muted, #64748b);
    transition: color 0.15s ease;
}

.topbar-user-dropdown-item:hover {
    background: var(--color-primary-bg, rgba(124, 58, 237, 0.08));
    color: var(--color-primary, #7c3aed);
}

.topbar-user-dropdown-item:hover i,
.topbar-user-dropdown-item:hover svg {
    color: var(--color-primary, #7c3aed);
}

.topbar-user-dropdown-divider {
    height: 1px;
    background: var(--color-border, #e2e8f0);
    margin: 0.4rem 0;
}

.topbar-user-dropdown-item.logout {
    color: var(--color-danger, #ef4444);
}

.topbar-user-dropdown-item.logout i,
.topbar-user-dropdown-item.logout svg {
    color: var(--color-danger, #ef4444);
}

.topbar-user-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--bg-card, var(--color-bg-card));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color, var(--color-border));
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: visible;
}

.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: var(--notification-header-bg, var(--color-bg-hover));
    transform: rotate(45deg);
    border-top: 1px solid var(--border-color, var(--color-border));
    border-left: 1px solid var(--border-color, var(--color-border));
    z-index: 1001;
}

.notification-dropdown.show {
    display: flex;
    animation: dropdownFade 0.2s ease-out;
}

.notification-dropdown-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color, var(--color-border));
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--notification-header-bg, var(--color-bg-hover));
    border-radius: 12px 12px 0 0;
    position: relative;
    z-index: 1002;
}

.notification-dropdown-header h3 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--text-main, var(--color-text-main));
    margin: 0;
}

.mark-all-read-btn {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: var(--font-weight-semibold);
}

.mark-all-read-btn:hover:not(:disabled):not(.disabled) {
    text-decoration: underline;
}

.mark-all-read-btn:disabled, .mark-all-read-btn.disabled {
    color: var(--text-muted, var(--color-text-muted));
    cursor: not-allowed;
    text-decoration: none;
    opacity: 0.5;
}

.notification-dropdown-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-loading,
.notification-empty,
.notification-error {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted, var(--color-text-muted));
    font-size: var(--font-size-sm);
}

.notification-item {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color, var(--color-border));
    display: flex;
    gap: var(--space-sm);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: var(--hover-bg, var(--color-bg-hover));
}

.notification-item.unread {
    background: var(--notification-unread-bg, var(--color-primary-bg));
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-main, var(--color-text-main));
    margin: 0 0 2px 0;
}

.notification-item-message {
    font-size: var(--font-size-sm);
    color: var(--text-muted, var(--color-text-muted));
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted, var(--color-text-muted));
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    align-self: flex-start;
    margin-top: 4px;
    flex-shrink: 0;
}

.notification-dropdown-footer {
    padding: var(--space-md);
    text-align: center;
    border-top: 1px solid var(--border-color, var(--color-border));
    background: var(--bg-card, var(--color-bg-card));
    border-radius: 0 0 12px 12px;
}

.notification-dropdown-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    color: var(--color-primary);
    background: var(--color-primary-bg, rgba(99, 102, 241, 0.08));
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: all 0.2s ease;
}

.notification-dropdown-footer a:hover {
    background: var(--color-primary);
    color: white;
}

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

/* ══════════════════════════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════════════════════════ */
.content-area {
    flex: 1;
    padding: var(--space-lg);
    max-width: 100%;
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE OVERLAY
   ══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE MENU BUTTON
   ══════════════════════════════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted, var(--color-text-muted));
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet: 768px - 1023px ── */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar-nav-text,
    .sidebar-nav-title,
    .sidebar-nav-badge {
        display: none;
    }
    
    .sidebar-nav-item {
        justify-content: center;
        padding: var(--space-sm) 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .topbar-search input {
        width: 200px;
    }
}

/* ── Mobile: Below 768px ── */
@media screen and (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar {
        padding: 0 var(--space-md);
    }
    
    .topbar-search {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .topbar-title {
        font-size: var(--font-size-md);
    }
    
    .topbar-user-info {
        display: none;
    }
    
    .topbar-user {
        margin-left: 0;
        padding-left: var(--space-xs);
        border-left: none;
    }
    
    .topbar-icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .topbar-logo img {
        height: 28px;
    }
    
    .topbar-user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .content-area {
        padding: var(--space-md);
    }
    
    .sidebar-nav {
        padding: var(--space-sm) var(--space-xs);
    }
    
    .sidebar-footer {
        padding: var(--space-sm);
    }
    
    .notification-dropdown {
        position: fixed;
        top: var(--topbar-height);
        left: var(--space-sm);
        right: var(--space-sm);
        width: auto;
        max-height: 80vh;
    }
}

/* ── Small Mobile: Below 480px ── */
@media screen and (max-width: 480px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .topbar-title {
        font-size: var(--font-size-sm);
    }
    
    .topbar-icon-btn {
        width: 32px;
        height: 32px;
    }
    
    .topbar-logo img {
        height: 24px;
    }
    
    .topbar-user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .sidebar-nav-item {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-sm);
    }
    
    .sidebar-nav-icon svg {
        width: 18px;
        height: 18px;
    }
}



/* --- Module: base.css --- */
/* Base Styles & Variables */
@import url('design_tokens.css');

:root {
    /* Legacy color variables for backward compatibility */
    --primary: var(--color-primary, #7c3aed);
    --primary-dark: var(--color-primary-hover, #6d28d9);
    --primary-light: var(--color-primary-light, #a78bfa);
    --secondary: var(--color-secondary, #8b5cf6);
    --success: var(--color-success, #10b981);
    --danger: var(--color-danger, #ef4444);
    --warning: var(--color-warning, #f59e0b);
    --info: var(--color-info, #06b6d4);
    --dark: var(--color-text-main, #111827);
    --gray-50: var(--color-bg-app, #f9fafb);
    --gray-100: var(--color-bg-hover, #f3f4f6);
    --gray-200: var(--color-border, #e5e7eb);
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: var(--color-text-muted, #6b7280);
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: var(--color-text-main, #111827);
    --white: var(--color-bg-card, #ffffff);
    
    /* Legacy aliases */
    --text-main: var(--color-text-main);
    --text-muted: var(--color-text-muted);
    --bg-card: var(--color-bg-card);
    --bg-app: var(--color-bg-app);
    --hover-bg: var(--color-bg-hover);
    --border-color: var(--color-border);
    --sidebar-bg: var(--color-bg-card);
    --topbar-bg: var(--color-bg-card);
    --notification-header-bg: var(--color-bg-hover);
    --notification-unread-bg: var(--color-primary-bg);
    
    /* Legacy sizing */
    --radius-sm: 0.375rem;
    --radius: var(--radius-md);
    --radius-lg: 0.75rem;
    --shadow: var(--shadow-md);
}


/* ── Utility Classes (Legacy Support) ── */

/* Dark Mode */
body.dark-mode {
    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
    --dark: #f1f5f9;
    background: #0f172a;
    color: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL PAGE LAYOUT COMPONENTS
   Reusable structural components shared across all pages.
   Match the Meetings page design as the design reference.
   ═══════════════════════════════════════════════════════════ */

/* ── Page wrapper (consistent padding/max-width across all pages) ── */
.page-section {
    padding: clamp(1rem, 2vw, 1.5rem);
}

/* ── Universal page header bar (card strip with title + action button) ── */
.page-header-bar {
    background: var(--white);
    border-radius: clamp(10px, 1.5vw, 12px);
    padding: clamp(1rem, 2vw, 1.25rem) clamp(1.25rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(1rem, 2vh, 1.5rem);
    border: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 1.5vw, 1rem);
}

.page-header-bar h1 {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.2rem 0;
    line-height: 1.3;
}

.page-header-bar p {
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    color: var(--gray-500);
    margin: 0;
}

.page-header-bar .page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Shared primary action button (gradient, matches btn-schedule) ── */
.btn-page-action {
    padding: clamp(0.625rem, 1.2vh, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    border: none;
    border-radius: clamp(8px, 1.2vw, 10px);
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.375rem, 0.8vw, 0.5rem);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.btn-page-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
}

/* ── Shared secondary outline action button ── */
.btn-page-action-outline {
    padding: clamp(0.625rem, 1.2vh, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: clamp(8px, 1.2vw, 10px);
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.375rem, 0.8vw, 0.5rem);
    white-space: nowrap;
}

.btn-page-action-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — Global overrides for hardcoded inline styles
   and legacy templates that use static color values.
   ═══════════════════════════════════════════════════════════ */

/* Page background & base text */
body.dark-mode {
    background: #0f172a !important;
    color: #f1f5f9 !important;
}

/* Any element with a hardcoded white/near-white background */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background:#f9fafb"] {
    background: #1e293b !important;
}

/* Light error/success message backgrounds */
body.dark-mode [style*="background: #fee"],
body.dark-mode [style*="background:#fee"],
body.dark-mode [style*="background: #efe"],
body.dark-mode [style*="background:#efe"] {
    background: #1e293b !important;
}

/* Pending approval yellow banner */
body.dark-mode [style*="background: #fff3cd"],
body.dark-mode [style*="background:#fff3cd"] {
    background: #2d2a1a !important;
    border-color: #f59e0b !important;
}

/* Hardcoded dark text colors */
body.dark-mode [style*="color: #2c3e50"],
body.dark-mode [style*="color:#2c3e50"],
body.dark-mode [style*="color: #1a1a1a"],
body.dark-mode [style*="color:#1a1a1a"],
body.dark-mode [style*="color: #333"],
body.dark-mode [style*="color:#333"],
body.dark-mode [style*="color: #111827"],
body.dark-mode [style*="color:#111827"] {
    color: #f1f5f9 !important;
}

/* Hardcoded muted/gray text */
body.dark-mode [style*="color: #7f8c8d"],
body.dark-mode [style*="color:#7f8c8d"],
body.dark-mode [style*="color: #95a5a6"],
body.dark-mode [style*="color:#95a5a6"],
body.dark-mode [style*="color: #555"],
body.dark-mode [style*="color:#555"],
body.dark-mode [style*="color: #666"],
body.dark-mode [style*="color:#666"],
body.dark-mode [style*="color: #856404"],
body.dark-mode [style*="color:#856404"] {
    color: #94a3b8 !important;
}

/* Borders */
body.dark-mode [style*="border-bottom: 1px solid #e0e0e0"],
body.dark-mode [style*="border-bottom:1px solid #e0e0e0"],
body.dark-mode [style*="border-top: 1px solid #e0e0e0"],
body.dark-mode [style*="border-top:1px solid #e0e0e0"],
body.dark-mode [style*="border: 1px solid #e0e0e0"],
body.dark-mode [style*="border:1px solid #e0e0e0"] {
    border-color: #334155 !important;
}

/* Cards / containers that use box-shadow on white */
body.dark-mode [style*="box-shadow: 0 2px 8px rgba(0,0,0,0.1)"],
body.dark-mode [style*="box-shadow:0 2px 8px rgba(0,0,0,0.1)"] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Auth left panel */
body.dark-mode .auth-left-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
}

body.dark-mode .auth-info h2,
body.dark-mode .feature-item h3,
body.dark-mode .brand-name {
    color: #f1f5f9 !important;
}

body.dark-mode .feature-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

body.dark-mode .feature-item p {
    color: #94a3b8 !important;
}

body.dark-mode .auth-right-panel {
    background: #111827 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .auth-split-container {
    background: #111827 !important;
    border-color: #1f2937 !important;
}

body.dark-mode .form-field input,
body.dark-mode .form-field select {
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    background: #0f172a !important;
}

body.dark-mode .form-field input:focus,
body.dark-mode .form-field select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

body.dark-mode .feature-slider-content {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode .feature-slider-close {
    background: #334155 !important;
}

body.dark-mode .feature-slider-close svg {
    stroke: #f1f5f9 !important;
}

body.dark-mode .feature-detail h2,
body.dark-mode .feature-detail-content h3,
body.dark-mode .feature-detail-content li,
body.dark-mode .feature-detail-content li strong {
    color: #f1f5f9 !important;
}

body.dark-mode .feature-detail-subtitle {
    color: #94a3b8 !important;
}

body.dark-mode .feature-detail-content li {
    border-bottom-color: #334155 !important;
}

/* classroom_detail / teacher_classrooms / student_classrooms cards */
body.dark-mode .container [style*="background: white"],
body.dark-mode .container [style*="background:white"],
body.dark-mode .container [style*="background: #fff"],
body.dark-mode .container [style*="background:#fff"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

/* ── Dashboard templates (student_dashboard, teacher_dashboard) ── */
/* These use inline <style> blocks with hardcoded colors */
body.dark-mode .dashboard-header {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

body.dark-mode .dashboard-header h1,
body.dark-mode .dashboard-header p {
    color: var(--text-main) !important;
}

body.dark-mode .stat-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .stat-info h3 {
    color: var(--text-muted) !important;
}

body.dark-mode .stat-number {
    color: var(--text-main) !important;
}

body.dark-mode .quick-actions {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .quick-actions h2 {
    color: var(--text-main) !important;
    border-bottom-color: var(--border-color) !important;
}

body.dark-mode .action-btn {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .action-btn p {
    color: var(--text-main) !important;
}

/* Stats box inside classroom cards */
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"] {
    background: #0f172a !important;
}

/* Pending approval inner white boxes */
body.dark-mode [style*="background: white"][style*="padding: 15px"],
body.dark-mode [style*="background:white"][style*="padding:15px"] {
    background: #1e293b !important;
}

/* engagement_report.html card */
body.dark-mode .er-card {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode .er-header {
    /* gradient is fine — keep it */
}

body.dark-mode .bar-wrap label {
    color: #94a3b8 !important;
}

body.dark-mode .bar {
    background: #334155 !important;
}

body.dark-mode .ebadge.e-focused {
    background: rgba(16, 185, 129, .2) !important;
}

body.dark-mode .ebadge.e-happy {
    background: rgba(245, 158, 11, .2) !important;
}

body.dark-mode .ebadge.e-confused {
    background: rgba(99, 102, 241, .2) !important;
}

body.dark-mode .ebadge.e-distracted {
    background: rgba(239, 68, 68, .2) !important;
}

body.dark-mode .ebadge.e-absent,
body.dark-mode .ebadge.e-unknown {
    background: rgba(100, 116, 139, .2) !important;
}

/* classroom_detail.html request/student items */
body.dark-mode .request-item {
    background: #0f172a !important;
}

body.dark-mode .student-item {
    border-bottom-color: #334155 !important;
}

/* meeting history cards inside classroom_detail */
body.dark-mode [style*="background: #f8f9fa"][style*="border-radius: 8px"] {
    background: #0f172a !important;
}

/* Override modal */
body.dark-mode #overrideModal>div {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

/* face_setup, attendance_settings, class_schedule pages */
body.dark-mode .setup-card,
body.dark-mode .settings-card,
body.dark-mode .schedule-card {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

/* Tables in dark mode */
body.dark-mode table {
    color: #f1f5f9;
}

body.dark-mode thead th {
    background: rgba(255, 255, 255, .03) !important;
    color: #94a3b8 !important;
}

body.dark-mode tbody tr:hover {
    background: rgba(102, 126, 234, .08) !important;
}

/* Scrollbar in dark mode */
body.dark-mode ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Camera templates ── */
body.dark-mode .camera-card,
body.dark-mode .admin-header,
body.dark-mode .status-card,
body.dark-mode .no-cameras,
body.dark-mode .form-card-large {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .admin-header h1,
body.dark-mode .camera-info h3,
body.dark-mode .camera-header h2,
body.dark-mode .camera-header h1,
body.dark-mode .camera-details h3,
body.dark-mode .camera-info-card h3,
body.dark-mode .troubleshooting h4 {
    color: #f1f5f9 !important;
}

body.dark-mode .camera-url,
body.dark-mode .status-label,
body.dark-mode .status-value,
body.dark-mode .ip-info,
body.dark-mode .camera-type,
body.dark-mode .detail-item .label,
body.dark-mode .info-item .label,
body.dark-mode .troubleshooting li,
body.dark-mode .permissions-count {
    color: #94a3b8 !important;
}

body.dark-mode .detail-item .value,
body.dark-mode .info-item .value {
    color: #f1f5f9 !important;
}

body.dark-mode .card-header {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .card-header h3 {
    color: #f1f5f9 !important;
}

body.dark-mode .card-footer {
    background: #1e293b !important;
}

body.dark-mode .monitor-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .camera-permissions-info {
    border-top-color: #334155 !important;
}

body.dark-mode .camera-header,
body.dark-mode .camera-details,
body.dark-mode .camera-info-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .detail-item {
    border-bottom-color: #334155 !important;
}

body.dark-mode .camera-url,
body.dark-mode .info-item .value.url {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

body.dark-mode .quality-selector select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark-mode .troubleshooting {
    border-top-color: #334155 !important;
}

/* ── Form cards (create_classroom, join_classroom, start_meeting, add_camera) ── */
body.dark-mode .add-camera-container .form-card-large,
body.dark-mode .container>div[style*="background: white"],
body.dark-mode .container>div[style*="background:white"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode textarea,
body.dark-mode select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #64748b !important;
}

body.dark-mode label,
body.dark-mode small {
    color: #94a3b8 !important;
}

body.dark-mode .info-box {
    background: #162032 !important;
    border-color: #334155 !important;
}

body.dark-mode .info-box strong,
body.dark-mode .info-box p {
    color: #94a3b8 !important;
}

body.dark-mode .btn-cancel {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

body.dark-mode .btn-secondary {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* ── Admin panel status cards ── */
body.dark-mode .system-status-container .status-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .status-info .status-label {
    color: #94a3b8 !important;
}

body.dark-mode .status-info .status-value {
    color: #f1f5f9 !important;
}

/* ── Live meetings cards inside admin panel ── */
body.dark-mode #live-meetings-section [style*="background: white"],
body.dark-mode #live-meetings-section [style*="background:white"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

/* ── Profile / edit_profile ── */
body.dark-mode .profile-card,
body.dark-mode .under-development-card {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode .profile-card h2,
body.dark-mode .under-development-card h1 {
    color: #f1f5f9 !important;
}

body.dark-mode .profile-card p,
body.dark-mode .under-development-card p {
    color: #94a3b8 !important;
}

body.dark-mode .editable-input,
body.dark-mode .editable-textarea,
body.dark-mode .editable-title {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body.dark-mode [style*="background: #e8f4fd"],
body.dark-mode [style*="background:#e8f4fd"],
body.dark-mode [style*="background: #e8f5e9"],
body.dark-mode [style*="background:#e8f5e9"],
body.dark-mode [style*="background: #e3f2fd"],
body.dark-mode [style*="background:#e3f2fd"] {
    background: #162032 !important;
    border-color: #334155 !important;
}

body.dark-mode [style*="color: #374151"],
body.dark-mode [style*="color:#374151"] {
    color: #94a3b8 !important;
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL DARK MODE OVERRIDES
   ══════════════════════════════════════════════════════════════ */

/* ── Classroom Views Dark Mode ── */
body.dark-mode .classroom-container {
    color: var(--color-text-main);
}
body.dark-mode .header-text h1 {
    color: var(--color-text-main) !important;
}
body.dark-mode .header-text p {
    color: var(--color-text-muted) !important;
}
body.dark-mode .teacher-course-card,
body.dark-mode .course-card {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .card-top {
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom-color: var(--color-border) !important;
}
body.dark-mode .card-title,
body.dark-mode .course-title {
    color: var(--color-text-main) !important;
}
body.dark-mode .course-desc {
    color: var(--color-text-muted) !important;
}
body.dark-mode .card-stats {
    background: var(--color-bg-card) !important;
}
body.dark-mode .stat-val {
    color: var(--color-text-main) !important;
}
body.dark-mode .stat-lab {
    color: var(--color-text-muted) !important;
}
body.dark-mode .card-footer,
body.dark-mode .teacher-info {
    border-top-color: var(--color-border) !important;
}
body.dark-mode .teacher-avatar {
    background: var(--color-bg-hover) !important;
}
body.dark-mode .teacher-name {
    color: var(--color-text-main) !important;
}
body.dark-mode .btn-manage,
body.dark-mode .btn-card-outline {
    background: var(--color-bg-hover) !important;
    color: var(--color-text-main) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .btn-card-outline:hover {
    background: var(--color-border) !important;
}
body.dark-mode .empty-state {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-main) !important;
}
body.dark-mode .pending-banner {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}
body.dark-mode .pending-banner h3 {
    color: var(--color-warning) !important;
}
body.dark-mode .pending-item {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-main) !important;
}

/* ── Create Classroom Dark Mode ── */
body.dark-mode .container div[style*="background: white"],
body.dark-mode .container div[style*="background:white"] {
    background: var(--color-bg-card) !important;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
}
body.dark-mode .container h2[style*="color: #2c3e50"] {
    color: var(--color-text-main) !important;
}
body.dark-mode .container p[style*="color: #7f8c8d"] {
    color: var(--color-text-muted) !important;
}
body.dark-mode .container label[style*="color: #2c3e50"] {
    color: var(--color-text-main) !important;
}
body.dark-mode .container input, 
body.dark-mode .container textarea {
    background-color: var(--color-bg-app) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-main) !important;
}
body.dark-mode .container small[style*="color: #7f8c8d"] {
    color: var(--color-text-muted) !important;
}
body.dark-mode .container div[style*="background: #e8f5e9"],
body.dark-mode .container div[style*="background:#e8f5e9"] {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
}
body.dark-mode .container div[style*="background: #e8f5e9"] strong,
body.dark-mode .container div[style*="background:#e8f5e9"] strong {
    color: #4ade80 !important;
}
body.dark-mode .container div[style*="background: #e8f5e9"] ul,
body.dark-mode .container div[style*="background:#e8f5e9"] ul {
    color: var(--color-text-muted) !important;
}
body.dark-mode .container a[style*="background: #ecf0f1"],
body.dark-mode .container a[style*="background:#ecf0f1"] {
    background: var(--color-bg-hover) !important;
    color: var(--color-text-main) !important;
    border: 1px solid var(--color-border) !important;
}
body.dark-mode .container a[style*="background: #ecf0f1"]:hover,
body.dark-mode .container a[style*="background:#ecf0f1"]:hover {
    background: var(--color-border) !important;
}

/* ── Create Meeting Dark Mode ── */
body.dark-mode .create-meeting-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 100%) !important;
}
body.dark-mode .create-meeting-card {
    background: var(--color-bg-card) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}
body.dark-mode .meeting-header h2 {
    color: var(--color-text-main) !important;
}
body.dark-mode .meeting-header p {
    color: var(--color-text-muted) !important;
}
body.dark-mode .form-group label {
    color: var(--color-text-main) !important;
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: var(--color-bg-app) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-main) !important;
}
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25) !important;
}
body.dark-mode .checkbox-label {
    color: var(--color-text-muted) !important;
}
body.dark-mode .btn-cancel {
    background: var(--color-bg-hover) !important;
    color: var(--color-text-main) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .btn-cancel:hover {
    background: var(--color-border) !important;
}

/* ── Teacher Camera Dashboard Dark Mode ── */
body.dark-mode .teacher-dash-container h1,
body.dark-mode .teacher-dash-container h2,
body.dark-mode .teacher-dash-container h3,
body.dark-mode .teacher-dash-container div[style*="color: #1e293b"],
body.dark-mode .teacher-dash-container div[style*="color: #1e293b"] div,
body.dark-mode .teacher-dash-container h2[style*="color: #1e293b"],
body.dark-mode .teacher-dash-container h3[style*="color: #1e293b"] {
    color: var(--color-text-main) !important;
}
body.dark-mode .teacher-dash-container p,
body.dark-mode .teacher-dash-container div[style*="color: #64748b"],
body.dark-mode .teacher-dash-container p[style*="color: #64748b"],
body.dark-mode .teacher-dash-container div[style*="color: #64748b"] div {
    color: var(--color-text-muted) !important;
}
body.dark-mode .camera-card {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .camera-preview {
    background: var(--color-bg-hover) !important;
}
body.dark-mode .camera-preview i {
    color: var(--color-text-muted) !important;
}
body.dark-mode .btn-control {
    background: var(--color-primary) !important;
}
body.dark-mode .btn-control:hover {
    background: var(--color-primary-hover) !important;
}
body.dark-mode .recordings-section {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .recording-item {
    border-bottom-color: var(--color-border) !important;
}
body.dark-mode .camera-grid div[style*="background: #f8fafc"] {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}
body.dark-mode .camera-grid div[style*="background: #f8fafc"] h3 {
    color: var(--color-text-main) !important;
}
body.dark-mode .teacher-dash-container span[style*="background: #dcfce7"] {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #4ade80 !important;
}
body.dark-mode .teacher-dash-container span[style*="background: #fef9c3"] {
    background: rgba(202, 138, 4, 0.2) !important;
    color: #facc15 !important;
}

/* ── Manage Recordings Dark Mode ── */
body.dark-mode .text-dark {
    color: var(--color-text-main) !important;
}
body.dark-mode .table {
    background-color: transparent !important;
    color: var(--color-text-main) !important;
}
body.dark-mode .table thead th {
    color: var(--color-text-main) !important;
    background-color: var(--bg-card) !important;
}
body.dark-mode .table tbody tr {
    background-color: transparent !important;
}
body.dark-mode .table tbody td {
    background-color: transparent !important;
    color: var(--color-text-muted) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}
body.dark-mode .modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}
body.dark-mode .modal-footer {
    border-top: 1px solid var(--border-color) !important;
}
body.dark-mode .btn-close {
    filter: invert(1) grayscale(1) brightness(2) !important;
}
body.dark-mode .btn-light {
    background-color: var(--hover-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* ── Upload Video Dark Mode ── */
body.dark-mode #thumbPreviewWrapper.bg-light {
    background-color: var(--hover-bg) !important;
    border-color: var(--border-color) !important;
}
body.dark-mode .text-primary {
    color: var(--primary) !important;
}
body.dark-mode .text-success {
    color: #4ade80 !important;
}
body.dark-mode .text-muted {
    color: var(--text-muted) !important;
}
body.dark-mode .upload-zone h5 {
    color: var(--text-main) !important;
}


/* ── Mobile Layout Responsiveness ── *//* ══════════════════════════════════════════════════════════════
   GLOBAL UI COMPONENTS (Containers, Cards, Headers)
   ══════════════════════════════════════════════════════════════ */
.page-container {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.flat-card {
    background: var(--color-bg-card, var(--bg-card, #ffffff));
    border: 1px solid var(--color-border, var(--border-color, #e5e7eb));
    border-radius: clamp(10px, 1.5vw, 12px);
    padding: clamp(1rem, 2vw, 1.5rem);
}

.page-header-flat {
    background: var(--color-bg-card, var(--bg-card, #ffffff));
    border-radius: clamp(10px, 1.5vw, 12px);
    padding: clamp(1rem, 2vw, 1.25rem) clamp(1.25rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(1rem, 2vh, 1.5rem);
    border: 1px solid var(--color-border, var(--border-color, #e5e7eb));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 1.5vw, 1rem);
}

.page-header-flat h1,
.page-header-flat h2 {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 700;
    color: var(--color-text-main, var(--text-main, #111827));
    margin: 0;
}

.page-header-flat p {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-muted, var(--text-muted, #4b5563));
    margin: 2px 0 0 0;
}

.btn-primary-gradient {
    padding: clamp(0.625rem, 1.2vh, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    background: linear-gradient(135deg, var(--color-primary, #667eea) 0%, var(--color-secondary, #764ba2) 100%);
    color: #ffffff !important;
    border: none;
    border-radius: clamp(8px, 1.2vw, 10px);
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.375rem, 0.8vw, 0.5rem);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
}

.btn-danger-gradient {
    padding: clamp(0.625rem, 1.2vh, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    background: linear-gradient(135deg, var(--color-danger, #ef4444) 0%, #dc2626 100%);
    color: #ffffff !important;
    border: none;
    border-radius: clamp(8px, 1.2vw, 10px);
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.375rem, 0.8vw, 0.5rem);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    color: #ffffff !important;
}

.btn-warning-gradient {
    padding: clamp(0.625rem, 1.2vh, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    background: linear-gradient(135deg, var(--color-warning, #f59e0b) 0%, #d97706 100%);
    color: #ffffff !important;
    border: none;
    border-radius: clamp(8px, 1.2vw, 10px);
    font-size: clamp(0.8rem, 1.4vw, 0.875rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.375rem, 0.8vw, 0.5rem);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    color: #ffffff !important;
}

/* Contextual Soft Background Utilities */
.bg-primary-soft { background: var(--color-primary-bg, rgba(102, 126, 234, 0.1)); }
.text-primary-soft { color: var(--color-primary, #667eea); }

.bg-success-soft { background: rgba(16, 185, 129, 0.1); }
.text-success-soft { color: var(--color-success, #10b981); }

.bg-info-soft { background: rgba(59, 130, 246, 0.1); }
.text-info-soft { color: var(--color-info, #06b6d4); }

/* Global Empty State */
.empty-state {
    background: var(--color-bg-card, var(--bg-card, #ffffff));
    border-radius: clamp(12px, 2vw, 16px);
    padding: clamp(2rem, 5vh, 4rem) clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    border: 2px dashed var(--color-border, var(--border-color, #e5e7eb));
}

.empty-state-icon {
    width: clamp(60px, 10vw, 80px);
    height: clamp(60px, 10vw, 80px);
    background: var(--color-bg-hover, var(--hover-bg, #f3f4f6));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(1rem, 2vh, 1.5rem);
}

.empty-state-icon svg {
    width: clamp(30px, 5vw, 40px);
    height: clamp(30px, 5vw, 40px);
    stroke: var(--color-text-muted, var(--text-muted, #9ca3af));
    fill: none;
}

.empty-state h3 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 700;
    color: var(--color-text-main, var(--text-main, #111827));
    margin-bottom: clamp(0.5rem, 1vh, 0.75rem);
}

.empty-state p {
    font-size: clamp(0.875rem, 1.6vw, 0.95rem);
    color: var(--color-text-muted, var(--text-muted, #4b5563));
    margin-bottom: clamp(1.25rem, 2vh, 1.5rem);
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .classroom-container,
    .container,
    .sessions-container,
    .report-container,
    .logs-container {
        padding: 1rem !important;
    }

    /* Auto-wrap tables in horizontal scroll on mobile */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Touch target standard size */
    button, input[type="button"], input[type="submit"], .btn, a.btn {
        min-height: 42px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN DASHBOARD DARK MODE & GLOBAL THEME ADAPTATION
   ═══════════════════════════════════════════════════════════ */
body.dark-mode .admin-container,
html.dark-mode .admin-container {
    color: var(--color-text-main, #f8fafc);
}

body.dark-mode .health-card,
html.dark-mode .health-card,
body.dark-mode .stat-mini-card,
html.dark-mode .stat-mini-card,
body.dark-mode .table-card,
html.dark-mode .table-card,
body.dark-mode .edit-user-card,
html.dark-mode .edit-user-card {
    background-color: var(--color-bg-card, #1e293b) !important;
    border-color: var(--color-border, #334155) !important;
    color: var(--color-text-main, #f8fafc) !important;
}

body.dark-mode .data-table th,
html.dark-mode .data-table th {
    background-color: var(--color-bg-hover, #334155) !important;
    color: var(--color-text-muted, #94a3b8) !important;
    border-color: var(--color-border, #334155) !important;
}

body.dark-mode .data-table td,
html.dark-mode .data-table td {
    color: var(--color-text-main, #f8fafc) !important;
    border-color: var(--color-border, #334155) !important;
}

body.dark-mode .modal-box,
html.dark-mode .modal-box {
    background-color: var(--color-bg-card, #1e293b) !important;
    color: var(--color-text-main, #f8fafc) !important;
    border-color: var(--color-border, #334155) !important;
}

/* ═══════════════════════════════════════════════════════════
   ASSIGNMENT & CREATION FORM SYSTEM (THEME-AWARE & DARK MODE)
   ═══════════════════════════════════════════════════════════ */

.create-container,
.submit-container,
.evaluate-container,
.detail-container {
    color: var(--color-text-main, var(--text-main, #0f172a));
}

.form-card,
.section-card {
    background-color: var(--color-bg-card, var(--bg-card, #ffffff));
    border-radius: 1.5rem;
    padding: 2.5rem;
    border: 1px solid var(--color-border, var(--border-color, #e2e8f0));
    color: var(--color-text-main, var(--text-main, #0f172a));
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.05));
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.form-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--color-text-main, var(--text-main, #0f172a));
    margin: 0 0 0.5rem 0;
}

.form-subtitle {
    color: var(--color-text-muted, var(--text-muted, #64748b));
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-main, var(--text-main, #0f172a));
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-text-main, var(--text-main, #0f172a));
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border, var(--border-color, #cbd5e1));
    background-color: var(--color-bg-card, var(--bg-card, #ffffff));
    color: var(--color-text-main, var(--text-main, #0f172a));
    border-radius: 0.875rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-text-muted, var(--text-muted, #94a3b8));
}

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

.btn-primary {
    background: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-secondary {
    background: var(--color-bg-hover, var(--hover-bg, #f1f5f9));
    color: var(--color-text-main, var(--text-main, #0f172a)) !important;
    border: 1px solid var(--color-border, var(--border-color, #e2e8f0));
    padding: 0.875rem 2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--color-border, var(--border-color, #e2e8f0));
    color: var(--color-text-main, var(--text-main, #0f172a)) !important;
}

.btn-draft {
    background: #e0e7ff;
    color: #3730a3 !important;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area {
    border: 2px dashed var(--color-border, var(--border-color, #cbd5e1));
    background: var(--color-bg-app, var(--bg-app, #f8fafc));
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
}

.file-upload-area:hover {
    border-color: #6366f1;
    background: var(--color-primary-bg, rgba(99, 102, 241, 0.08));
}

.file-upload-area p {
    color: var(--color-text-muted, var(--text-muted, #475569));
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    background: var(--color-bg-app, var(--bg-app, #f8fafc));
    border: 1px solid var(--color-border, var(--border-color, #e2e8f0));
    border-radius: 0.875rem;
    color: var(--color-text-main, var(--text-main, #0f172a));
}

.submission-item {
    background: var(--color-bg-app, var(--bg-app, #f8fafc));
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-border, var(--border-color, #cbd5e1));
    color: var(--color-text-main, var(--text-main, #0f172a));
}

/* Dark Mode explicit overrides */
body.dark-mode .form-card,
html.dark-mode .form-card,
body.dark-mode .section-card,
html.dark-mode .section-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .form-title,
html.dark-mode .form-title,
body.dark-mode .section-title,
html.dark-mode .section-title {
    color: #f8fafc !important;
}

body.dark-mode .form-subtitle,
html.dark-mode .form-subtitle {
    color: #94a3b8 !important;
}

body.dark-mode .form-group label,
html.dark-mode .form-group label {
    color: #f8fafc !important;
}

body.dark-mode .form-control,
html.dark-mode .form-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .form-control::placeholder,
html.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

body.dark-mode .btn-secondary,
html.dark-mode .btn-secondary {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

body.dark-mode .btn-secondary:hover,
html.dark-mode .btn-secondary:hover {
    background: #475569 !important;
    color: #ffffff !important;
}

body.dark-mode .btn-draft,
html.dark-mode .btn-draft {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #a5b4fc !important;
}

body.dark-mode .file-upload-area,
html.dark-mode .file-upload-area {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #94a3b8 !important;
}

body.dark-mode .file-upload-area:hover,
html.dark-mode .file-upload-area:hover {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.15) !important;
}

body.dark-mode .file-upload-area p,
html.dark-mode .file-upload-area p {
    color: #cbd5e1 !important;
}

body.dark-mode .file-item,
html.dark-mode .file-item,
body.dark-mode .submission-item,
html.dark-mode .submission-item {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}


/* --- Module: main.css --- */
/* Main CSS - Imports all component styles */
@import url('design_tokens.css');
@import url('base.css');
@import url('auth.css');
@import url('meetings.css');
@import url('profile.css');
@import url('classroom_card.css');


/* --- Module: toast.css --- */
/**
 * static/css/core/toast.css
 * Enterprise Toast Notification System Styling:
 * - Floating top-right viewport stack
 * - Success, Danger, Warning, and Info themes
 * - Seamless dark-mode variables
 * - Entrance and exit cubic-bezier animations
 */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.custom-toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 360px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

/* Dark mode support */
.dark-mode .custom-toast {
    background: rgba(30, 41, 59, 0.98);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.toast-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon-wrap.success {
    background: #ecfdf5;
    color: #059669;
}
.dark-mode .toast-icon-wrap.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.toast-icon-wrap.danger {
    background: #fef2f2;
    color: #dc2626;
}
.dark-mode .toast-icon-wrap.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.toast-icon-wrap.warning {
    background: #fffbeb;
    color: #d97706;
}
.dark-mode .toast-icon-wrap.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.toast-icon-wrap.info {
    background: #f5f3ff;
    color: #7c3aed;
}
.dark-mode .toast-icon-wrap.info {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-content .toast-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
}
.dark-mode .toast-content .toast-title {
    color: #f8fafc;
}

.toast-content .toast-desc {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 2px 0 0 0;
    line-height: 1.35;
    word-break: break-word;
}
.dark-mode .toast-content .toast-desc {
    color: #94a3b8;
}

.toast-close {
    background: transparent;
    border: none;
    outline: none;
    padding: 4px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #334155;
}
.dark-mode .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.custom-toast.fade-out {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.25s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* --- Module: classroom_card.css --- */
/* ══════════════════════════════════════════════════════════════
   GOOGLE CLASSROOM CARD SYSTEM - GLOBAL STYLES
   Authentic Google Classroom Card Aesthetics with Light & Dark Mode
   ══════════════════════════════════════════════════════════════ */

/* ── Classroom Grid Container ── */
.gclass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 1200px) {
    .gclass-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .gclass-grid {
        grid-template-columns: 1fr;
        gap: 1.125rem;
    }
}

/* ── Main Classroom Card ── */
.gclass-card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #dadce0);
    border-radius: 12px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.22s ease;
    min-height: 250px;
}

.gclass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 6px 12px -2px rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.4);
}

body.dark-mode .gclass-card {
    background: var(--color-bg-card, #1e293b);
    border-color: var(--color-border, #334155);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body.dark-mode .gclass-card:hover {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

/* ── Header Banner (Cover Art) ── */
.gclass-header {
    height: 120px;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    padding: 1rem 1.125rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    user-select: none;
}

/* Subtle decorative pattern overlay (Google Classroom authentic style) */
.gclass-header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    background-image: 
        radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.gclass-header::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    top: 0;
    width: 45%;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 40L60 20L100 40L60 60L20 40Z' stroke='white' stroke-width='2'/%3E%3Cpath d='M40 50V75C40 85 60 95 60 95C60 95 80 85 80 75V50' stroke='white' stroke-width='2' fill='none'/%3E%3Cpath d='M95 45V75' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='95' cy='80' r='3' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 90px 90px;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   AUTHENTIC GOOGLE CLASSROOM THEMES
   ══════════════════════════════════════════════════════════════ */
/* Default / Theme 1: Google Ocean Blue */
.gclass-card .gclass-header,
.gclass-theme-blue .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 1) .gclass-header {
    background-color: #1967d2;
    background-image: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
}

/* Theme 2: Emerald Green */
.gclass-theme-green .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 2) .gclass-header {
    background-color: #137333;
    background-image: linear-gradient(135deg, #188038 0%, #0d5324 100%);
}

/* Theme 3: Purple Violet */
.gclass-theme-purple .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 3) .gclass-header {
    background-color: #8430ce;
    background-image: linear-gradient(135deg, #9334e6 0%, #5b1d99 100%);
}

/* Theme 4: Warm Amber / Sunset */
.gclass-theme-amber .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 4) .gclass-header {
    background-color: #b06000;
    background-image: linear-gradient(135deg, #ea580c 0%, #9a3412 100%);
}

/* Theme 5: Ruby Crimson / Coral */
.gclass-theme-ruby .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 5) .gclass-header {
    background-color: #c5221f;
    background-image: linear-gradient(135deg, #e11d48 0%, #881337 100%);
}

/* Theme 6: Deep Teal / Cyan */
.gclass-theme-teal .gclass-header,
.gclass-grid > .gclass-card:nth-child(6n + 6) .gclass-header {
    background-color: #007b83;
    background-image: linear-gradient(135deg, #0d9488 0%, #115e59 100%);
}

/* ── Header Top Row (Title & Menu Actions) ── */
.gclass-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

.gclass-title-wrap {
    flex: 1;
    min-width: 0;
}

.gclass-title {
    color: #ffffff !important;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.28;
    margin: 0 0 0.25rem 0;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: opacity 0.15s;
}

.gclass-title:hover {
    text-decoration: underline !important;
    opacity: 0.92;
}

.gclass-subtitle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

.gclass-sub-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gclass-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: all;
}

.gclass-code-badge:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.gclass-code-badge:active {
    transform: scale(0.96);
}

/* ── Header Top Right Actions & Badges ── */
.gclass-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Live Badge */
.gclass-live-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: gclass-pulse 2s infinite;
}

.gclass-live-badge .live-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: gclass-blink 1.2s infinite ease-in-out;
}

@keyframes gclass-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@keyframes gclass-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 3-Dots Menu Button */
.gclass-dropdown-wrap {
    position: relative;
}

.gclass-menu-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.gclass-menu-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1.06);
}

.gclass-menu-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.gclass-menu-btn svg {
    width: 18px;
    height: 18px;
}

/* 3-Dots Dropdown Menu */
.gclass-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 190px;
    padding: 0.4rem;
    z-index: 100;
    display: none;
    animation: gclassFadeIn 0.15s ease-out;
}

.gclass-dropdown-menu.active {
    display: block;
}

body.dark-mode .gclass-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

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

.gclass-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-main, #334155);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.gclass-dropdown-item:hover {
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-primary, #4f46e5);
}

body.dark-mode .gclass-dropdown-item {
    color: #cbd5e1;
}

body.dark-mode .gclass-dropdown-item:hover {
    background: #334155;
    color: #ffffff;
}

.gclass-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.75;
}

.gclass-dropdown-divider {
    height: 1px;
    background: var(--color-border, #e2e8f0);
    margin: 0.35rem 0;
}

body.dark-mode .gclass-dropdown-divider {
    background: #334155;
}

/* ── Card Middle Body ── */
.gclass-body {
    padding: 1.125rem 1.125rem 0.875rem 1.125rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--color-bg-card, #ffffff);
}

body.dark-mode .gclass-body {
    background: var(--color-bg-card, #1e293b);
}

/* Teacher Stats Row */
.gclass-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: var(--color-bg-hover, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 0.625rem 0.5rem;
    margin-bottom: 0.5rem;
}

body.dark-mode .gclass-stats {
    background: rgba(15, 23, 42, 0.5);
    border-color: #334155;
}

.gclass-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--color-text-main, #1e293b);
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.gclass-stat-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.dark-mode .gclass-stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.gclass-stat-num {
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-text-main, #0f172a);
}

body.dark-mode .gclass-stat-num {
    color: #f8fafc;
}

.gclass-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

body.dark-mode .gclass-stat-label {
    color: #94a3b8;
}

.gclass-stat-item.has-pending .gclass-stat-num {
    color: #f59e0b;
}

.gclass-stat-item.has-pending .gclass-stat-label {
    color: #d97706;
}

/* Student Course Description / Info */
.gclass-student-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.25rem 0;
}

.gclass-desc {
    font-size: 0.84375rem;
    line-height: 1.45;
    color: var(--color-text-muted, #64748b);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-mode .gclass-desc {
    color: #94a3b8;
}

/* ── Card Footer Action Bar ── */
.gclass-footer {
    padding: 0.75rem 1.125rem;
    border-top: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-bg-card, #ffffff);
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
    display: flex;
    width: 100%;
}

body.dark-mode .gclass-footer {
    background: var(--color-bg-card, #1e293b);
    border-top-color: #334155;
}

/* Action buttons full-width responsive layout */
.gclass-footer-btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.65rem;
    width: 100%;
    align-items: center;
}

.gclass-btn-open,
.gclass-btn-manage {
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    color: var(--color-text-main, #1e293b);
    background: var(--color-bg-hover, #f1f5f9);
    border: 1px solid var(--color-border, #e2e8f0);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.gclass-btn-open:hover,
.gclass-btn-manage:hover {
    background: var(--color-border, #e2e8f0);
    color: var(--color-text-main, #0f172a);
}

body.dark-mode .gclass-btn-open,
body.dark-mode .gclass-btn-manage {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-mode .gclass-btn-open:hover,
body.dark-mode .gclass-btn-manage:hover {
    background: #475569;
    color: #ffffff;
}

.gclass-btn-start {
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.gclass-btn-start:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.gclass-btn-start svg {
    width: 14px;
    height: 14px;
}

.gclass-btn-live {
    padding: 0.55rem 0.95rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    color: #ffffff !important;
    background: #ef4444;
    border: none;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    animation: gclass-pulse 2s infinite;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.gclass-btn-live:hover {
    background: #dc2626;
    color: #ffffff !important;
}

.gclass-btn-live svg {
    width: 14px;
    height: 14px;
}

/* ── Toast Feedback for Code Copy ── */
.gclass-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.gclass-toast.show {
    opacity: 1;
    transform: translateY(0);
}

body.dark-mode .gclass-toast {
    background: #334155;
    border: 1px solid #475569;
}


/* --- Module: attendance.css --- */
/* static/css/attendance.css - Global Stylesheet for Attendance System */

/* ── Container Layouts ── */
.attendance-container {
    max-width: var(--container-max-width, 1360px);
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-family-base, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

.attendance-card-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

/* ── Header Banner Card ── */
.attendance-header-card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.attendance-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary, #3b82f6);
    text-decoration: none;
    font-size: var(--font-size-md, 15px);
    font-weight: 600;
    transition: opacity 0.2s, color 0.2s;
    margin-bottom: 6px;
}

.breadcrumb-back:hover {
    color: var(--color-primary-hover, #2563eb);
    opacity: 0.85;
}

.attendance-header-title {
    margin: 0;
    font-size: var(--font-size-2xl, 22px);
    font-weight: 800;
    color: var(--color-text-main, #0f172a);
    letter-spacing: -0.01em;
}

.attendance-header-subtitle {
    margin: 0;
    font-size: var(--font-size-sm, 13px);
    color: var(--color-text-muted, #64748b);
}

.attendance-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs, 8px);
    flex-wrap: wrap;
}

/* ── Reusable Action Buttons ── */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--btn-height-md, 38px);
    padding: 0 16px;
    border-radius: var(--radius-md, 8px);
    font-size: var(--font-size-sm, 13px);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-action.btn-outline {
    border-color: var(--color-border, #e2e8f0);
    color: var(--color-text-main, #0f172a);
    background: var(--color-bg-card, #ffffff);
}

.btn-action.btn-outline:hover {
    border-color: var(--color-primary, #667eea);
    color: var(--color-primary, #667eea);
    background: var(--color-primary-bg, rgba(102, 126, 234, 0.08));
    transform: translateY(-1px);
}

.btn-action.btn-green {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.btn-action.btn-green:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: #10b981;
    color: #059669;
    transform: translateY(-1px);
}

.btn-save-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-md, 8px);
    font-size: var(--font-size-sm, 14px);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
    transition: transform .2s, box-shadow .2s;
    margin-top: 24px;
}

.btn-save-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.45);
}

/* ── Schedule Status Banner ── */
.schedule-status-banner {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: 12px 18px;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.schedule-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.banner-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-primary-bg, rgba(102, 126, 234, 0.1));
    color: var(--color-primary, #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.banner-label {
    font-size: var(--font-size-sm, 13px);
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
}

.schedule-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.day-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    background: var(--color-primary-bg, rgba(102, 126, 234, 0.1));
    color: var(--color-primary, #667eea);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.schedule-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-xs, 12px);
}

.fr-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
    font-weight: 700;
}

.fr-on {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.fr-off {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.fr-threshold {
    color: var(--color-text-muted, #64748b);
}

/* ── Stats Grid System ── */
.attendance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md, 16px);
    margin-bottom: var(--space-lg, 24px);
}

.attendance-stat-card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.attendance-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary, #667eea);
}

.stat-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue { background: rgba(102, 126, 234, 0.12); color: #667eea; }
.icon-green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.icon-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.icon-red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: var(--font-size-xs, 12px);
    font-weight: 700;
    color: var(--color-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.stat-value {
    font-size: var(--font-size-2xl, 24px);
    font-weight: 800;
    line-height: 1.2;
}

/* ── Data Tables & Cards ── */
.attendance-table-card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg, 24px);
    color: var(--color-text-main, #0f172a);
}

.table-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-bg-card, #ffffff);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.table-card-title {
    margin: 0;
    font-size: var(--font-size-md, 15px);
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
}

.count-badge {
    font-size: var(--font-size-xs, 12px);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full, 9999px);
    background: var(--color-bg-hover, #f1f5f9);
    color: var(--color-text-muted, #64748b);
}

.table-responsive {
    overflow-x: auto;
}

.attendance-data-table {
    width: 100%;
    border-collapse: collapse;
}

.attendance-data-table thead th {
    padding: 12px 20px;
    text-align: left;
    font-size: var(--font-size-xs, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #64748b);
    background: var(--color-bg-hover, #f8fafc);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.attendance-data-table tbody td {
    padding: 14px 20px;
    font-size: var(--font-size-sm, 14px);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    vertical-align: middle;
    color: var(--color-text-main, #0f172a);
}

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

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

.attendance-data-table tbody tr:hover {
    background: var(--color-primary-bg, rgba(102, 126, 234, 0.04));
}

/* Student & Avatar cells */
.student-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border, #e2e8f0);
}

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

.student-name {
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
    font-size: var(--font-size-sm, 14px);
}

.student-id {
    font-size: var(--font-size-xs, 12px);
    color: var(--color-text-muted, #64748b);
}

/* Status Badges */
.face-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--font-size-xs, 12px);
    padding: 3px 10px;
    border-radius: var(--radius-full, 9999px);
    font-weight: 600;
}

.face-registered {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.face-missing {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-size-xs, 12px);
    font-weight: 700;
}

.badge-present { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-absent  { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.badge-late    { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.badge-partial { background: rgba(99, 102, 241, 0.12); color: #6366f1; }

/* Progress Bars */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pct-bar {
    width: 110px;
    height: 8px;
    background: var(--color-border, #e2e8f0);
    border-radius: 4px;
    overflow: hidden;
}

.pct-fill {
    height: 100%;
    border-radius: 4px;
}

.fill-good { background: linear-gradient(90deg, #10b981, #059669); }
.fill-warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.fill-bad  { background: linear-gradient(90deg, #ef4444, #dc2626); }

.pct-val {
    font-weight: 700;
    font-size: var(--font-size-sm, 13px);
    color: var(--color-text-main, #0f172a);
}

.count-pill {
    font-weight: 700;
    font-size: var(--font-size-sm, 14px);
}

.count-present { color: #10b981; }
.count-absent  { color: #ef4444; }

.btn-action-view {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-primary, #667eea);
    text-decoration: none;
    font-size: var(--font-size-sm, 13px);
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-md, 6px);
    transition: all 0.2s ease;
}

.btn-action-view:hover {
    background: var(--color-primary-bg, rgba(102, 126, 234, 0.08));
    transform: translateX(2px);
}

/* ── Settings Forms & Toggles ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.toggle-row:last-of-type {
    border-bottom: none;
}

.toggle-info h4 {
    margin: 0 0 4px;
    font-size: var(--font-size-sm, 14px);
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
}

.toggle-info p {
    margin: 0;
    font-size: var(--font-size-xs, 12px);
    color: var(--color-text-muted, #64748b);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    cursor: pointer;
    background: var(--color-border, #cbd5e1);
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

/* ── Empty State ── */
.attendance-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted, #64748b);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}


/* ==============================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ============================================================== */
@media screen and (max-width: 1024px) {
    .attendance-container {
        padding: var(--space-sm, 12px) var(--space-md, 16px);
    }
}

@media screen and (max-width: 768px) {
    .attendance-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md, 16px);
        padding: var(--space-md, 16px);
    }

    .attendance-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .attendance-header-actions .btn-action {
        flex: 1 1 auto;
        justify-content: center;
    }

    .attendance-table-container {
        border-radius: var(--radius-md, 8px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .attendance-table {
        min-width: 600px;
    }

    .toggle-row {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
}

@media screen and (max-width: 480px) {
    .attendance-container {
        padding: var(--space-xs, 8px);
    }

    .attendance-header-title {
        font-size: 1.25rem;
    }

    .attendance-header-actions {
        flex-direction: column;
        width: 100%;
    }

    .attendance-header-actions .btn-action {
        width: 100%;
    }

    .badge-pill {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* ==========================================================================
   9. SHARED CONFIRMATION MODAL & ACTION BUTTONS (EdumiConfirm - All Roles)
   ========================================================================== */
.btn-action,
.btn-action-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.btn-action {
    padding: 0.72rem 1rem;
    font-size: 0.82rem;
}

.btn-action-primary,
.btn-action-sm.btn-action-primary {
    background: linear-gradient(135deg, var(--color-primary, #7c3aed), var(--color-primary-hover, #6d28d9));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(124, 58, 237, 0.22);
}

.btn-action-secondary,
.btn-action-sm.btn-action-secondary {
    background: var(--color-bg-card, #ffffff);
    border-color: var(--color-border, #e2e8f0);
    color: var(--color-text-main, #0f172a);
}

.btn-action-danger,
.btn-action-sm.btn-action-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(220, 38, 38, 0.18));
    border-color: rgba(239, 68, 68, 0.18);
    color: var(--color-danger, #ef4444);
}

.btn-action-success,
.btn-action-sm.btn-action-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.18));
    border-color: rgba(16, 185, 129, 0.18);
    color: var(--color-success, #10b981);
}

.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-modal-card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-xl, 1rem);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-overlay.active .admin-modal-card {
    transform: translateY(0) scale(1);
}

.admin-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted, #64748b);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-md, 0.5rem);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-close:hover {
    color: var(--color-danger, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

.edumi-confirm-overlay {
    z-index: 100050;
}

.edumi-confirm-card {
    max-width: 490px;
    width: 92%;
    border-radius: var(--radius-xl, 1rem);
    padding: 1.5rem;
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e2e8f0);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
}

body.dark-mode .edumi-confirm-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.edumi-confirm-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.edumi-confirm-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edumi-confirm-badge i,
.edumi-confirm-badge svg {
    width: 22px;
    height: 22px;
}

.edumi-confirm-badge.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.edumi-confirm-badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.edumi-confirm-badge.primary,
.edumi-confirm-badge.success {
    background: rgba(139, 92, 246, 0.12);
    color: var(--color-primary, #8b5cf6);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.edumi-confirm-titles {
    flex: 1;
    min-width: 0;
}

.edumi-confirm-titles h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
}

body.dark-mode .edumi-confirm-titles h3 {
    color: #f8fafc;
}

.edumi-confirm-titles p {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.45;
}

.edumi-confirm-impact {
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 0.5rem);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
}

body.dark-mode .edumi-confirm-impact {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.edumi-impact-title {
    font-weight: 700;
    color: var(--color-text-main, #0f172a);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

body.dark-mode .edumi-impact-title {
    color: #f1f5f9;
}

.edumi-confirm-impact ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--color-text-secondary, #475569);
}

body.dark-mode .edumi-confirm-impact ul {
    color: #94a3b8;
}

.edumi-confirm-impact li {
    margin-bottom: 0.25rem;
}

.edumi-confirm-prompt {
    margin-bottom: 1.25rem;
}

.edumi-confirm-prompt label {
    display: block;
    font-size: 0.82rem;
    color: var(--color-text-muted, #64748b);
    margin-bottom: 0.4rem;
}

.edumi-confirm-prompt label strong {
    color: var(--color-danger, #ef4444);
    font-family: monospace;
    background: rgba(239, 68, 68, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.edumi-confirm-prompt .admin-search-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--color-bg-card, #ffffff);
    color: var(--color-text-main, #0f172a);
    font-size: 0.85rem;
}

body.dark-mode .edumi-confirm-prompt .admin-search-input {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.edumi-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0;
    border: none;
    background: transparent;
}

body.dark-mode .btn-action-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}


