/* ============================================================
   STUDENT ATTENDANCE SYSTEM – Main Stylesheet (v2)
   ============================================================ */

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

:root {
    --color-bg: #080e1a;
    --color-surface: #0f1929;
    --color-surface-2: #162035;
    --color-surface-3: #1c2a44;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-active: rgba(99, 179, 237, 0.4);
    --color-primary: #4facfe;
    --color-primary-dark: #0084ff;
    --color-primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --color-topbar-bg: rgba(8, 14, 26, 0.85);
    --color-success: #48bb78;
    --color-success-bg: rgba(72, 187, 120, 0.12);
    --color-warning: #f6ad55;
    --color-warning-bg: rgba(246, 173, 85, 0.12);
    --color-error: #fc8181;
    --color-error-bg: rgba(252, 129, 129, 0.12);
    --color-info: #63b3ed;
    --color-info-bg: rgba(99, 179, 237, 0.12);
    --color-purple: #b794f4;
    --color-purple-bg: rgba(183, 148, 244, 0.12);
    --color-teal: #4fd1c5;
    --color-teal-bg: rgba(79, 209, 197, 0.12);
    --color-text-primary: #f0f6ff;
    --color-text-secondary: #8ba7c7;
    --color-text-muted: #5a7a9d;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(79, 172, 254, 0.2);
    --transition: 0.2s ease;
}

[data-theme="light"] {
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-surface-2: #edf2f7;
    --color-surface-3: #e2e8f0;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-active: rgba(49, 130, 206, 0.4);
    --color-primary-gradient: linear-gradient(135deg, #3182ce 0%, #00b5d8 100%);
    --color-topbar-bg: rgba(255, 255, 255, 0.85);
    --color-success-bg: rgba(72, 187, 120, 0.15);
    --color-warning-bg: rgba(237, 137, 54, 0.15);
    --color-error-bg: rgba(229, 62, 62, 0.15);
    --color-info-bg: rgba(49, 130, 206, 0.15);
    --color-purple-bg: rgba(128, 90, 213, 0.15);
    --color-teal-bg: rgba(49, 151, 149, 0.15);
    --color-text-primary: #1a202c;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(49, 130, 206, 0.2);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 20% 20%, rgba(79, 172, 254, 0.07) 0%, transparent 60%), radial-gradient(ellipse 60% 40% at 80% 70%, rgba(183, 148, 244, 0.06) 0%, transparent 60%), radial-gradient(ellipse 40% 30% at 50% 50%, rgba(79, 209, 197, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0
}

.view {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1
}

.view.active {
    display: flex
}

/* ---- TOP BAR ---- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--color-topbar-bg);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 100
}

.top-bar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text-primary);
    text-decoration: none
}

.top-bar-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px
}

.top-bar-clock {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px
}

.live-clock {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em
}

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

/* ---- OTP BANNER ---- */
#demo-otp-banner {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 99;
    background: linear-gradient(90deg, #f6ad55, #ed8936);
    color: #1a1a1a;
    text-align: center;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 12px rgba(246, 173, 85, 0.4);
    animation: slideDown 0.3s ease
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0
    }

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

/* ---- TOAST ---- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    max-width: 360px
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-primary);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0
}

.toast.show {
    transform: translateX(0);
    opacity: 1
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0
}

.toast-success {
    border-left: 3px solid var(--color-success)
}

.toast-error {
    border-left: 3px solid var(--color-error)
}

.toast-info {
    border-left: 3px solid var(--color-info)
}

.toast-warning {
    border-left: 3px solid var(--color-warning)
}

/* ---- LOADER ---- */
#global-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 26, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(79, 172, 254, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.loader-ring+span {
    color: var(--color-text-secondary);
    font-size: 0.9rem
}

/* ---- MODAL ---- */
#modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: 24px
}

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

.modal-box {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(79, 172, 254, 0.1);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0
}

.modal-body {
    padding: 20px 24px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    overflow-y: auto
}

.modal-body p {
    margin-bottom: 8px
}

.modal-body strong {
    color: var(--color-text-primary)
}

.modal-time {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem
}

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

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important
}

.btn:not(:disabled):hover {
    transform: translateY(-1px)
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm)
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: #080e1a;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.35)
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5)
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: #080e1a;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3)
}

.btn-warning {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: #080e1a;
    box-shadow: 0 4px 15px rgba(246, 173, 85, 0.3)
}

.btn-danger {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    color: #fff;
    box-shadow: 0 4px 15px rgba(252, 129, 129, 0.3)
}

.btn-purple {
    background: linear-gradient(135deg, #b794f4, #9f7aea);
    color: #080e1a;
    box-shadow: 0 4px 12px rgba(183, 148, 244, 0.3)
}

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

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15)
}

.btn-danger-ghost {
    background: transparent;
    color: var(--color-error);
    border: 1px solid rgba(252, 129, 129, 0.3)
}

.btn-danger-ghost:hover {
    background: var(--color-error-bg)
}

.btn-secondary {
    background: var(--color-surface-3);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border)
}

.btn-block {
    width: 100%;
    margin-top: 4px
}

/* ---- FORMS ---- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em
}

.form-input {
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    outline: none;
    appearance: none
}

.form-input:focus {
    border-color: var(--color-border-active);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.12)
}

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

select.form-input {
    cursor: pointer
}

option {
    background: #162035
}

.label-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: none;
    font-weight: 400;
    margin-left: 4px
}

/* ---- CHIPS / BADGES ---- */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4
}

.chip-green {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(72, 187, 120, 0.3)
}

.chip-blue {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid rgba(99, 179, 237, 0.3)
}

.chip-gray {
    background: rgba(90, 122, 157, 0.12);
    color: var(--color-text-muted);
    border: 1px solid rgba(90, 122, 157, 0.2)
}

.chip-red {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(252, 129, 129, 0.3)
}

.chip-purple {
    background: var(--color-purple-bg);
    color: var(--color-purple);
    border: 1px solid rgba(183, 148, 244, 0.3)
}

.chip-teal {
    background: var(--color-teal-bg);
    color: var(--color-teal);
    border: 1px solid rgba(79, 209, 197, 0.3)
}

.chip-warning {
    background: rgba(246, 173, 85, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(246, 173, 85, 0.3)
}

.chip-orange {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3)
}

.chip-indigo {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
    border: 1px solid rgba(129, 140, 248, 0.3)
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15), rgba(0, 242, 254, 0.1));
    color: var(--color-primary);
    border: 1px solid rgba(79, 172, 254, 0.25);
    letter-spacing: 0.03em
}

/* Academic year badge on student cards */
.year-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(246, 173, 85, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(246, 173, 85, 0.25);
    margin-left: 6px;
    vertical-align: middle
}

/* ============================================================
   CLOSED VIEW
   ============================================================ */
#view-closed {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    padding-top: 80px
}

.closed-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 48px 56px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-lg)
}

.closed-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite
}

@keyframes float {

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

    50% {
        transform: translateY(-10px)
    }
}

.closed-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--color-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.closed-card p {
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    line-height: 1.7
}

.closed-hours {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--color-primary-gradient);
    color: #080e1a;
    font-weight: 700;
    font-size: 1.1rem
}

.closed-next {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--color-text-muted)
}

.closed-bypass-wrap {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border)
}

/* ============================================================
   LOGIN VIEW
   ============================================================ */
#view-login {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: 80px;
    min-height: 100vh
}

#view-setpassword {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: 80px;
    min-height: 100vh
}

.login-container {
    width: 100%;
    max-width: 460px
}

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

.school-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--color-primary-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.3)
}

.login-hero h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px
}

.login-hero p {
    color: var(--color-text-muted);
    font-size: 0.9rem
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow)
}

/* First-time login notice */
.first-login-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(79, 172, 254, 0.08);
    border: 1px solid rgba(79, 172, 254, 0.2);
    margin-bottom: 16px
}

.first-login-notice span {
    font-size: 1.2rem;
    flex-shrink: 0
}

.first-login-notice p {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    line-height: 1.5
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border)
}

.login-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px
}

.login-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(79, 172, 254, 0.05)
}

.login-tab:hover:not(.active) {
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.03)
}

.login-panel {
    display: none;
    padding: 28px
}

.login-panel.active {
    display: block;
    animation: fadeIn 0.3s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

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

.otp-step2 {
    margin-top: 16px
}

.otp-step2.slide-in {
    animation: fadeIn 0.3s ease
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin: 16px 0
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border)
}

.login-footer {
    padding: 16px 28px;
    text-align: center;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-text-muted)
}

.login-footer a {
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none
}

.login-footer a:hover {
    text-decoration: underline
}

.demo-creds {
    margin-top: 20px;
    padding: 14px;
    background: rgba(183, 148, 244, 0.08);
    border: 1px solid rgba(183, 148, 244, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--color-text-secondary)
}

.demo-creds strong {
    color: var(--color-purple);
    display: block;
    margin-bottom: 6px
}

.demo-creds code {
    background: rgba(183, 148, 244, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem
}

/* ============================================================
   REGISTER VIEW
   ============================================================ */
#view-register {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: 90px;
    min-height: 100vh
}

.register-container {
    width: 100%;
    max-width: 460px
}

.register-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg)
}

.register-header {
    padding: 28px 28px 0;
    text-align: center
}

.register-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px
}

.register-header p {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin-bottom: 24px
}

.register-form-body {
    padding: 0 28px 28px
}

.register-footer {
    padding: 16px 28px;
    text-align: center;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-text-muted)
}

.register-footer a {
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none
}

/* ============================================================
   PARENT DASHBOARD
   ============================================================ */
#view-parent {
    flex-direction: column;
    padding-top: 56px
}

.parent-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px
}

.parent-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #080e1a;
    flex-shrink: 0
}

.parent-header-info h2 {
    font-size: 1rem;
    font-weight: 700
}

.parent-header-info p {
    font-size: 0.8rem;
    color: var(--color-text-muted)
}

.parent-header-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center
}

.parent-content {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%
}

.page-title {
    margin-bottom: 24px
}

.page-title h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px
}

.page-title p {
    color: var(--color-text-muted);
    font-size: 0.88rem
}

.today-banner {
    background: var(--color-primary-gradient);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: #080e1a;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3)
}

.today-banner span {
    font-size: 1.2rem
}

.parent-students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px
}

.student-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition)
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 172, 254, 0.2)
}

.student-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0
}

.student-info {
    flex: 1
}

.student-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px
}

.student-info p {
    font-size: 0.78rem;
    color: var(--color-text-muted)
}

.student-attendance-today {
    display: flex;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border)
}

.att-item {
    flex: 1;
    padding: 12px;
    text-align: center
}

.att-item:first-child {
    border-right: 1px solid var(--color-border)
}

.att-label {
    display: block;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px
}

.att-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 700
}

.att-value.green {
    color: var(--color-success)
}

.att-value.blue {
    color: var(--color-info)
}

.att-value.gray {
    color: var(--color-text-muted)
}

.student-history-toggle {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: background var(--transition)
}

.student-history-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-primary)
}

.toggle-icon {
    font-size: 0.75rem;
    color: var(--color-text-muted)
}

.student-history {
    padding: 0 12px 12px
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--color-text-muted);
    gap: 12px
}

.empty-state .empty-icon {
    font-size: 3rem
}

.empty-state p {
    font-size: 0.9rem
}

.history-table,
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem
}

.history-table th,
.report-table th {
    background: var(--color-surface-3);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap
}

.history-table td,
.report-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary)
}

.history-table tr:hover td,
.report-table tr:hover td {
    background: rgba(255, 255, 255, 0.02)
}

.no-records {
    padding: 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
#view-admin {
    flex-direction: row;
    padding-top: 56px
}

.admin-sidebar {
    width: 240px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    flex-shrink: 0;
    min-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    align-self: flex-start;
    height: calc(100vh - 56px);
    overflow-y: auto
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: var(--color-surface-2)
}

.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--color-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #080e1a;
    flex-shrink: 0
}

.admin-profile-info p:first-child {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2
}

.admin-profile-info p:last-child {
    font-size: 0.7rem;
    color: var(--color-text-muted)
}

.nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 4px 12px 8px;
    margin-top: 8px
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    background: none;
    border: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
    margin-bottom: 2px
}

.nav-item:hover {
    background: var(--color-surface-3);
    color: var(--color-text-primary)
}

.nav-item.active {
    background: rgba(79, 172, 254, 0.12);
    color: var(--color-primary);
    font-weight: 600
}

.nav-item .nav-icon {
    font-size: 1rem;
    flex-shrink: 0
}

.admin-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border)
}

.admin-main {
    flex: 1;
    padding: 24px;
    overflow: hidden;
    min-width: 0
}

.admin-panel {
    display: none;
    animation: fadeIn 0.25s ease
}

.admin-panel.active {
    display: block
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition)
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px
}

.stat-card:nth-child(1)::before {
    background: var(--color-primary-gradient)
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #48bb78, #38f9d7)
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #4facfe, #b794f4)
}

.stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, #fc8181, #f6ad55)
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px
}

.stat-card:nth-child(1) .stat-value {
    color: var(--color-primary)
}

.stat-card:nth-child(2) .stat-value {
    color: var(--color-success)
}

.stat-card:nth-child(3) .stat-value {
    color: var(--color-info)
}

.stat-card:nth-child(4) .stat-value {
    color: var(--color-error)
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em
}

.stat-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.1
}

/* Panel */
.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 800
}

.panel-header-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.search-bar {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px
}

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

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

.table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: auto
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem
}

.attendance-table th {
    background: var(--color-surface-2);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1
}

.attendance-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary);
    vertical-align: middle
}

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

.attendance-table tr:hover td {
    background: rgba(79, 172, 254, 0.04)
}

.table-student {
    display: flex;
    align-items: center;
    gap: 10px
}

.table-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0
}

.student-name-cell {
    font-weight: 600;
    color: var(--color-text-primary)
}

.empty-row {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px !important
}

/* Students / Users list */
.students-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.student-list-card,
.user-list-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color var(--transition)
}

.student-list-card:hover,
.user-list-card:hover {
    border-color: rgba(79, 172, 254, 0.2)
}

.slc-avatar,
.ulc-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0
}

.slc-info,
.ulc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0
}

.slc-info strong,
.ulc-info strong {
    font-size: 0.92rem;
    color: var(--color-text-primary)
}

.slc-info span,
.ulc-info span {
    font-size: 0.78rem;
    color: var(--color-text-muted)
}

.ulc-chips {
    display: flex;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap
}

.ulc-meta {
    font-size: 0.72rem;
    color: var(--color-text-muted)
}

.slc-actions,
.ulc-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap
}

.self-label {
    font-size: 0.78rem;
    color: var(--color-text-muted)
}

.self-you {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.85rem
}

.empty-list {
    padding: 40px;
    text-align: center;
    color: var(--color-text-muted)
}

/* Reports */
.reports-controls {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px
}

.reports-actions {
    grid-column: 1/-1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.report-preview,
.weekly-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px
}

.report-table-wrap {
    overflow-x: auto
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border)
}

/* ============================================================
   Modal form grid (for student add/edit)
   ============================================================ */
.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px
}

.modal-form-grid .form-group {
    margin-bottom: 12px
}

/* ============================================================
   CSV UPLOAD
   ============================================================ */
.csv-drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px
}

.csv-drop-zone:hover,
.csv-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(79, 172, 254, 0.05)
}

.csv-drop-icon {
    font-size: 2.5rem
}

.csv-drop-zone p {
    color: var(--color-text-secondary);
    font-size: 0.88rem
}

.csv-meta {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px
}

.csv-errors {
    color: var(--color-warning)
}

.csv-template-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline
}

/* ============================================================
   LOGIN MANAGEMENT MODAL
   ============================================================ */
.login-mgmt-options {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.lm-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: border-color var(--transition)
}

.lm-option:has(input:checked) {
    border-color: var(--color-border-active);
    background: rgba(79, 172, 254, 0.06)
}

.lm-option input[type="radio"] {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--color-primary)
}

.lm-option label {
    cursor: pointer;
    flex: 1
}

.lm-option label strong {
    display: block;
    font-size: 0.88rem;
    color: var(--color-text-primary);
    margin-bottom: 2px
}

.lm-option label span {
    font-size: 0.78rem;
    color: var(--color-text-muted)
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(max-width:768px) {
    #view-admin {
        flex-direction: column
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        min-height: unset;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 4px;
        align-items: center
    }

    .admin-profile {
        display: none
    }

    .nav-label {
        display: none
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 0.8rem;
        margin-bottom: 0
    }

    .admin-sidebar-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr)
    }

    .reports-controls {
        grid-template-columns: 1fr
    }

    .parent-students-grid {
        grid-template-columns: 1fr
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start
    }

    .panel-header-right {
        width: 100%;
        justify-content: space-between
    }

    .modal-form-grid {
        grid-template-columns: 1fr
    }

    .ulc-actions {
        flex-direction: column;
        align-items: flex-start
    }
}

/* ============================================================
   ANIMATIONS / SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2)
}

::selection {
    background: rgba(79, 172, 254, 0.3)
}

/* ============================================================
   SETTINGS PANEL
   ============================================================ */
#panel-settings {
    max-width: 860px;
}

.settings-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
}

.settings-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.18), rgba(0, 242, 254, 0.1));
    border: 1px solid rgba(79, 172, 254, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0
}

.settings-card-title {
    flex: 1
}

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

.settings-card-title p {
    font-size: 0.8rem;
    color: var(--color-text-muted)
}

.settings-card-body {
    padding: 24px;
}

/* ---- Toggle Switch ---- */
.geo-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0
}

.geo-status-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-muted);
    transition: color var(--transition);
    min-width: 52px;
    text-align: right
}

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

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--color-text-muted);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    border-color: rgba(67, 233, 123, 0.4);
    box-shadow: 0 0 12px rgba(67, 233, 123, 0.35)
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px) translateY(-50%);
    background: #080e1a
}

/* ---- Geo Status Banner ---- */
.geo-status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(90, 122, 157, 0.08);
    border: 1px solid rgba(90, 122, 157, 0.2);
    margin-bottom: 24px;
    font-size: 0.87rem;
    color: var(--color-text-secondary);
    transition: background 0.3s, border-color 0.3s
}

.geo-status-banner.active {
    background: rgba(67, 233, 123, 0.08);
    border-color: rgba(67, 233, 123, 0.25)
}

.geo-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s
}

.geo-status-dot.active {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.6);
    animation: geo-pulse 2s ease-in-out infinite
}

@keyframes geo-pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(72, 187, 120, 0.6)
    }

    50% {
        box-shadow: 0 0 16px rgba(72, 187, 120, 0.9)
    }
}

/* ---- Settings Form Grid ---- */
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px
}

@media (max-width: 720px) {
    .settings-form-grid {
        grid-template-columns: 1fr
    }
}

/* ---- Settings Actions ---- */
.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px
}

/* ---- Geo Map Preview / Coords ---- */
.geo-map-preview {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
    animation: fadeInUp 0.3s ease
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

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

.geo-coords-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center
}

.geo-coord-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
    min-width: 110px
}

.geo-coord-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase
}

.geo-coord-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums
}