:root {
  --bg: #f5f6f8; --panel: #ffffff; --text: #1b1f27; --muted: #667085; --line: #e4e7ec;
  --brand: #1f5eff; --brand-text: #ffffff; --ok: #137a3c; --ok-bg: #e3f6ea; --warn: #9a5b00; --warn-bg: #fff1d6;
  --bad: #b42318; --bad-bg: #fde4e1; --grey-bg: #eceff3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b2029; --text: #e8ebf0; --muted: #9aa3b2; --line: #2b3240;
    --brand: #6b93ff; --brand-text: #0b1020; --ok: #5fd58a; --ok-bg: #11301e; --warn: #f2b84b; --warn-bg: #3a2c0c;
    --bad: #ff8a80; --bad-bg: #3c1815; --grey-bg: #262c38;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 16px; margin: 16px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.shell { max-width: 720px; margin: 0 auto; padding: 12px 14px 90px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0 12px; }
.brand { font-weight: 700; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; overflow-x: auto; z-index: 5; }
.nav a { flex: 1 0 auto; min-width: 74px; min-height: 52px; padding: 8px 6px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: var(--muted); text-decoration: none; }
.nav a.on { color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.item { display: block; width: 100%; text-align: left; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: inherit; min-height: 44px; }
.item:last-child { border-bottom: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .row.between { justify-content: space-between; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--grey-bg); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
button, .btn { font: inherit; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-text); border-color: var(--brand); font-weight: 600; }
button:disabled { opacity: .45; cursor: not-allowed; }
.clock { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.clock button { min-height: 76px; font-size: 18px; font-weight: 700; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; } .msg.err { background: var(--bad-bg); color: var(--bad); } .msg.ok { background: var(--ok-bg); color: var(--ok); }
.login { max-width: 380px; margin: 8vh auto; padding: 0 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv.total { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); margin-top: 6px; padding-top: 10px; }
.grid2 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.center { text-align: center; padding: 28px 8px; }
@media print {
  .nav, .top, .noprint { display: none !important; }
  body { background: #fff; color: #000; } .card { border: 1px solid #999; }
}
