/* =====================================================================
   Emfran — corporate, compact UI
   ===================================================================== */
:root {
  --brand: #1e3a5f;
  --brand-ink: #ffffff;
  --accent: #c8a24a;
  --side-bg: #0f1d30;
  --side-bg-2: #162a44;
  --side-ink: #a9b7cb;
  --side-ink-hi: #ffffff;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #1b2433;
  --ink-2: #4b5667;
  --muted: #7b8698;
  --line: #e2e6ec;
  --line-2: #eef1f5;
  --ok: #1f8a5b;
  --ok-bg: #e8f5ee;
  --warn: #a56a00;
  --warn-bg: #fdf3e1;
  --bad: #c0392b;
  --bad-bg: #fbeceb;
  --info: #2563a8;
  --info-bg: #e9f1fb;
  --radius: 6px;
  --side-w: 232px;
  --top-h: 48px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 17px; }
h2 { font-size: 14px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; }
small, .small { font-size: 11.5px; }
.muted { color: var(--muted); }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-sm { width: 14px; height: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid #0a1524; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 12px 14px; height: 60px; border-bottom: 1px solid rgba(255,255,255,.06); background: linear-gradient(180deg, var(--side-bg-2), var(--side-bg)); }
.side-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.side-brand .name { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-brand .sub { font-size: 10.5px; color: var(--side-ink); text-transform: uppercase; letter-spacing: .06em; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; scrollbar-width: thin; scrollbar-color: #2a3d58 transparent; }
.nav-group { margin-top: 10px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #61738d; padding: 4px 18px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 18px; color: var(--side-ink); font-size: 12.5px; border-left: 3px solid transparent; }
.nav-link:hover { background: rgba(255,255,255,.04); color: var(--side-ink-hi); text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.07); color: #fff; border-left-color: var(--accent); font-weight: 500; }
.nav-link .badge { margin-left: auto; }
.side-foot { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #61738d; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; }
.topbar .search { flex: 1; max-width: 380px; position: relative; }
.topbar .search input { width: 100%; padding-left: 30px; background: var(--bg); border-color: transparent; }
.topbar .search .i { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.term-chip { font-size: 11.5px; color: var(--ink-2); background: var(--line-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--ink); font: inherit; }
.usermenu > button:hover { background: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; object-fit: cover; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; border-radius: 8px; }
.usermenu .who { text-align: left; line-height: 1.15; }
.usermenu .who small { color: var(--muted); display: block; }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,40,.12); min-width: 190px; padding: 4px; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 10px; color: var(--ink); background: none; border: 0; font: inherit; border-radius: 4px; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); text-decoration: none; }

.content { padding: 16px 18px 40px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .titles p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); }

/* ---------- Cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.card-head h2 { flex: 1; }
.card-body { padding: 14px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.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)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack > * + * { margin-top: 14px; }

.stat { padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.stat .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.stat .ico.ok { background: var(--ok-bg); color: var(--ok); }
.stat .ico.warn { background: var(--warn-bg); color: var(--warn); }
.stat .ico.bad { background: var(--bad-bg); color: var(--bad); }
.stat .ico .i { width: 18px; height: 18px; }
.stat .v { font-size: 19px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 11.5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); background: #f8f9fb; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr:hover td { background: #fafbfc; }
table.t .num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .c { text-align: center; }
table.t tfoot td { font-weight: 600; background: #f8f9fb; border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.empty .i { width: 28px; height: 28px; display: block; margin: 0 auto 8px; color: #b5bfcc; }

.person { display: flex; align-items: center; gap: 8px; }
.person .avatar { width: 26px; height: 26px; }
.person b { font-weight: 500; }

/* ---------- Forms ---------- */
label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=color], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd6df; border-radius: 5px; padding: 6px 9px; height: 32px; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 70px; resize: vertical; }
input[type=color] { padding: 2px; width: 52px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(37,99,168,.15); }
input.err, select.err, textarea.err { border-color: var(--bad); }
.field { margin-bottom: 10px; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
.field .error { font-size: 11px; color: var(--bad); margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 12.5px; color: var(--ink); cursor: pointer; margin-bottom: 6px; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; min-width: 140px; }
.page-head .actions select, .page-head .actions input { width: auto; min-width: 150px; }
.marks-grid input.remark { width: 100%; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; font: 500 12.5px var(--font); border-radius: 5px; border: 1px solid #cfd6df; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: #f5f7fa; border-color: #b9c2ce; }
.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); border-color: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { color: var(--bad); border-color: #e7b9b4; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn-icon { width: 28px; padding: 0; justify-content: center; height: 28px; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Badges, alerts, tabs ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.sidebar .badge { background: var(--accent); color: #1b1b1b; }
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius); border: 1px solid; margin-bottom: 12px; font-size: 12.5px; }
.alert.success { background: var(--ok-bg); border-color: #bfe3cf; color: #165e3f; }
.alert.error { background: var(--bad-bg); border-color: #f0c6c1; color: #8c2a20; }
.alert.warning { background: var(--warn-bg); border-color: #f1d9a8; color: #7a4f00; }
.alert.info { background: var(--info-bg); border-color: #c5d9f1; color: #1d4c82; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.filters .field { margin: 0; min-width: 130px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pager .spacer { flex: 1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.1); }

/* ---------- Student picker ---------- */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgba(16,24,40,.14); z-index: 40; max-height: 320px; overflow-y: auto; min-width: 280px; }
.picker-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.picker-item:last-child { border-bottom: 0; }
.picker-item b { display: block; font-weight: 600; font-size: 12.5px; }
.picker-item small { color: var(--muted); font-size: 11px; }
.picker-item.active, .picker-item:hover { background: #eef5fd; }
.picker-bal { font-size: 11.5px; color: var(--ok); white-space: nowrap; font-variant-numeric: tabular-nums; }
.picker-bal.due { color: var(--bad); }
.picker-empty { padding: 10px 12px; color: var(--muted); font-size: 12px; }

/* ---------- Marks entry grid ---------- */
.marks-grid input.score { width: 66px; height: 28px; text-align: center; padding: 3px; font-variant-numeric: tabular-nums; }
.marks-grid input.remark { height: 28px; min-width: 220px; }
.marks-grid input.dirty { background: #fffbea; border-color: #e7c46b; }
.marks-grid input.saved { background: #effaf3; }
.marks-grid input.invalid { background: var(--bad-bg); border-color: var(--bad); }
.marks-grid input.gcell { width: 46px; height: 28px; text-align: center; padding: 2px; font-weight: 700; text-transform: uppercase; }
.marks-grid td.grade { font-weight: 600; color: var(--brand); width: 50px; text-align: center; }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.save-state { font-size: 12px; color: var(--muted); }

/* ---------- Auth pages (card layout) ---------- */
body.auth-page { background: #f2f6fb; font-family: "Poppins", "Segoe UI", system-ui, sans-serif; }
.auth-shell { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 820px; display: grid; grid-template-columns: 1fr 1.05fr; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #2b80c4 0%, #1f64a3 55%, #1b4f86 100%); box-shadow: 0 18px 44px rgba(17, 54, 98, .16); }
.auth-left { position: relative; color: #fff; padding: 30px 28px; display: flex; align-items: center; overflow: hidden; }
.auth-left-inner { position: relative; z-index: 2; width: 100%; text-align: center; }
.auth-left h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; color: #fff; }
.auth-left .auth-lead { font-size: 13px; line-height: 1.6; color: #eaf3ff; max-width: 330px; margin: 0 auto 18px; }
.auth-left h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: #fff; }
.auth-contact { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; text-align: left; max-width: 340px; }
.auth-contact li { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; color: #f2f8ff; white-space: nowrap; }
.auth-contact li.wide { flex-basis: 100%; justify-content: center; white-space: normal; }
.auth-contact .i { width: 14px; height: 14px; margin-top: 2px; flex: none; opacity: .9; }
.auth-points { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 8px; text-align: left; max-width: 300px; font-size: 12.5px; color: #eef6ff; }
.auth-points .i { color: #ffd166; margin-right: 6px; }
.auth-left .bubble { position: absolute; border-radius: 16px; background: rgba(255,255,255,.08); z-index: 1; }
.auth-left .b1 { width: 80px; height: 46px; top: 50px; left: -16px; }
.auth-left .b2 { width: 110px; height: 60px; bottom: 60px; right: -24px; }
.auth-left .b3 { width: 60px; height: 36px; top: 46%; left: 38%; background: rgba(255,255,255,.05); }
.auth-right { background: #fff; border-radius: 20px 20px 20px 72px; display: flex; align-items: center; justify-content: center; padding: 28px 38px; }
.auth-box { width: 100%; max-width: 330px; }
.auth-logo { display: block; width: 132px; height: auto; margin: 0 auto 10px; }
.auth-title { font-size: 16px; font-weight: 700; color: #1b2c47; margin-bottom: 6px; text-align: center; }
.auth-box > p, .auth-box form > p { font-size: 12.5px; }
.auth-form label { font-size: 13px; font-weight: 500; color: #1d2433; margin-bottom: 5px; }
.auth-form .field { margin-bottom: 12px; }
.auth-form input { height: 38px !important; border-radius: 7px !important; font-size: 13.5px !important; padding: 7px 12px !important; border-color: #cfd8e3 !important; }
.auth-form input:focus { background: #edf3fd; border-color: #2b80c4 !important; box-shadow: 0 0 0 3px rgba(43,128,196,.15) !important; }
.auth-row { display: flex; justify-content: flex-end; margin: -4px 0 14px; font-size: 12.5px; }
.auth-row a, .auth-note a { color: #1e78d0; font-weight: 500; }
.btn-auth { width: 100%; height: 38px; justify-content: center; border: 0; border-radius: 7px; font-size: 14px; font-weight: 500; color: #fff; background: linear-gradient(180deg, #2a81c6, #1d5c9a); box-shadow: 0 6px 14px rgba(29, 92, 154, .24); }
.btn-auth:hover { background: linear-gradient(180deg, #2374b5, #184f86); color: #fff; }
.auth-note { text-align: center; font-size: 12.5px; color: #5a6475; margin-top: 14px; }
.auth-foot { margin-top: 10px; color: #8a96a8; font-size: 11.5px; }
.auth-box .alert { border-radius: 8px; }

/* ---------- Error page ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-size: 56px; font-weight: 700; color: var(--brand); letter-spacing: -.04em; }

/* ---------- Toasts (X / Twitter style) ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 1000; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #1d9bf0; color: #fff; padding: 12px 18px; border-radius: 6px; font: 500 14px/1.35 var(--font); box-shadow: 0 0 15px rgba(101,119,134,.2), 0 0 3px 1px rgba(101,119,134,.15); max-width: 560px; animation: toast-in .28s cubic-bezier(.2,.9,.3,1.2); }
.toast .i { width: 18px; height: 18px; flex: none; }
.toast.ok { background: #1d9bf0; }
.toast.bad { background: #f4212e; }
.toast.warn { background: #0f1419; }
.toast.info { background: #0f1419; }
.toast .toast-x { margin-left: 6px; background: none; border: 0; color: inherit; opacity: .8; cursor: pointer; padding: 0; line-height: 0; }
.toast.leaving { animation: toast-out .22s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }

/* ---------- Platform console tint ---------- */
body.platform { --side-bg: #13151b; --side-bg-2: #1c1f27; --accent: #6aa5ff; --brand: #2b5fb4; }

/* ---------- Collapsed sidebar ---------- */
body.side-collapsed { --side-w: 60px; }
body.side-collapsed .side-brand .txt, body.side-collapsed .nav-label, body.side-collapsed .nav-link span, body.side-collapsed .side-foot, body.side-collapsed .nav-link .badge { display: none; }
body.side-collapsed .nav-link { justify-content: center; padding: 9px 0; }
body.side-collapsed .side-brand { justify-content: center; padding: 12px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; transform: translateX(-100%); transition: transform .18s ease; }
  body.side-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.side-collapsed { --side-w: 232px; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .who, .term-chip { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; max-width: 400px; border-radius: 18px; }
  .auth-left { display: none; }
  .auth-right { border-radius: 18px; padding: 26px 20px; }
  .content { padding: 12px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .topbar .search { display: none; }
}
@media print {
  .sidebar, .topbar, .page-head .actions, .filters, .pager, .no-print { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.t tr.group-row td { background: var(--surface-2, #f5f7fa); font-size: 12px; padding-top: 6px; padding-bottom: 6px; }
