/* DVZ Dispatch shared styles. Spacing scale: 4px steps (--s1..--s8). */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
[hidden] { display: none !important; }
:root {
  --ink: #15201b;
  --ink-2: #5d6863;
  --ink-3: #8b948f;
  --line: #e7e5df;
  --line-2: #d8d6cf;
  --bg: #f6f5f1;            /* warm off-white */
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --accent: #156a72;        /* DVZ teal, from the logo */
  --accent-hover: #0f5359;
  --accent-ink: #ffffff;
  --accent-soft: #e5f1f2;
  --accent-line: #c2dcdf;
  --warn: #8a5300;
  --warn-soft: #fcf2e1;
  --bad: #b02a22;
  --bad-soft: #fbeceb;
  --ok: #156a72;
  --info: #2a4a7f;
  --info-soft: #ebf0f8;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(21, 32, 27, .05);
  --shadow-2: 0 1px 2px rgba(21, 32, 27, .04), 0 6px 20px -6px rgba(21, 32, 27, .10);
  --shadow-3: 0 12px 32px -8px rgba(21, 32, 27, .22);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --fast: 140ms;
  --mid: 240ms;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
}
h1, h2, h3 { margin: 0 0 var(--s3); line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 var(--s3); }
a { color: var(--accent); text-underline-offset: 3px; }
small, .muted { color: var(--ink-2); font-size: 13px; }
.num, .money { font-variant-numeric: tabular-nums; }
.money { font-weight: 650; letter-spacing: -0.02em; }

/* Icons: <svg class="ic"><use href="/icons.svg#i-name"></use></svg> */
.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.9; vertical-align: -3px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 32px; height: 32px; stroke-width: 1.6; }

/* Buttons */
button, .btn {
  font: inherit; font-weight: 580; cursor: pointer;
  min-height: 40px; padding: 0 var(--s4);
  border-radius: var(--radius); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  text-decoration: none; box-shadow: var(--shadow-1);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), color var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
button:active:not(:disabled), .btn:active { transform: scale(.975); box-shadow: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(21, 106, 114, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--bad); border-color: #e7b9b5; }
button.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover:not(:disabled) { background: rgba(21, 32, 27, .05); border-color: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
button[aria-busy="true"] .ic { animation: spin 0.9s linear infinite; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Forms */
label { display: block; font-weight: 560; font-size: 13px; margin-bottom: var(--s1); color: var(--ink); }
input, select, textarea {
  font: inherit; width: 100%; min-height: 42px; padding: var(--s2) var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { min-height: 88px; resize: vertical; }
.field { margin-bottom: var(--s4); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 160px; }

/* Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s5); box-shadow: var(--shadow-2);
}
.stack > * + * { margin-top: var(--s3); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 580; line-height: 1;
  padding: 5px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  white-space: nowrap; color: var(--ink-2); vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.assigned, .badge.accepted { background: var(--info-soft); border-color: #d3deef; color: var(--info); }
.badge.submitted { background: var(--warn-soft); border-color: #f1ddb8; color: var(--warn); }
.badge.approved, .badge.paid { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ok); }
.badge.declined, .badge.rejected { background: var(--bad-soft); border-color: #f0cbc8; color: var(--bad); }
.badge.closed, .badge.cancelled { color: var(--ink-3); }

.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s3); border: 1px solid transparent;
}
.alert.error { background: var(--bad-soft); border-color: #f0cbc8; color: var(--bad); }
.alert.info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ok); }
.alert.warn { background: var(--warn-soft); border-color: #f1ddb8; color: var(--warn); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--s6) + env(safe-area-inset-bottom, 0px));
  max-width: min(92vw, 440px); padding: var(--s3) var(--s5); border-radius: 999px;
  background: var(--ink); color: #fff; z-index: 2000; box-shadow: var(--shadow-3);
  font-weight: 520; font-size: 14px; text-align: center;
  transform: translateX(-50%); animation: toast-in var(--mid) var(--spring);
}
#toast.error { background: var(--bad); }
body.has-tabbar #toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; color: var(--ink-3); font-weight: 560; background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); background: var(--surface); }
.num { text-align: right; }

.map { height: 300px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.photos { display: flex; flex-wrap: wrap; gap: var(--s2); }
.photos img {
  width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}
.photos a:hover img { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.empty { padding: var(--s8) var(--s6); text-align: center; color: var(--ink-2); }
.empty .ic.xl { display: block; margin: 0 auto var(--s3); color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Loading placeholders */
.skel { border-radius: var(--radius-lg); background: linear-gradient(90deg, #eeede8 0%, #f6f5f1 50%, #eeede8 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel + .skel { margin-top: var(--s3); }

/* Motion. .enter is set for one moment when a page opens, so polling redraws don't re-animate. */
.enter > * { animation: rise 420ms var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: 50ms; }
.enter > *:nth-child(3) { animation-delay: 100ms; }
.enter > *:nth-child(4) { animation-delay: 150ms; }
.enter > *:nth-child(n+5) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
