:root {
    --bg: #f6f8fc;
    --card: #ffffff;
    --line: #e8edf5;
    --line-soft: #f1f5fa;
    --text: #101828;
    --text-2: #475467;
    --muted: #8a94a6;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --green: #0f9d63;
    --green-soft: #e6f7f0;
    --red: #d92d20;
    --red-soft: #fdeceb;
    --amber: #d97706;
    --amber-soft: #fff4e5;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
    --sidebar: 268px;
    --bar: 68px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { color: #0b1526; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }

/* ---------------- top bar ---------------- */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--bar);
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    z-index: 40;
}

.app-bar-brand {
    width: var(--sidebar);
    padding: 0 24px;
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex: none;
}

.brand-mark { font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--blue); }
.brand-text { color: var(--text-2); font-size: 15px; }

.app-bar-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 0 28px;
}

.bar-divider { width: 1px; height: 26px; background: var(--line); }
.user-name { font-weight: 700; color: #101828; }

.pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: #eef2f7;
    color: #5a6675;
}

.pill-admin { background: var(--blue-soft); color: var(--blue); }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: none;
}

.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-teal { background: #0e7490; }
.link-quiet { color: var(--muted); }
.link-quiet:hover { color: var(--text-2); }

/* ---------------- shell ---------------- */
.shell { padding-top: var(--bar); }

.sidebar {
    position: fixed;
    top: var(--bar);
    bottom: 0;
    left: 0;
    width: var(--sidebar);
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 18px 16px;
    overflow-y: auto;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-2);
    font-weight: 600;
    position: relative;
}

.side-link:hover { background: #f5f8fd; }

.side-link.is-active {
    background: var(--blue-soft);
    color: var(--blue);
}

.side-link.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--blue);
}

.side-sep { height: 1px; background: var(--line); margin: 10px 6px; }

.content {
    margin-left: var(--sidebar);
    padding: 26px 28px 60px;
    min-width: 0;
}

.page { display: flex; flex-direction: column; gap: 18px; max-width: 1360px; }

/* ---------------- page head ---------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 27px; letter-spacing: -.01em; }
.page-sub { margin: 4px 0 0; color: var(--text-2); }
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.back-link { color: var(--muted); font-size: 13px; display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--text-2); }

.field-input {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

.field-input:focus { outline: 2px solid #dbe7ff; border-color: #b9d0ff; }
.date-box { box-shadow: var(--shadow); font-weight: 600; padding: 11px 14px; }
.field-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 10px;
    padding: 9px 15px;
    font: inherit;
    cursor: pointer;
}

.btn:hover { background: #f6f9fe; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4fd7; }
.btn-quiet { color: var(--text-2); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

.btn-view {
    border: 1px solid #cfe0ff;
    color: var(--blue);
    background: #fff;
    font-weight: 600;
    border-radius: 9px;
    padding: 7px 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-view:hover { background: var(--blue-soft); }

.alert { border-radius: 12px; padding: 12px 15px; border: 1px solid; }
.alert-info { background: #eef5ff; border-color: #d3e3ff; color: #1c4f9c; }
.alert-warn { background: var(--amber-soft); border-color: #ffe0a3; color: #92400e; }
.alert-error { background: var(--red-soft); border-color: #f7c9ca; color: #a3282c; }

/* ---------------- cards ---------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pad { padding: 22px; }
.empty { padding: 34px 20px; color: var(--muted); text-align: center; }

/* ---------------- stat tiles ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.stat-icon .icon { width: 21px; height: 21px; }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.teal { background: #e7f2ff; color: #0e7490; }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.stat-value.amber { color: var(--amber); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }

/* ---------------- table card ---------------- */
.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.table-title { margin: 0; font-size: 16px; }
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box { position: relative; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; width: 290px; border-radius: 10px; }

.chips { display: flex; gap: 8px; }

.chip-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-2);
    border-radius: 10px;
    padding: 8px 13px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.chip-filter b { font-weight: 700; }
.chip-filter.is-on { background: var(--blue-soft); border-color: #c9dcff; color: var(--blue); }
.chip-filter.tone-amber.is-on { background: var(--amber-soft); border-color: #ffe0a3; color: var(--amber); }
.chip-filter.tone-green.is-on { background: var(--green-soft); border-color: #c9ecdc; color: var(--green); }

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

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: #fbfcfe;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcff; }

.data-table td.col-accent {
    border-left: 3px solid transparent;
    padding-left: 16px;
}

tr.state-finished td.col-accent { border-left-color: var(--amber); }
tr.state-running td.col-accent { border-left-color: var(--green); }
tr.state-upcoming td.col-accent { border-left-color: #94a3b8; }

.cell-time { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-time .icon { color: var(--blue); }
.cell-link { color: var(--blue); font-weight: 600; }
.cell-link:hover { text-decoration: underline; }
.cell-person { display: flex; align-items: center; gap: 8px; }
.cell-person .icon { color: var(--muted); }
.cell-sub { color: var(--muted); font-size: 12px; margin-left: 23px; }
.col-right { text-align: right; }
.col-num { width: 56px; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.muted { color: var(--muted); }
.warn-text { color: var(--amber); font-weight: 600; }

.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 8px;
    white-space: nowrap;
}

.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-grey { background: #f1f4f9; color: var(--text-2); }

.num-present { color: var(--green); font-weight: 700; }
.num-absent { color: var(--red); font-weight: 700; }
.tick.on { color: var(--green); font-weight: 700; }
.tick.off { color: #cbd3de; }

.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-top: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
    gap: 12px;
    flex-wrap: wrap;
}

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

.pager button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    min-width: 36px;
    height: 34px;
    cursor: pointer;
    font: inherit;
    color: var(--text-2);
}

.pager button:hover:not(:disabled) { background: #f5f8fd; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .page-num { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }

/* ---------------- reports ---------------- */
.profile-card { display: flex; align-items: center; gap: 18px; padding: 20px 22px; flex-wrap: wrap; }
.profile-main { flex: 1 1 240px; min-width: 0; }
.profile-name { margin: 0; font-size: 20px; }
.profile-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.name-ar { color: #0e7490; font-size: 15px; }
.profile-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-mini { display: flex; flex-direction: column; align-items: center; min-width: 66px; }
.stat-mini b { font-size: 21px; line-height: 1.2; }
.stat-mini span { font-size: 12px; color: var(--muted); }

.report-block { display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.report-title { margin: 0; font-size: 17px; }
.report-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.chip-ok { background: var(--green-soft); color: #12805c; }
.chip-warn { background: var(--red-soft); color: #c0332f; }
.chip-mute { background: #eef2f7; color: var(--text-2); }
.chip-note { font-size: 12px; color: var(--muted); white-space: nowrap; }

.course-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.course-card.is-risk { border-left: 4px solid var(--red); }
.course-title { margin: 0; font-size: 16px; }
.course-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.bar { display: block; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--green); }
.status-ok { color: #12805c; font-weight: 700; }
.status-bad { color: #c0332f; font-weight: 700; }

/* ---------------- class detail header ---------------- */
[hidden] { display: none !important; }
.class-head { padding: 2px 0; }
.class-title { margin: 0; font-size: 24px; }
.class-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------------- session detail rows ---------------- */
.session-list { list-style: none; margin: 0; padding: 0; }

.session-row {
    display: grid;
    grid-template-columns: 130px 34px repeat(5, minmax(0, 1fr)) 44px 24px;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.session-row:last-child { border-bottom: 0; }
.session-row.is-today { background: #f3fbf7; }
.session-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.today-tag { display: block; font-size: 11px; font-style: normal; color: var(--green); font-weight: 700; text-transform: uppercase; }

.session-flag { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.session-flag.ok { background: var(--green-soft); color: var(--green); }
.session-flag.warn { background: var(--amber-soft); color: var(--amber); }

.metric { color: var(--muted); font-size: 13px; white-space: nowrap; }
.metric b { color: var(--text); }
.lock { text-align: center; }
.session-actions { position: relative; text-align: right; }

.btn-dots { border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 38px; height: 32px; cursor: pointer; color: var(--muted); line-height: 1; }
.btn-dots:hover { background: #f5f8fd; }

.menu {
    position: absolute;
    right: 0;
    top: 36px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow);
    min-width: 186px;
    padding: 6px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.menu[hidden] { display: none; }
.menu-item { background: none; border: 0; padding: 9px 11px; border-radius: 8px; text-align: left; font: inherit; cursor: pointer; color: var(--text); }
.menu-item:hover { background: #f3f7fd; }

/* ---------------- roster modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); }

.modal-panel {
    position: relative;
    background: #fff;
    max-width: 920px;
    margin: 5vh auto;
    max-height: 90vh;
    overflow: auto;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .25);
}

.modal-close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.roster-head h2 { margin: 0 0 2px; font-size: 20px; }
.roster-summary { display: flex; gap: 18px; margin: 14px 0; color: var(--muted); }
.roster-table { width: 100%; border-collapse: collapse; }
.roster-table th, .roster-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.roster-table th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.col-name-ar { text-align: right; }
.col-actions { width: 220px; }

.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.toggle-btn { border: 0; background: #fff; padding: 7px 15px; font: inherit; cursor: pointer; color: var(--text-2); }
.toggle-btn + .toggle-btn { border-left: 1px solid var(--line); }
.toggle-btn.present.on { background: var(--green); color: #fff; }
.toggle-btn.absent.on { background: var(--red); color: #fff; }
.toggle-btn:disabled { cursor: not-allowed; opacity: .55; }
.no-record { margin-left: 10px; font-size: 12px; color: var(--amber); }

/* ---------------- login ---------------- */
.app-main { max-width: 1180px; margin: 0 auto; padding: calc(var(--bar) + 24px) 20px 60px; }
.login-wrap { display: flex; justify-content: center; padding: 6vh 20px; }
.login-card { width: 100%; max-width: 390px; padding: 30px; }
.login-title { margin: 0 0 4px; font-size: 22px; }
.login-sub { margin: 0 0 18px; color: var(--text-2); }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.field .field-input { width: 100%; }

/* ---------------- forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .field { margin: 0; }
.form-grid .field-input { width: 100%; }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------------- toast ---------------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #101828;
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    z-index: 80;
}

.toast.error { background: var(--red); }

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-box input { width: 200px; }
}

@media (max-width: 860px) {
    :root { --sidebar: 0px; }
    .sidebar { display: none; }
    .app-bar-brand { width: auto; }
    .content { margin-left: 0; padding: 20px 16px 50px; }
    .session-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
}

@media print {
    .app-bar, .sidebar, .page-head-actions, .back-link, .table-tools, .table-foot { display: none !important; }
    .content { margin: 0; padding: 0; }
    .shell { padding-top: 0; }
    .card { box-shadow: none; }
}

/* ==================================================================
   Polish pass — refinements layered over the base rules above
   ================================================================== */

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    background:
        radial-gradient(900px 420px at 100% -10%, #eef4ff 0%, rgba(238, 244, 255, 0) 60%),
        var(--bg);
    background-attachment: fixed;
}

a, .btn, .btn-view, .chip-filter, .side-link, .btn-dots, .toggle-btn, .menu-item, .pager button {
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

:focus-visible {
    outline: 2px solid #93b4ff;
    outline-offset: 2px;
    border-radius: 8px;
}

.btn:active, .btn-view:active, .chip-filter:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 2px rgba(37, 99, 235, .28), 0 6px 16px rgba(37, 99, 235, .18); }
.btn-lg { padding: 12px 18px; font-size: 15px; font-weight: 600; }

/* header + sidebar ------------------------------------------------- */
.app-bar { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.brand-mark { letter-spacing: .06em; }

.side-link { font-size: 14.5px; }
.side-link:hover { transform: translateX(1px); }
.sidebar { padding-top: 22px; }

.side-group {
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #a3adbd;
    font-weight: 700;
    padding: 14px 14px 6px;
}

/* headings --------------------------------------------------------- */
.page-title { font-weight: 700; letter-spacing: -.02em; }
.page-sub { font-size: 14px; }
.table-title { font-weight: 700; letter-spacing: -.01em; }

/* cards + tables --------------------------------------------------- */
.card { border-radius: 16px; }
.stat-card { border-radius: 16px; transition: box-shadow .18s ease, transform .18s ease; }
.stat-card:hover { box-shadow: 0 2px 4px rgba(16,24,40,.05), 0 12px 28px rgba(16,24,40,.07); transform: translateY(-1px); }
.stat-value { letter-spacing: -.02em; }

.data-table thead th { position: sticky; top: var(--bar); z-index: 2; }
.data-table tbody tr { transition: background-color .12s ease; }
.data-table tbody tr:hover { background: #f7faff; }
.data-table td.col-accent { border-left-width: 3px; }
.cell-link { text-decoration-color: transparent; }

.tag { line-height: 1.6; }
.chip-filter:hover { background: #f6f9fe; }

/* empty states ----------------------------------------------------- */
.empty {
    padding: 46px 20px;
    font-size: 14.5px;
    color: #9aa4b4;
}

/* forms ------------------------------------------------------------ */
.field-input::placeholder { color: #b3bcca; }
.field-input:hover { border-color: #d5dfec; }

/* modal ------------------------------------------------------------ */
.modal-backdrop { backdrop-filter: blur(2px); }
.modal-panel { border-radius: 18px; }

/* ---------------- sign-in screen ---------------- */
.auth-body { margin: 0; background: #fff; }

.auth {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #eaf1ff;
    background:
        radial-gradient(700px 380px at 15% 10%, rgba(96, 165, 250, .35) 0%, rgba(96, 165, 250, 0) 60%),
        linear-gradient(155deg, #14346e 0%, #1d4ed8 55%, #1e3a8a 100%);
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}

.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-logo { display: flex; align-items: baseline; gap: 10px; margin-bottom: 64px; }
.auth-logo-mark { font-size: 26px; font-weight: 800; letter-spacing: .07em; color: #fff; }
.auth-logo-sub { color: #b9cdf5; font-size: 16px; }

.auth-headline {
    font-size: 38px;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin: 0 0 14px;
    color: #fff;
    font-weight: 700;
}

.auth-lede { margin: 0 0 34px; color: #c3d5f7; font-size: 15.5px; line-height: 1.65; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }

.auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dce8fd;
    font-size: 14.5px;
}

.auth-points .icon { color: #93c5fd; flex: none; }
.auth-foot { position: relative; z-index: 1; color: #91aee2; font-size: 13px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-form { width: 100%; max-width: 380px; }
.auth-mobile-logo { display: none; align-items: baseline; gap: 8px; margin-bottom: 26px; }
.auth-title { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 26px; color: var(--text-2); }
.auth-form .field { margin-bottom: 16px; }
.auth-form .field-label { font-size: 13px; }

.input-wrap { position: relative; display: block; }
.input-wrap .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-wrap .field-input { width: 100%; padding: 12px 14px 12px 40px; border-radius: 11px; }
.auth-form .btn-block { margin-top: 6px; }
.auth-note { margin-top: 22px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-logo { display: flex; }
}

.empty-hint {
    margin: 12px auto 0;
    max-width: 460px;
    font-size: 13px;
    color: var(--text-2);
    background: #f7f9fd;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    line-height: 1.6;
}

.term-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.term-form .field-input { min-width: 280px; }
.empty-hint a { font-weight: 600; }

.term-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    background: #f4f7fc;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
}

.term-chip .icon { color: var(--blue); }

/* ==================================================================
   Arabic / right-to-left
   ================================================================== */
.lang-toggle {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 999px;
    padding: 5px 12px;
}

.auth-lang {
    position: absolute;
    top: 22px;
    inset-inline-end: 26px;
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 999px;
    padding: 6px 14px;
}

.auth-panel { position: relative; }

[dir="rtl"] body,
[dir="rtl"] .side-link,
[dir="rtl"] .page-title,
[dir="rtl"] .table-title { font-family: "Segoe UI", "Dubai", "Tahoma", "Arial", sans-serif; }

[dir="rtl"] .sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .content { margin-left: 0; margin-right: var(--sidebar); }
[dir="rtl"] .side-link.is-active::before { left: auto; right: -16px; border-radius: 3px 0 0 3px; }
[dir="rtl"] .app-bar-brand { direction: ltr; }

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td,
[dir="rtl"] .roster-table th,
[dir="rtl"] .roster-table td { text-align: right; }

[dir="rtl"] .col-right { text-align: left; }
[dir="rtl"] .col-name-ar { text-align: right; }
[dir="rtl"] .data-table td.col-accent { border-left: 0; border-right: 3px solid transparent; padding-left: 16px; padding-right: 16px; }
[dir="rtl"] tr.state-finished td.col-accent { border-right-color: var(--amber); }
[dir="rtl"] tr.state-running td.col-accent { border-right-color: var(--green); }
[dir="rtl"] tr.state-upcoming td.col-accent { border-right-color: #94a3b8; }
[dir="rtl"] .cell-sub { margin-left: 0; margin-right: 23px; }
[dir="rtl"] .menu { right: auto; left: 0; text-align: right; }
[dir="rtl"] .menu-item { text-align: right; }
[dir="rtl"] .session-actions { text-align: left; }
[dir="rtl"] .search-box .icon { left: auto; right: 12px; }
[dir="rtl"] .search-box input { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] .input-wrap .icon { left: auto; right: 13px; }
[dir="rtl"] .input-wrap .field-input { padding: 12px 40px 12px 14px; }
[dir="rtl"] .modal-close { right: auto; left: 16px; }
[dir="rtl"] .course-card.is-risk { border-left: 0; border-right: 4px solid var(--red); }
[dir="rtl"] .cell-time,
[dir="rtl"] .mono,
[dir="rtl"] .session-date { direction: ltr; display: inline-block; }
[dir="rtl"] .btn-view svg,
[dir="rtl"] .cell-link + svg { transform: scaleX(-1); }
[dir="rtl"] .name-ar { text-align: right; }

/* ---------------- KILAW logo ---------------- */
.brand-logo { height: 30px; width: auto; display: block; }
.app-bar-brand { align-items: center; gap: 12px; }
.app-bar-brand .brand-text { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); line-height: 1.4; }

.auth-logo { margin-bottom: 56px; }

.auth-logo-card {
    display: inline-block;
    background: #fff;
    border-radius: 14px;
    padding: 16px 22px;
    box-shadow: 0 10px 30px rgba(2, 16, 43, .25);
}

.auth-logo-card img { display: block; height: 92px; width: auto; }
.auth-mobile-logo img { height: 54px; width: auto; }

@media (max-width: 900px) {
    .auth-mobile-logo { display: block; }
}

@media (max-width: 860px) {
    .app-bar-brand .brand-text { display: none; }
}

@media print {
    .brand-logo { height: 26px; }
}

/* ==================================================================
   KILAW house style — navy rail, cream hero, gold accents
   ================================================================== */
:root {
    --navy: #10245c;
    --navy-deep: #0b1a45;
    --gold: #b08a2e;
    --gold-soft: #f4ecd8;
    --cream: #faf6ec;
}

/* ---- navy sidebar ---- */
.sidebar {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-right: 0;
    padding: 20px 14px 26px;
}

.side-logo {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 4px 26px;
    box-shadow: 0 6px 18px rgba(3, 12, 36, .35);
}

.side-logo img { display: block; width: 100%; height: auto; max-height: 34px; object-fit: contain; }

.side-group { color: var(--gold); opacity: .95; padding: 16px 14px 8px; }
.side-link { color: #c8d3ea; border-radius: 8px; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.is-active { background: rgba(255, 255, 255, .12); color: #fff; }
.side-link.is-active::before { background: var(--gold); width: 4px; border-radius: 4px; left: auto; right: auto; inset-inline-start: -6px; }
.sidebar .side-nav { gap: 2px; }

/* keep the top bar reading as one piece with the rail */
.app-bar-brand { background: transparent; }

/* ---- hero banner ---- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--cream) 0%, #fdfbf6 55%, #fff 100%);
    border: 1px solid #efe6d2;
    border-radius: 18px;
    padding: 32px 34px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-body { position: relative; z-index: 2; max-width: 640px; }
.hero-title { margin: 0; font-size: 34px; letter-spacing: -.02em; color: var(--navy); }
.hero-sub { margin: 8px 0 0; color: #5b6478; font-size: 15px; }

.hero-date {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--gold);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hero-actions { position: relative; z-index: 2; }

.hero-art {
    position: absolute;
    top: -70%;
    inset-inline-end: -220px;
    width: 620px;
    height: 240%;
    background: radial-gradient(circle at 50% 50%, var(--navy) 0 70%, var(--navy-deep) 100%);
    border-radius: 50%;
    z-index: 1;
}

.hero-art::after {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: repeating-conic-gradient(from 205deg at 18% 50%,
        rgba(198, 160, 74, .30) 0deg 0.3deg,
        rgba(198, 160, 74, 0) 0.3deg 6deg);
    mask-image: radial-gradient(circle at 18% 50%, transparent 8%, rgba(0, 0, 0, .8) 34%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 18% 50%, transparent 8%, rgba(0, 0, 0, .8) 34%, transparent 72%);
}

@media (max-width: 1100px) { .hero-art { display: none; } }

/* ---- featured stat tile ---- */
.stat-card.is-featured {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-color: var(--navy);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card.is-featured .stat-label { color: #c2cee8; }
.stat-card.is-featured .stat-value { color: #fff; }

.stat-card.is-featured .stat-icon {
    background: rgba(255, 255, 255, .08);
    color: var(--gold);
    border: 1px solid rgba(198, 160, 74, .5);
    border-radius: 50%;
}

.stat-card.is-featured::after {
    content: "";
    position: absolute;
    inset-inline-end: -30px;
    bottom: -40px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid rgba(198, 160, 74, .25);
}

/* ---- session rows: gold timeline ---- */
.data-table td.col-accent { position: relative; border-left-color: transparent !important; }
[dir="rtl"] .data-table td.col-accent { border-right-color: transparent !important; }

tr.state-finished td.col-accent::before,
tr.state-running td.col-accent::before,
tr.state-upcoming td.col-accent::before {
    content: "";
    position: absolute;
    inset-inline-start: 6px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 46, .18);
}

tr.state-running td.col-accent::before { background: var(--green); box-shadow: 0 0 0 3px rgba(15, 157, 99, .18); }
tr.state-upcoming td.col-accent::before { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .18); }
.data-table td.col-accent { padding-inline-start: 26px; }
.cell-time .icon { color: var(--gold); }

@media (max-width: 860px) {
    .hero { padding: 22px; }
    .hero-title { font-size: 25px; }
}

.head-form { display: inline-flex; align-items: center; gap: 8px; }
.table-tools .head-form .field-input { padding: 8px 12px; }

/* ==================================================================
   Course pages — badges, label/value groups, gold outlines
   ================================================================== */

/* plain tiles get a thin ring instead of a filled square */
.stat-card:not(.is-featured) .stat-icon {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: inset 0 0 0 4px #fff;
}

.stat-card:not(.is-featured) .stat-icon.blue { border-color: #cfe0ff; }
.stat-card:not(.is-featured) .stat-icon.amber { border-color: #ffe0a3; }
.stat-card:not(.is-featured) .stat-icon.green { border-color: #c9ecdc; }
.stat-card:not(.is-featured) .stat-icon.teal { border-color: #cfe0ff; }

.avatar-navy { background: var(--navy); }

/* ---- course list ---- */
.course-rows { list-style: none; margin: 0; padding: 0; }

.course-row {
    display: grid;
    grid-template-columns: 56px minmax(200px, 1fr) repeat(4, minmax(72px, auto)) 128px;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.course-row:last-child { border-bottom: 0; }
.course-row:hover { background: #fbfcff; }

.code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 46px;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .01em;
}

.code-badge:hover { background: #1d4fd7; }
.course-row-name { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-weight: 600; font-size: 15px; }
.course-row-name:hover { color: var(--blue); }
.course-row-teacher { font-size: 12px; color: var(--muted); font-weight: 500; }

.mini { display: flex; flex-direction: column; gap: 5px; }

.mini-label {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a3adbd;
    font-weight: 700;
}

.mini-value { font-size: 15px; }
.course-row .btn-view { justify-content: center; }

/* ---- empty state with a ringed icon ---- */
.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 1px solid #e7dcc2;
    background: #fdfaf3;
    color: var(--gold);
}

.empty-icon .icon { width: 26px; height: 26px; }

/* ---- profile card: stats sit behind a divider ---- */
.profile-card .stat-row {
    padding-inline-start: 26px;
    border-inline-start: 1px solid var(--line);
}

.profile-card { position: relative; overflow: hidden; }

[dir="ltr"] .profile-main .name-ar { text-align: left; }

/* ---- faint crest at the foot of the rail ---- */
.sidebar { position: fixed; display: flex; flex-direction: column; }
.sidebar::after {
    content: "";
    display: block;
    margin-top: auto;
    height: 130px;
    opacity: .28;
    background: no-repeat center bottom / 120px auto
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 90' fill='none' stroke='%23b08a2e' stroke-width='1.2'><path d='M8 82h104M14 82V44M30 82V44M46 82V44M62 82V44M78 82V44M94 82V44M106 82V44M6 40h108L60 10 6 40z'/></svg>");
}

@media (max-width: 1100px) {
    .course-row { grid-template-columns: 56px 1fr auto; row-gap: 10px; }
}

/* ---- roster table: give names room, keep buttons on one line ---- */
.data-table .btn-view { white-space: nowrap; }
.data-table td .cell-person .strong,
.data-table td .cell-person .cell-link { white-space: normal; }
.data-table .col-num { width: 44px; }

tr.row-risk td.col-accent { border-inline-start: 3px solid var(--red); }
tr.row-risk:hover { background: #fffafa; }

/* the timeline dot belongs to session lists only */
tr.row-risk td.col-accent::before { content: none; }

/* softer ring on the featured tile */
.stat-card.is-featured::after {
    width: 120px;
    height: 120px;
    inset-inline-end: -46px;
    bottom: -56px;
    border-color: rgba(198, 160, 74, .18);
}

/* ---- serif display titles, as in the KILAW wordmark ---- */
.hero-title,
.page-title,
.class-title,
.auth-title,
.profile-name {
    font-family: Georgia, "Cambria", "Times New Roman", "Traditional Arabic", serif;
    font-weight: 700;
    letter-spacing: 0;
}

[dir="rtl"] .hero-title,
[dir="rtl"] .page-title,
[dir="rtl"] .class-title,
[dir="rtl"] .auth-title,
[dir="rtl"] .profile-name {
    font-family: "Traditional Arabic", "Sakkal Majalla", Georgia, "Segoe UI", serif;
}

/* ---- select styled like the mockup's control ---- */
.select-wrap { position: relative; display: inline-flex; align-items: center; }

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    background: #f6f8fc;
    border: 1px solid var(--line);
    font-weight: 600;
    color: var(--text-2);
    padding-inline-end: 34px;
    cursor: pointer;
}

.select-wrap .icon {
    position: absolute;
    inset-inline-end: 12px;
    pointer-events: none;
    color: var(--muted);
}

/* ---- student photos, with the initial showing through when there is none ---- */
.avatar { position: relative; overflow: hidden; }
.avatar-initial { position: relative; z-index: 1; }

.avatar-img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #fff;
}

.profile-card .avatar-lg { width: 76px; height: 76px; font-size: 26px; }

/* ---- student photos: portrait tiles, gently rounded ---- */
.avatar-photo {
    width: 52px;
    height: 60px;
    border-radius: 11px;
    background: #eef2f8;
    color: #56617a;
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .10);
}

.avatar-photo .avatar-img { object-position: center 18%; }

.avatar-photo-lg {
    width: 96px;
    height: 112px;
    border-radius: 14px;
    font-size: 32px;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .14);
}

.data-table td .cell-person { gap: 12px; }
.data-table tbody td { padding-top: 10px; padding-bottom: 10px; }
.profile-card { gap: 22px; }

/* ---- one logo only: the rail carries it, the bar starts beside the rail ---- */
.app-bar {
    left: auto;
    right: auto;
    inset-inline-start: var(--sidebar);
    inset-inline-end: 0;
    justify-content: flex-end;
}

.sidebar { top: 0; z-index: 50; padding-top: 18px; }
.side-logo { margin-bottom: 22px; }

@media (max-width: 860px) {
    .app-bar { inset-inline-start: 0; }
}

/* ================= one-time code sign in ================= */

.alert-ok { background: #eaf7ee; border-color: #bfe3c9; color: #1c6b36; }

.auth-form .alert { margin-bottom: 18px; font-size: 13.5px; }

/* the two-step marker above the form */
.auth-steps {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.auth-steps li { display: inline-flex; align-items: center; gap: 7px; }

.auth-steps li + li::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--line);
    margin-inline-end: 3px;
}

.step-dot {
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #eef1f6;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
}

.auth-steps .is-current { color: var(--navy); }
.auth-steps .is-current .step-dot { background: var(--navy); color: #fff; }
.auth-steps .is-done { color: var(--gold); }
.auth-steps .is-done .step-dot { background: var(--gold); color: #fff; }

.masked-email {
    display: inline-block;
    font-weight: 700;
    color: var(--text);
    unicode-bidi: isolate;
}

/* six boxes, one digit each */
.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 9px;
    margin: 4px 0 16px;
}

.otp-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 66px;
    text-align: center;
    font-size: 25px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--navy);
    background: var(--cream);
    border: 1.5px solid #e6dcc0;
    border-radius: 12px;
    transition: border-color .12s, box-shadow .12s, background .12s;
}

.otp-box:focus {
    outline: none;
    background: #fff;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(16, 36, 92, .12);
}

.otp-box:not(:placeholder-shown) { background: #fff; }

.otp-timer {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.otp-timer b { color: var(--text-2); }
.otp-timer.is-expired { color: #a3282c; }

.auth-form-tail {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 13px;
}

.auth-form-tail .inline-form { display: inline; }

.auth-form-tail button.link-quiet {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dot-sep { color: var(--line); }

/* the sign-in panel stacks the form and its tail */
.auth-panel { flex-direction: column; }
.auth-panel > .auth-form-tail { width: 100%; max-width: 380px; justify-content: flex-start; }

@media (max-width: 420px) {
    .otp-boxes { gap: 6px; }
    .otp-box { font-size: 21px; border-radius: 10px; }
}

/* checkbox row and section divider used on Settings */
.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
}

.check input { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }

.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0 18px;
}

.auth-form-tail a.link-quiet { text-decoration: underline; text-underline-offset: 3px; }

/* first-run setup */
.auth-form-wide { max-width: 560px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setup-grid .field { margin-bottom: 0; }

.setup-legend {
    margin: 4px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--gold);
}

.auth-form-wide .check { margin-top: 14px; }
.auth-form-wide .btn-block { margin-top: 22px; }

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

/* the server-console way in, shown under setup */
.setup-shortcut {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.shortcut-row { display: flex; gap: 10px; }
.shortcut-row .field-input { flex: 1; }
.shortcut-row .btn { flex: none; white-space: nowrap; }

.check-result { margin-top: 18px; }
.check-result .data-table td { padding-top: 10px; padding-bottom: 10px; }

/* ---- open manual entry ---- */
.release-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--cream);
    border: 1px solid #e6dcc0;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.release-bar.is-open { background: #eaf7ee; border-color: #bfe3c9; }
.release-text { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.release-text b { color: var(--text); }
.release-text span { color: var(--text-2); }

.tag-open { background: #eaf7ee; border-color: #bfe3c9; color: #1c6b36; }

.row-actions { display: inline-flex; align-items: center; gap: 10px; }


/* ---- session rows: actions shown, not hidden behind a menu ---- */
.session-row {
    grid-template-columns: 132px 30px repeat(5, minmax(0, auto)) 1fr;
    gap: 14px;
}

.session-actions {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    text-align: end;
}

.session-actions .btn { white-space: nowrap; }

.session-row .lock {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}


@media (max-width: 1100px) {
    .session-row {
        grid-template-columns: 1fr 1fr 1fr;
        row-gap: 12px;
    }

    .session-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ==================================================================
   Session cards — one line, generous type, cream and gold
   ================================================================== */

.session-wrap { display: flex; flex-direction: column; gap: 14px; }
.session-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }

.session-row {
    display: grid;
    grid-template-columns: minmax(150px, 210px) repeat(5, max-content) 1fr;
    align-items: center;
    gap: 0;
    padding: 22px 26px;
    background: #fbfaf6;
    border: 1px solid #e2d7bb;
    border-radius: 16px;
    border-bottom: 1px solid #e2d7bb;
    box-shadow: 0 1px 2px rgba(16, 36, 92, .04);
}

.session-row.is-today { background: #fbfaf6; border-color: #d9c89a; }

/* date block, with the tick beneath it */
.session-when {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-inline-end: 22px;
}

.session-date {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.today-tag {
    font-style: normal;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--green);
}

.session-flag {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-size: 19px;
    font-weight: 700;
    margin-top: 4px;
}

.session-flag.ok { background: #e3f5e9; color: #1c8043; }
.session-flag.warn { background: var(--amber-soft); color: var(--amber); }

/* the five figures, divided by hairlines */
.session-row .metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px clamp(12px, 1.6vw, 24px);
    border-inline-start: 1px solid #e6ddc6;
    white-space: nowrap;
}

.metric-label {
    display: block;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: 0;
}

.metric-label.is-present { color: #1c8043; }
.metric-label.is-absent { color: #b42318; }

.metric-value {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.metric-value.is-present { color: #1c8043; }
.metric-value.is-absent { color: #b42318; }
.metric-value.tick.on { color: #1c8043; }
.metric-value.tick.off { color: #b9b3a4; font-size: 22px; }

.session-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-inline-start: 24px;
    border-inline-start: 1px solid #e6ddc6;
}

.session-actions .btn { white-space: nowrap; }
.session-row .lock { display: inline-flex; align-items: center; color: var(--muted); }

/* not enough room for the buttons beside the figures - drop them below */
@media (max-width: 1400px) {
    .session-row { grid-template-columns: minmax(140px, 190px) repeat(5, minmax(0, 1fr)); }

    .session-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        border-inline-start: 0;
        padding-inline-start: 0;
        padding-top: 16px;
        margin-top: 4px;
        border-top: 1px solid #e6ddc6;
    }
}

/* narrow: the figures wrap too */
@media (max-width: 860px) {
    .session-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 18px;
        justify-items: center;
    }

    .session-when { grid-column: 1 / -1; padding-inline-end: 0; }
    .session-row .metric { border-inline-start: 0; }
    .session-actions { justify-content: center; }
}

.side-badge {
    margin-inline-start: auto;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
}

.chip-warn { background: var(--amber-soft); border-color: #ffe0a3; color: #92400e; }

/* ---- the finish line at the bottom of the roster ---- */
.roster-foot {
    position: sticky;
    bottom: -1px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin: 18px -24px -24px;
    padding: 16px 24px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    border-top: 1px solid var(--line);

    /* solid, or the rows scroll through it */
    background: #fff;
    box-shadow: 0 -10px 18px -14px rgba(16, 24, 40, .35);
}

/* room so the last student is never hidden behind the footer */
.roster .roster-table { margin-bottom: 6px; }

.roster-foot-text { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.roster-foot-text b { color: var(--text); }
.roster-foot-text b.is-done { color: #1c8043; }
.roster-foot-text span { color: var(--text-2); }

.roster-foot .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ==================================================================
   Upcoming Classes — the next class, then the days ahead
   ================================================================== */

.next-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    background: linear-gradient(120deg, #0e2050 0%, #16306e 60%, #1c3a82 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.next-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -80px;
    top: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .10), transparent 60%);
    pointer-events: none;
}

.next-main { position: relative; z-index: 1; min-width: 0; }

.next-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #a8c2f0;
}

.next-eyebrow .icon { color: #a8c2f0; }

.next-when {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 3px 11px;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12.5px;
}

.next-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.15;
    margin: 12px 0 10px;
    color: #fff;
}

.next-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #dbe6fb;
}

.next-facts b { color: #fff; }
.next-facts .dot-sep { color: #6f8ec9; }
.next-date { margin-top: 10px; font-size: 12.5px; color: #93aede; }

.next-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: center;
}

.next-side .btn { background: #fff; border-color: #fff; color: var(--navy); font-weight: 600; }
.next-side .btn:hover { background: #eef3ff; }
.next-side .link-quiet { color: #a8c2f0; font-size: 12.5px; }
.next-side .link-quiet:hover { color: #fff; }

/* the range chips */
.tools-spacer { flex: 1; }
.range-chips { display: inline-flex; gap: 6px; }

/* one block per day */
.day-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    overflow: hidden;
}

.day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px;
    background: var(--cream);
    border-bottom: 1px solid #eee6d3;
}

.day-name { display: flex; align-items: baseline; gap: 10px; }
.day-name b { font-size: 15px; color: var(--navy); }
.day-date { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.day-meta { font-size: 12.5px; color: var(--text-2); }

.day-list { list-style: none; margin: 0; padding: 0; }

.day-row {
    display: grid;
    grid-template-columns: 92px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.day-row:last-child { border-bottom: 0; }
.day-row:hover { background: #fbfcfe; }

.day-time { display: flex; flex-direction: column; }
.day-time b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.day-time span { font-size: 11.5px; color: var(--muted); }

.day-course { min-width: 0; }
.day-course b { display: block; font-size: 14.5px; color: var(--text); }

.day-seats { text-align: center; }
.day-seats b { display: block; font-size: 16px; color: var(--navy); }
.day-seats span { font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) {
    .next-card { grid-template-columns: 1fr; }
    .next-side { flex-direction: row; align-items: center; justify-content: flex-start; }
    .day-row { grid-template-columns: 78px 1fr; row-gap: 8px; }
    .day-seats, .day-action { grid-column: 2; justify-self: start; }
}

/* ==================================================================
   Phones and tablets — the menu becomes a drawer, tables become cards
   ================================================================== */

.nav-toggle,
.bar-brand { display: none; }

@media (max-width: 860px) {

    /* ---- top bar: menu, logo, then the account bits ---- */
    .app-bar {
        inset-inline-start: 0;
        justify-content: flex-start;
        gap: 10px;
        padding-inline: 12px;
        height: 58px;
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        flex: none;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #fff;
        color: var(--navy);
        cursor: pointer;
    }

    .bar-brand { display: inline-flex; align-items: center; }
    .bar-brand img { height: 26px; width: auto; }

    .app-bar-right { margin-inline-start: auto; gap: 8px; }
    .app-bar-right .term-chip,
    .app-bar-right .user-name,
    .app-bar-right .pill,
    .app-bar-right .bar-divider { display: none; }

    /* ---- the sidebar slides in over the page ---- */
    .shell { padding-top: 58px; }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        inset-inline-start: 0;
        width: 270px;
        max-width: 84vw;
        z-index: 70;
        transform: translateX(-102%);
        transition: transform .22s ease;
        overflow-y: auto;
        padding-top: 14px;
    }

    [dir="rtl"] .sidebar { transform: translateX(102%); }
    .sidebar.is-open { transform: translateX(0); }

    .nav-veil {
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(16, 24, 40, .48);
    }

    .nav-veil[hidden] { display: none; }
    body.nav-locked { overflow: hidden; }

    .content { margin-inline-start: 0; padding: 16px 14px 32px; }

    /* bigger targets throughout */
    .side-link { padding: 13px 14px; font-size: 15px; }
    .btn, .btn-view, .chip-filter { min-height: 42px; }

    /* ---- headings and tiles ---- */
    .page-title { font-size: 22px; }
    .hero, .next-card { padding: 20px 18px; }
    .next-title { font-size: 23px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }

    .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-head-actions { flex-wrap: wrap; }
    .table-tools { flex-wrap: wrap; gap: 10px; }
    .search-box, .search-box .field-input { width: 100%; }

    /* ---- tables turn into stacked cards ---- */
    .data-table thead { display: none; }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td { display: block; width: 100%; }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 13px;
        padding: 12px 14px;
        margin: 0 12px 10px;
        background: #fff;
    }

    .data-table td {
        border: 0;
        padding: 4px 0;
        text-align: start !important;
    }

    .data-table td.col-right { text-align: start !important; }

    /* the roster keeps its shape - it is the one table people work in */
    .roster-table thead { display: table-header-group; }

    .roster-table,
    .roster-table tbody,
    .roster-table tr,
    .roster-table td { display: revert; }

    .roster-table .col-name-ar { display: none; }
    .roster-table th, .roster-table td { padding: 9px 6px; }
    .roster-table .toggle-btn { padding: 9px 12px; font-size: 13.5px; }

    /* ---- the roster fills the screen ---- */
    .modal-panel {
        margin: 0;
        max-width: none;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        padding: 16px;
    }

    .roster-foot {
        margin: 16px -16px -16px;
        padding: 14px 16px;
        border-radius: 0;
    }

    .roster-foot .btn { width: 100%; }
    .roster-foot-text { width: 100%; }

    /* ---- day blocks ---- */
    .day-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .session-row { padding: 16px; }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr; }
    .next-side { flex-direction: column; align-items: stretch; }
    .next-side .btn { width: 100%; }
    .otp-boxes { gap: 5px; }
}

/* ==================================================================
   Today's status board — posted / waiting / no data at a glance
   ================================================================== */

.board {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}

.board-main { padding: 20px 24px; }

.board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.board-title { margin: 0; font-size: 16px; color: var(--text); }
.board-sub { font-size: 12.5px; color: var(--muted); }

.meter {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef1f6;
}

.meter-part { display: block; height: 100%; transition: width .3s ease; }
.meter-part.is-posted { background: #1c8043; }
.meter-part.is-pending { background: var(--gold); }
.meter-part.is-none { background: #dfe3ea; }

.meter-key {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 14px 0 0;
    padding: 0;
    font-size: 13px;
    color: var(--text-2);
}

.meter-key li { display: inline-flex; align-items: center; gap: 7px; }
.meter-key b { color: var(--text); }

.key-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.key-dot.is-posted { background: #1c8043; }
.key-dot.is-pending { background: var(--gold); }
.key-dot.is-none { background: #cfd5df; }
.key-dot.is-it { background: #b42318; }

.board-side {
    padding: 20px 24px;
    background: var(--cream);
    border-inline-start: 1px solid #eee6d3;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.board-figure { display: flex; flex-direction: column; gap: 2px; }

.board-figure-value {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--navy);
}

.board-figure-label { font-size: 13px; font-weight: 600; color: var(--text); }
.board-figure-note { font-size: 12px; color: var(--muted); }

.board-split {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e6ddc6;
}

.split-item { display: flex; flex-direction: column; gap: 2px; }
.split-item b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.split-item span { font-size: 11.5px; color: var(--muted); }

.board-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-2);
}

.board-note .icon { color: var(--muted); }

@media (max-width: 980px) {
    .board { grid-template-columns: 1fr; }
    .board-side { border-inline-start: 0; border-top: 1px solid #eee6d3; }
}

@media (max-width: 520px) {
    .board-split { grid-template-columns: 1fr 1fr; }
}

/* ==================================================================
   Attendance picture — the rate, the courses, the students
   ================================================================== */

.rate-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 26px;
    margin-bottom: 18px;
}

.rate-figure { display: flex; align-items: center; gap: 18px; }

.rate-ring {
    --pct: 0;
    width: 116px;
    height: 116px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring) calc(var(--pct) * 1%), #eef1f6 0);
}

.rate-ring.is-good { --ring: #1c8043; }
.rate-ring.is-ok { --ring: var(--gold); }
.rate-ring.is-low { --ring: #b42318; }

.rate-ring b {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    color: var(--navy);
}

.rate-ring b i { font-style: normal; font-size: 15px; }

.rate-caption { display: flex; flex-direction: column; gap: 4px; }
.rate-caption b { font-size: 15px; color: var(--text); }
.rate-caption span { font-size: 13px; color: var(--text-2); }

.rate-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
    padding-inline-start: 26px;
    border-inline-start: 1px solid var(--line);
}

.rate-fact { display: flex; flex-direction: column; gap: 2px; }
.rate-fact b { font-size: 21px; color: var(--navy); font-variant-numeric: tabular-nums; }
.rate-fact span { font-size: 12px; color: var(--muted); }

/* ---- one bar per course ---- */
.bar-list { list-style: none; margin: 0; padding: 0; }

.bar-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) minmax(120px, 2fr) 56px 84px auto;
    align-items: center;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.bar-row:last-child { border-bottom: 0; }
.bar-row:hover { background: #fbfcfe; }

.bar-label { min-width: 0; }
.bar-label b { display: block; font-size: 14px; color: var(--text); }

.bar-track { height: 10px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.is-good { background: #1c8043; }
.bar-fill.is-ok { background: var(--gold); }
.bar-fill.is-low { background: #b42318; }

.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.bar-value.is-good { color: #1c8043; }
.bar-value.is-ok { color: #8a6a1f; }
.bar-value.is-low { color: #b42318; }

.bar-counts { font-size: 12.5px; color: var(--muted); text-align: end; white-space: nowrap; }

/* ---- best / weakest lists side by side ---- */
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-row {
    display: grid;
    grid-template-columns: 26px auto 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.rank-row:last-child { border-bottom: 0; }

.rank-no {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f3ec;
    color: #1c8043;
    font-size: 12px;
    font-weight: 800;
}

.rank-no.is-low { background: #fdeceb; color: #b42318; }

.rank-who { min-width: 0; }
.rank-who b { display: block; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rank-pct { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-note { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.chip-green { background: #eaf7ee; border-color: #bfe3c9; color: #1c6b36; }

@media (max-width: 1080px) {
    .two-up { grid-template-columns: 1fr; }
    .rate-card { grid-template-columns: 1fr; }
    .rate-facts { padding-inline-start: 0; border-inline-start: 0; padding-top: 16px; border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
    .bar-row { grid-template-columns: 1fr auto; row-gap: 8px; }
    .bar-track { grid-column: 1 / -1; }
    .bar-counts, .bar-action { grid-row: 1; }
    .rank-row { grid-template-columns: 24px auto 1fr auto; }
    .rank-note { display: none; }
}
