:root {
  --gold: #c59a45;
  --gold-lt: #f1cc80;
  --gold-dk: #8a611c;
  --ink: #152d3c;
  --ink-s: #3d5360;
  --ink-m: #70818b;
  --paper: #f4f7f7;
  --raised: #ffffff;
  --sunken: #f4f7f8;
  --bd: #dce5e8;
  --bd-s: #b9c9cf;
  --grn: #116746;
  --grn-bg: #e5f5ec;
  --red: #a83740;
  --red-bg: #fff0f0;
  --amb: #8d5d10;
  --amb-bg: #fff5dd;
  --blu: #235777;
  --blu-bg: #eaf3f8;
  --primary: #126d69;
  --primary-hover: #0c5653;
  --navy: #102d3d;
  --shad: 0 5px 24px rgba(16, 45, 61, .055);
  --r: 14px;
  box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 "Aptos", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* Sign in */
.auth-loading { display: grid; place-items: center; min-height: 100vh; padding: 24px; color: #fff; background: radial-gradient(circle at 10% 10%, #24526a, transparent 35%), #0b2535; }
.auth-loading-card { display: flex; flex-direction: column; align-items: center; width: min(340px, 100%); text-align: center; }
.auth-loading-card .brand-logo { height: 64px; margin-bottom: 22px; }
.auth-loading-title { font-size: 19px; font-weight: 760; letter-spacing: -.025em; }
.auth-loading-sub { margin-top: 8px; color: #bfd3d8; font-size: 12px; }
.auth-loading-track { width: 100%; height: 3px; margin-top: 27px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.13); }
.auth-loading-track span { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--gold-lt); animation: loading-sweep 1.2s ease-in-out infinite alternate; }
@keyframes loading-sweep { from { transform: translateX(0); } to { transform: translateX(165%); } }
.login-wrap {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 56px);
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 6% 8%, #24526a 0, transparent 32%),
    radial-gradient(circle at 95% 95%, #174443 0, transparent 30%), #0b2535;
}
.login-shell {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  width: min(1100px, 100%);
  min-height: 610px;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(4, 20, 28, .35);
}
.login-aside {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 38px 48px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #164a5a, #0b3441 62%, #0b4b48);
}
.login-aside::before, .login-aside::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 50%;
  z-index: -1;
}
.login-aside::before { width: 560px; height: 560px; right: -320px; top: -250px; }
.login-aside::after { width: 460px; height: 460px; left: -300px; bottom: -265px; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.login-brand .brand-logo { height: 58px; }
.brand-logo { display: block; height: 42px; width: auto; max-width: 100%; object-fit: contain; flex: none; background: none; }
.login-aside-content { margin: auto 0; max-width: 440px; padding: 65px 0 40px; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-aside .eyebrow { color: var(--gold-lt); }
.login-aside h1 { margin: 18px 0; font-size: clamp(36px, 4vw, 54px); line-height: 1.08; letter-spacing: -.045em; font-weight: 740; }
.login-aside p { max-width: 385px; color: #c5d8da; font-size: 15px; line-height: 1.7; }
.login-points { display: grid; gap: 13px; margin-top: 40px; color: #e3eeee; font-size: 13px; font-weight: 600; }
.login-points span { display: flex; align-items: center; gap: 11px; }
.login-points i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-lt); box-shadow: 0 0 0 5px rgba(241,204,128,.12); }
.login-aside-footer { color: #9dbcbf; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 72px); background: #fff; }
.login-logo { color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.login-title { margin-top: 12px; font-size: 34px; line-height: 1.15; letter-spacing: -.04em; font-weight: 760; }
.login-sub { margin: 10px 0 34px; color: var(--ink-m); font-size: 14px; }
.login-err { display: none; margin-bottom: 20px; padding: 12px 14px; color: var(--red); background: var(--red-bg); border: 1px solid #f3c8cb; border-left: 4px solid var(--red); border-radius: 9px; font-size: 13px; }
.login-fg { margin-bottom: 19px; }
.login-fg label, label { display: block; margin-bottom: 7px; color: var(--ink-s); font-size: 11px; font-weight: 750; letter-spacing: .035em; }
.login-fg input, input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--bd-s);
  border-radius: 9px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: #9aabb2; }
input:hover, select:hover, textarea:hover { border-color: #90abb5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,109,105,.14); }
input[type="checkbox"], input[type="radio"] { flex: none; width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer; }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
.login-btn { width: 100%; min-height: 46px; margin-top: 9px; color: #fff; background: var(--primary); border: 0; border-radius: 9px; font-weight: 750; box-shadow: 0 8px 18px rgba(18,109,105,.17); }
.login-btn:hover { background: var(--primary-hover); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-setup { margin-top: 25px; color: var(--ink-m); text-align: center; font-size: 12px; }

/* Header and navigation */
.app { display: none; }
.hdr { position: sticky; top: 0; z-index: 100; color: #fff; background: #102c3a; border-bottom: 1px solid rgba(255,255,255,.08); }
.hdr-inner { max-width: 1600px; min-height: 68px; margin: 0 auto; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hdr-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.hdr-period { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.hdr-period span { color: #9eb8c1; font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.hdr-period strong { color: #f3f7f8; font-size: 13px; font-weight: 760; letter-spacing: .02em; }
.hdr-user { display: flex; align-items: center; gap: 10px; color: #a8bec6; font-size: 12px; white-space: nowrap; }
.hdr-user strong { color: #fff; font-size: 13px; }
.hdr-logout { min-height: 34px; margin-left: 9px; padding: 6px 13px; color: #dce8eb; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; font-size: 12px; font-weight: 650; }
.hdr-logout:hover { background: rgba(255,255,255,.15); }
.quick-toolbar { color: var(--ink); background: #f7fbfa; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid var(--bd); box-shadow: 0 4px 12px rgba(16,45,61,.035); }
.quick-toolbar-inner { display: flex; align-items: center; gap: 14px; max-width: 1600px; margin: 0 auto; padding: 8px 28px; }
.quick-search { display: flex; align-items: center; flex: 0 1 300px; min-width: 195px; height: 38px; padding-left: 11px; border: 1px solid var(--bd-s); border-radius: 9px; background: #fff; }
.quick-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,109,105,.12); }
.quick-search > span { color: var(--primary); font-size: 21px; line-height: 1; }
.quick-search input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0 8px; border: 0; background: transparent; font-size: 12px; box-shadow: none; }
.quick-search input:focus { border: 0; outline: 0; box-shadow: none; }
.quick-search button { align-self: stretch; padding: 0 12px; border: 0; border-radius: 0 8px 8px 0; background: #e6f3ef; color: var(--primary); font-size: 11px; font-weight: 800; }
.quick-search button:hover { background: #d5ebe4; }
.quick-actions { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.quick-action { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 37px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-s); font-size: 11px; font-weight: 750; white-space: nowrap; }
.quick-action > span:first-child { color: var(--primary); font-size: 16px; line-height: 1; }
.quick-action:hover, .quick-action.active { border-color: #c9e2dc; background: #e8f4f1; color: var(--primary-hover); }
.quick-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: #e4ebee; color: var(--ink-s); font-size: 10px; }
.quick-assistant { border-color: #d6e3e0; background: #fff; color: var(--primary); }
.nav { position: sticky; top: 78px; z-index: 99; background: #fff; border-bottom: 1px solid var(--bd); box-shadow: 0 4px 12px rgba(16,45,61,.025); }
.nav-inner { display: flex; gap: 6px; max-width: 1600px; margin: 0 auto; padding: 9px 34px; overflow-x: auto; scrollbar-width: thin; }
.ntab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 39px; padding: 8px 15px; border: 0; border-radius: 8px; background: transparent; color: #647783; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ntab .nav-icon { font-size: 17px; line-height: 1; font-weight: 500; }
.ntab:hover { color: var(--ink); background: #f3f7f8; }
.ntab.active { color: var(--primary-hover); background: #e8f4f1; box-shadow: inset 0 0 0 1px #c9e2dc; }
.ntab:focus-visible, button:focus-visible, .chip:focus-visible { outline: 3px solid rgba(18,109,105,.38); outline-offset: 2px; }

/* Workspace and overview */
.main { width: min(1600px, 100%); margin: 0 auto; padding: 26px 28px 60px; }
.workspace-heading { margin-bottom: 22px; }
.workspace-heading h1 { margin: 0 0 4px; font-size: clamp(25px, 2.7vw, 34px); line-height: 1.15; letter-spacing: -.04em; font-weight: 780; }
.workspace-heading p { color: var(--ink-m); font-size: 13px; }
.vbars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.vbars.overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vbar { position: relative; min-width: 0; padding: 20px 22px 18px; background: #fff; border: 1px solid var(--bd); border-radius: 13px; box-shadow: var(--shad); overflow: hidden; }
.vbar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #d6e4e8; }
.overview .vbar:nth-child(1)::before { background: var(--gold); }
.overview .vbar:nth-child(2)::before { background: var(--primary); }
.overview .vbar:nth-child(3)::before { background: #62a986; }
.overview .vbar:nth-child(4)::before { background: #a4b8c1; }
.overview .vbar.has-conflicts::before { background: var(--red); }
.vbar-lbl { color: var(--ink-m); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .095em; }
.vbar-val { margin-top: 10px; font-size: clamp(18px, 1.7vw, 25px); line-height: 1.15; font-weight: 780; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbar-val.gold { color: var(--ink); }
.vbar-val.green { color: var(--primary); }
#h-conf { color: var(--primary); }
.has-conflicts #h-conf { color: var(--red); }
.vbar-sub { margin-top: 8px; color: var(--ink-m); font-size: 11px; }
.prog-wrap, .pbwrap { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 20px; background: #e7eeef; }
.prog, .pb { height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }

/* Panels, forms and actions */
.card { min-width: 0; margin-bottom: 20px; background: var(--raised); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--shad); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 63px; padding: 17px 22px; border-bottom: 1px solid var(--bd); background: #fff; }
.card-title { color: var(--ink); font-size: 15px; line-height: 1.3; font-weight: 780; letter-spacing: -.015em; }
.card-sub { margin-left: auto; color: var(--ink-m); font-size: 11.5px; }
.card-body { padding: 22px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 22px; }
.builder { position: sticky; top: 152px; }
.builder .card { border-color: #bfd5d6; box-shadow: 0 15px 40px rgba(14,75,77,.10); }
.builder .card-head { padding: 18px 22px; background: linear-gradient(115deg, #123d4a, #145d60); border: 0; }
.builder .card-title { max-width: 290px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 18px; }
.builder-kicker { margin-bottom: 4px; color: var(--gold-lt); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.builder .card-body { padding: 22px; }
.pbwrap { height: 11px; margin: 10px 0 8px; }
.pb { background: var(--gold); }
.pb.close { background: #169263; }
.pb.over { background: var(--red); }
.form-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 17px; }
.form-row:last-child { margin-bottom: 0; }
.fg { display: flex; flex: 1; min-width: 150px; flex-direction: column; }
.fg.wide { flex: 1.8; }
.fg.narrow { flex: 0 0 116px; min-width: 116px; }
.fg label { margin-bottom: 7px; }
select[multiple] { padding: 5px; background: #fbfcfc; }
select[multiple] option { padding: 7px 8px; border-radius: 5px; }
select[multiple] option:checked { background: #d9ece9 linear-gradient(#d9ece9, #d9ece9); color: var(--ink); }
.filter-source { display: none !important; }
.allocation-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.allocation-filter-field { min-width: 0; }
.filter-field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.filter-field-heading label { margin: 0; color: var(--ink); font-size: 12px; }
.filter-field-heading > span { min-width: 0; overflow: hidden; color: var(--primary); font-size: 10.5px; font-weight: 750; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.allocation-filter-box { overflow: hidden; border: 1px solid var(--bd-s); border-radius: 10px; background: #fff; }
.filter-search { position: relative; padding: 9px; border-bottom: 1px solid var(--bd); background: #f9fbfb; }
.filter-search > span { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #708892; font-size: 20px; line-height: 1; pointer-events: none; }
.filter-search input { min-height: 36px; padding: 7px 10px 7px 32px; border-color: #d2dee1; background: #fff; font-size: 11.5px; }
.filter-option-list { max-height: 214px; overflow-y: auto; padding: 5px; scrollbar-color: #bdcccf transparent; }
.filter-option { display: flex; align-items: center; gap: 10px; min-height: 35px; margin: 0; padding: 7px 9px; border-radius: 6px; color: var(--ink-s); cursor: pointer; font-size: 11.5px; font-weight: 600; letter-spacing: 0; }
.filter-option:hover { background: #f3f8f7; }
.filter-option.selected { color: var(--primary-hover); background: #e8f5f1; font-weight: 800; }
.filter-option[hidden] { display: none; }
.filter-option:first-child { position: sticky; top: -5px; z-index: 1; margin-bottom: 4px; border-bottom: 1px solid var(--bd); border-radius: 6px 6px 0 0; background: #f8fbfa; }
.filter-option:first-child.selected { background: #e8f5f1; }
.filter-option input[type="checkbox"] { width: 15px; height: 15px; min-height: 15px; flex: none; }
.filter-option span { min-width: 0; overflow-wrap: anywhere; }
.allocation-filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--bd); }
.allocation-filter-footer > span { color: var(--ink-m); font-size: 11px; }
.allocation-filter-footer .btn { min-height: 40px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12.5px; font-weight: 750; line-height: 1.25; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.bp { color: #fff; background: var(--primary); box-shadow: 0 4px 10px rgba(18,109,105,.12); }
.bp:hover:not(:disabled) { background: var(--primary-hover); }
.bs { color: var(--ink-s); background: #fff; border-color: var(--bd-s); }
.bs:hover:not(:disabled) { background: #f4f8f8; border-color: #8faeb3; }
.bsuc { color: #fff; background: #167653; }
.bsuc:hover:not(:disabled) { background: #0d6242; }
.bd2 { color: var(--red); background: #fff7f7; border-color: #efc8ca; }
.bd2:hover:not(:disabled) { background: var(--red-bg); }
.bsm { min-height: 32px; padding: 5px 11px; font-size: 11.5px; }
#save-btn { min-height: 41px; }
.search-action { display: flex; align-items: flex-end; }
.search-action .btn { min-height: 42px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 11px; border: 1px solid var(--bd-s); border-radius: 7px; color: var(--ink-s); background: #fff; font-size: 11px; font-weight: 700; user-select: none; cursor: pointer; }
.chip:hover:not(.active) { border-color: var(--primary); background: #f2f8f7; }
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.filter-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row input, .filter-row select { min-height: 37px; padding: 7px 10px; font-size: 12px; }
.status-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.legend-note { margin-left: 4px; color: var(--ink-m); font-size: 11px; }

/* Tables, badges, alerts and selection */
.tbl-w { overflow-x: auto; scrollbar-color: #bbcbcf transparent; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 11px; color: #647883; background: #f6f9f9; border-bottom: 1px solid var(--bd); text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--primary); }
td { padding: 11px; border-bottom: 1px solid #eaf0f1; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7fbfa; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; font-size: 10px; line-height: 1.15; font-weight: 800; white-space: nowrap; }
.bg { color: var(--grn); background: var(--grn-bg); }
.br { color: var(--red); background: var(--red-bg); }
.ba { color: var(--amb); background: var(--amb-bg); }
.bb { color: var(--blu); background: var(--blu-bg); }
.bk { color: #60717b; background: #edf2f4; }
.conf td { background: #fff1f1 !important; }
.conf td:first-child { box-shadow: inset 4px 0 var(--red); }
.selrow { cursor: pointer; }
body.row-drag-select, body.row-drag-select * { user-select: none; }
body.row-drag-select .selrow, body.row-drag-select #reg-body tr { cursor: grabbing; }
.selrow.sel td { background: #eaf7f4 !important; }
.selrow.sel td:first-child { box-shadow: inset 4px 0 var(--primary); }
.results-card-head { border-bottom: 0; }
.results-count { margin-left: auto; padding: 6px 10px; border-radius: 7px; color: var(--primary); background: #eaf5f2; font-size: 11px; font-weight: 800; white-space: nowrap; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 59px; padding: 12px 20px; border-bottom: 1px solid var(--bd); background: #f5faf8; }
.results-toolbar strong { display: block; color: var(--ink); font-size: 11.5px; }
.results-toolbar span { display: block; margin-top: 1px; color: var(--ink-m); font-size: 10.5px; }
.results-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.results-table-wrap { width: 100%; }
.results-table { width: 100%; table-layout: fixed; }
.results-table th, .results-table td { padding: 12px 11px; overflow-wrap: anywhere; }
.results-table th { white-space: normal; }
.results-table .result-check-col { width: 6%; text-align: center; }
.results-table .result-school-col { width: 34%; }
.results-table .result-region-col { width: 15%; }
.results-table .result-item-col { width: 25%; }
.results-table .result-value-col { width: 20%; }
.results-table .result-region-col .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.results-table .sort-mark { color: #9bb0b6; font-size: 11px; }
.result-school-name { display: block; color: var(--ink); font-size: 11.5px; line-height: 1.4; }
.result-school-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.result-school-meta code { color: var(--gold-dk); font-size: 10.5px; font-weight: 700; }
.result-mobile-region { display: none; color: var(--ink-m); font-size: 10px; }
.result-item-col strong { display: block; color: var(--ink); font-size: 11.5px; }
.result-item-meta { display: block; margin-top: 5px; color: var(--ink-m); font-size: 10.5px; line-height: 1.4; }
.result-value-col strong { color: var(--ink); font-size: 12px; font-weight: 800; }
.sel-list { display: flex; flex-direction: column; gap: 7px; min-height: 38px; max-height: 38vh; overflow-y: auto; }
.sel-item { display: flex; align-items: center; gap: 6px; padding: 9px; border: 1px solid #d0e7e3; border-radius: 8px; background: #f0f8f6; font-size: 11px; }
.sel-more { padding: 9px; color: var(--ink-m); font-size: 10.5px; text-align: center; }
.si-id { flex: none; color: var(--primary); font-size: 10px; font-weight: 800; }
.si-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.si-it { flex: none; color: var(--blu); font-size: 10px; }
.si-v { flex: none; color: var(--ink-s); font-size: 10px; font-variant-numeric: tabular-nums; }
.si-rm { margin-left: auto; padding: 1px 3px; border: 0; background: transparent; color: var(--red); font-size: 18px; line-height: 1; cursor: pointer; }
.alert { margin-bottom: 12px; padding: 12px 14px; border: 1px solid transparent; border-left-width: 4px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.ae { color: var(--red); background: var(--red-bg); border-color: #f2d0d2; border-left-color: var(--red); }
.aw { color: var(--amb); background: var(--amb-bg); border-color: #f3dda7; border-left-color: #d29b2d; }
.ai { color: var(--blu); background: var(--blu-bg); border-color: #c9e0ed; border-left-color: #4587ad; }
.as { color: var(--grn); background: var(--grn-bg); border-color: #c3e4cf; border-left-color: #269365; }
.empty { padding: 28px 16px; color: var(--ink-m); text-align: center; font-size: 12px; }
.page { display: none; animation: page-in .18s ease-out; }
.page.active { display: block; }
@keyframes page-in { from { opacity: .65; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Supplier summary */
.summary-overview { margin-bottom: 20px; }
.summary-heading .results-count { margin-left: auto; }
.summary-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 17px 20px; border-bottom: 1px solid var(--bd); background: #fbfdfc; }
.summary-toolbar label { display: grid; gap: 6px; margin: 0; color: var(--ink-s); }
.summary-search { flex: 1 1 230px; max-width: 380px; }
.summary-sort { flex: 0 1 180px; }
.summary-toolbar input, .summary-toolbar select { min-height: 39px; }
.summary-export-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.allocation-report-actions { margin: 0 20px 18px; padding: 16px; border: 1px solid var(--bd); border-radius: 12px; background: #f0f8f6; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.allocation-report-actions strong { display: block; font-size: 14px; }
.allocation-report-actions span { display: block; color: var(--ink-m); font-size: 12px; margin-top: 4px; }
.allocation-report-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-google-setup { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.report-google-setup label { flex: 1 1 260px; min-width: 0; display: grid; gap: 8px; }
.report-google-setup input { width: 100%; }
.summary-list { padding: 5px 20px 14px; }
.summary-list > .empty { padding: 44px 18px; }
.summary-supplier { border-bottom: 1px solid var(--bd); }
.summary-supplier:last-child { border-bottom: 0; }
.summary-supplier-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; min-height: 83px; padding: 16px 2px; }
.summary-expand { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 2px; border: 0; color: var(--ink); background: transparent; text-align: left; }
.summary-expand > span:last-child { min-width: 0; }
.summary-expand strong { display: block; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.summary-expand small { display: block; margin-top: 3px; color: var(--ink-m); font-size: 11px; font-weight: 550; }
.summary-chevron { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 7px; color: var(--primary); background: #e8f5f1; font-size: 18px; font-weight: 600; }
.summary-expand:hover strong { color: var(--primary); }
.summary-supplier-values { display: flex; gap: 23px; }
.summary-supplier-values span { display: block; color: var(--ink-m); font-size: 10px; white-space: nowrap; }
.summary-supplier-values strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary-supplier-values span:first-child strong { color: var(--primary); }
.summary-supplier-actions { display: flex; grid-column: 1 / -1; gap: 8px; flex-wrap: wrap; padding-left: 42px; }
.summary-detail { padding: 0 0 18px 42px; }
.summary-detail[hidden] { display: none; }
.summary-detail-table { border: 1px solid var(--bd); border-radius: 9px; }
.summary-detail-table table { min-width: 640px; }
.summary-detail-table th { background: #f3f8f7; }
.summary-detail-table th, .summary-detail-table td { padding: 10px 13px; }
.summary-total-row td { color: var(--ink); background: #edf5f3; font-weight: 800; }
.summary-pagination { padding: 13px 20px 18px; }

/* Import and feedback */
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 190px; padding: 28px; border: 2px dashed #a8c9c7; border-radius: 12px; background: #f5faf9; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.drop-zone:hover { border-color: var(--primary); background: #edf8f5; transform: translateY(-1px); }
.drop-zone.drag-over { border-color: var(--primary); background: #e4f5ef; }
.drop-zone:focus-visible { outline: 3px solid rgba(18,109,105,.38); outline-offset: 3px; }
.drop-zone > div:first-child { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 13px !important; border-radius: 17px; background: #e3f2ed; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 9999; display: none; max-width: 380px; padding: 13px 18px; color: #fff; background: #123947; border-left: 4px solid var(--gold); border-radius: 9px; box-shadow: 0 14px 35px rgba(4,25,32,.23); font-size: 12px; font-weight: 700; }
.toast.show { display: block; animation: page-in .2s ease-out; }
.modal-ov { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(9,27,36,.62); backdrop-filter: blur(3px); }
.modal-ov.open { display: flex; }
.modal { width: min(460px, 100%); padding: 26px; border: 1px solid var(--bd); border-radius: 15px; background: #fff; box-shadow: 0 28px 75px rgba(3,23,32,.28); }
.modal-title { margin-bottom: 17px; font-size: 20px; font-weight: 780; letter-spacing: -.025em; }
.modal-info { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--bd); border-radius: 9px; color: var(--ink-s); background: var(--sunken); font-size: 11px; line-height: 1.7; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1200px) {
  .vbars.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1100px) {
  .quick-toolbar-inner { align-items: stretch; flex-direction: column; gap: 6px; }
  .quick-search { flex: none; width: 100%; }
  .quick-actions { justify-content: flex-start; width: 100%; }
}
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
  .builder { position: static; }
  .builder .card { max-width: none; }
  .card-sub { margin-left: 0; }
  .login-shell { grid-template-columns: 1fr 1fr; }
  .login-aside { padding: 28px; }
}
@media (max-width: 720px) {
  .hdr-inner { min-height: 68px; padding: 10px 18px; }
  .quick-toolbar-inner { align-items: stretch; flex-direction: column; gap: 6px; padding: 8px 18px; }
  .quick-search { flex: none; width: 100%; min-width: 0; }
  .quick-actions { justify-content: flex-start; width: 100%; }
  .hdr-period span { display: none; }
  .hdr-user > span { display: none; }
  .hdr-user strong { max-width: 95px; overflow: hidden; text-overflow: ellipsis; }
  .hdr-logout { margin-left: 0; }
  .nav { top: 68px; }
  .nav-inner { padding: 8px 18px; }
  .main { padding: 23px 18px 46px; }
  .vbars { grid-template-columns: 1fr; }
  .vbars.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-head, .card-body { padding: 16px; }
  .login-wrap { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .login-aside { min-height: 230px; padding: 22px 26px; }
  .login-aside-content { padding: 30px 0 12px; }
  .login-aside h1 { margin: 10px 0; font-size: 29px; }
  .login-aside p, .login-points, .login-aside-footer { display: none; }
  .login-card { padding: 35px 26px 55px; }
}
@media (max-width: 520px) {
  .hdr-brand { gap: 8px; }
  .hdr-period strong { font-size: 11px; }
  .hdr-user { gap: 5px; }
  .hdr-user strong { max-width: 70px; font-size: 11px; }
  .hdr-logout { padding: 5px 8px; font-size: 11px; }
  .workspace-heading h1 { font-size: 26px; }
  .vbars.overview { gap: 10px; }
  .overview .vbar { padding: 15px 13px; }
  .vbar-val { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
  .vbar-sub { font-size: 10px; }
  .form-row { gap: 12px; }
  .fg, .fg.wide, .fg.narrow { flex: 1 1 100%; max-width: none; }
  .search-action, .search-action .btn { width: 100%; }
  .filter-row input, .filter-row select { width: 100% !important; }
  .filter-row .chip { width: 100%; }
  .status-legend { gap: 5px; }
  .legend-note { width: 100%; margin: 4px 0 0; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Dashboard shell */
:root { --sidebar-width: 258px; }
.app { min-height: 100vh; }
.app-content { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .2s ease; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 120;
  display: flex; flex-direction: column; width: var(--sidebar-width);
  color: #d9e7e9; background: linear-gradient(180deg, #102f40 0%, #0c2937 75%, #0a2431 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 8px 0 26px rgba(11,36,49,.08);
  transition: width .2s ease;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 70px; padding: 14px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sidebar-brand .brand-logo { height: 23px; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand strong { display: block; color: #fff; font-size: 12.5px; font-weight: 760; white-space: nowrap; }
.sidebar-brand small { display: block; margin-top: 1px; color: #99b5bb; font-size: 9px; font-weight: 650; white-space: nowrap; }
.sidebar-collapse { display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; color: #dce8e9; background: rgba(255,255,255,.07); font-size: 22px; line-height: 1; }
.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,.16); }
.sidebar-close { display: none; width: 32px; height: 32px; border: 0; border-radius: 8px; color: #dce8e9; background: rgba(255,255,255,.10); font-size: 22px; line-height: 1; }
.sidebar .nav { position: static; display: flex; flex-direction: column; flex: 1; gap: 3px; padding: 16px 11px; overflow-y: auto; color: inherit; background: transparent; border: 0; box-shadow: none; }
.sidebar .nav-group-label { margin: 13px 12px 5px; color: #809faa; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.sidebar .nav-group-label:first-child { margin-top: 2px; }
.sidebar .ntab { justify-content: flex-start; width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 9px; color: #c0d3d8; background: transparent; font-size: 12.5px; font-weight: 690; text-align: left; }
.sidebar .ntab .nav-icon { display: inline-grid; place-items: center; width: 22px; flex: none; color: #8dafb6; font-size: 17px; }
.sidebar .ntab .nav-label { display: inline; }
.sidebar .ntab:hover { color: #fff; background: rgba(255,255,255,.09); }
.sidebar .ntab.active { color: #fff; background: rgba(34,138,128,.26); box-shadow: inset 3px 0 var(--gold-lt), inset 0 0 0 1px rgba(100,192,179,.16); }
.sidebar .ntab.active .nav-icon { color: var(--gold-lt); }
.sidebar-backdrop { display: none; }
.menu-toggle { display: none; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,.17); border-radius: 9px; color: #e9f2f4; background: rgba(255,255,255,.08); font-size: 18px; }
.hdr { position: sticky; top: 0; }
.builder { top: 98px; }

@media (min-width: 901px) {
  .app.sidebar-collapsed { --sidebar-width: 76px; }
  .sidebar-collapsed .sidebar-top { flex-direction: column; justify-content: center; gap: 8px; min-height: 96px; padding: 12px 8px; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; }
  .sidebar-collapsed .sidebar-brand .brand-logo { height: 20px; max-width: 60px; }
  .sidebar-collapsed .sidebar-brand-text { display: none; }
  .sidebar-collapsed .sidebar .nav { padding: 14px 8px; }
  .sidebar-collapsed .sidebar .nav-group-label { height: 1px; margin: 13px 9px 8px; overflow: hidden; border-top: 1px solid rgba(255,255,255,.12); font-size: 0; }
  .sidebar-collapsed .sidebar .nav-group-label:first-child { display: none; }
  .sidebar-collapsed .sidebar .ntab { justify-content: center; min-height: 48px; padding: 9px; }
  .sidebar-collapsed .sidebar .ntab .nav-icon { width: 24px; font-size: 20px; }
  .sidebar-collapsed .sidebar .ntab .nav-label { display: none; }
}

/* Allocation workflow and settings */
.settings-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; padding: 16px 20px; border: 1px solid #d5e6e4; border-radius: 12px; background: #eef7f5; }
.settings-intro strong { display: block; color: var(--ink); font-size: 13px; font-weight: 800; }
.settings-intro span { display: block; margin-top: 2px; color: var(--ink-m); font-size: 11.5px; }
.step-number, .settings-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; color: var(--primary); background: #e6f3f0; font-size: 11px; font-weight: 850; }
.step-sub { margin-top: 2px; color: var(--ink-m); font-size: 11.5px; }
.builder .step-number { color: var(--navy); background: var(--gold-lt); }
.settings-links, .settings-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-links a { padding: 7px 11px; border: 1px solid #bdd8d3; border-radius: 7px; color: var(--primary); background: #fff; font-size: 11px; font-weight: 750; text-decoration: none; }
.settings-links a:hover { background: #e4f3ef; }
#reference-section, #supplier-section { scroll-margin-top: 90px; }
.settings-count { margin-left: auto; padding: 5px 9px; border-radius: 6px; color: var(--primary); background: #e9f5f1; font-size: 11px; font-weight: 800; white-space: nowrap; }
.settings-action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.settings-action-row strong { display: block; font-size: 12px; font-weight: 800; }
.settings-action-row span { display: block; margin-top: 3px; color: var(--ink-m); font-size: 11.5px; }
.supplier-drop-zone { min-height: 150px; }
.supplier-drop-zone strong { color: var(--ink-s); font-size: 13px; }
.supplier-drop-zone span { margin-top: 3px; color: var(--ink-m); font-size: 11px; }
.supplier-preview { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--bd); }
.supplier-preview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.supplier-preview-stats > div { padding: 13px 15px; border: 1px solid var(--bd); border-radius: 9px; background: var(--sunken); }
.supplier-preview-stats strong { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.supplier-preview-stats span { color: var(--ink-m); font-size: 10.5px; }
.supplier-preview-list { margin-top: 17px; color: var(--ink-s); font-size: 11.5px; }
.supplier-preview-list > span { font-weight: 800; }
.supplier-preview-list > div { max-height: 140px; margin-top: 7px; padding: 11px 13px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 8px; background: #fff; line-height: 1.8; }
.supplier-preview-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.settings-api { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding: 18px 20px; border: 1px solid var(--bd); border-radius: var(--r); background: #fff; }
.settings-api strong { font-size: 12.5px; }
.settings-api p { margin-top: 3px; color: var(--ink-m); font-size: 11.5px; }
.settings-soon { margin-left: auto; padding: 5px 9px; border-radius: 6px; color: var(--amb); background: var(--amb-bg); font-size: 10px; font-weight: 800; white-space: nowrap; }
.groq-key-card { align-items: stretch; }
.groq-key-card form { flex: 1; min-width: 0; }
.groq-key-card label { display: block; margin-top: 10px; color: var(--ink-m); font-size: 10.5px; font-weight: 800; }
.groq-key-row { display: flex; gap: 8px; align-items: center; margin-top: 5px; }
.groq-key-row input { flex: 1; min-width: 0; min-height: 37px; }

/* Register selection and paging */
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px solid #d6e7e5; border-radius: 10px; background: #f4faf8; }
.bulk-count { color: var(--ink-s); font-size: 12px; font-weight: 800; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reg-check-col { width: 38px; text-align: center; }
.reg-check-col input, .reg-check-cell input { vertical-align: middle; }
.reg-check-cell { width: 38px; text-align: center; }
.reg-selected td { background: #eaf7f4 !important; }
.reg-selected td:first-child { box-shadow: inset 3px 0 var(--primary); }
.conf.reg-selected td { background: #fff2ed !important; }
.conf.reg-selected td:first-child { box-shadow: inset 3px 0 var(--red); }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px 17px; border-top: 1px solid var(--bd); color: var(--ink-m); font-size: 11.5px; }
.step-reset { margin-left: auto; }
.results-filters { display: grid; gap: 12px; padding: 17px 20px; background: #fff; border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.results-filter-fields { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(125px, 1fr)); gap: 12px; align-items: end; }
.results-filter-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-input, .advanced-filter-row label { display: grid; gap: 5px; color: var(--ink-m); font-size: 10.5px; font-weight: 700; }
.filter-input:first-child { flex: 2 1 190px; }
.filter-input:not(:first-child) { flex: 1 1 120px; }
.filter-input input, .advanced-filter-row input { width: 100%; min-height: 37px; }
.filter-check { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; color: var(--ink); font-size: 11.5px; white-space: nowrap; }
.filter-check input { width: auto; min-height: auto; }
.advanced-filter-row { padding-top: 5px; }
.advanced-filter-row label { flex: 1 1 130px; }
.pager-controls { align-items: center; flex-wrap: wrap; }
.page-numbers { display: inline-flex; align-items: center; gap: 4px; }
.pager-page { min-width: 31px; min-height: 31px; padding: 3px 7px; border: 1px solid var(--bd); border-radius: 7px; background: #fff; color: var(--ink); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.pager-page:hover { border-color: var(--primary); color: var(--primary); }
.pager-page.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-ellipsis { padding: 0 2px; }
.table-pagination > div { display: flex; gap: 8px; }
.table-pagination .btn { min-width: 75px; }
.upload-preview-head, .upload-school-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.upload-preview-head strong, .upload-school-head strong { display: block; color: var(--ink); font-size: 13px; font-weight: 800; }
.upload-preview-head span:not(.badge), .upload-school-head span { display: block; margin-top: 3px; color: var(--ink-m); font-size: 11.5px; }
.upload-preview-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.upload-preview-stats .vbar { padding: 13px 15px; box-shadow: none; }
.upload-duplicate-list { max-height: 145px; margin: 8px 0 0; padding-left: 19px; overflow-y: auto; }
.upload-duplicate-list li { margin: 3px 0; }
.upload-school-head { margin-top: 20px; }
.upload-school-head input { width: min(270px, 100%); }
.upload-school-table { max-height: 460px; overflow: auto; margin-bottom: 0; }
.upload-school-table table { min-width: 590px; }
.upload-school-table th { position: sticky; top: 0; background: var(--sunken); }
.import-school-detail summary { color: var(--ink); font-weight: 700; cursor: pointer; }
.import-school-detail summary:hover { color: var(--primary); }
.import-school-items { max-height: 210px; min-width: 235px; margin-top: 9px; padding: 8px 10px; overflow: auto; border: 1px solid var(--bd); border-radius: 7px; background: #f8fbfa; }
.import-school-items > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: var(--ink-m); font-size: 10.5px; }
.import-school-items > div + div { border-top: 1px solid #e6eeee; }
.upload-preview-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 22px; padding: 10px 0; color: var(--ink-m); font-size: 11.5px; }
.upload-preview-pager > div { display: flex; align-items: center; gap: 8px; }

@media (max-width: 1350px) {
  .vbars.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1220px) {
  .two-col { grid-template-columns: 1fr; }
  .builder { position: static; }
}
@media (max-width: 900px) {
  .app-content { margin-left: 0; }
  .sidebar { width: min(280px, 85vw); transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 115; background: rgba(5,26,36,.54); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-close, .menu-toggle { display: grid; place-items: center; }
  .sidebar-collapse { display: none; }
  .builder { position: static; }
  .summary-supplier-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
  .summary-expand { grid-column: 1 / -1; }
  .summary-supplier-values { grid-column: 1 / -1; padding-left: 42px; }
}
@media (max-width: 720px) {
  .results-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-filter-fields .filter-input:first-child { grid-column: 1 / -1; }
  .upload-preview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-table .result-region-col { display: none; }
  .results-table .result-check-col { width: 8%; }
  .results-table .result-school-col { width: 40%; }
  .results-table .result-item-col { width: 29%; }
  .results-table .result-value-col { width: 23%; }
  .result-mobile-region { display: inline; }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .results-card-head .results-count { margin-left: 48px; }
  .summary-export-actions { width: 100%; margin-left: 0; }
  .summary-export-actions .btn { flex: 1; }
}
@media (max-width: 620px) {
  .results-filter-fields { grid-template-columns: 1fr; }
  .results-filter-fields .filter-input:first-child { grid-column: auto; }
  .upload-school-head, .upload-preview-pager { align-items: stretch; flex-direction: column; }
  .upload-school-head input { width: 100%; }
  .upload-preview-pager > div { justify-content: space-between; }
  .allocation-filter-grid { grid-template-columns: 1fr; }
  .allocation-filter-footer { align-items: stretch; flex-direction: column; }
  .allocation-filter-footer .btn { width: 100%; }
  .results-table th, .results-table td { padding: 10px 7px; }
  .results-table th { font-size: 9px; }
  .results-table .sort-mark { display: none; }
  .results-actions { width: 100%; }
  .results-actions .btn { flex: 1; }
  .settings-intro, .settings-action-row { align-items: flex-start; flex-direction: column; }
  .settings-api { align-items: flex-start; flex-wrap: wrap; }
  .settings-soon { margin-left: 49px; }
  .supplier-preview-stats { grid-template-columns: 1fr; }
  .supplier-preview-actions .btn { flex: 1; }
  .bulk-bar { align-items: stretch; }
  .bulk-actions { width: 100%; }
  .bulk-actions .btn { flex: 1 1 auto; }
  .table-pagination { flex-direction: column; align-items: stretch; }
  .table-pagination > div { justify-content: space-between; }
  .table-pagination .btn { flex: 1; }
  .summary-toolbar { padding: 16px; }
  .summary-search, .summary-sort { flex: 1 1 100%; max-width: none; }
  .summary-list { padding: 4px 15px 12px; }
  .summary-supplier-row { grid-template-columns: 1fr; }
  .summary-expand, .summary-supplier-values, .summary-supplier-actions { grid-column: 1; }
  .summary-supplier-values { justify-content: space-between; gap: 10px; padding-left: 42px; }
  .summary-supplier-actions .btn { flex: 1 1 180px; }
  .summary-detail { padding-left: 0; }
}

/* Hidden allocation assistant, opened with Alt+A */
.assistant-overlay[hidden], .assistant-proposal[hidden] { display: none; }
.assistant-overlay { position: fixed; inset: 0; z-index: 300; display: flex; justify-content: flex-end; }
.assistant-backdrop { position: absolute; inset: 0; background: rgba(8, 30, 40, .52); }
.assistant-panel { position: relative; display: flex; flex-direction: column; width: min(530px, 100%); height: 100%; height: 100dvh; background: #f7faf9; box-shadow: -18px 0 55px rgba(7, 29, 39, .22); }
.assistant-header { display: flex; align-items: center; gap: 12px; padding: 19px 22px; background: var(--navy); color: #fff; }
.assistant-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: none; border-radius: 11px; background: #1d6966; color: #d6f1e8; font-size: 23px; }
.assistant-header h2 { font-size: 16px; line-height: 1.2; letter-spacing: -.02em; }
.assistant-header span:not(.assistant-mark) { display: block; margin-top: 3px; color: #b9d2d5; font-size: 11px; }
.assistant-close { margin-left: auto; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: transparent; color: #fff; font-size: 23px; line-height: 1; }
.assistant-close:hover { background: rgba(255,255,255,.12); }
.assistant-intro { padding: 16px 22px 8px; color: var(--ink-s); font-size: 12px; line-height: 1.5; }
.assistant-context { margin: 0 22px 10px; padding: 7px 10px; border-radius: 8px; background: #e7f3f0; color: var(--ink-s); font-size: 11px; font-weight: 700; }
.assistant-controls { margin: 0 22px 12px; border: 1px solid var(--bd); border-radius: 9px; background: #fff; }
.assistant-controls summary { padding: 8px 12px; color: var(--primary); font-size: 11px; font-weight: 800; cursor: pointer; }
.assistant-controls label { display: flex; align-items: flex-start; gap: 8px; padding: 0 12px 8px; color: var(--ink-s); font-size: 11px; line-height: 1.4; }
.assistant-controls input { margin-top: 2px; }
.assistant-controls .btn { margin: 0 12px 12px; }
.assistant-activity { margin-top: 8px; border-top: 1px solid var(--bd); padding-top: 6px; }
.assistant-activity summary { color: var(--primary); font-size: 11px; font-weight: 800; cursor: pointer; }
.assistant-activity ol { margin: 6px 0 0; padding-left: 18px; color: var(--ink-m); font-size: 11px; }
.assistant-activity li.failed { color: var(--red); }
.assistant-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px 15px; border-bottom: 1px solid var(--bd); }
.assistant-quick-actions button { padding: 7px 10px; border: 1px solid #c5dad8; border-radius: 99px; background: #fff; color: var(--primary); font-size: 11px; font-weight: 750; }
.assistant-quick-actions button:hover { background: #e9f6f2; }
.assistant-messages { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; padding: 20px 22px; overflow-y: auto; }
.assistant-message { max-width: 95%; padding: 12px 14px; border: 1px solid var(--bd); border-radius: 13px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message.user { align-self: flex-end; border-color: #b4d8d0; background: #e9f6f2; }
.assistant-message.assistant { align-self: flex-start; box-shadow: var(--shad); }
.assistant-message.error { border-color: #e7b8ba; background: var(--red-bg); color: var(--red); }
.assistant-provider { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.assistant-message strong { display: block; margin-bottom: 4px; }
.assistant-report { width: 100%; max-width: 100%; }
.assistant-report h3 { margin: 0 0 8px; font-size: 12px; }
.assistant-report-list { display: grid; gap: 7px; }
.assistant-report-item { padding: 9px 10px; border: 1px solid var(--bd); border-radius: 8px; background: #fbfdfc; }
.assistant-report-item strong { display: flex; justify-content: space-between; gap: 8px; margin: 0; }
.assistant-report-item span { display: block; color: var(--ink-m); font-size: 11px; }
.assistant-report-item.critical { border-color: #efb9bd; background: #fff5f5; }
.assistant-proposal { display: flex; flex: none; flex-direction: column; width: 100%; min-width: 0; min-height: 0; max-height: 48vh; overflow: hidden; border-top: 1px solid #c6ded9; background: #ebf7f3; }
.assistant-proposal-body { flex: 1; min-width: 0; min-height: 0; padding: 16px 22px 22px; overflow: auto; }
.assistant-panel.has-proposal > :is(.assistant-intro, .assistant-context, .assistant-controls, .assistant-quick-actions, .assistant-messages, .assistant-composer) { display: none; }
.assistant-panel.has-proposal .assistant-proposal { flex: 1; max-height: none; }
.assistant-review { width: 100%; max-width: 100%; min-width: 0; margin-top: 8px; overflow-x: auto; }
.assistant-review table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 11px; background: #fff; }
.assistant-review th, .assistant-review td { padding: 7px 8px; border-bottom: 1px solid var(--bd); text-align: left; white-space: nowrap; }
.assistant-review th { color: #647883; background: #f6f9f9; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.assistant-review td.num, .assistant-review th.num { text-align: right; }
.assistant-review .assistant-target-ok { color: var(--grn); font-weight: 750; }
.assistant-review .assistant-target-warning { color: var(--red); font-weight: 750; }
.assistant-review p { margin: 6px 0 0; }
.assistant-proposal h3 { margin: 0 0 5px; font-size: 13px; }
.assistant-proposal p { color: var(--ink-s); font-size: 11.5px; }
.assistant-proposal p.assistant-target-ok { color: var(--grn); font-weight: 750; }
.assistant-proposal p.assistant-target-warning { color: var(--red); font-weight: 750; }
.assistant-proposal p.assistant-proposal-error { padding: 9px 11px; border: 1px solid #e7b8ba; border-radius: 8px; background: var(--red-bg); color: var(--red); font-weight: 700; }
.assistant-proposal ul { max-height: 115px; margin: 9px 0; padding-left: 18px; overflow-y: auto; color: var(--ink-s); font-size: 11px; }
.assistant-proposal li { margin: 3px 0; }
.assistant-proposal-actions { display: flex; flex: none; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #c6ded9; background: #f7fbf9; box-shadow: 0 -5px 16px rgba(7, 29, 39, .06); }
.assistant-proposal-actions .btn { min-height: 40px; }
.assistant-proposal-actions .assistant-download { margin-right: auto; }
.assistant-proposal-actions .assistant-approve { min-width: 150px; }
.assistant-composer { flex: none; padding: 13px 22px 18px; border-top: 1px solid var(--bd); background: #fff; }
.assistant-composer label { display: block; margin-bottom: 6px; color: var(--ink-s); font-size: 11px; font-weight: 800; }
.assistant-composer > div { display: flex; gap: 8px; align-items: end; }
.assistant-composer textarea { width: 100%; min-height: 58px; max-height: 140px; padding: 10px 11px; resize: vertical; border: 1px solid var(--bd-s); border-radius: 9px; color: var(--ink); font-size: 12px; }
.assistant-composer textarea:focus { outline: 2px solid #a4d4c9; border-color: var(--primary); }
.assistant-composer button { width: 42px; height: 42px; flex: none; border: 0; border-radius: 9px; background: var(--primary); color: #fff; font-size: 16px; }
.assistant-composer #assistant-mic { background: #e7f3f0; color: var(--primary); font-size: 11px; font-weight: 800; }
.assistant-composer #assistant-mic[aria-pressed="true"] { background: var(--red); color: #fff; }
.assistant-composer button:hover { background: var(--primary-hover); }
.assistant-composer button:disabled { opacity: .5; cursor: wait; }
.assistant-composer > span { display: block; margin-top: 6px; color: var(--ink-m); font-size: 10px; }
@media (max-width: 620px) {
  .assistant-panel { width: 100%; }
  .assistant-header, .assistant-intro, .assistant-messages, .assistant-quick-actions, .assistant-composer { padding-left: 16px; padding-right: 16px; }
  .assistant-proposal-body, .assistant-proposal-actions { padding-left: 16px; padding-right: 16px; }
  .assistant-proposal-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .assistant-proposal-actions .btn { width: 100%; min-width: 0; white-space: normal; text-align: center; }
  .assistant-proposal-actions .assistant-download { margin-right: 0; }
  .assistant-proposal-actions .assistant-approve { grid-column: 1 / -1; }
  .assistant-context, .assistant-controls { margin-left: 16px; margin-right: 16px; }
}

/* API access page */
[data-admin-only][hidden] { display: none !important; }
.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; }
.api-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.api-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; letter-spacing: 0; color: var(--ink-s); font-size: 12px; font-weight: 650; cursor: pointer; }
.api-toggle span { line-height: 1.45; }
.api-keys-table td { vertical-align: top; }
.api-keys-table td small, .api-activity-table td small { display: block; margin-top: 3px; color: var(--ink-m); font-size: 10.5px; font-weight: 500; }
.api-keys-table .badge + .badge { margin-left: 3px; }
.api-row-muted td { color: var(--ink-m); background: #fafcfc; }
.api-error-text { color: var(--red) !important; }
.api-actions { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; min-width: 150px; }
.api-inline { padding: 2px 6px; border-radius: 5px; color: var(--navy); background: #eef3f5; font: 11px/1.5 "Cascadia Mono", Consolas, monospace; word-break: break-all; }
.api-modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.api-modal-wide { width: min(920px, 100%); }
.api-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.api-field { margin-bottom: 12px; }
.api-field label, .api-form-grid label, .api-scopes legend { font-size: 11.5px; font-weight: 750; color: var(--ink-s); }
.api-scopes { padding: 10px 12px; border: 1px solid var(--bd); border-radius: 9px; }
.api-scopes legend { padding: 0 4px; }
.api-confirm { padding-top: 12px; border-top: 1px dashed var(--bd); }
.api-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.api-help { margin: 0 0 14px; color: var(--ink-m); font-size: 12px; line-height: 1.55; }
.api-copy-row { display: flex; align-items: center; gap: 8px; }
.api-copy-row input { flex: 1; min-width: 0; font: 12px/1.4 "Cascadia Mono", Consolas, monospace; }
.api-copy-row .api-base { flex: 1; min-width: 0; padding: 8px 10px; }
.api-ack { margin-top: 4px; }
.api-code { margin: 0 0 14px; padding: 13px 15px; max-height: 320px; overflow: auto; border-radius: 10px; color: #dbe8ec; background: #10222d; font: 11.5px/1.6 "Cascadia Mono", Consolas, monospace; white-space: pre; }
.api-code-tall { max-height: 420px; }
.api-subhead { margin: 18px 0 8px; color: var(--ink); font-size: 12.5px; font-weight: 800; }
.api-docs .api-subhead:first-child, .api-doc-grid section > .api-subhead:first-child { margin-top: 0; }
.api-doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 26px; }
.api-endpoints > div { padding: 10px 0; border-bottom: 1px solid #eaf0f1; }
.api-endpoints p { margin: 6px 0 0; color: var(--ink-s); font-size: 12px; line-height: 1.55; }
.api-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.api-tab { padding: 6px 11px; border: 1px solid var(--bd); border-radius: 7px; color: var(--ink-s); background: #fff; font-size: 11.5px; font-weight: 700; }
.api-tab.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.api-tab-copy { margin-left: auto; }
.api-notes { margin: 0 0 16px; padding-left: 18px; color: var(--ink-s); font-size: 12px; line-height: 1.7; }
.api-events { margin: 0 0 8px; padding: 0; list-style: none; font-size: 12px; }
.api-events li { padding: 8px 0; border-bottom: 1px solid #eaf0f1; }
.api-events li span { margin-left: 6px; color: var(--ink-m); font-size: 11px; }
.api-events li div { margin-top: 2px; color: var(--ink-m); font-size: 11.5px; }
.api-activity-table { max-height: 340px; overflow-y: auto; }
@media (max-width: 980px) {
  .api-doc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .api-form-grid { grid-template-columns: minmax(0, 1fr); }
  .api-head-actions { width: 100%; margin-left: 0; }
  .api-actions { justify-content: flex-start; }
}

/* Users page, password screen, and the CEO (dashboard-only) layout */
[data-staff-only][hidden] { display: none !important; }
.user-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.user-roles > div { padding: 12px 14px; border: 1px solid var(--bd); border-radius: 11px; background: #fff; }
.user-roles p { margin: 6px 0 0; color: var(--ink-m); font-size: 11.5px; line-height: 1.5; }
.users-search { width: 220px; min-height: 32px; padding: 5px 10px; font-size: 12px; }
.password-wrap { position: fixed; inset: 0; z-index: 400; overflow-y: auto; }
.password-card { width: min(460px, 100%); border-radius: 18px; box-shadow: 0 30px 70px rgba(4, 20, 28, .35); }
.password-logo { height: 40px; margin-bottom: 22px; align-self: flex-start; }
.pw-hint { margin-top: 6px; color: var(--ink-m); font-size: 11.5px; }
.pw-hint-ok { color: var(--grn); }
.pw-secondary { margin-top: 12px; padding: 8px; border: 0; color: var(--ink-m); background: none; font-size: 12.5px; font-weight: 650; }
.pw-secondary:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 720px) {
  .user-roles { grid-template-columns: minmax(0, 1fr); }
  .users-search { width: 100%; }
  .hdr-user > span { display: none; }
}

/* Structured dialogs (New user / Edit user) */
.user-modal { width: min(640px, 100%); padding: 0; display: flex; flex-direction: column; }
.modal-head { padding: 24px 28px 16px; border-bottom: 1px solid var(--bd); }
.modal-head .modal-title { margin-bottom: 4px; }
.modal-sub { margin: 0; color: var(--ink-m); font-size: 12.5px; }
.modal-section { padding: 18px 28px 0; }
.modal-section-title { margin: 0 0 10px; color: var(--ink-m); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.modal-section .api-form-grid { margin-bottom: 0; }
.modal-note { margin: 8px 0 0; color: var(--ink-m); font-size: 11.5px; line-height: 1.5; }
.modal-confirm { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bd); }
.modal-confirm .fg { max-width: 300px; }
.user-modal > .alert { margin: 14px 28px 0; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding: 14px 28px; border-top: 1px solid var(--bd); background: #f8fbfb; border-radius: 0 0 15px 15px; }
.mono-input { font: 13px/1.4 "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.role-card { position: relative; display: block; margin: 0; padding: 12px 12px 12px 36px; border: 1px solid var(--bd-s); border-radius: 10px; background: #fff; letter-spacing: 0; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.role-card:hover { border-color: #8faeb3; }
.role-card input { position: absolute; top: 13px; left: 12px; }
.role-card-title { display: block; color: var(--ink); font-size: 12.5px; font-weight: 780; }
.role-card-help { display: block; margin-top: 3px; color: var(--ink-m); font-size: 11.5px; font-weight: 500; line-height: 1.45; }
.role-card:has(input:checked) { border-color: var(--primary); background: #eef7f5; box-shadow: inset 0 0 0 1px var(--primary); }
.role-card:has(input:focus-visible) { outline: 3px solid rgba(18,109,105,.35); outline-offset: 2px; }
.role-card:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.switch-row { display: flex; align-items: flex-start; gap: 10px; margin: 0; letter-spacing: 0; cursor: pointer; }
.switch-row input { margin-top: 2px; }
.switch-row strong { display: block; color: var(--ink); font-size: 12.5px; font-weight: 750; }
.switch-row small { display: block; margin-top: 2px; color: var(--ink-m); font-size: 11.5px; font-weight: 500; }
@media (max-width: 620px) {
  .role-cards { grid-template-columns: minmax(0, 1fr); }
  .modal-head, .modal-section, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .user-modal > .alert { margin-left: 18px; margin-right: 18px; }
  .modal-confirm .fg { max-width: none; }
}

/* Sidebar menu scroll rail (js/sidebar-scroll.js replaces the native scrollbar) */
.sidebar .nav {
  scrollbar-width: none;
  --fade-top: 0px;
  --fade-bottom: 0px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade-top), #000 calc(100% - var(--fade-bottom)), transparent 100%);
}
.sidebar .nav::-webkit-scrollbar { display: none; }
.nav-rail { position: absolute; right: 3px; z-index: 3; width: 5px; border-radius: 99px; background: rgba(255,255,255,.06); opacity: 0; transition: opacity .25s ease, width .15s ease, right .15s ease, background .15s ease; }
.nav-rail[hidden] { display: none; }
.sidebar:hover .nav-rail, .nav-rail.is-active { opacity: 1; }
.nav-rail:hover, .nav-rail.is-dragging { right: 2px; width: 8px; background: rgba(255,255,255,.10); }
.nav-thumb { position: absolute; top: 0; left: 0; right: 0; border-radius: 99px; background: linear-gradient(180deg, var(--gold-lt), var(--gold)); box-shadow: 0 0 0 1px rgba(7,30,41,.35), 0 0 12px rgba(241,204,128,.35); cursor: grab; touch-action: none; transition: box-shadow .15s ease, filter .15s ease; }
.nav-rail:hover .nav-thumb { filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(7,30,41,.35), 0 0 16px rgba(241,204,128,.55); }
.nav-rail.is-dragging .nav-thumb { cursor: grabbing; filter: brightness(1.12); }
@media (prefers-reduced-motion: reduce) { .nav-rail, .nav-thumb { transition: none; } }

/* Show/hide password toggle (js/ui.js initPasswordReveal) */
.reveal-field { position: relative; }
.reveal-field input { padding-right: 46px; }
.reveal-btn { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 7px; color: var(--ink-m); background: transparent; transform: translateY(-50%); }
.reveal-btn:hover { color: var(--primary); background: #eef5f4; }
.reveal-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reveal-field input::-ms-reveal { display: none; }

/* Settings: tabs, summary, and two-column steps */
.settings-tabs { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--bd); border-radius: 12px; background: #fff; box-shadow: var(--shad); max-width: 100%; overflow-x: auto; }
.settings-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 16px; border: 0; border-radius: 9px; color: var(--ink-m); background: transparent; font-size: 12.5px; font-weight: 750; white-space: nowrap; transition: background .15s, color .15s; }
.settings-tab span { font-size: 14px; }
.settings-tab:hover { color: var(--ink); background: #f3f7f8; }
.settings-tab.active { color: #fff; background: var(--primary); box-shadow: 0 4px 10px rgba(18,109,105,.18); }
.settings-panel { padding: 24px; }
.settings-panel[hidden] { display: none; }
.settings-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-panel-head h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 780; letter-spacing: -.02em; }
.settings-panel-head p { margin: 4px 0 0; color: var(--ink-m); font-size: 12.5px; }
.settings-panel-head kbd { padding: 1px 6px; border: 1px solid var(--bd-s); border-bottom-width: 2px; border-radius: 5px; background: #f6f9f9; font: 11px/1.4 "Cascadia Mono", Consolas, monospace; }
.settings-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--bd); border-radius: 12px; background: #f8fbfb; }
.settings-summary > div { padding: 14px 18px; }
.settings-summary > div + div { border-left: 1px solid var(--bd); }
.settings-summary span { display: block; color: var(--ink-m); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-summary strong { display: block; margin-top: 4px; color: var(--ink); font-size: 20px; font-weight: 780; letter-spacing: -.02em; }
.settings-updated { margin: 10px 0 0; color: var(--ink-m); font-size: 12px; }
.settings-updated::before { content: "●"; margin-right: 7px; color: #36a36f; font-size: 9px; vertical-align: 1px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.settings-block { min-width: 0; padding: 18px; border: 1px solid var(--bd); border-radius: 12px; background: #fff; }
.settings-block-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.settings-block-head .step-number { width: 28px; height: 28px; border-radius: 8px; }
.settings-block-head strong { display: block; color: var(--ink); font-size: 13px; font-weight: 780; }
.settings-block-head span:not(.step-number) { display: block; margin-top: 2px; color: var(--ink-m); font-size: 11.5px; line-height: 1.45; }
.settings-files { display: grid; gap: 8px; }
.settings-file { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 1px solid var(--bd); border-radius: 10px; color: var(--ink); background: #fff; text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.settings-file:hover { border-color: #9fc4bf; background: #f5faf9; transform: translateY(-1px); }
.settings-file strong { display: block; font-size: 12.5px; font-weight: 750; }
.settings-file small { display: block; margin-top: 1px; color: var(--ink-m); font-size: 11px; }
.settings-file > span:nth-child(2) { flex: 1; min-width: 0; }
.settings-file-arrow { color: var(--primary); font-size: 15px; font-weight: 800; }
.file-badge { display: grid; place-items: center; width: 42px; height: 34px; flex: none; border-radius: 7px; color: #fff; font-size: 9.5px; font-weight: 850; letter-spacing: .06em; }
.file-xlsx { background: #1d7a4d; }
.file-csv { background: #3f6f8a; }
.settings-drop.drop-zone, .settings-drop.supplier-drop-zone { min-height: 128px; padding: 18px; }
.settings-drop .settings-drop-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 0 9px; border-radius: 11px; color: var(--primary); background: #e3f2ed; font-size: 17px; font-weight: 800; }
.settings-drop strong { color: var(--ink-s); font-size: 12.5px; font-weight: 750; }
.settings-drop small { margin-top: 3px; color: var(--ink-m); font-size: 11px; }
.settings-block #upload-progress { margin-top: 12px !important; }
#settings-panel-data #upload-preview { margin-top: 20px !important; padding-top: 20px; border-top: 1px solid var(--bd); }
#settings-panel-suppliers #supplier-upload-preview, #settings-panel-suppliers #supplier-upload-error { margin-top: 16px; }
.settings-footnote { margin: 16px 0 0; color: var(--ink-m); font-size: 11.5px; }
.settings-planned { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 11px 14px; border: 1px dashed var(--bd-s); border-radius: 10px; color: var(--ink-m); font-size: 12px; }
.settings-key form { display: flex; flex-direction: column; }
.settings-key form > div:first-child strong { display: block; color: var(--ink); font-size: 13px; font-weight: 780; }
.settings-key form > div:first-child p { margin: 3px 0 4px; color: var(--ink-m); font-size: 11.5px; line-height: 1.5; }
.settings-key label { margin: 10px 0 5px; color: var(--ink-m); font-size: 10.5px; font-weight: 800; }
.settings-key .groq-key-row { margin-top: 0; }
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .settings-panel { padding: 16px; }
  .settings-summary { grid-template-columns: minmax(0, 1fr); }
  .settings-summary > div + div { border-left: 0; border-top: 1px solid var(--bd); }
  .settings-tabs { display: flex; }
}

/* Page scrollbar: slim, on-brand, matches the sidebar rail */
/* Chrome and Edge ignore ::-webkit-scrollbar once scrollbar-color is set, so the standard properties are for Firefox only. */
@supports (-moz-appearance: none) { html { scrollbar-width: thin; scrollbar-color: #2f7f7a #eef3f4; } }
html::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track { background: #eef3f4; border-left: 1px solid #dde7e9; }
html::-webkit-scrollbar-thumb { min-height: 48px; border: 3px solid #eef3f4; border-radius: 99px; background: linear-gradient(180deg, #2f7f7a, #145d60); }
html::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #c59a45, #8a611c); }
html::-webkit-scrollbar-thumb:active { background: linear-gradient(180deg, #f1cc80, #c59a45); }
html::-webkit-scrollbar-corner { background: #eef3f4; }
