/* ==========================================================================
   App shell — admin / teacher / student / guardian
   ========================================================================== */
:root {
  --app-bg: #f6f7f9;
  --app-border: #e9ebf0;
  --app-ink: #1f2430;
}

.app-shell { min-height: 100vh; background: var(--app-bg); --role: #7c3aed; display: flex; }
.app-sidebar {
  width: 252px; flex: none; background: #fff; border-right: 1px solid var(--app-border);
  position: fixed; inset: 0 auto 0 0; z-index: 60; display: flex; flex-direction: column;
  padding: 16px 13px 14px; overflow-y: auto; scrollbar-width: thin;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 3px 6px 16px; border-bottom: 1px solid var(--app-border); margin-bottom: 15px; }
.side-brand > span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-brand .brand-text b { font-size: 17px; }
.side-brand .brand-text small { font-size: 10px; letter-spacing: .3px; color: var(--muted); }
.side-group { margin-bottom: 13px; }
.side-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; color: #9aa0ac; text-transform: uppercase; padding: 7px 11px 5px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: #525866; transition: .15s; margin-bottom: 1px;
  border: 0; background: none; width: 100%; text-align: left; cursor: pointer; position: relative;
}
.side-link .icon { color: #8b91a0; }
.side-link:hover { background: #f5f6f9; color: var(--ink); }
.side-link:hover .icon { color: var(--role); }
.side-link.active { background: color-mix(in srgb, var(--role) 9%, #fff); color: var(--role); font-weight: 600; }
.side-link.active .icon { color: var(--role); }
.side-link.active::before { content: ''; position: absolute; left: -13px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--role); }
.side-link.danger { color: #b91c1c; }
.side-link.danger .icon { color: #dc2626; }
.side-bottom { margin-top: auto; border-top: 1px solid var(--app-border); padding-top: 11px; }

.app-main { flex: 1; min-width: 0; margin-left: 252px; display: flex; flex-direction: column; }
.app-topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; gap: 14px; padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.app-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9aa0ac; min-width: 0; }
.app-crumb span { white-space: nowrap; }
.app-crumb b { color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-top-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.demo-pill { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--role) 8%, #fff); color: var(--role); border: 1px solid color-mix(in srgb, var(--role) 18%, #fff); border-radius: 100px; font-size: 10.5px; font-weight: 600; padding: 4px 9px; white-space: nowrap; }
.top-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #71717a; position: relative; border: 1px solid var(--app-border); background: #fff; }
.top-icon:hover { color: var(--role); border-color: color-mix(in srgb, var(--role) 30%, #fff); }
.dot-badge { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; background: #ef4444; border-radius: 50%; border: 1.5px solid #fff; }
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--app-border); }
.top-user b { display: block; font-size: 12.5px; line-height: 1.25; }
.top-user small { display: block; font-size: 10.5px; color: #9aa0ac; }
.app-menu-btn { display: none; }
.app-content { padding: 24px 28px 56px; width: 100%; max-width: 1440px; margin: 0 auto; }
.app-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.app-heading h1 { font-size: 23px; letter-spacing: -.02em; }
.app-heading p { color: #848b98; font-size: 12.5px; margin-top: 3px; }
.app-heading-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--app-border); border-radius: 12px; padding: 16px 17px; display: flex; align-items: center; gap: 13px; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -26px; width: 78px; height: 78px; border-radius: 50%; background: color-mix(in srgb, var(--role) 5%, transparent); }
.stat-icon { width: 43px; height: 43px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--role) 10%, #fff); color: var(--role); }
.tone-orange .stat-icon { background: #fff3ea; color: #ea580c; }
.tone-blue .stat-icon { background: #eef5ff; color: #2563eb; }
.tone-green .stat-icon { background: #e9f9ef; color: #16a34a; }
.tone-purple .stat-icon { background: #f4efff; color: #7c3aed; }
.tone-amber .stat-icon { background: #fff7e8; color: #d97706; }
.tone-red .stat-icon { background: #fef0f0; color: #dc2626; }
.tone-teal .stat-icon { background: #e9faf7; color: #0d9488; }
.stat-info { min-width: 0; }
.stat-info span { font-size: 11.5px; color: #848b98; display: block; }
.stat-info b { font-size: 23px; line-height: 1.25; letter-spacing: -.02em; display: block; color: var(--app-ink); }
.stat-info small { font-size: 10.5px; color: #9aa0ac; display: block; }
.stat-info small.up { color: #16a34a; }

/* ------------------------------------------------------------------- panels */
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid.equal { grid-template-columns: 1fr 1fr; }
.panel { background: #fff; border: 1px solid var(--app-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f0f1f5; }
.panel-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.panel-head h3 .icon { color: var(--role); }
.panel-head .panel-link { font-size: 11.5px; color: var(--role); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.panel-body { padding: 17px 18px; }
.panel-body.flush { padding: 0; }
.panel-sub { font-size: 11.5px; color: #9aa0ac; margin-top: 2px; }

/* --------------------------------------------------------------- bar chart */
.chart-bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 8px 2px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.chart-col .bar-track { width: 100%; max-width: 42px; height: 100%; display: flex; align-items: flex-end; }
.chart-col .bar-fill { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--role) 85%, #fff), color-mix(in srgb, var(--role) 55%, #fff)); min-height: 3px; position: relative; transition: height .5s; }
.chart-col .bar-fill:hover { filter: brightness(.94); }
.chart-col .bar-fill span { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: #848b98; white-space: nowrap; opacity: 0; transition: .15s; }
.chart-col:hover .bar-fill span { opacity: 1; }
.chart-col small { font-size: 10px; color: #9aa0ac; white-space: nowrap; }
.chart-legend { display: flex; gap: 18px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--app-border); }
.chart-legend span { font-size: 11px; color: #848b98; display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------------- donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 142px; height: 142px; border-radius: 50%; position: relative; flex: none; background: conic-gradient(var(--role) 0 45%, #f59e0b 45% 70%, #0ea5e9 70% 100%); }
.donut::after { content: ''; position: absolute; inset: 19px; border-radius: 50%; background: #fff; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; }
.donut-center b { font-size: 23px; line-height: 1.1; display: block; }
.donut-center small { font-size: 10px; color: #9aa0ac; }
.legend-list { display: grid; gap: 9px; flex: 1; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #525866; }
.legend-list i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-list b { margin-left: auto; font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- list rows */
.mini-list { display: grid; }
.mini-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed #f0f1f5; }
.mini-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-row:first-child { padding-top: 0; }
.mini-ico { width: 33px; height: 33px; border-radius: 9px; background: color-mix(in srgb, var(--role) 9%, #fff); color: var(--role); display: grid; place-items: center; flex: none; }
.mini-row .mini-main { flex: 1; min-width: 0; }
.mini-row b { font-size: 12.5px; display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row small { font-size: 10.5px; color: #9aa0ac; }
.mini-row .badge { flex: none; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--app-border); border-radius: 9px; font-size: 12px; font-weight: 600; color: #525866; transition: .15s; background: #fff; }
.quick-action .icon { color: var(--role); }
.quick-action:hover { border-color: color-mix(in srgb, var(--role) 35%, #fff); background: color-mix(in srgb, var(--role) 4%, #fff); color: var(--role); }

/* --------------------------------------------------------------- admin table */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; background: #fff; border: 1px solid var(--app-border); border-radius: 11px; padding: 11px 13px; }
.toolbar .search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--app-border); border-radius: 8px; padding: 8px 11px; min-width: 230px; background: #fafbfc; }
.toolbar .search-box input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12.5px; color: var(--ink); }
.toolbar .search-box .icon { color: #9aa0ac; }
.toolbar select { border: 1px solid var(--app-border); border-radius: 8px; background: #fff; padding: 8px 10px; font-size: 12.5px; color: #525866; outline: 0; }
.toolbar .spacer { margin-left: auto; }
.toolbar .btn { padding: 8px 13px; font-size: 12.5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--app-border); border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 680px; }
.data-table th { background: #fafbfc; color: #848b98; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--app-border); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f2f3f6; color: #3f4552; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfbfd; }
.data-table .cell-user { display: flex; align-items: center; gap: 9px; }
.data-table .cell-user b { display: block; font-size: 12.5px; color: var(--ink); font-weight: 600; line-height: 1.35; }
.data-table .cell-user small { color: #9aa0ac; font-size: 10.5px; }
.data-table .actions { display: flex; gap: 5px; justify-content: flex-end; }
.tbl-btn { width: 29px; height: 29px; border-radius: 7px; border: 1px solid var(--app-border); background: #fff; color: #71717a; display: inline-grid; place-items: center; cursor: pointer; transition: .14s; }
.tbl-btn:hover { color: var(--role); border-color: color-mix(in srgb, var(--role) 35%, #fff); background: color-mix(in srgb, var(--role) 5%, #fff); }
.tbl-btn.danger:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--app-border); font-size: 11.5px; color: #9aa0ac; background: #fff; border-radius: 0 0 11px 11px; }
.mobile-cards { display: none; }

/* -------------------------------------------------------------------- forms */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.form-card.app { background: #fff; border: 1px solid var(--app-border); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #9aa0ac; margin: 20px 0 10px; }
.form-section-title:first-child { margin-top: 0; }
.modal .form-grid { gap: 12px; }
.modal .field input, .modal .field select, .modal .field textarea { padding: 9px 11px; font-size: 13px; }
.modal .field label { font-size: 11.5px; }

/* ------------------------------------------------------------------ profile */
.profile-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.profile-card { background: #fff; border: 1px solid var(--app-border); border-radius: 12px; padding: 24px; text-align: center; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.profile-card .avatar { margin: 0 auto 12px; }
.profile-card h2 { font-size: 18px; }
.profile-card .role-text { color: var(--role); font-size: 12px; font-weight: 600; margin-top: 2px; }
.profile-card .p-meta { margin-top: 16px; border-top: 1px dashed var(--app-border); padding-top: 14px; display: grid; gap: 10px; text-align: left; }
.profile-card .p-meta div { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #525866; }
.profile-card .p-meta .icon { color: #9aa0ac; margin-top: 2px; }
.profile-card .p-meta small { display: block; color: #9aa0ac; font-size: 10.5px; }
.info-list { display: grid; }
.info-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px dashed #f0f1f5; font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: #848b98; }
.info-row b { font-weight: 600; text-align: right; }

/* ------------------------------------------------------------------- portal */
.welcome-banner { background: linear-gradient(120deg, color-mix(in srgb, var(--role) 90%, #111), color-mix(in srgb, var(--role) 60%, #111)); color: #fff; border-radius: 14px; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 18px; position: relative; overflow: hidden; margin-bottom: 18px; }
.welcome-banner::after { content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); right: -50px; top: -110px; }
.welcome-banner::before { content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .06); right: 70px; bottom: -90px; }
.welcome-banner h2 { font-size: 21px; }
.welcome-banner p { color: rgba(255, 255, 255, .78); font-size: 12.5px; margin-top: 4px; }
.welcome-banner .btn { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(3px); flex: none; }
.welcome-banner .btn:hover { background: rgba(255, 255, 255, .24); }
.welcome-aside { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 10px 14px; font-size: 11.5px; flex: none; }

.progress { height: 7px; background: #f0f1f5; border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--role); }
.progress.orange i { background: var(--primary); }
.progress.blue i { background: #2563eb; }
.progress.green i { background: #16a34a; }
.progress.amber i { background: #d97706; }

.course-progress-list { display: grid; gap: 12px; }
.course-progress { border: 1px solid var(--app-border); border-radius: 11px; padding: 15px; display: flex; gap: 14px; align-items: center; background: #fff; transition: .16s; }
.course-progress:hover { border-color: color-mix(in srgb, var(--role) 30%, #fff); box-shadow: 0 4px 14px rgba(16, 24, 40, .05); }
.cp-thumb { width: 58px; height: 58px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.cp-main { flex: 1; min-width: 0; }
.cp-main h3 { font-size: 14px; }
.cp-main small { color: #9aa0ac; font-size: 11px; }
.cp-progress { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.cp-progress .progress { flex: 1; max-width: 250px; }
.cp-progress b { font-size: 11px; color: var(--role); }
.cp-arrow { color: #c4c8d0; flex: none; }

/* lesson list */
.lesson-list { border: 1px solid var(--app-border); border-radius: 11px; overflow: hidden; background: #fff; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #f2f3f6; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-num { width: 30px; height: 30px; border-radius: 8px; background: #f5f6f9; color: #848b98; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: none; }
.lesson-row.done .lesson-num { background: #e9f9ef; color: #16a34a; }
.lesson-row .lesson-main { flex: 1; min-width: 0; }
.lesson-row b { font-size: 13px; display: block; font-weight: 600; }
.lesson-row small { font-size: 10.5px; color: #9aa0ac; }
.lesson-row .tbl-btn { flex: none; }
.lesson-row.done .tbl-btn { background: #e9f9ef; border-color: #c6f0d5; color: #16a34a; }

/* invoice list */
.invoice-list { display: grid; gap: 9px; }
.invoice-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #fff; border: 1px solid var(--app-border); border-radius: 10px; font-size: 12.5px; }
.invoice-row .inv-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #fff7e8; color: #d97706; }
.invoice-row.paid .inv-ico { background: #e9f9ef; color: #16a34a; }
.invoice-row .inv-main { flex: 1; min-width: 0; }
.invoice-row b { display: block; font-size: 12.5px; font-weight: 600; }
.invoice-row small { color: #9aa0ac; font-size: 10.5px; display: block; }
.invoice-row .inv-amount { font-weight: 700; font-size: 14px; color: var(--ink); }
.invoice-row .btn { flex: none; }

/* routine */
.routine-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
.routine-table th { background: #fafbfc; padding: 10px 12px; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: #848b98; border-bottom: 1px solid var(--app-border); }
.routine-table td { padding: 11px 12px; border-bottom: 1px solid #f2f3f6; }
.routine-table tr:last-child td { border-bottom: 0; }
.routine-table .today-row td { background: color-mix(in srgb, var(--role) 4%, #fff); }
.routine-table b { font-size: 12.5px; }
.routine-table small { display: block; color: #9aa0ac; font-size: 10.5px; }

/* results mini */
.result-mini-list { display: grid; gap: 9px; }
.result-mini { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 10px; background: #fff; }
.result-mini .rm-grade { width: 42px; height: 42px; border-radius: 10px; background: var(--green-soft); color: #15803d; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.result-mini .rm-main { flex: 1; }
.result-mini b { font-size: 12.5px; display: block; }
.result-mini small { color: #9aa0ac; font-size: 10.5px; }
.result-mini .rm-marks { text-align: right; font-size: 12px; }
.result-mini .rm-marks b { font-size: 15px; color: var(--role); }

/* quiz */
.quiz-card { background: #fff; border: 1px solid var(--app-border); border-radius: 12px; padding: 22px; max-width: 760px; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--app-border); }
.quiz-head h2 { font-size: 18px; }
.quiz-head p { font-size: 12px; color: #9aa0ac; }
.quiz-timer { background: var(--red-soft); color: #b91c1c; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.question-block { padding: 16px 0; border-bottom: 1px dashed var(--app-border); }
.question-block:last-of-type { border-bottom: 0; }
.question-block h3 { font-size: 14px; margin-bottom: 11px; display: flex; gap: 8px; }
.question-block h3 span { color: var(--role); }
.q-options { display: grid; gap: 7px; }
.q-option { display: flex; align-items: center; gap: 9px; border: 1px solid var(--app-border); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; cursor: pointer; transition: .14s; color: #525866; }
.q-option:hover { border-color: color-mix(in srgb, var(--role) 35%, #fff); background: #fbfbfd; }
.q-option input { accent-color: var(--role); }
.q-option:has(input:checked) { border-color: var(--role); background: color-mix(in srgb, var(--role) 5%, #fff); color: var(--ink); font-weight: 500; }
.quiz-result { text-align: center; padding: 24px; }
.quiz-result .qr-score { width: 110px; height: 110px; border-radius: 50%; background: color-mix(in srgb, var(--role) 10%, #fff); color: var(--role); display: grid; place-items: center; margin: 0 auto 14px; font-size: 32px; font-weight: 700; }
.quiz-result .qr-score small { font-size: 12px; font-weight: 500; color: #848b98; display: block; margin-top: -4px; }

/* attendance */
.att-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--app-border); border-radius: 11px; padding: 12px 14px; margin-bottom: 14px; }
.att-toolbar label { font-size: 11.5px; color: #848b98; display: grid; gap: 4px; }
.att-toolbar select, .att-toolbar input { border: 1px solid var(--app-border); border-radius: 7px; padding: 7px 9px; font-size: 12.5px; outline: none; background: #fff; }
.att-list { display: grid; gap: 7px; }
.att-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--app-border); border-radius: 9px; padding: 9px 12px; }
.att-row .att-name { flex: 1; min-width: 0; }
.att-row b { font-size: 12.5px; display: block; }
.att-row small { font-size: 10.5px; color: #9aa0ac; }
.att-options { display: flex; gap: 5px; }
.att-opt { border: 1px solid var(--app-border); background: #fff; color: #848b98; border-radius: 6px; font-size: 10.5px; font-weight: 600; padding: 5px 9px; cursor: pointer; }
.att-opt:hover { border-color: #c4c8d0; }
.att-opt.active.present { background: #e9f9ef; color: #15803d; border-color: #b9ebc9; }
.att-opt.active.absent { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.att-opt.active.late { background: #fff7e8; color: #b45309; border-color: #fde68a; }
.att-summary { display: flex; gap: 14px; font-size: 11.5px; color: #848b98; flex-wrap: wrap; }
.att-summary b { color: var(--ink); }

/* marks entry */
.marks-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.marks-table th { background: #fafbfc; text-align: left; padding: 9px 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #848b98; border-bottom: 1px solid var(--app-border); }
.marks-table td { padding: 8px 12px; border-bottom: 1px solid #f2f3f6; }
.marks-table input { width: 74px; border: 1px solid var(--app-border); border-radius: 6px; padding: 6px 8px; font-size: 12px; outline: none; }
.marks-table input:focus { border-color: var(--role); }
.marks-table tfoot td { background: #fafbfc; font-weight: 600; }

/* settings */
.settings-layout { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: start; }
.settings-nav { background: #fff; border: 1px solid var(--app-border); border-radius: 11px; padding: 8px; display: grid; gap: 2px; }
.settings-nav button { border: 0; background: none; text-align: left; padding: 9px 11px; border-radius: 7px; font-size: 12.5px; color: #525866; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.settings-nav button:hover { background: #f5f6f9; }
.settings-nav button.active { background: color-mix(in srgb, var(--role) 9%, #fff); color: var(--role); font-weight: 600; }
.settings-pane { display: none; }
.settings-pane.active { display: block; }
.color-swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--app-border); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--role); }
.settings-note { background: #fafbfc; border: 1px dashed var(--app-border); border-radius: 9px; padding: 12px 14px; font-size: 11.5px; color: #848b98; display: flex; gap: 8px; }

/* cards grid */
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mini-course-card { background: #fff; border: 1px solid var(--app-border); border-radius: 11px; overflow: hidden; }
.mini-course-cover { height: 84px; display: flex; align-items: flex-end; padding: 12px; color: #fff; font-weight: 700; font-size: 14px; position: relative; }
.mini-course-cover .mc-ico { position: absolute; right: 12px; top: 10px; opacity: .4; }
.mini-course-body { padding: 12px 14px; }
.mini-course-body small { color: #9aa0ac; font-size: 10.5px; display: block; }
.mini-course-body .progress { margin-top: 9px; }

/* certificate */
.certificate { background: #fffdf8; border: 1px solid #f0dbc8; padding: 9px; border-radius: 8px; }
.cert-border { border: 3px double #f2620e; padding: 26px 24px 22px; text-align: center; position: relative; background: radial-gradient(circle at 50% 0%, #fff7ef, #fffdf8 70%); }
.cert-brand { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; margin-bottom: 16px; }
.cert-brand b { display: block; font-size: 15px; line-height: 1.3; }
.cert-brand small { display: block; font-size: 9.5px; color: #a8a29e; }
.cert-kicker { letter-spacing: 2.5px; font-size: 9.5px; color: #b45309; font-weight: 700; }
.certificate h2 { font-size: 24px; margin: 5px 0 13px; color: #7c2d12; letter-spacing: -.01em; }
.cert-text { font-size: 12.5px; color: #57534e; line-height: 1.8; }
.cert-text b { color: #9a3412; }
.cert-name { font-size: 28px; font-weight: 700; color: #9a3412; border-bottom: 1px dashed #d6b394; display: inline-block; padding: 2px 28px 6px; margin: 8px 0 10px; line-height: 1.35; }
.cert-meta { display: flex; justify-content: center; gap: 30px; margin: 18px 0 4px; }
.cert-meta span { display: block; font-size: 9.5px; color: #a8a29e; }
.cert-meta b { font-size: 11.5px; color: #44403c; }
.cert-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 24px; }
.cert-sign > div { min-width: 110px; }
.cert-sign > div > span { display: block; width: 110px; border-top: 1px solid #d6d3d1; margin: 0 auto 5px; }
.cert-sign b { display: block; font-size: 11px; color: #44403c; }
.cert-sign small { font-size: 9px; color: #a8a29e; }
.cert-seal { width: 68px; height: 68px; border-radius: 50%; border: 2px solid #f2620e; color: #f2620e; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; background: #fff7ef; flex: none; }
.cert-seal small { font-size: 6.5px; letter-spacing: 1.4px; font-weight: 700; }
.cert-code { margin-top: 16px; font-size: 10px; color: #a8a29e; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* receipt */
.receipt { background: #fff; padding: 26px; border-radius: 12px; border: 1px solid var(--app-border); font-size: 13px; }
.receipt-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.receipt-head h2 { font-size: 18px; }
.receipt-head small { color: #848b98; font-size: 11px; display: block; line-height: 1.7; }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px dashed var(--app-border); font-size: 12px; }
.receipt-meta span { color: #848b98; display: inline-block; min-width: 100px; }
.receipt table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.receipt th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: #848b98; padding: 7px 0; border-bottom: 1px solid var(--app-border); }
.receipt td { padding: 9px 0; border-bottom: 1px dashed #f0f1f5; }
.receipt td:last-child, .receipt th:last-child { text-align: right; }
.receipt-total { display: flex; justify-content: flex-end; gap: 30px; padding-top: 10px; font-size: 14px; }
.receipt-total b { font-size: 18px; color: var(--role); }
.receipt-foot { margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--app-border); display: flex; justify-content: space-between; gap: 20px; color: #848b98; font-size: 10.5px; }

@media print {
  body * { visibility: hidden; }
  #overlay-root, #overlay-root * { visibility: visible; }
  #overlay-root { position: absolute; inset: 0; }
  .modal-backdrop { position: absolute; inset: 0; background: #fff; padding: 0; display: block; }
  .modal { max-width: none; max-height: none; box-shadow: none; border: 0; }
  .modal-head, .modal-foot { display: none !important; }
  .modal-body { padding: 0; overflow: visible; }
  .receipt { border: 0; padding: 0; }
}

/* empty app */
.app-empty { text-align: center; padding: 40px 20px; color: #9aa0ac; background: #fff; border: 1px dashed var(--app-border); border-radius: 11px; }
.app-empty h3 { font-size: 14px; color: var(--ink); margin: 8px 0 3px; }
.app-empty p { font-size: 12px; margin-bottom: 12px; }

/* sidebar backdrop */
@media (max-width: 1024px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .1); }
  .app-main { margin-left: 0; }
  .app-menu-btn { display: inline-flex; }
  .app-shell.sidebar-open .app-sidebar { transform: none; }
  .app-shell.sidebar-open::after { content: ''; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 55; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid.equal { grid-template-columns: 1fr; }
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { max-width: none; }
}
@media (max-width: 700px) {
  .app-topbar { padding: 0 14px; height: 56px; gap: 8px; }
  .app-crumb span { display: none; }
  .app-crumb .icon { display: none; }
  .app-top-actions { gap: 8px; }
  .demo-pill { display: none; }
  .top-user span:last-child { display: none; }
  .top-user { padding-left: 8px; }
  .app-content { padding: 16px 14px 40px; }
  .app-heading h1 { font-size: 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 37px; height: 37px; }
  .stat-info b { font-size: 19px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .toolbar { padding: 9px; }
  .toolbar .search-box { min-width: 0; flex: 1; }
  .toolbar .spacer { display: none; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
  .welcome-aside { display: none; }
  .donut-wrap { flex-direction: column; }
  .quick-actions { grid-template-columns: 1fr; }
  .invoice-row { flex-wrap: wrap; }
  .invoice-row .btn { margin-left: 50px; }
  .table-wrap { border-radius: 10px; }
  .data-table { min-width: 620px; }
  .quiz-card { padding: 16px; }
  .att-row { flex-wrap: wrap; }
  .att-options { width: 100%; justify-content: flex-end; }
  .app-heading-actions .btn { padding: 8px 12px; font-size: 12px; }
  .receipt { padding: 16px; }
  .receipt-meta { grid-template-columns: 1fr; }
}
