/* Archivo, bundled with the app (vendor/archivo, SIL Open Font License) — Milestone 2 */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/archivo/archivo-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 500; font-display: swap; src: url('../vendor/archivo/archivo-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/archivo/archivo-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; font-display: swap; src: url('../vendor/archivo/archivo-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 800; font-display: swap; src: url('../vendor/archivo/archivo-latin-800-normal.woff2') format('woff2'); }

:root {
  --ink: #1E1A1D;
  --red: #626162;
  --gray: #F3F2F2;
  --card: #FFFFFF;
  --border: #E3E1DF;
  --text: #1E1A1D;
  --text-muted: #6B6866;
  --amber: #C77900;
  --green: #1E8A4C;
  --blue: #2564C4;
  --purple: #7B4FC9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gray);
  color: var(--text);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
}

a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 13px;
  text-decoration: none; border: none; cursor: pointer; white-space: nowrap;
}
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost-dark { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-big { width: 100%; padding: 14px; font-size: 15px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 10px 20px; background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: #fff; }
.brand-name { font-weight: 800; font-size: 15px; }
.brand-sub { font-size: 11px; color: #b9b6b3; }

.kpis { display: flex; gap: 22px; margin-left: 12px; flex: 1; }
.kpi { text-align: center; cursor: pointer; }
.kpi-val { font-size: 19px; font-weight: 800; }
.kpi-lbl { font-size: 10.5px; color: #b9b6b3; text-transform: uppercase; letter-spacing: .04em; }
.kpi-alert .kpi-val { color: var(--red); }

.top-actions { display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 12.5px; color: #b9b6b3; }

/* ---- Toolbar ---- */
.toolbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 54px; z-index: 90;
}
.search { display: flex; align-items: center; gap: 8px; background: var(--gray); border-radius: 8px; padding: 7px 12px; flex: 0 1 320px; }
.search svg { width: 16px; height: 16px; color: var(--text-muted); }
.search input { border: none; background: none; outline: none; font: inherit; width: 100%; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.legend { margin-left: auto; display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-red { background: var(--red); }
.dot-amber { background: var(--amber); }

/* ---- Board ---- */
.board-wrap { padding: 16px 20px 40px; }
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.column {
  flex: 0 0 270px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; max-height: calc(100vh - 160px);
}
.column-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.column-title { font-weight: 800; font-size: 13px; }
.column-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.column-body { padding: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.column-empty { text-align: center; color: var(--text-muted); font-size: 12px; padding: 18px 8px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 11px; margin-bottom: 8px; cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card.sortable-ghost { opacity: .35; }
.card-unassigned { border-color: var(--red); border-width: 1.5px; }
.card-late { border-left: 4px solid var(--amber); }
.card-overdue { border-left: 4px solid var(--red); }

.card-row1 { display: flex; justify-content: space-between; align-items: baseline; }
.card-jobnum { font-weight: 800; font-size: 13.5px; }
.card-time { font-weight: 700; font-size: 12.5px; color: var(--red); }
.card-customer { font-size: 13px; margin-top: 3px; font-weight: 600; }
.card-route { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.chip {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: var(--gray); color: var(--text-muted);
}
.chip-unassigned { background: var(--red); color: #fff; }
.chip-driver-only { background: #E7E5E3; }
.chip-farmed { background: #EDE5FA; color: var(--purple); }
.chip-round { background: #E4EDF8; color: #1d4e9e; }
.chip-paid { background: #E3F4E9; color: var(--green); }
.chip-deposit { background: #FFF3DE; color: var(--amber); }
.chip-unpaid { background: #FBE4E0; color: var(--red); }

.card-tap { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 5px; }
.card-sent { font-size: 14px; margin-left: 3px; }
.card-sent-confirm { color: var(--green); }
.card-sent-sheet { color: var(--blue); }

/* ---- Toasts ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast-error { background: var(--red); }

/* ---- Auth pages ---- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.auth-card { width: 100%; max-width: 360px; color: #fff; text-align: center; }
.auth-card h1 { font-size: 22px; margin: 0 0 2px; }
.auth-sub { color: #b9b6b3; margin: 0 0 20px; font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.auth-form label { font-size: 12.5px; color: #b9b6b3; margin-top: 10px; display: flex; flex-direction: column; } /* FIX (Harper): inputs sat beside their labels */
.auth-logo { width: 64px; height: 64px; border-radius: 12px; background: #fff; object-fit: contain; margin-bottom: 10px; }
.auth-form input {
  font-size: 16px; padding: 12px; border-radius: 8px; border: 1px solid #3a3735;
  background: #2c2a28; color: #fff; margin-top: 4px;
}
.auth-form button { margin-top: 20px; }
.error { color: #ff9182; font-weight: 700; }
.ok { color: #7de8a8; font-weight: 700; }

/* FIX (Harper): "Open in a new tab" hint when embedded in HighLevel */
.framed-note { font-size: 12.5px; color: #b9b6b3; background: rgba(255,255,255,.06); border-radius: 8px; padding: 8px 10px; }
.framed-note a { color: #fff; font-weight: 700; }

/* Milestone 10: SaaS */
.powered-by { margin: 18px 0 0; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.support-banner { background: #FFF3DE; color: #1E1A1D; border-bottom: 1px solid #f1d29a; padding: 8px 20px; font-size: 13.5px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.support-banner .btn { padding: 5px 12px; font-size: 12.5px; }
.board-foot { text-align: center; font-size: 11.5px; color: var(--text-muted); padding: 0 0 18px; }
