/* Alpine Graphite — office theme. Dark default (near-black graphite,
   steel-blue accent, instrument-panel precision). Light via [data-theme=light]. */
:root, [data-theme="dark"] {
  --bg: #101216;
  --surface: #171a1f;
  --surface2: #1f232a;
  --surface3: #262b34;
  --ink: #e8eaed;
  --muted: #9aa3b0;
  --line: #2c313a;
  --accent: #4d8fd1;
  --accent-strong: #6aa9e6;
  --on-accent: #ffffff;
  --good: #43b581;
  --warn: #e0a458;
  --bad: #e0655f;
  --shadow: 0 6px 24px rgba(0,0,0,.45);
}
[data-theme="light"] {
  /* ShopMonkey-style light (Andrew, Nov 28, 2026): cool blue-gray surfaces,
     white cards, royal-blue accent — replaces the warm Alpine cream. */
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface2: #edf1f7;
  --surface3: #dfe6f0;
  --ink: #1d2733;
  --muted: #64748b;
  --line: #d7dee9;
  --accent: #2563eb;
  --accent-strong: #1e50c8;
  --on-accent: #ffffff;
  --good: #1e9e57;
  --warn: #cf4b3f;
  --bad: #d92d20;
  --shadow: 0 6px 24px rgba(30,50,90,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}
a { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); min-height: 1.2em; }

/* auth pages */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.auth-brand { letter-spacing: .18em; font-size: .72rem; color: var(--muted); font-weight: 700; }
.auth-card h1 { margin: 8px 0 6px; font-size: 1.5rem; }
.auth-card label, .form label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 5px; }
.auth-card input, .form input, .form select, .form textarea,
input.inp, select.inp, textarea.inp {
  width: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface2); color: var(--ink); min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--ink);
  padding: 10px 15px; border-radius: 10px; cursor: pointer; font-weight: 600;
  min-height: 44px; text-decoration: none; font-size: .95rem;
}
.btn:hover { background: var(--surface3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.big { width: 100%; margin-top: 16px; min-height: 52px; font-size: 1.02rem; }
.btn.sm { min-height: 38px; padding: 6px 11px; font-size: .88rem; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }

/* office layout */
header.office-top {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.office-top .row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.office-top .brand { font-weight: 800; letter-spacing: .04em; font-size: 1rem; }
.office-top .brand small { display: block; font-weight: 400; color: var(--muted); font-size: .68rem; letter-spacing: .16em; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 8px; }
nav.tabs a {
  color: var(--muted); text-decoration: none; padding: 9px 13px; border-radius: 9px;
  white-space: nowrap; font-weight: 600; font-size: .93rem;
}
nav.tabs a.active { background: var(--surface3); color: var(--ink); }
nav.tabs a .badge {
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem;
  padding: 1px 7px; margin-left: 5px; vertical-align: 2px;
}
main.office { padding: 16px 14px 60px; max-width: 1400px; margin: 0 auto; }

/* board */
.board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.board.no-archive { grid-template-columns: repeat(4, minmax(230px, 1fr)); }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 10px; min-height: 120px; }
.col h3 { margin: 2px 2px 2px; font-size: .95rem; display: flex; justify-content: space-between; align-items: baseline; }
.col .coltotal { color: var(--muted); font-size: .82rem; margin: 0 2px 10px; }
.job-card {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 12px; margin-bottom: 9px; cursor: pointer;
}
.job-card:hover { border-color: var(--accent); }
.job-card { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
.job-card.drag-src { opacity: .35; }
.job-card.drag-ghost {
  position: fixed; z-index: 999; pointer-events: none; margin: 0;
  opacity: .94; transform: rotate(1.2deg); cursor: grabbing;
}
.col.drop-ok { outline: 2px dashed var(--accent); outline-offset: -6px; }
.job-card .num { font-weight: 800; font-size: .92rem; }
.job-card .num .st { color: var(--muted); font-weight: 600; font-size: .75rem; letter-spacing: .06em; }
.job-card .title { font-weight: 600; margin: 2px 0; }
.job-card .meta { color: var(--muted); font-size: .85rem; }
.job-card .money { display: flex; justify-content: space-between; margin-top: 6px; font-variant-numeric: tabular-nums; }
.job-card .due { color: var(--warn); font-weight: 700; }
.paid-badge { background: var(--good); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .05em; }

/* generic panels/tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 1.15rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.tbl th { text-align: left; color: var(--muted); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover td { background: var(--surface2); }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.totals .t { background: var(--surface2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; }
.totals .t .k { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.totals .t .v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.totals .t.grand { border-color: var(--accent); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.chip { background: var(--surface3); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.tag-draft { background: var(--warn); color: #1c1f24; }
.tag-queued { background: var(--accent); color: #fff; }
.tag-sent { background: var(--good); color: #fff; }

/* order detail */
.svc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.svc-head { background: var(--surface2); padding: 10px 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.svc-head .name { font-weight: 700; }
.svc.recommended { opacity: .65; }
.line-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 13px; border-top: 1px solid var(--line); align-items: baseline; }
.line-row .sub { color: var(--muted); font-size: .83rem; }
.line-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; }

/* messages */
.thread-list .thread-item { padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 9px; cursor: pointer; background: var(--surface); }
.thread-item:hover { border-color: var(--accent); }
.thread-item .last { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 14px; margin: 7px 0; white-space: pre-wrap; }
.msg.out { background: var(--surface3); margin-left: auto; }
.msg.in { background: var(--surface2); border: 1px solid var(--line); }
.msg .meta { font-size: .72rem; color: var(--muted); margin-top: 5px; display: flex; gap: 6px; align-items: center; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 50;
  background: var(--surface3); color: var(--ink); border: 1px solid var(--accent);
  padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow); max-width: 92vw;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

/* vehicle identification: predictive picker + plate-resolve banner */
.ta-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 220px; overflow-y: auto; margin-top: 4px;
}
.ta-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; cursor: pointer; font: inherit; font-size: .95rem;
}
.ta-item:last-child { border-bottom: 0; }
.ta-item:hover { background: var(--surface3); }
.plate-hit {
  border: 1.5px solid var(--good); border-radius: 10px;
  padding: 10px 12px; margin-top: 8px; background: var(--surface2);
}
