/* =========================================================================
   MediFlow HMS — hand-written stylesheet (no build step, no Node.js).
   Colours live in the variables below; change --brand to re-theme.
   ========================================================================= */

:root {
  --brand: #0f766e;
  --brand-600: #0d6560;
  --brand-50: #ecfdf8;
  --brand-100: #d1faf0;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f6f8fa;
  --card: #ffffff;
  --danger: #b42318;
  --danger-50: #fef3f2;
  --danger-100: #fee4e2;
  --warn: #b54708;
  --warn-50: #fffaeb;
  --ok: #067647;
  --ok-50: #ecfdf3;
  --info: #175cd3;
  --info-50: #eff8ff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --sidebar-w: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 620; }
h3 { font-size: .98rem; font-weight: 620; }
p { margin: 0; }
small { font-size: .82em; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.strong { font-weight: 620; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #0b1f2a; color: #cbd5e1;
  display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #94a3b8; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-heading { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-weight: 500; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link.disabled { opacity: .45; cursor: default; }
.nav-link.disabled:hover { background: none; color: #cbd5e1; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.role-pill { display: inline-block; font-size: .75rem; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: #e2e8f0; }
.nav-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 10px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.nav-open { display: none; }
.global-search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.global-search .icon { position: absolute; left: 12px; color: var(--muted); }
.global-search input { width: 100%; padding: 9px 40px 9px 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font: inherit; }
.global-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.global-search kbd { position: absolute; right: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 24px; max-width: 1400px; width: 100%; }

/* User menu (uses <details> — no JS needed) */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; }
.user-name { font-weight: 550; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.menu-item:hover { background: var(--bg); text-decoration: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: #fbfcfd; border-radius: 0 0 var(--radius) var(--radius); }
a.card { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--brand-100); box-shadow: 0 0 0 3px var(--brand-50); text-decoration: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 580; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand); }

.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 560; cursor: pointer;
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-danger { background: #fff; border-color: #fda29b; color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .88rem; }
.btn-lg { padding: 12px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-9 { grid-column: span 9; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.row > .select, .row > .input:not(.grow) { width: auto; }
.field label, .field-label { display: block; font-weight: 560; font-size: .88rem; margin-bottom: 5px; color: var(--ink-2); }
.req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff;
  font: inherit; color: var(--ink);
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.is-invalid { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 8px 16px; margin: 0; cursor: pointer; font-weight: 560; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.segmented label:last-of-type { border-right: 0; }
.segmented input:checked + label { background: var(--brand); color: #fff; }
.segmented input:focus-visible + label { box-shadow: inset 0 0 0 2px var(--brand-100); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }
.disclosure { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 0; }
.disclosure > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--bg); color: var(--brand); font-weight: 700; }
.disclosure[open] > summary::before { content: "−"; }
.disclosure-body { padding: 4px 16px 16px; }

/* ---------- Alerts & badges ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--ok-50); border-color: #abefc6; color: var(--ok); }
.alert-error { background: var(--danger-50); border-color: #fecdca; color: var(--danger); }
.alert-info { background: var(--info-50); border-color: #b2ddff; color: var(--info); }
.alert-warning { background: var(--warn-50); border-color: #fedf89; color: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); border-color: #abefc6; }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: #fecdca; }
.badge-warn { background: var(--warn-50); color: var(--warn); border-color: #fedf89; }
.badge-info { background: var(--info-50); color: var(--info); border-color: #b2ddff; }
.badge-brand { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fbfcfd; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--brand-50); }
.table .row-link { color: var(--ink); font-weight: 600; }
.cell-sub { display: block; color: var(--muted); font-size: .82rem; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--line-2); margin-bottom: 8px; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }

/* ---------- Patient banner ---------- */
.patient-banner { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 18px 20px; }
.patient-avatar { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; flex: none; }
.patient-main { flex: 1; min-width: 220px; }
.patient-main h1 { font-size: 1.3rem; }
.patient-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--ink-2); margin-top: 6px; font-size: .92rem; }
.patient-meta span { display: inline-flex; align-items: center; gap: 5px; }
.patient-meta .icon { width: 15px; height: 15px; color: var(--muted); }
.allergy-box { border-radius: var(--radius-sm); padding: 10px 14px; min-width: 220px; max-width: 360px; }
.allergy-box.has { background: var(--danger-50); border: 1px solid #fecdca; color: var(--danger); }
.allergy-box.none { background: var(--ok-50); border: 1px solid #abefc6; color: var(--ok); }
.allergy-box.unknown { background: var(--warn-50); border: 1px solid #fedf89; color: var(--warn); }
.allergy-box strong { display: flex; align-items: center; gap: 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.allergy-box .icon { width: 15px; height: 15px; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 520; }

/* ---------- Search results (check-in picker) ---------- */
.picker { position: relative; }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 20; max-height: 320px; overflow-y: auto; }
.picker-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover, .picker-item.focused { background: var(--brand-50); }
.picker-empty { padding: 12px 14px; color: var(--muted); }
.selected-patient { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: var(--radius); }

/* ---------- Queue board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(158px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: #eef2f5; border-radius: var(--radius); padding: 8px; min-height: 240px; display: flex; flex-direction: column; gap: 10px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-weight: 650; font-size: .88rem; color: var(--ink-2); }
.lane-count { background: #fff; border-radius: 999px; padding: 0 9px; font-size: .78rem; border: 1px solid var(--line); }
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; box-shadow: var(--shadow); }
.ticket.urgent { border-left: 4px solid var(--danger); }
.ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ticket-top { flex-wrap: wrap; }
.ticket-top .row { gap: 4px; }
.ticket-top .badge { padding: 1px 6px; }
.ticket-top .badge .icon { width: 13px; height: 13px; }
.qno { font-weight: 800; font-size: 1.05rem; color: var(--brand-600); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticket-name { font-weight: 620; margin-top: 4px; color: var(--ink); display: block; }
.ticket-meta { color: var(--muted); font-size: .82rem; }
.ticket-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ticket-actions form { margin: 0; }
.wait-long { color: var(--danger); font-weight: 600; }
.lane-empty { color: #94a3b8; font-size: .85rem; text-align: center; padding: 18px 0; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
.live-dot.offline::before { background: #f79009; box-shadow: 0 0 0 3px #fef0c7; }

/* ---------- Permission matrix ---------- */
.perm-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.perm-group h3 { margin-bottom: 10px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }

/* ---------- Guest (login) ---------- */
.guest-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 480px) 1fr; }
.guest-panel { padding: 48px 44px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.guest-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.guest-brand div { display: flex; flex-direction: column; }
.guest-brand small { color: var(--muted); }
.guest-art { background: linear-gradient(135deg, #0b1f2a 0%, #0f766e 100%); color: #fff; display: flex; align-items: flex-end; padding: 56px; }
.guest-art h2 { font-size: 2rem; letter-spacing: -.02em; }
.guest-art p { color: #cdeee8; margin-top: 10px; max-width: 460px; font-size: 1.05rem; }

/* ---------- Environment banner ---------- */
.env-banner { background: #fef0c7; color: #93370d; border-bottom: 1px solid #fedf89; text-align: center; font-size: .82rem; font-weight: 600; padding: 5px 12px; }
.guest .env-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 60; }

/* ---------- Error page ---------- */
.error-detail { margin: 0; padding: 16px 20px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font-size: .8rem; line-height: 1.45; color: var(--ink-2); background: #fbfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.error-page { text-align: center; padding: 56px 20px; }
.error-code { font-size: 3.2rem; font-weight: 800; color: var(--line-2); }

/* ---------- Printables (card, ticket) ---------- */
.print-sheet { display: flex; justify-content: center; margin: 0 auto; }
.id-card { width: 85.6mm; height: 54mm; border: 1px solid var(--line-2); border-radius: 3mm; padding: 4mm; display: flex; flex-direction: column; justify-content: space-between; background: #fff; overflow: hidden; }
.id-card-head { display: flex; align-items: center; gap: 2.5mm; border-bottom: 1px solid var(--line); padding-bottom: 2mm; }
.id-card-head .brand-mark, .id-card-head .brand-logo { width: 8mm; height: 8mm; border-radius: 2mm; }
.id-card-head .brand-mark .icon { width: 5mm; height: 5mm; }
.id-card-head strong { font-size: 9pt; display: block; line-height: 1.1; }
.id-card-head small { font-size: 6.5pt; color: var(--muted); }
.id-card-name { font-size: 11pt; font-weight: 700; line-height: 1.2; }
.id-card-meta { font-size: 7.5pt; color: var(--ink-2); }
.id-card .barcode { width: 100%; height: 11mm; }
.id-card-no { font-family: ui-monospace, Consolas, monospace; font-size: 8pt; text-align: center; letter-spacing: .1em; }
.queue-slip { width: 72mm; border: 1px dashed var(--line-2); padding: 5mm; text-align: center; background: #fff; }
.queue-slip .big { font-size: 34pt; font-weight: 800; line-height: 1.1; margin: 2mm 0; }
.queue-slip .barcode { width: 100%; height: 12mm; }
.print-actions { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }

@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  .sidebar, .topbar, .nav-backdrop, .print-actions, .alert, .page-head, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 35; }
  .main { margin-left: 0; }
  .nav-open { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2 { grid-column: span 12; }
  .guest-wrap { grid-template-columns: 1fr; }
  .guest-art { display: none; }
  .guest-panel { padding: 32px 20px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .global-search kbd { display: none; }
}
@media (max-width: 600px) {
  .hide-sm { display: none !important; }
  .stats, .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.4rem; }
  .table th, .table td { padding: 10px 12px; }
  .hide-mobile-col { display: none; }
}
