/* HM brand theme — beige / near-black / tan / teal. Headings Frutiger LT Arabic 75 Black, body 55 Roman. */
:root {
  --bg: #F5EDE3;
  --ink: #1D1B17;
  --tan: #D4B38B;
  --teal: #84C6B2;
  --good: #2B8A74;
  --bad: #C2564A;
  --card: #FBF7F1;
  --line: #E4D6C2;
  --muted: #6F675B;
  --radius: 14px;
  --font: "Frutiger LT Arabic", "Frutiger", "Segoe UI", "Helvetica Neue", Arial, Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); }
h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 32px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 34px; display: block; }
.brand b { font-weight: 900; font-size: 15px; line-height: 1.1; }
.brand i { display: block; width: 28px; height: 4px; background: var(--tan); border-radius: 2px; margin-top: 4px; }
.nav { display: flex; gap: 4px; margin: 0; flex: 1 1 100%; order: 3; justify-content: center; overflow-x: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: rgba(212,179,139,.3); }
.nav a.on { background: var(--ink); color: var(--bg); }
.who { font-size: 13px; text-align: right; line-height: 1.2; white-space: nowrap; }
.who b { display: block; font-weight: 900; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.tan-bar { width: 44px; height: 5px; background: var(--tan); border-radius: 3px; margin: 10px 0 0; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .v { font-size: 34px; font-weight: 900; line-height: 1; }
.kpi .l { margin-top: 6px; font-size: 13px; color: var(--muted); }
.kpi.tealk { background: var(--teal); border-color: var(--teal); } .kpi.tealk .l { color: var(--ink); opacity: .75; }
.kpi.tank { background: var(--tan); border-color: var(--tan); } .kpi.tank .l { color: var(--ink); opacity: .75; }

/* controls */
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: var(--ink); color: var(--bg); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: transform .05s, opacity .15s; }
.btn:hover { opacity: .88; } .btn:active { transform: translateY(1px); }
.btn.teal { background: var(--teal); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.icon { border: 0; background: transparent; cursor: pointer; padding: 4px 7px; border-radius: 8px; font-size: 15px; line-height: 1; }
.icon:hover { background: rgba(212,179,139,.35); }
.icon.del:hover { background: rgba(194,86,74,.15); color: var(--bad); }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--good); box-shadow: 0 0 0 3px rgba(132,198,178,.45); }
textarea { resize: vertical; min-height: 64px; }
.field + .field { margin-top: 12px; }
.err { background: rgba(194,86,74,.12); color: #8d3329; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; }
.ok { background: rgba(43,138,116,.13); color: #1e6453; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 900; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--tan); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(212,179,139,.18); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }

/* chips + bars */
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: var(--line); }
.chip.good { background: rgba(43,138,116,.16); color: var(--good); }
.chip.bad { background: rgba(194,86,74,.16); color: var(--bad); }
.chip.warn { background: rgba(212,179,139,.45); }
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--good); border-radius: 6px; transition: width .25s; }
.bar.warn > i { background: var(--tan); } .bar.bad > i { background: var(--bad); }
.pct { font-weight: 900; } .pct.good { color: var(--good); } .pct.bad { color: var(--bad); } .pct.warn { color: #9a7440; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { height: 54px; display: block; margin-bottom: 8px; }
.login-card h1 { font-size: 28px; }

/* position picker */
.pos-card { text-align: left; cursor: pointer; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px; display: block; width: 100%; }
.pos-card:hover { border-color: var(--ink); }
.pos-card.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pos-card b { font-weight: 900; font-size: 18px; display: block; }
.pos-card span { font-size: 13px; opacity: .75; }

/* evaluation form */
.evbar { position: sticky; top: 56px; z-index: 15; background: var(--bg); padding: 10px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.evbar .prog { margin-top: 8px; }
.sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.sec-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none; }
.sec-h .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--tan); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.sec.done .num { background: var(--good); color: #fff; }
.sec-h h3 { flex: 1; }
.sec-h .caret { transition: transform .15s; } .sec.open .caret { transform: rotate(90deg); }
.sec-b { display: none; border-top: 1px solid var(--line); padding: 6px 16px 14px; }
.sec.open .sec-b { display: block; }
.sec.na { opacity: .6; }
.sec-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0; align-items: center; }
.colhead, .q { display: grid; grid-template-columns: 1fr 150px 150px; gap: 12px; align-items: center; }
.colhead { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 0; }
.q { padding: 10px 0; border-top: 1px solid var(--line); }
.q .t { display: flex; gap: 10px; } .q .t .n { color: var(--muted); font-weight: 700; min-width: 20px; }
.q .t span:last-child { unicode-bidi: plaintext; }
.heading { font-weight: 900; margin: 14px 0 2px; padding-top: 6px; border-top: 2px solid var(--tan); }
.note { font-size: 14px; color: var(--muted); background: rgba(212,179,139,.2); border-radius: 8px; padding: 6px 10px; margin: 8px 0; unicode-bidi: plaintext; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 0; width: 64px; cursor: pointer; font-weight: 700; font-size: 14px; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button.y.on { background: var(--good); color: #fff; }
.seg button.n.on { background: var(--bad); color: #fff; }
.seg.missing { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(194,86,74,.18); }
.mlabel { display: none; font-size: 12px; color: var(--muted); font-weight: 700; }
@media (max-width: 700px) {
  .colhead { display: none; }
  .q { grid-template-columns: 1fr 1fr; }
  .q .t { grid-column: 1 / -1; }
  .mlabel { display: block; margin-bottom: 3px; }
  .seg button { width: 54px; }
  .brand b { display: none; }
  .nav { margin-left: 0; }
}
.savestate { font-size: 13px; color: var(--muted); }

/* result */
.score-ring { font-size: 56px; font-weight: 900; line-height: 1; }
.secrow { display: grid; grid-template-columns: minmax(120px, 1.2fr) 3fr 70px; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.secrow:first-child { border-top: 0; }
.gap-list { margin: 8px 0 0; padding-left: 20px; } .gap-list li { margin: 4px 0; unicode-bidi: plaintext; }

/* admin question editor */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.qe-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.qe-sec > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: rgba(212,179,139,.28); border-radius: var(--radius) var(--radius) 0 0; }
.qe-sec > header h3 { flex: 1; }
.qe-item { display: flex; gap: 8px; align-items: flex-start; padding: 9px 14px; border-top: 1px solid var(--line); }
.qe-item .txt { flex: 1; unicode-bidi: plaintext; }
.qe-item.heading-k .txt { font-weight: 900; } .qe-item.note-k .txt { color: var(--muted); font-style: italic; }
.qe-item textarea { min-height: 54px; }
.qe-add { padding: 12px 14px; border-top: 1px dashed var(--tan); display: flex; gap: 8px; flex-wrap: wrap; }
.qe-add input { flex: 1; min-width: 200px; } .qe-add select { width: 130px; }
.kind { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--line); }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; background: rgba(29,27,23,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 18px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 10px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.drop { border: 2px dashed var(--tan); border-radius: var(--radius); padding: 26px; text-align: center; background: rgba(212,179,139,.12); cursor: pointer; }
.drop.over { background: rgba(132,198,178,.3); border-color: var(--good); }

@media print {
  .top, .no-print, #toast { display: none !important; }
  body { background: #fff; } .card, .sec { break-inside: avoid; }
  .sec .sec-b { display: block !important; }
}

/* polish */
.card > h2 { margin-bottom: 8px; }
.grid + .card, .grid + .grid { margin-top: 16px; }
@media (max-width: 700px) {
  .top-in { flex-wrap: wrap; row-gap: 6px; }
  .brand { order: 1; } .who { order: 2; margin-left: auto; }
  .nav { order: 3; flex: 1 1 100%; margin: 0; }
  .evbar { top: 92px; }
  h1 { font-size: 26px; }
  .secrow { grid-template-columns: 1fr 60px; } .secrow .bar { grid-column: 1 / -1; grid-row: 2; }
}
.pwcell { border: 0; background: rgba(132,198,178,.35); border-radius: 8px; padding: 3px 10px; font: inherit; letter-spacing: .06em; cursor: pointer; }
.pwcell:hover { background: var(--teal); }
tr.off td { opacity: .55; }

/* sortable grids */
.gridbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.flt, .flt-search { width: auto; padding: 7px 10px; font-size: 14px; border-radius: 999px; background: #fff; }
.flt-search { min-width: 190px; }
.flt.on { border-color: var(--good); background: rgba(132,198,178,.25); font-weight: 700; }
.thbtn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.thbtn:hover { color: var(--ink); }
th[aria-sort=ascending], th[aria-sort=descending] { color: var(--ink); }
table.dtable thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
@media (max-width: 700px) { .flt, .flt-search { flex: 1 1 140px; } }
input.flt-search { width: auto; min-width: 220px; }
.btn { white-space: nowrap; }
table.dtable thead th { border-bottom: 0; box-shadow: inset 0 -2px 0 var(--tan); }
td input[type=text] { padding: 6px 8px; }

/* ===== Motion & touch polish =====
   Rules of thumb: UI feedback under 200 ms, ease-out for things entering, transform/opacity only,
   press feedback on every tappable thing, hover effects only on real pointers, nothing animates for keyboard-heavy use. */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); }
button, a, input, select, textarea, .sec-h, .pos-card, .tab { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html { overscroll-behavior-y: none; }
main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.pct, .kpi .v, .score-ring, td, .savestate { font-variant-numeric: tabular-nums; }
h1, h2 { text-wrap: balance; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* press feedback */
.btn, .tab, .pos-card, .seg button, .icon { transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), color 140ms var(--ease-out), opacity 140ms var(--ease-out), box-shadow 140ms var(--ease-out); }
.btn:active, .tab:active, .pos-card:active, .icon:active { transform: scale(.97); }
.seg button { transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out); }
.seg button:active { background: rgba(212,179,139,.35); }
.btn:hover { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { opacity: .88; }
  .nav a:hover, .icon:hover, tr.click:hover td { transition: background-color 120ms var(--ease-out); }
}
@media (hover: none) { .nav a:hover { background: none; } .nav a.on:hover { background: var(--ink); } tr.click:hover td { background: none; } .icon:hover, .icon.del:hover { background: transparent; color: inherit; } }

/* progress + caret */
.bar > i { transition: width 220ms var(--ease-out), transform 220ms var(--ease-out); }
.bar > i.scalebar { transform-origin: left center; will-change: transform; }
.sec-h .caret { transition: transform 160ms var(--ease-out); }

/* long forms: skip layout/paint for rows that are off-screen */
.q { content-visibility: auto; contain-intrinsic-size: auto 76px; }
.sec { contain: layout style; }

/* page + dialog entrances (opacity/transform only) */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes fade { from { opacity: 0; } }
#app > * { animation: rise 200ms var(--ease-out); }
.modal-bg { animation: fade 150ms var(--ease-out); }
.modal { animation: pop 180ms var(--ease-out); transform-origin: center; }
#toast { transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }

/* thin loading bar when a screen takes more than ~150 ms */
@keyframes loadbar { from { transform: scaleX(.04); } to { transform: scaleX(.92); } }
body.loading::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--teal); transform-origin: left; animation: loadbar 1.6s var(--ease-out) forwards; z-index: 100; }

/* bigger targets + no iOS zoom on touch screens */
@media (pointer: coarse) {
  .seg button { width: 72px; padding: 11px 0; }
  .btn.sm { padding: 9px 14px; }
  .icon { padding: 9px 11px; }
  .nav a { padding: 11px 14px; }
  .sec-h { padding: 16px; }
  input, select, textarea, .flt, .flt-search, input.flt-search { font-size: 16px; }
}
@media (max-width: 700px) {
  .q { padding: 12px 0; }
  .evbar { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ===== Backdrop: brand glows + dot texture + ½M watermark (static, GPU-composited, no animation) ===== */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(900px 520px at 6% -8%, rgba(132,198,178,.50), transparent 62%),
    radial-gradient(820px 620px at 104% 4%, rgba(212,179,139,.55), transparent 58%),
    radial-gradient(760px 520px at 50% 112%, rgba(132,198,178,.30), transparent 62%),
    radial-gradient(520px 380px at 92% 78%, rgba(212,179,139,.22), transparent 60%),
    linear-gradient(180deg, #F8F1E8 0%, #F5EDE3 55%, #F1E6D8 100%); }
.bg::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(rgba(29,27,23,.10) 1px, transparent 1.4px) 0 0 / 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.55) 38%, transparent 78%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.55) 38%, transparent 78%); }
.bg-mark { position: absolute; right: 3vw; bottom: 4vh; width: min(30vw, 380px); aspect-ratio: 772 / 350;
  background: url(/logo.png) center / contain no-repeat; opacity: .05; }
@media (max-width: 700px) { .bg-mark { width: 56vw; right: 6vw; bottom: 3vh; opacity: .045; } }

/* glass header + sticky evaluation bar so the backdrop shows through */
.top { background: rgba(245,237,227,.80); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 0; box-shadow: 0 1px 0 rgba(212,179,139,.55), 0 10px 24px -18px rgba(29,27,23,.35); }
.evbar { background: rgba(245,237,227,.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 0; box-shadow: 0 1px 0 rgba(212,179,139,.5); padding-left: 2px; padding-right: 2px; }

/* cards with a little lift */
.card, .sec, .qe-sec, .kpi, .pos-card { background: rgba(251,247,241,.94); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 12px 28px -18px rgba(29,27,23,.28); }
.kpi.tealk { background: linear-gradient(135deg, #84C6B2 0%, #9DD3C2 100%); }
.kpi.tank { background: linear-gradient(135deg, #D4B38B 0%, #E1C8A4 100%); }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.28); }
.kpi > * { position: relative; z-index: 1; }
.page-head h1 { background: linear-gradient(90deg, var(--ink) 60%, #4b463c); -webkit-background-clip: text; background-clip: text; }
.tan-bar { width: 56px; height: 6px; background: linear-gradient(90deg, var(--tan), var(--teal)); }
.pos-card.on { background: linear-gradient(135deg, #1D1B17, #34302a); }
.tab.on { background: linear-gradient(135deg, #1D1B17, #34302a); }

/* sign-in screen: brand shapes behind the card */
.login { position: relative; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login::before { width: min(60vw, 520px); aspect-ratio: 1; left: -12vw; top: -14vh; background: radial-gradient(circle at 35% 35%, rgba(132,198,178,.75), rgba(132,198,178,0) 70%); }
.login::after { width: min(56vw, 480px); aspect-ratio: 1; right: -10vw; bottom: -12vh; background: radial-gradient(circle at 60% 60%, rgba(212,179,139,.80), rgba(212,179,139,0) 70%); }
.login-card { position: relative; z-index: 1; padding: 28px; box-shadow: 0 30px 60px -30px rgba(29,27,23,.45), 0 1px 0 rgba(255,255,255,.9) inset; border-radius: 22px; }
.login-card .logo { height: 64px; }

@media print { .bg { display: none; } body { background: #fff; } }

/* ===== Liquid navbar (React island) in HM colours ===== */
.top-in { flex-wrap: wrap; row-gap: 6px; }
.who { margin-left: auto; }
.nav-host { display: none; order: 3; flex: 1 1 100%; margin: 0; justify-content: center; min-width: 0; }
body.nav-live .nav-host { display: flex; }
body.nav-live .top .nav { display: none; }
.top .nimbus-nav { --n-tint: rgba(255,255,255,.38); --n-fg: #1D1B17; --n-fg-soft: rgba(29,27,23,.62); --n-rim: rgba(255,255,255,.95); }
.top .nimbus-item { font-weight: 700; }
@media print { .nav-host { display: none !important; } }

/* long section names must wrap inside their column instead of running under the bar */
.secrow { grid-template-columns: minmax(140px, 1.5fr) 2fr 64px; }
.secrow > * { min-width: 0; }
.secrow b, .secrow .small { overflow-wrap: anywhere; }
@media (max-width: 700px) { .secrow { grid-template-columns: 1fr 64px; } }

/* ===== trainer / visit screens ===== */
.pick-search { font-size: 17px; padding: 14px 16px; border-radius: 14px; }
.pick-list { margin-top: 12px; display: grid; gap: 8px; max-height: 62vh; overflow: auto; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.pick:hover { border-color: var(--ink); }
.pick:active { transform: scale(.99); }
.pick .chip { flex: none; }
.notice { display: block; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: rgba(212,179,139,.45); font-weight: 800; text-decoration: none; color: var(--ink); }
.range { gap: 8px; }
.range input[type=date].flt { padding: 6px 10px; }
.note-row { padding: 10px 0; border-top: 1px solid var(--line); }
.note-row:first-of-type { border-top: 0; }
.pending-row { padding: 10px 14px; border: 1.5px solid var(--tan); border-radius: 12px; background: rgba(212,179,139,.18); }
.login-card .tabs { gap: 6px; }
.login-card .tab { flex: 1; text-align: center; }

/* ===== modules: sub-navigation, master dashboard cards, record forms, store visit report ===== */
.subnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.subnav > span { font-weight: 700; margin-right: 4px; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.subnav a { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.subnav a:hover { background: rgba(212,179,139,.3); }
.subnav a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.mcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(29,27,23,.08); }
.mcard .mt { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
.mcard .mv { font-size: 38px; font-weight: 900; line-height: 1.1; margin-top: 10px; }
.mcard .ml { font-size: 13px; color: var(--muted); }
.mcard .mline { margin-top: 8px; }
.span2 { grid-column: 1 / -1; }
.sec[hidden] { display: none; }
.svb .svh { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.svn { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--tan); display: grid; place-items: center; font-weight: 900; }
.rl { display: grid; gap: 8px; }
.rl > .btn { justify-self: start; }
.rrow { display: grid; gap: 8px; align-items: center; }
.rrow input, .rrow select { min-width: 0; width: 100%; }
.r-ready { grid-template-columns: minmax(0, 3fr) auto minmax(0, 2fr) 34px; }
.r-qual { grid-template-columns: minmax(0, 2.4fr) auto 92px minmax(0, 2fr) 34px; }
.r-team { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 84px minmax(0, 3fr) 34px; }
.r-act { grid-template-columns: minmax(0, 3fr) minmax(0, 3fr) minmax(0, 1.4fr) 150px 34px; }
@media (max-width: 760px) {
  .rrow { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.5); }
  .rrow > :first-child { grid-column: 1 / -1; }
  .rrow > .icon { justify-self: end; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; }
}
.kv .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv .vv { font-weight: 700; margin-top: 2px; }
.sign .sigline { border-bottom: 1.5px solid var(--ink); height: 44px; margin-bottom: 4px; }
@media print { .subnav { display: none; } .svview .card { box-shadow: none; } }
.card .grid input[type=number], .card .grid input[type=date], .card .grid input[type=time] { width: 100%; }

/* clickable number tiles */
.kpi.click { cursor: pointer; position: relative; transition: transform .15s, box-shadow .15s; }
.kpi.click:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(29,27,23,.1); }
.kpi.click:focus-visible { outline: 2px solid var(--deep, #2B8A74); outline-offset: 2px; }
.kpi.click::after { content: "i"; position: absolute; top: 10px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .45; font: italic 700 12px/15px Georgia, serif; text-align: center; }
.explain .ex-head { font-size: 26px; font-weight: 900; line-height: 1.15; }
.modal:has(.explain) { max-width: min(680px, 94vw); }
.modal .explain { gap: 12px; }

/* drink picker (Barista verification) */
.pick-results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 170px; overflow: auto; }
.pick-opt { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.pick-opt:hover { background: rgba(132,198,178,.3); border-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.chip.drink { background: var(--teal); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; font-size: 13.5px; border: 0; }
.chip.drink a { color: inherit; text-decoration: none; }
.chip.drink button { border: 0; background: rgba(29,27,23,.14); border-radius: 50%; width: 20px; height: 20px; line-height: 20px; cursor: pointer; font-size: 11px; padding: 0; }
button.chip { cursor: pointer; border: 0; }
