/* Termite One · แอปผู้บริหาร + ผู้จัดการ — สีและตัวอักษรชุดเดียวกับผังบนกระดาน (APP-01…06) */
:root {
  --ground: #F6F3ED;
  --paper: #FFFFFF;
  --soft: #FBF9F5;
  --line: #E4DDD0;
  --line2: #D9D2C5;
  --ink: #17140F;
  --muted: #5C5449;
  --faint: #8C8375;
  --exec: #0F6B6B;
  --mgr: #8B1E2E;
  --ai: #3D359B;
  --org: #B8520F;
  --bad: #9B1C10;
  --warn-bg: #FBE9E7;
  --ok-bg: #E9F2EC;
  --ai-bg: #F1EFFB;
  --head: 'Anuphan', 'Leelawadee UI', Tahoma, sans-serif;
  --body: 'IBM Plex Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
a { color: var(--ink); }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

/* ── โครง: มือถือ = แท็บล่าง · เดสก์ท็อป = แถบซ้าย ── */
.shell { min-height: 100vh; }
.view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
       background: var(--soft); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav .brand { display: none; }
.nav a { text-align: center; text-decoration: none; color: var(--faint); font-size: 14px; padding: 12px 0 14px; min-height: 48px; }
.nav a.on { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--ink); }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 200px 1fr; }
  .nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px; }
  .nav .brand { display: block; font-family: var(--head); font-weight: 700; font-size: 20px; padding: 4px 10px 16px; }
  .nav a { text-align: left; padding: 10px 12px; min-height: 0; font-size: 15px; }
  .nav a.on { box-shadow: inset 4px 0 0 var(--ink); background: var(--paper); }
  .view { max-width: 1100px; padding: 24px 32px 40px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

/* ── ชิ้นส่วน ── */
h1 { font-family: var(--head); font-size: 24px; line-height: 1.2; margin: 4px 0 0; }
h2 { font-family: var(--head); font-size: 18px; line-height: 1.25; margin: 8px 0 0; }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--faint); font-size: 13px; }
.card { background: var(--paper); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card.soft { background: var(--soft); }
.card .label { font-weight: 700; font-size: 14px; }
.card .sub { color: var(--muted); font-size: 13.5px; }
.big { font-family: var(--head); font-weight: 700; font-size: 30px; line-height: 1.1; }
.exec { color: var(--exec); } .mgr { color: var(--mgr); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.edge-exec { border-left: 5px solid var(--exec); } .edge-mgr { border-left: 5px solid var(--mgr); }
.edge-org { border-left: 5px solid var(--org); } .edge-mute { border-left: 5px solid var(--line2); }
.warn { background: var(--warn-bg); border: 1px dashed var(--mgr); color: #7A1A14; padding: 8px 10px; font-size: 14px; }
.ok { background: var(--ok-bg); border: 1px solid var(--exec); color: #0B4F4F; padding: 8px 10px; font-size: 14px; }
.ai { background: var(--ai-bg); border: 1px dashed var(--ai); color: #2A2470; padding: 8px 10px; font-size: 14px; }
.stale { background: #FFF6D6; border: 1px solid #C9A227; color: #5B4A00; padding: 8px 10px; font-size: 14px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #EFE9DE; font-size: 15px; }
.row:last-child { border-bottom: 0; }
.row .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; background: #F1ECE3; border: 1px solid var(--line2); font-size: 12.5px; padding: 1px 7px; font-family: Consolas, monospace; }
.ev { display: inline-block; background: var(--ai); color: #fff; font-size: 12.5px; padding: 1px 7px; font-family: Consolas, monospace; }
.stations { display: flex; flex-wrap: wrap; gap: 4px; }
.stations span { font-size: 12.5px; padding: 3px 7px; border: 1px solid var(--line2); color: var(--faint); }
.stations span.done { background: var(--exec); border-color: var(--exec); color: #fff; }
a.card, a.item { text-decoration: none; color: inherit; }
a.card:hover, a.item:hover { border-color: var(--ink); }
.item { display: block; background: var(--paper); border: 1px solid var(--line); padding: 10px 12px; }
.item + .item { margin-top: -1px; }
.list { display: flex; flex-direction: column; }
.struck { text-decoration: line-through; color: var(--faint); }
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 1px 8px; color: #fff; }
.pill.rev { background: var(--bad); } .pill.back { background: var(--faint); }
.btn { display: block; width: 100%; min-height: 48px; border: 0; background: var(--ink); color: #fff; font-weight: 700; padding: 12px; cursor: pointer; text-align: center; text-decoration: none; }
.btn.line { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); }
.btn:disabled { background: var(--line2); color: var(--faint); cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { min-height: 48px; border: 1.5px solid #C9C1B3; background: #fff; padding: 10px 12px; font-size: 16px; }
.field input:focus, .field select:focus { outline: 3px solid #C9D6E5; border-color: var(--ink); }
.evidence { max-width: 100%; border: 1px solid var(--line2); background: var(--soft); display: block; }
.loginbox { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.split { display: flex; gap: 8px; } .split > * { flex: 1; }
table.stmt { width: 100%; border-collapse: collapse; }
table.stmt td { padding: 6px 4px; border-bottom: 1px solid #EFE9DE; font-size: 15px; }
table.stmt td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.stmt tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
