@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("fonts/montserrat-700.woff") format("woff"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("fonts/montserrat-800.woff") format("woff"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400.woff") format("woff"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff") format("woff"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff") format("woff"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-700.woff") format("woff"); }
body { margin: 0; }
a { color: inherit; }

/* Layout: admin = black side rail + content (bottom bar on phones); worker = one phone-width column with black header and bottom bar. Brand: KODAS design system. */
:root {
  --bg: #edeeef; --card: #ffffff; --inverse: #100f0d; --ink: #100f0d; --muted: #5e6368;
  --inv-ink: #ffffff; --inv-muted: #a9aeb3; --line: #d5d8db; --line-strong: #9ca1a6;
  --hivis: #ccff00; --on-hivis: #100f0d; --hivis-tint: #f2ffc7; --graphite: #26292c;
  --ok: #1f7a4d; --ok-bg: #e3f3ea; --warn: #6b4a12; --warn-bg: #fff1d6; --err: #b42318; --err-bg: #fee4e2; --err-ink: #ffffff;
  --btn2-bg: #100f0d; --btn2-fg: #ffffff; --chip: #e6e8ea;
  --font-d: "Montserrat", "Arial Black", system-ui, sans-serif;
  --font-t: "Barlow", "Arial Narrow", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #100f0d; --card: #1a1c1f; --inverse: #26292c; --ink: #ffffff; --muted: #a9aeb3; --line: #3a3e42; --line-strong: #5e6368;
  --hivis-tint: #2e3608; --ok: #5cc98c; --ok-bg: #12301f; --warn: #f0b357; --warn-bg: #3a2a0a; --err: #f97066; --err-bg: #3d1512; --err-ink: #100f0d;
  --btn2-bg: #ffffff; --btn2-fg: #100f0d; --chip: #26292c; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #100f0d; --card: #1a1c1f; --inverse: #26292c; --ink: #ffffff; --muted: #a9aeb3; --line: #3a3e42; --line-strong: #5e6368;
  --hivis-tint: #2e3608; --ok: #5cc98c; --ok-bg: #12301f; --warn: #f0b357; --warn-bg: #3a2a0a; --err: #f97066; --err-bg: #3d1512; --err-ink: #100f0d;
  --btn2-bg: #ffffff; --btn2-fg: #100f0d; --chip: #26292c; color-scheme: dark; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-t); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
h1, h2, h3 { font-family: var(--font-d); margin: 0; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-d); font-weight: 800; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.logo { fill: currentColor; display: block; height: auto; aspect-ratio: 1208 / 318; overflow: visible; }

/* prototype strip */
.proto { background: var(--hivis); color: var(--on-hivis); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 14px; }
.proto b { font-family: var(--font-d); font-weight: 800; letter-spacing: 2px; font-size: 12px; }
.proto select { min-height: 36px; border: 1.5px solid var(--on-hivis); border-radius: var(--r-sm); background: #ffffff; color: #100f0d; padding: 0 8px; max-width: 100%; font-weight: 600; }
.proto-note { font-weight: 500; }

/* buttons, fields, pills */
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--card); font-family: var(--font-d); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--hivis); color: var(--on-hivis); border-color: var(--hivis); }
.btn-dark { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--btn2-bg); }
.btn-big { min-height: 60px; font-size: 18px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; width: 100%; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); text-decoration: underline; font-family: var(--font-t); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.field input, .field select, .field textarea { min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--card); color: var(--ink); padding: 0 12px; font-size: 16px; font-weight: 500; width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex-shrink: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.pill { display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-sm); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err); color: var(--err-ink); }
.pill.neutral { background: var(--chip); color: var(--ink); }
.pill.hv { background: var(--hivis); color: var(--on-hivis); }
.form-err { color: var(--err); font-weight: 700; font-size: 14px; min-height: 0; }
.form-err:empty { display: none; }
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: 0 1px 0 var(--line); padding: 16px; }
.card-pad0 { padding: 4px 16px; }
.sec-title { font-family: var(--font-d); font-weight: 700; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.lrow:first-child { border-top: 0; }
.lrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lrow-main b { font-weight: 700; }
.ava { width: 40px; height: 40px; border-radius: 20px; background: var(--chip); color: var(--ink); font-family: var(--font-d); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; font-size: 14px; }
.chip.on { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--btn2-bg); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); background: var(--hivis); color: var(--on-hivis); font-family: var(--font-d); font-weight: 700; padding: 12px 18px; border-radius: var(--r-md); z-index: 50; box-shadow: 0 0 0 2px #100f0d; max-width: calc(100% - 32px); }

/* admin shell */
.shell-admin { display: flex; min-height: 100vh; }
.side { width: 236px; flex-shrink: 0; background: var(--inverse); color: var(--inv-ink); padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo-side { width: 150px; color: #ffffff; margin: 0 10px 24px; }
.side-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 0; background: none; color: var(--inv-muted); font-weight: 600; font-size: 16px; text-align: left; }
.side-item.on { background: #26292c; color: var(--hivis); font-weight: 700; }
.side-item svg { flex-shrink: 0; }
.badge { margin-left: auto; background: var(--hivis); color: var(--on-hivis); font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.main { flex: 1; min-width: 0; padding-block: 28px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.main-in { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.mtop { display: none; }
.bnav { display: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .num { font-size: 28px; line-height: 1.1; }
.kpi.dark { background: var(--inverse); color: var(--inv-ink); box-shadow: none; }
.kpi.dark .muted { color: var(--inv-muted); }
.kpi.dark .num { color: var(--hivis); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-wide { flex: 3 1 420px; min-width: 0; }
.col-narrow { flex: 2 1 300px; min-width: 0; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--card); box-shadow: 0 1px 0 var(--line); border: 0; width: 100%; text-align: left; }
.alert.warn { background: var(--warn-bg); box-shadow: none; }
.alert.err { background: var(--err-bg); box-shadow: none; }
.alert .cnt { min-width: 32px; height: 32px; border-radius: 16px; background: var(--hivis); color: var(--on-hivis); font-family: var(--font-d); font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
td.r, th.r { text-align: right; }
.code { font-family: var(--font-d); font-weight: 800; font-size: 26px; letter-spacing: 3px; }

@media (max-width: 899px) {
  .side { display: none; }
  .main { padding-block: 0 120px; }
  .mtop { display: flex; align-items: center; justify-content: space-between; background: var(--inverse); color: #ffffff; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding-block: 14px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); margin-bottom: 18px; }
  .logo-m { width: 112px; color: #ffffff; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--inverse); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
}
.bnav-item, .wnav-item { flex: 1; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--inv-muted); font-size: 12px; font-weight: 600; position: relative; }
.bnav-item.on, .wnav-item.on { color: var(--hivis); font-weight: 700; }
.dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--hivis); color: var(--on-hivis); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* worker shell */
.shell-worker { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 110px; }
.whead { background: var(--inverse); color: #ffffff; padding-block: 18px 30px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }
.whead-top { display: flex; justify-content: space-between; align-items: center; }
.logo-w { width: 118px; color: #ffffff; }
.whead h1 { color: #ffffff; }
.whead .sub { color: #a9aeb3; font-size: 15px; }
.wbody { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); margin-top: -14px; display: flex; flex-direction: column; gap: 14px; }
.wnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--inverse); padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.stat { background: var(--bg); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.stat span:first-child { font-size: 13px; color: var(--muted); }
.stat span:last-child { font-family: var(--font-d); font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 96px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.bar i { display: block; width: 100%; border-radius: 6px; background: var(--ink); min-height: 6px; }
.bar i.zero { background: var(--line); }
.bar i.today { background: var(--hivis); box-shadow: inset 0 0 0 1.5px var(--ink); }
.bar span { font-size: 13px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.steps i { height: 6px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--ink); }
.sigbox { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: #ffffff; touch-action: none; width: 100%; height: 130px; display: block; }
details.manual summary { cursor: pointer; font-weight: 700; text-decoration: underline; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.dark-hero { background: var(--inverse); color: #ffffff; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dark-hero .muted { color: #a9aeb3; }
.dark-hero .hv { color: var(--hivis); }
.lineitem { display: flex; justify-content: space-between; gap: 12px; }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.kcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.task.done { opacity: .72; }
.task.done .task-title { text-decoration: line-through; }
.task-title { overflow-wrap: anywhere; }
.ava-sm { width: 26px; height: 26px; font-size: 11px; border-radius: 13px; }
.tadd { display: flex; flex-wrap: wrap; gap: 12px; }
.morenav { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.morebtn { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border: 0; text-align: left; min-height: 96px; position: relative; }
.morebtn .badge { position: absolute; top: 12px; right: 12px; }
.cell { min-height: 42px; width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); padding: 0 8px; font-size: 15px; }
.cell.r { text-align: right; }
.totals, .paper-sum { margin-left: auto; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.leg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
tfoot td { border-bottom: 0; font-weight: 700; }
.paper { background: #ffffff; color: #100f0d; border-radius: var(--r-lg); padding: clamp(18px, 4vw, 40px); box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 22px; max-width: 860px; font-size: 15px; }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid #100f0d; padding-bottom: 14px; }
.paper-kicker { font-family: var(--font-d); font-weight: 700; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #5e6368; margin-bottom: 4px; }
.paper-no { font-family: var(--font-d); font-weight: 800; font-size: 24px; }
.paper-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; line-height: 1.5; }
.paper-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; background: #edeeef; border-radius: 10px; padding: 12px; }
.paper-meta div { display: flex; flex-direction: column; gap: 2px; }
.paper-meta span { font-size: 12px; color: #5e6368; }
.paper-tbl th { color: #5e6368; border-color: #d5d8db; }
.paper-tbl td { border-color: #d5d8db; color: #100f0d; }
.paper-total { border-top: 2px solid #100f0d; padding-top: 8px; font-size: 20px; font-family: var(--font-d); font-weight: 800; }
.paper-total b { background: #ccff00; padding: 0 6px; }
.paper-foot { font-size: 13px; color: #3a3e42; }
.paper-foot p { margin: 0 0 4px; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .2s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } }
label.chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
label.chip input { margin: 0; accent-color: var(--ink); }
label.chip:has(input:checked) { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--btn2-bg); }
label.chip:has(input:checked) input { accent-color: var(--hivis); }
.qrbox { background: #ffffff; border-radius: 12px; padding: 6px; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; line-height: 0; }
.qrbox svg { display: block; width: 168px; height: 168px; }
