/* Folfem POC — logo palette: signal red + royal blue on clean off-white */
:root {
  --bg: oklch(0.975 0.002 250);
  --bg-tint: oklch(0.95 0.004 250);
  --panel: #ffffff;
  --panel-2: oklch(0.99 0.002 250);
  --line: oklch(0.91 0.004 250);
  --line-strong: oklch(0.84 0.006 250);
  --ink: oklch(0.22 0.015 260);
  --ink-2: oklch(0.38 0.015 260);
  --muted: oklch(0.55 0.012 260);
  --soft: oklch(0.7 0.012 260);

  --accent: oklch(0.55 0.21 27);
  --accent-ink: oklch(0.46 0.19 27);
  --accent-soft: oklch(0.95 0.045 27);
  --accent-line: oklch(0.86 0.09 27);

  --amber: oklch(0.72 0.15 75);
  --amber-soft: oklch(0.95 0.05 80);
  --amber-ink: oklch(0.42 0.12 60);

  --blue: oklch(0.45 0.16 258);
  --blue-soft: oklch(0.94 0.04 258);
  --blue-ink: oklch(0.37 0.14 258);

  --red: oklch(0.55 0.18 25);
  --red-soft: oklch(0.95 0.04 25);
  --red-ink: oklch(0.42 0.15 25);

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 0 oklch(0.92 0.006 85), 0 1px 2px oklch(0.85 0.008 85 / 0.4);

  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ===== App shell ===== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 16px;
}
.brand-mark {
  width: 26px; height: 26px;
  background: #fff url(assets/folfem-logo.png) center/contain no-repeat;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark::before {
  content: none;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 4px;
}

.role-switcher {
  display: flex;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.role-switcher button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-switcher button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px oklch(0.85 0.01 80 / 0.5);
}
.role-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.role-switcher button.active .role-dot { background: var(--accent); opacity: 1; }

/* Static persona indicator (route-based; replaces the old tab switcher) */
.persona-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.persona-pill .role-dot { background: var(--accent); opacity: 1; }

.portal-switch {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.portal-switch:hover { color: var(--ink); text-decoration: underline; }

.topbar-spacer { flex: 1; }
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.topbar-meta .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: oklch(0.5 0.13 150);
  font-weight: 600;
}
.topbar-meta .live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: oklch(0.55 0.14 150);
  box-shadow: 0 0 0 3px oklch(0.55 0.14 150 / 0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px oklch(0.55 0.14 150 / 0.2); }
  50% { box-shadow: 0 0 0 5px oklch(0.55 0.14 150 / 0.05); }
}

.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ===== Common components ===== */
.btn {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--bg-tint); border-color: var(--soft); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-tint); }
.btn-danger { color: var(--red-ink); border-color: var(--red-soft); background: var(--panel); }
.btn-danger:hover { background: var(--red-soft); }
.btn-lg { padding: 12px 18px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  background: var(--bg-tint);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.status-Pending { background: var(--amber-soft); color: var(--amber-ink); border-color: oklch(0.9 0.06 80); }
.status-Assigned { background: var(--blue-soft); color: var(--blue-ink); border-color: oklch(0.9 0.03 240); }
.status-Accepted { background: oklch(0.95 0.04 200); color: oklch(0.4 0.1 220); border-color: oklch(0.88 0.05 220); }
.status-InTransit { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.status-Delivered { background: oklch(0.94 0.02 150); color: oklch(0.32 0.06 150); border-color: oklch(0.86 0.04 150); }
.status-Cancelled { background: var(--red-soft); color: var(--red-ink); border-color: oklch(0.88 0.05 25); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 18px; }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 13px; font-weight: 700; letter-spacing: -0.005em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.55 0.21 27 / 0.15);
}
.textarea { resize: vertical; min-height: 76px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.mono { font-family: var(--font-mono); }

/* ===== Client view ===== */
.client-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 24px 80px;
  background: var(--bg);
}
.client-shell { width: 100%; max-width: 1080px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
@media (max-width: 920px) { .client-shell { grid-template-columns: 1fr; } }

.client-hero { margin-bottom: 20px; }
.client-hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.client-hero p { color: var(--muted); margin: 0; font-size: 14px; }

.form-section {
  padding: 22px 22px 24px;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 4px;
}
.section-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.005em; }

.cargo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cargo-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  transition: all 0.12s;
}
.cargo-card:hover { border-color: var(--soft); }
.cargo-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.cargo-card .glyph {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.cargo-card.selected .glyph { background: var(--panel); }
.cargo-card .name { font-weight: 700; font-size: 13px; }
.cargo-card .desc { font-size: 11px; color: var(--muted); }

.route-stack { display: flex; flex-direction: column; gap: 14px; position: relative; }
.route-row { display: flex; gap: 14px; align-items: flex-start; }
.route-rail { width: 24px; display: flex; flex-direction: column; align-items: center; padding-top: 28px; }
.route-pin {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  outline: 2px solid var(--accent);
  background: var(--accent);
}
.route-pin.dest { background: var(--panel); outline-color: var(--ink); }
.route-line { flex: 1; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 4px, transparent 4px 8px); min-height: 24px; }
.route-fields { flex: 1; }
.route-fields .label { display: block; margin-bottom: 6px; }

.summary-card { position: sticky; top: 80px; align-self: start; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row .k { color: var(--muted); }
.summary-row .v { font-weight: 600; text-align: right; max-width: 60%; }
.summary-total { padding: 12px 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.summary-total .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.summary-total .v { font-size: 22px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.01em; }

/* My requests list */
.my-jobs { padding: 0; }
.my-job {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.my-job:hover { background: var(--bg-tint); }
.my-job:last-child { border-bottom: 0; }
.my-job .jid { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.my-job .jroute { font-weight: 600; font-size: 13px; margin-top: 2px; }
.my-job .jmeta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ===== Admin view ===== */
.admin-shell { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar .nav-group { margin-top: 18px; }
.sidebar .nav-group:first-child { margin-top: 0; }
.sidebar .nav-label { padding: 0 10px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sidebar a, .sidebar button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
}
.sidebar a:hover, .sidebar button:hover { background: var(--bg-tint); }
.sidebar .active { background: var(--accent-soft); color: var(--accent-ink); }
.sidebar .counter { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sidebar .active .counter { color: var(--accent-ink); }

.main {
  padding: 24px 28px 40px;
  overflow: auto;
  background: var(--bg);
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.kpi .v { font-size: 28px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.02em; margin-top: 6px; }
.kpi .delta { font-size: 11px; margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.kpi .delta.up { color: var(--accent-ink); }
.kpi .spark { margin-top: 10px; height: 28px; }

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* Job table */
.jobs-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.jobs-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.jobs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.jobs-table tr:last-child td { border-bottom: 0; }
.jobs-table tr.selectable { cursor: pointer; }
.jobs-table tr.selectable:hover td { background: var(--bg-tint); }
.jobs-table tr.selected td { background: var(--accent-soft); }
.jobs-table .jid { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.jobs-table .route { font-weight: 600; }
.jobs-table .route small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: 2px; }
.jobs-table .driver { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  flex-shrink: 0;
}
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 48px; height: 48px; font-size: 16px; }

/* Driver picker (admin) */
.driver-picker { padding: 0; }
.driver-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.driver-row:hover { background: var(--bg-tint); }
.driver-row:last-child { border-bottom: 0; }
.driver-row .meta { flex: 1; }
.driver-row .nm { font-weight: 600; font-size: 13px; }
.driver-row .sub { font-size: 11px; color: var(--muted); }
.driver-row .badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tint);
  color: var(--muted);
}
.driver-row .badge.available { background: var(--accent-soft); color: var(--accent-ink); }
.driver-row .badge.busy { background: var(--amber-soft); color: var(--amber-ink); }
.driver-row .badge.offline { background: var(--bg-tint); color: var(--muted); }

/* Map placeholder */
.map-placeholder {
  position: relative;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background:
    repeating-linear-gradient(45deg, oklch(0.96 0.005 80) 0 12px, oklch(0.945 0.008 80) 12px 24px);
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}
.map-placeholder .map-label {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
}
.map-placeholder .pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 6px oklch(0.55 0.21 27 / 0.4);
}
.map-placeholder .pin.dest { background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.map-placeholder .route-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Detail drawer */
.drawer {
  background: var(--panel);
  border-left: 1px solid var(--line);
  width: 420px;
  flex-shrink: 0;
  overflow: auto;
}
.drawer-section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-section h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; max-width: 60%; }

/* Activity log / inbox */
.log {
  display: flex;
  flex-direction: column;
}
.log-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
}
.log-item:last-child { border-bottom: 0; }
.log-glyph {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.log-glyph.sms { background: var(--accent-soft); color: var(--accent-ink); }
.log-glyph.email { background: var(--blue-soft); color: var(--blue-ink); }
.log-glyph.event { background: var(--amber-soft); color: var(--amber-ink); }
.log-body { flex: 1; min-width: 0; }
.log-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.log-title { font-weight: 600; font-size: 13px; }
.log-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.log-text { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.log-text .to { color: var(--muted); }

/* Toasts */
.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  pointer-events: auto;
  box-shadow: 0 8px 20px oklch(0.2 0.01 80 / 0.18);
  animation: toastIn 0.25s ease-out;
}
.toast .icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast .body { flex: 1; }
.toast .t { font-weight: 700; }
.toast .d { font-size: 11px; opacity: 0.75; margin-top: 2px; }
@keyframes toastIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Driver: desktop ===== */
.driver-shell { flex: 1; display: flex; min-height: 0; background: var(--bg); }
.driver-modeswitch {
  display: flex;
  gap: 0;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  align-items: center;
  justify-content: space-between;
}
.driver-modeswitch .tabs {
  display: flex;
  gap: 4px;
}
.driver-modeswitch .tabs button {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.driver-modeswitch .tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.driver-modeswitch .meta { color: var(--muted); font-size: 12px; padding-bottom: 10px; }

.driver-desktop {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
}
.dd-list { border-right: 1px solid var(--line); background: var(--panel); overflow: auto; }
.dd-list-head { padding: 16px 18px 8px; }
.dd-list-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.dd-list-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.dd-jobs { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.dd-jobs button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dd-jobs button:hover { border-color: var(--soft); }
.dd-jobs button.active { border-color: var(--accent); background: var(--accent-soft); }
.dd-jobs .top { display: flex; justify-content: space-between; align-items: center; }
.dd-jobs .jid { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.dd-jobs .route { font-weight: 600; font-size: 13px; line-height: 1.3; }
.dd-jobs .route span { color: var(--muted); margin: 0 4px; }
.dd-jobs .sub { font-size: 11px; color: var(--muted); }

.dd-detail { padding: 24px 28px; overflow: auto; }
.dd-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.dd-hero h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.dd-hero .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dd-hero .actions { margin-left: auto; display: flex; gap: 8px; }

.timeline { display: flex; flex-direction: column; gap: 0; padding: 6px 0; }
.timeline-row { display: flex; gap: 14px; align-items: flex-start; position: relative; }
.timeline-bullet {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  margin-top: 2px;
  z-index: 1;
  flex-shrink: 0;
}
.timeline-row.done .timeline-bullet { background: var(--accent); border-color: var(--accent); }
.timeline-row.current .timeline-bullet { background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-line {
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: -22px;
  width: 2px;
  background: var(--line-strong);
}
.timeline-row.done .timeline-line { background: var(--accent); }
.timeline-row:last-child .timeline-line { display: none; }
.timeline-content { padding-bottom: 22px; flex: 1; }
.timeline-name { font-weight: 600; font-size: 13px; }
.timeline-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.timeline-row.upcoming .timeline-name { color: var(--muted); }

/* ===== Driver: mobile (inside iOS frame) ===== */
.dm {
  height: 100%;
  width: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.dm-head {
  padding: 12px 16px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dm-head .av { background: var(--ink); color: var(--bg); }
.dm-head .who { flex: 1; }
.dm-head .who .nm { font-weight: 700; font-size: 13px; }
.dm-head .who .st { font-size: 11px; color: var(--accent-ink); display: flex; align-items: center; gap: 5px; }
.dm-head .who .st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dm-head .menu {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.dm-body { flex: 1; overflow: auto; padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 12px; }

.dm-summary { margin-bottom: 6px; }
.dm-summary .label-row { display: flex; justify-content: space-between; align-items: baseline; }
.dm-summary h2 { margin: 4px 0 2px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.dm-summary .meta { font-size: 12px; color: var(--muted); }

.dm-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.dm-card h4 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.dm-map {
  border-radius: 12px;
  height: 130px;
  position: relative;
  background:
    repeating-linear-gradient(45deg, oklch(0.96 0.005 80) 0 10px, oklch(0.945 0.008 80) 10px 20px);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.dm-map .map-label {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--panel);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
}

.dm-route { display: flex; gap: 10px; }
.dm-route .rail { width: 14px; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.dm-route .pin { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.dm-route .pin.dest { background: var(--ink); }
.dm-route .line { width: 2px; flex: 1; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 3px, transparent 3px 6px); min-height: 18px; }
.dm-route .stops { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.dm-route .stop { font-size: 12px; }
.dm-route .stop .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.dm-route .stop .addr { font-weight: 600; }
.dm-route .stop .sub { color: var(--muted); font-size: 11px; }

.dm-actions { padding: 12px 14px 14px; background: var(--panel); border-top: 1px solid var(--line); }
.dm-actions .btn { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }
.dm-actions .row-2 { display: flex; gap: 8px; }

/* ===== Driver wallet ===== */
.wallet-hero {
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 85% -10%, oklch(0.55 0.13 150), transparent 60%),
    linear-gradient(165deg, oklch(0.4 0.11 150), oklch(0.3 0.09 155));
  box-shadow: 0 10px 24px oklch(0.4 0.08 150 / 0.28);
}
.wallet-hero .wh-label { font-size: 12px; opacity: 0.78; font-weight: 600; }
.wallet-hero .wh-balance { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; font-family: var(--font-mono); }
.wallet-hero .wh-sub { font-size: 12px; opacity: 0.78; margin-bottom: 16px; }
.wallet-hero .wh-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.wallet-hero .wh-btn:hover { transform: translateY(-1px); }
.wallet-hero .wh-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.wallet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.wallet-stat .ws-val { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.wallet-stat .ws-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 600; }

.wallet-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}
.wallet-row:first-of-type { border-top: 0; }
.wr-icon {
  width: 34px; height: 34px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.wr-icon.out { background: var(--bg-tint); color: var(--ink-2); }
.wr-main { flex: 1; min-width: 0; }
.wr-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.wr-amt { text-align: right; flex: none; }
.wr-amt .mono { font-size: 13px; }
.wr-state { font-size: 10px; font-weight: 700; margin-top: 1px; }
.wr-state.ready { color: var(--accent-ink); }
.wr-state.paid { color: var(--muted); }
.wr-state.proc { color: var(--amber-ink); }

.wallet-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.2 0.01 80 / 0.4);
  display: flex;
  align-items: flex-end;
  z-index: 30;
  animation: wsFade 0.18s ease;
}
@keyframes wsFade { from { opacity: 0; } to { opacity: 1; } }
.wallet-sheet {
  width: 100%;
  background: var(--panel);
  border-radius: 18px 18px 0 0;
  padding: 16px 18px 22px;
  animation: wsUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes wsUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.wallet-sheet .ws-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.wallet-sheet h3 { margin: 0 0 4px; font-size: 16px; }
.wallet-sheet .ws-amount { font-size: 28px; font-weight: 800; font-family: var(--font-mono); letter-spacing: -0.02em; margin-bottom: 16px; }
.wallet-sheet .ws-field { margin-bottom: 14px; }
.wallet-sheet .ws-flabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: block; margin-bottom: 7px; }
.wallet-sheet .ws-bank {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.wallet-sheet .ws-note { font-size: 11px; color: var(--muted); line-height: 1.45; margin-bottom: 14px; }


/* OTP numpad */
.otp-display {
  font-family: var(--font-mono);
  font-size: 30px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 16px 0;
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: 16px;
  font-weight: 600;
}
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin: 12px 0 20px; }
.otp-box {
  width: 40px; height: 48px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  background: var(--panel);
}
.otp-box.filled { border-color: var(--accent); color: var(--accent-ink); }
.otp-box.cursor { border-color: var(--ink); }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button {
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
}
.numpad button:active { background: var(--bg-tint); }
.numpad button.clear { color: var(--red-ink); }
.numpad button.submit { background: var(--accent); color: white; border-color: var(--accent); }

/* Slide-to-confirm */
.slide-confirm {
  position: relative;
  height: 52px;
  border-radius: 999px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.slide-confirm .track-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.slide-confirm .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  cursor: grab;
  box-shadow: 0 2px 6px oklch(0.4 0.1 150 / 0.4);
}
.slide-confirm .knob:active { cursor: grabbing; }
.slide-confirm .fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--accent-soft);
  pointer-events: none;
}

/* Tweaks panel button styling override (lightweight) */
.tweaks-pill {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* ===== Auth ===== */
.auth-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--bg);
}

/* Client auth: split with marketing panel */
.auth-client {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}
@media (max-width: 900px) { .auth-client { grid-template-columns: 1fr; } .auth-marketing { display: none; } }
.auth-marketing {
  background: var(--ink);
  color: var(--bg);
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-marketing::after {
  content: "";
  position: absolute;
  right: -120px; bottom: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
  opacity: 0.5;
  pointer-events: none;
}
.auth-marketing h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 24px 0 14px;
  max-width: 460px;
}
.auth-marketing p {
  font-size: 14px;
  color: oklch(0.7 0.01 80);
  max-width: 420px;
  margin: 0 0 28px;
  line-height: 1.6;
}
.auth-marketing .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: auto;
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-marketing .stat .v {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.auth-marketing .stat .v .unit { font-size: 14px; color: var(--accent); margin-left: 2px; }
.auth-marketing .stat .k { font-size: 11px; color: oklch(0.6 0.01 80); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; font-weight: 600; }
.auth-marketing .testimonial {
  margin-top: 28px;
  padding: 18px;
  background: oklch(0.18 0.005 80);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-marketing .testimonial q {
  font-size: 13px;
  line-height: 1.55;
  color: oklch(0.86 0.005 80);
  quotes: '“' '”';
}
.auth-marketing .testimonial .who {
  font-size: 11px;
  color: oklch(0.6 0.01 80);
  margin-top: 10px;
}
.auth-marketing .brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.auth-marketing .brand-mark {
  background: #fff url(assets/folfem-logo.png) center/contain no-repeat;
}

.auth-form-side {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--panel);
}
.auth-card-shell {
  width: 100%;
  max-width: 380px;
}
.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.auth-h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.auth-sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.55;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .row-between { display: flex; justify-content: space-between; align-items: center; }
.auth-form a {
  font-size: 12px;
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.auth-form a:hover { text-decoration: underline; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: 0;
  border: 0;
  padding: 6px 8px;
  margin-left: -8px;
  margin-bottom: 12px;
  border-radius: 6px;
}
.auth-back:hover { background: var(--bg-tint); color: var(--ink); }

.auth-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.auth-strength span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.2s;
}
.auth-strength.s1 span:nth-child(-n+1) { background: var(--red); }
.auth-strength.s2 span:nth-child(-n+2) { background: var(--amber); }
.auth-strength.s3 span:nth-child(-n+3) { background: oklch(0.7 0.12 100); }
.auth-strength.s4 span { background: oklch(0.55 0.14 150); }

.auth-check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.auth-check-list li {
  list-style: none;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-check-list li.ok { color: oklch(0.5 0.13 150); }
.auth-check-list .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auth-check-list li.ok .dot { background: oklch(0.55 0.14 150); color: white; }

/* Admin auth: console card, centered */
.auth-admin {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 0% 0%, oklch(0.945 0.012 150 / 0.6), transparent 50%),
    radial-gradient(circle at 100% 100%, oklch(0.95 0.01 240 / 0.5), transparent 50%),
    var(--bg);
}
.auth-admin-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px oklch(0.2 0.01 80 / 0.06), 0 1px 0 var(--line);
  padding: 36px 32px 28px;
  position: relative;
}
.auth-admin-card .lockup {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-admin-card .lockup .brand-mark { width: 30px; height: 30px; }
.auth-admin-card .lockup .nm { font-weight: 700; font-size: 17px; }
.auth-admin-card .console-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.auth-admin-card .auth-h1 { text-align: center; font-size: 22px; }
.auth-admin-card .auth-sub { text-align: center; }

.mfa-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mfa-note strong { color: var(--ink); font-weight: 600; }

/* Driver auth: phone frame */
.auth-driver {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
  background: var(--bg);
  gap: 48px;
  flex-wrap: wrap;
}
.auth-driver-aside {
  max-width: 320px;
}
.auth-driver-aside h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.auth-driver-aside p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px;
}
.auth-driver-aside .feat {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.auth-driver-aside .feat .glyph {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auth-driver-aside .feat .nm { font-weight: 600; font-size: 13px; }
.auth-driver-aside .feat .ds { font-size: 12px; color: var(--muted); }

.auth-dm {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 0;
}
.auth-dm-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 28px 0 28px;
}
.auth-dm-logo .brand-mark { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.auth-dm-logo .brand-mark::before { width: 18px; height: 18px; }
.auth-dm-logo .nm { font-weight: 700; font-size: 18px; }
.auth-dm-logo .sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.auth-dm h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 6px;
}
.auth-dm .auth-sub {
  text-align: center;
  margin-bottom: 22px;
  padding: 0 8px;
}
.auth-dm .input { padding: 13px 14px; font-size: 15px; border-radius: 10px; }
.auth-dm .btn { padding: 14px; border-radius: 12px; font-size: 14px; justify-content: center; }
.auth-dm .otp-boxes .otp-box { width: 44px; height: 52px; font-size: 24px; }
.auth-dm .auth-back {
  align-self: flex-start;
}

.phone-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.phone-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.55 0.21 27 / 0.15); }
.phone-input .cc {
  padding: 13px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  border-right: 1px solid var(--line);
  background: var(--bg-tint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.phone-input input {
  flex: 1;
  padding: 13px 14px;
  font-size: 15px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
}

.sign-out-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sign-out-btn:hover { color: var(--ink); background: var(--bg-tint); }

.success-tick {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  animation: tickIn 0.4s ease-out;
}
@keyframes tickIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Demo credentials chip on login screens */
.demo-creds {
  margin-top: 18px;
  padding: 10px 12px;
  background: var(--bg-tint);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}
.demo-creds strong { color: var(--ink); font-weight: 600; }
.demo-creds .mono { font-size: 11px; color: var(--ink-2); }
.demo-creds button {
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  padding: 5px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.demo-creds button:hover { background: var(--bg-tint); }

/* ===== UK → West Africa re-frame: mode badge, stages, journey ===== */

/* Mid-route pin (clearing hub) in admin drawer */
.dm-route .pin.mid { background: var(--amber); }

/* Transport mode badge */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}
.mode-badge.lg { font-size: 12px; padding: 4px 10px 4px 8px; }
.mode-badge svg { flex-shrink: 0; }
.mode-air { background: var(--blue-soft); color: var(--blue-ink); border-color: oklch(0.9 0.03 240); }
.mode-sea { background: oklch(0.95 0.045 215); color: oklch(0.36 0.09 230); border-color: oklch(0.87 0.05 220); }

/* Stage chips (journey milestones) */
.chip.stage-Booked { background: var(--bg-tint); color: var(--muted); border-color: var(--line-strong); }
.chip.stage-Collected,
.chip.stage-Export { background: var(--blue-soft); color: var(--blue-ink); border-color: oklch(0.9 0.03 240); }
.chip.stage-Transit { background: oklch(0.95 0.045 215); color: oklch(0.36 0.09 230); border-color: oklch(0.87 0.05 220); }
.chip.stage-Arrived,
.chip.stage-Customs { background: var(--amber-soft); color: var(--amber-ink); border-color: oklch(0.9 0.06 80); }
.chip.stage-OutForDelivery { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.chip.stage-Delivered { background: oklch(0.94 0.02 150); color: oklch(0.32 0.06 150); border-color: oklch(0.86 0.04 150); }

/* Horizontal journey tracker */
.journey { position: relative; padding: 4px 0 2px; }
.journey-line {
  position: absolute;
  left: 9px; right: 9px;
  top: 13px;
  height: 2px;
  background: var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.journey.compact .journey-line { top: 9px; }
.journey-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.journey-nodes { position: relative; display: flex; justify-content: space-between; }
.journey-node { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.journey-node .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--panel);
  position: relative;
  z-index: 1;
}
.journey.compact .journey-node .dot { width: 10px; height: 10px; border-width: 2px; }
.journey-node.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.journey-node.current .dot { border-color: var(--accent); background: var(--panel); }
.journey-node.current .dot .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: jpulse 1.6s ease-in-out infinite;
}
.journey.compact .journey-node.current .dot .pulse { width: 5px; height: 5px; }
@keyframes jpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }
.journey-node .lbl {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.journey-node.done .lbl, .journey-node.current .lbl { color: var(--ink-2); }

/* Client booking: service note, customs checks, trust card */
.svc-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--bg-tint);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-2);
}
.svc-note svg { color: var(--accent-ink); flex-shrink: 0; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
  cursor: pointer;
  padding: 2px 0;
}
.check-row input { margin-top: 2px; flex-shrink: 0; }
.check-row strong { color: var(--ink); font-weight: 600; }

/* Client shipments list (with journey tracker) */
.my-job.ship { display: block; }
.my-job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.my-job.ship .jid { display: flex; align-items: center; gap: 8px; }

/* Clickable shipment card (button reset) */
.my-job.clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border-left: 0; border-right: 0; border-top: 0;
  background: var(--panel);
  -webkit-appearance: none;
  appearance: none;
}
.my-job.clickable:hover { background: var(--bg-tint); }
.my-job-act { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ===== Client: shipment detail view ===== */
.detail-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 24px 80px;
  background: var(--bg);
}
.detail-shell { width: 100%; max-width: 980px; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  margin-bottom: 16px;
}
.detail-back:hover { color: var(--accent-ink); }

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-id {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}
.detail-route {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.detail-route .sep { color: var(--soft); font-weight: 400; margin: 0 4px; }
.detail-hint { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.detail-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.detail-eta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.detail-eta span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.detail-eta strong { font-size: 15px; font-family: var(--font-mono); }

.detail-journey-card { padding: 24px 28px 18px; margin-bottom: 22px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; gap: 22px; } }

.detail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 12px;
}

.leg-stack { display: flex; flex-direction: column; gap: 0; position: relative; }
.leg-card {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  position: relative;
}
.leg-card:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px; top: 42px; bottom: -2px;
  width: 2px;
  background: var(--line);
}
.leg-ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--bg-tint);
  color: var(--muted);
  z-index: 1;
}
.leg-card.uk .leg-ic { background: var(--blue-soft); color: var(--blue-ink); }
.leg-card.hub .leg-ic { background: var(--amber-soft); color: var(--amber-ink); }
.leg-card.ng .leg-ic { background: var(--accent-soft); color: var(--accent-ink); }
.leg-body { min-width: 0; padding-top: 1px; }
.leg-tag { font-size: 11px; font-weight: 600; color: var(--muted); }
.leg-name { font-size: 14px; font-weight: 700; margin-top: 3px; letter-spacing: -0.01em; }
.leg-line { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.leg-time { font-size: 11px; color: var(--accent-ink); font-weight: 600; margin-top: 5px; }

.otp-callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--amber-soft);
  border: 1px solid oklch(0.9 0.06 80);
}
.otp-callout.done { background: oklch(0.94 0.02 150); border-color: oklch(0.86 0.04 150); }
.otp-ic { color: var(--amber-ink); flex-shrink: 0; padding-top: 1px; }
.otp-callout.done .otp-ic { color: oklch(0.4 0.08 150); }
.otp-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber-ink); }
.otp-callout.done .otp-k { color: oklch(0.36 0.07 150); }
.otp-v { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: 0.18em; margin: 2px 0; }
.otp-note { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }

.detail-facts { padding: 6px 18px 14px; }
.detail-facts .summary-row .v { max-width: 62%; }

.detail-timeline { padding: 18px 20px 6px; }
.tl-row { display: flex; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tl-row.latest .tl-dot { background: var(--panel); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tl-line { flex: 1; width: 2px; background: var(--line); margin: 2px 0; min-height: 14px; }
.tl-body { padding-bottom: 16px; min-width: 0; }
.tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-stage { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.tl-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.tl-text { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }

.detail-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.detail-footer span { margin-right: auto; }

.trust-card { margin-top: 16px; padding: 6px 4px; }
.trust-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.trust-row:last-child { border-bottom: 0; }
.trust-ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.trust-row strong { display: block; font-size: 12.5px; color: var(--ink); }
.trust-row span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* Driver: origin context note under last-mile route */
.origin-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.origin-note svg { color: var(--blue-ink); flex-shrink: 0; }

/* ===== Client portal: sub-nav ===== */
.client-portal { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.client-subnav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 56px;
  z-index: 40;
}
.client-subnav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 26px;
}
.client-subnav button {
  border: 0;
  background: transparent;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.client-subnav button:hover { color: var(--ink); }
.client-subnav button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ===== Client services page ===== */
.svc-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 40px 24px 80px;
  background: var(--bg);
}
.svc-shell { width: 100%; max-width: 1080px; }

.svc-hero { max-width: 680px; margin-bottom: 28px; }
.svc-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 14px;
}
.svc-hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin: 0 0 12px;
  text-wrap: balance;
}
.svc-hero p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
  text-wrap: pretty;
}

.svc-list { display: flex; flex-direction: column; gap: 18px; }

.svc-block { padding: 0; overflow: hidden; }
.svc-block-grid { display: grid; grid-template-columns: 304px minmax(0, 1fr); }
@media (max-width: 800px) { .svc-block-grid { grid-template-columns: 1fr; } }

.svc-aside {
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
}
@media (max-width: 800px) {
  .svc-aside { border-right: 0; border-bottom: 1px solid var(--line); }
}
.svc-aside-top { display: flex; align-items: flex-start; justify-content: space-between; }
.svc-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.svc-icon.air { background: var(--blue-soft); color: var(--blue-ink); }
.svc-icon.sea { background: oklch(0.95 0.045 215); color: oklch(0.36 0.09 230); }
.svc-icon.land { background: var(--accent-soft); color: var(--accent-ink); }
.svc-num { font-family: var(--font-mono); font-size: 12px; color: var(--soft); }
.svc-aside h2 { margin: 16px 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -0.018em; }
.svc-lead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-mono);
}
.svc-lead svg { color: var(--accent-ink); }
.svc-aside p { margin: 12px 0 20px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.svc-cta { margin-top: auto; }

.svc-feats {
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 26px;
  align-content: start;
}
@media (max-width: 560px) { .svc-feats { grid-template-columns: 1fr; } }
.svc-feats .feat-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}
.svc-feat {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.svc-feat .tick {
  width: 21px; height: 21px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
}

.svc-cta-band {
  margin-top: 22px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--bg);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.svc-cta-band h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: #fff; }
.svc-cta-band p { margin: 0; font-size: 13px; color: oklch(0.78 0.01 80); }
.svc-band-btn {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
  padding: 12px 18px;
  font-size: 14px;
}
.svc-band-btn:hover { background: oklch(0.94 0.005 80); border-color: oklch(0.94 0.005 80); }

.svc-contact {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
@media (max-width: 640px) { .svc-contact { grid-template-columns: 1fr; gap: 18px; } }
.svc-contact-col h4 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
}
.svc-contact-col p, .svc-contact-col a {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  display: block;
  text-decoration: none;
}
.svc-contact-col a:hover { color: var(--accent-ink); }
