/* SCHOLNEXA — ERP & portal styles. Mobile-first, no external dependencies. */
:root {
  --brand: #0f766e; --brand-2: #f59e0b; --brand-ink: #fff;
  --bg: #f4f6f8; --panel: #ffffff; --panel-2: #f8fafc; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e2e8f0; --line-2: #cbd5e1;
  --green: #15803d; --green-bg: #dcfce7; --red: #b91c1c; --red-bg: #fee2e2; --amber: #b45309; --amber-bg: #fef3c7;
  --blue: #1d4ed8; --blue-bg: #dbeafe; --purple: #7e22ce; --purple-bg: #f3e8ff; --gray-bg: #f1f5f9;
  --chart-1: var(--brand); --chart-2: #f59e0b; --chart-3: #6366f1; --chart-4: #e11d48;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.04);
  --side-w: 256px;
  --font: "Inter", "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --panel: #111a2c; --panel-2: #0f172a; --ink: #e2e8f0; --ink-2: #cbd5e1; --muted: #94a3b8;
    --line: #1f2a40; --line-2: #2c3a55; --green-bg: #052e1a; --red-bg: #3b0a0a; --amber-bg: #3a2405; --blue-bg: #0b2150;
    --purple-bg: #2a0b45; --gray-bg: #1a2336; --green: #4ade80; --red: #f87171; --amber: #fbbf24; --blue: #93c5fd; --purple: #d8b4fe;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --panel: #111a2c; --panel-2: #0f172a; --ink: #e2e8f0; --ink-2: #cbd5e1; --muted: #94a3b8;
  --line: #1f2a40; --line-2: #2c3a55; --green-bg: #052e1a; --red-bg: #3b0a0a; --amber-bg: #3a2405; --blue-bg: #0b2150;
  --purple-bg: #2a0b45; --gray-bg: #1a2336; --green: #4ade80; --red: #f87171; --amber: #fbbf24; --blue: #93c5fd; --purple: #d8b4fe;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .inline { display: inline; } .hidden { display: none !important; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ico { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ── Shell ── */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: var(--panel-2); }
.brand .logo-fallback { width: 36px; height: 36px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand b { display: block; font-size: 14px; } .brand small { color: var(--muted); font-size: 11px; display: block; }
.nav { padding: 8px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); cursor: pointer; list-style: none; font-weight: 500; }
.nav-item::-webkit-details-marker { display: none; }
.nav-item:hover { background: var(--panel-2); text-decoration: none; }
.nav-item.active, .nav-group[open] > .nav-item { color: var(--brand); }
.nav-item.active { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.nav-item .caret { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; opacity: .6; }
.nav-group[open] > .nav-item .caret { transform: rotate(45deg); }
.nav-children { padding: 2px 0 6px 40px; display: grid; }
.nav-sub { padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.nav-sub:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.nav-sub.active { color: var(--brand); font-weight: 600; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; }
.lic-pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-weight: 600; white-space: nowrap; }
.lic-pill.warn { background: var(--amber-bg); color: var(--amber); } .lic-pill.bad { background: var(--red-bg); color: var(--red); }
.top-link { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; position: relative; padding: 6px; border-radius: 8px; }
.top-link:hover { background: var(--panel-2); text-decoration: none; }
.top-link .dot { position: absolute; top: 2px; right: 0; background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; object-fit: cover; flex: none; }
.dropdown { position: absolute; right: 0; top: 110%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; z-index: 30; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--panel-2); text-decoration: none; }
.content { padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }
.banner { padding: 10px 20px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--amber-bg); color: var(--amber); } .banner.bad { background: var(--red-bg); color: var(--red); } .banner.info { background: var(--blue-bg); color: var(--blue); }

/* ── Page chrome ── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; min-width: 0; }
.card > h2, .card > h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); flex: none; }
.stat.green .stat-ico { background: var(--green-bg); color: var(--green); } .stat.red .stat-ico { background: var(--red-bg); color: var(--red); }
.stat.amber .stat-ico { background: var(--amber-bg); color: var(--amber); } .stat.blue .stat-ico { background: var(--blue-bg); color: var(--blue); }
.stat-v { font-size: 20px; font-weight: 700; line-height: 1.2; } .stat-l { font-size: 12px; color: var(--muted); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th, .t td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.t th { background: var(--panel-2); font-weight: 600; color: var(--ink-2); white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: var(--panel-2); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tfoot td { font-weight: 700; background: var(--panel-2); }
.t .actions { white-space: nowrap; text-align: right; }
.t input, .t select { padding: 5px 8px; min-width: 60px; }
.thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--panel-2); vertical-align: middle; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
label em { color: var(--red); font-style: normal; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=file] { padding: 6px; }
input[type=color] { height: 38px; padding: 2px; }
select[multiple] { min-height: 110px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; padding-top: 22px; }
.help { color: var(--muted); font-size: 11.5px; } .err { color: var(--red); font-size: 12px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 140px; flex: 1 1 140px; max-width: 260px; }
.thumb-prev img { max-height: 70px; border-radius: 8px; border: 1px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 16px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; color: var(--brand); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; } .btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Badges, alerts ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); } .badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); } .badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--muted); } .badge-purple { background: var(--purple-bg); color: var(--purple); }
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); } .alert-error { background: var(--red-bg); color: var(--red); }
.alert-warning { background: var(--amber-bg); color: var(--amber); } .alert-info { background: var(--blue-bg); color: var(--blue); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); } .empty-ico { font-size: 30px; opacity: .4; }
.pager { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pager a, .pager b, .pager span { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; }
.pager b { background: var(--brand); color: #fff; border-color: var(--brand); } .pager .pager-info { border: 0; color: var(--muted); margin-right: auto; }
.pager-info { color: var(--muted); font-size: 12px; margin-top: 10px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.active { color: var(--brand); border-color: var(--brand); } .tabs a:hover { text-decoration: none; color: var(--ink); }
.progress { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); }
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head img, .profile-head .avatar { width: 84px; height: 84px; border-radius: 16px; font-size: 28px; object-fit: cover; }

/* ── Charts ── */
.chart { width: 100%; height: auto; display: block; }
.chart .ch-g { stroke: var(--line); stroke-width: 1; } .chart .ch-l { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ── Attendance grid & routine ── */
.att-opts { display: flex; gap: 4px; flex-wrap: wrap; }
.att-opts label { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; }
.att-opts input { display: none; }
.att-opts input:checked + span { color: #fff; }
.att-opts label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.att-opts label.A:has(input:checked) { background: var(--red); border-color: var(--red); }
.att-opts label.L:has(input:checked) { background: var(--amber); border-color: var(--amber); }
.routine-grid td { min-width: 120px; vertical-align: top; }
.slot { background: color-mix(in srgb, var(--brand) 8%, transparent); border-left: 3px solid var(--brand); border-radius: 6px; padding: 6px 8px; font-size: 12px; margin-bottom: 4px; }
.slot b { display: block; font-size: 12.5px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .d { min-height: 86px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font-size: 12px; }
.cal .d.off { opacity: .35; } .cal .d.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .h { font-weight: 700; text-align: center; color: var(--muted); font-size: 12px; padding: 4px; }
.cal .ev { display: block; background: var(--blue-bg); color: var(--blue); border-radius: 4px; padding: 1px 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.holiday { background: var(--red-bg); color: var(--red); } .cal .ev.exam { background: var(--amber-bg); color: var(--amber); }
.cal .att-P { background: var(--green-bg); } .cal .att-A { background: var(--red-bg); } .cal .att-L { background: var(--amber-bg); } .cal .att-LV { background: var(--blue-bg); }

/* ── Rich text editor ── */
.rte { border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.rte-bar { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.rte-bar button { border: 0; background: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; color: var(--ink); font-size: 12px; }
.rte-bar button:hover { background: var(--line); }
.rte-area { min-height: 200px; padding: 10px 12px; outline: none; }
.rte-src { display: none; font-family: ui-monospace, monospace; font-size: 12px; }
.rte.html-mode .rte-area { display: none; } .rte.html-mode + .rte-src { display: block; }

/* ── Auth pages ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 12px 40px rgba(15,23,42,.08); }
.auth-card .brand-big { text-align: center; margin-bottom: 18px; }
.auth-card .brand-big .mark { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.auth-card .brand-big img { max-height: 64px; margin-bottom: 8px; }
.auth-card form { display: grid; gap: 12px; }
.lock-card { max-width: 560px; text-align: center; }
.lock-ico { font-size: 44px; }

/* ── Portal ── */
.portal-top { background: var(--brand); color: #fff; }
.portal-top .inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.portal-top a { color: #fff; }
.portal-nav { background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.portal-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; }
.portal-nav a { padding: 12px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; font-size: 13px; }
.portal-nav a.active { color: var(--brand); border-color: var(--brand); } .portal-nav a:hover { text-decoration: none; color: var(--ink); }
.portal-main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.child-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.child-switch a { display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
.child-switch a.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
.child-switch .avatar { width: 28px; height: 28px; font-size: 11px; }
.timer { position: sticky; top: 0; background: var(--amber-bg); color: var(--amber); padding: 8px 12px; border-radius: 8px; font-weight: 700; z-index: 5; text-align: center; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.q label { display: flex; gap: 8px; font-weight: 500; padding: 6px; border-radius: 6px; cursor: pointer; }
.q label:hover { background: var(--panel-2); }

/* ── Gate scanner ── */
.scanner { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.scanner video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.scan-result { font-size: 18px; padding: 16px; border-radius: 12px; text-align: center; }

/* ── Responsive ── */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 8px 16px; }
  .form-grid .c2, .form-grid .c3, .form-grid .c4 { grid-column: span 6; }
  .form-grid .c6, .form-grid .c8 { grid-column: span 12; }
  .scanner { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .form-grid .c2, .form-grid .c3, .form-grid .c4 { grid-column: span 12; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 10px; } .stat-ico { width: 32px; height: 32px; } .stat-v { font-size: 16px; }
  .page-head h1 { font-size: 19px; }
  .filters input, .filters select { max-width: none; }
  .cal .d { min-height: 56px; font-size: 10px; } .cal .ev { font-size: 9px; }
}

/* ── Print ── */
@media print {
  .sidebar, .topbar, .no-print, .banner, .page-actions, .filters, .pager, .portal-top, .portal-nav { display: none !important; }
  .shell { display: block; } .content, .portal-main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}
