/* ========================================
   EduSched AI — Premium Design
   Aurora Login + Red Sidebar Dashboard
   ======================================== */

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

/* ========================================
   CSS VARIABLES - LIGHT MODE
   ======================================== */
:root {
    --primary: #E53935;
    --primary-hover: #C62828;
    --primary-glow: rgba(229, 57, 53, 0.3);
    --primary-light: #FF6F61;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Aurora BG */
    --aurora-1: #667eea;
    --aurora-2: #764ba2;
    --aurora-3: #f093fb;
    --aurora-4: #48c6ef;
    --aurora-5: #6f86d6;
    --bg-base: #0f0e17;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-bg-strong: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-border-strong: rgba(255, 255, 255, 0.35);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --glass-blur: 24px;
    --glass-blur-strong: 32px;

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-bg: linear-gradient(180deg, #E53935 0%, #C62828 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.12);
    --sidebar-active: rgba(255, 255, 255, 0.2);

    /* Dashboard */
    --dash-bg: #f4f6fb;
    --topbar-bg: rgba(255, 255, 255, 0.85);
    --topbar-shadow: 0 1px 8px rgba(99, 102, 241, 0.06);
    --card-bg: #ffffff;
    --card-shadow: 0 2px 16px rgba(99, 102, 241, 0.06);
    --card-radius: 16px;

    /* Text */
    --text-primary: #1a202c;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-placeholder: #cbd5e1;
    --text-on-glass: rgba(255, 255, 255, 0.92);

    /* Error */
    --error-bg: rgba(239, 68, 68, 0.12);
    --error-text: #dc2626;
    --error-border: #f87171;

    /* Footer */
    --footer-color: rgba(148, 163, 184, 0.7);

    /* General */
    --border-color: #e8ecf4;
    --input-bg: rgba(255, 255, 255, 0.5);
    --input-border: rgba(255, 255, 255, 0.4);

    /* Stat Colors */
    --stat-green: linear-gradient(135deg, #34d399, #10b981);
    --stat-blue: linear-gradient(135deg, #60a5fa, #3b82f6);
    --stat-orange: linear-gradient(135deg, #fb923c, #f97316);
    --stat-red: linear-gradient(135deg, #f87171, #ef4444);
    --stat-yellow: linear-gradient(135deg, #fbbf24, #eab308);
    --stat-emerald: linear-gradient(135deg, #34d399, #059669);
    --stat-teal: linear-gradient(135deg, #2dd4bf, #14b8a6);
    --stat-pink: linear-gradient(135deg, #f472b6, #ec4899);
}

/* ========================================
   DARK MODE
   ======================================== */
[data-theme="dark"] {
    --aurora-1: #3730a3;
    --aurora-2: #581c87;
    --aurora-3: #9333ea;
    --aurora-4: #1e40af;
    --aurora-5: #4338ca;
    --bg-base: #030014;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-strong: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

    --sidebar-bg: linear-gradient(180deg, #B71C1C 0%, #7f1d1d 100%);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.18);

    --dash-bg: #0f172a;
    --topbar-bg: rgba(15, 23, 42, 0.8);
    --topbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-placeholder: #334155;

    --error-bg: rgba(239, 68, 68, 0.15);
    --error-text: #fca5a5;
    --error-border: rgba(239, 68, 68, 0.4);

    --border-color: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: color 0.4s ease;
}

::selection {
    background: var(--primary);
    color: white;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(229, 57, 53, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 57, 53, 0.5);
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* ========================================
   AURORA MESH BACKGROUND
   ======================================== */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

[data-theme="dark"] .aurora-blob {
    opacity: 0.35;
}

.aurora-1 {
    width: 600px;
    height: 600px;
    background: var(--aurora-1);
    top: -15%;
    left: -10%;
    animation: aurora1 20s infinite;
}

.aurora-2 {
    width: 500px;
    height: 500px;
    background: var(--aurora-2);
    top: 50%;
    right: -15%;
    animation: aurora2 25s infinite;
}

.aurora-3 {
    width: 450px;
    height: 450px;
    background: var(--aurora-3);
    bottom: -10%;
    left: 30%;
    animation: aurora3 18s infinite;
}

.aurora-4 {
    width: 350px;
    height: 350px;
    background: var(--aurora-4);
    top: 20%;
    right: 25%;
    animation: aurora4 22s infinite;
}

.aurora-5 {
    width: 280px;
    height: 280px;
    background: var(--aurora-5);
    bottom: 30%;
    left: 5%;
    animation: aurora5 16s infinite;
}

@keyframes aurora1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    25% {
        transform: translate(100px, 50px) scale(1.1)
    }

    50% {
        transform: translate(50px, 120px) scale(.95)
    }

    75% {
        transform: translate(-50px, 80px) scale(1.05)
    }
}

@keyframes aurora2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    33% {
        transform: translate(-80px, -60px) scale(1.15)
    }

    66% {
        transform: translate(40px, -100px) scale(.9)
    }
}

@keyframes aurora3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    50% {
        transform: translate(80px, -60px) scale(1.2)
    }
}

@keyframes aurora4 {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    25% {
        transform: translate(-60px, 40px) scale(1.1)
    }

    75% {
        transform: translate(70px, -30px) scale(.85)
    }
}

@keyframes aurora5 {

    0%,
    100% {
        transform: translate(0, 0)
    }

    50% {
        transform: translate(50px, -60px) scale(1.15)
    }
}

/* Sparkle Particles */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
    animation: sparkleFloat linear infinite;
    opacity: 0;
}

.sparkle-1 {
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s
}

.sparkle-2 {
    left: 20%;
    animation-duration: 10s;
    animation-delay: 1s
}

.sparkle-3 {
    left: 35%;
    animation-duration: 7s;
    animation-delay: 2s
}

.sparkle-4 {
    left: 50%;
    animation-duration: 9s;
    animation-delay: .5s
}

.sparkle-5 {
    left: 60%;
    animation-duration: 11s;
    animation-delay: 3s
}

.sparkle-6 {
    left: 75%;
    animation-duration: 8s;
    animation-delay: 1.5s
}

.sparkle-7 {
    left: 85%;
    animation-duration: 12s;
    animation-delay: 2.5s
}

.sparkle-8 {
    left: 5%;
    animation-duration: 9s;
    animation-delay: 4s
}

.sparkle-9 {
    left: 45%;
    animation-duration: 7s;
    animation-delay: 3.5s
}

.sparkle-10 {
    left: 90%;
    animation-duration: 10s;
    animation-delay: .8s
}

.sparkle-11 {
    left: 30%;
    animation-duration: 6s;
    animation-delay: 5s
}

.sparkle-12 {
    left: 70%;
    animation-duration: 8s;
    animation-delay: 2.2s
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0
    }

    10% {
        opacity: 1
    }

    50% {
        opacity: .6
    }

    90% {
        opacity: .2
    }

    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0
    }
}

/* Grid Overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

[data-theme="dark"] .grid-overlay {
    opacity: 0.5;
}

/* ========================================
   THEME TOGGLE (Login)
   ======================================== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--glass-shadow);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 20px var(--primary-glow);
}

.theme-toggle:active {
    transform: scale(0.9);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--text-on-glass);
}

.icon-sun {
    display: none;
}

.icon-moon {
    display: block;
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

/* ========================================
   LOGIN CARD — Premium Glass
   ======================================== */
.login-card {
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 48px 44px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 10;
    animation: cardAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(var(--glass-blur-strong));
    -webkit-backdrop-filter: blur(var(--glass-blur-strong));
    overflow: hidden;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 180deg at 50% 50%, transparent 0deg, var(--primary-glow) 60deg, transparent 120deg, var(--accent-glow) 200deg, transparent 260deg, var(--primary-glow) 320deg, transparent 360deg);
    opacity: 0.15;
    animation: glowRotate 10s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowRotate {
    from {
        transform: rotate(0deg)
    }

    to {
        transform: rotate(360deg)
    }
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(.9)
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

/* Logo */
.login-logo {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    position: relative;
    box-shadow: 0 8px 25px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: logoBreathe 4s ease-in-out infinite;
}

.login-logo svg {
    width: 38px;
    height: 38px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-ring {
    position: absolute;
    inset: -6px;
    border-radius: 26px;
    border: 2px solid rgba(229, 57, 53, 0.2);
    animation: ringPulse 3s ease-in-out infinite;
}

@keyframes logoBreathe {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px var(--primary-glow)
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 12px 35px var(--primary-glow)
    }
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .6
    }

    50% {
        transform: scale(1.1);
        opacity: 0
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-on-glass), rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

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

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text-on-glass);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(229, 57, 53, 0.1);
    background: var(--glass-bg-strong);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    z-index: 2;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.3s;
}

.password-toggle:hover svg {
    color: rgba(255, 255, 255, 0.7);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.btn-arrow svg {
    width: 20px;
    height: 20px;
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

/* Footer */
.login-footer {
    margin-top: 28px;
    text-align: center;
}

/* ========================================
   DELETE BUTTON UI
   ======================================== */
.btn-delete-selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;

    /* สไตล์สีแดงแบบ Outline */
    border: 1px solid #ef4444;
    background: white;
    color: #ef4444;

    font-weight: 500;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-right: 8px;

    /* แสดงตลอดเวลา */
    pointer-events: auto;
    opacity: 1;
    scale: 1;
}

.btn-delete-selected:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-delete-selected.active {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ========================================
   DASHBOARD TABS & FORMS (Reference UI)
   ======================================== */

/* --- Page Header --- */
.page-header-block {
    margin-bottom: 20px;
}

.page-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    text-decoration: none;
}

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

.btn-back svg {
    width: 20px;
    height: 20px;
}

.page-header-info h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.page-header-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* --- Tab Navigation --- */
.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- View Tab: Toolbar --- */
.view-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 140px;
}

.search-box {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #16a34a;
    background: white;
    color: #16a34a;
    font-weight: 500;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-export:hover {
    background: #16a34a;
    color: white;
}

.btn-export svg {
    width: 16px;
    height: 16px;
}

/* --- View Tab: Data Table --- */
.data-card {
    background: white;
    border-radius: 16px;
    overflow-x: auto;
    /* Enable horizontal scrolling */
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: none;
    background: #fafbfc;
}

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

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

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

.row-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: #f0f9ff;
    color: #0284c7;
}

.btn-edit:hover {
    background: #0284c7;
    color: white;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

.btn-edit svg,
.btn-delete svg {
    width: 15px;
    height: 15px;
}

/* Pagination */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: #fafbfc;
}

.table-footer select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    background: white;
}

/* --- Add Tab: Form --- */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);

    /* Updated for centering */
    max-width: 860px;
    margin: 2rem auto;
    width: calc(100% - 40px);
    display: block;
    position: relative;
}

.form-row {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: white;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.08);
}

select.form-control {
    appearance: auto;
    cursor: pointer;
}

.form-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-submit-lg {
    flex: 1;
    padding: 15px 32px;
    background: linear-gradient(135deg, #E53935 0%, #FF6F61 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(229, 57, 53, 0.3);
}

.btn-submit-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 57, 53, 0.4);
}

.btn-submit-lg svg {
    width: 18px;
    height: 18px;
}

.btn-example {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-example svg {
    width: 16px;
    height: 16px;
}

.btn-reset {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

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

/* --- Import Tab --- */
.import-subtabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.import-subtab {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-subtab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.import-subtab svg {
    width: 14px;
    height: 14px;
}

/* Template download */
.template-section {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.template-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.template-header svg {
    width: 20px;
    height: 20px;
    color: #f59e0b;
}

.template-header h4 {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.template-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

.btn-download-template {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: #16a34a;
    color: white;
    font-weight: 600;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download-template:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.btn-download-template svg {
    width: 16px;
    height: 16px;
}

/* Upload drop zone */
.upload-area {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(229, 57, 53, 0.02);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area .upload-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f1f5f9;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area .upload-icon-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.upload-area .upload-text-main {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.upload-area .upload-text-sub {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.upload-area .selected-file {
    color: var(--primary);
    font-weight: 500;
}

.btn-import-submit {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 14px 32px;
    background: linear-gradient(135deg, #E53935 0%, #FF6F61 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(229, 57, 53, 0.3);
}

.btn-import-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 57, 53, 0.4);
}

/* Current data preview */
.current-data-section {
    margin-top: 24px;
}

.current-data-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.current-data-header svg {
    width: 18px;
    height: 18px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.footer-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.footer-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
}

.footer-divider small {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Error */
.error-message {
    background: var(--error-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--error-text);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid var(--error-border);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-6px)
    }

    75% {
        transform: translateX(6px)
    }
}

/* ========================================
   LOGIN — LIGHT MODE OVERRIDES
   ======================================== */
.login-body {
    background: linear-gradient(135deg, #fce4ec 0%, #e8eaf6 25%, #e0f7fa 50%, #f3e5f5 75%, #fff3e0 100%);
}

.login-body .aurora-blob {
    opacity: 0.5;
    mix-blend-mode: normal;
    filter: blur(100px);
}

.login-body .aurora-1 {
    background: #f8bbd0;
}

.login-body .aurora-2 {
    background: #b39ddb;
}

.login-body .aurora-3 {
    background: #80deea;
}

.login-body .aurora-4 {
    background: #f48fb1;
}

.login-body .aurora-5 {
    background: #ce93d8;
}

.login-body .sparkle {
    background: rgba(229, 57, 53, 0.4);
    box-shadow: 0 0 6px 2px rgba(229, 57, 53, 0.15);
}

.login-body .grid-overlay {
    opacity: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card .card-glow {
    opacity: 0.05;
}

.login-header h1 {
    background: linear-gradient(135deg, #1a202c, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: #64748b;
}

.form-group label {
    color: #475569;
}

.input-icon {
    color: #94a3b8;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-group input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.password-toggle svg {
    color: #94a3b8;
}

.password-toggle:hover svg {
    color: #475569;
}

.footer-divider span {
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.footer-divider small {
    color: #94a3b8;
}

.login-footer p {
    color: #94a3b8;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.theme-toggle svg {
    color: #475569;
}

/* ========================================
   LOGIN — DARK MODE OVERRIDES
   ======================================== */
[data-theme="dark"] .login-body {
    background: #070b1e;
}

[data-theme="dark"] .login-body .aurora-blob {
    opacity: 0.2;
    mix-blend-mode: screen;
    filter: blur(80px);
}

[data-theme="dark"] .login-body .aurora-1 {
    background: #3730a3;
}

[data-theme="dark"] .login-body .aurora-2 {
    background: #581c87;
}

[data-theme="dark"] .login-body .aurora-3 {
    background: #9333ea;
}

[data-theme="dark"] .login-body .aurora-4 {
    background: #1e40af;
}

[data-theme="dark"] .login-body .aurora-5 {
    background: #4338ca;
}

[data-theme="dark"] .login-body .sparkle {
    background: white;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .login-body .grid-overlay {
    opacity: 0.3;
}

[data-theme="dark"] .login-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

[data-theme="dark"] .login-card .card-glow {
    opacity: 0.1;
}

[data-theme="dark"] .login-header h1 {
    background: linear-gradient(135deg, #f1f5f9, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .login-header p {
    color: rgba(148, 163, 184, 0.7);
}

[data-theme="dark"] .form-group label {
    color: rgba(203, 213, 225, 0.7);
}

[data-theme="dark"] .input-icon {
    color: rgba(148, 163, 184, 0.5);
}

[data-theme="dark"] .form-group input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .form-group input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

[data-theme="dark"] .form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

[data-theme="dark"] .password-toggle svg {
    color: rgba(148, 163, 184, 0.5);
}

[data-theme="dark"] .password-toggle:hover svg {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .footer-divider span {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.08), transparent);
}

[data-theme="dark"] .footer-divider small {
    color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .login-footer p {
    color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .theme-toggle svg {
    color: #e2e8f0;
}

/* ========================================
   POPUP / ALERT MODAL
   ======================================== */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-card {
    background: white;
    border-radius: 20px;
    padding: 36px 40px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

[data-theme="dark"] .popup-card {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.popup-close:hover {
    color: #475569;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .popup-close:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.popup-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: popupBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.popup-icon.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.popup-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.popup-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

@keyframes popupBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 6px;
}

[data-theme="dark"] .popup-title {
    color: #f1f5f9;
}

.popup-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 24px;
}

[data-theme="dark"] .popup-subtitle {
    color: #94a3b8;
}

.popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.popup-btn {
    padding: 10px 32px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.popup-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.popup-btn-cancel:hover {
    background: #e2e8f0;
}

[data-theme="dark"] .popup-btn-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .popup-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.popup-btn-confirm {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.popup-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.popup-btn-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.popup-btn-error:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ========================================
   DASHBOARD PAGE — Aurora-themed
   ======================================== */
.dashboard-body {
    min-height: 100vh;
    background: var(--dash-bg);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(240, 147, 251, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(72, 198, 239, 0.06) 0%, transparent 50%);
    transition: background 0.4s ease;
    position: relative;
}

[data-theme="dark"] .dashboard-body {
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(147, 51, 234, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(30, 64, 175, 0.04) 0%, transparent 50%);
}

/* ========================================
   SIDEBAR — Red/Coral Theme
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(229, 57, 53, 0.15);
}

.sidebar-header {
    padding: 16px 16px 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 22px;
    height: 22px;
    color: white;
}

.sidebar-title h2 {
    font-size: 0.88rem;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* ========================================
   STUDENT ADD FORM (Custom)
   ======================================== */
.page-header-custom {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-back:hover {
    background: var(--bg-base);
    transform: translateX(-2px);
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.header-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Action Tabs */
.action-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

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

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

.tab-btn.active {
    background: #ff1744;
    /* Bright Red/Pink from screenshot */
    color: white;
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.3);
}

/* Form Card (Custom Section) */
.form-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);

    /* บังคับให้จัดกึ่งกลาง (แก้ปัญหาโค้ดทับกัน) */
    max-width: 860px;
    width: 95%;
    margin: 2rem auto;
    display: block;
}

.custom-form {
    max-width: 100%;
}

.custom-group {
    margin-bottom: 24px;
}

.custom-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
}

.custom-group input,
.custom-group select {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #2d3748;
    transition: all 0.2s;
    outline: none;
}

.custom-group input:focus,
.custom-group select:focus {
    border-color: #ff1744;
    box-shadow: 0 0 0 3px rgba(255, 23, 68, 0.1);
}

.select-wrapper {
    position: relative;
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #a0aec0;
    pointer-events: none;
}

.input-with-icon {
    position: relative;
}

.input-icon-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #a0aec0;
    pointer-events: none;
}

.custom-group select {
    appearance: none;
    -webkit-appearance: none;
}

.error-text {
    color: #ff1744;
    font-size: 0.85rem;
    margin-top: -16px;
    margin-bottom: 24px;
    font-weight: 500;
}

.btn-submit-large {
    width: 100%;
    padding: 16px;
    background: #ff3d00;
    /* Deep Orange/Red */
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 61, 0, 0.3);
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-submit-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 61, 0, 0.4);
}

/* Floating Chat Button */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #4C6FFF;
    /* Blue/Indigo */
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(76, 111, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
}

.floating-chat-btn svg {
    width: 28px;
    height: 28px;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-collapse-btn svg {
    width: 18px;
    height: 18px;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1.5px;
    padding: 16px 12px 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 1px;
    min-height: 40px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nav-item svg:first-child {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    min-width: 20px;
}

.nav-text {
    transition: opacity 0.2s ease, width 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-arrow {
    width: 16px !important;
    height: 16px !important;
    margin-left: auto;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-item {
    color: rgba(255, 255, 255, 0.5);
}

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

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

/* ========================================
   TOP BAR
   ======================================== */
.topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--topbar-shadow);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-accent {
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 4px;
}

.topbar-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-info:hover {
    box-shadow: var(--card-shadow);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.user-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin-left: 4px;
    transition: transform 0.3s ease;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-info.active {
    background: var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.user-info.active .user-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

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

.dropdown-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar.small {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.user-name.small {
    font-size: 0.9rem;
}

.user-email.small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--dash-bg);
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Dashboard Content */
.dashboard-content {
    padding: 24px 28px;
}

/* ========================================
   WELCOME BANNER
   ======================================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), #FF7043);
    border-radius: var(--card-radius);
    padding: 32px 36px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.25);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.welcome-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

.welcome-date {
    position: absolute;
    top: 50%;
    right: 36px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
}

.welcome-date svg {
    width: 18px;
    height: 18px;
}

/* Decorative banner circles */
.banner-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.banner-circle-1 {
    width: 200px;
    height: 200px;
    top: -80px;
    right: -40px;
}

.banner-circle-2 {
    width: 120px;
    height: 120px;
    bottom: -40px;
    right: 120px;
}

.banner-circle-3 {
    width: 80px;
    height: 80px;
    top: -20px;
    right: 200px;
    background: rgba(255, 255, 255, 0.04);
}

/* ========================================
   STAT CARDS — Colorful
   ======================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    border-radius: var(--card-radius);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Card colors */
.stat-green {
    background: var(--stat-green);
}

.stat-blue {
    background: var(--stat-blue);
}

.stat-orange {
    background: var(--stat-orange);
}

.stat-red {
    background: var(--stat-red);
}

.stat-yellow {
    background: var(--stat-yellow);
}

.stat-emerald {
    background: var(--stat-emerald);
}

.stat-teal {
    background: var(--stat-teal);
}

.stat-pink {
    background: var(--stat-pink);
}

.stat-card-inner {
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.stat-label span {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

/* Background SVG icon */
.stat-card-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 70px;
    height: 70px;
    opacity: 0.15;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.stat-card-icon svg {
    width: 100%;
    height: 100%;
    color: white;
}

.stat-card:hover .stat-card-icon {
    opacity: 0.25;
    transform: scale(1.1) rotate(5deg);
}

/* ========================================
   SIDEBAR COLLAPSED STATE
   ======================================== */
.sidebar-collapsed .sidebar {
    width: 64px;
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-arrow {
    opacity: 0;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sidebar-collapsed .sidebar-header {
    padding: 14px 0;
    justify-content: center;
    gap: 0;

}

.sidebar-collapsed .sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.sidebar-collapsed .sidebar-nav {
    padding: 6px;
}

.sidebar-collapsed .nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    gap: 0;
    min-height: 42px;
    width: 100%;
    margin: 0;
}

.sidebar-collapsed .nav-item svg:first-child {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
    display: block;
    margin: 0 auto;
}

.sidebar-collapsed .sidebar-footer {
    padding: 8px 6px;
}

.sidebar-collapsed .main-content {
    margin-left: 64px;
}

/* ========================================
   DASHBOARD THEME TOGGLE
   ======================================== */
.theme-toggle-dash {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-dash:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--primary-glow);
}

.theme-toggle-dash svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.theme-toggle-dash:hover svg {
    color: var(--primary);
}

.theme-toggle-dash .icon-sun {
    display: none;
}

.theme-toggle-dash .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle-dash .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle-dash .icon-moon {
    display: none;
}

/* ========================================
   MOBILE MENU BUTTON
   ======================================== */
.topbar-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.topbar-menu-btn:hover {
    background: var(--dash-bg);
}

.topbar-menu-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 36px 28px 28px;
        margin: 12px;
        border-radius: 24px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }

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

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        z-index: 200;
    }

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

    .sidebar.open .sidebar-title,
    .sidebar.open .nav-section-title,
    .sidebar.open .nav-text,
    .sidebar.open .nav-arrow {
        opacity: 1;
        width: auto;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .topbar-menu-btn {
        display: flex;
    }

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

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

    .topbar {
        padding: 12px 20px;
    }

    .dashboard-content {
        padding: 20px;
    }

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

    .welcome-banner {
        padding: 24px;
    }

    .welcome-text h2 {
        font-size: 1.2rem;
    }

    .welcome-date {
        position: static;
        transform: none;
        margin-top: 12px;
        display: inline-flex;
    }

    .sidebar.open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .user-info>div:last-of-type {
        display: none;
    }

    .user-chevron {
        display: none;
    }

    .login-card {
        padding: 32px 24px 24px;
    }

    .welcome-banner {
        padding: 20px;
    }

    .welcome-text h2 {
        font-size: 1.1rem;
    }
}

/* ========================================
   RESPONSIVE: TABS & DATA PAGES
   ======================================== */
@media (max-width: 768px) {
    .page-header-top {
        gap: 12px;
    }

    .page-header-info h2 {
        font-size: 1.3rem;
    }

    .tab-navigation {
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .view-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .filter-select {
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .btn-export {
        width: 100%;
        justify-content: center;
    }

    .data-table th,
    .data-table td {
        padding: 10px 10px;
        font-size: 0.82rem;
    }

    .form-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .btn-submit-lg {
        width: 100%;
        flex: unset;
    }

    .upload-area {
        padding: 32px 16px;
    }

    .template-section {
        padding: 16px 18px;
    }

    .import-subtabs {
        width: 100%;
    }

    .import-subtab {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-header-info h2 {
        font-size: 1.1rem;
    }

    .tab-btn {
        padding: 7px 10px;
        font-size: 0.78rem;
        gap: 4px;
    }

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

    .data-table th:first-child,
    .data-table td:first-child {
        display: none;
    }

    .action-btns {
        gap: 4px;
    }

    .btn-edit,
    .btn-delete {
        width: 28px;
        height: 28px;
    }

    .form-row[style*="display:flex"] {
        flex-direction: column !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-example {
        width: 100%;
        justify-content: center;
    }

    .btn-reset {
        width: 100%;
    }

    .dashboard-content {
        padding: 14px;
    }

    .table-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ========================================
   QUICK START CARD
   ======================================== */
.quick-start-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.quick-start-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.quick-start-icon {
    font-size: 1.5rem;
}

.quick-start-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.quick-start-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.quick-start-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.quick-start-btn:hover {
    background: #334155;
    transform: translateY(-1px);
}

[data-theme="dark"] .quick-start-btn {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .quick-start-btn:hover {
    background: #f1f5f9;
}

@media (max-width: 640px) {
    .quick-start-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
    }

    .quick-start-btn {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   DASHBOARD GLASSMORPHISM
   ======================================== */

/* --- Aurora Background --- */
.dashboard-body {
    background: linear-gradient(135deg, #fce4ec 0%, #e8eaf6 25%, #e0f7fa 50%, #f3e5f5 75%, #fff3e0 100%);
}

[data-theme="dark"] .dashboard-body {
    background: #030014;
}

.dashboard-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dashboard-aurora .aurora-blob {
    opacity: 0.4;
    filter: blur(100px);
    mix-blend-mode: normal;
}

[data-theme="dark"] .dashboard-aurora .aurora-blob {
    opacity: 0.2;
    mix-blend-mode: screen;
}

/* Light-mode sparkles (visible on light bg) */
.dashboard-body .sparkle {
    background: rgba(229, 57, 53, 0.35);
    box-shadow: 0 0 6px 2px rgba(229, 57, 53, 0.12);
}

[data-theme="dark"] .dashboard-body .sparkle {
    background: white;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
}

/* --- Content Layer --- */
.sidebar {
    z-index: 100;
}

.main-content {
    position: relative;
    z-index: 1;
}

/* --- Topbar Glass --- */
.topbar {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] .topbar {
    background: rgba(15, 23, 42, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* --- Stat Cards Glass --- */
.stat-card {
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* --- Quick Start Glass --- */
.quick-start-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .quick-start-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* --- Welcome Banner Glass Edge --- */
.welcome-banner {
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 40px rgba(229, 57, 53, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .welcome-banner {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

/* --- User Dropdown Glass --- */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .dropdown-menu {
    background: rgba(15, 23, 42, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* --- Sidebar Glass (Match Header) --- */
.sidebar {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] .sidebar {
    background: rgba(15, 23, 42, 0.6) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2) !important;
}

.sidebar-logo svg {
    color: var(--primary) !important;
    filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.sidebar-title h2 {
    color: var(--text-primary) !important;
}

.sidebar-collapse-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-secondary) !important;
}

.sidebar-collapse-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--primary) !important;
}

[data-theme="dark"] .sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

/* Nav Items on Glass Sidebar */
.nav-section-title {
    color: var(--text-muted) !important;
}

.nav-item {
    color: var(--text-secondary) !important;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--primary) !important;
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    color: white !important;
    box-shadow: 0 4px 12px var(--primary-glow) !important;
}

.nav-item.active svg {
    color: white !important;
}

/* Logo container tweaks for glass */
.sidebar-logo {
    background: rgba(229, 57, 53, 0.1) !important;
    border-radius: 12px;
    padding: 6px;
}

#handToggleBtn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] #handToggleBtn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.4);
}

/* ========================================
   GESTURE CONTROL STYLES
   ======================================== */
#input_video {
    display: none;
}

#output_canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    pointer-events: none;
}

.gesture-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 3px solid #00FF00;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
    transition: width 0.1s, height 0.1s, background-color 0.1s;
    display: none;
}

.gesture-cursor.visible {
    display: block;
}

.gesture-cursor.clicking {
    background-color: rgba(0, 255, 0, 0.6);
    width: 20px;
    height: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.9);
}

/* ========================================
   UI COMPONENTS (Profile/Settings)
   ======================================== */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 12px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    outline: none;
}

.glass-input[readonly] {
    opacity: 0.6;
    cursor: default;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #10b981;
    /* Green success */
    border-color: #10b981;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.setting-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   TABLE FOOTER — Pagination & Rows Per Page
   ======================================== */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin-top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 16px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    gap: 16px;
    flex-wrap: wrap;
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.rows-input {
    width: 64px;
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}

.rows-input::-webkit-outer-spin-button,
.rows-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rows-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--glass-bg-strong);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-page:active:not(:disabled) {
    transform: translateY(0);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: transparent;
}

.btn-page svg {
    width: 16px;
    height: 16px;
}

.page-info {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 6px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
}

/* Responsive table footer */
@media (max-width: 480px) {
    .table-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .rows-per-page,
    .pagination-controls {
        justify-content: center;
    }

    .page-info {
        min-width: unset;
    }
}