/* Vision Model School - management system
   One stylesheet, no build step. Organised: tokens, base, layout,
   components, utilities, print. */

/* ------------------------------------------------------------- tokens */
:root {
  --ink:        #12202e;
  --ink-2:      #3d5266;
  --ink-3:      #6b7f92;
  --line:       #dbe3ea;
  --line-2:     #eef2f6;
  --bg:         #f4f7fa;
  --surface:    #ffffff;

  --brand:      #0f5c86;
  --brand-dark: #0a4364;
  --brand-soft: #e6f0f6;

  --ok:         #10715a;
  --ok-soft:    #e2f2ec;
  --warn:       #8a5a05;
  --warn-soft:  #fdf0d9;
  --bad:        #a3282f;
  --bad-soft:   #fbe9ea;
  --info-soft:  #e8effa;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 2px rgba(18, 32, 46, .06), 0 4px 14px rgba(18, 32, 46, .05);
  --shadow-lg:  0 12px 32px rgba(18, 32, 46, .16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-w: 236px;
  --topbar-h: 58px;
}

/* --------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .75rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

small { font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- layout */
.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  background: var(--brand-dark);
  color: #fff;
}
.topbar a { color: #fff; }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
  border-radius: 8px; font-size: .8rem; font-weight: 700;
}
.brand-name { font-size: .98rem; }
.brand-sub { display: block; font-size: .7rem; opacity: .72; font-weight: 400; line-height: 1; }

.topbar-spacer { flex: 1; }

.topbar-user {
  display: flex; align-items: center; gap: .55rem;
  font-size: .85rem;
}
.topbar-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
}
.topbar-role { opacity: .75; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }

/* Sign-out sits on the dark bar, so it needs its own colours: .btn-ghost is
   dark slate and scores 1.3:1 against --brand-dark, i.e. invisible. */
.topbar-signout {
  display: inline-flex; align-items: center; gap: .4rem;
  font: inherit; font-size: .8125rem; font-weight: 600;
  padding: .35rem .75rem; min-height: 32px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .12); color: #fff;
  cursor: pointer; white-space: nowrap;
}
.topbar-signout:hover { background: rgba(255, 255, 255, .26); }
.topbar-signout svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none;
  background: rgba(255,255,255,.14); border: 0; color: #fff;
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

.shell { display: flex; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1rem .6rem 2rem;
}
.nav-group + .nav-group { margin-top: 1.1rem; }
.nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 650; padding: 0 .65rem; margin-bottom: .3rem;
}
.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .65rem; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .9rem; font-weight: 500;
}
.nav-item:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav-item.is-active svg { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: .72rem; font-weight: 650;
  background: var(--line-2); color: var(--ink-2);
  padding: .05rem .4rem; border-radius: 20px;
}

.main { flex: 1; min-width: 0; padding: 1.25rem 1.5rem 3rem; }
.container { max-width: 1180px; margin: 0 auto; }
.container-narrow { max-width: 720px; margin: 0 auto; }

/* ------------------------------------------------------- page header */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: .75rem; margin-bottom: 1.1rem;
}
.page-head .grow { flex: 1; min-width: 240px; }
.page-head h1 { margin-bottom: .15rem; }
.page-sub { color: var(--ink-3); font-size: .875rem; margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.breadcrumb { font-size: .8125rem; color: var(--ink-3); margin-bottom: .35rem; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb span { margin: 0 .35rem; opacity: .5; }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .grow { flex: 1; min-width: 120px; }
.card-body { padding: 1.1rem; }
.card-body.tight { padding: .75rem 1.1rem; }
.card-foot {
  padding: .75rem 1.1rem; border-top: 1px solid var(--line-2);
  background: #fbfcfd; border-radius: 0 0 var(--radius) var(--radius);
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}

.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* --------------------------------------------------------- stat tiles */
.stats { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.1rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
}
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.stat-value { font-size: 1.75rem; font-weight: 680; line-height: 1.15; letter-spacing: -.02em; margin-top: .15rem; }
.stat-value.sm { font-size: 1.3rem; }
.stat-note { font-size: .8125rem; color: var(--ink-3); }
.stat a { font-size: .8125rem; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th, table.data td { padding: .6rem .75rem; text-align: left; vertical-align: middle; }
table.data thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 650; white-space: nowrap;
  border-bottom: 1px solid var(--line); background: #fbfcfd;
  position: sticky; top: 0; z-index: 1;
}
table.data tbody tr { border-bottom: 1px solid var(--line-2); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data .muted { color: var(--ink-3); }
table.data a { font-weight: 550; }
.row-strong { font-weight: 600; }

.table-compact th, .table-compact td { padding: .4rem .55rem; }

/* ------------------------------------------------------------ badges */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 650;
  padding: .12rem .48rem; border-radius: 20px; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge-ok      { background: var(--ok-soft);   color: var(--ok); }
.badge-warn    { background: var(--warn-soft); color: var(--warn); }
.badge-bad     { background: var(--bad-soft);  color: var(--bad); }
.badge-info    { background: var(--info-soft); color: var(--brand-dark); }
.badge-brand   { background: var(--brand-soft); color: var(--brand-dark); }

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-size: .875rem; font-weight: 600;
  padding: .5rem .9rem; min-height: 38px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; background: var(--brand); color: #fff;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn svg { width: 16px; height: 16px; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #822026; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-sm { font-size: .8125rem; padding: .3rem .6rem; min-height: 30px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ------------------------------------------------------------- forms */
.field { margin-bottom: .9rem; }
.field > label, .label {
  display: block; font-size: .8125rem; font-weight: 620;
  color: var(--ink-2); margin-bottom: .25rem;
}
.req { color: var(--bad); font-weight: 700; }
.hint { display: block; font-size: .78rem; color: var(--ink-3); margin-top: .2rem; }

.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .9rem;
  padding: .5rem .65rem; min-height: 38px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(15, 92, 134, .18); outline-offset: 0;
}
.textarea { min-height: 92px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7f92' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  background-size: 11px; padding-right: 1.9rem;
}
.input[readonly] { background: var(--line-2); color: var(--ink-2); }

.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
fieldset legend {
  padding: 0; font-size: .78rem; font-weight: 680; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3); margin-bottom: .6rem;
}

.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; }
.check input { width: 17px; height: 17px; margin-top: .18rem; flex: none; accent-color: var(--brand); }

.filters {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end;
}
.filters .field { margin: 0; flex: 1 1 160px; min-width: 140px; }
.filters .field.wide { flex: 2 1 240px; }
.filters .actions { display: flex; gap: .5rem; }

/* ------------------------------------------------------------ alerts */
.alert {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .7rem .9rem; border-radius: var(--radius);
  border: 1px solid; font-size: .875rem; margin-bottom: 1rem;
}
.alert-success { background: var(--ok-soft);  border-color: #b9dfd2; color: var(--ok); }
.alert-error   { background: var(--bad-soft); border-color: #f0c4c6; color: var(--bad); }
.alert-info    { background: var(--info-soft); border-color: #c6d6f0; color: var(--brand-dark); }
.alert-warn    { background: var(--warn-soft); border-color: #efd9a8; color: var(--warn); }
.alert strong { font-weight: 680; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }

/* ------------------------------------------------------- empty state */
.empty {
  text-align: center; padding: 2.5rem 1.25rem; color: var(--ink-3);
}
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: .5rem; }
.empty h3 { color: var(--ink-2); margin-bottom: .25rem; }
.empty p { max-width: 44ch; margin: 0 auto .9rem; font-size: .875rem; }

/* -------------------------------------------------------- pagination */
.pagination {
  display: flex; flex-wrap: wrap; gap: .3rem; align-items: center;
  padding: .75rem 1.1rem; border-top: 1px solid var(--line-2); font-size: .8125rem;
}
.pagination .grow { flex: 1; color: var(--ink-3); }
.page-link {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px;
  padding: 0 .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-2); background: var(--surface); font-weight: 600;
}
.page-link:hover { background: var(--line-2); text-decoration: none; }
.page-link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.is-disabled { opacity: .4; pointer-events: none; }

/* -------------------------------------------------------- meter bars */
.meter { height: 7px; border-radius: 20px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; border-radius: 20px; background: var(--brand); }
.meter.is-ok   > span { background: var(--ok); }
.meter.is-warn > span { background: #c78a1a; }
.meter.is-bad  > span { background: var(--bad); }
.meter-row { display: flex; align-items: center; gap: .5rem; }
.meter-row .meter { flex: 1; }
.meter-val { font-variant-numeric: tabular-nums; font-weight: 620; font-size: .8125rem; min-width: 46px; text-align: right; }

/* -------------------------------------------------- attendance grid */
.register-row td { padding-top: .45rem; padding-bottom: .45rem; }
.status-set { display: flex; gap: .25rem; flex-wrap: wrap; }
.status-opt { position: relative; }
.status-opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.status-opt span {
  display: block; padding: .28rem .6rem; font-size: .8125rem; font-weight: 620;
  border: 1px solid var(--line); border-radius: 20px; color: var(--ink-2);
  background: var(--surface); user-select: none; white-space: nowrap;
}
.status-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.status-opt input:checked + span.s-present { background: var(--ok-soft);   border-color: #a9d8c8; color: var(--ok); }
.status-opt input:checked + span.s-absent  { background: var(--bad-soft);  border-color: #eeb9bc; color: var(--bad); }
.status-opt input:checked + span.s-late    { background: var(--warn-soft); border-color: #ecd2a0; color: var(--warn); }
.status-opt input:checked + span.s-excused { background: var(--info-soft); border-color: #bcd0ee; color: var(--brand-dark); }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: .75rem 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  box-shadow: 0 -4px 14px rgba(18, 32, 46, .06);
  border-radius: 0 0 var(--radius) var(--radius);
}
.sticky-actions .grow { flex: 1; font-size: .8125rem; color: var(--ink-3); }

.mark-input { width: 88px; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ misc pieces */
.definition { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .1rem .9rem; font-size: .875rem; }
.definition dt { color: var(--ink-3); padding: .3rem 0; }
.definition dd { margin: 0; padding: .3rem 0; font-weight: 520; }

.avatar-lg {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
}

.notice { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.notice:last-child { border-bottom: 0; }
.notice-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.notice-head h3 { margin: 0; font-size: .95rem; }
.notice-meta { font-size: .78rem; color: var(--ink-3); }
.notice-body { white-space: pre-wrap; font-size: .875rem; color: var(--ink-2); margin: .35rem 0 0; }
.notice.is-pinned { background: #fffdf7; border-left: 3px solid #d9a441; }

.pill-list { display: flex; flex-wrap: wrap; gap: .35rem; }

.picker-list {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem;
}
.picker-list label {
  display: flex; gap: .5rem; align-items: center;
  padding: .3rem .4rem; border-radius: var(--radius-sm); font-size: .875rem;
}
.picker-list label:hover { background: var(--line-2); }

.danger-zone { border-color: #f0c4c6; }
.danger-zone .card-head { border-bottom-color: #f7dcde; }

.trend { display: flex; align-items: flex-end; gap: 4px; height: 88px; padding-top: .5rem; }
.trend-bar { flex: 1; min-width: 8px; background: var(--brand-soft); border-radius: 3px 3px 0 0; position: relative; }
.trend-bar > i { display: block; background: var(--brand); border-radius: 3px 3px 0 0; width: 100%; position: absolute; bottom: 0; }
.trend-labels { display: flex; gap: 4px; font-size: .65rem; color: var(--ink-3); margin-top: .3rem; }
.trend-labels > span { flex: 1; min-width: 8px; text-align: center; }

/* -------------------------------------------------------- auth pages */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 1.5rem; background: linear-gradient(160deg, #0a4364 0%, #12202e 100%);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 1.75rem;
}
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand .brand-mark {
  width: 46px; height: 46px; margin: 0 auto .6rem; font-size: 1rem;
  background: var(--brand-soft); color: var(--brand-dark);
}
.auth-brand h1 { font-size: 1.2rem; margin-bottom: .1rem; }
.auth-brand p { color: var(--ink-3); font-size: .85rem; margin: 0; }
.auth-foot { text-align: center; margin-top: 1.1rem; font-size: .78rem; color: rgba(255,255,255,.6); }

/* ------------------------------------------------- photo + routine */
.photo-field { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.photo-preview {
  width: 110px; height: 132px; flex: none; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--line-2); display: grid; place-items: center;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder { color: var(--ink-3); }
.student-photo {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); flex: none;
}

.routine-table th.routine-period { width: 92px; white-space: nowrap; background: #fbfcfd; }
.routine-cell { vertical-align: top; min-width: 130px; }
.routine-subject { font-weight: 620; }
.routine-cell.is-break { background: #fbfaf6; }
.routine-break { font-weight: 600; color: var(--warn); }
.routine-clear { opacity: 0; transition: opacity .12s; padding: 0; min-height: 20px; font-size: .72rem; }
.routine-cell:hover .routine-clear, .routine-clear:focus-visible { opacity: 1; }

/* ------------------------------------------------------- utilities */
.muted { color: var(--ink-3); }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.gap-sm { gap: .35rem; }
.grow { flex: 1; }
.text-sm { font-size: .8125rem; }
.tabular { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .main { padding: 1rem; }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 45;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow-lg); width: 262px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop {
    position: fixed; inset: var(--topbar-h) 0 0; z-index: 44;
    background: rgba(18, 32, 46, .4); border: 0; width: 100%;
  }
  .nav-backdrop { display: none; }
  body.nav-open .nav-backdrop { display: block; }
  .brand-sub { display: none; }
  .topbar-user .name { display: none; }
  .topbar-signout .label { display: none; }
  .topbar-signout { padding: .35rem .5rem; }
  .definition { grid-template-columns: 1fr; gap: 0; }
  .definition dt { padding-bottom: 0; }
  .definition dd { padding-top: 0; margin-bottom: .5rem; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
  .stat-value { font-size: 1.45rem; }
  .card-body { padding: .9rem; }
}

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

/* ---------------------------------------------------------- printing */
@media print {
  .topbar, .sidebar, .page-actions, .no-print, .sticky-actions, .pagination { display: none !important; }
  body { background: #fff; font-size: 11.5pt; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; margin-bottom: .6rem; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  table.data thead th { position: static; background: #fff; }
}
