/* ==========================================================================
   BanquetClose — local-first banquet exception close
   System fonts only. No web fonts, no external assets.
   ========================================================================== */

:root {
  --ink: #0f1b2d;
  --ink-2: #26364a;
  --body: #33445a;
  --muted: #66788f;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f4f7fb;
  --card: #ffffff;
  --accent: #1d4ed8;
  --accent-ink: #143a9e;
  --accent-soft: #eef3ff;
  --green: #0b7a52;
  --green-soft: #e7f6ef;
  --amber: #a85a06;
  --amber-soft: #fdf3e2;
  --red: #b42318;
  --red-soft: #fdecea;
  --purple: #5b46a8;
  --purple-soft: #f1eefc;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 1px 3px rgba(15, 27, 45, .06);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
small { font-size: 11.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.text-green { color: var(--green) !important; }
.hint { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.note { color: var(--muted); font-size: 11.5px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; background: #0d1b2e; }

.sidebar {
  background: #0d1b2e;
  color: #c8d4e4;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2f6df0, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 13.5px; letter-spacing: .01em; }
.brand-text small { color: #7f93ad; font-size: 10.5px; }

.side-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #6e849f; padding: 0 6px; }

.role-switch { display: grid; gap: 4px; }
.role-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  background: transparent; border: 1px solid rgba(255,255,255,.09);
  color: #b9c7d9; padding: 7px 9px; border-radius: 7px; cursor: pointer; text-align: left;
}
.role-btn span { font-size: 12.5px; font-weight: 600; }
.role-btn small { color: #7186a1; font-size: 10.5px; }
.role-btn:hover { background: rgba(255,255,255,.04); }
.role-btn.is-active { background: rgba(47,109,240,.18); border-color: rgba(88,143,255,.55); color: #fff; }
.role-btn.is-active small { color: #a8c0e6; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav a {
  display: flex; gap: 10px; align-items: center;
  color: #a9b9cd; padding: 8px 9px; border-radius: 7px; font-size: 12.5px;
}
.nav a .num { font-family: var(--mono); font-size: 10px; color: #5f7691; width: 16px; }
.nav a:hover { background: rgba(255,255,255,.05); color: #e6eef9; }
.nav a.is-active { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset 2px 0 0 #4f86f7; }
.nav a.is-active .num { color: #7fa6ff; }

.license-chip {
  margin-top: auto; display: flex; gap: 9px; align-items: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  padding: 9px 10px; border-radius: 8px;
}
.license-chip strong { display: block; font-size: 12px; color: #e8eef7; }
.license-chip small { color: #8299b3; font-size: 10.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-gray { background: #7b8ca3; }
.dot-green { background: #2fbf83; }
.dot-amber { background: #f0a13a; }
.dot-red { background: #ef5f52; }

.side-foot { font-size: 10px; color: #61758e; line-height: 1.5; padding: 0 4px; }

.main { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 18px 28px 16px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; color: var(--ink); letter-spacing: -.01em; }
.topbar p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.top-meta { display: flex; align-items: center; gap: 22px; }
.meta-item { display: flex; flex-direction: column; line-height: 1.3; }
.meta-item span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.meta-item strong { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

.pill { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: #eef2f7; color: var(--ink-2); border: 1px solid var(--line); }
.pill-muted { color: var(--muted); }
.pill-green { background: var(--green-soft); color: var(--green); border-color: #bfe6d5; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: #f3d9ab; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: #f6c9c4; }

.view { padding: 22px 28px 40px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.grid-2-wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-h-tight { padding: 14px 16px; margin-bottom: 0; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.card-h-tight h2 { white-space: nowrap; }
.card h2 { font-size: 14.5px; color: var(--ink); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h p { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 68ch; }
.sec-no {
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  background: var(--accent-soft); border-radius: 4px; padding: 2px 5px;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.legend-inline { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 7px; border: 1px solid transparent; padding: 8px 13px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled { background: #b9c7de; cursor: not-allowed; }
.btn-dark { background: #14243a; color: #fff; }
.btn-dark:hover { background: #0d1b2e; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: #f8fafc; border-color: #b6c2d2; }
.btn-blue { background: var(--accent-soft); color: var(--accent-ink); border-color: #c8d8fb; }
.btn-green { background: var(--green); color: #fff; }
.btn-small { padding: 5px 10px; font-size: 11.5px; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 6px 0 0; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em;
  padding: 2.5px 7px; border-radius: 5px; border: 1px solid transparent; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); border-color: #c5e8d8; }
.badge-red { background: var(--red-soft); color: var(--red); border-color: #f6cbc7; }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f0d9b4; }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: #d8d0f3; }
.badge-blue { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfdcfa; }
.badge-gray { background: #f1f4f8; color: var(--muted); border-color: var(--line); }
.tag { font-size: 10.5px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 3px 9px; }

/* ---------- demo ---------- */
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scenario {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  border-left-width: 3px; transition: border-color .12s, background .12s, transform .12s;
}
.scenario strong { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.scenario small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.scenario:hover { background: #f8fafc; border-color: #c3d2e0; }
.scenario.tone-red { border-left-color: #e0574c; }
.scenario.tone-amber { border-left-color: #e39a2e; }
.scenario.tone-green { border-left-color: #24a06f; }
.scenario.tone-purple { border-left-color: #7a63c9; }
.scenario.tone-gray { border-left-color: #94a3b8; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 11px; align-items: flex-start; }
.step-n {
  width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.steps strong { font-size: 12.5px; color: var(--ink-2); }
.steps p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field input, .field select { min-width: 0; }
.field > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.field input, .field select, select, input[type=text] {
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px;
  font-size: 12.5px; color: var(--ink-2); background: #fff; font-family: inherit; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(47,109,240,.22); border-color: var(--accent); }
.field-sm > span { font-size: 10px; }
.field-sm input { padding: 5px 7px; font-size: 12px; }
select[multiple] { padding: 4px; }
.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form input { flex: 1; border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.mini-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin: 12px 0 6px; }

.licence-actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 12px; }
.token-box { background: #0f1b2d; border-radius: 8px; padding: 9px 11px; }
.token-head { display: flex; justify-content: space-between; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #7f93ad; margin-bottom: 4px; }
.token-head .mono { text-transform: none; letter-spacing: 0; color: #b9c9dd; }
.token-box code { display: block; font-family: var(--mono); font-size: 10.5px; color: #9fc0f5; word-break: break-all; line-height: 1.45; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 5px 10px; font-size: 11.5px; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.seg-sm button { padding: 4px 8px; font-size: 11px; }
.mini-table { width: 100%; font-size: 11.5px; border-collapse: collapse; }
.mini-table td { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.mini-table td:last-child { text-align: right; font-weight: 600; color: var(--ink-2); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 520px; }
.card-flush .table-wrap { max-height: 540px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 650; padding: 8px 10px; background: #f8fafc;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
.table td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table tbody tr:hover { background: #f9fbfd; }
.table tbody tr.is-selected { background: var(--accent-soft); }
.table-compact td, .table-compact th { padding: 5px 8px; font-size: 11.5px; }
.cell-sub { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line); background: #fbfcfe; font-size: 11.5px; color: var(--muted);
}
.table-foot > span { white-space: nowrap; }
.foot-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- prep ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 12.5px; border: 1px solid; }
.banner strong { font-weight: 650; }
.banner-warn { background: var(--amber-soft); border-color: #f0d9b4; color: #7a4405; }
.banner-red { background: var(--red-soft); border-color: #f4c6c1; color: #8d1c13; display: block; }
.banner-red ul { margin: 6px 0 0; padding-left: 18px; }
.banner-amber { background: var(--amber-soft); border-color: #f0d9b4; color: #7a4405; }
.banner .btn { margin-left: auto; }

.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.slot { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: #fcfdff; display: flex; flex-direction: column; gap: 8px; }
.slot.is-ok { border-color: #c5e8d8; background: #fbfefc; }
.slot.is-warn { border-color: #f0d9b4; }
.slot-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.slot-head strong { display: block; font-size: 12.5px; color: var(--ink); }
.slot-head small { color: var(--muted); font-size: 10.5px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--line-strong); border-radius: 8px; padding: 14px 10px; cursor: pointer;
  background: #fff; text-align: center;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dz-title { font-size: 12px; font-weight: 600; color: var(--ink-2); word-break: break-all; }
.dz-sub { font-size: 10.5px; color: var(--muted); }
.dropzone-sm { padding: 16px 10px; }
.slot-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10.5px; color: var(--muted); }
.slot-stats b { color: var(--ink-2); font-weight: 600; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.issue-list-inline { list-style: none; margin: 0; padding: 0; font-size: 10.5px; color: var(--red); display: flex; flex-direction: column; gap: 3px; }
.issue-list-inline.warn { color: var(--amber); }
.issue-list-inline li { display: flex; gap: 5px; align-items: flex-start; }
.issue-list-inline .dot { margin-top: 5px; }

.mapping-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.mapping-table-wrap { max-height: 430px; overflow: auto; }
.mapping-table td { border-bottom: 1px solid #f1f4f8; }
.field-name { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.req { font-size: 9.5px; color: var(--red); text-transform: uppercase; letter-spacing: .05em; }
.preview .table-wrap { max-height: 230px; border: 1px solid var(--line); border-radius: 7px; }

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.checks li { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; }
.checks strong { font-weight: 600; color: var(--ink-2); display: block; }
.checks small { color: var(--muted); font-size: 10.5px; display: block; line-height: 1.4; }
.chk { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; flex: none; margin-top: 1px; font-weight: 700; }
.chk-pass { background: var(--green-soft); color: var(--green); }
.chk-warn { background: var(--amber-soft); color: var(--amber); }
.chk-fail { background: var(--red-soft); color: var(--red); }
.chk-pending { background: #eef2f7; color: var(--muted); }
.run-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.run-totals { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.run-totals strong { display: block; font-size: 13px; color: var(--ink-2); }
.issue-list { margin-top: 10px; }
.issue-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--red); font-weight: 650; margin-bottom: 4px; }
.issue-list ul { margin: 0; padding-left: 16px; color: var(--red); font-size: 11.5px; }

/* ---------- review ---------- */
.empty { background: #fff; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 48px; text-align: center; }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.empty p { color: var(--muted); margin-bottom: 14px; }
.empty-sm { padding: 24px; }

.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; border-top: 3px solid var(--line-strong); box-shadow: var(--shadow); }
.kpi span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.kpi strong { display: block; font-size: 20px; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi small { font-size: 10.5px; color: var(--muted); }
.kpi-red { border-top-color: #e0574c; }
.kpi-amber { border-top-color: #e39a2e; }
.kpi-purple { border-top-color: #7a63c9; }
.kpi-green { border-top-color: #24a06f; }
.kpi-blue { border-top-color: #2f6df0; }
.kpi-gray { border-top-color: #94a3b8; }

.review-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); gap: 16px; align-items: start; }
.findings-table tbody tr { cursor: pointer; }
.findings-table td { padding: 7px 10px; }
.evidence { position: sticky; top: 96px; }
.ev-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ev-head strong { display: block; font-size: 13.5px; color: var(--ink); }
.ev-head small { color: var(--muted); }
.ev-reason { margin-top: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; }
.ev-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.ev-reason p { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.ev-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.ev-amounts > div { background: #fbfcfe; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
.ev-amounts span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ev-amounts strong { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ev-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11px; margin-bottom: 4px; }
.ev-meta span { color: var(--muted); }
.ev-meta b { color: var(--ink-2); font-weight: 600; font-family: var(--mono); font-size: 11px; }
.alert-note { margin-top: 8px; background: var(--amber-soft); border: 1px solid #f0d9b4; color: #7a4405; border-radius: 7px; padding: 7px 9px; font-size: 11px; }
.decision-box { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 4px; }
.decision-btns { display: flex; gap: 6px; }
.partial-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; margin-top: 8px; }

/* ---------- HQ ---------- */
.hq-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.hq-setup { grid-column: 1; grid-row: 1; }
.hq-status { grid-column: 2; grid-row: 1; }
.hq-import { grid-column: 1; grid-row: 2; }
.hq-history { grid-column: 2; grid-row: 2; }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; background: #f1f5fa; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-family: var(--mono); color: var(--ink-2); }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; }
.import-results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; padding-bottom: 2px; }
.import-row { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.import-row > div { min-width: 0; }
.import-row strong { display: block; font-size: 10.5px; color: var(--ink-2); word-break: break-all; }
.import-row small { color: var(--muted); font-size: 10.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hist-block { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; }
.hist-head strong { font-size: 12.5px; color: var(--ink); }
.hist-head span { font-size: 10.5px; color: var(--muted); }
.hist-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; margin: 6px 0; font-size: 10.5px; color: var(--muted); }
.hist-totals b { color: var(--ink-2); font-family: var(--mono); }

/* ---------- report ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.report-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.report-title { font-size: 22px; color: var(--ink); letter-spacing: -.02em; margin-top: 2px; }
.report-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.report-actions { display: flex; gap: 7px; }
.kpi-row-report { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.coverage { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 12px; }
.coverage div { display: contents; }
.coverage dt { color: var(--muted); }
.coverage dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(13, 27, 46, .45); display: grid; place-items: center; z-index: 100; padding: 24px; }
.modal-card { background: #fff; border-radius: 12px; width: min(720px, 100%); padding: 18px 20px; box-shadow: 0 24px 60px rgba(13,27,46,.25); }
.modal-h { display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { font-size: 15px; color: var(--ink); }
.modal textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--ink-2); margin-top: 10px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #0f1b2d; color: #e9f0fa; padding: 9px 16px; border-radius: 8px;
  font-size: 12px; box-shadow: 0 10px 30px rgba(15,27,45,.28); z-index: 200; max-width: 80vw;
}

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .hq-grid { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-2, .slot-grid, .review-grid, .mapping-grid { grid-template-columns: 1fr; }
  .hq-grid { grid-template-columns: 1fr; }
  .hq-setup, .hq-status, .hq-import, .hq-history { grid-column: auto; grid-row: auto; }
  .topbar { flex-direction: column; gap: 10px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .sidebar, .topbar, .report-actions, .toast, .modal, .card-actions, .table-foot, .seg, .btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .view { padding: 0; }
  .card { border: 1px solid #d5dce6; box-shadow: none; break-inside: avoid; }
  .kpi-row { grid-template-columns: repeat(5, 1fr); }
  .kpi strong { font-size: 16pt; }
  .table-wrap { max-height: none; overflow: visible; }
  .table th { background: #f2f5f9; }
  .banner { break-inside: avoid; }
  .report-title { font-size: 18pt; }
  #view-report::before {
    content: "BanquetClose — monthly exception report";
    display: block; font-size: 9pt; letter-spacing: .12em; text-transform: uppercase; color: #666; margin-bottom: 6mm;
  }
}
