/* VMeal demo · giao diện điều hành sáng, đậm thông tin nhưng dễ đọc. */
@import url("assets/fonts/fonts.css");
@import url("assets/theme.css");
:root {
  --bg: var(--vm-bg);
  --surface: var(--vm-surface);
  --surface-2: var(--vm-surface-2);
  --ink: var(--vm-ink);
  --ink-2: var(--vm-ink-2);
  --muted: var(--vm-muted);
  --line: var(--vm-line);
  --line-2: var(--vm-line-2);
  --red: var(--vm-red);
  --red-ink: var(--vm-red-ink);
  --side: var(--vm-red-deep);
  --red-soft: var(--vm-red-soft);
  --ok: var(--vm-ok);
  --ok-soft: var(--vm-ok-soft);
  --warn: var(--vm-warn);
  --warn-soft: var(--vm-warn-soft);
  --bad: var(--vm-bad);
  --bad-soft: var(--vm-bad-soft);
  --info: var(--vm-info);
  --info-soft: var(--vm-info-soft);
  --hold: var(--vm-hold);
  --focus: var(--vm-focus);
  --radius: var(--vm-radius);
  --radius-sm: var(--vm-radius-sm);
  --shadow: 0 1px 2px rgba(18, 28, 54, .05), 0 1px 1px rgba(18, 28, 54, .03);
  --shadow-lg: 0 12px 32px rgba(18, 28, 54, .16);
  --font: var(--vm-font);
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 256px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--info); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: .01em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: var(--vm-focus-ring); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
[tabindex="-1"]:focus-visible { outline: var(--vm-focus-ring); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; }

/* ---------- Khung ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 16px 20px;
  background: var(--side); color: #fff;
}
.brand { display: flex; align-items: center; gap: .5em; padding: 0 8px; color: #fff; text-decoration: none; font-size: 23px; }
.tray-mark { width: var(--vm-mark-w); height: var(--vm-mark-h); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1em; font-weight: var(--vm-word-weight); letter-spacing: var(--vm-word-track); }
.brand-text small { color: rgba(255, 255, 255, .78); font-size: 11.5px; font-weight: 500; letter-spacing: 0; margin-top: 3px; }
.sidebar :focus-visible { outline-color: #fff; }
.nav-toggle { display: none; }
.nav ol { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 50px; padding: 8px 14px; border-radius: 9px;
  color: #fff; text-decoration: none;
}
.nav-link .i { width: 24px; height: 24px; stroke-width: 1.8; }
.nav-link:hover { background: rgba(255, 255, 255, .1); }
.nav-link.is-current { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-label { font-weight: 500; font-size: 16.5px; }
.nav-link.is-current .nav-label { font-weight: 700; }
.nav-hint { display: none; }
.nav-flag {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: #fff;
}
.nav-flag-warn { color: var(--warn); }
.nav-flag-bad { color: var(--side); }
.nav-flag-info { color: var(--info); }
.nav-flag-muted { color: var(--ink-2); }
.side-foot { margin-top: 6px; display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .28); }
.side-link {
  display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 8px 14px; border-radius: 9px;
  color: #fff; text-decoration: none; font-weight: 500; font-size: 16px;
}
.side-link .i { width: 24px; height: 24px; }
.side-link:hover { background: rgba(255, 255, 255, .1); }
.side-note { margin-top: auto; font-size: 11.5px; color: rgba(255, 255, 255, .7); padding: 0 8px; }
.sidebar .side-foot { flex: 1; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 64px; padding: 10px 28px 10px 36px; flex-wrap: wrap; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.tb-school, .tb-clock { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; }
.tb-school strong, .tb-clock strong { font-weight: 600; }
.tb-school .i, .tb-clock .i { width: 24px; height: 24px; color: var(--ink-2); }
.tb-time { color: var(--muted); font-size: 14px; font-weight: 500; }
.tb-sep { width: 1px; height: 30px; background: var(--line-2); margin: 0 10px; }
.demo-tag {
  padding: 3px 9px; border-radius: 5px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.tb-warn { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 5px; }
.role-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.role-pick select {
  height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6977' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  appearance: none; -webkit-appearance: none; color: var(--ink); font-weight: 600; font-size: 13px;
}
.reset-wrap { position: relative; }
.reset-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px;
}
.reset-title { font-weight: 600; margin-bottom: 8px; }
.reset-menu ul { display: flex; flex-direction: column; gap: 4px; }
.reset-item {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.reset-item:hover { border-color: var(--line-2); background: #fff; }
.reset-note { margin-top: 8px; font-size: 12px; color: var(--muted); }

.main { padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 18px; max-width: 1320px; width: 100%; }
.main:focus { outline: none; }

/* ---------- Nút & nhãn ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: var(--vm-btn-weight); font-size: 14px; line-height: 1.2; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .i { width: 16px; height: 16px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; white-space: normal; }
.btn-primary { background: var(--red) var(--vm-btn-red); color: #fff; box-shadow: var(--vm-btn-shadow); }
.btn-primary:hover { background: var(--red-ink); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-danger { background: var(--hold); color: #fff; }
.btn-danger:hover { background: var(--vm-hold-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link-btn {
  padding: 0; border: 0; background: none; color: var(--info); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--vm-red-line); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #eef1f4; color: var(--ink-2); }
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .03em; white-space: nowrap; border: 1px solid;
}
.tag-seed { color: var(--ink-2); border-color: var(--line-2); background: var(--surface-2); }
.tag-demo { color: var(--info); border-color: #c3d4e6; background: var(--info-soft); }

/* ---------- Bảng & khối ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.panel-tight { padding: 14px 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.panel h2 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; }
.panel .h3, h2.h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.panel-sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.opt { color: var(--muted); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.grid-cases { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.page-head-extra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding-top: 4px; }
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; position: relative; padding-left: 14px; }
.page-head h1::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--red); }
.page-sub { color: var(--muted); margin-top: 6px; max-width: 760px; }

/* ---------- Điều hành ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding-top: 6px; }
.dash-head h1 { font-size: 46px; line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.dash-head .page-sub { margin-top: 8px; font-size: 18px; color: var(--ink-2); }
.btn-lg { min-height: 54px; padding: 10px 22px; font-size: 17px; border-radius: 9px; gap: 12px; }
.btn-lg .i { width: 24px; height: 24px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr 1.05fr; gap: 18px; }
.kpi {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 196px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 26px; box-shadow: var(--shadow);
}
.kpi-icon { width: 52px; height: 52px; stroke-width: 2; margin-bottom: 8px; }
.kpi-icon-red { color: var(--red); }
.kpi-icon-ok { color: var(--ok); }
.kpi-value { font-size: 50px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.kpi-value span { font-size: inherit; color: inherit; font-weight: inherit; }
.kpi-label { color: var(--ink-2); font-size: 18px; font-weight: 500; }
.kpi-note { color: var(--muted); font-size: 13px; }
.kpi-bad { background: #fdeeef; border: 1.5px solid #f0a0a9; }
.kpi-bad .kpi-icon, .kpi-bad .kpi-value { color: var(--red); }
.kpi-bad .kpi-value { font-size: 44px; }
.kpi-bad .kpi-note { color: var(--red-ink); }
.kpi-ok .kpi-icon, .kpi-ok .kpi-value { color: var(--ok); }

.ready {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 8px;
}
.ready-item { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 4px 14px; min-width: 0; }
.ready-item + .ready-item { border-left: 1px solid var(--line-2); }
.ready-icon { width: 40px; height: 40px; stroke-width: 1.6; color: var(--ink); }
.ready-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ready-body strong { font-size: 18px; font-weight: 600; }
.ready-body small { color: var(--muted); font-size: 12.5px; }
.is-done .ready-body small { color: var(--ok); }
.is-current .ready-icon { color: var(--red); }
.is-current .ready-body small { color: var(--red-ink); font-weight: 600; }
.is-blocked .ready-icon, .is-blocked .ready-body small { color: var(--bad); }
.is-todo .ready-icon { color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 20px; align-items: stretch; }
.panel-title { font-size: 30px !important; font-weight: 700 !important; letter-spacing: -.02em !important; margin-bottom: 16px; }
.sites-table { font-size: 16px; border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.sites-table thead th { font-size: 15px; color: var(--ink-2); padding: 14px 18px; background: #f1f3f6; }
.sites-table th, .sites-table td { padding: 16px 18px; }
.sites-table tbody tr:last-child th, .sites-table tbody tr:last-child td { border-bottom: 0; }
.sites-table tbody th { display: flex; align-items: center; gap: 14px; font-size: 19px; font-weight: 700; }
.sites-table tbody th small { font-size: 12px; }
.site-icon { width: 34px; height: 34px; color: var(--red); }
.sites-table .num { text-align: left; }
.sites-table td.num { font-size: 21px; font-weight: 600; }
.sites-table td .badge { font-size: 16px; padding: 7px 16px; font-weight: 700; }
.sites-table td .badge .dot { display: none; }
.frac-sep { margin: 0 .3em; }

.hero { display: flex; flex-direction: column; gap: 16px; }
.next-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, background-color .15s;
}
.next-row:hover { border-color: var(--red); background: #fffafa; }
.next-icon { width: 30px; height: 30px; color: var(--red); }
.next-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.next-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.next-desc { color: var(--muted); font-size: 12.5px; }
.next-chev { width: 20px; height: 20px; color: var(--ink); }
.next-bad .next-icon { color: var(--bad); }
.next-ok .next-icon { color: var(--ok); }
.hero-photo { position: relative; flex: 1; min-height: 170px; margin: 0 22px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption, .pp-photo figcaption {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 5px;
  background: rgba(18, 28, 54, .72); color: #fff; font-size: 12px;
}


.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tbody th { font-weight: 600; }
.table th small, .table td small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .row-adj { background: var(--info-soft); }
.ledger .row-total th, .ledger .row-total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line-2); }

.lot-pending { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.lot-warn { border-left: 3px solid var(--vm-warn-line); }
.lot-bad { border-left: 3px solid var(--red); }
.lot-ok { border-left: 3px solid var(--ok); }
.lot-info { border-left: 3px solid var(--info); }
.lot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lot-code { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 700; font-size: 15px; }
.lot-pending .btn { align-self: flex-start; }

.ev-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ev-chip {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.ev-chip .i { margin-top: 2px; color: var(--muted); width: 16px; height: 16px; }
.ev-chip span { display: flex; flex-direction: column; min-width: 0; }
.ev-chip strong { font-weight: 600; font-size: 13px; }
.ev-chip small { color: var(--muted); font-size: 12px; }

.log { display: flex; flex-direction: column; }
.log-item { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0 8px 12px; border-top: 1px solid var(--line); position: relative; }
.log-item:first-child { border-top: 0; }
.log-item::before { content: ""; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.log-ok::before { background: var(--ok); }
.log-warn::before { background: var(--vm-warn-line); }
.log-bad::before { background: var(--red); }
.log-info::before { background: var(--info); }
.log time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.log-body { display: flex; flex-direction: column; min-width: 0; }
.log-body small { color: var(--muted); font-size: 12px; }

/* ---------- Giao nhận ---------- */
.context-bar, .context-line {
  display: flex; align-items: center; gap: 8px; color: var(--ink-2);
  padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
}
.context-line { background: var(--surface-2); margin-bottom: 4px; font-size: 13px; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: s; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px;
}
.step-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #eef1f4; font-size: 12px; color: var(--ink-2); }
.step-dot .i { width: 14px; height: 14px; stroke-width: 2.4; }
.step.is-done { color: var(--ink); }
.step.is-done .step-dot { background: var(--ok); color: #fff; }
.step.is-current { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -3px 0 var(--red); }
.step.is-current .step-dot { background: var(--ink); color: #fff; }
.step.is-skip { opacity: .65; text-decoration: line-through; text-decoration-color: var(--line-2); }
.step.is-blocked { border-color: var(--vm-red-line); color: var(--bad); background: var(--bad-soft); }
.step.is-blocked .step-dot { background: var(--red); color: #fff; }

.step-panel { border-left: 3px solid var(--line); }
.step-panel.is-current { border-left-color: var(--red); }
.step-panel.is-done { border-left-color: var(--ok); }
.step-panel.is-held { border-left-color: var(--red); background: linear-gradient(0deg, #fff, #fff), var(--bad-soft); }
.step-panel.is-todo { background: var(--surface-2); box-shadow: none; }
.step-panel.is-todo .step-title { color: var(--muted); }
.step-title { margin-bottom: 10px; }
.step-no {
  width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700;
}
.is-todo .step-no { background: var(--line-2); color: var(--ink-2); }
.is-done .step-no { background: var(--ok); }
.done-line { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); }
.done-line .i { color: var(--ok); margin-top: 1px; }

.label-card {
  display: flex; align-items: center; gap: 14px; margin: 12px 0 14px; padding: 12px 14px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); max-width: 460px;
}
.barcode {
  width: 74px; height: 50px; flex: none; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px);
}
.label-body { display: flex; flex-direction: column; line-height: 1.3; }
.label-body small { font-size: 10.5px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.label-body strong { font-size: 19px; }
.label-body span { font-size: 12.5px; color: var(--ink-2); }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .field > label { font-weight: 600; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
input[type="text"], input:not([type]), input[type="number"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6977' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
select:disabled { background-color: var(--surface-2); color: var(--muted); }
.field-inline select { width: auto; flex: 1 1 220px; min-width: 0; max-width: 100%; }
textarea { resize: vertical; min-height: 64px; }
input:hover, select:hover, textarea:hover { border-color: #b8c1cb; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
[aria-invalid="true"] { border-color: var(--bad) !important; background-color: #fffafa; }
input[type="number"] { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; font-size: 15px; }
.form-alt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line); }
.form-alt .hint { margin: 0; }
.form-error {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bad-soft); color: var(--bad); font-weight: 600; border: 1px solid var(--vm-red-line);
}
.form-error .i { margin-top: 1px; }
.form > .btn { align-self: flex-start; }

.count-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-cell { display: flex; flex-direction: column; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); min-height: 78px; }
.diff-cell small { color: var(--muted); font-size: 12px; font-weight: 600; }
.diff-cell strong { font-size: 24px; font-weight: 700; line-height: 1.25; }
.diff-cell em { font-style: normal; font-size: 12px; color: var(--ink-2); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-bad { color: var(--bad); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.why { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.why > legend { float: left; width: 100%; margin-bottom: 0; color: var(--ink-2); }
.why > legend + * { clear: both; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--red); }
.check-strong { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices > legend { grid-column: 1 / -1; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
}
.choice input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.choice span { display: flex; flex-direction: column; gap: 3px; }
.choice small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.choice:hover { border-color: var(--ink-2); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-danger:has(input:checked) { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: var(--bad-soft); }
.choice:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.mini-title { font-weight: 600; font-size: 13px; }
.evidence-review .ev-list { margin-top: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; }
.facts > div { display: flex; flex-direction: column; gap: 1px; }
.facts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.facts dd { font-size: 14px; }
.facts-compact { grid-template-columns: 1fr; gap: 0; }
.facts-compact > div { flex-direction: row; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts-compact dd { text-align: right; }

.status-banner { display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-radius: 12px; border: 1.5px solid; }
.status-banner > .i { width: 40px; height: 40px; flex: none; padding-right: 16px; box-sizing: content-box; border-right: 1px solid currentColor; stroke-width: 1.7; }
.status-banner p { color: var(--ink-2); font-size: 15px; }
.status-banner .status-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.status-warn { background: #fdf3dc; border-color: #e6b04a; }
.status-warn > .i, .status-warn .status-title { color: #9a5a00; }
.status-info { background: var(--info-soft); border-color: #b4cbe2; }
.status-info > .i, .status-info .status-title { color: var(--info); }
.status-ok { background: var(--ok-soft); border-color: #a9d3b9; }
.status-ok > .i, .status-ok .status-title { color: var(--ok); }
.status-hold { background: var(--hold); border-color: var(--hold); }
.status-hold > .i, .status-hold .status-title, .status-hold p { color: #fff; }
@media (max-width: 560px) {
  .status-banner { padding: 12px 14px; gap: 12px; }
  .status-banner > .i { width: 26px; height: 26px; padding-right: 10px; }
  .status-banner .status-title { font-size: 19px; }
  .status-banner p { font-size: 13.5px; }
}
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 6px 0 4px; }
.notice > .i { margin-top: 2px; width: 20px; height: 20px; }
.notice > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.notice .btn { align-self: flex-start; }
.notice .btn-row { margin-top: 2px; }
.notice-info { background: var(--info-soft); border-color: #c8d8e8; }
.notice-info > .i { color: var(--info); }
.notice-warn { background: var(--warn-soft); border-color: #efd8a8; }
.notice-warn > .i { color: var(--warn); }
.notice-bad { background: var(--bad-soft); border-color: var(--vm-red-line); }
.notice-bad > .i { color: var(--bad); }
.notice-ok { background: var(--ok-soft); border-color: #c4e0cf; }
.notice-ok > .i { color: var(--ok); }

/* ---------- Truy xuất ---------- */
.trace-form label { font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chips-inline { align-items: center; }
.chips-label { color: var(--muted); font-size: 12.5px; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); text-align: left;
}
.chip small { color: var(--muted); font-size: 11.5px; }
.chip:hover { border-color: var(--ink-2); }
.chip-sm { padding: 4px 10px; border-radius: 999px; }
/* Gợi ý gần đúng: mỗi mục một thẻ đều nhau, mã luôn nhìn thấy, chữ dài tự xuống dòng. */
.trace-near { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.trace-near li { display: flex; min-width: 0; }
.trace-near .chip { width: 100%; min-height: 48px; justify-content: center; gap: 2px; padding: 9px 14px; }
.trace-near .chip .mono { font-size: 15px; font-weight: 600; color: var(--ink); }
.trace-near .chip small, #trace-result h2 { overflow-wrap: anywhere; }
.trace-near .chip small { font-size: 12.5px; }
#trace-result, [tabindex="-1"] { scroll-margin-top: 84px; }
.trace-head { align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-btn .i { width: 15px; height: 15px; }
.chain { position: relative; display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.chain-node { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding-bottom: 16px; }
.chain-node:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line-2); }
.chain-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.chain-node.is-start .chain-icon { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 0 0 4px var(--red-soft); }
.chain-body { padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.chain-node.is-start .chain-body { border-color: var(--ink-2); }
.chain-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chain-role { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chain-role strong { color: var(--red); }
.chain-title { font-weight: 600; font-size: 15px; margin-top: 2px; }
.chain-line { color: var(--ink-2); font-size: 13.5px; }
.chain-time { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.chain-time .i { width: 14px; height: 14px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-top: 8px; }
.class-grid li { display: flex; flex-direction: column; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); line-height: 1.25; }
.class-grid li span { font-size: 12px; color: var(--muted); }
.class-grid li.is-hit { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }

/* ---------- Công khai ---------- */
.checklist { display: flex; flex-direction: column; margin-bottom: 8px; }
.checklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.check-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.check-mark .i { width: 15px; height: 15px; stroke-width: 2.2; }
.is-ok .check-mark { background: var(--ok-soft); color: var(--ok); }
.is-bad .check-mark { background: var(--bad-soft); color: var(--bad); }
.is-wait .check-mark { background: var(--warn-soft); color: var(--warn); }
.check-body { display: flex; flex-direction: column; }
.check-body small { color: var(--muted); font-size: 12.5px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields-col { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid #c4e0cf; background: var(--ok-soft); }
.fields-private { border-color: var(--line-2); background: var(--surface-2); }
.fields-title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 6px; }
.fields-col li { padding: 3px 0 3px 14px; position: relative; font-size: 13.5px; }
.fields-col li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.pub-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--red); }
.pub-card.is-dim { opacity: .62; border-top-color: var(--line-2); }
.pub-dim-note { font-size: 12px; font-weight: 700; color: var(--warn); }
.pub-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pub-school { font-weight: 700; font-size: 15px; }
.pub-menu li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pub-menu li span { color: var(--muted); font-size: 13px; }
.pub-menu li strong { text-align: right; }
.pub-facts { display: flex; flex-direction: column; gap: 8px; }
.pub-facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.pub-lot { display: block; font-size: 13px; }
.pub-foot { font-size: 12px; color: var(--muted); }

/* ---------- Cổng phụ huynh ---------- */
.parent-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.phone {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(27, 38, 49, .12); display: flex; flex-direction: column;
}
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--red); color: #fff; }
.pp-brand { display: inline-flex; align-items: center; gap: .5em; font-size: 19px; }
.pp-brand strong { font-weight: var(--vm-word-weight); letter-spacing: var(--vm-word-track); }
.pp-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.pp-meta .i { width: 20px; height: 20px; }
.pp-meta .pp-bell { margin-left: 10px; }
.pp-body { padding: 18px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.pp-title { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.pp-title .i { width: 22px; height: 22px; color: var(--red); }
.pp-sub { padding: 0 4px; margin-top: -6px; color: var(--muted); font-size: 15px; }
.pp-photo { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 950 / 510; background: var(--surface-2); margin-top: 4px; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.pp-photo figcaption { left: auto; right: 10px; bottom: 8px; background: none; padding: 0; font-style: italic; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.pp-menu { display: flex; flex-direction: column; gap: 6px; }
.pp-menu li { display: flex; align-items: center; justify-content: flex-start; min-height: 50px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.pp-dish-icon { width: 34px; height: 34px; padding: 0 16px 0 18px; color: var(--red); border-right: 1px solid var(--line-2); margin-right: 18px; box-sizing: content-box; stroke-width: 1.5; }
.pp-menu strong { font-size: 18px; font-weight: 700; }
.pp-source { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 10px; }
.pp-source summary { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 16px; cursor: pointer; list-style: none; font-size: 17px; font-weight: 700; }
.pp-source summary::-webkit-details-marker { display: none; }
.pp-source-icon { width: 26px; height: 26px; color: var(--red); }
.pp-chev { margin-left: auto; width: 20px; height: 20px; transition: transform .15s; }
.pp-source[open] .pp-chev { transform: rotate(180deg); }
.pp-source-body { padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); }
.pp-k { margin-top: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pp-v { font-weight: 600; }
.pp-v small { font-weight: 400; color: var(--ink-2); }
.pp-ok { margin-top: 8px; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.pp-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pp-wait { align-items: center; text-align: center; padding: 36px 22px; color: var(--ink-2); }
.pp-wait .pp-title { font-size: 21px; justify-content: center; text-wrap: balance; }
.pp-wait-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.pp-wait-icon .i { width: 24px; height: 24px; }
.pp-actions { padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pp-actions .btn-lg { font-size: 19px; min-height: 56px; }
.pp-note { font-size: 12px; color: var(--muted); text-align: center; }
.pp-backrow { padding: 12px 18px 0; }
.pp-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.pp-back .i { width: 18px; height: 18px; }
.pp-back:hover { color: var(--red); }
.pp-body .form { padding: 0 4px 12px; }
.pp-receipt { align-items: flex-start; padding: 18px 18px 22px; gap: 12px; }
.pp-receipt .pp-title { padding: 0; }
.pp-receipt-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.pp-receipt-icon .i { width: 24px; height: 24px; }
.pp-code { font-size: 16px; }
.pp-code strong { font-size: 18px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); }
.pp-receipt .pp-note { text-align: left; }
.parent-bar {
  display: none; align-items: center; gap: 10px; padding: 6px 16px; padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background: var(--ink); color: #fff; font-size: 12.5px;
}
.parent-bar a { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.parent-bar a .i { width: 16px; height: 16px; }
.parent-bar a:focus-visible { outline-color: #fff; }

/* Phụ huynh mở trực tiếp (chưa đăng nhập nhà trường): chỉ màn hình phụ huynh, không có khung điều hành. */
body.is-guest .shell, body.is-login .shell { grid-template-columns: minmax(0, 1fr); }
body.is-guest .page-head, body.is-guest .parent-notes { display: none; }
body.is-guest .main { max-width: none; padding: 0 0 40px; gap: 0; }
body.is-guest .parent-bar { display: flex; }
body.is-guest .parent-layout { display: block; width: 100%; max-width: 440px; margin: 28px auto 0; }

/* ---------- Đăng nhập bản demo ---------- */
body.is-login .main { max-width: none; padding: 0; gap: 0; min-height: 100vh; }
.login { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 32px; }
.login-card {
  width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 16px;
  padding: 36px 36px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 44px rgba(18, 28, 54, .08), 0 2px 6px rgba(18, 28, 54, .04);
}
.login-card h1 { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.login-note {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: -4px;
  padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red-ink); font-weight: 600; font-size: 14px;
}
.login-note .i { width: 18px; height: 18px; }
.login-next { font-size: 14px; color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--info-soft); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.role-cards { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.role-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 76px; padding: 12px 16px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.role-card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.role-card:hover { border-color: var(--ink-2); }
.role-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--red); }
.role-ic .i { width: 24px; height: 24px; }
.role-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-txt strong { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.role-txt small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.role-tick { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.role-tick .i { width: 16px; height: 16px; stroke-width: 2.6; }
.role-card:has(input:checked) { border-color: var(--red); background: #fffafa; box-shadow: 0 0 0 1px var(--red) inset; }
.role-card:has(input:checked) .role-ic { background: var(--red); border-color: var(--red); color: #fff; }
.role-card:has(input:checked) .role-tick { background: var(--red); border-color: var(--red); color: #fff; }
.role-card:has(input:focus-visible) { outline: var(--vm-focus-ring); outline-offset: 2px; }
.role-card:has(input[aria-invalid="true"]) { border-color: var(--bad); }
.login-form .form-error { margin: 0; }
.login-alt {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; margin-top: 2px;
  border-top: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.login-alt > .i:first-child { width: 22px; height: 22px; color: var(--red); }
.login-alt > .i:last-child { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
.login-alt span { display: flex; flex-direction: column; }
.login-alt strong { font-weight: 700; }
.login-alt small { font-size: 12.5px; color: var(--muted); }
.login-alt:hover strong { color: var(--red); }
.login-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.login-back .i { width: 18px; height: 18px; }
.login-back:hover { color: var(--red); }
button.side-link { border: 0; background: none; cursor: pointer; text-align: left; font-family: inherit; line-height: inherit; }
.bullets li { position: relative; padding: 4px 0 4px 16px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 6px; height: 2px; background: var(--red); }
.bullets + .btn { margin-top: 10px; }
.integrations { display: flex; flex-direction: column; margin-top: 8px; }
.integrations li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }

/* ---------- Phản ánh ---------- */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.queue-head { align-items: flex-start; }
.clock-box { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.clock-box p { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.clock-box strong { color: var(--ink); font-size: 14px; font-family: var(--mono); }
.clock-box .btn-row { margin-top: 6px; }
.cases { display: flex; flex-direction: column; gap: 10px; }
.case { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.case-new { border-left-color: var(--vm-warn-line); }
.case-progress { border-left-color: var(--info); }
.case-closed { border-left-color: var(--ok); background: var(--surface-2); }
.case:focus-visible { outline-offset: 2px; }
.case-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-id { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.case-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.case-meta { font-size: 12.5px; color: var(--muted); }
.case-text { margin: 2px 0; padding: 8px 12px; border-left: 3px solid var(--line-2); background: var(--surface-2); border-radius: 0 6px 6px 0; color: var(--ink-2); }
.case-controls { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.case-controls > .btn { align-self: flex-start; }
.close-form { gap: 10px; }
p.case-closed { display: flex; gap: 8px; align-items: flex-start; padding-top: 6px; border-top: 1px dashed var(--line); }
p.case-closed .i { color: var(--ok); margin-top: 2px; }
p.case-closed small { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: var(--radius);
  background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { border-left: 4px solid #5cc08a; }
.toast-bad { border-left: 4px solid #ff8a98; }
.toast-info { border-left: 4px solid #8fb5dc; }

/* ---------- Đáp ứng ---------- */
@media (max-width: 1280px) {
  .dash-head h1 { font-size: 40px; }
  .kpi-value { font-size: 42px; }
  .kpi-bad .kpi-value { font-size: 36px; }
  .ready-body strong { font-size: 16px; }
  .ready-icon { width: 32px; height: 32px; }
  .panel-title { font-size: 24px !important; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-photo { margin: 0; aspect-ratio: 16 / 7; flex: none; }
  .ready { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .ready-item:nth-child(3) { border-left: 0; }
  .ready-item { justify-content: flex-start; }
}
@media (max-width: 1020px) {
  .grid-2, .grid-main { grid-template-columns: 1fr; }
  .parent-layout { grid-template-columns: 1fr; }
  .phone { max-width: 420px; width: 100%; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    min-width: 0;
    position: static; height: auto; overflow: visible; gap: 10px;
    padding: 12px 16px 10px;
  }
  .brand { padding: 0; }
  .brand { font-size: 20px; }
  .nav-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 11px;
    border: 1px solid #ffffff70; border-radius: 8px; background: #ffffff12; color: #fff; text-align: left;
    font: inherit; font-weight: 700; cursor: pointer;
  }
  .nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: #ffffff24; }
  .nav-toggle .i { width: 18px; height: 18px; flex: none; }
  .nav-toggle__current { margin-left: auto; min-width: 0; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__chevron { transform: rotate(180deg); }
  .nav-toggle[aria-expanded="false"] + .nav { display: none; }
  .nav ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .nav li { min-width: 0; }
  .nav-link { min-height: 44px; padding: 6px 8px; gap: 7px; border: 1px solid #ffffff50; }
  .nav-label { font-size: 13.5px; overflow-wrap: anywhere; }
  .nav-link .i { width: 18px; height: 18px; flex: none; }
  .nav-flag { min-width: 17px; height: 17px; padding: 0 4px; margin-left: auto; }
  .sidebar .side-foot { flex: none; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; margin-top: 0; }
  .side-link { min-height: 36px; padding: 4px 6px; font-size: 13.5px; gap: 8px; }
  .side-link .i { width: 18px; height: 18px; }
  .side-note { margin-top: 0; font-size: 11px; max-width: 220px; }
  .topbar { position: static; }
  #trace-result, [tabindex="-1"] { scroll-margin-top: 12px; }
  .topbar-inner { padding: 8px 16px; min-height: 0; }
  .tb-school, .tb-clock { font-size: 15px; }
  .tb-school .i, .tb-clock .i { width: 20px; height: 20px; }
  .tb-sep { display: none; }
  .main { padding: 16px 16px 72px; gap: 14px; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Góc nhìn phụ huynh trên điện thoại: ẩn khung điều hành, giữ thanh demo có lối quay lại. */
  body.is-parent .sidebar, body.is-parent .topbar, body.is-parent .page-head, body.is-parent .parent-notes { display: none; }
  body.is-parent .main { padding: 0 0 24px; gap: 0; }
  body.is-parent .phone { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .parent-bar { display: flex; }
  body.is-guest .parent-layout { max-width: none; margin: 0; }
  body.is-guest .main { padding: 0 0 24px; }
  .login { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-panel { justify-content: flex-start; padding: 16px 16px 28px; gap: 10px; }
  .login-card { padding: 22px 18px 18px; border-radius: 14px; gap: 14px; }
  .login-card h1 { font-size: 28px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  /* iOS không tự phóng to khi chữ trong ô nhập >= 16px. */
  input[type="text"], input:not([type]), select, textarea, .input-row input { font-size: 16px; }
  .input-row input, .input-row .btn { min-height: 48px; }
  .trace-near, #trace-result .chips { display: grid; grid-template-columns: minmax(0, 1fr); }
  #trace-result .chips .chip { width: 100%; min-height: 48px; justify-content: center; }
  .chips-inline .chip-sm { min-height: 44px; justify-content: center; }
  #trace-result .notice { padding: 12px; gap: 10px; }
  .trace-head .seg { width: 100%; }
  .trace-head .seg-btn { flex: 1; justify-content: center; min-height: 44px; }
  .pp-head { padding: 12px 14px; }
  .pp-brand { white-space: nowrap; font-size: 17px; gap: 8px; }
  .pp-meta { gap: 6px; font-size: 13px; white-space: nowrap; }
  .pp-meta .pp-bell { margin-left: 4px; }
  .dash-head h1 { font-size: 30px; }
  .dash-head .page-sub { font-size: 14.5px; margin-top: 4px; }
  .dash-head .btn-lg { width: 100%; min-height: 48px; font-size: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { min-height: 0; padding: 12px 14px; }
  .kpi-bad, .kpi-ok { grid-column: 1 / -1; }
  .kpi-icon { width: 30px; height: 30px; margin-bottom: 4px; }
  .kpi-value, .kpi-bad .kpi-value { font-size: 27px; }
  .kpi-label { font-size: 14px; }
  .kpi-note { font-size: 12px; }
  .ready { padding: 10px 4px; }
  .ready-item { gap: 8px; padding: 4px 10px; }
  .ready-icon { width: 26px; height: 26px; }
  .ready-body strong { font-size: 14.5px; }
  .panel-title { font-size: 20px !important; margin-bottom: 12px; }
  .sites-table, .sites-table thead th { font-size: 12.5px; }
  .sites-table th, .sites-table td, .sites-table thead th { padding: 10px 8px; }
  .sites-table tbody th { font-size: 15px; gap: 8px; }
  .site-icon { display: none; }
  .sites-table tbody th { white-space: nowrap; }
  .sites-table tbody th small { display: none; }
  .sites-table td.num { font-size: 15px; white-space: nowrap; }
  .sites-table td .badge { font-size: 12.5px; padding: 4px 9px; white-space: normal; }
  .next-title { font-size: 16px; }
  .page-head h1 { font-size: 22px; }
  .panel { padding: 14px; }
  .count-grid, .choices, .fields, .row-2 { grid-template-columns: 1fr; }
  .input-row { flex-direction: column; }
  .input-row .btn { width: 100%; }
  .checklist li { grid-template-columns: 28px minmax(0, 1fr); }
  .check-state { grid-column: 2; }
  .log-item { grid-template-columns: 1fr; gap: 2px; }
  .log-item .tag { justify-self: start; }
  .role-pick-label { display: none; }
  .role-pick select { max-width: 190px; }
  .tb-time { display: none; }
  .topbar-inner { gap: 8px; }
  .reset-menu { position: fixed; left: 16px; right: 16px; top: auto; width: auto; margin-top: 6px; }
  .side-note { display: none; }
  /* Đăng xuất nằm cùng hàng với tên VMeal để không tốn thêm một hàng. */
  .sidebar { position: relative; }
  .sidebar .side-foot { position: absolute; top: 8px; right: 12px; padding: 0; border: 0; }
  .side-link { min-height: 40px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .35); }
  .facts { grid-template-columns: 1fr; }
  .integrations li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .btn { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .toast { display: none; }
  .shell { display: block; }
}

/* Luồng bếp và hồ sơ sự cố */
.pilot-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pilot-step { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pilot-step__head { display: flex; gap: 10px; align-items: flex-start; }
.pilot-step__head .step-num {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  color: var(--red-ink); background: var(--red-soft); border-radius: 50%; font-weight: 700;
}
.pilot-step h2 { font-size: 17px; line-height: 1.3; margin: 1px 0 5px; }
.pilot-step__head p { color: var(--muted); font-size: 13px; }
.pilot-step > .form { margin-top: auto; }
.pilot-step > .form .btn { align-self: flex-start; }
.pilot-step > .form .check { align-items: flex-start; }
.pilot-photo { min-width: 0; }
.pilot-photo img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.pilot-photo figcaption { color: var(--muted); font-size: 11px; margin-top: 5px; }
.pilot-record {
  display: flex; gap: 8px; align-items: flex-start; color: var(--ok); font-size: 13px;
  padding: 10px; background: var(--ok-soft); border-radius: var(--radius-sm);
}
.pilot-record small { color: var(--ink-2); }
.pilot-sample-list { display: grid; margin-bottom: 12px; border-top: 1px solid var(--line); }
.pilot-sample-list li {
  display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.pilot-sample-list .mono { color: var(--muted); }
.pilot-sample-list ~ .form { max-width: 440px; margin-top: 12px; }
.preview-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pilot-photo--parent { margin: 12px 0; }
.pp-source-body > .pilot-photo { margin-bottom: 12px; }
.pilot-invoice { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pilot-invoice summary { cursor: pointer; min-height: 44px; padding: 10px; font-weight: 600; }
.pilot-invoice > .pub-facts { padding: 0 10px 10px; }
.incident-history { display: grid; gap: 14px; }
.incident-history li { display: grid; gap: 3px; padding: 0 0 14px 13px; border-left: 2px solid var(--line-2); }
.incident-history li:last-child { padding-bottom: 0; }
.incident-history time, .incident-history small { color: var(--muted); font-size: 12px; }
.incident-history p { overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 950px) {
  .pilot-steps { grid-template-columns: 1fr; }
  .pilot-step .pilot-photo img { aspect-ratio: 16 / 9; }
}

/* Phiếu nguyên liệu và bản in */
.parent-example-label {
  margin: 12px 14px 0; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ok); background: var(--ok-soft); font-size: 13px; font-weight: 700;
}
.intake-row {
  display: grid; gap: 10px; min-inline-size: 0; padding: 12px 14px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.intake-row legend { padding: 0 5px; font-size: 16px; font-weight: 700; }
.intake-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.intake-fields input, .intake-fields select { min-width: 0; }
.intake-photo { max-width: 200px; margin: 0; }
.intake-photo img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.intake-photo figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.intake-summary { display: grid; gap: 8px; }
.intake-summary__row {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(90px,155px);
  gap: 10px 16px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line);
}
.intake-summary__row h3 { margin-bottom: 4px; }
.intake-summary__row p + p { margin-top: 5px; }
.intake-note { overflow-wrap: anywhere; }
.intake-approval { margin-top: 14px; }
.intake-signoff { margin-top: 7px; }
.intake-document-note { margin-top: 14px; font-size: 12px; color: var(--muted); }
.intake-watch h3 { margin-top: 14px; }
.intake-watch summary { cursor: pointer; margin: 8px 0; }
.intake-watch .btn-ghost { margin-top: 8px; }
.intake-expiry li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.intake-expiry small { color: var(--muted); }
@media print {
  @page { margin: 14mm; }
  body.printing-receipt-view { background: #fff; }
  body.printing-receipt-view .skip-link,
  body.printing-receipt-view #main > :not(.receipt-document),
  body.printing-receipt-view .intake-print-action { display: none !important; }
  body.printing-receipt-view .main { display: block; padding: 0; }
  body.printing-receipt-view .receipt-document { border: 0; padding: 0; box-shadow: none; }
  body.printing-receipt-view .intake-summary__row { break-inside: avoid; grid-template-columns: minmax(0,1fr) 120px; }
}

/* Shared public sign-in frame */
body.is-login .main { background: #fff; }
.reference-login-frame { width: calc(100% - 48px); max-width: 1160px; margin-inline: auto; }
.reference-login-header { border-bottom: 1px solid var(--line); background: #fff; }
.reference-login-header .reference-login-frame,
.reference-login-footer .reference-login-frame { display: flex; align-items: center; justify-content: space-between; gap: 16px 26px; padding-block: 14px; }
.reference-login-brand,
.reference-login-brand > span:last-child { display: inline-flex; align-items: center; gap: 8px; }
.reference-login-brand { flex-shrink: 0; gap: 13px; color: var(--ink); font-size: 16px; font-weight: 800; text-decoration: none; }
.reference-login-brand .i, .reference-login-brand svg { width: 28px; height: 26px; color: var(--red); }
.reference-login-brand .reference-login-partner { font-size: 29px; letter-spacing: -.08em; line-height: 1; color: var(--red); }
.reference-login-separator { width: 1px; height: 24px; background: var(--line-2); }
.reference-login-header nav { display: flex; align-items: center; gap: clamp(13px, 3vw, 42px); font-weight: 700; }
.reference-login-header nav a { padding: 11px 0; text-decoration: none; }
.reference-login-header nav a:hover { color: var(--red); }
.reference-login-current { white-space: nowrap; }
.reference-login-current .signin-short { display: none; }
.reference-login.reference-login-frame {
  align-items: center; min-height: 0; flex: 1 0 auto; padding-block: clamp(28px, 6vh, 80px);
  grid-template-columns: minmax(0, 53fr) minmax(0, 47fr); gap: clamp(18px, 3vw, 44px);
}
.reference-login-visual { overflow: hidden; border-radius: 18px; min-height: 458px; align-self: stretch; position: relative; }
.reference-login-visual img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 47% 50%; }
.reference-login .login-panel { padding: 0; gap: 10px; }
.reference-login .login-card { max-width: none; padding: clamp(18px, 3vw, 38px); box-shadow: 0 4px 15px rgba(20,32,56,.06); }
.reference-login .login-back { color: var(--red-ink); text-decoration: underline; text-underline-offset: 3px; }
.reference-login-footer { background: #081c3d; color: #fff; }
.reference-login-footer a, .reference-login-footer .reference-login-partner { color: #fff; }
.reference-login-footer a { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.reference-login-footer .reference-login-brand { gap: 13px; }
.reference-login-footer a[href^="tel:"] strong { color: #ff737b; }
@media (max-width: 760px) {
  .reference-login-header .reference-login-frame, .reference-login-footer .reference-login-frame { flex-wrap: wrap; }
  .reference-login-header nav { order: 2; width: 100%; justify-content: space-between; gap: 10px; }
  .reference-login-header nav a { flex: 1; text-align: center; }
  .reference-login.reference-login-frame { grid-template-columns: minmax(0, 1fr); padding-block: 24px; }
  .reference-login-visual { order: 2; min-height: 0; aspect-ratio: 16 / 8; border-radius: 12px; }
}
@media (max-width: 460px) {
  .reference-login-frame { width: calc(100% - 28px); }
  .reference-login-header .reference-login-frame, .reference-login-footer .reference-login-frame { gap: 8px; }
  .reference-login-brand { gap: 7px; font-size: 13px; }
  .reference-login-brand > span:last-child { gap: 4px; }
  .reference-login-brand .reference-login-partner { font-size: 22px; }
  .reference-login-brand svg { width: 21px; height: 21px; }
  .reference-login-current { gap: 5px; padding-inline: 7px; font-size: 12px; }
  .reference-login-current .i { width: 14px; height: 14px; }
  .reference-login-current .signin-full { display: none; }
  .reference-login-current .signin-short { display: inline; }
  .reference-login-footer a { font-size: 13px; }
}

.source-qr { margin-top: 8px; }
.source-qr summary { cursor: pointer; font-weight: 650; }
.source-qr img { display: block; width: 132px; height: auto; margin-block: 8px; background: #fff; }
.intake-choices { margin-top: 12px; }

.meal-entry {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 13px 16px; color: var(--ink); background: var(--surface); text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius);
}
.meal-entry:hover { border-color: var(--red); }
.meal-entry__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--red-soft); color: var(--red); }
.meal-entry small { display: block; margin-top: 2px; color: var(--muted); }
.meal-entry > .i { color: var(--red); }
.meal-progress {
  display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1px; list-style: none;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.meal-progress li {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 12px;
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600;
}
.meal-progress li.is-current { color: var(--red-ink); background: var(--red-soft); }
.meal-progress li.is-done { color: var(--ok); }
.meal-progress__mark {
  display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%;
  color: inherit; background: var(--surface-2); border: 1px solid currentColor;
}
.meal-progress__mark .i { width: 16px; height: 16px; }
.meal-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(245px,1fr); gap: 16px; align-items: start; }
.meal-work { border-top: 3px solid var(--red); }
.meal-work > h2 { margin-bottom: 7px; font-size: clamp(23px, 3vw, 32px); line-height: 1.2; font-weight: 750; letter-spacing: -.025em; }
.meal-role { margin-bottom: 5px; color: var(--red-ink); font-size: 13px; font-weight: 700; }
.meal-description { color: var(--ink-2); margin-bottom: 17px; max-width: 59ch; }
.meal-work .meal-form { gap: 13px; }
.meal-docs { margin: 0; }
.meal-docs div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.meal-docs dt { color: var(--muted); font-size: 13px; }
.meal-docs dd { margin: 2px 0 0; font-weight: 650; }
.meal-record h2 .i { color: var(--red); }
.meal-record .meal-docs small { color: var(--muted); }
.meal-record .meal-docs div:last-child { border-bottom: 0; padding-bottom: 0; }
.meal-classes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.meal-classes:has(.field:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0,1fr)); }
.meal-total, .meal-parent__receipt {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.meal-total strong { white-space: nowrap; }
.meal-work .meal-confirm, .meal-inline-note {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.meal-handoff-checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px 10px; margin: 0; min-width: 0; }
.meal-handoff-checks legend { font-weight: 700; padding-inline: 4px; }
.meal-discrepancy, .meal-reset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.meal-discrepancy summary, .meal-reset summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.meal-discrepancy[open] summary, .meal-reset[open] summary, .meal-reset p { margin-bottom: 8px; }
.meal-reset { margin-top: 14px; }
.meal-evidence-photo { width: min(100%, 280px); }
.meal-publish-preview { display: grid; grid-template-columns: minmax(100px, 155px) minmax(0, 1fr); align-items: center; gap: 12px; }
.meal-publish-preview p { margin-top: 4px; }
.meal-share label { display: block; margin-bottom: 5px; font-weight: 700; }
.meal-share input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; }
#meal-share-feedback { margin-top: 6px; }
.meal-parent { width: min(100% - 28px, 480px); margin: 20px auto 0; }
.meal-parent__home { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
.meal-parent__home .i { width: 18px; height: 18px; color: var(--red); }
.meal-parent__receipt { background: var(--ok-soft); color: var(--ok); }
.meal-parent__receipt span { display: inline-flex; align-items: center; gap: 7px; }
.meal-parent__receipt .i { width: 18px; height: 18px; flex-shrink: 0; }
.meal-parent__receipt strong { white-space: nowrap; }
.meal-parent .pp-bell { display: none; }
.meal-parent__foot { padding: 0 4px 12px; }
@media (max-width: 960px) {
  .meal-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .meal-progress li { font-size: 11px; line-height: 1.2; flex-direction: column; padding: 8px 3px; gap: 4px; text-align: center; }
  .meal-progress__mark { flex: none; width: 25px; height: 25px; }
  .meal-work .btn { min-height: 44px; }
  .meal-entry { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; padding-inline: 10px; }
  .meal-entry__icon { width: 34px; height: 34px; }
  .meal-share .btn-row > * { width: 100%; }
}


.scenario-label { margin-top: 3px; color: var(--red-ink); font-weight: 700; font-size: 13px; }
.workflow-banner { flex-wrap: wrap; }
.workflow-banner__body { flex: 1; min-width: min(100%, 175px); }
.workflow-banner__action { margin-left: auto; }
#publish-next .notice { margin: 0; }
.preview-panel form { margin-top: 14px; }
.preview-panel form button { align-self: flex-start; }
@media (min-width: 861px) {
  #step-1-title, #step-2-title, #step-3-title, #step-4-title, #preview-title, #publish-next { scroll-margin-top: 84px; }
}
@media (max-width: 560px) {
  .workflow-banner { display: grid; grid-template-columns: auto minmax(0,1fr); }
  .workflow-banner__body { min-width: 0; }
  .workflow-banner__action { grid-column: 2; margin: 0; }
  .workflow-banner__action .btn, #publish-next .btn { min-height: 44px; max-width: 100%; white-space: normal; }
}

.account-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
  font-weight: 650; font-size: 13px;
}
.account-badge .i { width: 17px; height: 17px; flex: none; color: var(--red); }
.reference-login.reference-account {
  padding: 0; margin-block: 23px; gap: 0; grid-template-columns: repeat(2,minmax(0,1fr));
  border: 1px solid var(--line); border-radius: 15px; overflow: hidden;
}
.reference-account .reference-login-visual { border-radius: 0; min-height: 510px; }
.reference-account .login-panel { padding: clamp(18px,4vw,46px); }
.reference-account .login-card {
  max-width: 420px; padding: 0; gap: 19px; border: none; border-radius: 0; box-shadow: none;
}
.reference-account .login-card h1 { text-align: center; font-size: clamp(25px,3vw,40px); }
.account-login-form .field label { font-weight: 700; }
.account-login-form input { width: 100%; min-width: 0; min-height: 47px; font-size: 16px; }
.account-password { position: relative; }
.account-password input { padding: 8px 49px 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.account-password__toggle {
  display: grid; place-items: center; position: absolute; right: 2px; top: 2px;
  width: 43px; height: 43px; border: none; background: transparent; color: var(--ink); cursor: pointer;
}
.account-password__toggle .i { width: 22px; height: 22px; }
.account-login-form #login-submit:disabled { opacity: .66; cursor: wait; }
.reference-account .login-alt { padding-inline: 0; margin-top: -3px; }
@media (max-width: 760px) {
  .reference-login.reference-account { grid-template-columns: minmax(0,1fr); margin-block: 17px; }
  .reference-account .reference-login-visual { min-height: 0; }
  .reference-account .login-panel { padding: 24px 15px 15px; gap: 4px; }
}

.school-meal { max-width: 760px; border-top: 3px solid var(--red); }
.school-meal h2 { margin-bottom: 9px; font-size: 20px; }
.school-meal > p:not(:empty) { margin-bottom: 10px; }
.school-status:not(:empty) { color: var(--ink-2); font-weight: 650; }
.school-meal-form { margin-top: 15px; }
.school-meal-form .school-count input { width: 100%; min-height: 44px; }
.school-meal-form > .school-count { max-width: 300px; }
.school-meal-counts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.school-meal-counts > div { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.school-meal-counts dt { color: var(--muted); font-size: 13px; }
.school-meal-counts dd { margin: 3px 0 0; font-weight: 700; }
.school-meal-counts dd small { display: block; font-weight: 500; }
.school-handoff-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
@media (max-width: 460px) {
  .school-handoff-fields { grid-template-columns: minmax(0,1fr); }
  .school-meal-form .btn { min-height: 44px; }
}
@media (max-width: 860px) {
  body.is-school-meal .shell { align-content: start; }
  .nav--single { display: none; }
}
