/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.95);
    --bg-input: rgba(51, 65, 85, 0.7);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Noto Sans Thai', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Glass Effect */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.app-container.hidden { display: none !important; }
.sidebar {
    width: 260px; background: var(--bg-card); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100;
    transition: width 0.3s ease;
}
.sidebar.collapsed { width: 80px; }

.sidebar-header { 
    padding: 1.5rem; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { display: flex; align-items: center; gap: 0.75rem; overflow: hidden; }
.logo-icon { font-size: 2rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); border-radius: 12px; padding: 0.5rem; flex-shrink: 0; }
.logo-icon.large { font-size: 3rem; padding: 1rem; }
.logo-text { 
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    transition: opacity 0.3s;
}
.sidebar.collapsed .logo-text { opacity: 0; width: 0; display: none; }

.sidebar-toggle {
    background: transparent; border: none; color: var(--text-secondary);
    cursor: pointer; font-size: 1.25rem; padding: 0.25rem;
    border-radius: var(--radius-sm); transition: all 0.2s;
}
.sidebar-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.user-info-section { 
    padding: 1.5rem; display: flex; align-items: center; gap: 1rem; 
    border-bottom: 1px solid var(--border-color); overflow: hidden;
}
.user-avatar { 
    width: 40px; height: 40px; border-radius: 50%; 
    background: var(--bg-input); display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; white-space: nowrap; transition: opacity 0.3s; }
.sidebar.collapsed .user-details { opacity: 0; width: 0; display: none; }
.user-name { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.user-role { color: var(--text-secondary); font-size: 0.75rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0; overflow-x: hidden; }
.nav-section { margin-bottom: 0.5rem; }
.nav-group-title { 
    display: block; padding: 0.75rem 1.5rem 0.5rem; 
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; 
    color: var(--text-secondary); white-space: nowrap;
}
.sidebar.collapsed .nav-group-title { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1.5rem; color: var(--text-secondary); text-decoration: none;
    transition: all 0.2s; border-left: 3px solid transparent;
    overflow: hidden;
}
.sidebar.collapsed .nav-item { padding: 0.75rem; justify-content: center; }
.nav-icon { flex-shrink: 0; font-size: 1.2rem; min-width: 1.5rem; text-align: center; }
.nav-text { white-space: nowrap; transition: opacity 0.3s; }
.sidebar.collapsed .nav-text { opacity: 0; width: 0; display: none; }
.nav-item:hover { color: var(--text-primary); background: rgba(99, 102, 241, 0.1); }
.nav-item.active { color: var(--primary-light); background: rgba(99, 102, 241, 0.15); border-left-color: var(--primary); }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-color); }
.connection-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 2s infinite; }
.connection-status.connected .status-dot { background: var(--success); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.main-content { 
    flex: 1; margin-left: 260px; padding: 2rem; min-height: 100vh; 
    transition: margin-left 0.3s ease;
}
.main-content.collapsed { margin-left: 80px; }
.sidebar.hidden { transform: translateX(-100%); width: 0; opacity: 0; pointer-events: none; }
.main-content.full-width { margin-left: 0 !important; width: 100%; }
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-header { margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; background: linear-gradient(90deg, var(--text-primary), var(--primary-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-header p { color: var(--text-secondary); margin-top: 0.25rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline { background: transparent; color: var(--primary-light); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* Forms */
.form-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.section-title { font-size: 1rem; font-weight: 600; color: var(--primary-light); margin-bottom: 1rem; }
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 1rem; 
}
.form-group { margin-bottom: 0; min-width: 0; }
.form-group.span-full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.required { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.75rem 1rem;
    background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: inherit; font-size: 0.95rem;
    transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.form-group input.readonly-field { background: rgba(51, 65, 85, 0.3); cursor: not-allowed; }
.form-hint { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.checkbox-label input[type="checkbox"] { width: auto; }

/* Flex row for name fields */
.form-row-flex {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-row-flex > div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 120px;
}

/* Utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 2rem; }

/* File Upload */
.file-upload-container { display: flex; align-items: center; gap: 1rem; }
.file-name { color: var(--text-secondary); font-size: 0.85rem; }

/* Photo Section */
.form-photo-section { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; }
.photo-container {
    width: 120px; height: 150px; border-radius: var(--radius-sm);
    background: var(--bg-input); border: 2px dashed var(--border-color);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.photo-container img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { color: var(--text-secondary); font-size: 2.5rem; }

/* Registration Form Layout */
.registration-form { display: grid; grid-template-columns: auto 1fr; gap: 2rem; padding: 2rem; margin-top: 2rem; }
.form-fields { min-width: 0; }

/* Card Reader Section */
.card-reader-section { margin-bottom: 2rem; }
.reader-card { padding: 1.5rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.reader-header { display: flex; align-items: center; gap: 1rem; flex: 1; }
.reader-icon { font-size: 2.5rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); border-radius: 12px; padding: 0.75rem; }
.reader-info h3 { font-size: 1rem; font-weight: 600; }
.reader-info p { font-size: 0.85rem; color: var(--text-secondary); }
.reader-actions { display: flex; gap: 0.75rem; }
.reader-animation { display: none; }
.reader-animation.active { display: block; }
.card-visual { width: 80px; height: 50px; background: linear-gradient(135deg, #fbbf24, #f59e0b); border-radius: 8px; position: relative; overflow: hidden; }
.scan-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary); animation: scan 1.5s infinite; }
@keyframes scan { 0%, 100% { top: 0; } 50% { top: 100%; } }

/* Alert */
.alert { padding: 1rem 1.5rem; border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.alert-info { background: rgba(14, 165, 233, 0.15); border: 1px solid rgba(14, 165, 233, 0.3); }
.alert-icon { font-size: 1.25rem; }
.alert-content strong { display: block; margin-bottom: 0.25rem; }

/* Tables */
.table-container, .student-table-container { overflow-x: auto; padding: 1.5rem; }
.data-table, .student-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td, .student-table th, .student-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th, .student-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); background: rgba(15, 23, 42, 0.5); }
.data-table tr:hover, .student-table tr:hover { background: rgba(99, 102, 241, 0.05); }
.loading-row { text-align: center; color: var(--text-secondary); padding: 3rem !important; }

/* List Controls */
.list-controls { display: flex; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.5rem; margin-bottom: 1rem; align-items: center; }
.search-box { flex: 1; min-width: 200px; padding: 0.75rem 1rem; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); }
.search-box:focus { outline: none; border-color: var(--primary); }
.list-controls select { padding: 0.75rem 1rem; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); }

/* Status Badges */
.status-badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; }
.status-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-approved { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-passed { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.status-failed { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-enrolled { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Action Buttons */
.action-btns { display: flex; gap: 0.5rem; }
.action-btn { width: 32px; height: 32px; border: none; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--bg-input); transition: all 0.2s; }
.action-btn:hover { transform: scale(1.1); }
.action-btn.view { background: rgba(14, 165, 233, 0.2); }
.action-btn.edit { background: rgba(245, 158, 11, 0.2); }
.action-btn.approve { background: rgba(16, 185, 129, 0.2); }
.action-btn.reject { background: rgba(239, 68, 68, 0.2); }
.action-btn.delete { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { padding: 1.5rem; display: flex; align-items: center; gap: 1.25rem; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-5px); }
.stat-icon { font-size: 2.5rem; background: rgba(99, 102, 241, 0.2); border-radius: 12px; padding: 0.75rem; }
.stat-card[data-type="pending"] .stat-icon { background: rgba(245, 158, 11, 0.2); }
.stat-card[data-type="approved"] .stat-icon { background: rgba(16, 185, 129, 0.2); }
.stat-card[data-type="enrolled"] .stat-icon { background: rgba(99, 102, 241, 0.2); }
.stat-info h3 { font-size: 2rem; font-weight: 700; }
.stat-info p { font-size: 0.85rem; color: var(--text-secondary); }
.stats-detail { padding: 1.5rem; margin-bottom: 1.5rem; }
.stats-detail h3 { margin-bottom: 1rem; }
.stats-summary { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-badge { background: var(--bg-input); padding: 0.5rem 1rem; border-radius: var(--radius-sm); }

/* Stats Filter */
.stats-filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.6rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.stats-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.6rem 2.5rem 0.6rem 1.2rem;
    background-color: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.stats-select:hover {
    border-color: var(--primary-light);
    background-color: rgba(51, 65, 85, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.stats-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: var(--bg-card);
}
.stats-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}


/* ===== NEW LOGIN PAGE STYLES ===== */
.login-overlay { 
    position: fixed; 
    inset: 0; 
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    z-index: 99999; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden;
    opacity: 1; /* Force visibility */
    transition: opacity 0.5s ease;
}
.login-overlay.hidden { display: none !important; opacity: 0; }

/* Animated Background Orbs */
.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}
.login-bg-orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}
.login-bg-orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}
.login-bg-orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(20px, 10px) scale(1.05); }
}

/* Login Card */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    margin: 1.5rem;
    padding: 2.5rem;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 1;
}
@keyframes cardAppear {
    from { opacity: 1; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card.hidden { display: none !important; }

/* Login Logo */
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}
.login-logo-icon.small {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    border-radius: 16px;
}
.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(90deg, #f1f5f9, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Login Menu Buttons */
.login-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.login-menu-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}
.login-menu-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(5px);
}
.login-menu-btn-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(99, 102, 241, 0.4);
}
.login-menu-btn-primary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0.5) 100%);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}
.login-menu-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    flex-shrink: 0;
}
.login-menu-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.login-menu-text strong {
    font-size: 1rem;
    font-weight: 600;
}
.login-menu-text small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.login-menu-arrow {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}
.login-menu-btn:hover .login-menu-arrow {
    transform: translateX(5px);
    color: var(--primary-light);
}

/* Login Back Button */
.login-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}
.login-back-btn:hover {
    color: var(--text-primary);
}
.login-back-btn span:first-child {
    font-size: 1.25rem;
}

/* Login Form */
.login-form-new {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.login-form-new.hidden { display: none !important; }

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.login-input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.login-input-icon {
    font-size: 1rem;
}
.login-input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.login-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}
.login-input-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Login Submit Button */
.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}
.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}
.login-submit-btn:active {
    transform: translateY(0);
}
.login-submit-arrow {
    transition: transform 0.3s ease;
}
.login-submit-btn:hover .login-submit-arrow {
    transform: translateX(5px);
}

/* Login Error */
.login-error-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
}
.login-error-box.hidden { display: none !important; }

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.login-footer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Keep old classes for compatibility */
.login-form.hidden { display: none; }
.login-error.hidden { display: none; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { width: 100%; max-width: 600px; margin: 2rem; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 1.25rem; }
.modal-close { width: 32px; height: 32px; border: none; background: transparent; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; border-radius: 6px; transition: all 0.2s; }
.modal-close:hover { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); }

/* Toast */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.75rem; }
.toast { padding: 1rem 1.5rem; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-color); box-shadow: var(--shadow); animation: slideIn 0.3s ease; display: flex; align-items: center; gap: 0.75rem; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* Toggle Switch */
.switch { position: relative; width: 50px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--bg-input); border-radius: 26px; cursor: pointer; transition: 0.3s; }
.slider:before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
input:checked + .slider { background: var(--success); }
input:checked + .slider:before { transform: translateX(24px); }

/* Announcement Controls */
.announcement-controls { display: flex; flex-direction: column; gap: 1.5rem; }
.announcement-item { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; background: var(--bg-input); border-radius: var(--radius-sm); }
.announcement-item h3 { margin-bottom: 0.25rem; }
.announcement-item p { font-size: 0.85rem; color: var(--text-secondary); }

/* Badge */
.badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.badge.active { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 992px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
    .registration-form { grid-template-columns: 1fr; }
    .form-photo-section { flex-direction: row; justify-content: flex-start; padding: 0 0 1.5rem; border-bottom: 1px solid var(--border-color); }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; transition: left 0.3s; }
    .sidebar.open { left: 0; }
    .main-content { margin-left: 0; padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 1.5rem; }
    .registration-form { padding: 1.25rem; gap: 1.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-row-flex { gap: 0.75rem; }
    .form-row-flex > div { min-width: 100%; }
    .stats-grid { grid-template-columns: 1fr; }
    .list-controls { flex-direction: column; }
    .search-box { width: 100%; }
}

@media (max-width: 480px) {
    .form-row-flex > div.flex-none-mobile { flex: none; min-width: 0; width: 100%; }
    .reader-card { padding: 1rem; gap: 1rem; }
    .reader-header { flex-direction: column; align-items: flex-start; text-align: left; }
    .reader-actions { width: 100%; flex-direction: column; }
    .reader-actions .btn { width: 100%; }
}

/* Login Birthdate Enhancement */
#applicantLoginForm .form-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: 0.5rem;
}

#applicantLoginForm select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

#applicantLoginForm select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(51, 65, 85, 0.9);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-pending { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.status-approved { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Guest Header Styles */
.guest-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.sidebar.hidden + .guest-header { display: flex; }
.sidebar.hidden ~ .main-content { padding-top: 90px; }

/* Status Badge mapping */
.status-pending { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.status-approved { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.status-paid { background: rgba(14, 165, 233, 0.2); color: var(--secondary); }
.status-enrolled { background: rgba(99, 102, 241, 0.2); color: var(--primary); }
