/* Haverhill Tuition Centre Portal
   Palette: exercise-book blue ink on white paper, with the red margin rule as the brand accent. */
:root {
  --paper: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --ink: #16203a;
  --ink-2: #4b5670;
  --ink-3: #7a8499;
  --line: #e2e6ee;
  --line-2: #eef1f6;
  --blue: #2346a0;
  --blue-600: #1b3985;
  --blue-soft: #e9eefb;
  --margin: #d2453d;
  --margin-soft: #fbeceb;
  --navy: #121d38;
  --navy-2: #1b2848;
  --green: #1d7f55; --green-soft: #e4f4ec;
  --amber: #a86a12; --amber-soft: #fbf1df;
  --red: #b83232; --red-soft: #fbe9e9;
  --grey-soft: #eef0f4;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(18, 29, 56, .05), 0 4px 16px rgba(18, 29, 56, .04);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 400; font-size: 1.85rem; letter-spacing: -.005em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono, .num { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.strong { font-weight: 700; }
.pos { color: var(--green); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.navtoggle { display: none; }
.scrim { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--navy); color: #c9d1e4; display: flex; flex-direction: column; padding: 20px 14px 16px;
  border-right: 3px solid var(--margin); /* the exercise-book margin */
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 14px; text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--margin); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 1rem; flex: none; }
.brand-logo { height: 38px; width: auto; max-width: 150px; background: #fff; border-radius: 6px; padding: 3px; }
.brand-name { font-family: var(--display); font-size: 1.02rem; line-height: 1.2; }
.role-pill { margin: 0 8px 14px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #8e9bbb; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #c9d1e4; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: #fff; color: var(--navy); }
.nav a.on .ic { color: var(--margin); }
.nav .count { margin-left: auto; background: var(--margin); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 999px; }
.ic { width: 19px; height: 19px; flex: none; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #25325a; display: grid; gap: 8px; }
.who { padding: 0 10px; display: grid; }
.who strong { color: #fff; font-weight: 600; }
.who small { color: #8e9bbb; overflow: hidden; text-overflow: ellipsis; }
.logout { display: flex; gap: 10px; align-items: center; color: #c9d1e4; padding: 8px 10px; border-radius: 8px; }
.logout:hover { background: var(--navy-2); color: #fff; text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px clamp(16px, 3vw, 40px) 40px; max-width: 1240px; width: 100%; }
.foot { margin-top: auto; padding: 18px clamp(16px, 3vw, 40px); color: var(--ink-3); font-size: .8rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head .sub { color: var(--ink-2); margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card > h2:first-child { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.stack { display: grid; gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.kpi span { color: var(--ink-2); font-size: .82rem; }
.kpi b { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi a { color: inherit; }
.kpi-due { border-color: #efc9c6; background: linear-gradient(0deg, var(--margin-soft), var(--margin-soft)); }
.kpi-due b { color: var(--red); }
.kpi-ok b { color: var(--green); }
.kpi-link:hover { border-color: var(--blue); text-decoration: none; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.opening td { color: var(--ink-2); font-style: italic; }
.statement tr.payment td { background: #f6fbf8; }
.person { display: flex; align-items: center; gap: 10px; }
.person small { display: block; color: var(--ink-3); }

.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--blue-soft); }
.avatar-lg { width: 84px; height: 84px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-initials { display: inline-grid; place-items: center; color: var(--blue); font-weight: 700; font-size: .8rem; }
.avatar-lg.avatar-initials { font-size: 1.5rem; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.b-scheduled, .b-pending, .b-unpaid { background: var(--blue-soft); color: var(--blue); }
.b-completed, .b-approved, .b-active, .b-paid { background: var(--green-soft); color: var(--green); }
.b-no_show, .b-paused { background: var(--amber-soft); color: var(--amber); }
.b-cancelled, .b-rejected, .b-left, .b-inactive { background: var(--grey-soft); color: var(--ink-3); }
.b-pending { background: var(--margin-soft); color: var(--margin); }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: .78rem; margin: 1px 2px 1px 0; color: var(--ink-2); }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--blue-600); border-color: var(--blue-600); }
.btn .ic { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: #efc9c6; }
.btn.danger-ghost:hover { background: var(--red-soft); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; }
.btn.sm { padding: 6px 11px; font-size: .86rem; }
.btn.xs { padding: 3px 9px; font-size: .8rem; font-weight: 600; }
.btn.block { width: 100%; }
button.x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 2px; }
button.x:hover { color: var(--red); }

/* ----------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .wide, .form-grid h2, .form-grid h3 { grid-column: 1 / -1; }
.form-grid h2 { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.form-grid > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .field legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.req { color: var(--margin); font-style: normal; }
.help { color: var(--ink-3); font-size: .8rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=month], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #cfd5e1; border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
input[type=file] { font: inherit; font-size: .88rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.checks legend { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; inset: 0; }
.chip-check span { display: inline-block; padding: 6px 12px; border: 1px solid #cfd5e1; border-radius: 999px; font-size: .88rem; cursor: pointer; background: var(--surface); user-select: none; }
.chip-check input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip-check input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.toggle input[type=checkbox] { position: absolute; opacity: 0; }
.knob { width: 38px; height: 22px; border-radius: 999px; background: #cfd5e1; position: relative; flex: none; transition: background .15s; margin-top: 1px; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .knob { background: var(--blue); }
.toggle input:checked + .knob::after { transform: translateX(16px); }
.toggle input:focus-visible + .knob { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle-text { display: grid; }
.toggle-text small { color: var(--ink-3); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .btn { align-self: flex-end; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ---------------------------------------------------------------- alerts */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: .93rem; }
.alert.success { background: var(--green-soft); border-color: #b9e1cc; color: #145c3e; }
.alert.error { background: var(--red-soft); border-color: #f0c4c4; color: #8f2424; }
.alert.warn { background: var(--amber-soft); border-color: #f0d6a8; color: #7b4d0c; }
.alert.info { background: var(--blue-soft); border-color: #c9d5f3; color: var(--blue-600); }
.alert a { font-weight: 600; }

.empty { text-align: center; padding: 26px 12px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); }
.empty p { margin: 0 0 10px; }
.empty p:last-child { margin: 0; }
.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .86rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------- week & slots */
.weeknav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.weeknav strong { margin: 0 6px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day header { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 6px; border-bottom: 1px solid var(--line-2); font-size: .8rem; color: var(--ink-3); }
.day header b { color: var(--ink); font-size: .88rem; }
.day.today { border-color: var(--margin); box-shadow: inset 0 3px 0 var(--margin); }
.day-empty { color: var(--ink-3); font-size: .8rem; margin: 6px 4px; }
.slot { display: grid; gap: 1px; padding: 7px 8px; border-radius: 7px; background: var(--blue-soft); border-left: 3px solid var(--blue); color: var(--ink); font-size: .82rem; text-decoration: none !important; min-width: 0; }
.slot strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.slot em { font-style: normal; color: var(--ink-2); font-weight: 400; }
.slot small { color: var(--ink-2); }
.slot:hover { filter: brightness(.97); }
.s-completed { background: var(--green-soft); border-left-color: var(--green); }
.s-no_show { background: var(--amber-soft); border-left-color: var(--amber); }
.s-cancelled { background: var(--grey-soft); border-left-color: #b8bfcc; opacity: .75; }
.s-cancelled strong { text-decoration: line-through; }

.avail-week { display: grid; gap: 0; margin-bottom: 16px; }
.avail-day { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.avail-name { font-weight: 700; font-size: .85rem; }
.avail-blocks { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-block { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue-600); border-radius: 6px; padding: 3px 6px 3px 9px; margin: 0; }

.slot-days { display: grid; gap: 14px; }
.slot-day h3 { font-size: .9rem; margin-bottom: 8px; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-btn { font: inherit; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 8px; border: 1px solid #c9d5f3; background: var(--surface); color: var(--blue); font-weight: 600; cursor: pointer; }
.slot-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.teacher-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tcard { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none !important; }
.tcard:hover, .tcard.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tcard p { margin: 2px 0 0; font-size: .84rem; color: var(--ink-2); }

.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; counter-reset: s; }
.steps span { counter-increment: s; font-size: .85rem; color: var(--ink-3); padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.steps span::before { content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: .74rem; margin-right: 7px; font-weight: 700; }
.steps span.on { color: var(--ink); border-color: var(--blue); }
.steps span.on::before { background: var(--blue); color: #fff; }
.steps span.done::before { background: var(--green); color: #fff; }

.share-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed #c9d5f3; border-radius: 8px; padding: 8px 8px 8px 12px; }
.share-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.cred { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 6px; }
.cred code { font-family: var(--mono); background: rgba(255,255,255,.1); padding: 2px 7px; border-radius: 5px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 90px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-track { height: 12px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 4px; }
.bar-fill.alt { background: var(--margin); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ------------------------------------------------------ public & auth pages */
.plain { background: var(--paper); }
.narrow { max-width: 760px; margin: 0 auto; padding: 32px 16px 60px; }
.display { font-family: var(--display); font-weight: 400; font-size: 2rem; margin-bottom: 6px; }
.sub { color: var(--ink-2); }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: .92rem; }
.checklist .ok { color: var(--green); }
.checklist .no { color: var(--ink-3); }

.auth { background: var(--navy); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; max-width: 1080px; margin: 0 auto; align-items: center; gap: 40px; padding: 32px 24px; }
.auth-side { color: #c9d1e4; }
.auth-side h1 { color: #fff; font-size: 2.4rem; margin: 28px 0 12px; max-width: 16ch; }
.brand.big .brand-mark { width: 46px; height: 46px; font-size: 1.2rem; }
.brand.big .brand-name { font-size: 1.25rem; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-points li { padding-left: 16px; border-left: 3px solid var(--margin); }
.auth-points b { color: #fff; }
.auth-card { background: var(--surface); border-radius: 14px; padding: 30px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }

.enrol-hero { background: var(--navy); color: #c9d1e4; border-bottom: 4px solid var(--margin); }
.enrol-hero .narrow { padding-bottom: 28px; }
.enrol-hero h1 { color: #fff; font-size: 2.1rem; margin: 18px 0 8px; }
.enrol-body { margin-top: -8px; }
.thanks { text-align: center; padding: 40px 24px; }
.thanks .tick { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; }
  .navtoggle:checked ~ .sidebar { transform: none; }
  .scrim { display: none; }
  .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 16, 32, .45); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: 10px 16px; border-bottom: 3px solid var(--margin); }
  .menu-btn { display: inline-flex; cursor: pointer; padding: 4px; }
  .topbar-title { font-family: var(--display); }
  .content { padding: 20px 16px 32px; }
  .grid-2, .grid-3, .kpis-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; }
  .auth-side h1 { font-size: 1.8rem; margin-top: 18px; }
  .auth-points { display: none; }
}
@media (max-width: 560px) {
  .form-grid, .form-grid.three, .grid-3 { grid-template-columns: 1fr; }
  .kpis-4 { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 1.25rem; }
  h1 { font-size: 1.5rem; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .filters .field { max-width: none; }
  .bar-row { grid-template-columns: 56px 1fr 70px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .sidebar, .topbar, .foot, .no-print, .actions, .alert, .filters, .weeknav form { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .content { padding: 0; max-width: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
a.slot-btn { display: inline-block; text-decoration: none !important; }
.alert .cred { margin: -4px -6px; }

.sm-only { display: none; }
@media (max-width: 560px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); position: relative; }
  .table.stack-sm td { border: 0; padding: 2px 0; text-align: left !important; white-space: normal; }
  .table.stack-sm td[data-label]:not([data-label=""]):not([data-label="Date"])::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: .82rem; }
  .table.stack-sm td.lg-cell { display: none; }
  .table.stack-sm .sm-only { display: inline; }
  .table.stack-sm .lg-only { display: none; }
  .table.stack-sm td.right { position: absolute; top: 10px; right: 10px; width: auto; }
  .table-wrap:has(.stack-sm) { margin: 0; }
}
