:root {
  --green: #14532d; --green-2: #166534; --green-tint: #dcfce7;
  --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --bg: #f6f7f5; --card: #fff;
  --red: #b91c1c; --red-tint: #fee2e2; --amber: #92400e; --amber-tint: #fef3c7; --blue-tint: #e0ecff;
  --radius: 12px; --tap: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--green); color: #fff; }
.brand { color: #fff; font-weight: 700; text-decoration: none; flex: 1; font-size: 1.05rem; }
.net { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: var(--amber-tint); color: var(--amber); }
.net.ok { background: rgba(255,255,255,.15); color: #fff; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.35rem; margin: 4px 0 12px; }
h2 { font-size: 1rem; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { line-height: 1.45; }
.muted { color: var(--muted); } .center { text-align: center; } .pad { padding: 32px 0; } .small { font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
form .field { display: block; margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #86efac; outline-offset: 1px; }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--tap);
  padding: 12px 16px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-weight: 600; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.danger { background: var(--red); }
.btn.big { min-height: 72px; font-size: 1.25rem; border-radius: 14px; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; padding: 8px 0; min-height: 40px; }
.bar .link { color: #fff; }
.err { background: var(--red-tint); color: var(--red); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.ok-msg { background: var(--green-tint); color: var(--green); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.tabs { display: flex; gap: 6px; background: #e9ece7; padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.job { display: block; text-decoration: none; color: inherit; }
.job .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.job .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.job .client { font-weight: 600; margin-top: 2px; }
.job .sum { color: var(--muted); margin-top: 2px; }
.job .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: .78rem; padding: 3px 9px; border-radius: 99px; background: #eef0ec; color: #374151; white-space: nowrap; }
.chip.in_progress { background: var(--blue-tint); color: #1e3a8a; }
.chip.declined, .chip.overdue { background: var(--red-tint); color: var(--red); }
.chip.awaiting_approval, .chip.due { background: var(--amber-tint); color: var(--amber); }
.chip.approved, .chip.completed { background: var(--green-tint); color: var(--green); }
.chip.queued { background: var(--amber-tint); color: var(--amber); }
.running { background: var(--green); color: #fff; border-color: var(--green); }
.running a { color: #fff; }
.running .clock { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 12px; }
.clock { font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.note-kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.note-body { white-space: pre-wrap; margin-top: 2px; }
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: auto; padding: 0 22px;
  border-radius: 99px; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.qr { display: block; width: 220px; height: 220px; margin: 8px auto 12px; image-rendering: pixelated; background: #fff; }
.secret { font-family: ui-monospace, monospace; word-break: break-all; text-align: center; background: #f3f4f6; padding: 8px; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90vw; z-index: 10; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.back { display: inline-block; margin-bottom: 8px; color: var(--green); text-decoration: none; font-weight: 600; min-height: 40px; padding-top: 8px; }
@media (prefers-color-scheme: dark) {
  :root { --ink: #e5e7eb; --muted: #9ca3af; --line: #2f343b; --bg: #111418; --card: #1a1e23; --green-tint: #123524; --blue-tint: #1e2a44; --amber-tint: #3b2a10; --red-tint: #3b1414; }
  input, select, textarea { background: #0f1215; color: var(--ink); border-color: #374151; }
  .tabs { background: #22272d; } .tabs button[aria-selected="true"] { background: #2f353c; }
  .chip { background: #2a2f35; color: #d1d5db; } .btn.secondary { background: transparent; color: #86efac; border-color: #86efac; }
  .secret { background: #22272d; } .back { color: #86efac; }
}
