/* Edura — glass dark shell (V5.0.1 style) on Bootstrap 5.3 */
:root {
    --ed-bg: #0b1020;
    --ed-bg-2: #111833;
    --ed-glass: rgba(255, 255, 255, 0.055);
    --ed-glass-strong: rgba(255, 255, 255, 0.09);
    --ed-border: rgba(255, 255, 255, 0.10);
    --ed-text: #e7ebf5;
    --ed-muted: #9aa4bf;
    --ed-accent: #5eead4;
    --ed-accent-2: #818cf8;
    --ed-danger: #fb7185;
    --ed-warning: #fbbf24;
    --ed-radius: 14px;
    --ed-sidebar: 248px;
}

html, body { height: 100%; }
body {
    background: var(--ed-bg);
    background-image:
        radial-gradient(900px 520px at 8% -10%, rgba(129, 140, 248, 0.22), transparent 60%),
        radial-gradient(800px 480px at 105% 10%, rgba(94, 234, 212, 0.14), transparent 60%),
        radial-gradient(700px 500px at 50% 120%, rgba(129, 140, 248, 0.10), transparent 60%);
    background-attachment: fixed;
    color: var(--ed-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
}

a { color: var(--ed-accent); text-decoration: none; }
a:hover { color: #99f6e4; }
.text-muted, .form-text { color: var(--ed-muted) !important; }

/* Glass surfaces */
.glass {
    background: var(--ed-glass);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.card.glass { color: var(--ed-text); }
.card.glass .card-header { background: transparent; border-bottom: 1px solid var(--ed-border); font-weight: 600; }
.card.glass .card-footer { background: transparent; border-top: 1px solid var(--ed-border); }

/* Layout */
.ed-shell { display: flex; min-height: 100vh; }
.ed-sidebar {
    width: var(--ed-sidebar);
    flex-shrink: 0;
    position: sticky; top: 0; height: 100vh;
    padding: 18px 14px;
    border-right: 1px solid var(--ed-border);
    background: rgba(11, 16, 32, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-y: auto;
}
.ed-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ed-text); }
.ed-brand:hover { color: var(--ed-text); }
.ed-logo {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; font-weight: 800; color: #0b1020;
    background: linear-gradient(135deg, var(--ed-accent), var(--ed-accent-2));
}
.ed-brand-name { font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
.ed-brand-sub { font-size: .75rem; color: var(--ed-muted); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ed-nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ed-muted); padding: 14px 10px 6px; }
.ed-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px; color: var(--ed-text); margin-bottom: 2px;
}
.ed-nav a i { font-size: 1.05rem; color: var(--ed-muted); }
.ed-nav a:hover { background: var(--ed-glass); }
.ed-nav a.active { background: var(--ed-glass-strong); box-shadow: inset 3px 0 0 var(--ed-accent); }
.ed-nav a.active i { color: var(--ed-accent); }

.ed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px;
    background: rgba(11, 16, 32, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ed-border);
}
.ed-topbar h1 { font-size: 1.1rem; margin: 0; font-weight: 600; }
.ed-content { padding: 24px; max-width: 1280px; width: 100%; }

.ed-menu-btn { display: none; }
@media (max-width: 991.98px) {
    .ed-sidebar { position: fixed; left: 0; z-index: 1040; transform: translateX(-100%); transition: transform .2s; }
    [dir="rtl"] .ed-sidebar { left: auto; right: 0; transform: translateX(100%); }
    body.ed-nav-open .ed-sidebar { transform: none; }
    body.ed-nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1030; }
    .ed-menu-btn { display: inline-flex; }
    .ed-content, .ed-topbar { padding-left: 16px; padding-right: 16px; }
}

/* Bootstrap overrides for the dark glass look */
.form-control, .form-select {
    background-color: rgba(255,255,255,.04);
    border: 1px solid var(--ed-border);
    color: var(--ed-text);
    border-radius: 10px;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(255,255,255,.07);
    color: var(--ed-text);
    border-color: var(--ed-accent);
    box-shadow: 0 0 0 .2rem rgba(94, 234, 212, .15);
}
.form-control::placeholder { color: #6b7591; }
.form-select option { background: var(--ed-bg-2); color: var(--ed-text); }
.form-control:disabled, .form-control[readonly] { background-color: rgba(255,255,255,.02); color: var(--ed-muted); }
.form-check-input { background-color: rgba(255,255,255,.08); border-color: var(--ed-border); }
.form-check-input:checked { background-color: var(--ed-accent); border-color: var(--ed-accent); }
.form-label { font-weight: 500; font-size: .88rem; }
.input-group-text { background: rgba(255,255,255,.06); border-color: var(--ed-border); color: var(--ed-muted); }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary {
    background: linear-gradient(135deg, var(--ed-accent), var(--ed-accent-2));
    border: 0; color: #0b1020;
}
.btn-primary:hover, .btn-primary:focus { color: #0b1020; filter: brightness(1.08); }
.btn-outline-light { border-color: var(--ed-border); color: var(--ed-text); }
.btn-outline-light:hover { background: var(--ed-glass-strong); color: var(--ed-text); border-color: var(--ed-border); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--ed-text); --bs-table-border-color: var(--ed-border); --bs-table-hover-bg: rgba(255,255,255,.04); --bs-table-hover-color: var(--ed-text); margin-bottom: 0; }
.table thead th { color: var(--ed-muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table td, .table th { vertical-align: middle; }

.alert { border-radius: 12px; border: 1px solid var(--ed-border); backdrop-filter: blur(10px); }
.alert-success { background: rgba(94, 234, 212, .12); color: #a7f3d0; }
.alert-danger { background: rgba(251, 113, 133, .12); color: #fecdd3; }
.alert-warning { background: rgba(251, 191, 36, .12); color: #fde68a; }
.alert-info { background: rgba(129, 140, 248, .12); color: #c7d2fe; }

.badge-soft { padding: .35em .65em; border-radius: 999px; font-weight: 500; font-size: .75rem; border: 1px solid var(--ed-border); }
.badge-soft.ok { background: rgba(94, 234, 212, .12); color: var(--ed-accent); }
.badge-soft.warn { background: rgba(251, 191, 36, .12); color: var(--ed-warning); }
.badge-soft.bad { background: rgba(251, 113, 133, .12); color: var(--ed-danger); }
.badge-soft.info { background: rgba(129, 140, 248, .14); color: #c7d2fe; }
.badge-soft.muted { background: rgba(255,255,255,.05); color: var(--ed-muted); }

.dropdown-menu { background: var(--ed-bg-2); border: 1px solid var(--ed-border); border-radius: 12px; }
.dropdown-item { color: var(--ed-text); }
.dropdown-item:hover { background: var(--ed-glass-strong); color: var(--ed-text); }
.modal-content { background: var(--ed-bg-2); border: 1px solid var(--ed-border); border-radius: var(--ed-radius); color: var(--ed-text); }
.modal-header, .modal-footer { border-color: var(--ed-border); }
.btn-close { filter: invert(1); }
.pagination .page-link { background: var(--ed-glass); border-color: var(--ed-border); color: var(--ed-text); }
.pagination .active .page-link { background: var(--ed-accent); color: #0b1020; border-color: var(--ed-accent); }
hr { border-color: var(--ed-border); opacity: 1; }

/* Stat tiles */
.stat { padding: 18px; }
.stat .label { color: var(--ed-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; }
.stat i { font-size: 1.4rem; color: var(--ed-accent); }

/* Auth pages */
.ed-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.ed-auth-card { width: 100%; max-width: 440px; padding: 30px; }
.ed-auth-card.wide { max-width: 640px; }

/* Onboarding stepper */
.ed-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.ed-steps .s { flex: 1; min-width: 64px; font-size: .78rem; color: var(--ed-muted); padding-top: 8px; border-top: 3px solid var(--ed-border); }
.ed-steps .s.done { border-color: var(--ed-accent-2); color: var(--ed-text); }
.ed-steps .s.now { border-color: var(--ed-accent); color: var(--ed-text); font-weight: 600; }

.choice {
    display: block; padding: 14px 16px; border: 1px solid var(--ed-border); border-radius: 12px;
    background: rgba(255,255,255,.03); cursor: pointer; height: 100%;
}
.choice:hover { background: rgba(255,255,255,.06); }
.choice input { margin-right: 8px; }
.choice:has(input:checked) { border-color: var(--ed-accent); background: rgba(94, 234, 212, .07); }
.choice .t { font-weight: 600; }
.choice .d { color: var(--ed-muted); font-size: .85rem; margin-top: 4px; }

.grade-chip { display: inline-block; margin: 0 6px 8px 0; }
.grade-chip input { display: none; }
.grade-chip span {
    display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ed-border);
    cursor: pointer; user-select: none; background: rgba(255,255,255,.03);
}
.grade-chip input:checked + span { background: rgba(94, 234, 212, .15); border-color: var(--ed-accent); color: var(--ed-accent); }

.perm-group { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ed-muted); margin: 14px 0 6px; }
.empty { text-align: center; color: var(--ed-muted); padding: 36px 12px; }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; }
pre.audit { background: rgba(0,0,0,.25); border: 1px solid var(--ed-border); border-radius: 10px; padding: 10px; color: var(--ed-muted); font-size: .78rem; max-height: 240px; overflow: auto; white-space: pre-wrap; }

/* Attendance register */
.att-group .btn { min-width: 42px; font-weight: 700; border: 1px solid var(--ed-border); color: var(--ed-muted); background: rgba(255,255,255,.03); }
.att-group .btn-check:checked + .att-present { background: rgba(94, 234, 212, .22); color: var(--ed-accent); border-color: var(--ed-accent); }
.att-group .btn-check:checked + .att-absent  { background: rgba(251, 113, 133, .22); color: var(--ed-danger); border-color: var(--ed-danger); }
.att-group .btn-check:checked + .att-late    { background: rgba(251, 191, 36, .22); color: var(--ed-warning); border-color: var(--ed-warning); }
.att-group .btn-check:checked + .att-excused { background: rgba(129, 140, 248, .25); color: #c7d2fe; border-color: var(--ed-accent-2); }
@media (max-width: 575.98px) { .att-group .btn { min-width: 48px; padding: .45rem 0; } }
.att-cell { width: 26px; text-align: center; font-size: .75rem; font-weight: 700; }
.att-cell.present { color: var(--ed-accent); } .att-cell.absent { color: var(--ed-danger); }
.att-cell.late { color: var(--ed-warning); } .att-cell.excused { color: #c7d2fe; }

/* Small colour key for charts */
.legend-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; vertical-align: middle; margin-right: .2rem; }

/* "View as school" banner: always visible while a platform admin is signed in as a school user */
.ed-impersonating { position: sticky; top: 0; z-index: 1100; background: #fbbf24; color: #1f2937; font-weight: 500; }
.ed-impersonating .btn-dark { background: #1f2937; border-color: #1f2937; }
