:root {
  --bg: #f3f2ee; --card: #fff; --fg: #1d2420; --muted: #67706a; --line: #dfdcd3;
  --brand: #0f6b52; --brand-soft: #e3f0eb; --accent: #f0a21a; --danger: #c0392b; --warn: #b26a00;
  font-family: "Segoe UI", Roboto, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.nav { position: sticky; top: 0; z-index: 5; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 4px; padding: 0 12px; overflow-x: auto; }
.nav b { padding: 12px 10px 12px 0; white-space: nowrap; }
.nav button { background: none; border: 0; color: rgba(255,255,255,.8); padding: 13px 10px; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav button.on { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }
.nav .sp { flex: 1; }
.main { padding: 16px; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h2, .card h3 { margin: 0; font-size: 1.0625rem; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; }
.btn.p { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.btn.d { color: var(--danger); border-color: #e8c2bd; }
.btn.sm { padding: 4px 9px; font-size: .875rem; }
.btn[disabled] { opacity: .5; }
.in { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0; }
textarea.in { width: 100%; min-height: 70px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.muted { color: var(--muted); font-size: .875rem; }
.pill { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: .8125rem; font-weight: 600; background: #eee; }
.pill.pending_payment { background: #fff0d6; color: var(--warn); }
.pill.new { background: #fde2dd; color: var(--danger); }
.pill.accepted { background: #e6eefc; color: #2456a6; }
.pill.ready { background: #efe5fb; color: #6a35a8; }
.pill.picked { background: var(--brand-soft); color: var(--brand); }
.pill.delivered { background: #e9ece9; color: #3f4a43; }
.pill.canceled { background: #eee; color: #888; text-decoration: line-through; }
.order .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.order .num { font-weight: 700; font-size: 1.0625rem; }
.order.alert { border-color: var(--danger); box-shadow: 0 0 0 2px #f6cfc9; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .9rem; }
.kv span:nth-child(odd) { color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8125rem; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tw { overflow-x: auto; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--brand-soft); display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8125rem; }
.err { background: #fde7e4; color: var(--danger); border-radius: 8px; padding: 10px 12px; }
.ok { background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 10px 12px; word-break: break-all; }
.login { max-width: 340px; margin: 12vh auto; }
.plines { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.pline { display: flex; gap: 8px; align-items: center; }
.pline span { flex: 1; min-width: 0; }
.pline input { width: 64px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--fg); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 20; max-width: calc(100vw - 32px); }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .main { padding: 12px; } }
