/* Otylka — local, dependency-free styles adapted from the supplied reference. */
:root {
  --bg: #f4f7fb;
  --card: #fff;
  --text: #122338;
  --muted: #637387;
  --line: #e5ebf1;
  --primary: #0f6d8a;
  --primary-hover: #0a5972;
  --primary2: #1594b9;
  --success: #1d9870;
  --danger: #b44141;
  --warning: #986811;
  --info: #3f72c7;
  --shadow: 0 12px 34px rgb(20 48 72 / 8%);
  --r: 18px;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #1594b9; outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin-top: 0; }
small { font-size: 12px; }
img, svg { max-width: 100%; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
code, pre { font-size: 12px; }
pre { margin: 0; overflow: auto; max-width: 40rem; white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: -90px; left: 16px; padding: 12px 18px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); font-weight: 700; }
.skip-link:focus { top: 12px; }

/* Persistent navigation and account menu. */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 24px 18px; background: #0c3040; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.logo { display: grid; flex-shrink: 0; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, #45c8df, #0d7c9f); color: #fff; font-size: 30px; line-height: 1; font-weight: 700; }
.nav { display: grid; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; color: #d1e0e7; font-weight: 500; }
.nav a.active, .nav a:hover { background: #17495d; color: #fff; text-decoration: none; }
.nav a.active { font-weight: 750; }
.nav a:focus-visible { outline-color: #76ddeb; }
.nav-icon { display: inline-grid; flex: 0 0 20px; width: 20px; place-items: center; font-size: 18px; line-height: 1; }
.sidebar-foot { display: grid; gap: 2px; margin-top: 26px; padding: 14px; border-radius: 14px; background: #123d50; color: #d2e2e8; font-size: 12px; }
.sidebar-foot strong { color: #fff; }
.sidebar-role { margin-top: 8px; color: #b0cbd7; }
.main { min-width: 0; padding: 24px 30px 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.title { min-width: 0; }
.title h1 { margin: 0; font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.title p { margin: 5px 0 0; color: var(--muted); }
.account-menu { position: relative; flex-shrink: 0; z-index: 5; }
.user { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); list-style: none; }
.user::-webkit-details-marker { display: none; }
.user .muted { display: block; font-size: 12px; }
.account-label { max-width: 220px; }
.account-label strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-chevron { margin-left: 5px; color: var(--muted); }
.avatar { display: grid; flex-shrink: 0; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #dff1f5; color: var(--primary); font-weight: 800; }
.account-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 250px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 38px rgb(20 48 72 / 16%); }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--text); font-weight: 600; }
.account-dropdown a:hover, .account-dropdown button:hover { background: #edf6f8; color: var(--primary); text-decoration: none; }
.account-email { display: block; padding: 8px 12px 10px; overflow-wrap: anywhere; }
.account-dropdown form { margin: 0; }

/* Reusable content layout. */
.stack { display: grid; gap: 18px; min-width: 0; }
.grid { display: grid; gap: 18px; min-width: 0; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.two { grid-template-columns: 1.45fr .9fr; align-items: start; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.group-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 18px; }
.split > *, .grid > * { min-width: 0; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3, .card h3 { margin: 0; }
.card-head .muted { margin-top: 4px; }
.card-head .page-actions { margin-bottom: 0; }
.card-body { padding: 18px 20px; }
.card-body > :last-child { margin-bottom: 0; }
.card-footer { padding: 15px 20px; border-top: 1px solid var(--line); }
.card-footer .pagination { padding: 0; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.page-actions > :first-child:last-child { margin-left: auto; }
.page-actions .back-link, .page-actions > .btn-soft:first-child { margin-right: auto; }
.page-actions form, .toolbar form, .actions form, .inline-form { display: inline; margin: 0; }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.kpi { padding: 18px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { margin: 7px 0; font-size: 29px; line-height: 1.2; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.kpi .value-small { font-size: 21px; }
.kpi .sub { color: var(--success); font-size: 12px; }
.kpi .sub.red, .kpi.danger .sub, .kpi .sub.danger { color: var(--danger); background: none; }
.kpi .sub.yellow, .kpi.warning .sub { color: var(--warning); background: none; }
.kpi .sub.blue { color: var(--info); background: none; }
.kpi .sub.gray { color: var(--muted); background: none; }

/* Buttons and filters use native links and HTML forms. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 9px 13px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; font-size: 13px; line-height: 1.4; cursor: pointer; text-align: center; text-decoration: none; vertical-align: middle; }
.btn:hover { text-decoration: none; }
.btn-primary, .btn.primary { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn.primary:hover { background: var(--primary-hover); }
.btn-soft, .btn.soft { background: #eaf4f7; color: var(--primary); }
.btn-soft:hover, .btn.soft:hover { background: #d9edf3; }
.btn-danger, .btn.danger { background: #ffeded; color: #a63535; }
.btn-danger:hover, .btn.danger:hover { background: #fbe0e0; }
.btn-ghost, .btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover, .btn.ghost:hover { border-color: #bbcdd7; background: #f8fafc; }
.btn-small, .btn-sm { min-height: 32px; padding: 6px 9px; font-size: 12px; border-radius: 9px; }
.btn-block, .full-width { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar > form { display: flex; flex: 1; gap: 10px; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; width: auto; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); }
.toolbar select, .toolbar input[type="date"], .toolbar input[type="month"] { min-height: 43px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
.toolbar select { max-width: 100%; }
.search::placeholder { color: var(--muted); opacity: 1; }

/* Tables keep real column alignment and scroll within their card on phones. */
.table-wrap { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.card.table-wrap { overflow: auto; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--r) var(--r); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { padding: 15px 19px; font-weight: 700; text-align: left; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
th { background: #fafbfd; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
td .muted { display: block; }
td strong { font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable:hover, tr[data-href]:hover { background: #f7fbfc; cursor: pointer; }
tr[data-href]:focus-visible { outline-offset: -3px; }
.table-wrap td.wrap, .table-wrap th.wrap { white-space: normal; min-width: 190px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.text-right, td.amount, th.amount { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.cell-secondary { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.35; white-space: nowrap; }
.green { background: #e9f7f1; color: #17775a; }
.red { background: #feeeee; color: #b44141; }
.yellow { background: #fff5dd; color: #986811; }
.blue { background: #edf3ff; color: #3665ad; }
.gray { background: #eef2f5; color: #596878; }
.muted { color: var(--muted); font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: #17775a; }
.person { display: flex; align-items: center; gap: 10px; }
.person > div:last-child { min-width: 0; }
.person strong { display: block; }
.mini { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: #e4f1f5; color: var(--primary); font-size: 12px; font-weight: 800; }
.list { display: grid; gap: 10px; }
.lesson { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.lesson strong { display: block; }
.lesson > :first-child { min-width: 0; }
.lesson .btn, .lesson .badge { flex-shrink: 0; }
.group-card { display: flex; flex-direction: column; padding: 18px; }
.group-card h3 { margin: 10px 0 8px; }
.group-card > .muted { margin-top: 12px; }
.group-card .cap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 14px; }
.group-card .person h3 { margin: 0; }
.group-card .progress { margin-top: 14px; }

/* Student and instructor cards. */
.profile { padding: 18px; }
.profile h2 { margin: 0 0 7px; font-size: 23px; letter-spacing: -.02em; }
.big-avatar { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 22px; background: #dceff4; color: var(--primary); font-size: 22px; font-weight: 800; }
.profile dl { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 22px 0 0; }
.profile dt, .details-list dt, .data-grid dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.profile dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.profile .form-actions { flex-direction: column; align-items: stretch; margin-top: 20px; }
.profile .btn { margin-top: 6px; }
.details-list, .data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.details-list dd, .data-grid dd { margin: 5px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.data-grid .wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 6px; padding: 7px; margin-bottom: 16px; border-radius: 14px; background: #edf2f5; overflow-x: auto; }
.tabs a, .tabs button { display: block; flex-shrink: 0; padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--primary); text-decoration: none; }
.tabs .active, .tabs [aria-current="page"] { background: #fff; color: var(--primary); box-shadow: 0 4px 10px rgb(20 50 70 / 8%); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.sum { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sum strong { display: block; margin-top: 3px; font-size: 22px; font-weight: 750; }
.sum .badge { margin-top: 6px; }
.progress, progress { display: block; width: 100%; height: 8px; margin-top: 9px; overflow: hidden; border: 0; border-radius: 999px; background: #e8edf1; accent-color: var(--success); }
progress { appearance: none; }
progress::-webkit-progress-bar { background: #e8edf1; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--success); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--success); border-radius: 999px; }
.course-box { padding: 18px; }
.course-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.course-head h3 { margin: 4px 0 0; }
.course-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 3px; font-size: 18px; font-weight: 750; overflow-wrap: anywhere; }

/* Calendar and instructor schedule. */
.calendar { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.cal-head h2, .cal-head h3 { margin: 0; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow, .day { padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dow { background: #f8fafc; color: var(--muted); text-align: center; font-size: 11px; font-weight: 750; }
.day { min-height: 86px; }
.day:nth-child(7n), .dow:nth-child(7n) { border-right: 0; }
.day.outside, .day.other-month { background: #fafbfd; }
.day.outside .num, .day.other-month .num { color: #9aa6b3; }
.day.today .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.num { color: var(--muted); font-size: 12px; }
.statusdot { display: block; margin-top: 8px; padding: 5px; border-radius: 8px; text-align: center; font-size: 10px; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.present, .statusdot.present { background: #e8f7f1; color: #17775a; }
.absent, .statusdot.absent { background: #feeeee; color: #b44141; }
.future, .unset, .scheduled, .statusdot.future { background: #eef3f7; color: #566b80; }
.cancelled, .statusdot.cancelled { background: #fff5dd; color: #986811; }
.calendar-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.calendar-legend .badge { font-weight: 600; }
.schedule { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.schedule-grid { min-width: 620px; table-layout: fixed; }
.schedule-grid th:first-child, .schedule-grid td:first-child { width: 120px; }
.schedule-grid th, .schedule-grid td { min-width: 160px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; }
.schedule-grid th:last-child, .schedule-grid td:last-child { border-right: 0; }
.schedule-grid tbody tr:last-child td { border-bottom: 0; }
.schedule-grid th { padding: 13px 10px; font-size: 11px; }
.sched-cell { min-height: 78px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sched-head { min-height: auto; background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.slot { color: var(--text); font-size: 12px; font-weight: 750; }
.slot-card { display: block; padding: 10px; border: 1px solid #daedf1; border-radius: 10px; background: #edf6f8; color: #235c6e; font-size: 13px; font-weight: 650; }
.slot-card + .slot-card { margin-top: 7px; }
.slot-card:hover { background: #dff0f4; text-decoration: none; }
.slot-card small { display: block; margin-top: 4px; color: #506e7a; font-size: 11px; font-weight: 400; }
.slot-card.cancelled { border-color: #e7dfcc; background: #fff8e8; color: #806323; }
.slot-card.cancelled small { color: #806323; }

/* Forms: server validation, explicit actions and visible error messages. */
.form-card { max-width: 900px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; margin-bottom: 16px; }
.form-grid > .field { margin-bottom: 0; }
.field-full, .form-grid > .field:has(textarea), .form-grid > .field:has(select[multiple]) { grid-column: 1 / -1; }
.field label, .field > legend { display: block; margin-bottom: 6px; color: #4c6075; font-size: 12px; font-weight: 650; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #d9e2ea; border-radius: 10px; background: #fff; color: var(--text); }
.field textarea { min-height: 115px; resize: vertical; }
.field select[multiple] { min-height: 150px; padding: 6px; }
.field select[multiple] option { padding: 5px 7px; border-radius: 5px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f1f4f7; color: #68798a; cursor: not-allowed; }
.field input[readonly] { background: #f8fafc; }
.field input[type="checkbox"], .field input[type="radio"], .checkbox input { width: 18px; height: 18px; margin: 0 7px 0 0; vertical-align: middle; accent-color: var(--primary); }
.field:has(.errorlist) input, .field:has(.errorlist) select, .field:has(.errorlist) textarea, .field [aria-invalid="true"] { border-color: #cb6060; }
.field .checkbox, .checkbox-field { display: flex; align-items: center; gap: 7px; }
.checkbox-field label { margin: 0; }
.field ul { padding-left: 20px; }
.field ul label { font-weight: 400; }
.helptext, .help-text { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.helptext ul, .help-text ul { margin: 6px 0 0; padding-left: 19px; }
.errorlist { margin: 7px 0 10px; padding-left: 20px; color: #a93333; font-size: 12px; }
.errorlist.nonfield { margin: 0 0 18px; padding: 13px 15px 13px 32px; border: 1px solid #efcdcd; border-radius: 12px; background: #fff1f1; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions .btn-primary { min-width: 140px; }
.form-grid + .form-actions { margin-top: 24px; }
.form-actions form { margin: 0; }
.required { color: var(--danger); }
.impact-list { margin: 10px 0 0; padding-left: 20px; }
.impact-list li + li { margin-top: 5px; }
.info { margin-bottom: 16px; padding: 14px 16px; border: 1px solid #cfe4ed; border-radius: 14px; background: #f3fbfd; color: #315b6c; font-size: 13px; }
.info > :last-child { margin-bottom: 0; }
.info strong { font-weight: 700; }
.info.warning { border-color: #ecdcae; background: #fffaed; color: #80601f; }
.info.danger, .info.error { border-color: #efcdcd; background: #fff1f1; color: #a33c3c; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 13px 16px; border: 1px solid #cfe4ed; border-radius: 12px; background: #edf8fc; color: #315b6c; font-size: 13px; }
.message-success { border-color: #c2e5d7; background: #eaf8f1; color: #176d50; }
.message-error { border-color: #efcdcd; background: #fff1f1; color: #a33c3c; }
.message-warning { border-color: #ecdcae; background: #fffaed; color: #80601f; }
.empty-state { padding: 36px 22px; text-align: center; white-space: normal; }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; font-size: 17px; }
.empty-state p { max-width: 460px; margin: 0 auto 15px; color: var(--muted); font-size: 13px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 15px; border-radius: 18px; background: #edf5f8; color: var(--primary); font-size: 24px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0 0; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 6px; align-items: center; }
.pagination .current { color: var(--muted); font-size: 12px; }
.card > .pagination { padding: 16px 19px; border-top: 1px solid var(--line); }

/* Explicit present/absent inputs; an empty value remains unrecorded. */
.radio-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attendance-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.attendance-row:last-child { border-bottom: 0; }
.lesson.attendance-row { padding: 14px; }
.lesson.attendance-row:last-child { border-bottom: 1px solid var(--line); }
.attendance-row .person { min-width: 0; }
.attendance-choice { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 11px; border: 1px solid #dce5eb; border-radius: 10px; background: #fff; color: #526477; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.attendance-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.attendance-choice:hover { background: #f5f9fb; }
.attendance-choice:has(input:checked) { border-color: #a6d3df; background: #eaf5f9; color: var(--primary); }
.attendance-choice:has(input[value="present"]:checked) { border-color: #a4d6c3; background: #e9f7f1; color: #17775a; }
.attendance-choice:has(input[value="absent"]:checked) { border-color: #e6b9b9; background: #feeeee; color: #b44141; }
.attendance-choice:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.attendance-choice:has(input:focus-visible) { outline: 3px solid #1594b9; outline-offset: 3px; }
.attendance-note { margin-top: 4px; color: var(--muted); font-size: 12px; }
.attendance-row .errorlist { margin-bottom: 0; }

/* Authentication matches the separate, compact login mockup. */
.auth-body { background: var(--bg); }
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 36px 24px; }
.auth-brand { margin: 0 0 24px; color: var(--text); font-size: 25px; }
.auth-logo { width: 48px; height: 48px; border-radius: 16px; font-size: 33px; }
.auth-card { width: min(440px, 100%); padding: 28px; }
.auth-card h1, .auth-heading { margin: 0 0 8px; font-size: 25px; font-weight: 750; letter-spacing: -.025em; }
.auth-card h2 { margin: 0 0 10px; font-size: 22px; }
.auth-card > .muted, .auth-intro { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.auth-card .field input { min-height: 46px; }
.auth-card .btn { min-height: 46px; }
.auth-card .form-actions { display: grid; margin-top: 20px; padding-top: 0; border: 0; }
.auth-actions { display: grid; gap: 10px; margin-top: 20px; }
.auth-actions .btn { width: 100%; }
.auth-footer { margin: 22px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-divider { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.auth-status { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 18px; border-radius: 16px; background: #e9f7f1; color: #17775a; font-size: 23px; }
.auth-card .card { box-shadow: none; }
.auth-card .error-page { padding: 0; border: 0; }
.error-page { padding: 38px 26px; text-align: center; }
.error-page h1, .error-page h2 { margin: 12px 0; font-size: 23px; }
.error-page p { max-width: 520px; margin: 0 auto 22px; color: var(--muted); font-size: 14px; }
.error-code { display: block; color: #6a9ead; font-size: 46px; font-weight: 800; letter-spacing: -.05em; }

/* Page-specific wrappers share the same component vocabulary. */
.min-width-0 { min-width: 0; }
.card-head h2 { font-size: 17px; }
.card-head p { margin-bottom: 0; }
.text-muted, .kpi .sub.text-muted { color: var(--muted); }
.kpi .sub.text-danger { color: var(--danger); }
.text-link { font-size: 13px; font-weight: 650; }
.person-link { color: var(--text); }
.person-link:hover { color: var(--primary); text-decoration: none; }
.lesson-link { color: var(--text); }
.lesson-link:hover { border-color: #c6dfe8; background: #f7fbfc; text-decoration: none; }
.filter-select { min-height: 43px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
.form-page { max-width: 940px; }
.impact-card { margin-bottom: 18px; }
.impact-list:first-child { margin-top: 0; }
.form-errors { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #efcdcd; border-radius: 12px; background: #fff1f1; color: #a33c3c; }
.form-errors .errorlist { margin: 0; }
.form-errors .errorlist.nonfield { padding: 0 0 0 18px; border: 0; border-radius: 0; }
.field-errors .errorlist { margin-bottom: 0; }
.field-checkbox > label { display: flex; align-items: center; gap: 7px; min-height: 28px; margin: 0; color: var(--text); }
.field-checkbox input[type="checkbox"] { flex-shrink: 0; margin: 0; }
.empty-state-small { padding: 22px 12px; }
.empty-state > strong { display: block; margin-bottom: 7px; font-size: 15px; }
.empty-state .empty-icon + strong { margin-top: 0; }
.table-empty { padding: 28px 20px; color: var(--muted); text-align: center; white-space: normal; }
.readonly { display: inline-block; color: var(--muted); font-size: 12px; }
.section-gap, .quick-start { margin-top: 18px; }
.section-note { margin-top: 11px; font-size: 12px; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-toolbar > :first-child { margin-right: auto; }
.profile-schedule { margin-top: 20px; padding: 13px 12px; border-radius: 12px; background: #eef7fa; }
.profile-schedule strong { color: var(--primary); font-size: 13px; }
.profile-schedule .muted { margin-top: 3px; font-size: 12px; }
.course-head h2 { margin: 4px 0 0; font-size: 20px; }
.metric .metric-date { font-size: 15px; line-height: 1.5; }
.usage-bar { margin-top: 18px; }
.policy-note { margin: 13px 0 0; font-size: 12px; line-height: 1.6; }
.enrollment-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.enrollment-actions { justify-content: flex-start; margin: 16px 0 0; }
.day.outside-month { background: #fafbfd; }
.day.outside-month .num { color: #8d9cab; }
.day.is-today .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.statusdot.unmarked { background: #eef3f7; color: #566b80; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.voided-row { background: #f8fafc; color: var(--muted); }
.voided-row .money { text-decoration: line-through; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.detail-list dd { margin: 5px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.prose { line-height: 1.7; overflow-wrap: anywhere; }
.archive-box { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.archive-box p { margin: 7px 0 0; }
.quick-start .page-actions { justify-content: flex-start; margin-bottom: 0; }
.card-description { margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.card-label-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.compact-heading { margin: 0; font-size: 17px; }
.schedule-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.schedule-toolbar .date-picker { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; }
.schedule-toolbar .page-actions { margin-bottom: 0; }
.date-picker label { color: var(--muted); font-size: 12px; font-weight: 650; }
.date-picker input[type="date"] { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
.schedule-date { margin: 0; font-size: 18px; }
.schedule-table { min-width: 620px; table-layout: fixed; }
.schedule-table th:first-child, .schedule-table td:first-child { width: 120px; }
.schedule-table th, .schedule-table td { padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; }
.schedule-table th:last-child, .schedule-table td:last-child { border-right: 0; }
.schedule-table th { min-width: 170px; padding-top: 14px; padding-bottom: 14px; font-size: 11px; }
.schedule-table td { height: 91px; }
.schedule-table tbody tr:last-child td { border-bottom: 0; }
.attendance-toolbar { justify-content: space-between; }
.attendance-options { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attendance-meta { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.attendance-name { font-size: 14px; font-weight: 650; }
.attendance-form .form-actions { justify-content: flex-end; }
.attendance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.attendance-summary > div { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.attendance-summary dt { color: var(--muted); font-size: 12px; }
.attendance-summary dd { margin: 4px 0 0; font-size: 22px; font-weight: 750; }
.attendance-summary .count-present dd { color: #17775a; }
.attendance-summary .count-absent dd { color: var(--danger); }
.slot-card.slot-cancelled { border-color: #e7dfcc; background: #fff8e8; color: #806323; }
.slot-card.slot-cancelled small { color: #806323; }
.error-banner { margin-bottom: 16px; padding: 14px 16px; border: 1px solid #efcdcd; border-radius: 12px; background: #fff1f1; color: #a33c3c; font-size: 13px; }
.payment-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.payment-actions form { margin: 0; }
.toolbar form.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.toolbar form.filters input[type="search"], .toolbar form.filters input[type="text"] { flex: 1; min-width: 210px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.toolbar .search:has(input) { padding: 0; border: 0; background: transparent; }
.toolbar .search > input[type="search"], .toolbar .search > input[type="text"] { width: 100%; min-width: 0; }

@media (min-width: 1600px) {
  .main { padding-left: 38px; padding-right: 38px; }
  .group-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding: 22px 13px; }
  .main { padding: 22px 23px 44px; }
  .brand { font-size: 21px; }
  .nav a { padding: 11px 12px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .group-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 230px minmax(0, 1fr); }
  .course-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-label { max-width: 155px; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .profile dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile .form-actions { flex-direction: row; }
  .attendance-row { align-items: flex-start; flex-direction: column; }
  .card-head { flex-wrap: wrap; }
  .topbar { align-items: flex-start; }
  .title h1 { font-size: 25px; }
  .account-label { display: none; }
  .account-chevron { margin-left: 0; }
}

@media (max-width: 720px) {
  html { scrollbar-gutter: auto; }
  .app { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 16px 12px; overflow: visible; }
  .sidebar .brand { margin-bottom: 13px; font-size: 21px; }
  .sidebar .logo { width: 34px; height: 34px; border-radius: 11px; font-size: 25px; }
  .nav { display: flex; gap: 5px; overflow-x: auto; padding: 3px 0 5px; scrollbar-width: thin; scrollbar-color: #396475 transparent; }
  .nav a { flex-shrink: 0; gap: 6px; padding: 9px 11px; border-radius: 10px; white-space: nowrap; font-size: 12px; }
  .nav-icon { flex-basis: 16px; width: 16px; font-size: 15px; }
  .sidebar-foot { display: none; }
  .main { padding: 21px 16px 40px; }
  .topbar { gap: 10px; margin-bottom: 20px; }
  .title h1 { font-size: 24px; }
  .title p { font-size: 12px; }
  .user { gap: 5px; padding: 6px 8px; }
  .avatar { width: 32px; height: 32px; font-size: 12px; }
  .account-dropdown { width: min(270px, calc(100vw - 32px)); }
  .grid { gap: 12px; }
  .kpis { gap: 12px; }
  .kpi { padding: 15px; }
  .kpi .value { font-size: 25px; }
  .kpi .label { font-size: 12px; }
  .kpi .sub { font-size: 11px; }
  .card-head { padding: 15px 16px; }
  .card-head h2, .card-head h3 { font-size: 16px; }
  .card-body { padding: 16px; }
  .card-footer { padding: 14px 16px; }
  .page-actions { justify-content: flex-start; gap: 8px; }
  .page-actions > :first-child:last-child { margin-left: 0; }
  .toolbar { gap: 8px; }
  .toolbar .search { min-width: 0; flex: 1 1 100%; }
  .toolbar form.filters { flex: 1 0 100%; }
  .toolbar > .btn-primary { margin-left: auto; }
  .search, .toolbar select, .toolbar input { font-size: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field input, .field select, .field textarea { font-size: 16px; }
  .form-actions { align-items: stretch; }
  .form-actions > .btn { flex: 1; }
  .profile dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { gap: 3px; }
  .tabs a { padding: 9px 11px; font-size: 12px; }
  .cal-head { padding: 13px; }
  .day { min-height: 76px; padding: 5px; }
  .dow { padding: 7px 2px; font-size: 10px; }
  .statusdot { padding: 4px 2px; font-size: 9px; }
  .three { grid-template-columns: minmax(0, 1fr); }
  .attendance-row .radio-group { gap: 6px; }
  .attendance-choice { min-height: 43px; }
  .attendance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .schedule-toolbar .date-picker { width: 100%; flex-wrap: wrap; }
  .date-picker label { flex-basis: 100%; }
  .date-picker input[type="date"] { flex: 1; min-width: 0; font-size: 16px; }
  .pagination { font-size: 12px; }
  .auth-wrap { padding: 26px 18px; }
  .auth-card { padding: 24px; }
}

@media (max-width: 440px) {
  .main { padding-right: 12px; padding-left: 12px; }
  .group-cards { grid-template-columns: minmax(0, 1fr); }
  .kpi .value { font-size: 23px; }
  .kpi { padding: 13px; }
  .kpi .sub { overflow-wrap: anywhere; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary .sum:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .lesson { align-items: flex-start; flex-wrap: wrap; }
  .course-head { align-items: flex-start; flex-wrap: wrap; }
  .details-list, .detail-list, .data-grid { grid-template-columns: minmax(0, 1fr); }
  .attendance-choice { padding: 8px; font-size: 11px; }
  .day { min-height: 70px; padding: 4px; }
  .cal-head { flex-wrap: wrap; }
  .auth-card { padding: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .tabs a { transition: background-color 120ms ease, color 120ms ease; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  .app { display: block; }
  .sidebar, .account-menu, .page-actions, .toolbar, .form-actions, .skip-link, .pagination { display: none; }
  .main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .table-wrap, .schedule { overflow: visible; }
  a { color: inherit; }
  .topbar { margin-bottom: 14px; }
  th, td { padding: 7px; }
}
