/*
 * New Lakshya ERP — single stylesheet (no build step).
 * Shell and components follow designs/dashboard-ui (navy sidebar, white header,
 * blue accents, gold primary actions). Tokens first; components reuse them.
 */
:root {
    --navy-950: #0b1638; --navy-900: #0f1e4a; --navy-800: #16295f; --navy-700: #1e3474;
    --blue-600: #1d5ee8; --blue-500: #2f6ff2; --blue-50: #eef3ff; --blue-100: #dde7ff;
    --gold-500: #d9a42b; --gold-600: #c08d1b; --gold-50: #fff6e2;
    --red-600: #d6343f; --red-50: #fdecee; --green-600: #15803d; --green-50: #e7f7ed; --amber-600: #b45309; --amber-50: #fff4e0;
    --ink: #17203a; --ink-2: #44506b; --muted: #6b7690; --line: #e3e7f0; --line-2: #eef1f6;
    --bg: #f4f6fb; --surface: #fff;
    --radius: 12px; --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 30, 74, .05), 0 2px 10px rgba(16, 30, 74, .05);
    --focus: 0 0 0 3px rgba(47, 111, 242, .35);
    --sidebar-w: 248px; --topbar-h: 64px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--ink); }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
img { max-width: 100%; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .1rem 0 .3rem; color: var(--navy-900); letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 .9rem; color: var(--navy-900); }
h3 { font-size: .98rem; margin: 0 0 .6rem; color: var(--navy-900); }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9em; background: var(--line-2); padding: .05rem .35rem; border-radius: 4px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--red-600); font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: .5rem .8rem; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.icon { flex: none; vertical-align: middle; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #c9d3ee; overflow-y: auto; z-index: 40; padding: 18px 12px 24px; }
.wordmark { display: block; color: #fff; padding: 2px 12px 18px; line-height: 1; text-decoration: none !important; }
.wordmark small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .12em; }
.wordmark strong { display: block; font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; font-style: italic; }
.wordmark strong span { color: #ef3b45; }
.wordmark em { display: block; font-style: normal; font-size: .68rem; letter-spacing: .32em; margin-top: 3px; color: #dfe6fb; }
.nav-heading { margin: 14px 12px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8d9bc4; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: 9px; color: #dbe3f8; font-size: .92rem; text-decoration: none; }
.sidebar li a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar li a.active { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(29, 94, 232, .35); }
.main { margin-left: var(--sidebar-w); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(6px); }
.topbar-title { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--blue-50); color: var(--blue-600); }
.nav-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-500), var(--navy-700)); color: #fff; font-weight: 700; flex: none; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-meta b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--muted); }
.content { padding: 22px 28px 48px; max-width: 1480px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { opacity: .6; }
.breadcrumbs [aria-current] { color: var(--navy-900); font-weight: 600; }
.backdrop { position: fixed; inset: 0; background: rgba(11, 22, 56, .45); z-index: 35; }
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }
.page-head .head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; width: 100%; margin: 0 auto; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.step { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--blue-600); color: #fff; font-weight: 700; font-size: .9rem; flex: none; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; min-width: 0; }
.field > span { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 5px; color: var(--ink-2); }
.field input, .field select, .field textarea, input[type=search], .input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #d6dce8; border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus, input[type=search]:focus, .input:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--focus); }
.field input[readonly] { background: var(--line-2); color: var(--ink-2); }
.field textarea { min-height: 76px; resize: vertical; }
.field small:not(.err) { display: block; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--blue-600); flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.span-2 { grid-column: span 2; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--blue-600); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #164fcb; }
.btn.navy { background: var(--navy-800); }
.btn.navy:hover { background: var(--navy-900); }
.btn.gold { background: linear-gradient(180deg, #e2b13d, var(--gold-600)); color: #1b1606; box-shadow: 0 4px 12px rgba(192, 141, 27, .28); }
.btn.gold:hover { background: var(--gold-600); }
.btn.secondary { background: #fff; color: var(--navy-900); border-color: #d6dce8; }
.btn.secondary:hover { background: var(--blue-50); border-color: var(--blue-100); }
.btn.danger { background: var(--red-600); }
.btn.danger:hover { background: #b9232e; }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.actions .spacer { flex: 1; }
form.inline { display: inline; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--kpi, var(--blue-600)); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .kpi-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--kpi-bg, var(--blue-50)); color: var(--kpi, var(--blue-600)); flex: none; }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--navy-900); }
.kpi span { color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.kpi.green { --kpi: var(--green-600); --kpi-bg: var(--green-50); }
.kpi.red { --kpi: var(--red-600); --kpi-bg: var(--red-50); }
.kpi.amber { --kpi: var(--amber-600); --kpi-bg: var(--amber-50); }
.kpi.violet { --kpi: #6d4ae0; --kpi-bg: #f0ecff; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue-600); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); color: var(--ink-2); font-weight: 600; }
.stat b { display: block; font-size: 1.55rem; color: var(--navy-900); }

/* ---------- filters & tabs ---------- */
.filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 0 14px; align-items: end; }
.filters .field { margin-bottom: 12px; }
.filter-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: end; margin-bottom: 12px; grid-column: -3 / -1; }
.date-range { display: flex; gap: 8px; align-items: center; grid-column: span 2; }
.date-range .field { flex: 1; }
.tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; margin-bottom: 14px; box-shadow: var(--shadow); scrollbar-width: thin; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9px; color: var(--ink-2); font-weight: 600; white-space: nowrap; text-decoration: none; flex: 1; justify-content: center; }
.tabs a:hover { background: var(--line-2); }
.tabs a.active { background: var(--blue-50); color: var(--blue-600); box-shadow: inset 0 -2px 0 var(--blue-600); }
.count { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--line-2); font-size: .78rem; text-align: center; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.mode-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); }
.mode-card:hover { border-color: var(--blue-100); }
.mode-card .mode-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); flex: none; }
.mode-card b { display: block; color: var(--navy-900); }
.mode-card small { color: var(--muted); }
.mode-card .radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c3cbdb; flex: none; }
.mode-card.active { border-color: var(--blue-600); background: #f7f9ff; }
.mode-card.active .radio { border: 6px solid var(--blue-600); }
.segmented { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.segmented a { padding: 7px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.segmented a.active { background: #fff; color: var(--blue-600); box-shadow: var(--shadow); }

/* ---------- tables ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 16px 20px 0; }
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { background: #f8f9fc; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tbody tr:hover { background: #fafbff; }
td.num, th.num { text-align: right; }
td.nowrap, th.nowrap { white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person .avatar { width: 34px; height: 34px; font-size: .85rem; }
.person b { display: block; color: var(--navy-900); }
.person small { color: var(--muted); }
.row-actions { display: flex; gap: 6px; }
.row-actions a, .row-actions button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-2); }
.row-actions a:hover { background: var(--blue-50); color: var(--blue-600); text-decoration: none; }
.table-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 20px; color: var(--muted); font-size: .88rem; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty .icon { color: #b6bfd3; margin-bottom: 6px; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok, .badge.valid { background: var(--green-50); color: var(--green-600); }
.badge.bad, .badge.revoked { background: var(--red-50); color: var(--red-600); }
.badge.warn, .badge.superseded { background: var(--amber-50); color: var(--amber-600); }
.badge.info { background: var(--blue-50); color: var(--blue-600); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert.success { background: var(--green-50); border-color: #a7dcb9; color: #14532d; }
.alert.error { background: var(--red-50); border-color: #f2b2b8; color: #7f1d1d; }
.alert.warn { background: var(--amber-50); border-color: #f3cf8f; color: #78350f; }
.alert.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--navy-800); }

/* ---------- details ---------- */
dl.details { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 9px 16px; margin: 0; }
dl.details dt { font-weight: 600; color: var(--muted); font-size: .88rem; }
dl.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.selected-student { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: #f7f9ff; border: 1px solid var(--blue-100); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.selected-student .avatar { width: 52px; height: 52px; font-size: 1.1rem; }
.selected-student img.photo { width: 52px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.selected-student .facts { display: flex; flex-wrap: wrap; gap: 6px 26px; flex: 1; min-width: 0; }
.selected-student .facts div { min-width: 0; }
.selected-student .facts small { display: block; color: var(--muted); font-size: .76rem; }
.send-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.send-row:last-of-type { border-bottom: 0; }
.policy-table .input { min-width: 84px; }
.policy-table select.input { min-width: 158px; }
.policy-table td:last-child .input { min-width: 240px; }
.policy-table td, .policy-table th { vertical-align: top; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { margin: 6px 0; font-size: .9rem; color: var(--ink-2); }
.eligibility { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; background: #fcfdff; }
.results { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 320px; overflow-y: auto; background: #fff; }
.results li a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.results li a:hover, .results li a:focus { background: var(--blue-50); }
.results li:last-child a { border-bottom: 0; }
.results small { color: var(--muted); }
.search-row { display: flex; gap: 10px; margin-bottom: 12px; }
.search-row .input-icon { position: relative; flex: 1; }
.search-row .input-icon .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search-row .input-icon input { padding-left: 38px; }

/* ---------- issue layout ---------- */
.issue-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.preview-pane { position: sticky; top: calc(var(--topbar-h) + 16px); }
.preview-frame { width: 100%; aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #eef1f7; display: block; }
.preview-frame.landscape { aspect-ratio: 297 / 210; }
.preview-empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.facts-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fact { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .82rem; color: var(--ink-2); }
.fact .icon { color: var(--blue-600); }
.fact b { display: block; color: var(--navy-900); }
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps-list li { counter-increment: s; position: relative; padding-left: 32px; margin: 8px 0; color: var(--ink-2); font-size: .9rem; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-600); font-size: .75rem; font-weight: 700; }
.form-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; }
.form-footer .spacer { flex: 1; }
.show-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.qr-panel { display: flex; gap: 16px; align-items: center; }
.qr-panel img { width: 120px; height: 120px; border: 1px solid var(--line); border-radius: 8px; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue-600); border: 2px solid #fff; }
.timeline li:last-child { border-left-color: transparent; }
.timeline b { color: var(--navy-900); }
.timeline small { display: block; color: var(--muted); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pagination li > * { display: block; min-width: 36px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.pagination li.active > * { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.pagination li.disabled > * { color: #b6bfd3; }
nav[role=navigation] p { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }

/* ---------- library seat map ---------- */
.seat-map { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.seat > a, .seat > span { display: flex; flex-direction: column; min-height: 66px; padding: 7px 8px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); text-decoration: none !important; font-size: .74rem; line-height: 1.25; overflow: hidden; }
.seat b { font-size: .92rem; color: var(--navy-900); }
.seat small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.available > * { border-color: #a7dcb9; background: var(--green-50); }
.seat.occupied > * { border-color: var(--blue-100); background: var(--blue-50); }
.seat.overdue > * { border-color: #f2b2b8; background: var(--red-50); }
.seat.blocked > * { border-style: dashed; background: var(--line-2); color: var(--muted); }
.seat > a:hover { box-shadow: var(--shadow); border-color: var(--blue-600); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--line); vertical-align: middle; }
.dot.available { background: var(--green-50); border-color: #a7dcb9; }
.dot.occupied { background: var(--blue-50); border-color: var(--blue-100); }
.dot.overdue { background: var(--red-50); border-color: #f2b2b8; }
.dot.blocked { background: var(--line-2); border-style: dashed; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
    .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters .field.search { grid-column: span 3; }
    .filter-actions { grid-column: span 1; }
}
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .issue-layout, .show-layout { grid-template-columns: minmax(0, 1fr); }
    .preview-pane { position: static; }
}
@media (max-width: 960px) {
    :root { --sidebar-w: 270px; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    body.nav-open { overflow: hidden; }
    .main { margin-left: 0; }
    .nav-toggle { display: inline-flex; }
    .content { padding: 18px 16px 40px; }
    .topbar { padding: 0 16px; }
}
@media (max-width: 720px) {
    h1 { font-size: 1.4rem; }
    .topbar-title, .user-meta { display: none; }
    .filters, .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filters .field.search, .date-range, .filter-actions, .span-2 { grid-column: auto; }
    .filter-actions { justify-content: stretch; }
    .filter-actions .btn { flex: 1; }
    .mode-switch { grid-template-columns: 1fr; }
    .segmented { display: flex; width: 100%; }
    .segmented a { flex: 1; text-align: center; padding: 7px 8px; }
    .facts-row { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .page-head .head-actions { width: 100%; }
    .page-head .head-actions .btn { flex: 1; }
    dl.details { grid-template-columns: 1fr; gap: 2px 0; }
    dl.details dd { margin-bottom: 8px; }
    .form-footer .btn { flex: 1 1 100%; }
    .qr-panel { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 960px) {
    /* Tables on older pages are not wrapped in .table-wrap: let each one scroll on its own. */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrap table { display: table; }
    .actions form, .actions input[type=search] { max-width: 100%; }
}
@media (max-width: 480px) {
    .kpis { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
    .sidebar, .topbar, .actions, .no-print, .backdrop, .breadcrumbs { display: none !important; }
    .main { margin: 0; }
    body { background: #fff; }
    .card { box-shadow: none; }
}
/* Eligibility rules: one fieldset per document type, plus the in-force summary */
.policy-type { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 4px; margin: 0 0 14px; }
.policy-type legend { font-weight: 700; color: var(--navy-900); padding: 0 6px; }
.policy-type [hidden] { display: none !important; }
.policy-state { list-style: none; margin: 0; padding: 0; }
.policy-state li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.policy-state li:last-child { border-bottom: 0; }
.policy-state .badge { margin-right: 6px; }
.eligibility .outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.eligibility .outcome .badge { font-size: .9rem; }
.eligibility h3 { font-size: .85rem; margin: 10px 0 4px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.policy-type .check { align-items: center; margin: 4px 0 8px; }
.policy-type .check input { margin-top: 0; }
.policy-type .check span { display: inline; margin: 0; font-weight: 500; font-size: .92rem; color: var(--ink-1, inherit); }
