/* Check-in by AgrimAi — shared design system (landing, download, dashboard). */
:root {
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg: #f8fafc; --bg-2: #f1f5f9; --panel: #ffffff; --panel-2: #f8fafc;
  --ink: #0f172a; --ink-2: #334155; --muted: #5b6b80; --line: #e2e8f0; --line-2: #cbd5e1;
  --brand: #2563EB; --brand-2: #1D4ED8; --brand-ink: #ffffff; --brand-strong: #1D4ED8; --brand-soft: #EFF6FF; --brand-deep: #1E3A8A; --band: #1E3A8A;
  --accent: #7d5f00; --accent-soft: #fdf0c4;
  --ok: #17703c; --ok-bg: #e2f3e8; --warn: #7d5f00; --warn-bg: #fdf0c4; --bad: #b3261e; --bad-bg: #fbe5e2;
  --info: #3d4f61; --info-bg: #e8edf2; --neutral: #475569; --neutral-bg: #eef2f7;
  --violet: #5b3fa6; --violet-bg: #ece6f8;
  --focus: #1D4ED8;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.35);
  color-scheme: light;
}
/* Light is the default for everyone; dark applies ONLY when the user picks it (data-theme="dark"). */
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-2: #0f172a; --panel: #111a2e; --panel-2: #16213a; --ink: #e2e8f0; --ink-2: #cbd5e1; --muted: #94a3b8;
    --line: #1e293b; --line-2: #334155; --brand: #60A5FA; --brand-2: #93C5FD; --brand-ink: #0b1220; --brand-strong: #93C5FD; --brand-soft: #172554; --brand-deep: #BFDBFE; --band: #172554;
    --accent: #e8c547; --accent-soft: #33290c;
    --ok: #7ad79c; --ok-bg: #14301f; --warn: #ecd06a; --warn-bg: #33290c; --bad: #ff9b90; --bad-bg: #3a1916;
    --info: #b3c3d3; --info-bg: #1f262d; --neutral: #cbd5e1; --neutral-bg: #1e293b; --violet: #c3b0f5; --violet-bg: #2a2340;
    --focus: #93C5FD; --shadow: 0 1px 0 rgba(0,0,0,.2); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--ink); }
html { scrollbar-color: color-mix(in srgb, var(--brand) 55%, var(--line-2)) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.015em; color: var(--ink); overflow-wrap: anywhere; }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wrap { overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Controls ---------- */
.btn, button { font: 500 13px/1 var(--font-ui); display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .08s ease; }
.btn:hover, button:hover { background: var(--panel-2); border-color: var(--muted); color: var(--ink); }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover, button.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--brand-ink); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover, button.ghost:hover { background: var(--bg-2); }
button.danger, .btn.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.sm, button.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.lg, button.lg { min-height: 46px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.icon-btn { width: 36px; padding: 0; }

input, select, textarea { font: 14px/1.3 var(--font-ui); color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 10px; width: 100%; min-height: 38px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }
input[type="range"] { padding: 0; border: 0; min-height: 24px; accent-color: var(--brand); background: transparent; box-shadow: none; }
select[multiple] { min-height: 120px; padding: 4px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 12px; min-width: 0; }
label > input, label > select, label > textarea { margin-top: 5px; }
label .hint, .hint { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
label.check input { margin: 0; flex: none; }
.err { color: var(--bad); font-size: 13px; min-height: 0; }
.err:not(:empty) { margin: 8px 0; padding: 8px 10px; background: var(--bad-bg); border-radius: var(--radius-sm); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.fields > * { min-width: 0; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s cubic-bezier(.3,.7,.4,1); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; min-width: 0; }
.card-h h2 { margin: 0; }
.card.flush > .card-h { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; } .grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-3-1 { grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* KPI tiles */
.kpi { padding: 16px 18px; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.accent { border-top: 3px solid var(--brand); } .kpi.warn { border-top: 3px solid var(--accent); } .kpi.bad { border-top: 3px solid var(--bad); }

/* Tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { color: var(--muted); font-size: 12px; }
td .name { font-weight: 600; color: var(--ink); text-decoration: none; }
td .name:hover { color: var(--brand-strong); text-decoration: underline; }
.cell-max { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-min { min-width: 640px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; line-height: 18px;
  background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); } .b-brand { background: var(--brand-soft); color: var(--brand-strong); } .b-violet { background: var(--violet-bg); color: var(--violet); }
.b-accent { background: var(--accent-soft); color: var(--accent); }
.badge.outline { background: transparent; border: 1px dashed currentColor; }
/* Phone-signal note next to a green "Checked in" badge, and the sub-line under it. */
.signote { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sig-warn, td .sub.sig-warn { color: var(--warn); } .sig-bad, td .sub.sig-bad { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }

/* States */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; color: var(--muted); }
.empty h3 { margin: 0 0 4px; color: var(--ink); font-size: 15px; }
.empty p { max-width: 380px; margin: 0 auto 12px; font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: skel 1.3s infinite linear; border-radius: 6px; }
@keyframes skel { to { background-position: -200% 0; } }
.loading-page { padding: 4px 0; }
.loading-page .skel { height: 14px; margin-bottom: 10px; }
.error-box { border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad); border-radius: var(--radius); padding: 16px 18px; }
.note { font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: var(--bg-2); border-radius: var(--radius-sm); margin-top: 12px; }

/* ---------- App shell ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; min-width: 0; z-index: 30; }
.side-top { padding: 18px 16px 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo .mark { width: 30px; height: 30px; flex: none; }
.logo b { color: var(--brand-strong); font-weight: 700; }
.logo .logo-by { margin-left: 6px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.scope { margin: 6px 12px 8px; padding: 14px; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); }
.scope label { display: block; margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.scope .sc-name { font-size: 18px; font-weight: 700; line-height: 1.25; margin: 0 0 12px; }
.scope .sc-biz { margin-bottom: 12px; font-weight: 600; }
.scope select { min-height: 40px; font-size: 14px; font-weight: 500; background: var(--panel); margin-bottom: 10px; }
.scope select:last-child { margin-bottom: 0; }
.scope select.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.nav { padding: 6px 10px 12px; overflow-y: auto; flex: 1; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; margin-bottom: 1px; min-width: 0; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.nav a.active svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--brand); color: var(--brand-ink); font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 26px 32px 60px; max-width: 1800px; width: 100%; }
@media (min-width: 1600px) { .main { padding: 28px 40px 64px; } }
.topbar { display: none; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; min-width: 0; }
.page-h > div:first-child { min-width: 0; flex: 1 1 260px; }
.page-h .eyebrow { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-h .eyebrow a { color: var(--muted); text-decoration: none; } .page-h .eyebrow a:hover { color: var(--brand-strong); }
.page-h .desc { color: var(--muted); max-width: 680px; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; min-width: 0; }
.toolbar > label { margin: 0; flex: 0 1 180px; }
.toolbar > label.grow { flex: 1 1 220px; }
.scrim { display: none; }

/* Tabs / segmented */
.seg { display: inline-flex; background: var(--bg-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { min-height: 30px; border: 0; background: transparent; font-size: 12.5px; padding: 0 12px; border-radius: 7px; color: var(--muted); }
.seg button:hover { background: transparent; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* Toast */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 420px; animation: toastIn .25s cubic-bezier(.2,.8,.3,1); overflow-wrap: anywhere; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* Modal / drawer */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.48); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 60; overflow: auto; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 16px; padding: 22px 24px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); min-width: 0; animation: pop .2s cubic-bezier(.2,.8,.3,1); }
.modal.wide { max-width: 860px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal h2 { font-size: 19px; margin-bottom: 14px; padding-right: 30px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.drawer-bg { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 60; animation: fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 61; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .25s cubic-bezier(.2,.8,.3,1); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-h h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.drawer-b { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal .h { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; padding-bottom: 2px; }
.cal .d { min-height: 58px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; cursor: pointer; font: inherit; color: var(--ink); min-width: 0; overflow: hidden; }
.cal .d:hover { border-color: var(--muted); }
.cal .d .n { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal .d .t { font-size: 10px; line-height: 1.2; color: inherit; opacity: .9; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .d.sel { box-shadow: 0 0 0 2px var(--brand); border-color: var(--brand); }
.cal .d.today .n { color: var(--brand-strong); text-decoration: underline; }
.cal .d.future { opacity: .55; cursor: default; }
.cal .PRESENT { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.cal .MANUAL_PRESENT { background: var(--ok-bg); color: var(--ok); border: 1px dashed var(--ok); }
.cal .ABSENT { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.cal .MANUAL_ABSENT { background: var(--bad-bg); color: var(--bad); border: 1px dashed var(--bad); }
.cal .NEEDS_REVIEW { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Timeline */
.tl { position: relative; padding-left: 18px; margin: 4px 0; }
.tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); border-radius: 2px; }
.tl .ev { position: relative; padding: 2px 0 8px; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.tl .ev::before { content: ""; position: absolute; left: -17px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--muted); }
.tl .ev.in::before { border-color: var(--ok); background: var(--ok); }
.tl .ev.out::before { border-color: var(--neutral); }
.tl .ev.warn::before { border-color: var(--accent); }
.tl .ev .t { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-right: 8px; }

/* Day strip (in/out trips) */
.daybar { position: relative; height: 26px; background: var(--bg-2); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.daybar .seg-in { position: absolute; top: 4px; bottom: 4px; background: var(--brand); border-radius: 4px; min-width: 3px; }
.daybar .seg-in.open { background: repeating-linear-gradient(45deg, var(--brand), var(--brand) 6px, color-mix(in srgb, var(--brand) 60%, transparent) 6px, color-mix(in srgb, var(--brand) 60%, transparent) 12px); }
.dayaxis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }

/* Bars (CSS charts) */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { height: 12px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.3,1); }
.bar-row .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 80px; text-align: right; white-space: nowrap; }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.cols .c { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.cols .c i { display: block; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 1px; transition: height .5s cubic-bezier(.2,.8,.3,1); }
.cols .c:hover i { background: var(--brand-deep); }
.cols-x { display: flex; gap: 3px; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }
.cols-x span { flex: 1; min-width: 0; text-align: center; overflow: hidden; white-space: nowrap; }

/* Map */
.map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); z-index: 0; }
.map.sm { height: 300px; }
.split { display: grid; grid-template-columns: minmax(300px, 26%) minmax(0, 1fr); gap: 16px; align-items: start; }
.split .list { max-height: clamp(560px, calc(100vh - 260px), 900px); overflow-y: auto; }
.split .map { height: clamp(560px, calc(100vh - 190px), 960px); position: sticky; top: 16px; }
.blist { list-style: none; margin: 0; padding: 0; }
.blist li { border-bottom: 1px solid var(--line); }
.blist li:last-child { border-bottom: 0; }
.blist button { width: 100%; text-align: left; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border: 0; border-radius: 0; background: transparent; min-height: 0; font-weight: 400; }
.blist button:hover { background: var(--panel-2); }
.blist button[aria-current="true"] { background: var(--brand-soft); }
.blist .pin { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.blist .pin.off { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.blist .t1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.blist .t2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.mk.sel { background: var(--brand-deep); width: 22px; height: 22px; }
.mk { cursor: pointer; transition: width .12s, height .12s; }
.mk:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
/* Build 121: people on the branch map (last reported position). */
.mk.p { width: 26px; height: 26px; font: 600 10px/20px system-ui, sans-serif; color: #fff; text-align: center; background: var(--ok); }
.mk.p.out { background: var(--warn); }
.mk.p.stale { background: var(--muted); }
.mk.p.left { background: var(--bad); opacity: .85; }
.map { position: relative; }
.maplibregl-map { font-family: var(--font-ui); }
.maplibregl-popup-content { padding: 10px 26px 10px 12px; font-size: 13px; line-height: 1.45; border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); }
.maplibregl-popup-content b { display: block; font-family: var(--font-display); font-size: 14px; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 0 6px; min-height: 0; border: 0; background: transparent; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--panel); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--panel); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel); } .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel); }
.maplibregl-ctrl-group button { min-height: 0; padding: 0; border-radius: 0; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.map-off { height: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.map-off b { color: var(--ink); font-size: 14px; }
/* Branch dashboard + live board helpers */
.minirow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.mini b { display: block; font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.mini span { font-size: 11.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini.warn b { color: var(--warn); } .mini.bad b { color: var(--bad); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick .btn { justify-content: flex-start; gap: 8px; }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chipbar button { min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--panel); }
.chipbar button .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.chipbar button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chipbar button[aria-pressed="true"] .n { color: inherit; opacity: .8; }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 10px; align-items: center; }

/* Products */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--bg-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.thumb.lg { width: 120px; height: 120px; border-radius: 12px; font-size: 20px; }
.pcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pcell > div { min-width: 0; }
.pcell .name { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulkbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 10px; margin-bottom: 12px; animation: pop .15s ease; }
.bulkbar button { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.bulkbar button:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.img-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding: 12px; background: var(--bg-2); border-radius: 10px; }
.img-edit .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.drop { border: 2px dashed var(--line-2); }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }

/* Live */
.livedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; vertical-align: 1px; }
.livedot.off { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.statusgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.st { white-space: normal; border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.st .v { font-family: var(--font-display); font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.st .l { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st .d { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.st.ok { border-left: 4px solid var(--ok); } .st.ok .l { color: var(--ok); }
.st.warn { border-left: 4px solid var(--accent); } .st.warn .l { color: var(--warn); }
.st.bad { border-left: 4px solid var(--bad); } .st.bad .l { color: var(--bad); }
.st.out { border-left: 4px solid var(--neutral); } .st.out .l { color: var(--neutral); }
.st.rev { border-left: 4px solid var(--violet); } .st.rev .l { color: var(--violet); }
.feed { max-height: 460px; overflow-y: auto; font-size: 13px; }
.feed .it { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed .it:last-child { border-bottom: 0; }
.feed .it .t { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); padding-top: 1px; }
.feed .it div { overflow-wrap: anywhere; }

/* Person header */
.person { display: flex; gap: 14px; align-items: center; min-width: 0; }
.person > div { min-width: 0; }
.kv { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }

/* Auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art { background: var(--band); color: #dbeafe; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .logo { color: #ffffff; } .auth-art .logo b { color: #93C5FD; } .auth-art .logo .logo-by { color: rgba(255,255,255,.72); }
.auth-art h2 { color: #fff; font-size: 34px; line-height: 1.1; max-width: 420px; margin: 0 0 12px; }
.auth-art p { color: #dbeafe; max-width: 420px; }
.auth-art svg.rings { position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; opacity: .25; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; }

/* ---------- Marketing pages ---------- */
.site { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.site-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.site-h nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-h nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.site-h nav a:not(.btn):hover { background: var(--bg-2); }
.eyebrow-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); padding: 5px 12px; border-radius: 99px; }
.display { font-family: var(--font-display); font-size: clamp(36px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; margin: 18px 0 16px; }
.display em { font-style: normal; color: var(--brand-strong); position: relative; }
.display em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .16em; background: var(--brand); opacity: .4; z-index: -1; border-radius: 2px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 580px; line-height: 1.55; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; padding: 40px 0 72px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; font-size: 13px; color: var(--muted); }
.trust span { display: inline-flex; gap: 6px; align-items: center; }
.trust svg { width: 16px; height: 16px; color: var(--brand-strong); }
.phone { justify-self: center; width: min(320px, 100%); aspect-ratio: 9 / 18.5; border-radius: 38px; background: #0f172a; padding: 10px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.2); position: relative; }
.phone .scr { height: 100%; border-radius: 30px; background: #f8fafc; overflow: hidden; padding: 34px 16px 16px; color: #0f172a; display: flex; flex-direction: column; gap: 10px; }
.phone .notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; border-radius: 12px; background: #0f172a; }
.ph-card { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ph-card .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 600; }
.ph-card .big { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #1D4ED8; }
.ph-step { display: flex; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 0; }
.ph-step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: #EFF6FF; color: #1D4ED8; flex: none; }
.ph-step.done i { background: #2563EB; color: #ffffff; }
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section-h { max-width: 640px; margin-bottom: 36px; }
.section-h h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; margin: 10px 0 10px; font-weight: 700; letter-spacing: -.025em; }
.section-h p { color: var(--muted); font-size: 16px; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: s; position: relative; }
.flow .step { padding: 0 20px 0 0; position: relative; min-width: 0; }
.flow .step .n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--brand-strong); margin-bottom: 14px; position: relative; z-index: 1; }
.flow .step .n svg { width: 22px; height: 22px; }
.flow .step::before { content: ""; position: absolute; top: 22px; left: 44px; right: 0; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.flow .step:last-child::before { display: none; }
.flow h3 { font-size: 16px; margin: 0 0 6px; }
.flow p { color: var(--muted); font-size: 14px; }
.flow .tag { font-family: var(--font-mono); font-size: 11px; color: var(--brand-strong); font-weight: 600; letter-spacing: .04em; }
.zones { margin-top: 40px; padding: 26px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.zones svg { width: 100%; height: auto; display: block; }
.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.role { padding: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.role .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px; }
.role .ic svg { width: 20px; height: 20px; }
.role h3 { font-size: 17px; margin: 0 0 6px; }
.role ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.role li { margin-bottom: 4px; }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.feat { background: var(--panel); padding: 26px; min-width: 0; }
.feat h3 { font-size: 16px; margin: 12px 0 6px; }
.feat p { color: var(--muted); font-size: 14px; margin: 0; }
.feat svg { width: 22px; height: 22px; color: var(--brand-strong); }
.signup-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: start; }
.signup-card { padding: 28px; border-radius: 18px; }
.checklist { list-style: none; padding: 0; margin: 18px 0 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; color: var(--ink-2); }
.checklist svg { width: 18px; height: 18px; color: var(--brand-strong); flex: none; margin-top: 2px; }
.cta-band { background: var(--band); color: #dbeafe; box-shadow: inset 0 3px 0 var(--brand); border-radius: 22px; padding: 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: 28px; }
.cta-band p { margin: 0; color: #dbeafe; }
.cta-band .btn { background: #2563EB; color: #ffffff; border-color: #2563EB; }
.cta-band .btn:hover { background: #1D4ED8; border-color: #1D4ED8; color: #ffffff; }
.cta-band .btn.ghost { background: transparent; color: #ffffff; border-color: rgba(147,197,253,.5); }
.site-f { padding: 36px 0 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 72px; }
.site-f nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-f a { color: var(--muted); }
/* Small AgrimAI credit. The logo file is white: dark silhouette in light mode, white in dark mode. */
.agrim-by { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; opacity: .7; transition: opacity .2s; vertical-align: middle; }
.agrim-by:hover { opacity: 1; }
.agrim-by img { height: 10px; width: auto; filter: brightness(0); }
:root[data-theme="dark"] .agrim-by img { filter: none; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dl-card { padding: 28px; border-radius: 18px; display: flex; flex-direction: column; }
.dl-card .os { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dl-card .os svg { width: 34px; height: 34px; }
.dl-card ol { padding-left: 20px; color: var(--ink-2); margin: 14px 0 18px; }
.dl-card ol li { margin-bottom: 8px; }
.perm { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: 0; }
.perm .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; }
.perm .ic svg { width: 20px; height: 20px; }
.perm h3 { margin: 0 0 4px; font-size: 15px; }
.perm p { margin: 0; color: var(--muted); font-size: 14px; }
.spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .statusgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-3-1 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split .map { height: 380px; position: static; order: -1; }
  .split .list { max-height: none; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.3,1); box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 16px 48px; }
  .g2, .g3, .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .hero, .signup-wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .flow .step::before { display: none; }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .dl-grid, .spec { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .site { padding: 0 16px; }
  .site-h nav a:not(.btn) { display: none; }
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .minirow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chipbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chipbar button { flex: none; }
  .statusgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi { padding: 12px 14px; } .kpi .v { font-size: 22px; }
  .card { padding: 14px; }
  .card.flush > .card-h { padding: 14px 14px 0; }
  .flow, .roles { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto; }
  .bar-row .val { min-width: 0; }
  .cal { gap: 3px; } .cal .d { min-height: 44px; padding: 4px; } .cal .d .t { display: none; }
  .modal { padding: 18px 16px; border-radius: 14px; }
  .modal-bg { padding: 12px; }
  .cta-band { padding: 26px; }
  .toolbar > label { flex: 1 1 140px; }
  .map { height: 320px; }
  .section { padding: 52px 0; }
  .dl-card, .signup-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.blist button { line-height: 1.35; white-space: normal; }
.blist .t1 + .t2 { margin-top: 2px; }
/* Dark mode maps use the OpenFreeMap "dark" style (see mapStyle() in app.js); no CSS filter needed. */

/* Product department picker */
.deppick { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.deprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.deprow + .deprow, .depbranches + .deprow { border-top: 1px solid var(--line); }
.depbranches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px; padding: 4px 12px 12px 36px; background: var(--bg); border-top: 1px dashed var(--line); }
label.check.sm { font-size: 13px; font-weight: 500; }
.field .lbl { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ---------- Stock ---------- */
.gk { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.nav .count.alert { background: #c62828; color: #fff; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bell { position: relative; }
.bell-n { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #c62828; color: #fff; font: 700 10px/17px var(--font-ui); text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.pill-bad { background: #c62828; color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; line-height: 17px; font-weight: 700; }
.kpi-sep { color: var(--muted); font-weight: 400; margin: 0 4px; }
.kpi .s a { color: inherit; }
.st.info { border-left: 4px solid var(--info); } .st.info .l { color: var(--info); }
.qty { min-height: 30px; padding: 0 8px; border: 1px dashed transparent; background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; justify-content: flex-end; }
.qty:hover, .qty:focus-visible { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.qty-in { width: 84px; min-height: 30px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.dleft { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.dleft .num { min-width: 30px; text-align: right; font-weight: 600; }
.dbar { flex: 1; height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; min-width: 48px; }
.dbar i, .lg-dot { display: block; height: 100%; border-radius: 4px; }
.dbar i.bad, .lg-dot.bad { background: var(--bad); } .dbar i.warn, .lg-dot.warn { background: #d4a900; } .dbar i.ok, .lg-dot.ok { background: var(--ok); }
.lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 8px; }
.stock-t tr.grp td { background: var(--bg-2); padding: 8px 12px; }
.stock-t .pcell .name { max-width: 260px; }
.bulk-list { max-height: min(52vh, 520px); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.bulk-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 6px 10px; margin: 0; border-bottom: 1px solid var(--line); }
.bulk-row:last-child { border-bottom: 0; }
.bulk-row input { margin: 0; text-align: right; min-height: 34px; }
.bulk-n { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--ink); }
/* Notices */
.ngrp + .ngrp { margin-top: 14px; }
.ngrp-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; display: flex; gap: 6px; align-items: center; }
.ngrp-h::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ngrp-h.critical { color: var(--bad); } .ngrp-h.warning { color: var(--warn); } .ngrp-h.info { color: var(--info); }
.ntc { border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 10px; padding: 10px 12px; background: var(--panel); margin-bottom: 8px; min-width: 0; }
.ntc.critical { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 45%, var(--panel)); }
.ntc.warning { border-left-color: #f59e0b; background: color-mix(in srgb, var(--warn-bg) 45%, var(--panel)); }
.ntc.ack { opacity: .7; }
.ntc-t { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ntc-f { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sugs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sugs li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; background: var(--brand-soft); color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.sugs li svg { flex: none; margin-top: 2px; color: var(--brand-strong); }
.sugs.top li { background: var(--bg-2); }
.stack-bar { display: flex; }
.stack-bar .fill.out { background: var(--bad); border-radius: 4px 0 0 4px; } .stack-bar .fill.low { background: #f59e0b; border-radius: 0 4px 4px 0; }
.bar-row .lbl a { color: var(--ink); text-decoration: none; } .bar-row .lbl a:hover { color: var(--brand-strong); text-decoration: underline; }
.lowlist { list-style: none; margin: 0; padding: 0; }
.lowlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.lowlist li:last-child { border-bottom: 0; }
.lowlist .pcell { min-width: 0; flex: 1; } .lowlist .thumb { width: 36px; height: 36px; }
.pstock { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.pstock-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.pstock-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 90px 90px; gap: 8px; align-items: center; }
.pstock-row input { min-height: 34px; text-align: right; }
.pstock-b { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 560px) {
  .pstock-row { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .pstock-row > .badge, .pstock-row > span:empty { display: none; }
  .bulk-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .dleft { min-width: 84px; }
}

/* ---------- In-place refresh: progress bar, dimmed regions, reserved heights ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent, var(--brand) 30%, var(--brand-deep, var(--brand)) 70%, transparent); background-size: 50% 100%; background-repeat: no-repeat; transition: opacity .2s ease; }
.progress.on { opacity: 1; animation: prog 1s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes prog { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.main .tablewrap, .main .cal, .main .daypanel, .main .bars, .main .cols, .main .statusgrid, .main .kpi .v { transition: opacity .18s ease; }
.main.refreshing .tablewrap, .main.refreshing .cal, .main.refreshing .daypanel, .main.refreshing .bars, .main.refreshing .cols, .main.refreshing .kpi .v, .main.refreshing .statusgrid .v { opacity: .55; }
.tablewrap.tall { max-height: min(72vh, 920px); overflow: auto; overscroll-behavior: contain; }
.tablewrap table { min-height: 0; }
.card.flush .tablewrap { min-height: 96px; }

/* Sticky filter bars on long pages */
.main > .card.toolbar, .main > form.card.toolbar { position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow), 0 6px 14px -10px rgba(15,23,42,.25); }
@media (max-width: 900px) { .main > .card.toolbar, .main > form.card.toolbar { top: 62px; } }

/* Staff detail: calendar and day detail side by side */
.staff-top { margin-bottom: 16px; }
.calsplit { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calcard { margin-bottom: 0; min-height: 470px; }
.daypanel { position: sticky; top: 16px; min-width: 0; min-height: 300px; }
.daypanel-h { margin: 2px 0 12px; font-size: 17px; }
.daypanel > .card:last-child { margin-bottom: 0; }
@media (max-width: 1100px) { .calsplit { grid-template-columns: minmax(0, 1fr); } .daypanel { position: static; } .calcard { min-height: 0; } }

/* Live board search + chip bar */
.sm-in { height: 32px; padding: 0 10px; font-size: 13px; width: 170px; max-width: 42vw; }
.chipbar { scroll-behavior: smooth; scrollbar-width: thin; }
@media (max-width: 900px) { .chipbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; } .chipbar button { flex: none; } }
/* Re-renders patch rows in place; keep the window where the user left it rather than chasing a re-sorted row. */
.main { overflow-anchor: none; }

/* ===== Check-in minimal: managers, item sales, hours ===== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.checks legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; font-weight: 500; cursor: pointer; }
.chk input { width: 18px; height: 18px; margin: 0; flex: none; }
.pw-box { display: flex; gap: 8px; align-items: center; margin: 12px 0 6px; }
.pw-box code { flex: 1; min-width: 0; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 16px; letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }
.filters .row.end { align-items: center; gap: 12px; margin-top: 8px; }
.filters .err { flex: 1; margin: 0; }
.ibgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ibcard { min-width: 0; }
.ibtotal { font-size: 13px; margin-bottom: 8px; } .ibtotal b { font-family: var(--font-display); font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ibtop { list-style: none; margin: 0; padding: 0; }
.ibtop li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ibtop li > span { min-width: 0; } .ibtop li b { font-variant-numeric: tabular-nums; }
/* Product sales: best seller per branch, ranked top 5 with a share bar */
.ps-card h2 a { color: inherit; } .ps-card h2 a:hover { color: var(--brand); }
.ps-best { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; min-width: 0; }
.ps-best .eyebrow { margin: 0 0 2px; }
.ps-best-n { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-top li { align-items: center; }
.ps-rk { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-top li:first-child .ps-rk { background: var(--brand); color: #fff; }
.ps-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ps-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ps-nm > .trunc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.ps-best-n { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 560px) { .ps-grid { grid-template-columns: 1fr; } }
.ps-bar { display: block; height: 4px; border-radius: 3px; background: var(--bg-2); overflow: hidden; } .ps-bar i { display: block; height: 100%; background: var(--brand); }
.ps-v { flex: none; text-align: right; display: flex; flex-direction: column; } .ps-v .sub { font-size: 11.5px; color: var(--muted); }
.ps-kpi-n { display: block; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix th, .matrix td { white-space: nowrap; }
.matrix .sticky-c { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; font-weight: 500; max-width: 220px; box-shadow: 1px 0 0 var(--line); }
.matrix .muted { color: var(--muted); }
.late-mark { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 700; line-height: 16px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); vertical-align: 1px; }
@media (max-width: 560px) { .pw-box { flex-direction: column; align-items: stretch; } .ibgrid { grid-template-columns: 1fr; } }

/* ===== Check-in minimal 2.1: attendance calendar, sales reports, products, app versions ===== */
/* Shared */
.warn-box { display: flex; gap: 10px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-bg); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.warn-box > svg { flex: none; color: var(--warn); margin-top: 1px; }
.warn-box a { color: var(--ink); font-weight: 600; }
.linklike { display: inline; min-height: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; border-radius: 4px; }
.linklike:hover { background: none; color: var(--brand-strong); text-decoration: underline; border-color: transparent; }
.pcell .linklike.name { display: block; max-width: 300px; }
th.rowh a.name { font-weight: 600; color: var(--ink); text-decoration: none; }
th.rowh a.name:hover { color: var(--brand-strong); text-decoration: underline; }
tbody th.rowh, tfoot th, tfoot td { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); background: transparent; position: static; font-weight: 400; white-space: normal; }
tfoot th, tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; background: var(--panel-2); font-weight: 600; }
.rangebar { padding: 12px 16px; align-items: flex-end; }
.rangebar .seg { align-self: flex-end; }
.rangebar > label { flex: 0 1 160px; }
.rangebar .rb-err { flex: 1 0 100%; }
.rangebar .rb-err:empty { display: none; }
.rangebar .rb-err:not(:empty) { margin: 0; }

/* Sortable tables and tabs */
.th-sort { min-height: 0; padding: 2px 4px; margin: -2px -4px; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; gap: 4px; white-space: nowrap; }
.th-sort:hover { background: var(--bg-2); color: var(--ink); }
th[aria-sort] .th-sort { color: var(--ink); }
.th-sort .arr { font-size: 11px; opacity: .55; }
th[aria-sort] .th-sort .arr { opacity: 1; color: var(--brand-strong); }
th.num .th-sort { justify-content: flex-end; }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabs [role=tab] { flex: none; min-height: 40px; border: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; background: none; color: var(--muted); font-weight: 600; padding: 0 14px; }
.tabs [role=tab]:hover { color: var(--ink); background: var(--bg-2); }
.tabs [role=tab][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.sr-foot { margin: 0; padding: 10px 16px 14px; }
.sortable td .person, .sortable th .person { gap: 10px; }

/* Teams-style initials avatars */
.mc-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 10px/1 var(--font-ui); letter-spacing: 0; flex: none; box-shadow: 0 0 0 2px var(--panel); background: var(--neutral-bg); color: var(--neutral); }
.mc-av.lg { width: 34px; height: 34px; font-size: 12.5px; box-shadow: none; }
.mc-av.sm { width: 18px; height: 18px; font-size: 8px; box-shadow: none; vertical-align: -4px; margin-right: 4px; }
.av0 { background: var(--brand-soft); color: var(--brand-strong); } .av1 { background: var(--info-bg); color: var(--info); } .av2 { background: var(--ok-bg); color: var(--ok); }
.av3 { background: var(--violet-bg); color: var(--violet); } .av4 { background: var(--accent-soft); color: var(--accent); } .av5 { background: var(--neutral-bg); color: var(--ink-2); }
.mc-av.mc-more { background: var(--ink-2); color: var(--panel); }

/* Attendance month calendar */
.mc-stats { display: flex; gap: 6px 18px; flex-wrap: wrap; align-self: center; margin-left: auto; }
.main > form.card.toolbar.mc-filter { position: static; box-shadow: var(--shadow); }
@media (max-width: 900px) { .main > form.card.toolbar.rangebar { position: static; box-shadow: var(--shadow); } }
.mc-split { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
@media (max-width: 1100px) { .mc-split { grid-template-columns: minmax(0, 1fr); } }
.mc-card { margin-bottom: 0; container-type: inline-size; }
.mc-wd, .mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mc-wd span { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; padding-bottom: 4px; }
.mc-d { min-height: 86px; height: auto; padding: 7px 7px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); white-space: normal;
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 4px; text-align: left; min-width: 0; }
.mc-d:hover { border-color: var(--muted); background: var(--panel-2); }
.mc-d:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.mc-n { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mc-today { font-size: 10px; font-weight: 700; color: var(--brand-ink); background: var(--brand); border-radius: 99px; padding: 0 6px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; }
.mc-d.today { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 55%, var(--panel)); }
.mc-d.sel { box-shadow: 0 0 0 2px var(--brand-strong); border-color: var(--brand-strong); }
.mc-d.future { background: transparent; border-style: dashed; color: var(--muted); }
.mc-d.none:not(.future) .mc-c { color: var(--muted); }
.mc-avs { display: flex; align-items: center; min-width: 0; overflow: hidden; padding: 2px; margin: -2px; }
.mc-avs .mc-av { width: 24px; height: 24px; font-size: 9.5px; }
.mc-avs .mc-av + .mc-av { margin-left: -6px; }
.mc-avs .mc-av.mc-more { width: auto; min-width: 22px; padding: 0 5px; border-radius: 99px; margin-left: -4px; }
.mc-c { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.mc-c .muted { font-weight: 500; }
.mc-pad { min-height: 1px; }
.mc-panel .card { margin-bottom: 0; }
.mc-back { display: none; }
#mcdh:focus { outline: none; }
#mcdh:focus-visible { outline: 2px solid var(--focus); }
.mc-h { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.mc-plist { display: flex; flex-direction: column; gap: 6px; }
.mc-p { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 0; }
.mc-p[open] { border-color: var(--line-2); box-shadow: var(--shadow); }
.mc-p > summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; border-radius: 10px; }
.mc-p > summary::-webkit-details-marker { display: none; }
.mc-p > summary:hover { background: var(--panel-2); }
.mc-p > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mc-pn { display: flex; flex-direction: column; min-width: 0; }
.mc-pn .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.mc-pn a.nm:hover { color: var(--brand-strong); text-decoration: underline; }
.mc-pn .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-pt { display: flex; gap: 14px; font-size: 13px; }
.mc-pt > span { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.mc-pt .lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.mc-chev { color: var(--muted); transition: transform .15s; display: inline-flex; }
.mc-p[open] .mc-chev { transform: rotate(90deg); }
.mc-detail { padding: 2px 12px 12px; border-top: 1px dashed var(--line); }
.mc-bar { position: relative; height: 20px; border-radius: 6px; background: var(--bg-2); margin-top: 10px; overflow: hidden; }
.mc-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--brand); }
.mc-seg.open { background: repeating-linear-gradient(45deg, var(--brand), var(--brand) 6px, color-mix(in srgb, var(--brand) 55%, transparent) 6px, color-mix(in srgb, var(--brand) 55%, transparent) 12px); }
.mc-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.mc-sess { list-style: none; margin: 0 0 8px; padding: 0; }
.mc-sess li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mc-sess li:last-child { border-bottom: 0; }
.mc-range { font-weight: 600; white-space: nowrap; }
.mc-alist { list-style: none; margin: 0; padding: 0; }
.mc-abs { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 10px; color: var(--muted); }
.mc-abs .mc-av { background: var(--bg-2); color: var(--muted); }
.mc-abs .mc-pn .nm { color: var(--ink-2); font-weight: 500; }
@media (max-width: 1100px) { .mc-back { display: inline-flex; } }
/* Calendar width (not viewport) decides how much fits in a day cell: smaller avatars, then the count only. */
@container (max-width: 700px) { .mc-today { display: none; } .mc-d.today .mc-n { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 2px; } .mc-d { padding: 6px 5px 5px; } .mc-avs .mc-av { width: 22px; height: 22px; font-size: 9px; } }
@container (max-width: 560px) { .mc-avs .mc-av { width: 19px; height: 19px; font-size: 8px; } .mc-avs .mc-av + .mc-av { margin-left: -7px; } .mc-avs .mc-av.mc-more { min-width: 19px; padding: 0 3px; } }
@container (max-width: 440px) { .mc-avs { display: none; } .mc-c { text-align: left; } .mc-c .muted { display: none; } .mc-d { min-height: 54px; } }
@media (max-width: 900px) { .mc-d { min-height: 74px; } }
@media (max-width: 560px) {
  .mc-wd, .mc-grid { gap: 3px; }
  .mc-d { min-height: 54px; padding: 4px; border-radius: 8px; gap: 2px; }
  .mc-p > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .mc-pt { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; padding-left: 44px; }
  .mc-pt > span { align-items: flex-start; }
  .mc-chev { grid-column: 3; grid-row: 1; }
  .mc-sess li { grid-template-columns: minmax(0, 1fr) auto; }
  .mc-stats { margin-left: 0; }
  .legend .mc-av.sm { display: none; }
}

/* Products drawer */
.pd-price { font-family: var(--font-display); font-size: 22px; font-weight: 650; margin-top: 2px; }
.pd-price .small { font-family: var(--font-ui); font-weight: 400; }
.ph-list { list-style: none; }
.mp-h { padding-bottom: 12px; }
.mp-tools { gap: 8px; }
.mp-tools select.sm-in { width: auto; min-height: 32px; height: 32px; padding: 0 8px; }
.mp-table th.num, .mp-table td.num { white-space: nowrap; }
@media (max-width: 560px) {
  .mp-table .thumb { display: none; }
  .mp-table th, .mp-table td { padding: 8px; }
  .mp-table .pcell .linklike.name { max-width: 42vw; white-space: normal; overflow-wrap: anywhere; }
  .mp-table thead th { font-size: 10.5px; }
}

/* App versions */
.av-rules ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.av-rules li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.av-rules li .badge { flex: none; min-width: 120px; justify-content: center; }
.av-card h2 { display: flex; align-items: center; gap: 8px; }
.av-switch { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; }
.av-switch .hint { margin-top: 0; }
.av-try { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 10px 12px; background: var(--bg-2); border-radius: var(--radius-sm); margin-bottom: 4px; }
.av-try label { margin: 0; flex: 0 1 170px; }
.av-try-out { font-size: 13px; padding-bottom: 9px; }
@media (max-width: 560px) {
  .av-rules li { flex-direction: column; gap: 4px; }
  .av-rules li .badge { min-width: 0; }
  .rangebar .seg { width: 100%; }
  .rangebar > label { flex: 1 1 120px; }
  .mp-tools { width: 100%; }
  .mp-tools .sm-in { flex: 1 1 140px; max-width: none; width: auto; }
}

/* Sales by day editor (manager edits one staff member's daily counts) */
.sd-nav { align-items: center; padding: 12px 16px; }
.sd-nav .sd-date { margin: 0; flex: 0 1 170px; display: flex; align-items: center; gap: 8px; }
.sd-nav .sd-date input { margin-top: 0; }
.sd-nav .sd-note { display: inline-flex; align-items: center; gap: 6px; }
.sd-br > .card-h.sd-h { padding: 16px 20px 12px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.sd-err { margin: 12px 20px 0 !important; }
.sd-table th.rowh { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); background: transparent; position: static; font-weight: 600; white-space: normal; }
.sd-table tbody tr.sd-zero .sd-pn, .sd-table tbody tr.sd-zero .c-rev { opacity: .55; }
.sd-table tbody tr.sd-changed > th { box-shadow: inset 3px 0 0 var(--brand); }
.sd-pn { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-table .sub { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 400; }
.sd-was { color: var(--brand-strong); font-weight: 600; }
.sd-unit-m { display: none; }
.sd-table tfoot th, .sd-table tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--panel-2); position: static; }
.sd-table tfoot th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.sd-table tbody tr.sd-empty:hover td { background: transparent; }
.sd-unp { margin: 0; padding: 10px 20px 14px; color: var(--warn); }
.sd-unp.muted { color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty .qb { width: 36px; min-height: 36px; padding: 0; font-size: 18px; line-height: 1; font-weight: 600; }
.qty input { width: 72px; min-height: 36px; text-align: center; padding: 6px 4px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.qrm { color: var(--muted); }
.qrm:hover { color: var(--bad); background: var(--bad-bg); }
.sd-bar { position: static; bottom: 12px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 16px; margin-top: 4px; }
.sd-bar.dirty { position: sticky; border-color: var(--brand); }
.sd-br .empty { padding: 20px 16px; }
.sd-br .empty .ic { width: 36px; height: 36px; margin-bottom: 6px; }
.sd-sum { display: flex; flex-direction: column; gap: 2px; }
.sd-sum #sdstatus { font-weight: 600; }
.sd-sum #sdstatus.bad { color: var(--bad); }
.sd-sum #sdstatus:focus { outline: none; }
.sd-sum #sdstatus:focus-visible { outline: 2px solid var(--focus); }
.sd-pick { list-style: none; margin: 4px 0 0; padding: 0; max-height: min(50vh, 420px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sd-pick:empty { display: none; }
.sd-pick li + li { border-top: 1px solid var(--line); }
.sd-pi { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; justify-content: stretch; text-align: left; border: 0; border-radius: 0; min-height: 44px; padding: 8px 12px; white-space: normal; }
.sd-pi:hover, .sd-pi:focus-visible { background: var(--brand-soft); }
.sd-pi:focus-visible { outline-offset: -2px; }
.sd-pi-n { font-weight: 600; overflow-wrap: anywhere; }
td .sr-edit { min-height: 28px; }
@media (max-width: 560px) {
  .sd-nav .spacer { display: none; }
  .sd-nav .sd-note { flex-basis: 100%; }
  .sd-nav .sd-date { flex: 1 1 140px; }
  .sd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sd-table, .sd-table tbody, .sd-table tfoot { display: block; }
  .sd-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .sd-table tr.sd-empty { display: block; }
  .sd-table th, .sd-table td { padding: 0; border: 0; }
  .sd-table .c-prod { grid-column: 1; grid-row: 1; }
  .sd-table .c-rm { grid-column: 2; grid-row: 1; justify-self: end; }
  .sd-table .c-qty { grid-column: 1; grid-row: 2; }
  .sd-table .c-rev { grid-column: 2; grid-row: 2; text-align: right; }
  .sd-table .c-unit { display: none; }
  .sd-table .sd-unit-m { display: inline; }
  .sd-table tfoot tr { background: var(--panel-2); }
  .sd-table tfoot th, .sd-table tfoot td { border: 0; }
  .sd-table tfoot .c-qty { text-align: left; }
  .sd-pn { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .sd-bar { bottom: 8px; padding: 10px 12px; }
  .sd-bar .row { width: 100%; } .sd-bar .row button { flex: 1; }
  .sd-pi { grid-template-columns: minmax(0, 1fr) auto; } .sd-pi .mono { grid-column: 1; grid-row: 2; }
}

/* Account link in the sidebar footer */
.side-foot .me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: 8px; padding: 4px; margin: -4px; }
.side-foot .me-link:hover, .side-foot .me-link.active { background: var(--bg-2); color: inherit; }
.side-foot .me-link.active .avatar { background: var(--brand); color: var(--brand-ink); }
/* My account */
.acct-list { margin: 0; padding-left: 18px; }
.acct-list li { margin: 2px 0; }
.acct-rules { margin: -4px 0 8px; padding-left: 18px; }
@media (max-width: 900px) { .acct.g2 { grid-template-columns: minmax(0, 1fr); } }
/* Staff row menu + staff lifecycle */
.rowmenu { display: inline-block; text-align: right; position: relative; }
.rowmenu > summary { list-style: none; font-size: 18px; line-height: 1; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu[open] > summary { background: var(--bg-2); }
.rowmenu-list { position: fixed; z-index: 60; display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin-top: 6px; padding: 6px; min-width: 170px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.rowmenu-list button { justify-content: flex-start; min-height: 32px; font-size: 12.5px; }
.rowmenu-hint { padding: 4px 8px; text-align: left; white-space: normal; }
.staff-life { gap: 12px; }
.rp-opts { border: 0; padding: 0; margin: 0 0 12px; }
.rp-opts label.check { margin: 6px 0; }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger.solid:hover { background: var(--bad); color: #fff; filter: brightness(1.08); }
button.danger.solid:disabled { filter: none; }

/* Branches: list tools (search + Show inactive) and the branch status card. */
.blist-tools { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.blist-tools .switch { font-size: 13px; }
.branch-status .row.end { gap: 10px; }
@media (max-width: 560px) { .branch-status .row.end > button { flex: 1 1 100%; } }

/* ---------- Home page: two-column roles (owner dashboard + staff app) ---------- */
.roles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .roles.two { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Build 116: floors, business settings, cost price, incentives ---------- */
/* Business settings */
.bset { align-items: start; }
.radio-cards { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; min-width: 0; }
.radio-cards .lbl-legend { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; background: var(--panel); }
.radio-card:hover { border-color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input { margin-top: 2px; flex: none; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; color: var(--ink); font-weight: 500; }
.radio-cards[disabled] .radio-card { cursor: default; opacity: .8; }
.floor-list { list-style: none; margin: 0; padding: 0; }
.floor-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.floor-row > div:first-child { flex: 1 1 160px; }
.floor-acts { gap: 6px; flex-wrap: nowrap; }
.floor-acts .icon-btn { width: 30px; }
.floorpick { margin-bottom: 0; }
.h4 { font-size: 13px; margin: 14px 0 8px; font-weight: 600; font-family: var(--font-display); }
.pplace .fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
td.pickc { width: 36px; }

/* Incentives: shell, tabs, toolbar */
.inc-shell { overflow: visible; }
.inc-panel { min-width: 0; }
.inc-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 14px 16px 6px; }
.inc-bar > label { margin: 0; flex: 0 1 220px; }
.inc-bar .spacer { flex: 1 1 0; }
.inc-hint { padding: 0 16px; margin: 4px 0 10px; max-width: 80ch; }
.inc-bar .inc-hint { padding: 0; flex: 1 1 320px; margin: 0 0 6px; }
.inc-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.inc-foot .err { flex: 1 1 200px; margin: 0; }
.inc-foot > span.small { margin-right: auto; }
.inc-kpis { padding: 8px 16px 14px; margin: 0; }
/* Period picker (business calendar months) */
.period-pick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-pick .per-l { display: flex; flex-direction: column; align-items: center; min-width: 150px; padding: 0 6px; line-height: 1.25; text-align: center; }
.period-pick .per-l b { font-family: var(--font-display); font-size: 16px; }
/* Target grids */
.tg-table td.num { min-width: 120px; }
.tg-in { width: 130px; max-width: 100%; text-align: right; font-variant-numeric: tabular-nums; min-height: 34px; padding: 6px 8px; }
.tg-in::placeholder { color: var(--muted); opacity: .8; }
.tg-table tr[hidden] { display: none; }
/* Scheme list */
.lvsum { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-width: 220px; }
.lvsum li { display: flex; flex-direction: column; line-height: 1.35; }
/* Progress bars per level (report) */
.lvbars { display: grid; gap: 8px; min-width: 190px; max-width: 320px; }
.lvb-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.lvb-t { height: 8px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin: 3px 0 2px; }
.lvb-t i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--brand) 70%, var(--line-2)); transition: width .3s ease; }
.lvb.done .lvb-t i { background: var(--ok); }
.lvb.done .lvb-h b { color: var(--ok); }
.inc-rep td, .inc-rep th { vertical-align: top; }
/* Scheme builder */
.inc-builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
.inc-main { display: grid; gap: 16px; min-width: 0; }
.inc-main > .card, .inc-side > .card { margin: 0; }
.inc-side { position: sticky; top: 16px; display: grid; gap: 16px; min-width: 0; }
.inc-checks { margin-top: 12px; }
.inc-checks .inc-chk-hint, .inc-products .hint { grid-column: 1 / -1; margin: 2px 0 0; }
.inc-addbrand { grid-column: 1 / -1; gap: 8px; flex-wrap: nowrap; margin-top: 4px; }
.inc-addbrand input { min-height: 34px; flex: 1 1 auto; }
.inc-products { margin-top: 12px; display: block; }
.inc-products .sm-in { width: 100%; max-width: none; margin: 4px 0 8px; }
.inc-plist { max-height: 260px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.inc-plist .chk[hidden] { display: none; }
.lvcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 4px; margin-bottom: 12px; background: var(--panel-2); }
.lvcard-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-display); }
.lvcard [hidden] { display: none !important; }
.lv-say { font-size: 13px; color: var(--ink-2); background: var(--brand-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin: 0 0 10px; }
.incx-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; }
.incx-rules { margin: 0; padding: 12px 0 0 18px; border-top: 1px solid var(--line); display: grid; gap: 5px; color: var(--ink-2); }
.inc-actions .row.end { gap: 8px; }
@media (max-width: 1100px) {
  .inc-builder { grid-template-columns: minmax(0, 1fr); }
  .inc-side { position: static; }
}
@media (max-width: 560px) {
  .inc-bar { padding: 12px 12px 4px; }
  .inc-bar > label, .inc-bar > .period-pick { flex: 1 1 100%; }
  .period-pick .per-l { flex: 1 1 auto; min-width: 0; }
  .inc-hint { padding: 0 12px; }
  .inc-foot { padding: 12px; }
  .inc-foot > button { flex: 1 1 100%; }
  .inc-kpis { padding: 8px 12px 12px; }
  .tg-in { width: 96px; }
  .inc-actions .row.end > * { flex: 1 1 auto; }
  .floor-acts { flex-wrap: wrap; }
}
.mp-bulkslot:not(:empty) { padding: 0 12px; }
.mp-bulkslot .bulkbar { margin: 0 0 12px; }
.inc-rep td.num { white-space: nowrap; }
.inc-rep .badge { white-space: nowrap; }
.inc-rep .lvbars { min-width: 170px; max-width: 240px; }
.inc-rep td:nth-child(2) .cell-max { max-width: 150px !important; }
@media (max-width: 560px) { .inc-rep .rowh .cell-max { max-width: 140px; white-space: normal; } }
/* Incentives: frozen badge (report) and history of closed months */
.inc-frozen { align-self: center; display: inline-flex; align-items: center; gap: 5px; }
.inc-frozen svg { flex: none; }
.inc-hnote { margin-top: 2px; }
.inc-hmonth { border-top: 1px solid var(--line); }
.inc-hhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 16px 10px; }
.inc-htitle { display: flex; flex-direction: column; min-width: 140px; line-height: 1.25; }
.inc-htitle h3 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.inc-hmeta { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; min-width: 0; }
.inc-hmeta .badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; white-space: normal; text-align: left; }
.inc-htot { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.inc-htot > span { display: flex; flex-direction: column; line-height: 1.2; }
.inc-htot b { font-variant-numeric: tabular-nums; }
.inc-hhead > button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) {
  .inc-hhead { padding: 12px 12px 8px; }
  .inc-hhead > button { flex: 1 1 100%; justify-content: center; }
  .inc-frozen { flex: 1 1 100%; justify-content: center; }
}

/* Build 118: Bikram Sambat | Gregorian month grids (other calendar's day small in the corner) */
.cal-tog button { white-space: nowrap; }
.mc-actions { flex-wrap: wrap; justify-content: flex-end; }
.mc-n { font-size: 17px; line-height: 1.1; }
.mc-top { align-items: flex-start; }
.mc-o, .cal-o { margin-left: auto; font-size: 10.5px; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mc-o b, .cal-o b { font-weight: 700; color: var(--ink-2); }
.mc-today + .mc-o { margin-left: 4px; }
.mc-o-key { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 0; }
.cal .d { position: relative; }
.cal .d .cal-o { position: absolute; top: 5px; right: 6px; max-width: 55%; }
.cal .d .n { font-size: 14px; }
@media (max-width: 560px) {
  .mc-today { display: none; }
  .mc-n { font-size: 14px; }
  .mc-o b, .cal-o b { display: none; }
  .cal .d .cal-o { top: 3px; right: 3px; font-size: 9.5px; }
}
/* Incentive target grids: an SP target and a CP amount per level */
.tg-pair { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.tg-f { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0; font-size: 11px; color: var(--muted); font-weight: 500; }
.tg-l { white-space: nowrap; }
.tg-table td.num { min-width: 190px; }
.incx-ex { margin-top: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .tg-table td.num { min-width: 150px; } .tg-f { flex-direction: column; align-items: flex-end; gap: 2px; } }

/* ---------- Build 118: leave days and the weekly sales sheet ---------- */
.cal .LV_DAY_OFF { background: var(--info-bg); color: var(--info); border-color: transparent; }
.cal .LV_SICK { background: var(--violet-bg); color: var(--violet); border-color: transparent; }
.cal .LV_OTHER { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.cal .LV_PENDING { border: 1px dashed var(--warn); color: var(--warn); }
.cal .d.future.LV_DAY_OFF, .cal .d.future.LV_SICK, .cal .d.future.LV_OTHER, .cal .d.future.LV_PENDING { opacity: .85; cursor: pointer; }
.mc-lv { align-self: flex-start; font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 6px; border-radius: 99px; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.mc-lv.req { background: transparent; border: 1px dashed var(--warn); color: var(--warn); }
.ws { padding: 16px 20px 20px; display: grid; gap: 16px; min-width: 0; }
.ws-up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px) auto; gap: 12px; align-items: end; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--brand-soft); }
.ws-up .ws-file input { background: var(--panel); }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ws-kpi { margin: 0; }
.ws-miss { color: var(--warn); font-weight: 700; } .ws-extra { color: var(--info); font-weight: 600; }
.ws-pct { font-weight: 700; } .ws-pct.ok { color: var(--ok); } .ws-pct.warn { color: var(--warn); } .ws-pct.bad { color: var(--bad); }
.ws-dd h3 { margin: 4px 0 8px; }
.ws-unm summary { cursor: pointer; padding: 8px 0; }
.ws-bottom { margin-top: 16px; align-items: start; }
.ws-bottom select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
@media (max-width: 760px) { .ws-up { grid-template-columns: 1fr; } .ws { padding: 12px; } }
@media (max-width: 1100px) { .ws-bottom.g2 { grid-template-columns: minmax(0, 1fr); } }

.theme-toggle { display:inline-flex; align-items:center; gap:6px; font:600 13px/1 var(--font-ui); padding:7px 11px; border-radius:999px; border:1px solid var(--line-2); background:var(--panel); color:var(--ink); cursor:pointer; }
.theme-toggle:hover { border-color: var(--brand); }
.theme-fab { position: fixed; right: 16px; bottom: 16px; z-index: 50; box-shadow: var(--shadow); }
body:has(#theme) .theme-fab { display: none; }
/* Reports page */
.rp-grid { align-items: stretch; }
.rp-card { display: flex; flex-direction: column; gap: 6px; }
.rp-card h2 { margin: 4px 0 0; font-size: 16px; }
.rp-card p { flex: 1; margin: 0 0 10px; }
.rp-card select { width: 100%; }
.rp-card button { align-self: flex-start; }
.rp-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }

/* Incentive report: one connected bar per person (build 119) */
.inc-track { min-width: 240px; max-width: 420px; }
.inc-track-td { min-width: 260px; }
.inc-track-t { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.inc-track-t.some { color: var(--ink); }
.inc-track-t.all { color: var(--ok, #1a7f4b); }
.inc-track-b { position: relative; height: 10px; border-radius: 5px; background: var(--bg-2); overflow: visible; }
.inc-track-f { height: 10px; border-radius: 5px; background: var(--brand); }
.inc-track.all .inc-track-f { background: var(--ok, #1a7f4b); }
.inc-mark { position: absolute; top: -3px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 1.5px; background: var(--muted); }
.inc-mark.done { background: var(--ok, #1a7f4b); }
.inc-track-ls { position: relative; height: 16px; margin-top: 3px; }
.inc-mark-l { position: absolute; transform: translateX(-100%); white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--muted); padding-right: 2px; }
.inc-mark-l.done { color: var(--ok, #1a7f4b); }
.inc-lv summary { cursor: pointer; color: var(--muted); }
.inc-lv[open] summary { margin-bottom: 6px; }
.inc-amt { font-size: 15px; }
.kpi.ok .v { color: var(--ok, #1a7f4b); }

/* Rounding staff page: calendar days with visits, the day's route bar, branch colour dots */
.cal .RD_VISITS { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.cal .RD_VISITS .t { font-weight: 700; }
.cal .RD_EMPTY { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.rd-bar { height: 30px; }
.rd-bar .rd-round { position: absolute; top: 12px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 30%, transparent); }
.rd-bar .seg-in { top: 5px; bottom: 5px; opacity: .92; }
.rd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
tr.rd-gap td { padding-top: 2px; padding-bottom: 2px; border-bottom: 0; }

/* View-only admin (body.readonly): controls that change things are hidden; the API refuses them anyway (READ_ONLY). */
.ro-bar { margin: 12px 24px 0; padding: 9px 14px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 600; }
.readonly .page-h .row > button.primary, .readonly .page-h .row > button:not(.ghost):not([data-stmt]),
.readonly .rowmenu, .readonly button.danger, .readonly .switch, .readonly .staff-life,
.readonly form:not(.toolbar) button[type="submit"], .readonly form:not(.toolbar) button.primary,
.readonly [data-ov], .readonly [data-rr], .readonly #gr, .readonly [data-lap], .readonly [data-lrj],
.readonly [data-eb], .readonly [data-rm], .readonly #am2, .readonly #bdeact, .readonly #dvack, .readonly [data-dv],
.readonly [data-prok], .readonly [data-prno], .readonly [data-a] { display: none !important; }

/* Stock counts (build 135) */
.qty-in.invalid { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
td.num.bad { color: var(--bad); }
td.num.ok { color: var(--ok); }
