:root {
  --navy-950: #0a0f1c;
  --navy-900: #0f172a;
  --navy-800: #1b2537;
  --navy-700: #2a3648;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;

  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-bg: #eff6ff;

  --amber: #b45309;
  --amber-bg: #fef3c7;
  --blue: #1d4ed8;
  --blue-bg: #dbeafe;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --orange: #c2410c;
  --orange-bg: #ffedd5;
  --purple: #6d28d9;
  --purple-bg: #ede9fe;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

/* Any class that sets its own `display` (e.g. .btn-secondary's inline-flex)
   has the same specificity as the UA's [hidden] rule, and can win on source
   order — silently showing an element JS just hid. This settles it for
   every element, permanently, instead of patching one class at a time. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--slate-100);
  color: var(--navy-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--slate-500); }
.small { font-size: 0.8125rem; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--slate-300); cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--navy-900);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: var(--slate-300); background: var(--slate-50); }
.btn-secondary.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-dark); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; background: var(--white); }
.btn-secondary:disabled:hover { border-color: var(--slate-200); background: var(--white); }

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--slate-500);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { background: var(--slate-100); color: var(--navy-900); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  width: 100%;
}
.btn-danger:hover { background: #fecaca; }

.btn-large { width: 100%; padding: 0.85rem 1.1rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }

/* ---------- driver pages ---------- */
body.driver {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-900) 180px, var(--slate-100) 180px);
}

.driver-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-top: 1rem;
}

.brand { text-align: center; margin-bottom: 1.5rem; }
.brand-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem;
  margin: 0 auto 0.75rem;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.brand h1 { font-size: 1.375rem; margin-bottom: 0.35rem; }
.brand p { font-size: 0.9375rem; }

#checkinForm label, .field {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 1rem;
}
.optional { font-weight: 400; color: var(--slate-500); }

#checkinForm input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 1rem;
  color: var(--navy-900);
}
#checkinForm input:focus {
  outline: none;
  border-color: var(--accent);
}

.trip-type-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.trip-btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-700);
}
.trip-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-dark);
}

.error {
  color: var(--red);
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.status-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.status-icon {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.status-banner h1 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.status-banner p { font-size: 0.875rem; }
.status-icon-sorry { background: var(--red-bg); color: var(--red); }
.reject-reason {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-weight: 600;
  margin: 0.6rem 0;
}

.summary {
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 0.3rem 0;
}
.summary-row span { color: var(--slate-500); }

#enableNotif { margin-bottom: 1.5rem; }

.messages h2 {
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}
.message-list { list-style: none; margin: 0; padding: 0; }
.message-item {
  background: var(--blue-bg);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.65rem;
}
.message-item.acked { background: var(--slate-50); }
.message-body { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.3rem; }
.message-meta { font-size: 0.75rem; color: var(--slate-500); margin-bottom: 0.5rem; }
.ack-badge { color: var(--green); font-weight: 700; font-size: 0.8125rem; }
.ack-btn { width: 100%; }

.request-update-section { margin-top: 1.25rem; }
.request-update-section .btn-secondary { width: 100%; }
.request-update-note {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.request-update-cooldown {
  color: var(--amber);
  background: var(--amber-bg);
  font-variant-numeric: tabular-nums;
}

/* ---------- QR signage page ---------- */
body.qr-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-900);
}
.qr-card {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  max-width: 460px;
}
.qr-card h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.qr-card img { width: 280px; height: 280px; margin-bottom: 1.5rem; }
.qr-card p { color: var(--slate-500); font-size: 1rem; }
@media print {
  body.qr-page { background: var(--white); }
  .qr-card { box-shadow: none; }
}

/* ---------- dashboard ---------- */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-900);
}
.login-card {
  width: 100%; max-width: 360px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}
.login-card h1 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.login-card label { display: block; text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--navy-700); margin-bottom: 1.25rem; }
.login-card input {
  display: block; width: 100%; margin-top: 0.4rem;
  padding: 0.75rem 0.85rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200); font-size: 1rem;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

.app-header {
  background: var(--navy-900);
  color: var(--white);
  padding: 1rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 0.9rem; }
.app-header h1 { font-size: 1.125rem; }
.app-header .muted { color: var(--slate-300); font-size: 0.8125rem; margin-top: 0.15rem; }
.header-tenant-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}
.tenant-info-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.tenant-company {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.tenant-plan-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: rgba(255,255,255,0.12);
  color: var(--slate-300);
}
/* Trial = Bronze, Basic = Silver, Enterprise = Gold — a medal-tier feel. */
.tenant-plan-badge.plan-trial { background: #cd7f32; color: #fff; }
.tenant-plan-badge.plan-basic { background: #c8ccd4; color: #1f2937; }
.tenant-plan-badge.plan-enterprise { background: #d4af37; color: #3f2d00; }
.tenant-expiry {
  font-size: 0.75rem;
  color: var(--slate-300);
  white-space: nowrap;
  text-align: center;
}
.header-right { display: flex; align-items: center; gap: 0.6rem; }

.header-right .btn-secondary, .header-right .btn-ghost {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--white);
}
.header-right .btn-secondary:hover { background: rgba(255,255,255,0.12); }
.header-right .btn-secondary.active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.header-right .btn-ghost { color: var(--slate-300); }
.header-right .btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.stat {
  text-align: center;
  padding: 0 0.9rem;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.stat span { display: block; font-size: 1.25rem; font-weight: 800; }
.stat label { display: block; font-size: 0.6875rem; color: var(--slate-300); text-transform: uppercase; letter-spacing: 0.04em; }

.board {
  max-width: 1600px;
  margin: 1.75rem auto;
  padding: 0 1.75rem;
}
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.ticker-board {
  flex: 1 1 260px;
  min-width: 220px;
  height: 38px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  position: relative;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll linear infinite;
}
.ticker-set {
  display: inline-flex;
  align-items: center;
}
.ticker-item {
  display: inline-block;
  padding: 0 1.5rem;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffb000;
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.85), 0 0 2px rgba(255, 176, 0, 0.6);
}
.ticker-item .ticker-sep {
  color: #7a4c00;
  margin-right: 1.5rem;
  text-shadow: none;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.day-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
}
.day-btn-start { background: var(--green); }
.day-btn-start:hover { background: #15803d; }
.day-btn-end { background: var(--red); }
.day-btn-end:hover { background: #991b1b; }
.view-btn {
  background: var(--white);
  color: var(--navy-700);
  border: 1.5px solid var(--slate-200);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.view-btn:hover { border-color: var(--slate-300); }
.view-btn.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-dark); }
.board-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.board-columns.view-inbound, .board-columns.view-outbound { grid-template-columns: 1fr; }
.board-columns.view-inbound #outboundSection,
.board-columns.view-outbound #inboundSection { display: none; }
@media (max-width: 1100px) {
  .board-columns { grid-template-columns: 1fr; }
}
.board-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.board-column-header .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-inbound { background: #0ea5e9; }
.dot-outbound { background: #8b5cf6; }
.board-column-header h2 { font-size: 1.0625rem; }
.board-column-header .count {
  font-size: 0.8125rem;
  color: var(--slate-500);
  font-weight: 600;
}
.board-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.board-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--white);
  overflow: hidden;
}
.board-table th:nth-child(1), .board-table td:nth-child(1) { width: 21%; }
.board-table td:nth-child(1) { text-align: center; }
.board-table th:nth-child(2), .board-table td:nth-child(2) { width: 17%; }
.board-table th:nth-child(3), .board-table td:nth-child(3) { width: 19%; }
.board-table th:nth-child(4), .board-table td:nth-child(4) { width: 12%; }
.board-table th:nth-child(5), .board-table td:nth-child(5) { width: 31%; }
.board-table thead th {
  text-align: left;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
}
.board-row td {
  padding: 0.7rem 0.6rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--slate-100);
  overflow-wrap: break-word;
}
.board-row:last-child td { border-bottom: none; }
.board-row { cursor: pointer; transition: background 0.12s ease; }
.board-row:hover { background: var(--slate-50); }
.board-row .mono { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; letter-spacing: 0.02em; }
.board-row td.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-row.row-overdue { background: var(--red-bg); }
.board-row.row-overdue:hover { background: #fecaca; }
.job-timer {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.badge-waiting { background: var(--amber-bg); color: var(--amber); }
.badge-notified { background: var(--blue-bg); color: var(--blue); }
.badge-overdue { background: var(--red); color: var(--white); }
.badge-cancelled { background: var(--red); color: var(--white); }
.badge-acknowledged { background: var(--green-bg); color: var(--green); }
.badge-job { background: var(--orange-bg); color: var(--orange); }
.badge-complete { background: var(--green-bg); color: var(--green); }
.badge-transition { background: #ede9fe; color: #6d28d9; }
.badge-unreachable { background: var(--purple-bg); color: var(--purple); }
.badge-update-requested { animation: badge-flash-red-blue 1s steps(1, end) infinite; }
.badge-info-required { background: #eab308; color: #1c1917; }
@keyframes badge-flash-red-blue {
  0%, 49% { background: var(--red); color: var(--white); }
  50%, 100% { background: #1d4ed8; color: var(--white); }
}
.ack-tick { color: var(--green); }

.trip-tag {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  white-space: normal;
  line-height: 1.3;
}
.board-row.row-returning { box-shadow: inset 3px 0 0 #8b5cf6; }

.manual-tag, .security-tag {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: normal;
  line-height: 1.3;
}
.manual-tag { background: var(--navy-800); color: var(--white); }
.security-tag { background: var(--red-bg); color: var(--red); }

.security-banner {
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
}
.manual-banner {
  background: var(--navy-800);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

.completed-toggle {
  background: var(--white);
  color: var(--navy-700);
  border: 1.5px solid var(--slate-200);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.completed-toggle:hover { border-color: var(--slate-300); }
.completed-toggle.active { border-color: var(--navy-700); background: var(--navy-800); color: var(--white); }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.9375rem;
}

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: var(--white);
  box-shadow: -8px 0 24px rgba(15,23,42,0.15);
  display: flex; flex-direction: column;
}
.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.drawer-header h2 { font-size: 1.125rem; }
.drawer-header .muted { font-size: 0.8125rem; margin-top: 0.25rem; }
.drawer-body { padding: 1.5rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 1.25rem; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-btn {
  background: var(--accent-bg);
  color: var(--accent-dark);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.quick-btn:hover { background: #dbeafe; }

.status-btn {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.status-btn:hover { background: #fed7aa; }
.status-btn.active { background: var(--orange); color: var(--white); border-color: var(--orange); }

.status-line {
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-top: 0.35rem;
}

.btn-orange {
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
}
.btn-orange:hover { background: #9a3412; }

.job-status-section {
  background: var(--orange-bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1.25rem;
}
.job-status-section p { font-size: 0.875rem; color: var(--orange); margin-bottom: 0.75rem; font-weight: 600; }
.job-status-section .ack-badge { display: block; text-align: center; }
.job-status-section.cancel-notice { background: var(--red-bg); }

#loadDetailsSection label, #deliveryDetailsSection label, #addNewForm label, #tabSecurity label, #drawerDetailsEditFields label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 0.75rem;
}
#loadDetailsSection input, #loadDetailsSection textarea, #deliveryDetailsSection input, #addNewForm input, #tabSecurity input[type="number"], #drawerDetailsEditFields input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 0.9375rem;
  font-family: inherit;
  resize: vertical;
}
#loadDetailsSection input:focus, #loadDetailsSection textarea:focus, #deliveryDetailsSection input:focus, #addNewForm input:focus, #tabSecurity input:focus, #drawerDetailsEditFields input:focus { outline: none; border-color: var(--accent); }

.field-pair { display: flex; gap: 0.75rem; }
.field-pair label { flex: 1; min-width: 0; }

.finish-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.finish-actions button { flex: 1; }

.details-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.details-header h3 { margin: 0; }
.icon-btn {
  background: none;
  border: none;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--slate-500);
}
.icon-btn:hover { background: var(--slate-100); color: var(--navy-700); }
#drawerDetailsEdit .quick-actions { margin-top: 0.5rem; }
#loadDetailsSection #loadDetailsNote, #deliveryDetailsSection #deliveryDetailsNote { margin-bottom: 0.75rem; }
#saveLoadDetailsBtn, #saveDeliveryDetailsBtn { width: 100%; margin-bottom: 0.5rem; }
#officeCompleteBtn { margin-top: 0.75rem; }
.job-status-section.cancel-notice p { color: var(--red); }
.job-status-section.cancel-notice .cancel-reason-text { font-weight: 400; margin-top: -0.4rem; }

#cancelBtn { margin-top: 0.75rem; }
#uncancelBtn { width: 100%; margin-top: 0.75rem; }
#cancelReasonForm { margin-top: 0.75rem; }
#cancelReasonInput {
  width: 100%;
  min-height: 60px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}
#cancelReasonInput:focus { outline: none; border-color: var(--accent); }

#messageForm textarea {
  width: 100%;
  min-height: 80px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  padding: 0.75rem;
  font-size: 0.9375rem;
  resize: vertical;
  margin-bottom: 0.75rem;
}
#messageForm textarea:focus { outline: none; border-color: var(--accent); }

/* customize modal */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-panel {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: 85vh;
  margin: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.qm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.qm-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.875rem;
}
.qm-delete {
  flex: none;
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.qm-delete:hover { background: var(--red-bg); }

#qmForm { display: flex; gap: 0.5rem; }
#qmForm input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 0.9375rem;
}
#qmForm input:focus { outline: none; border-color: var(--accent); }

.modal-panel-wide { max-width: 560px; }

.upgrade-panel { max-width: 400px; }
.upgrade-body { text-align: center; padding: 1.5rem; }
.upgrade-icon {
  width: 56px; height: 56px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem;
}
.upgrade-body #upgradeMessage { font-weight: 600; font-size: 1rem; margin: 0 0 0.5rem; }
.upgrade-body .muted { margin-bottom: 1.25rem; }
.upgrade-body .btn-primary { width: 100%; text-align: center; text-decoration: none; display: inline-block; }
.upgrade-body p:not(.muted) { font-weight: 600; font-size: 1rem; margin: 0 0 0.5rem; }
.upgrade-icon-alert { background: var(--red-bg); color: var(--red); }

.tab-bar {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--slate-200);
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-500);
  white-space: nowrap;
}
.tab-btn + .tab-btn { margin-left: 1rem; }
.tab-btn:hover { color: var(--navy-700); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.switch-row {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}
.switch-row input[type="checkbox"] { width: auto; margin: 0; }

.settings-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.field-builder-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.field-builder-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
}
.field-label-input {
  flex: 1 1 140px;
  min-width: 100px;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 0.875rem;
}
.field-label-input:focus { outline: none; border-color: var(--accent); }
.field-applies-select {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 0.8125rem;
  background: var(--white);
  color: var(--navy-700);
}
.field-required-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--slate-500);
  white-space: nowrap;
}
.field-required-check input { width: auto; margin: 0; }
.field-delete-btn {
  flex: none;
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.field-delete-btn:hover { background: var(--red-bg); }
#addFieldBtn { margin-bottom: 0.75rem; }

.settings-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.875rem;
}
.settings-checkbox-row input { width: auto; margin: 0; }

.drawer-body h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500); }
.history-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.history-list li {
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  .board { padding: 0 0.75rem; }
  .board-table thead { display: none; }
  .board-table, .board-table tbody, .board-row, .board-row td { display: block; width: 100%; }
  .board-row { padding: 0.75rem 1rem; border-bottom: 1px solid var(--slate-100); }
  .board-row td { padding: 0.15rem 0; border-bottom: none; }
  .header-right .stat { display: none; }
}
