/* KFIA design system (2026-11-19): the look shared by the pages of the system. The school's navy and gold, the Inter
   type, line icons (icons.svg), one style for the menu, page headers, cards, tiles, tables, buttons and forms.
   On a phone or a tablet the menu slides in from the left (the ☰ button of the top bar, kfia-ui.js).
   A page uses it with <body class="kui">. Printed documents (report cards, PDFs) do not use it. */

:root {
  /* the school's colours */
  --navy: #0e1c36; --navy2: #162340; --navy-deep: #0a1529; --navy-line: rgba(255,255,255,.08);
  --gold: #f5c842; --gold-deep: #d9a514; --gold-ink: #7a5200; --gold-bg: #fff6d8;
  --blue: #1e6be6; --blue-deep: #1757c4; --sky: #3b9eff; --blue-bg: #eaf2ff;
  /* surfaces and text */
  --bg: #f3f5f9; --cream: #f3f5f9; --white: #ffffff; --surface: #ffffff; --soft: #f1f4f9; --tint: #f8fafc;
  --border: #e3e8f0; --border-2: #d2dae6; --grid: #e8edf5;
  --text: #13203b; --text-2: #3d4b68; --muted: #66748f; --faint: #9aa6bd;
  /* states: fill / ink on white / tint */
  --ok: #0ca30c; --ok-ink: #006300; --ok-bg: #e7f6e7;
  --warn: #fab219; --warn-ink: #8a5a00; --warn-bg: #fff4dc;
  --serious: #ec835a; --serious-ink: #9a3a12; --serious-bg: #fdece4;
  --bad: #d03b3b; --bad-ink: #b42318; --bad-bg: #fdeceb;
  --info: #1e6be6; --info-ink: #1e6be6; --info-bg: #e3eefd;
  --none: #eef1f6; --danger: #d03b3b; --success: #0ca30c;
  /* shape */
  --r: 14px; --r-sm: 10px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05);
  --sh-2: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --sh-pop: 0 18px 44px -12px rgba(10,21,41,.32);
  --ring: 0 0 0 3px rgba(30,107,230,.18);
  --side-w: 268px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-brand: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* ── BASE ─────────────────────────────────────────────────────── */
.kui, .kui *, .kui *::before, .kui *::after { box-sizing: border-box; }
body.kui { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.kui h1, .kui h2, .kui h3, .kui h4, .kui p { margin: 0; }
.kui a { color: var(--blue); }
.kui button { font-family: inherit; }
.kui .ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.kui :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.kui [hidden] { display: none !important; }   /* the hidden attribute wins over a display set by a class */
.kui ::selection { background: rgba(30,107,230,.18); }

/* ── THE MENU (sidebar; a drawer on a phone) ─────────────────── */
.kui #sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 300; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #17305c 0%, rgba(23,48,92,0) 60%), linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.kui #sidebar::-webkit-scrollbar { width: 6px; }
.kui #sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }
.kui .sidebar-logo { display: grid; grid-template-columns: 46px 1fr; column-gap: 12px; align-items: center; padding: 22px 20px 20px; border-bottom: 1px solid var(--navy-line); }
.kui .sidebar-logo img, .kui .sidebar-logo .school-badge-img { grid-row: span 2; width: 46px; height: 46px; margin: 0; border-radius: 13px; background: #fff; padding: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 6px 16px rgba(0,0,0,.28); object-fit: contain; }
.kui .sidebar-logo h2 { font: 600 14.5px/1.25 var(--font-brand); color: #fff; letter-spacing: .1px; }
.kui .sidebar-logo p { margin-top: 4px; font-size: 10.5px; line-height: 1.2; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--gold); }
.kui .nav-section { padding: 18px 24px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: rgba(255,255,255,.4); }
.kui .nav-item { position: relative; display: flex; align-items: center; gap: 12px; margin: 1px 12px; padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,.74); font-size: 13.5px; font-weight: 500; line-height: 1.3; text-decoration: none; cursor: pointer; user-select: none;
  transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.kui a > .nav-item { margin: 1px 12px; }
.kui .nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: none; box-shadow: none;
  border-radius: 0; color: rgba(255,255,255,.56); font-size: 15px; transition: color .15s; }
.kui .nav-item .icon svg { width: 19px; height: 19px; }
.kui .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.kui .nav-item:hover .icon { color: rgba(255,255,255,.85); }
.kui .nav-item.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.kui .nav-item.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.kui .nav-item.active .icon { color: var(--gold); background: none; box-shadow: none; }
.kui .nav-item .count, .kui .kfia-req-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--navy); }
.kui .sidebar-footer { position: sticky; bottom: 0; margin-top: auto; padding: 14px 14px 16px; border-top: 1px solid var(--navy-line); background: #0b1730;   /* stays in view when a long menu scrolls */
  box-shadow: 0 -10px 18px rgba(5,12,26,.35); }
.kui #welcomeCard { display: flex; align-items: center; gap: 11px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: rgba(255,255,255,.05); }
.kui .avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--sky)); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 0 0 2px rgba(245,200,66,.65); }
.kui .avatar-info { min-width: 0; }
.kui .avatar-info p { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kui .avatar-info span { display: block; font-size: 11.5px; color: rgba(255,255,255,.55); }
.kui .sidebar-footer .btn { width: 100%; height: 36px; background: transparent; color: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.14); box-shadow: none; }
.kui .sidebar-footer .btn:hover { background: rgba(208,59,59,.18); border-color: rgba(208,59,59,.5); color: #fff; }
.kui .kfia-lang { font-family: var(--font); }
.kui .kfia-lang-side { border-color: rgba(255,255,255,.14); border-radius: 9px; }

/* the top bar of a phone or a tablet: ☰, the logo, the page */
.kui-appbar { display: none; }
.kui-scrim { display: none; }

/* ── THE PAGE ─────────────────────────────────────────────────── */
.kui #main { margin-left: var(--side-w); padding: 30px 36px 64px; min-width: 0; max-width: 1560px; }
.kui .topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.kui .page-title { min-width: 0; }
.kui .page-title h1 { font: 700 26px/1.2 var(--font); letter-spacing: -.02em; color: var(--text); }
.kui .page-title p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.kui .topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.kui .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--r-sm);
  border: 1px solid transparent; font: 600 13.5px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.kui .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.kui .btn:focus-visible { outline: none; box-shadow: var(--ring); }
.kui .btn:disabled, .kui .btn[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.kui .btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.12), inset 0 -1px 0 rgba(0,0,0,.12); }
.kui .btn-primary:hover { background: var(--blue-deep); }
.kui .btn-navy { background: var(--navy); color: #fff; }
.kui .btn-navy:hover { background: var(--navy2); }
.kui .btn-gold { background: var(--gold); color: var(--navy); }
.kui .btn-gold:hover { background: var(--gold-deep); }
.kui .btn-outline { background: #fff; color: var(--text); border-color: var(--border-2); box-shadow: var(--sh-1); }
.kui .btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.kui .btn-ghost { background: transparent; color: var(--text-2); }
.kui .btn-ghost:hover { background: var(--soft); color: var(--text); }
.kui .btn-danger-soft { background: var(--bad-bg); color: var(--bad-ink); border-color: #f6cdc9; }
.kui .btn-danger-soft:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.kui .btn-danger { background: var(--bad-bg); color: var(--bad-ink); border-color: #f6cdc9; }   /* the same as danger-soft */
.kui .btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.kui .btn-success, .kui .btn-ok { background: #0b8a0b; color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.12), inset 0 -1px 0 rgba(0,0,0,.12); }
.kui .btn-success:hover, .kui .btn-ok:hover { background: var(--ok-ink); }
.kui .btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.kui .btn-sm svg { width: 14px; height: 14px; }
.kui .btn-full { width: 100%; }

/* ── FORMS ────────────────────────────────────────────────────── */
.kui select, .kui textarea,
.kui input:is([type=text], [type=date], [type=time], [type=number], [type=email], [type=password], [type=search], [type=tel], :not([type])) {
  height: 38px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: #fff; color: var(--text);
  font: 500 13.5px/1.2 var(--font); outline: none; transition: border-color .15s, box-shadow .15s; max-width: 100%; }
.kui textarea { height: auto; min-height: 76px; padding: 10px 12px; line-height: 1.5; }
.kui select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366748f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.kui :is(select, textarea, input):focus { border-color: var(--blue); box-shadow: var(--ring); }
.kui :is(select, textarea, input):disabled { background-color: var(--tint); color: var(--muted); cursor: default; }
.kui input[type=checkbox], .kui input[type=radio] { accent-color: var(--blue); width: 16px; height: 16px; }
.kui ::placeholder { color: var(--faint); }

/* a bar of filters at the top of a page part */
.kui .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 20px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.kui .filters label { display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }

/* ── CARDS ────────────────────────────────────────────────────── */
.kui .card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); margin-bottom: 20px; min-width: 0; }
.kui .card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.kui .card-header h3 { font: 600 15.5px/1.35 var(--font); letter-spacing: -.01em; color: var(--text); }
.kui .card-header .sub, .kui .card-header > small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kui .card-body { padding: 18px 20px; }
.kui .card > .table-wrap:last-child, .kui .card > .table-wrap:last-child table { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.kui .grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.kui .grid-2 > .card { margin-bottom: 0; }
.kui .grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ── TILES (key numbers) ──────────────────────────────────────── */
.kui .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kui .kpi { position: relative; min-width: 0; padding: 16px 18px 15px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
/* a tile: the label; the number with its icon; a note */
.kui .kpi .kpi-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.kui .kpi .kpi-main .val { margin-top: 0; min-width: 0; }
.kui .kpi .kpi-ic { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-bg); color: var(--blue); }
.kui .kpi .kpi-ic svg { width: 18px; height: 18px; }
.kui .kpi.t-gold .kpi-ic { background: var(--gold-bg); color: #a37400; }
.kui .kpi.t-green .kpi-ic { background: var(--ok-bg); color: var(--ok-ink); }
.kui .kpi.t-red .kpi-ic { background: var(--bad-bg); color: var(--bad-ink); }
.kui .kpi.t-navy .kpi-ic { background: #e8ebf3; color: var(--navy); }
.kui .kpi.t-orange .kpi-ic { background: var(--serious-bg); color: var(--serious-ink); }
.kui .kpi.t-amber .kpi-ic { background: var(--warn-bg); color: var(--warn-ink); }
.kui .kpi .lbl { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--muted); }
.kui .kpi .val { margin-top: 8px; font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.kui .kpi .val small { font-size: 15px; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.kui .kpi .note { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.kui .kpi .note b { color: var(--text); font-weight: 600; }
.kui .kpi .note.bad b { color: var(--bad-ink); }

/* ── TABLES ───────────────────────────────────────────────────── */
.kui .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;   /* a soft shadow at an edge when the table scrolls sideways */
  background: linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)) left center / 40px 100% no-repeat local,
              linear-gradient(270deg, #fff 30%, rgba(255,255,255,0)) right center / 40px 100% no-repeat local,
              radial-gradient(farthest-side at 0 50%, rgba(16,24,40,.13), rgba(16,24,40,0)) left center / 12px 100% no-repeat scroll,
              radial-gradient(farthest-side at 100% 50%, rgba(16,24,40,.13), rgba(16,24,40,0)) right center / 12px 100% no-repeat scroll; }
.kui table { width: 100%; border-collapse: collapse; }
.kui thead th { padding: 10px 16px; background: var(--tint); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .45px; text-transform: uppercase; color: var(--muted); }
.kui tbody td { padding: 12px 16px; border-bottom: 1px solid #edf1f6; font-size: 13.5px; vertical-align: middle; }
.kui tbody tr { border-bottom: 0; }
.kui tbody tr:last-child td { border-bottom: 0; }
.kui tbody tr:hover td { background: #f9fbfe; }
.kui td.num, .kui th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kui td small, .kui .muted { font-size: 12px; color: var(--muted); }

/* ── LABELS ───────────────────────────────────────────────────── */
.kui .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.kui .badge-blue { background: var(--blue-bg); color: var(--blue-deep); }
.kui .badge-gold { background: var(--gold-bg); color: var(--gold-ink); }
.kui .badge-green { background: var(--ok-bg); color: var(--ok-ink); }
.kui .badge-gray { background: var(--soft); color: var(--muted); }
.kui .badge-red { background: var(--bad-bg); color: var(--bad-ink); }
.kui .badge .ic { width: 12px; height: 12px; }
.kui small .ic { width: 13px; height: 13px; vertical-align: -2px; }
.kui .tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── PARTS OF A PAGE (segmented tabs) ─────────────────────────── */
.kui .subtabs { display: inline-flex; gap: 4px; max-width: 100%; margin-bottom: 18px; padding: 4px; background: #e8ecf3; border: 0; border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.kui .subtabs::-webkit-scrollbar { display: none; }
.kui .subtab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border: 0; border-radius: 9px; background: transparent;
  font: 600 13px/1.2 var(--font); color: var(--text-2); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.kui .subtab svg { width: 16px; height: 16px; color: var(--muted); }
.kui .subtab:hover { color: var(--text); }
.kui .subtab.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 1px 2px rgba(16,24,40,.06); }
.kui .subtab.on svg { color: var(--blue); }
.kui .subtab .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* ── EMPTY, TOAST, TOOLTIP, POP-UP ────────────────────────────── */
.kui .empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.kui .empty-state .es-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--tint); border: 1px solid var(--border); color: var(--faint); font-size: 22px; }
.kui .empty-state .es-icon svg { width: 22px; height: 22px; }
.kui .empty-state h3 { margin-bottom: 6px; font: 600 16px/1.35 var(--font); color: var(--text); }
.kui .empty-state p { font-size: 13.5px; line-height: 1.6; }
.kui #toast { position: fixed; top: 18px; left: 50%; z-index: 900; transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--sh-pop); transition: opacity .2s, transform .2s; }
.kui #toast.show { opacity: 1; transform: translate(-50%, 0); }
.kui #toast .t-ic { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.14); }
.kui #toast .t-ic .ic { width: 13px; height: 13px; }
.kui #toast .t-ic.ok { background: var(--ok); }
.kui #toast .t-ic.bad { background: var(--bad); }
.kui #tip { position: fixed; z-index: 800; pointer-events: none; opacity: 0; max-width: 280px; padding: 9px 12px; border-radius: 10px; background: var(--navy); color: #fff;
  font-size: 12.5px; line-height: 1.5; white-space: pre-line; box-shadow: var(--sh-pop); transition: opacity .12s; }
.kui #tip.show { opacity: 1; }
.kui #tip b { font-size: 13.5px; }
.kui #modal { display: none; position: fixed; inset: 0; z-index: 700; align-items: center; justify-content: center; padding: 20px;
  background: rgba(10,21,41,.55); backdrop-filter: blur(3px); }
.kui #modal.open { display: flex; }
.kui .modal-box { width: min(780px, 100%); max-height: 88vh; overflow: auto; background: #fff; border-radius: 18px; box-shadow: var(--sh-pop); }
.kui .modal-box .card-header { position: sticky; top: 0; z-index: 2; background: #fff; }

/* ── SHARED PIECES FROM OTHER FILES (academic years, the photo dialog) ── */
.kui .kfia-year select, .kui .kfia-year .kfia-year-pill { height: 38px; padding: 0 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background-color: #fff;
  color: var(--text); font: 600 13px/1 var(--font); box-shadow: var(--sh-1); display: inline-flex; align-items: center; gap: 8px; }
.kui .kfia-year select { padding-right: 36px; }
.kui .kfia-year .kfia-year-pill svg { width: 16px; height: 16px; color: var(--gold-deep); }
.kui .kfia-year button { height: 38px; padding: 0 14px; border-radius: var(--r-sm); background: var(--gold); color: var(--navy); font: 600 13px var(--font); }
.kui .kfia-year-banner { border-radius: 12px; font-family: var(--font); }
.kui .kp-box { font-family: var(--font); border-radius: 18px; }
.kui .kp-box h3 { font-family: var(--font); font-weight: 700; }
.kui .kp-btn { font-family: var(--font); }

/* ── A PHONE OR A TABLET: the top bar, the menu as a drawer ───── */
@media (max-width: 1023px) {
  .kui-appbar { position: sticky; top: 0; z-index: 250; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 12px 0 10px;
    background: var(--navy); color: #fff; box-shadow: 0 2px 12px rgba(10,21,41,.28); }
  .kui-menu-btn { width: 40px; height: 40px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px;
    background: rgba(255,255,255,.08); color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .kui-menu-btn:active { background: rgba(255,255,255,.16); }
  .kui-menu-btn svg { width: 22px; height: 22px; }
  .kui-appbar-logo { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: #fff; padding: 2px; object-fit: contain; }
  .kui-appbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .kui-appbar-title b { font: 600 14.5px var(--font-brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kui-appbar-title span { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kui #sidebar { width: min(86vw, 300px); transform: translateX(-104%); visibility: hidden; transition: transform .26s cubic-bezier(.2,.8,.2,1), visibility 0s linear .26s; }
  body.kui.kui-nav-open #sidebar { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 48px rgba(0,0,0,.4); }
  .kui-scrim { display: block; position: fixed; inset: 0; z-index: 280; background: rgba(10,21,41,.52); opacity: 0; pointer-events: none; transition: opacity .26s; }
  body.kui-nav-open .kui-scrim { opacity: 1; pointer-events: auto; }
  body.kui-nav-open { overflow: hidden; }
  .kui #main { margin-left: 0; padding: 20px 16px 48px; }
  .kui .topbar { margin-bottom: 18px; }
  .kui .page-title h1 { font-size: 22px; }
  .kui .page-title p { font-size: 13px; }
  .kui .grid-2, .kui .grid-2.even { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kui #main { padding: 16px 12px 40px; }
  .kui .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kui .kpi { padding: 13px 13px 12px; }
  .kui .kpi .kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
  .kui .kpi .kpi-ic svg { width: 16px; height: 16px; }
  .kui .kpi .lbl { font-size: 12px; }
  .kui .kpi .val { font-size: 23px; }
  .kui .kpi .note { font-size: 11.5px; }
  .kui .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last tile: the whole row */
  .kui .grid-2 { gap: 14px; margin-bottom: 14px; }
  .kui .card { border-radius: 14px; margin-bottom: 14px; }
  .kui .card-header { padding: 13px 14px; }
  .kui .card-body { padding: 14px; }
  .kui thead th { padding: 9px 12px; }
  .kui tbody td { padding: 11px 12px; font-size: 13px; }
  .kui .filters { padding: 12px; gap: 10px 14px; }
  .kui .filters label { flex-wrap: wrap; }
  .kui .filters label:has(> input:not([type=checkbox]):not([type=radio]), > select) { flex-direction: column; align-items: flex-start; gap: 5px; }   /* the name above its field */
  .kui .subtab { padding: 8px 11px; }
}

/* ── PRINTING: the page, without the menu ─────────────────────── */
@media print {
  .kui #sidebar, .kui-appbar, .kui-scrim, .kui #toast { display: none !important; }
  .kui #main { margin: 0; padding: 0; max-width: none; }
  body.kui { background: #fff; }
}
