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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   WiFi Transfer Admin Panel — Design System
   Premium dark theme with glassmorphism, micro-animations,
   and a curated HSL color palette.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── CSS Custom Properties (Design Tokens) ────────────── */
:root {
    /* Primary palette — Electric indigo gradient */
    --primary-50:  hsl(245, 100%, 97%);
    --primary-100: hsl(245, 95%, 92%);
    --primary-200: hsl(245, 90%, 82%);
    --primary-300: hsl(245, 85%, 72%);
    --primary-400: hsl(245, 80%, 62%);
    --primary-500: hsl(245, 75%, 52%);
    --primary-600: hsl(245, 70%, 44%);
    --primary-700: hsl(245, 65%, 36%);
    --primary-800: hsl(245, 60%, 28%);
    --primary-900: hsl(245, 55%, 20%);

    /* Accent — Cyan electric */
    --accent-400: hsl(185, 90%, 55%);
    --accent-500: hsl(185, 85%, 48%);
    --accent-600: hsl(185, 80%, 40%);

    /* Success — Emerald */
    --success-400: hsl(152, 70%, 55%);
    --success-500: hsl(152, 65%, 45%);
    --success-bg:  hsla(152, 70%, 55%, 0.12);

    /* Warning — Amber */
    --warning-400: hsl(38, 95%, 60%);
    --warning-500: hsl(38, 90%, 50%);
    --warning-bg:  hsla(38, 95%, 60%, 0.12);

    /* Danger — Rose */
    --danger-400: hsl(350, 80%, 60%);
    --danger-500: hsl(350, 75%, 50%);
    --danger-bg:  hsla(350, 80%, 60%, 0.12);

    /* Info — Sky */
    --info-400: hsl(205, 85%, 60%);
    --info-500: hsl(205, 80%, 50%);
    --info-bg:  hsla(205, 85%, 60%, 0.12);

    /* Neutrals — Cool slate */
    --neutral-50:  hsl(220, 20%, 97%);
    --neutral-100: hsl(220, 18%, 93%);
    --neutral-200: hsl(220, 16%, 85%);
    --neutral-300: hsl(220, 14%, 70%);
    --neutral-400: hsl(220, 12%, 55%);
    --neutral-500: hsl(220, 10%, 42%);
    --neutral-600: hsl(220, 12%, 30%);
    --neutral-700: hsl(220, 16%, 22%);
    --neutral-800: hsl(220, 20%, 16%);
    --neutral-850: hsl(220, 22%, 13%);
    --neutral-900: hsl(220, 25%, 10%);
    --neutral-950: hsl(220, 30%, 7%);

    /* Surface colors (glassmorphism) */
    --surface-base:     hsl(220, 25%, 10%);
    --surface-card:     hsla(220, 22%, 14%, 0.7);
    --surface-elevated: hsla(220, 20%, 17%, 0.8);
    --surface-overlay:  hsla(220, 25%, 12%, 0.95);
    --surface-glass:    hsla(220, 25%, 18%, 0.4);
    --surface-input:    hsla(220, 20%, 15%, 0.6);

    /* Borders */
    --border-subtle:  hsla(220, 20%, 40%, 0.15);
    --border-default: hsla(220, 20%, 40%, 0.25);
    --border-strong:  hsla(220, 20%, 40%, 0.4);
    --border-focus:   var(--primary-400);

    /* Text */
    --text-primary:   hsl(220, 20%, 95%);
    --text-secondary: hsl(220, 15%, 68%);
    --text-tertiary:  hsl(220, 12%, 50%);
    --text-inverse:   hsl(220, 25%, 10%);
    --text-link:      var(--accent-400);

    /* Shadows */
    --shadow-sm:  0 1px 2px hsla(0, 0%, 0%, 0.2);
    --shadow-md:  0 4px 12px hsla(0, 0%, 0%, 0.25);
    --shadow-lg:  0 8px 24px hsla(0, 0%, 0%, 0.3);
    --shadow-xl:  0 16px 48px hsla(0, 0%, 0%, 0.35);
    --shadow-glow: 0 0 20px hsla(245, 80%, 60%, 0.25);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Animation */
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--surface-base);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background ambient effect */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 20%, hsla(245, 80%, 50%, 0.08), transparent),
        radial-gradient(ellipse 500px 500px at 80% 80%, hsla(185, 80%, 50%, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
    color: var(--accent-500);
}

img {
    max-width: 100%;
    display: block;
}

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.875rem; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }

/* ── Layout ───────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--duration-normal) var(--ease-smooth);
}

.app-main {
    flex: 1;
    padding: 24px;
    padding-top: calc(var(--header-height) + 24px);
}

@media (max-width: 768px) {
    .app-content {
        margin-left: 0;
    }
    .app-main {
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.sidebar-logo {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.sidebar-logo .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    padding: 8px 12px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-smooth);
    border-radius: var(--radius-md);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--surface-glass);
}

.sidebar-link.active {
    color: var(--text-primary);
}

.sidebar-link.active::before {
    opacity: 0.15;
}

.sidebar-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.sidebar-link .nav-text {
    position: relative;
    z-index: 1;
}

.sidebar-link .nav-badge {
    margin-left: auto;
    background: var(--primary-500);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border-subtle);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    width: 42px;
    height: 42px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2rem;
    backdrop-filter: blur(12px);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.sidebar-toggle:hover {
    background: var(--surface-glass);
    border-color: var(--primary-400);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: hsla(0, 0%, 0%, 0.5);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration-normal) var(--ease-smooth);
    }
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

/* ── Header ───────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
    transition: left var(--duration-normal) var(--ease-smooth);
}

@media (max-width: 768px) {
    .app-header {
        left: 0;
        padding: 0 16px 0 64px;
    }
}

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

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.header-breadcrumb a {
    color: var(--text-secondary);
}

.header-breadcrumb .separator {
    color: var(--text-tertiary);
}

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

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-smooth);
    position: relative;
}

.header-icon-btn:hover {
    background: var(--surface-glass);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.header-icon-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-400);
    border: 2px solid var(--surface-card);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.header-user:hover {
    background: var(--surface-glass);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.header-user-info {
    line-height: 1.2;
}

.header-user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.header-user-role {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--duration-normal) var(--ease-smooth);
}

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

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

.stat-icon.primary { background: hsla(245, 80%, 60%, 0.15); color: var(--primary-300); }
.stat-icon.success { background: var(--success-bg); color: var(--success-400); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning-400); }
.stat-icon.danger  { background: var(--danger-bg); color: var(--danger-400); }
.stat-icon.info    { background: var(--info-bg); color: var(--info-400); }
.stat-icon.accent  { background: hsla(185, 90%, 55%, 0.12); color: var(--accent-400); }

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--success-400); }
.stat-change.down { color: var(--danger-400); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    color: white;
    box-shadow: 0 2px 8px hsla(245, 80%, 50%, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-400), var(--primary-300));
    box-shadow: 0 4px 16px hsla(245, 80%, 50%, 0.35);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-glass);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: var(--surface-elevated);
    border-color: var(--border-strong);
}

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

.btn-danger:hover {
    background: var(--danger-400);
    box-shadow: 0 4px 12px hsla(350, 80%, 50%, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-glass);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Forms ────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--duration-fast) var(--ease-smooth);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px hsla(245, 80%, 60%, 0.15);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger-400);
    margin-top: 4px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ── Tables ───────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.table th {
    background: var(--surface-elevated);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table tbody tr {
    transition: background var(--duration-fast) var(--ease-smooth);
}

.table tbody tr:hover {
    background: var(--surface-glass);
}

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

/* ── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

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

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

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

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

.badge-neutral {
    background: hsla(220, 20%, 50%, 0.15);
    color: var(--text-secondary);
}

.badge-primary {
    background: hsla(245, 80%, 60%, 0.15);
    color: var(--primary-300);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success-400);
    box-shadow: 0 0 6px var(--success-400);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--text-tertiary);
}

.status-dot.warning {
    background: var(--warning-400);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Progress Bars ────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--neutral-800);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500), var(--accent-400));
    transition: width var(--duration-slow) var(--ease-smooth);
    position: relative;
}

.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.15), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.success .progress-fill {
    background: linear-gradient(90deg, var(--success-500), var(--success-400));
}

.progress-bar.danger .progress-fill {
    background: linear-gradient(90deg, var(--danger-500), var(--danger-400));
}

/* ── Tabs ─────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
    white-space: nowrap;
    font-family: var(--font-sans);
}

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

.tab.active {
    color: var(--primary-300);
    border-bottom-color: var(--primary-400);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--duration-normal) var(--ease-smooth);
}

/* ── Pagination ───────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: var(--surface-glass);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.pagination-btn.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0 12px;
}

/* ── Modals ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: hsla(0, 0%, 0%, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface-overlay);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--duration-normal) var(--ease-spring);
    box-shadow: var(--shadow-xl);
}

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

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.modal-close:hover {
    background: var(--surface-glass);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ── Toast Notifications ──────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface-overlay);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--duration-normal) var(--ease-spring);
}

.toast.success { border-left: 3px solid var(--success-400); }
.toast.error   { border-left: 3px solid var(--danger-400); }
.toast.warning { border-left: 3px solid var(--warning-400); }
.toast.info    { border-left: 3px solid var(--info-400); }

.toast-message {
    flex: 1;
    font-size: 0.85rem;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* ── Loading Skeleton ─────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--neutral-800) 25%,
        var(--neutral-700) 50%,
        var(--neutral-800) 75%
    );
    background-size: 200% 100%;
    animation: skeletonWave 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-circle {
    border-radius: 50%;
}

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

/* ── Empty State ──────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state .empty-description {
    font-size: 0.9rem;
    max-width: 360px;
    margin: 0 auto 20px;
}

/* ── Search Bar ───────────────────────────────────────── */
.search-bar {
    position: relative;
    max-width: 360px;
}

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

.search-bar .form-input {
    padding-left: 38px;
}

/* ── Grid Utilities ───────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Flex Utilities ───────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ── Spacing Utilities ────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Scrollbar Styling ────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--neutral-700);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-600);
}

/* ── Login Page ───────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}

.login-card {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow-glow);
}

.login-logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Video player for camera */
.video-container {
    position: relative;
    background: var(--neutral-950);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, hsla(0, 0%, 0%, 0.7));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* File previewer */
.file-preview {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--neutral-950);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.file-preview img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.file-info-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    font-size: 0.875rem;
}

.file-info-grid dt {
    color: var(--text-secondary);
    font-weight: 500;
}

.file-info-grid dd {
    color: var(--text-primary);
    word-break: break-all;
}

/* ── Print Styles ─────────────────────────────────────── */
@media print {
    .sidebar, .app-header, .sidebar-toggle {
        display: none !important;
    }
    .app-content {
        margin-left: 0 !important;
    }
    .app-main {
        padding-top: 0 !important;
    }
    body {
        background: white;
        color: black;
    }
}
