/* Dispatch Voice Kit - Live Dispatch Board
   Light industrial control tower aesthetic. No external fonts or assets. */

:root {
  --accent: #2B303A;
  --accent-ink: #FFFFFF;

  --bg-canvas: #F2F1ED;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F8F7F4;
  --bg-hover: #F2F0EA;
  --bg-flash: #FFF3C4;

  --border: #E2DFD7;
  --border-strong: #CCC7BA;

  --ink: #141517;
  --ink-secondary: #4B4E57;
  --ink-muted: #656871;

  /* Fixed semantic palette (WCAG AA contrast) */
  --green-bg: #E6F5EC;
  --green-border: #B3DEC4;
  --green-ink: #0E582E;
  --green-solid: #16803C;

  --amber-bg: #FEF3D6;
  --amber-border: #F2D082;
  --amber-ink: #764800;
  --amber-solid: #C47B00;

  --red-bg: #FDECEC;
  --red-border: #F5BABA;
  --red-ink: #991B1B;
  --red-solid: #C81E1E;

  --blue-bg: #E8F1FD;
  --blue-border: #B8D3FA;
  --blue-ink: #184696;
  --blue-solid: #1D5ED4;

  --neutral-bg: #EFEFE9;
  --neutral-border: #D7D4CB;
  --neutral-ink: #464952;

  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(20, 21, 23, 0.05);
  --shadow-md: 0 6px 20px rgba(20, 21, 23, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.sr-copy-buffer {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

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

/* Focus ring for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--blue-solid);
  outline-offset: 2px;
}

/* Icon sizing */
svg {
  display: block;
  width: 100%;
  height: 100%;
}

.btn-icon,
.line-pill-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------- */
/* Boot and Login views                                                       */
/* -------------------------------------------------------------------------- */

.boot-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.boot-text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-canvas);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow-sm);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.login-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.login-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.login-copy {
  margin: 0 0 18px;
  color: var(--ink-secondary);
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.text-input {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.text-input:focus {
  border-color: var(--blue-solid);
}

.form-error {
  margin: 0;
  padding: 8px 10px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  color: var(--red-ink);
  font-size: 12px;
  font-weight: 500;
}

.form-msg {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  background: var(--neutral-bg);
  color: var(--ink);
}

.form-msg.is-error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red-ink);
}

.form-msg.is-ok {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-ink);
}

.inline-link {
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 11px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 10px;
}

.btn-xs {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: rgba(20, 21, 23, 0.14);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink);
}

.btn-danger {
  background: var(--red-solid);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-ink);
}

.btn-claim {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-color: var(--amber-border);
}

.btn-claim:hover:not(:disabled) {
  background: #FDE7B0;
}

.btn-resolve {
  background: var(--green-bg);
  color: var(--green-ink);
  border-color: var(--green-border);
}

.btn-resolve:hover:not(:disabled) {
  background: #D4EEDF;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Board Shell (Desktop 1440x900 no-page-scroll control tower)                */
/* -------------------------------------------------------------------------- */

.board-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-canvas);
}

/* Header */
.board-header {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-block;
  width: 14px;
  height: 28px;
  border-radius: 3px;
  background: var(--accent);
  border: 1px solid rgba(20, 21, 23, 0.14);
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.line-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.line-pill:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-pill-live {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-ink);
}

.status-pill-reconnecting {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber-ink);
}

.status-pill-preview {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-ink);
}

.preview-timer {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.85;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-solid);
  flex-shrink: 0;
}

.live-dot-pulsing {
  animation: pulseDot 1.6s ease-in-out infinite;
}

.live-dot-warn {
  background: var(--amber-solid);
}

.live-dot-preview {
  background: var(--blue-solid);
}

.live-dot-idle {
  background: var(--ink-muted);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.local-clock-wrap {
  padding: 3px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.local-clock {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* Stat Tiles Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 14px 7px;
  background: var(--bg-subtle);
}

.stats-strip.has-nine-stats {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.stats-strip.has-nine-stats .stat-tile {
  padding: 5px 8px;
}

.stats-strip.has-nine-stats .stat-value {
  font-size: 16px;
}

.stat-tile {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
}

.stat-tile.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  flex-shrink: 0;
}

.stat-value-blue { color: var(--blue-ink); }
.stat-value-red { color: var(--red-ink); }
.stat-value-green { color: var(--green-ink); }

/* Toast Region */
.toast-region {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

.toast-error {
  background: var(--red-ink);
}

/* -------------------------------------------------------------------------- */
/* Main 3-Column Desktop Grid                                                 */
/* -------------------------------------------------------------------------- */

.board-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 23%) minmax(540px, 50%) minmax(295px, 27%);
  gap: 10px;
  padding: 10px 14px;
}

.board-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

/* Panels */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.panel-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  white-space: nowrap;
}

.panel-hint {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--neutral-ink);
  font-size: 11px;
  font-weight: 700;
}

.count-pill-red {
  background: var(--red-bg);
  color: var(--red-ink);
  border: 1px solid var(--red-border);
}

.panel-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.list-stack {
  display: flex;
  flex-direction: column;
}

/* Column panel proportions */
.live-call-card {
  flex: 0 0 auto;
  max-height: 45%;
  border-top: 3px solid var(--border-strong);
}

.live-call-card.is-live {
  border-color: var(--accent);
  border-top-width: 3px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), var(--shadow-sm);
}

.panel-calls {
  flex: 1 1 0;
  min-height: 120px;
}

.panel-try-it {
  flex: 0 0 auto;
}

.panel-orders {
  flex: 1.25 1 0;
}

.panel-trucks {
  flex: 1 1 0;
}

.panel-escalations {
  flex: 1.15 1 0;
}

.panel-capacity {
  flex: 0.8 1 0;
}

.panel-webhooks {
  flex: 1.05 1 0;
}

/* -------------------------------------------------------------------------- */
/* Chips                                                                      */
/* -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.chip-green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-ink);
}

.chip-amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber-ink);
}

.chip-red {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red-ink);
}

.chip-blue {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-ink);
}

.chip-neutral {
  background: var(--neutral-bg);
  border-color: var(--neutral-border);
  color: var(--neutral-ink);
}

.chip-accent {
  background: var(--accent);
  border-color: rgba(20, 21, 23, 0.14);
  color: var(--accent-ink);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  color: var(--blue-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* -------------------------------------------------------------------------- */
/* Live Call Centerpiece                                                      */
/* -------------------------------------------------------------------------- */

.live-call-header {
  background: var(--bg-subtle);
}

.live-call-card.is-live .live-call-header {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
}

.live-timer {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.live-call-body {
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-caller-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.live-caller-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.live-caller-meta {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.live-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.live-actions-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.live-action-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
}

.live-action-item.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.action-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.action-icon-ok { color: var(--green-solid); }
.action-icon-err { color: var(--red-solid); }

.action-label {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--ink);
}

.action-ref-btn {
  border: none;
  background: var(--blue-bg);
  color: var(--blue-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.action-ref-btn:hover {
  background: #D6E7FC;
}

.action-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.live-summary-box {
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--ink);
}

.live-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.live-standby {
  padding: 8px 4px;
  color: var(--ink-secondary);
  font-size: 12px;
}

/* -------------------------------------------------------------------------- */
/* Recent Calls List                                                          */
/* -------------------------------------------------------------------------- */

.call-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: inherit;
  cursor: pointer;
}

.call-row:hover {
  background: var(--bg-hover);
}

.call-row.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.call-row-blocked {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  cursor: default;
}

.call-row-blocked:hover {
  background: var(--bg-subtle);
}

.call-row-blocked-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.call-row-blocked-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.call-row-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
}

.call-row-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.call-row-summary {
  font-size: 12px;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Try It Card                                                                */
/* -------------------------------------------------------------------------- */

.try-it-tel {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-ink);
  text-decoration: none;
}

.try-it-tel:hover {
  text-decoration: underline;
}

.try-it-body {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.try-it-quote {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.35;
}

.try-it-jobs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--ink-muted);
}

.job-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}

.job-name-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  line-height: 1.3;
}

/* -------------------------------------------------------------------------- */
/* Orders Table                                                               */
/* -------------------------------------------------------------------------- */

.orders-header {
  padding-top: 6px;
  padding-bottom: 6px;
}

.segmented-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
}

.seg-tab:hover {
  color: var(--ink);
}

.seg-tab.is-active {
  background: var(--bg-surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.seg-tab.has-alert::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.seg-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
}

.table-scroll {
  overflow: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 7px 6px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.orders-table th.num,
.orders-table td.num {
  text-align: right;
}

.order-tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.order-tr:hover {
  background: var(--bg-hover);
}

.order-tr.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.order-tr td {
  padding: 7px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.order-tr td:nth-child(2) {
  white-space: normal;
}

.order-id-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.order-id-btn:hover {
  color: var(--blue-ink);
}

.job-cell-main {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 152px;
}

.job-cell-sub {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 152px;
}

.loads-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.mini-bar {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 48px;
  height: 5px;
  border: none;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.mini-bar::-webkit-progress-bar {
  background: var(--border);
  border-radius: 99px;
}

.mini-bar::-webkit-progress-value {
  background: var(--green-solid);
  border-radius: 99px;
}

.mini-bar::-moz-progress-bar {
  background: var(--green-solid);
  border-radius: 99px;
}

.loads-by-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* -------------------------------------------------------------------------- */
/* Live Trucks (Grouped by Order)                                             */
/* -------------------------------------------------------------------------- */

.trucks-scroll {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.truck-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

.truck-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.truck-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.truck-group-order {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--ink);
}

.truck-group-job {
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-row {
  display: grid;
  grid-template-columns: 56px minmax(105px, 1.1fr) 86px minmax(115px, 1.3fr) 52px 42px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.truck-row:last-child {
  border-bottom: none;
}

.truck-row.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.truck-num {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--ink);
}

.truck-driver {
  min-width: 0;
}

.truck-driver-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-driver-sub {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.progress-track {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  border: none;
  background: var(--neutral-bg);
  border-radius: 99px;
  overflow: hidden;
}

.progress-track::-webkit-progress-bar {
  background: var(--neutral-bg);
  border-radius: 99px;
}

.progress-track::-webkit-progress-value {
  background: var(--green-solid);
  border-radius: 99px;
}

.progress-track::-moz-progress-bar {
  background: var(--green-solid);
  border-radius: 99px;
}

.progress-track.progress-amber::-webkit-progress-value,
.progress-track.progress-amber::-moz-progress-bar {
  background: var(--amber-solid);
}

.progress-track.progress-neutral::-webkit-progress-value,
.progress-track.progress-neutral::-moz-progress-bar {
  background: var(--ink-muted);
}

.truck-status-note {
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-eta {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  color: var(--ink);
}

.truck-loads {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  color: var(--ink-secondary);
}

/* -------------------------------------------------------------------------- */
/* Escalations ("Needs a dispatcher")                                         */
/* -------------------------------------------------------------------------- */

.esc-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--amber-solid);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.esc-card.is-urgent {
  border-left-color: var(--red-solid);
  background: #FFF9F9;
}

.esc-card.is-resolved {
  border-left-color: var(--green-solid);
  background: var(--bg-subtle);
  opacity: 0.78;
}

.esc-card.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.esc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.esc-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.esc-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.esc-summary {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.38;
}

.esc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

.esc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.esc-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* -------------------------------------------------------------------------- */
/* Tomorrow's Capacity                                                        */
/* -------------------------------------------------------------------------- */

.capacity-headline {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.capacity-number {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.capacity-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}

.avail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.avail-row.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.avail-main {
  min-width: 0;
}

.avail-driver {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avail-sub {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avail-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.avail-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

/* -------------------------------------------------------------------------- */
/* Webhooks Event Log                                                         */
/* -------------------------------------------------------------------------- */

.docs-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-ink);
  text-decoration: none;
}

.docs-link:hover {
  text-decoration: underline;
}

.webhook-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: inherit;
  cursor: pointer;
}

.webhook-row:hover {
  background: var(--bg-hover);
}

.webhook-row.is-flashing {
  animation: rowFlash 380ms ease-out;
}

.webhook-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.webhook-type {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
}

.webhook-summary {
  font-size: 12px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.webhook-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-muted);
}

/* -------------------------------------------------------------------------- */
/* Empty States                                                               */
/* -------------------------------------------------------------------------- */

.empty-state {
  padding: 20px 14px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

.board-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-muted);
}

.footer-credit {
  font-weight: 600;
  color: var(--ink-secondary);
}

/* -------------------------------------------------------------------------- */
/* Drawers (Call Transcript, Order History, Webhook JSON, Admin)              */
/* -------------------------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 23, 0.38);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: slideIn 200ms ease-out;
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0.7; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.drawer-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.drawer-title {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.drawer-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detail-kv-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.detail-kv-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* Transcript Bubbles */
.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.42;
}

.bubble-agent {
  align-self: flex-start;
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--ink);
}

.bubble-caller {
  align-self: flex-end;
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* Order History */
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 12px;
}

/* JSON Viewer */
.json-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.json-pre {
  margin: 0;
  padding: 12px;
  background: #1B1D21;
  color: #ECEEF2;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.48;
  overflow-x: auto;
  white-space: pre;
}

/* Admin Drawer */
.admin-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-section-danger {
  background: #FFF9F9;
  border-color: var(--red-border);
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.admin-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

.tester-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tester-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tester-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.health-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.reset-row {
  display: flex;
  gap: 8px;
}

/* -------------------------------------------------------------------------- */
/* Flash Animation (< 400 ms, only on state change)                           */
/* -------------------------------------------------------------------------- */

@keyframes rowFlash {
  0% { background-color: var(--bg-flash); }
  100% { background-color: transparent; }
}

/* -------------------------------------------------------------------------- */
/* Mobile Bottom Tab Bar (Hidden on desktop)                                  */
/* -------------------------------------------------------------------------- */

.mobile-tabs {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Responsive: Compact Desktop / Laptop (901px..1260px)                       */
/* -------------------------------------------------------------------------- */

@media (max-width: 1260px) and (min-width: 901px) {
  .stats-strip,
  .stats-strip.has-nine-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .board-grid {
    grid-template-columns: minmax(250px, 26%) minmax(390px, 46%) minmax(250px, 28%);
  }
  .truck-row {
    grid-template-columns: 62px minmax(90px, 1fr) 82px minmax(64px, 0.9fr) 48px 40px;
    gap: 5px;
  }
}

/* -------------------------------------------------------------------------- */
/* Responsive: Phone Layout (<= 900px)                                        */
/* One column, Live Call card pinned on top, fixed 5-tab bottom bar           */
/* -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .board-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-bottom: 64px;
  }

  .header-top {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-name {
    font-size: 15px;
  }

  .line-pill {
    padding: 3px 8px;
    font-size: 12px;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
  }

  .local-clock-wrap {
    padding: 2px 6px;
  }

  .local-clock {
    font-size: 11px;
  }

  .header-controls .btn-sm {
    padding: 4px 7px;
    font-size: 11px;
  }

  .preview-timer {
    display: none;
  }

  .stats-strip {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 6px 10px;
    scroll-snap-type: x proximity;
  }

  .stat-tile {
    flex: 0 0 auto;
    min-width: 124px;
    scroll-snap-align: start;
  }

  .board-grid {
    flex: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px 14px;
  }

  .board-col {
    display: contents;
  }

  .panel,
  .panel-calls,
  .panel-try-it,
  .panel-orders,
  .panel-trucks,
  .panel-escalations,
  .panel-capacity,
  .panel-webhooks {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  /* Pin live call card at the top on mobile */
  .live-call-card {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    max-height: none;
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }

  .live-call-card .live-call-body {
    max-height: 210px;
    overflow-y: auto;
  }

  .panel-calls { order: 1; }
  .panel-try-it { order: 2; }
  .panel-orders { order: 1; }
  .panel-trucks { order: 1; }
  .panel-capacity { order: 2; }
  .panel-escalations { order: 1; }
  .panel-webhooks { order: 1; }

  .panel-scroll {
    flex: none;
    max-height: none;
    overflow-y: visible;
  }

  .table-scroll {
    overflow-x: auto;
  }

  /* Show only the active mobile tab panels */
  [data-mobile-panel] {
    display: none;
  }

  .board-shell[data-mobile-tab="calls"] [data-mobile-panel="calls"],
  .board-shell[data-mobile-tab="orders"] [data-mobile-panel="orders"],
  .board-shell[data-mobile-tab="trucks"] [data-mobile-panel="trucks"],
  .board-shell[data-mobile-tab="dispatcher"] [data-mobile-panel="dispatcher"],
  .board-shell[data-mobile-tab="webhooks"] [data-mobile-panel="webhooks"] {
    display: flex;
  }

  .truck-row {
    grid-template-columns: 64px 1fr auto;
    grid-template-areas:
      "num driver eta"
      "status bar loads";
    gap: 6px;
  }

  .truck-num { grid-area: num; }
  .truck-driver { grid-area: driver; }
  .truck-eta { grid-area: eta; }
  .truck-status-cell { grid-area: status; }
  .truck-progress-wrap { grid-area: bar; }
  .truck-loads { grid-area: loads; }

  .board-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px 18px;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-strong);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(20, 21, 23, 0.08);
  }

  .mobile-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .mobile-tab.is-active {
    color: var(--ink);
    background: var(--bg-subtle);
  }

  .mobile-tab.is-active::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
  }

  .mobile-tab-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-tab-badge {
    position: absolute;
    top: 1px;
    right: calc(50% - 19px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red-solid);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tester-form-fields {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------- */
/* Reduced Motion                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
