:root {
  color-scheme: light;

  /* A&A Logistics Control Tower — Enterprise tokens */
  --background: #f7f8fa;
  --surface-subtle: #f9fafb;
  --surface-hover: #f2f4f7;
  --text-primary: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;
  --border: #d0d5dd;
  --border-subtle: #eaecf0;
  --primary-brand: #0057d9;
  --primary-hover: #0047b3;
  --primary-subtle: #eff8ff;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --info: #175cd3;
  --info-bg: #eff8ff;

  --sidebar-width: 240px;
  --sidebar-width-collapsed: 70px;
  --topbar-height: 64px;
  --content-padding: 20px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  /* Legacy aliases */
  --bg: var(--background);
  --surface: #ffffff;
  --surface-strong: var(--surface-subtle);
  --surface-muted: var(--surface-hover);
  --line: var(--border);
  --line-strong: var(--border);
  --text: var(--text-primary);
  --text-soft: var(--text-secondary);
  --muted: var(--text-muted);
  --navy: var(--text-primary);
  --navy-strong: var(--text-primary);
  --primary: var(--primary-brand);
  --primary-strong: var(--primary-hover);
  --primary-text: #ffffff;
  --blue: var(--primary-brand);
  --blue-bg: var(--primary-subtle);
  --blue-border: #b2ddff;
  --blue-chip-text: var(--primary-brand);
  --steel: #475569;
  --steel-bg: #f8fafc;
  --steel-border: #e2e8f0;
  --steel-chip-text: #334155;
  --amber: var(--warning);
  --amber-bg: var(--warning-bg);
  --amber-border: #fedf89;
  --red: var(--danger);
  --red-bg: var(--danger-bg);
  --red-border: #fecdca;
  --green: var(--success);
  --green-bg: var(--success-bg);
  --green-border: #abefc6;
  --violet: #7c3aed;
  --violet-bg: #f5f3ff;
  --topbar-bg: #ffffff;
  --input-bg: #ffffff;
  --input-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  --focus-ring: rgba(37, 99, 235, 0.12);
  --placeholder: #94a3b8;
  --segment-bg: #f1f5f9;
  --table-head: #f8fafc;
  --table-head-solid: #f8fafc;
  --row-bg: #ffffff;
  --row-alt: #fafafa;
  --row-hover: #f1f5f9;
  --hover-border: #cbd5e1;
  --count-border: #cbd5e1;
  --toast-bg: #ffffff;
  --danger-soft: #fca5a5;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: var(--radius-md);
  --sticky-table-top: 0px;

  /* Glow shadows light */
  --glow-green: 0 0 10px rgba(22, 163, 74, 0.15);
  --glow-amber: 0 0 10px rgba(217, 119, 6, 0.15);
  --glow-red: 0 0 10px rgba(220, 38, 38, 0.15);
  --glow-blue: 0 0 10px rgba(37, 99, 235, 0.15);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0c111d;
  --surface-subtle: #111827;
  --surface-hover: #1a2234;
  --text-primary: #f5f7fb;
  --text-secondary: #c5ccda;
  --text-muted: #8b95a8;
  --border: #2a3448;
  --border-subtle: #1f293a;
  --primary-brand: #3b82f6;
  --primary-hover: #2563eb;
  --primary-subtle: rgba(59, 130, 246, 0.14);
  --success: #32d583;
  --success-bg: rgba(6, 118, 71, 0.2);
  --warning: #fdb022;
  --warning-bg: rgba(181, 71, 8, 0.18);
  --danger: #f97066;
  --danger-bg: rgba(180, 35, 24, 0.18);
  --info: #53b1fd;
  --info-bg: rgba(23, 92, 211, 0.18);
  --bg: var(--background);
  --surface: #121a2b;
  --surface-strong: var(--surface-subtle);
  --surface-muted: var(--surface-hover);
  --line: var(--border);
  --line-strong: var(--border);
  --text: var(--text-primary);
  --text-soft: var(--text-secondary);
  --muted: var(--text-muted);
  --navy: #f8fafc;
  --navy-strong: #ffffff;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --primary-text: #ffffff;
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --blue-border: rgba(59, 130, 246, 0.25);
  --blue-chip-text: #93c5fd;
  --steel: #94a3b8;
  --steel-bg: rgba(30, 41, 59, 0.5);
  --steel-border: rgba(255, 255, 255, 0.08);
  --steel-chip-text: #cbd5e1;
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-border: rgba(245, 158, 11, 0.25);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --red-border: rgba(239, 68, 68, 0.25);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --green-border: rgba(16, 185, 129, 0.25);
  --violet: #8b5cf6;
  --violet-bg: rgba(139, 92, 246, 0.1);
  --topbar-bg: var(--surface);
  --input-bg: #0f172a;
  --input-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  --focus-ring: rgba(59, 130, 246, 0.2);
  --placeholder: #475569;
  --segment-bg: rgba(17, 24, 39, 0.6);
  --table-head: rgba(30, 41, 59, 0.4);
  --table-head-solid: #111827;
  --row-bg: rgba(17, 24, 39, 0.4);
  --row-alt: rgba(17, 24, 39, 0.2);
  --row-hover: rgba(59, 130, 246, 0.08);
  --hover-border: rgba(59, 130, 246, 0.4);
  --count-border: rgba(255, 255, 255, 0.12);
  --toast-bg: #111827;
  --danger-soft: rgba(239, 68, 68, 0.3);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.3);

  /* Glow shadows dark */
  --glow-green: 0 0 14px rgba(16, 185, 129, 0.35);
  --glow-amber: 0 0 14px rgba(245, 158, 11, 0.35);
  --glow-red: 0 0 14px rgba(239, 68, 68, 0.35);
  --glow-blue: 0 0 14px rgba(59, 130, 246, 0.35);
}

:root {
  --glass-blur: 24px;
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-bg-strong: rgba(255, 255, 255, 0.9);
  --glass-bg-muted: rgba(241, 245, 249, 0.74);
  --glass-line: rgba(148, 163, 184, 0.34);
  --glass-line-strong: rgba(100, 116, 139, 0.42);
  --glass-highlight: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 22px 54px rgba(15, 23, 42, 0.12);
  --glass-shadow-strong: 0 30px 90px rgba(15, 23, 42, 0.18);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.66), inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  --glass-radius: 24px;
  --glass-radius-sm: 16px;
  --glass-status-new: rgba(148, 163, 184, 0.54);
  --glass-status-planned: rgba(139, 92, 246, 0.72);
  --glass-status-progress: rgba(59, 130, 246, 0.72);
  --glass-status-done: rgba(16, 185, 129, 0.72);
  --glass-status-warning: rgba(245, 158, 11, 0.78);
  --glass-status-danger: rgba(239, 68, 68, 0.76);
}

:root[data-theme="dark"] {
  --bg: #050916;
  --surface: rgba(12, 19, 36, 0.66);
  --surface-strong: rgba(17, 28, 50, 0.78);
  --surface-muted: rgba(8, 14, 27, 0.72);
  --line: rgba(191, 219, 254, 0.12);
  --line-strong: rgba(191, 219, 254, 0.2);
  --topbar-bg: rgba(8, 14, 27, 0.56);
  --input-bg: rgba(5, 10, 22, 0.54);
  --segment-bg: rgba(12, 19, 36, 0.42);
  --table-head: rgba(14, 24, 44, 0.68);
  --table-head-solid: rgba(10, 18, 34, 0.92);
  --row-bg: rgba(12, 20, 38, 0.48);
  --row-alt: rgba(18, 29, 52, 0.44);
  --row-hover: rgba(59, 130, 246, 0.16);
  --hover-border: rgba(125, 211, 252, 0.5);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.34);
  --glass-blur: 30px;
  --glass-bg: rgba(12, 22, 42, 0.52);
  --glass-bg-strong: rgba(17, 30, 55, 0.68);
  --glass-bg-muted: rgba(8, 15, 30, 0.48);
  --glass-line: rgba(191, 219, 254, 0.17);
  --glass-line-strong: rgba(219, 234, 254, 0.26);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  --glass-shadow-strong: 0 42px 120px rgba(0, 0, 0, 0.58);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --glass-status-new: rgba(148, 163, 184, 0.56);
  --glass-status-planned: rgba(168, 85, 247, 0.9);
  --glass-status-progress: rgba(59, 130, 246, 0.88);
  --glass-status-done: rgba(16, 185, 129, 0.88);
  --glass-status-warning: rgba(245, 158, 11, 0.9);
  --glass-status-danger: rgba(248, 113, 113, 0.9);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding-bottom: 24px;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: padding-bottom 0.2s ease;
}

.login-screen{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:24px;background:var(--app-bg,#f5f7fb)}
.login-screen[hidden]{display:none}.login-card{width:min(420px,100%);display:grid;gap:18px;padding:32px;border:1px solid var(--border-color,#dfe3eb);border-radius:20px;background:var(--surface,#fff);box-shadow:0 24px 70px rgba(15,23,42,.16)}
.login-card>img{width:120px;max-height:54px;object-fit:contain}.login-card h1,.login-card p{margin:0}.login-error{color:#b91c1c}.session-user{font-size:13px;color:var(--text-muted)}

:root[data-theme="dark"] body {
  background: var(--bg);
}

/* ── App shell: sidebar + topbar ── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--background);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface);
  overflow: hidden auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--topbar-height);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #050505;
  object-fit: contain;
  padding: 3px;
}

.sidebar-brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}

.sidebar-brand-text strong {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-text small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.sidebar-collapse-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.sidebar-collapse-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button svg {
  transform: rotate(180deg);
}

.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus-visible {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--primary-brand);
  outline: none;
}

.sidebar-nav {
  display: grid;
  gap: 2px;
  padding: 10px 8px 16px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-nav-item:focus-visible {
  outline: 2px solid var(--primary-brand);
  outline-offset: 1px;
}

.sidebar-nav-item.active {
  border-color: #b2ddff;
  background: var(--primary-subtle);
  color: var(--primary-brand);
  box-shadow: inset 3px 0 0 var(--primary-brand);
}

.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-nav-item span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar-nav-item {
  justify-content: center;
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button {
  position: absolute;
  right: 8px;
  bottom: 12px;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 420px) auto;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-height);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-left {
  flex: 1;
}

.topbar-center {
  justify-content: center;
}

.topbar-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.topbar-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0;
  cursor: pointer;
}

.topbar-menu-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.breadcrumb-module {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.breadcrumb-separator {
  color: var(--border);
  font-size: 13px;
}

.breadcrumb-page,
.topbar-breadcrumb h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  min-height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 0 12px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.global-search:focus-within {
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 3px rgba(0, 87, 217, 0.12);
  background: var(--surface);
}

.global-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 8px 0;
  font-size: 14px;
}

.global-search input:focus {
  outline: none;
}

.global-search-kbd {
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.topbar-cta {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-icon-button,
.topbar-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.topbar-icon-button {
  position: relative;
  width: 36px;
  padding: 0;
}

.topbar-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: opacity 0.15s ease;
}

.topbar-icon-button.is-busy {
  pointer-events: none;
  color: var(--primary-brand);
}

.topbar-icon-button.is-busy svg {
  opacity: 0.25;
}

.topbar-icon-button.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: topbar-icon-spin 0.7s linear infinite;
}

@keyframes topbar-icon-spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar-icon-button:hover,
.topbar-icon-button:focus-visible,
.topbar-profile:hover,
.topbar-profile:focus-visible {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--primary-brand);
  outline: none;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.topbar-fleet-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-fleet-actions[hidden] {
  display: none !important;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-subtle);
  color: var(--primary-brand);
  font-size: 11px;
  font-weight: 700;
}

.profile-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.app-content {
  flex: 1;
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
}

.app-content .layout,
.app-content .drivers-layout,
.app-content .orders-layout,
.app-content .vehicle-map-layout,
.app-content .calculator-layout,
.app-content .earnings-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--content-padding);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 84px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, transparent), transparent 66%),
    var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(20px) saturate(130%);
}

.top-tabs {
  display: flex;
  align-items: center;
  flex: 1 1 520px;
  gap: 8px;
  min-width: 280px;
  max-width: 760px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--line-strong) 62%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.07),
    0 1px 0 color-mix(in srgb, var(--surface) 78%, transparent) inset;
  backdrop-filter: blur(18px) saturate(130%);
  scrollbar-width: none;
}

.top-tabs::-webkit-scrollbar {
  display: none;
}

.top-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.top-tab svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.top-tab:hover {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--navy);
  transform: translateY(-1px);
}

.top-tab.active {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--line-strong));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--blue) 24%, transparent), transparent 48%),
    var(--blue-bg);
  color: var(--blue);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--blue) 14%, transparent),
    0 14px 32px color-mix(in srgb, var(--blue) 16%, transparent);
}

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

.topbar-logo {
  width: 126px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #050505;
  object-fit: contain;
  padding: 4px 8px;
  box-shadow: var(--shadow-soft);
}

.page-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topbar-context {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  font-weight: 850;
}

h2 {
  font-size: 17px;
  font-weight: 800;
}

.top-actions,
.button-row,
.segmented,
.metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-actions {
  position: relative;
  gap: 8px;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 62%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.08),
    0 1px 0 color-mix(in srgb, var(--surface) 78%, transparent) inset;
  backdrop-filter: blur(18px);
}

.top-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  padding: 0;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.top-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.top-icon-button:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.top-icon-button:disabled {
  cursor: progress;
  opacity: 0.68;
  transform: none;
}

.top-icon-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.top-icon-primary:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  color: var(--primary-text);
}

.top-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.top-icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 50%;
  bottom: -38px;
  z-index: 30;
  max-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: var(--primary-text);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, -4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  white-space: nowrap;
}

:root[data-theme="dark"] .top-icon-button::after {
  border-color: #4b5f7a;
  background: #f8fafc;
  color: #0b1220;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.top-icon-button:hover::after,
.top-icon-button:focus-visible::after {
  opacity: 1;
  transform: translate(50%, 0);
}

.theme-sun-icon {
  display: none;
}

:root[data-theme="dark"] .theme-moon-icon {
  display: none;
}

:root[data-theme="dark"] .theme-sun-icon {
  display: inline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  width: min(100%, 1880px);
  margin: 0 auto;
  padding: 22px 14px 36px;
}

.fleet-tools {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 16px;
  pointer-events: none;
}

.fleet-tools.tool-drawer-open {
  pointer-events: auto;
}

.fleet-tools.tool-drawer-open::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
}

.bottom-drawer {
  position: relative;
  z-index: 1;
  width: min(100%, 900px);
  max-height: min(64vh, 620px);
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0;
  pointer-events: auto;
  animation: drawer-rise 0.22s ease-out;
}

@keyframes drawer-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tool-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.tool-panel .tool-panel-heading {
  margin: -18px -18px 2px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 52%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-strong) 78%, transparent);
}

.tool-panel-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.tool-panel-title h2 {
  overflow: hidden;
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--blue-border);
  border-radius: 12px;
  background: var(--blue-bg);
  color: var(--blue);
}

.tool-panel-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bottom-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  width: min(100%, 660px);
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow:
    0 18px 54px rgba(15, 23, 42, 0.17),
    0 1px 0 color-mix(in srgb, var(--surface) 78%, transparent) inset;
  padding: 6px;
  pointer-events: auto;
  backdrop-filter: blur(22px) saturate(140%);
}

.bottom-tool-button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--text-soft);
  padding: 7px 7px 6px;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.bottom-tool-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bottom-tool-button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.86;
}

.bottom-tool-button:hover {
  border-color: color-mix(in srgb, var(--blue-border) 74%, var(--line));
  background: color-mix(in srgb, var(--blue-bg) 42%, transparent);
  color: var(--navy);
  transform: translateY(-2px);
}

.bottom-tool-button.active {
  border-color: color-mix(in srgb, var(--blue) 52%, var(--blue-border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 92%, #ffffff), var(--primary));
  color: var(--primary-text);
  box-shadow:
    0 12px 24px color-mix(in srgb, var(--blue) 26%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transform: translateY(-2px);
}

.bottom-tool-button.active span {
  opacity: 1;
}

.tool-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--count-border) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--steel-bg) 88%, transparent);
  color: var(--navy);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 850;
}

.tool-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--navy);
  padding: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.tool-close-button:hover {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
  transform: translateY(-1px);
}

.tab-panel[hidden] {
  display: none;
}

.drivers-layout {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 26px 24px 36px;
}

.drivers-pane {
  width: 100%;
  max-width: none;
}

.orders-layout {
  width: min(100%, 1960px);
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.orders-pane {
  display: grid;
  gap: 18px;
}

.orders-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.orders-hero h2 {
  margin: 3px 0 8px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.orders-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.orders-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.orders-timeline-panel {
  display: grid;
  gap: 14px;
}

.orders-timeline-heading {
  align-items: flex-start;
}

.orders-timeline-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.orders-timeline-heading h2 {
  margin: 0;
}

.orders-timeline-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.orders-planner-alerts {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 180px)) minmax(220px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.planner-alert-card {
  display: grid;
  gap: 2px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 11px 13px;
}

.planner-alert-card strong {
  color: var(--navy);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.planner-alert-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.planner-alert-card.warning {
  border-color: var(--amber-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber-bg) 74%, transparent), transparent 72%),
    var(--surface-strong);
}

.planner-alert-card.danger {
  border-color: var(--red-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 76%, transparent), transparent 72%),
    var(--surface-strong);
}

.planner-alert-card.warning strong {
  color: var(--amber);
}

.planner-alert-card.danger strong {
  color: var(--red);
}

.planner-alert-note {
  display: flex;
  align-items: center;
  min-height: 64px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
  color: var(--text-soft);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.45;
}

.planner-alert-note.clear {
  border-color: var(--green-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-bg) 52%, transparent), transparent 72%),
    var(--surface-strong);
  color: var(--green);
}

.orders-timeline {
  min-width: 0;
}

.orders-timeline-scroll {
  position: relative;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 28%, transparent), transparent 72%),
    var(--surface-strong);
}

.orders-timeline-grid {
  --timeline-day-width: calc((100% - 174px) / 7);
  --timeline-header-height: 58px;
  --timeline-sidebar-width: 174px;
  position: relative;
  display: grid;
  min-width: 1180px;
  grid-template-columns: 174px repeat(7, minmax(134px, 1fr));
}

.timeline-corner,
.timeline-day-header,
.timeline-vehicle-cell,
.timeline-row-track {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline-corner,
.timeline-day-header {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: var(--timeline-header-height);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-strong));
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow:
    0 1px 0 var(--line),
    0 16px 30px rgba(15, 23, 42, 0.12);
}

.timeline-corner {
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  color: var(--muted);
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline-day-header {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px;
  text-align: center;
}

.timeline-day-header.today {
  color: var(--blue);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--blue) 24%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 92%, var(--surface-strong));
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--blue) 72%, transparent),
    inset 0 4px 0 color-mix(in srgb, var(--blue) 84%, white 10%),
    0 18px 36px color-mix(in srgb, var(--blue) 18%, transparent);
}

.timeline-day-header.today strong,
.timeline-day-header.today span {
  color: color-mix(in srgb, var(--blue) 88%, white 12%);
}

.timeline-day-header strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.timeline-day-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.timeline-vehicle-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  min-height: 60px;
  gap: 1px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-strong));
  padding: 8px 14px;
}

.timeline-vehicle-cell strong,
.timeline-vehicle-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-vehicle-cell strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: 0;
}

.timeline-vehicle-cell span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.timeline-day-cell {
  min-height: var(--timeline-row-height, 60px);
  gap: 4px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  border-right: 1px solid var(--line);
  padding: 0;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.timeline-day-cell.today {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 12%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.timeline-today-column-outline {
  position: absolute;
  top: var(--timeline-header-height);
  bottom: 0;
  left: var(--timeline-sidebar-width);
  z-index: 1;
  width: var(--timeline-day-width);
  pointer-events: none;
  border-right: 3px solid color-mix(in srgb, var(--blue) 74%, transparent);
  border-bottom: 3px solid color-mix(in srgb, var(--blue) 82%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--blue) 74%, transparent);
  border-radius: 0 0 14px 14px;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--blue) 20%, transparent),
    0 0 28px color-mix(in srgb, var(--blue) 24%, transparent);
}

.orders-timeline-grid.today-index-1 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width));
}

.orders-timeline-grid.today-index-2 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width) + var(--timeline-day-width));
}

.orders-timeline-grid.today-index-3 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width));
}

.orders-timeline-grid.today-index-4 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width));
}

.orders-timeline-grid.today-index-5 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width));
}

.orders-timeline-grid.today-index-6 .timeline-today-column-outline {
  left: calc(var(--timeline-sidebar-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width) + var(--timeline-day-width));
}

.timeline-row-track {
  position: relative;
  display: grid;
  align-content: center;
  grid-column: 2 / -1;
  grid-template-columns: repeat(7, minmax(134px, 1fr));
  grid-template-rows: repeat(var(--timeline-lanes, 1), 44px);
  min-height: var(--timeline-row-height, 60px);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.timeline-row-track.has-orders {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 38%, transparent), transparent 82%),
    var(--surface-strong);
}

.timeline-row-track.has-warning {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber-bg) 42%, transparent), transparent 78%),
    var(--surface-strong);
}

.timeline-row-track.has-conflict {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 52%, transparent), transparent 78%),
    var(--surface-strong);
}

.timeline-day-cell.drag-over {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 72%, transparent), transparent 78%),
    var(--surface);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.timeline-empty {
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  color: color-mix(in srgb, var(--muted) 74%, transparent);
  font-size: 10.5px;
  font-weight: 850;
}

.timeline-order-card {
  position: relative;
  z-index: 2;
  display: grid;
  align-self: center;
  gap: 1px;
  width: auto;
  min-height: 38px;
  margin: 4px 6px;
  border: 4px solid var(--line-strong);
  border-radius: 9px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 74%, transparent), transparent 82%),
    var(--surface-strong);
  backdrop-filter: blur(8px) saturate(120%);
  color: var(--text);
  font: inherit;
  padding: 5px 8px;
  text-align: left;
  cursor: pointer;
  overflow: visible;
  transition:
    border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-order-card.planned {
  border-color: color-mix(in srgb, var(--violet) 66%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--violet) 20%, transparent), transparent 82%),
    var(--surface-strong);
}

.timeline-order-card.planned:hover,
.timeline-order-card.planned.active {
  border-color: color-mix(in srgb, var(--violet) 92%, white 8%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 30%, transparent), 0 10px 28px color-mix(in srgb, var(--violet) 32%, transparent);
}

.timeline-order-card:hover,
.timeline-order-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent), 0 8px 20px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.timeline-order-card.dragging {
  opacity: 0.46;
  transform: scale(0.98);
}

.timeline-order-card > .timeline-empty-run {
  display: inline-flex;
  align-items: center;
  align-self: start;
  max-width: 100%;
  margin-bottom: 1px;
  overflow: hidden;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-order-card > strong,
.timeline-order-card > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-order-card > strong {
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1.15;
}

.timeline-order-card > span {
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
}

.timeline-order-card em {
  position: absolute;
  right: 7px;
  bottom: 5px;
  justify-self: start;
  margin-top: 0;
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  padding: 1px 5px;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.timeline-order-card.has-warning {
  border-color: color-mix(in srgb, var(--amber) 54%, transparent);
  padding-right: 58px;
}

.timeline-order-card.has-conflict {
  padding-right: 58px;
}

.timeline-order-card.secondary-segment {
  border-style: dashed;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 62%, transparent), transparent 75%),
    var(--surface-strong);
}

.timeline-order-card.has-conflict em {
  background: color-mix(in srgb, var(--red-bg) 70%, var(--surface));
  color: var(--red);
}

.timeline-handover-marker {
  position: absolute;
  top: -7px;
  bottom: -7px;
  width: 2px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-bg) 72%, transparent);
  transform: translateX(-50%);
  pointer-events: none;
}

.timeline-handover-marker small {
  position: absolute;
  top: -18px;
  left: 50%;
  border: 1px solid var(--red-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--red);
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.timeline-order-card.in_progress {
  border-color: var(--blue-border);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.timeline-order-card.in_progress:hover,
.timeline-order-card.in_progress.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent), 0 8px 20px rgba(59, 130, 246, 0.25);
}

.timeline-order-card.done {
  border-color: var(--green-border);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.timeline-order-card.done:hover,
.timeline-order-card.done.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 22%, transparent), 0 8px 20px rgba(16, 185, 129, 0.25);
}

.timeline-order-card.cancelled {
  border-color: var(--red-border);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.timeline-order-card.cancelled:hover,
.timeline-order-card.cancelled.active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent), 0 8px 20px rgba(239, 68, 68, 0.25);
}

.timeline-order-card.has-conflict {
  border-color: var(--red-border);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.08) 100%);
}

.timeline-order-card.has-conflict:hover,
.timeline-order-card.has-conflict.active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent), 0 8px 20px rgba(239, 68, 68, 0.25);
}

.timeline-order-card.has-warning:not(.has-conflict) {
  border-color: color-mix(in srgb, var(--amber) 54%, transparent);
}

.timeline-order-card.has-warning:not(.has-conflict):hover,
.timeline-order-card.has-warning:not(.has-conflict).active {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 22%, transparent), 0 8px 20px color-mix(in srgb, var(--amber) 22%, transparent);
}

.orders-board {
  display: grid;
  grid-template-columns: minmax(380px, 0.55fr) minmax(0, 0.82fr);
  gap: 18px;
  align-items: start;
}

.orders-list-panel,
.orders-form-panel {
  height: auto;
  min-height: 840px;
  padding: 18px;
}

.orders-list-panel {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.orders-form-panel {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.orders-form-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.orders-form-content {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 3px;
  margin-top: 12px;
}

.orders-form-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 28px;
  text-align: center;
}

.orders-form-empty strong {
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
}

.orders-form-empty span {
  max-width: 360px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.orders-search-field {
  margin-top: 12px;
}

.orders-search-field input {
  min-height: 40px;
  font-size: 12px;
}

.orders-list {
  position: relative;
  display: grid;
  flex: 1;
  align-content: start;
  gap: 7px;
  margin-top: 12px;
  min-height: 0;
  overflow: visible;
  padding-right: 6px;
}

.active-orders-list,
.completed-orders-list {
  display: grid;
  gap: 7px;
}

.orders-active-empty {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
  padding: 14px;
}

.orders-active-empty strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.orders-active-empty span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.4;
}

.orders-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 42%, transparent), transparent 62%),
    var(--surface-strong);
  padding: 32px;
  text-align: center;
}

.orders-empty strong {
  color: var(--navy);
  font-size: 20px;
  font-weight: 900;
}

.orders-empty span {
  max-width: 560px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.orders-next-steps {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
}

.order-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  border: 4px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 64%, transparent), transparent 78%),
    var(--surface-strong);
  color: inherit;
  font: inherit;
  padding: 5px 8px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.order-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 20%, transparent), var(--shadow);
  transform: translateY(-1px);
}

.order-card.active {
  border-color: var(--blue);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 55%, transparent), transparent 70%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 24%, transparent), 0 16px 40px color-mix(in srgb, var(--blue) 22%, transparent);
}

.order-card.planned {
  border-color: color-mix(in srgb, var(--violet) 66%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--violet) 18%, transparent), transparent 76%),
    var(--surface-strong);
}

.order-card.in_progress {
  border-color: var(--blue-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 42%, transparent), transparent 76%),
    var(--surface-strong);
}

.order-card.done {
  border-color: var(--green-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-bg) 42%, transparent), transparent 76%),
    var(--surface-strong);
}

.order-card.cancelled {
  border-color: var(--red-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 46%, transparent), transparent 76%),
    var(--surface-strong);
}

.order-card.planned:hover,
.order-card.active.planned {
  border-color: color-mix(in srgb, var(--violet) 92%, white 8%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--violet) 22%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 30%, transparent), 0 16px 40px color-mix(in srgb, var(--violet) 32%, transparent);
}

.order-card.in_progress:hover,
.order-card.active.in_progress {
  border-color: var(--blue);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 58%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 22%, transparent), 0 16px 40px color-mix(in srgb, var(--blue) 18%, transparent);
}

.order-card.done:hover,
.order-card.active.done {
  border-color: var(--green);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-bg) 58%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 22%, transparent), 0 16px 40px color-mix(in srgb, var(--green) 18%, transparent);
}

.order-card.cancelled:hover,
.order-card.active.cancelled,
.order-card.active.has-conflict {
  border-color: var(--red);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 62%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent), 0 16px 40px color-mix(in srgb, var(--red) 18%, transparent);
}

.order-card.has-warning {
  border-color: color-mix(in srgb, var(--amber) 54%, transparent);
}

.order-card.has-warning:hover,
.order-card.active.has-warning:not(.has-conflict) {
  border-color: var(--amber);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber-bg) 60%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 22%, transparent), 0 16px 40px color-mix(in srgb, var(--amber) 18%, transparent);
}

.order-card.has-conflict {
  border-color: var(--red-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 54%, transparent), transparent 72%),
    var(--surface-strong);
}

.order-card.has-conflict:hover {
  border-color: var(--red);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-bg) 62%, transparent), transparent 76%),
    var(--surface-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 22%, transparent), 0 16px 40px color-mix(in srgb, var(--red) 18%, transparent);
}

.order-card.completed {
  opacity: 0.82;
}

.order-card.disabled {
  cursor: default;
}

.completed-orders-section {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
  overflow: hidden;
}

.completed-orders-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.completed-orders-summary::-webkit-details-marker {
  display: none;
}

.completed-orders-summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 15px;
  line-height: 1;
}

.completed-orders-section[open] .completed-orders-summary::before {
  content: "-";
}

.completed-orders-summary span {
  flex: 1;
}

.completed-orders-summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--green-border);
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 950;
}

.completed-orders-list {
  padding: 0 10px 10px;
}

.orders-completed-table-section {
  margin-top: 10px;
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.orders-completed-table-section .orders-table-scroll {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
}

.orders-completed-table-section .orders-data-table tbody tr {
  opacity: 0.82;
}

.orders-completed-summary {
  min-height: 42px;
}

.order-file-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 8px;
  font-weight: 950;
}

.order-card-body {
  display: grid;
  min-width: 0;
  gap: 0;
}

.order-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.order-status-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 4px;
}

.order-card-body strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-file-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 820;
  line-height: 1.2;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card-body small,
.order-card-body em {
  color: var(--muted);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-status-chip {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.order-status-chip.planned {
  border-color: color-mix(in srgb, var(--violet) 52%, transparent);
  background: color-mix(in srgb, var(--violet-bg) 74%, transparent);
  color: color-mix(in srgb, var(--violet) 78%, var(--text));
}

.order-status-chip.in_progress {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.order-status-chip.done {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.order-status-chip.cancelled {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.order-warning-chip {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  border: 1px solid var(--amber-border);
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
}

.order-warning-chip.danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.order-warning-chip.duplicate {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.order-route-chip {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
}

.order-route-chip.ok {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.order-route-chip.warning {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.order-route-chip.danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.orders-form-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.orders-form-heading {
  align-items: flex-start;
  gap: 12px;
}

.orders-form-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.orders-form-heading span {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-form-heading small {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-preview-content {
  display: grid;
  grid-template-columns: minmax(540px, 0.95fr) minmax(0, 1.05fr);
  min-height: 0;
  gap: 18px;
}

.orders-preview-details {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  max-height: none;
  gap: 10px;
  overflow: visible;
  padding-right: 3px;
}

.order-plan-check {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 12px;
}

.order-plan-check > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-plan-check strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.order-plan-check span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.order-plan-check.ok {
  border-color: var(--green-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-bg) 45%, transparent), transparent 78%),
    var(--surface-strong);
}

.order-plan-check.acknowledged {
  border-color: var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-muted) 62%, transparent), transparent 76%),
    var(--surface-strong);
}

.order-plan-check.warning {
  border-color: var(--amber-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--amber-bg) 54%, transparent), transparent 78%),
    var(--surface-strong);
}

.order-plan-check.warning strong {
  color: var(--amber);
}

.order-plan-check ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-plan-check li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.35;
}

.acknowledge-warnings-button {
  justify-self: end;
}

.order-assignment-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 34%, transparent), transparent 72%),
    var(--surface-strong);
  padding: 12px;
}

.order-assignment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.order-assignment-form .field {
  gap: 6px;
  font-size: 10.5px;
}

.order-assignment-form input,
.order-assignment-form select,
.order-assignment-form textarea {
  min-height: 36px;
  font-size: 12px;
}

.order-title-field input {
  font-size: 13px;
  font-weight: 850;
}

.order-title-field small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  opacity: 0.8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-handover-fields {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 56%, var(--surface));
  padding: 11px;
}

.order-commercial-fields {
  border-style: solid;
}

.order-rate-summary {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--blue) 20%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface-muted) 72%, transparent);
  padding: 10px 12px;
}

.order-rate-summary strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 950;
}

.order-rate-summary span,
.order-rate-summary small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 820;
  line-height: 1.45;
}

.order-route-panel {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--green) 14%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-muted) 72%, transparent);
  padding: 12px;
}

.order-route-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-route-heading > div {
  display: grid;
  gap: 3px;
}

.order-route-heading strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.order-route-heading span:not(.status-pill) {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.35;
}

.order-route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.order-route-grid > span,
.order-route-places > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 8px 10px;
}

.order-route-grid small,
.order-route-places small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.order-route-grid strong,
.order-route-places span {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
}

.order-route-places {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ltl-route-panel {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface-muted) 74%, transparent);
}

.ltl-route-point-list {
  display: grid;
  gap: 7px;
}

.ltl-route-point {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 8px 9px;
}

.ltl-route-point-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-size: 11px;
  font-weight: 950;
}

.ltl-route-point strong,
.ltl-route-point small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ltl-route-point strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 950;
}

.ltl-route-point small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.ltl-route-point-actions {
  display: flex;
  gap: 5px;
}

.ltl-route-point-actions .button {
  min-height: 28px;
  width: 32px;
  padding: 0;
}

.order-route-messages {
  display: grid;
  gap: 5px;
  margin: 0;
  border: 1px solid var(--amber-border);
  border-radius: 10px;
  background: var(--amber-bg);
  color: var(--amber);
  padding: 8px 10px 8px 24px;
  font-size: 10px;
  font-weight: 850;
}

.order-route-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.route-calculate-button,
.route-map-button {
  justify-self: end;
}

.modal-open {
  overflow: hidden;
}


.order-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: stretch;
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.24), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.16), transparent 38%),
    rgba(2, 8, 23, 0.72);
  padding: 10px;
  backdrop-filter: blur(18px);
}

.order-preview-modal[hidden] {
  display: none;
}

.order-preview-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 68%, rgba(147, 197, 253, 0.48));
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 88%, rgba(96, 165, 250, 0.16)), color-mix(in srgb, var(--surface-muted) 88%, transparent)),
    var(--surface);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.order-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.order-preview-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 950;
}

.order-preview-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.order-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-preview-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.order-preview-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  background: #1e293b;
}

.order-preview-body .order-preview-frame {
  flex: 1;
  display: flex;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.order-preview-body .order-preview-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: #ffffff;
}

.order-preview-body .order-preview-empty {
  flex: 1;
  display: grid;
  min-height: 0;
  place-items: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 28px;
  text-align: center;
}

.route-map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.24), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.16), transparent 38%),
    rgba(2, 8, 23, 0.72);
  padding: 28px;
  backdrop-filter: blur(18px);
}

.route-map-modal[hidden] {
  display: none;
}

.route-map-dialog {
  width: min(1480px, 96vw);
  height: min(860px, 92vh);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 68%, rgba(147, 197, 253, 0.48));
  border-radius: 26px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 88%, rgba(96, 165, 250, 0.16)), color-mix(in srgb, var(--surface-muted) 88%, transparent)),
    var(--surface);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.route-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.route-map-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 950;
  letter-spacing: 0;
}

.route-map-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.route-map-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.route-map-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 16px;
  padding: 18px;
}

.route-map-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(96, 165, 250, 0.12), transparent 44%),
    color-mix(in srgb, var(--surface-muted) 70%, transparent);
  padding: 16px;
}

.route-map-waypoints,
.route-map-result {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 12px;
}

.route-map-waypoints > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-map-waypoints strong,
.route-map-result strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.route-map-waypoints > div:first-child span {
  min-width: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 3px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.route-map-waypoint-list {
  display: grid;
  gap: 8px;
}

.route-map-waypoint-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.route-map-waypoint-add .field {
  margin: 0;
}

.route-map-waypoint-add .button {
  min-height: 42px;
  padding-inline: 14px;
}

.route-map-waypoint-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.route-map-waypoint {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
  padding: 9px 10px;
}

.route-map-waypoint span {
  color: var(--text);
  font-size: 12px;
  font-weight: 920;
}

.route-map-waypoint small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.route-map-waypoint button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.route-map-result span,
.route-map-result small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.45;
}

.route-map-result small {
  color: var(--amber);
}

.route-map-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: auto;
}

.route-map-canvas-wrap {
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 72%, rgba(96, 165, 250, 0.38));
  border-radius: 20px;
  background: var(--surface-muted);
}

.route-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.route-map-canvas .leaflet-container,
.route-map-canvas.leaflet-container {
  background: #0f172a;
  color: #0f172a;
  font-family: inherit;
}

.route-map-canvas .leaflet-control-attribution,
.route-map-canvas .leaflet-control-zoom a {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.82);
  color: #e5e7eb;
}

.calculator-layout {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.calculator-pane {
  display: grid;
  gap: 18px;
}

.calculator-hero {
  padding: 24px;
}

.calculator-hero h2 {
  margin: 3px 0 8px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.calculator-hero p {
  max-width: 900px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.calculator-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.calculator-form-panel,
.calculator-map-panel {
  min-width: 0;
  padding: 18px;
}

.calculator-form-panel .panel-heading > div,
.calculator-map-panel .panel-heading > div {
  display: grid;
  gap: 4px;
}

.calculator-form-panel .panel-heading span,
.calculator-map-panel .panel-heading span:not(.status-pill) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.calculator-form-grid {
  display: grid;
  gap: 13px;
}

.calculator-waypoints .route-map-waypoint.calculator-waypoint-item {
  grid-template-columns: auto 1fr auto;
  gap: 8px 10px;
  align-items: center;
}

.calculator-waypoints .route-map-waypoint-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.calculator-waypoints .route-map-waypoint-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.calculator-waypoints .waypoint-drag-handle,
.calculator-waypoints .route-map-waypoint-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}

.calculator-waypoints .waypoint-drag-handle {
  cursor: grab;
  font-size: 16px;
}

.calculator-waypoints .waypoint-drag-handle:active {
  cursor: grabbing;
}

.calculator-waypoints .route-map-waypoint-actions button[data-calculator-waypoint-remove] {
  font-size: 18px;
}

.calculator-waypoints .route-map-waypoint-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calculator-waypoints .route-map-waypoint.dragging {
  opacity: 0.55;
}

.calculator-waypoints .route-map-waypoint button {
  grid-column: auto;
  grid-row: auto;
}

.calculator-waypoints .route-map-waypoint.drag-over {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.calculator-waypoints {
  margin-top: 14px;
}

.calculator-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.calculator-map-panel {
  display: grid;
  grid-template-rows: auto minmax(560px, 1fr);
  min-height: 700px;
}

.calculator-map-wrap {
  min-height: 560px;
}

.calculator-map-canvas {
  min-height: 560px;
}

.calculator-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: start;
}

.calculator-result-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 7px;
  min-height: 112px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--glass-radius);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--blue) 13%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--glass-shadow-soft), var(--glass-inset);
  padding: 16px;
}

.calculator-result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 48%);
  pointer-events: none;
}

.calculator-result-card > * {
  position: relative;
  z-index: 1;
}

.calculator-result-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.calculator-result-card strong {
  color: var(--navy);
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 950;
  line-height: 1.05;
}

.calculator-result-card small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.45;
}

.calculator-result-card.highlight {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--green) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 88%, transparent);
}

.calculator-result-card.danger {
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--red) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 88%, transparent);
}

.vehicle-map-layout {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.vehicle-map-pane {
  display: grid;
  gap: 18px;
}

.vehicle-map-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.vehicle-map-hero h2 {
  margin: 3px 0 8px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
}

.vehicle-map-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.vehicle-map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.vehicle-map-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.vehicle-map-sidebar,
.vehicle-map-main {
  min-width: 0;
  padding: 18px;
}

.vehicle-map-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: calc(100vh - 190px);
}

.vehicle-map-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.vehicle-map-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 2px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--text);
  box-shadow: var(--glass-inset);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.vehicle-map-list-item:hover,
.vehicle-map-list-item.active {
  border-color: color-mix(in srgb, var(--blue) 78%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 24%, transparent), var(--glass-shadow);
  transform: translateY(-1px);
}

.vehicle-map-list-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.vehicle-map-list-item strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 950;
}

.vehicle-map-list-item small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.vehicle-map-list-item em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.vehicle-map-list-item.online em {
  background: var(--green-bg);
  color: var(--green);
}

.vehicle-map-list-item.stale em {
  background: var(--amber-bg);
  color: var(--amber);
}

.vehicle-map-list-item.missing em {
  background: var(--steel-bg);
  color: var(--muted);
}

.vehicle-map-main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.vehicle-map-canvas {
  height: 560px;
  overflow: hidden;
  border: 1px solid var(--glass-line-strong);
  border-radius: 24px;
  background: var(--surface-muted);
}

.vehicle-map-canvas.leaflet-container {
  background: var(--surface-muted);
}

.vehicle-map-canvas .leaflet-control-attribution,
.vehicle-map-canvas .leaflet-control-zoom a {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.82);
  color: #e5e7eb;
}

.vehicle-map-marker {
  display: flex !important;
  align-items: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.vehicle-map-marker .gps-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #2563eb;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4), 0 2px 5px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Status colors and glowing shadows */
.vehicle-map-marker.online .gps-dot {
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 0 8px rgba(16, 185, 129, 0.8), 0 2px 5px rgba(0, 0, 0, 0.4);
}

.vehicle-map-marker.stale .gps-dot {
  background-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 0 8px rgba(245, 158, 11, 0.8), 0 2px 5px rgba(0, 0, 0, 0.4);
}

.vehicle-map-marker.active .gps-dot {
  background-color: #3b82f6;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5), 0 0 15px rgba(59, 130, 246, 1), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Pulsing waves */
.vehicle-map-marker.online .gps-dot::after {
  content: '';
  position: absolute;
  top: -2.5px;
  left: -2.5px;
  right: -2.5px;
  bottom: -2.5px;
  border-radius: 50%;
  border: 1px solid rgba(16, 185, 129, 0.6);
  animation: gps-pulse 2s infinite ease-out;
  pointer-events: none;
}

.vehicle-map-marker.active .gps-dot::after {
  content: '';
  position: absolute;
  top: -2.5px;
  left: -2.5px;
  right: -2.5px;
  bottom: -2.5px;
  border-radius: 50%;
  border: 1.5px solid rgba(59, 130, 246, 0.8);
  animation: gps-pulse 1.8s infinite ease-out;
  pointer-events: none;
}

@keyframes gps-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Floating name tags */
.vehicle-map-marker .gps-label {
  margin-left: 8px;
  padding: 4.5px 9px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-shadow: none;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.vehicle-map-marker.active .gps-label {
  background: rgba(30, 41, 59, 0.95);
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 0 8px rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

/* List stacked markers layout */
.vehicle-map-marker.list-marker {
  align-items: flex-start !important;
}

.vehicle-map-marker.list-marker .gps-dot {
  margin-top: 7px; /* Align dot center with the middle of the first row (height 28px) */
}

/* Floating list of vehicle registrations */
.gps-label-list {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.88); /* Deep slate cockpit background */
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  margin-left: 8px;
  pointer-events: auto;
  min-width: 120px;
}

.gps-list-row {
  display: flex;
  align-items: center;
  padding: 6.5px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

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

.gps-list-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gps-list-row.active {
  background: rgba(59, 130, 246, 0.24);
}

.gps-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  display: inline-block;
  border: 1px solid #ffffff;
}

.gps-list-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.gps-list-dot.stale {
  background-color: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.gps-list-dot.active {
  background-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 1);
  border-color: #ffffff;
}

.gps-list-text {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gps-list-row.active .gps-list-text {
  color: #ffffff;
  text-shadow: 0 0 4px rgba(59, 130, 246, 0.3);
}

.vehicle-map-details {
  position: static;
  width: 100%;
  margin-top: 18px;
  z-index: 10;
  pointer-events: auto;
}

.vehicle-map-detail-card,
.vehicle-map-empty-detail {
  pointer-events: auto;
  border: 1px solid var(--glass-line-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--blue) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: var(--glass-shadow-strong), var(--glass-inset);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 18px;
}

.vehicle-map-detail-card {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 24px;
}

.vehicle-map-detail-card.online {
  border-color: color-mix(in srgb, var(--green) 36%, var(--glass-line-strong));
}

.vehicle-map-detail-card.stale {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--glass-line-strong));
}

.vehicle-map-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vehicle-map-detail-heading h2 {
  margin: 2px 0;
  color: var(--navy);
  font-size: 24px;
  font-weight: 950;
}

.vehicle-map-detail-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.vehicle-map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.vehicle-map-stats span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  padding: 10px;
}

.vehicle-map-stats small,
.vehicle-map-order span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.vehicle-map-stats strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.vehicle-map-orders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}

.vehicle-map-order {
  display: grid;
  gap: 4px;
  border: 2px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent);
  padding: 11px 12px;
}

.vehicle-map-order.in_progress {
  border-color: color-mix(in srgb, var(--blue) 54%, var(--line));
}

.vehicle-map-order.planned {
  border-color: color-mix(in srgb, var(--violet) 56%, var(--line));
}

.vehicle-map-order.new {
  border-color: color-mix(in srgb, var(--steel) 42%, var(--line));
}

.vehicle-map-order strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.vehicle-map-order small,
.vehicle-map-order em {
  color: var(--text-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.35;
}

.vehicle-map-order.empty {
  opacity: 0.72;
}

.vehicle-map-empty-detail {
  display: grid;
  gap: 5px;
}

.vehicle-map-empty-detail strong {
  color: var(--navy);
  font-size: 16px;
  font-weight: 950;
}

.vehicle-map-empty-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}


.toll-breakdown-card {
  align-content: start;
}

.calculator-result-card.toll-breakdown-card {
  overflow: visible;
  z-index: 2;
}

.calculator-result-card.toll-breakdown-card.is-expanded {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  box-shadow: var(--glass-shadow-soft), 0 14px 28px color-mix(in srgb, var(--blue) 10%, transparent);
  z-index: 3;
}

.toll-breakdown-cell.toll-breakdown-card {
  position: relative;
}

.toll-breakdown-cell.toll-breakdown-card.is-expanded {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--surface) 88%, var(--blue-bg));
}

.toll-breakdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin-top: 2px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.toll-breakdown-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.toll-breakdown-toggle[aria-expanded="true"] .toll-breakdown-toggle-icon {
  transform: rotate(180deg);
}

.toll-breakdown-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  animation: toll-breakdown-open 0.18s ease;
}

@keyframes toll-breakdown-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toll-breakdown-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.toll-breakdown-panel-head strong {
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.toll-breakdown-panel-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 780;
  white-space: nowrap;
}

.toll-breakdown-list {
  display: grid;
  gap: 6px;
}

.toll-breakdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  padding: 7px 9px;
  font-size: 11.5px;
}

.toll-breakdown-row em {
  color: var(--text-soft);
  font-style: normal;
  font-weight: 780;
}

.toll-breakdown-row b {
  color: var(--navy);
  font-weight: 900;
  text-align: right;
  white-space: normal;
}

.toll-breakdown-note {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.4;
}

.calculator-result-card.warning {
  border-color: color-mix(in srgb, var(--amber) 58%, var(--line));
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--amber) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 88%, transparent);
}

.order-handover-heading {
  display: grid;
  gap: 3px;
}

.order-handover-heading strong {
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
}


.order-places-group {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  border: 1px dashed color-mix(in srgb, var(--line-strong) 82%, transparent);
  border-radius: 12px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface-muted) 42%, transparent);
}

.order-places-heading {
  display: grid;
  gap: 3px;
}

.order-places-heading strong {
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 950;
}

.order-places-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 780;
  line-height: 1.35;
}

.order-places-list {
  display: grid;
  gap: 8px;
}

.order-place-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.order-place-field {
  min-width: 0;
}

.order-place-add {
  justify-self: start;
}

.order-commercial-fields .order-assignment-grid {
  align-items: start;
}

.order-handover-heading span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 780;
  line-height: 1.35;
}

.order-assignment-note textarea {
  min-height: 62px;
  resize: vertical;
}

.order-assignment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-assignment-button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-assignment-actions span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-extract-button {
  border-color: color-mix(in srgb, var(--violet) 42%, var(--line-strong));
  color: color-mix(in srgb, var(--violet) 72%, var(--blue));
}

.order-assignment-form.ai-suggested {
  border-color: color-mix(in srgb, var(--violet) 42%, var(--line-strong));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--violet) 18%, transparent),
    var(--glass-shadow);
}

.order-history {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted) 54%, var(--surface));
  padding: 0;
  overflow: hidden;
}

.order-history[open] {
  padding-bottom: 12px;
}

.order-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.order-history-heading::-webkit-details-marker {
  display: none;
}

.order-history-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}

.order-history-heading span,
.order-history-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.order-history-heading span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.history-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 14px;
  font-weight: 950;
}

.history-toggle-icon::before {
  content: "+";
  line-height: 1;
}

.order-history[open] .history-toggle-icon::before {
  content: "-";
}

.order-history-empty {
  margin: 0;
  padding: 0 12px;
  line-height: 1.45;
}

.order-history-list {
  display: grid;
  max-height: 172px;
  gap: 8px;
  margin: 0;
  overflow: auto;
  padding: 0 12px;
  list-style: none;
}

.order-history-list li {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 10px;
}

.order-history-list strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.35;
}

.order-history-list span,
.order-history-list small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 760;
  line-height: 1.35;
}

.orders-preview-frame {
  min-height: 760px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 40%, transparent);
}

.orders-preview-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.orders-preview-empty {
  display: grid;
  min-height: 760px;
  place-items: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 28px;
  text-align: center;
}

.orders-preview-empty strong {
  color: var(--navy);
  font-size: 20px;
  font-weight: 900;
}

.orders-preview-empty span {
  max-width: 360px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.earnings-layout {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.earnings-pane {
  display: grid;
  gap: 18px;
}

.earnings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.earnings-hero h2 {
  margin: 3px 0 8px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.earnings-hero p {
  max-width: 860px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.earnings-month-field {
  flex: 0 0 220px;
}

.earnings-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
}

.earnings-summary-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 32%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.earnings-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.earnings-summary-card strong {
  color: var(--navy);
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.earnings-table-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.earnings-table-panel .panel-heading > div {
  display: grid;
  gap: 4px;
}

.earnings-table-panel .panel-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.earnings-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.earnings-table-header,
.earnings-vehicle-summary {
  display: grid;
  grid-template-columns:
    minmax(200px, 1.2fr)
    minmax(70px, 0.35fr)
    minmax(100px, 0.5fr)
    minmax(120px, 0.55fr)
    minmax(140px, 0.65fr)
    minmax(140px, 0.65fr)
    minmax(140px, 0.65fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 1180px;
}

.empty-run-share {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.empty-run-panel .empty-run-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.earnings-table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: var(--table-head-solid);
  color: var(--muted);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.earnings-vehicle-list {
  display: grid;
  min-width: 1180px;
}

.earnings-vehicle-card {
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.earnings-vehicle-card:last-child {
  border-bottom: 0;
}

.earnings-vehicle-summary {
  position: relative;
  min-height: 64px;
  color: var(--text);
  padding: 12px 16px 12px 52px;
  font-size: 13px;
  font-weight: 820;
  cursor: pointer;
  list-style: none;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.earnings-vehicle-summary::-webkit-details-marker {
  display: none;
}

.earnings-vehicle-summary::before {
  content: "+";
  position: absolute;
  left: 16px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
}

.earnings-vehicle-card[open] .earnings-vehicle-summary::before {
  content: "-";
}

.earnings-vehicle-summary:hover {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 50%, transparent), transparent 76%),
    var(--surface-strong);
}

.earnings-vehicle-card[open] .earnings-vehicle-summary {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 56%, transparent), transparent 78%),
    var(--surface-strong);
}

.earnings-vehicle-name {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.earnings-vehicle-name strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earnings-vehicle-name small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earnings-order-list {
  display: grid;
  gap: 7px;
  padding: 12px 16px 14px 52px;
}

.earnings-order-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 56%, var(--surface));
  padding: 8px 10px;
}

.earnings-order-item strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earnings-order-item span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 780;
  line-height: 1.35;
}

.earnings-warning {
  border: 1px solid color-mix(in srgb, var(--amber) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  color: var(--amber);
  padding: 1px 6px;
  font: inherit;
  font-weight: 900;
}

.earnings-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
}

.earnings-empty strong {
  color: var(--navy);
  font-size: 18px;
  font-weight: 920;
}

.earnings-empty span {
  max-width: 520px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.5;
}

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

.metrics {
  display: block;
  margin-bottom: 24px;
}

.fleet-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 16px;
  align-items: start;
}

.metric-list {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.metric,
.panel,
.table-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(140%);
}

.metric {
  position: relative;
  min-height: 94px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-strong) 40%, transparent));
  padding: 12px 14px 12px 16px;
  transition:
    border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric:hover {
  border-color: var(--hover-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.metric-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric strong.metric-value {
  display: block;
  color: var(--navy-strong);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-top: 0;
}

.metric-subtext {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Icon indicator */
.metric-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.metric-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Theme specifics for cards */
.metric-health .metric-icon {
  color: var(--primary);
  background: var(--blue-bg);
  border-color: var(--blue-border);
}

.metric-urgent .metric-icon {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.metric-urgent-ok .metric-icon {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.metric-drivers .metric-icon {
  color: var(--violet);
  background: var(--violet-bg);
  border-color: rgba(139, 92, 246, 0.25);
}

/* Progress ring styles */
.metric-gauge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring__bg {
  stroke: rgba(255, 255, 255, 0.05);
  transition: stroke 0.3s ease;
}

:root[data-theme="light"] .progress-ring__bg {
  stroke: rgba(0, 0, 0, 0.04);
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
}

/* Colors for progress gauges */
.progress-ring__circle--health {
  stroke: var(--primary);
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4));
}

.progress-ring__circle--urgent {
  stroke: var(--amber);
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.progress-ring__circle--drivers {
  stroke: var(--violet);
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

.gauge-percent {
  position: absolute;
  font-size: 11px;
  font-weight: 850;
  color: var(--navy-strong);
  letter-spacing: -0.5px;
}

/* Pulse animation for attention-required metric */
.critical-pulse {
  border-color: var(--amber-border) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15), var(--shadow-soft) !important;
  animation: card-alert-pulse 2s infinite alternate;
}

@keyframes card-alert-pulse {
  from {
    border-color: var(--amber-border) !important;
  }
  to {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25), var(--shadow) !important;
  }
}

.dashboard-calendar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-self: end;
  min-width: 0;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 42%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-heading span,
.calendar-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-heading strong {
  display: block;
  margin-top: 1px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
  text-transform: capitalize;
}

.calendar-heading small {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 4px 10px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  gap: 6px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  gap: 6px;
  flex: 1;
  grid-auto-rows: minmax(0, 1fr);
  min-height: 0;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-strong));
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
}

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
}

.calendar-day.today:not(.has-events) {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.calendar-day.has-events {
  border-color: color-mix(in srgb, var(--amber-border) 78%, var(--blue-border));
  background:
    radial-gradient(circle at 76% 26%, color-mix(in srgb, var(--amber) 18%, transparent), transparent 34%),
    var(--amber-bg);
  color: var(--amber);
  cursor: default;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 12%, transparent);
}

.calendar-day.has-events.today {
  border-color: var(--red-border);
  background:
    radial-gradient(circle at 76% 26%, color-mix(in srgb, var(--red) 20%, transparent), transparent 34%),
    var(--red-bg);
  color: var(--red);
}

.calendar-date-number {
  position: relative;
  z-index: 1;
}

.calendar-event-count {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: currentColor;
  color: var(--surface);
  padding: 0 4px;
  font-size: 9px;
  font-weight: 900;
}

.calendar-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 40;
  display: grid;
  width: min(280px, 76vw);
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-strong));
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 6px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.calendar-day.has-events:hover .calendar-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.calendar-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-strong));
  transform: translate(-50%, -5px) rotate(45deg);
}

.calendar-tooltip strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  text-transform: capitalize;
}

.calendar-tooltip span {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  padding-top: 7px;
  font-size: 12px;
  font-weight: 760;
}

.calendar-tooltip b {
  color: var(--navy);
  font-weight: 900;
}

.calendar-tooltip small,
.calendar-tooltip em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
}

.search-field {
  display: grid;
  min-width: 320px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field input,
.field input,
.field select,
textarea,
input[type="date"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  box-shadow: var(--input-shadow);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.search-field input::placeholder,
.field input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.search-field input:focus,
.field input:focus,
.field select:focus,
textarea:focus,
input[type="date"]:focus {
  border-color: var(--blue);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.segmented {
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--segment-bg);
}

.segment,
.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  padding: 9px 14px;
  font-weight: 780;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.button {
  border-color: var(--line-strong);
  background: var(--surface);
}

.segment:hover,
.button:hover {
  border-color: var(--hover-border);
  color: var(--navy);
}

.button:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.segment.active,
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.button.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.button.muted {
  background: var(--surface);
}

.button:disabled {
  cursor: progress;
  opacity: 0.68;
  transform: none;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.button.theme-toggle {
  min-width: 112px;
}

.category-tables {
  display: grid;
  gap: 26px;
}

.category-section {
  min-width: 0;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.category-heading h2 {
  color: var(--navy);
  font-size: 21px;
  font-weight: 850;
}

.category-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  border: 1px solid var(--count-border);
  border-radius: 999px;
  background: var(--steel-bg);
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.table-wrap {
  position: relative;
  overflow: visible;
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--navy), var(--blue));
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}

th,
td {
  overflow: hidden;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: var(--sticky-table-top);
  z-index: 4;
  background: var(--table-head-solid);
  box-shadow: 0 1px 0 var(--line), 0 12px 20px rgba(15, 23, 42, 0.07);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
  text-transform: uppercase;
}

.vehicle-row td {
  height: 46px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 100px;
}

th:nth-child(2),
td:nth-child(2) {
  display: none;
}

th:nth-child(3),
td:nth-child(3) {
  width: 86px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 78px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 38px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 94px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 122px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 50px;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
}

.hidden-column {
  display: none;
}

th:nth-child(n + 9):not(:last-child),
td:nth-child(n + 9):not(:last-child) {
  width: 68px;
}

th:last-child,
td:last-child {
  width: 54px;
}

tbody tr {
  background: var(--row-bg);
  transition:
    background 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr:hover {
  background: var(--row-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.vehicle-row td:first-child {
  border-left: 3px solid transparent;
}

.status-row-ok td:first-child {
  border-left-color: var(--green-border);
}

.status-row-soon td:first-child {
  border-left-color: var(--blue-border);
}

.status-row-urgent td:first-child {
  border-left-color: var(--amber);
}

.status-row-overdue td:first-child {
  border-left-color: var(--red);
}

.status-row-missing td:first-child {
  border-left-color: var(--steel-border);
}

.reg {
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 900;
}

.registration-cell {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.registration-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.note-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--navy);
  padding: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.note-toggle-button:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.note-toggle-button[aria-expanded="true"] {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.vin {
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.type-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 25px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 7px;
  overflow: visible;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.type-chip.truck {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-chip-text);
}

.type-chip.trailer {
  background: var(--steel-bg);
  border-color: var(--steel-border);
  color: var(--steel-chip-text);
}

.status-pill.ok {
  min-width: 54px;
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
  box-shadow: var(--glow-green);
}

.status-pill.soon {
  min-width: 76px;
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue);
  box-shadow: var(--glow-blue);
}

.status-pill.urgent {
  min-width: 76px;
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--amber);
  box-shadow: var(--glow-amber);
  animation: status-pulse 2s infinite alternate;
}

.status-pill.overdue {
  min-width: 76px;
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
  box-shadow: var(--glow-red);
  animation: status-pulse 1.2s infinite alternate;
}

.status-pill.missing,
.status-pill.neutral {
  background: var(--steel-bg);
  border-color: var(--steel-border);
  color: var(--steel-chip-text);
}

:is(
  .top-icon-button:hover,
  .top-icon-button:focus-visible,
  .bottom-tool-button.active,
  .tool-panel-icon,
  .tool-close-button:hover,
  .note-toggle-button:hover,
  .note-toggle-button[aria-expanded="true"],
  .planner-alert-card.warning,
  .planner-alert-card.danger,
  .planner-alert-card.clear,
  .planner-alert-note.clear,
  .timeline-order-card:hover,
  .timeline-order-card.active,
  .timeline-order-card.has-warning,
  .timeline-order-card.has-conflict,
  .timeline-order-card.in_progress,
  .timeline-order-card.done,
  .timeline-order-card.cancelled,
  .timeline-order-card.in_progress:hover,
  .timeline-order-card.in_progress.active,
  .timeline-order-card.done:hover,
  .timeline-order-card.done.active,
  .timeline-order-card.cancelled:hover,
  .timeline-order-card.cancelled.active,
  .order-card.active,
  .order-card.has-warning,
  .order-card.has-conflict,
  .completed-orders-summary strong,
  .order-status-chip.planned,
  .order-status-chip.in_progress,
  .order-status-chip.done,
  .order-status-chip.cancelled,
  .order-warning-chip,
  .order-warning-chip.danger,
  .order-warning-chip.duplicate,
  .order-plan-check.ok,
  .order-plan-check.acknowledged,
  .order-plan-check.warning,
  .status-pill.ok,
  .status-pill.soon,
  .status-pill.urgent,
  .status-pill.overdue,
  .type-chip.truck,
  .days-badge.ok,
  .days-badge.soon,
  .days-badge.urgent,
  .days-badge.overdue,
  .days-badge.missing,
  .readonly-cell.warning,
  .readonly-cell.danger,
  .doc-link,
  .row-action-button,
  input[type="date"].date-alert,
  .calendar-day.has-events,
  .calendar-day.has-events.today,
  .driver-copy-primary,
  .driver-profile-card.active,
  .driver-card-tab.active,
  .earnings-vehicle-summary:hover,
  .earnings-vehicle-card[open] .earnings-vehicle-summary
) {
  border-width: 4px;
}

@keyframes status-pulse {
  from {
    opacity: 0.86;
    filter: brightness(0.95);
  }
  to {
    opacity: 1;
    filter: brightness(1.2);
  }
}

.days-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-soft);
  padding: 2px 6px;
  overflow: visible;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.days-badge.ok {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}

.days-badge.soon {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue);
}

.days-badge.urgent {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.days-badge.overdue {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.days-badge.missing {
  border-color: var(--steel-border);
  background: var(--steel-bg);
  color: var(--steel-chip-text);
}

input[type="date"] {
  min-height: 32px;
  padding: 5px 6px;
}

input[type="date"].date-alert {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
  font-weight: 850;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 16%, transparent);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.7;
}

:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.custom-field.date-field {
  width: 100%;
  min-width: 0;
}

.custom-field.text-field {
  width: 100%;
  min-width: 0;
}

.readonly-cell {
  display: block;
  max-width: 100%;
  min-height: 32px;
  padding: 7px 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readonly-cell.warning {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber);
}

.readonly-cell.danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red);
}

.doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--blue-border);
  border-radius: 7px;
  background: var(--blue-bg);
  color: var(--blue-chip-text);
  font-size: 11.5px;
  font-weight: 850;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.doc-link:hover {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.row-action-button {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--red-border);
  border-radius: 7px;
  background: var(--red-bg);
  color: var(--red);
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.row-action-button:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.expanded-note-row {
  background: var(--surface-strong) !important;
}

.expanded-note-cell {
  width: auto !important;
  padding: 12px !important;
  border-bottom: 1px solid var(--line-strong);
  white-space: normal;
}

.expanded-note-field {
  display: grid;
  gap: 8px;
}

.expanded-note-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.note-input {
  width: 100%;
  min-width: 0;
  min-height: 108px;
  resize: vertical;
  white-space: pre-wrap;
}

td input[type="date"],
td input[type="text"] {
  min-height: 32px;
  padding: 5px 6px;
  font-size: 11.5px;
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.visibility-groups {
  display: grid;
  gap: 16px;
}

.visibility-group {
  display: grid;
  gap: 10px;
}

.visibility-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.visibility-list {
  display: grid;
  gap: 8px;
}

.visibility-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--text-soft);
}

.visibility-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.visibility-item span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.visibility-item strong,
.visibility-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visibility-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.visibility-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text-soft);
  font-weight: 760;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.driver-cards-panel {
  display: grid;
  gap: 18px;
  overflow: visible;
}

.driver-cards-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 400px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.driver-cards-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 400px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-muted) 52%, var(--surface));
  padding: 14px;
}

.driver-sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.driver-sidebar-heading .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.driver-sidebar-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.driver-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-height: min(calc(100vh - 260px), 820px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.driver-tab {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  overflow: visible;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text-soft);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.driver-tab:hover {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
}

.driver-tab.active {
  border-color: var(--blue);
  background: var(--surface-strong);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 20%, transparent);
}

.driver-tab-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-bg) 75%, var(--surface-strong));
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.driver-tab-content {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: 10px;
  overflow: visible;
}

.driver-tab-name {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-tab-plates {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.driver-tab-plate {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-tab-plate.muted {
  color: var(--muted);
  font-style: italic;
}

.driver-card-editor {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-muted) 40%, var(--surface));
  padding: 16px;
}

.driver-card-form {
  display: grid;
  gap: 16px;
}

.driver-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue-bg) 42%, transparent), transparent 58%),
    var(--surface-strong);
  padding: 16px;
}

.driver-profile-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.driver-profile-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--blue-border);
  border-radius: 13px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 17px;
  font-weight: 950;
}

.driver-profile-main span:not(.driver-profile-number) {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.driver-profile-main h3 {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-copy-primary {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 18px;
}

.driver-vehicle-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 10px;
}

.driver-vehicle-strip span {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
}

.driver-vehicle-strip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.driver-vehicle-strip strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-card-form input,
.driver-card-form textarea {
  text-transform: none;
}

.driver-card-form textarea {
  min-height: 150px;
  resize: vertical;
}

.driver-note-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 12px;
}

.driver-note-field textarea,
.driver-note-field textarea[readonly] {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
}

.driver-card-form input[readonly],
.driver-card-form textarea[readonly] {
  background: var(--surface-strong);
  cursor: default;
}

.driver-card-form.editing input:not([readonly]),
.driver-card-form.editing textarea:not([readonly]) {
  border-color: var(--blue);
  background: var(--input-bg);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    var(--input-shadow);
}

.driver-copy-preview {
  min-height: 120px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface));
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.driver-cards-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.custom-columns-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.custom-column-item,
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
}

.custom-column-item strong,
.custom-column-item span,
.archive-item strong,
.archive-item span,
.archive-item small {
  display: block;
}

.custom-column-item strong,
.archive-item strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.custom-column-item span,
.archive-item span,
.archive-item small,
.empty-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-list {
  display: grid;
  gap: 8px;
}

.archive-item > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.archive-item strong,
.archive-item span,
.archive-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-hint {
  margin: 12px 0 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--steel);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.icon-button:hover {
  border-color: var(--danger-soft);
  background: var(--red-bg);
  color: var(--red);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--toast-bg);
  color: var(--navy);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

/* Liquid Glass / Neuromorphic visual layer */
body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 10%, rgba(59, 130, 246, 0.22), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(139, 92, 246, 0.18), transparent 30%),
    radial-gradient(circle at 62% 88%, rgba(239, 68, 68, 0.1), transparent 32%),
    linear-gradient(135deg, #f8fafc 0%, #eef5ff 48%, #f8fbff 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(ellipse at 12% 18%, rgba(125, 211, 252, 0.22), transparent 30%),
    radial-gradient(ellipse at 84% 8%, rgba(99, 102, 241, 0.18), transparent 34%),
    radial-gradient(ellipse at 76% 88%, rgba(248, 113, 113, 0.08), transparent 28%);
  filter: blur(12px);
}

body::after {
  opacity: 0.44;
  background:
    linear-gradient(118deg, transparent 0 22%, rgba(255, 255, 255, 0.42) 23%, transparent 27% 100%),
    linear-gradient(142deg, transparent 0 48%, rgba(59, 130, 246, 0.16) 49%, transparent 55% 100%);
  mix-blend-mode: soft-light;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 18% 4%, rgba(56, 189, 248, 0.3), transparent 34%),
    radial-gradient(ellipse at 76% 3%, rgba(79, 70, 229, 0.36), transparent 38%),
    radial-gradient(ellipse at 72% 92%, rgba(185, 28, 28, 0.18), transparent 36%),
    linear-gradient(135deg, #030712 0%, #071126 42%, #020617 100%) fixed !important;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse at 12% 18%, rgba(56, 189, 248, 0.26), transparent 30%),
    radial-gradient(ellipse at 76% 16%, rgba(37, 99, 235, 0.26), transparent 36%),
    radial-gradient(ellipse at 92% 84%, rgba(139, 92, 246, 0.2), transparent 34%),
    linear-gradient(112deg, transparent 0 18%, rgba(125, 211, 252, 0.08) 19% 21%, transparent 25% 100%),
    linear-gradient(145deg, transparent 0 52%, rgba(96, 165, 250, 0.08) 53% 55%, transparent 60% 100%);
  filter: blur(8px) saturate(130%);
}

:root[data-theme="dark"] body::after {
  opacity: 0.28;
  background:
    linear-gradient(122deg, transparent 0 26%, rgba(255, 255, 255, 0.18) 27%, transparent 30% 100%),
    linear-gradient(144deg, transparent 0 44%, rgba(59, 130, 246, 0.2) 45%, transparent 49% 100%);
}

.topbar,
.bottom-bar,
.bottom-drawer,
.metric,
.panel,
.table-wrap,
.dashboard-calendar,
.orders-list-panel,
.orders-form-panel,
.earnings-summary-card,
.earnings-table-wrap,
.driver-profile-card,
.driver-card-tab,
.driver-cards-sidebar,
.driver-editor,
.completed-orders-summary,
.completed-orders-content {
  border-color: var(--glass-line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 34%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--glass-bg-strong) 74%, transparent), var(--glass-bg));
  box-shadow: var(--glass-shadow), var(--glass-inset);
  backdrop-filter: blur(var(--glass-blur)) saturate(155%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(155%);
}

.top-icon-button,
.tool-close-button,
.note-toggle-button,
.row-action-button,
.doc-link,
.calendar-day,
.tool-badge {
  border-color: var(--glass-line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--glass-highlight) 26%, transparent), transparent 46%),
    color-mix(in srgb, var(--glass-bg-strong) 76%, transparent);
  box-shadow: var(--glass-inset), 0 10px 24px rgba(0, 0, 0, 0.12);
}

.topbar {
  min-height: 80px;
  margin: 12px 14px 0;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--glass-highlight) 34%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--topbar-bg) 86%, transparent), color-mix(in srgb, var(--glass-bg) 78%, transparent));
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.topbar-logo {
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 32% 10%, rgba(255, 255, 255, 0.18), transparent 38%),
    #020617;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.top-actions {
  border-color: var(--glass-line-strong);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 24%, transparent), transparent 52%),
    color-mix(in srgb, var(--glass-bg) 84%, transparent);
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.top-icon-button:hover,
.top-icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--glass-line-strong));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--blue) 28%, transparent), transparent 48%),
    color-mix(in srgb, var(--blue-bg) 74%, var(--glass-bg));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--blue) 20%, transparent),
    0 18px 42px color-mix(in srgb, var(--blue) 24%, transparent),
    var(--glass-inset);
}

.top-icon-primary {
  border-color: color-mix(in srgb, var(--blue) 62%, transparent);
  background:
    radial-gradient(circle at 26% 20%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(135deg, #38bdf8, var(--blue) 50%, #4338ca);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 18px 40px color-mix(in srgb, var(--blue) 36%, transparent);
}

.fleet-dashboard,
.orders-board,
.driver-cards-layout {
  gap: 18px;
}

.metric,
.panel,
.table-wrap,
.dashboard-calendar,
.earnings-summary-card {
  position: relative;
  border-radius: var(--glass-radius);
}

.panel > *,
.metric > *,
.dashboard-calendar > *,
.orders-hero > *,
.earnings-summary-card > * {
  position: relative;
  z-index: 1;
}

.metric {
  overflow: hidden;
  min-height: 90px;
}

.metric::before,
.panel::before,
.table-wrap::after,
.orders-hero::before,
.dashboard-calendar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

.metric:hover,
.panel:hover,
.dashboard-calendar:hover,
.earnings-summary-card:hover {
  border-color: var(--glass-line-strong);
  box-shadow: var(--glass-shadow-strong), var(--glass-inset);
}

.metric-icon,
.tool-panel-icon,
.metric-gauge {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.22));
}

.calendar-day.has-events,
.calendar-day.has-events.today {
  box-shadow:
    0 0 0 2px color-mix(in srgb, currentColor 18%, transparent),
    0 16px 34px color-mix(in srgb, currentColor 18%, transparent),
    var(--glass-inset);
}

.toolbar,
.orders-timeline-heading,
.orders-preview-heading,
.panel-heading,
.category-heading {
  position: relative;
  z-index: 1;
}

.search-field input,
.field input,
.field select,
textarea,
input[type="date"] {
  border-color: var(--glass-line-strong);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 18%, transparent), transparent 52%),
    var(--input-bg);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--glass-highlight) 36%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.08);
}

.search-field input:focus,
.field input:focus,
.field select:focus,
textarea:focus,
input[type="date"]:focus {
  border-color: color-mix(in srgb, var(--blue) 76%, white 8%);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent),
    0 18px 42px color-mix(in srgb, var(--blue) 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--glass-highlight) 38%, transparent);
}

.segmented {
  border-color: var(--glass-line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 20%, transparent), transparent 50%),
    color-mix(in srgb, var(--segment-bg) 84%, transparent);
  box-shadow: var(--glass-inset);
}

.segment,
.button {
  border-radius: 13px;
}

.segment.active,
.button.primary {
  border-color: color-mix(in srgb, var(--blue) 74%, white 10%);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.26), transparent 36%),
    linear-gradient(135deg, #38bdf8, var(--blue) 54%, #4338ca);
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--blue) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.button,
.button.muted,
.compact-button {
  border-color: var(--glass-line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--glass-highlight) 22%, transparent), transparent 44%),
    color-mix(in srgb, var(--glass-bg-strong) 74%, transparent);
  box-shadow: var(--glass-inset), 0 12px 28px rgba(0, 0, 0, 0.1);
}

.table-wrap {
  overflow: visible;
  border-color: var(--glass-line);
}

.table-wrap::before {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue) 64%, white 12%), transparent);
}

th {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--glass-highlight) 10%, transparent), transparent),
    var(--table-head-solid);
  box-shadow:
    0 1px 0 var(--glass-line),
    0 16px 28px rgba(0, 0, 0, 0.16);
}

tbody tr {
  background: color-mix(in srgb, var(--row-bg) 88%, transparent);
}

tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--row-alt) 88%, transparent);
}

tbody tr:hover {
  background:
    radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 48%),
    var(--row-hover);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 20%, transparent);
}

.orders-timeline,
.orders-timeline-scroll,
.orders-timeline-grid,
.timeline-row-track,
.timeline-vehicle-cell,
.timeline-day-header,
.timeline-corner {
  border-color: var(--glass-line);
}

.orders-timeline {
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 36%),
    color-mix(in srgb, var(--glass-bg-muted) 78%, transparent);
}

.timeline-row-track {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 38%),
    color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

.timeline-order-card,
.order-card {
  border-width: 4px;
  border-radius: 16px;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.timeline-order-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 18%, transparent), transparent 42%),
    color-mix(in srgb, var(--glass-bg-strong) 82%, transparent);
}

.order-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 20%, transparent), transparent 44%),
    color-mix(in srgb, var(--glass-bg-strong) 84%, transparent);
}

.timeline-order-card:hover,
.timeline-order-card.active,
.order-card:hover,
.order-card.active {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent),
    0 22px 52px color-mix(in srgb, var(--blue) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.timeline-order-card.planned,
.order-card.planned {
  border-color: color-mix(in srgb, var(--glass-status-planned) 78%, transparent);
}

.timeline-order-card.planned:hover,
.timeline-order-card.planned.active,
.order-card.planned:hover,
.order-card.active.planned {
  border-color: color-mix(in srgb, var(--glass-status-planned) 94%, white 12%);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--glass-status-planned) 34%, transparent),
    0 22px 54px color-mix(in srgb, var(--glass-status-planned) 34%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.timeline-order-card.in_progress,
.order-card.in_progress {
  border-color: color-mix(in srgb, var(--glass-status-progress) 72%, transparent);
}

.timeline-order-card.done,
.order-card.done {
  border-color: color-mix(in srgb, var(--glass-status-done) 72%, transparent);
}

.timeline-order-card.has-warning:not(.has-conflict),
.order-card.has-warning:not(.has-conflict) {
  border-color: color-mix(in srgb, var(--glass-status-warning) 72%, transparent);
}

.timeline-order-card.has-conflict,
.order-card.has-conflict,
.timeline-order-card.cancelled,
.order-card.cancelled {
  border-color: color-mix(in srgb, var(--glass-status-danger) 74%, transparent);
}

.order-file-icon,
.order-status-chip,
.order-warning-chip,
.status-pill,
.days-badge,
.type-chip,
.readonly-cell,
.driver-copy-primary,
.driver-copy-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(0, 0, 0, 0.12);
}

.bottom-bar {
  border-radius: 28px;
}

.bottom-drawer {
  border-radius: 28px;
  box-shadow: var(--glass-shadow-strong), var(--glass-inset);
}

.bottom-tool-button {
  border-radius: 20px;
}

.bottom-tool-button:hover,
.bottom-tool-button.active {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent),
    0 18px 42px color-mix(in srgb, var(--blue) 24%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.driver-profile-card,
.driver-card-tab,
.earnings-vehicle-card,
.earnings-order-item,
.archive-item,
.custom-column-item {
  border-color: var(--glass-line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-highlight) 16%, transparent), transparent 42%),
    color-mix(in srgb, var(--glass-bg-strong) 74%, transparent);
  box-shadow: var(--glass-inset);
}

.driver-profile-card.active,
.driver-card-tab.active,
.earnings-vehicle-card[open] .earnings-vehicle-summary {
  border-color: color-mix(in srgb, var(--blue) 62%, var(--glass-line-strong));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent),
    0 18px 42px color-mix(in srgb, var(--blue) 18%, transparent),
    var(--glass-inset);
}

:root[data-theme="dark"] ::selection {
  background: rgba(59, 130, 246, 0.36);
  color: #ffffff;
}

:root[data-theme="dark"] * {
  scrollbar-color: rgba(125, 211, 252, 0.38) rgba(15, 23, 42, 0.42);
}

@media (max-width: 900px) {
  .driver-cards-workspace {
    grid-template-columns: 1fr;
  }

  .driver-cards-sidebar {
    max-width: none;
  }

  .driver-tabs-list {
    max-height: none;
    overflow: visible;
  }

  .vehicle-map-detail-card {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .vehicle-map-orders {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .orders-board {
    grid-template-columns: 1fr;
  }

  .orders-list-panel,
  .orders-form-panel {
    height: auto;
    min-height: 520px;
  }

  .orders-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .orders-timeline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-timeline-heading .panel-heading-actions {
    justify-content: flex-start;
  }

  .orders-planner-alerts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .earnings-summary {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .vehicle-map-workspace {
    grid-template-columns: 1fr;
  }

  .vehicle-map-sidebar {
    max-height: none;
  }

  .vehicle-map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  .planner-alert-note {
    grid-column: 1 / -1;
  }

  .orders-timeline-grid {
    --timeline-day-width: calc((100% - 152px) / 7);
    --timeline-sidebar-width: 152px;
    min-width: 1040px;
    grid-template-columns: 152px repeat(7, minmax(126px, 1fr));
  }

  .timeline-row-track {
    grid-template-columns: repeat(7, minmax(126px, 1fr));
  }

  .order-assignment-grid {
    grid-template-columns: 1fr 1fr;
  }

  .orders-preview-frame {
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .fleet-dashboard {
    grid-template-columns: 1fr;
  }

  .metric-list {
    grid-template-columns: repeat(2, minmax(120px, 220px));
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    min-width: 0;
  }

  .segmented {
    justify-content: flex-start;
  }

  .bottom-drawer {
    width: 100%;
  }

  .order-assignment-grid {
    grid-template-columns: 1fr;
  }

  .orders-planner-alerts {
    grid-template-columns: 1fr;
  }

  .planner-alert-note {
    grid-column: auto;
  }

  .order-assignment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .order-assignment-button-row {
    justify-content: stretch;
  }

  .order-assignment-button-row .button {
    flex: 1 1 150px;
  }
}

@media (max-width: 720px) {
  * {
    -webkit-tap-highlight-color: transparent !important;
  }

  .vehicle-map-list {
    grid-template-columns: 1fr;
  }

  body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .fleet-tools {
    align-items: flex-end;
    padding: 12px;
  }

  .bottom-drawer {
    width: 100% !important;
    max-height: 76vh !important;
    border-radius: 24px 24px 0 0 !important; /* Bottom-sheet appearance */
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4) !important;
    background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
    backdrop-filter: blur(32px) saturate(140%) !important;
  }

  .tool-panel {
    padding: 14px;
  }

  .tool-panel .tool-panel-heading {
    margin: -14px -14px 0;
    padding: 13px 14px;
    border-radius: 24px 24px 0 0;
  }

  .tool-panel-title h2 {
    font-size: 16px;
  }

  .tool-panel-icon {
    width: 34px;
    height: 34px;
  }

  .bottom-bar {
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    border-radius: 14px;
    padding: 5px;
  }

  .bottom-tool-button {
    min-height: 54px;
    padding: 7px 4px 6px;
    font-size: 9.5px;
  }

  .bottom-tool-button svg {
    width: 21px;
    height: 21px;
  }

  .tool-badge {
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
  }

  /* Compact Topbar - single row on mobile to save vertical space */
  .topbar {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    height: auto !important;
    min-height: 56px !important;
    border-bottom: 1px solid var(--line) !important;
    background: color-mix(in srgb, var(--bg) 80%, transparent) !important;
    backdrop-filter: blur(12px) !important;
  }

  .brand-heading {
    width: auto !important;
    gap: 10px !important;
    order: 1 !important;
  }

  .page-heading {
    display: none !important; /* Hide to save space on mobile */
  }

  .topbar-logo {
    width: auto !important;
    height: 28px !important;
  }

  .top-tabs {
    order: 3 !important;
    flex: 1 0 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
  }

  .top-tab {
    min-height: 34px !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .top-tab svg {
    width: 16px !important;
    height: 16px !important;
  }

  .top-actions {
    display: flex !important;
    align-items: center !important;
    order: 2 !important;
    width: auto !important;
    gap: 6px !important;
    overflow: visible !important;
  }

  .top-icon-button {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .top-icon-button svg {
    width: 18px !important;
    height: 18px !important;
  }

  .top-action-label {
    display: none !important; /* Hide button text labels on mobile */
  }

  /* Main Layout */
  .layout {
    padding: 16px 12px 28px !important;
  }

  h1 {
    font-size: 21px;
  }

  /* Swipeable Metrics Slider */
  .metric-list {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 4px 4px 12px 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .metric {
    flex: 0 0 282px !important; /* Snug native slider width */
    scroll-snap-align: start !important;
    min-height: 84px !important;
    padding: 12px 14px !important;
  }

  .metric strong {
    font-size: 24px !important;
  }

  /* Data Tables Responsive Swipe-to-Scroll */
  .category-tables {
    display: grid !important;
    gap: 20px !important;
  }

  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    border-radius: 12px !important;
  }

  table {
    min-width: 780px !important; /* Force columns to layout beautifully without wrapping */
  }

  /* Segment controls scrollable */
  .segmented {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    width: 100% !important;
    padding: 4px !important;
  }

  .segment {
    flex: 1 0 auto !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
  }

  .button {
    flex: 1 1 auto;
  }

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

  .panel {
    padding: 16px;
  }

  /* Calendar responsive adjustments */
  .dashboard-calendar {
    padding: 12px;
  }

  .calendar-day {
    border-radius: 8px;
  }

  .calendar-tooltip {
    left: auto;
    right: -8px;
    width: min(260px, calc(100vw - 116px));
    transform: translateY(6px);
  }

  .calendar-day.has-events:hover .calendar-tooltip {
    transform: translateY(0);
  }

  .calendar-tooltip::after {
    left: auto;
    right: 18px;
  }

  /* Driver Cards mobile layout */
  .driver-cards-workspace {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .driver-cards-sidebar,
  .driver-card-editor {
    padding: 12px;
  }

  .driver-profile-card {
    align-items: stretch;
    flex-direction: column;
  }

  .driver-copy-primary {
    width: 100%;
  }

  .driver-profile-main h3 {
    font-size: 22px;
    white-space: normal;
  }

  .driver-vehicle-strip {
    grid-template-columns: 1fr;
  }

  .driver-sidebar-heading {
    align-items: stretch;
    flex-direction: column;
  }

  /* Orders layout */
  .orders-layout {
    padding: 18px 12px 28px;
  }

  .orders-hero {
    flex-direction: column;
    padding: 18px;
  }

  .orders-hero-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .orders-hero h2 {
    font-size: 22px;
  }

  .orders-list-panel,
  .orders-form-panel {
    min-height: 0;
    padding: 16px;
  }

  .order-route-grid,
  .order-route-places {
    grid-template-columns: 1fr;
  }

  .route-calculate-button,
  .route-map-button {
    justify-self: stretch;
  }

  .order-route-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .route-map-modal {
    padding: 10px;
  }

  .route-map-dialog {
    width: 100%;
    height: 94vh;
    border-radius: 20px;
  }

  .route-map-header {
    padding: 16px;
  }

  .route-map-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .route-map-side {
    overflow: visible;
  }

  .route-map-waypoint-add {
    grid-template-columns: 1fr;
  }

  .route-map-waypoint-add .button {
    width: 100%;
  }

  .route-map-canvas {
    min-height: 420px;
  }

  .calculator-layout {
    padding: 18px 12px 28px;
  }

  .calculator-hero {
    padding: 18px;
  }

  .calculator-hero h2 {
    font-size: 22px;
  }

  .calculator-workspace {
    grid-template-columns: 1fr;
  }

  .calculator-actions {
    grid-template-columns: 1fr;
  }

  .calculator-map-panel {
    min-height: 0;
    grid-template-rows: auto minmax(420px, 1fr);
  }

  .calculator-map-wrap,
  .calculator-map-canvas {
    min-height: 420px;
  }

  .calculator-results {
    grid-template-columns: 1fr;
  }

  .vehicle-map-layout {
    padding: 18px 12px 28px;
  }

  .vehicle-map-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .vehicle-map-actions {
    justify-content: flex-start;
  }

  .vehicle-map-main,
  .vehicle-map-canvas {
    min-height: 520px;
  }

  .vehicle-map-details {
    position: static;
    width: auto;
    margin-top: 14px;
  }

  .vehicle-map-stats {
    grid-template-columns: 1fr;
  }

  .earnings-layout {
    padding: 18px 12px 28px;
  }

  .earnings-hero {
    flex-direction: column;
    padding: 18px;
  }

  .earnings-hero h2 {
    font-size: 22px;
  }

  .earnings-month-field {
    width: 100%;
    flex-basis: auto;
  }

  .earnings-summary {
    grid-template-columns: 1fr;
  }

  .earnings-table-panel {
    padding: 16px;
  }

  .earnings-table-header,
  .earnings-vehicle-list,
  .earnings-vehicle-summary {
    min-width: 1080px !important;
  }
}

/* Panel administracyjny */
.admin-tool-panel {
  max-height: min(78vh, 820px);
  overflow: auto;
}

.admin-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.admin-panel-section {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface, #fff);
}

.admin-section-heading,
.admin-user-card-heading,
.admin-user-actions,
.admin-section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-heading h3,
.admin-section-heading p {
  margin: 0;
}

.admin-section-heading p,
.admin-user-card-heading span {
  color: var(--text-muted, #667085);
  font-size: 12px;
}

.admin-user-form,
.admin-user-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-user-form .button {
  align-self: end;
}

.admin-users-list {
  display: grid;
  gap: 10px;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.admin-user-card.inactive {
  opacity: 0.72;
}

.admin-user-card-heading > div {
  display: grid;
  gap: 2px;
}

.backup-status-grid {
  display: grid;
  gap: 0;
  margin: 0;
}

.backup-status-grid > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.backup-status-grid dt {
  color: var(--text-muted, #667085);
  font-size: 12px;
}

.backup-status-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.admin-monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px !important;
}

@media (max-width: 900px) {
  .admin-panel-grid,
  .admin-user-form,
  .admin-user-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* Fleet dashboard left column styling */
.fleet-dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* TrafficBan Europe premium widget styles */
.traffic-ban-panel {
  display: flex;
  flex-direction: column;
  padding: 16px !important;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(140%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.traffic-ban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.traffic-ban-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.traffic-ban-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--amber) 12%, rgba(15, 23, 42, 0.45));
  border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent);
  color: var(--amber);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.traffic-ban-header-clickable:hover .traffic-ban-icon {
  background: color-mix(in srgb, var(--amber) 20%, rgba(15, 23, 42, 0.6));
  transform: scale(1.05);
}

.traffic-ban-title-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.traffic-ban-title {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700; /* Crisp bold weight loaded in system */
  color: var(--navy); /* Standard variable for navy/white adaptive headers */
  margin: 0;
  letter-spacing: 0.010em;
}

.traffic-ban-subtitle {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted); /* Adaptive system muted gray */
  margin: 0;
  margin-top: 2px;
}

.traffic-ban-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.traffic-ban-header-clickable:hover .traffic-ban-toggle-btn {
  background: var(--surface-strong);
  color: var(--navy);
}

.traffic-ban-body {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
  margin-top: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 600px;
  opacity: 1;
}

.traffic-ban-panel.collapsed .traffic-ban-body {
  height: 0px;
  margin-top: 0px;
  border-color: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.traffic-ban-iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* ── Enterprise Control Tower overrides ── */

body::before,
body::after {
  display: none;
}

.eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

.panel,
.metric,
.table-wrap,
.dashboard-calendar,
.orders-list-panel,
.orders-form-panel,
.orders-hero,
.orders-timeline-panel,
.earnings-summary-card,
.earnings-table-panel,
.earnings-hero,
.driver-cards-panel,
.vehicle-map-sidebar,
.vehicle-map-main,
.vehicle-map-hero,
.calculator-form-panel,
.calculator-map-panel,
.calculator-hero,
.calculator-results,
.bottom-bar,
.bottom-drawer {
  border-radius: var(--radius-md);
  border-color: var(--border-subtle);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel::before,
.metric::before,
.orders-hero::before,
.dashboard-calendar::before {
  display: none;
}

.metric:hover,
.panel:hover,
.dashboard-calendar:hover,
.earnings-summary-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.button {
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.button.primary {
  border-color: var(--primary-brand);
  background: var(--primary-brand);
}

.button.primary:hover,
.button.primary:focus-visible {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.search-field input,
.field input,
.field select,
textarea,
input[type="date"],
.global-search {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.status-pill {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

table {
  font-size: 13px;
}

.metric strong {
  font-size: 28px;
  font-weight: 600;
}

.bottom-bar {
  display: none !important;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(16, 24, 40, 0.42);
  }

  .sidebar-backdrop[hidden] {
    display: none !important;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .topbar-menu-button {
    display: inline-flex;
  }

  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 14px;
  }

  .topbar-center {
    grid-column: 1 / -1;
    order: 3;
  }

  .global-search {
    max-width: none;
  }

  .global-search-kbd {
    display: none;
  }

  .profile-name,
  .topbar-cta {
    display: none;
  }

}

@media (max-width: 640px) {
  .breadcrumb-module {
    display: none;
  }

  .breadcrumb-separator {
    display: none;
  }

  .breadcrumb-page,
  .topbar-breadcrumb h1 {
    font-size: 16px;
  }
}

/* ── View UX redesign ── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.status-pill.success,
.status-pill.ok {
  background: var(--success-bg);
  border-color: #abefc6;
  color: var(--success);
  box-shadow: none;
}

.status-pill.warning,
.status-pill.soon,
.status-pill.urgent,
.status-pill.missing {
  background: var(--warning-bg);
  border-color: #fedf89;
  color: var(--warning);
  box-shadow: none;
  animation: none;
}

.status-pill.danger,
.status-pill.overdue {
  background: var(--danger-bg);
  border-color: #fecdca;
  color: var(--danger);
  box-shadow: none;
  animation: none;
}

.status-pill.info {
  background: var(--info-bg);
  border-color: #b2ddff;
  color: var(--info);
}

.status-pill.neutral {
  background: var(--surface-subtle);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.fleet-kpi-row,
.orders-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.orders-kpi-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.fleet-kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  max-height: 80px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.fleet-kpi-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.fleet-kpi-value {
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.fleet-kpi-status {
  width: 10px;
  min-width: 10px;
  height: 10px;
  min-height: 10px;
  padding: 0;
}

.fleet-kpi-status::before {
  display: none;
}

.fleet-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.fleet-alert-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  max-height: 56px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}

.fleet-alert-bar strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.fleet-alert-bar small {
  color: var(--text-muted);
  font-size: 12px;
}

.fleet-alert-icon svg,
.fleet-alert-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.fleet-alert-chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.fleet-alert-bar.expanded .fleet-alert-chevron {
  transform: rotate(180deg);
}

.fleet-alert-body {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.fleet-alert-body .traffic-ban-iframe {
  height: 420px;
}

.fleet-table-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  max-height: 56px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.fleet-table-toolbar-left,
.fleet-table-toolbar-center,
.fleet-table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fleet-table-toolbar-center {
  flex: 1;
}

.fleet-table-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.fleet-category-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.fleet-table-count {
  min-height: 24px;
  font-size: 12px;
}

.fleet-inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 0 10px;
}

.fleet-inline-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 13px;
}

.fleet-inline-search svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
}

.orders-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  padding: 0 10px;
}

.orders-sort-control span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.orders-sort-control select {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.fleet-segments {
  flex-wrap: wrap;
}

.fleet-data-table {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: auto;
}

.fleet-data-table table {
  width: 100%;
}

.fleet-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.fleet-data-table tbody td {
  min-height: 48px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: middle;
}

.fleet-data-table tbody tr {
  height: 50px;
}

.fleet-data-table tbody tr:hover {
  background: var(--surface-hover);
}

.view-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.view-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
}

.view-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  height: 100%;
  border-left: 1px solid var(--border-subtle);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.view-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.view-drawer-body {
  overflow: auto;
  padding: 14px 16px 20px;
}

.view-drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
}

.orders-module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 14px 16px;
}

.orders-module-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.module-header-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.orders-view-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.orders-view-tab {
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.orders-view-tab.active {
  border-color: #b2ddff;
  background: var(--primary-subtle);
  color: var(--primary-brand);
}

.orders-table-panel {
  padding: 12px;
}

.orders-table-wrap {
  overflow: auto;
}

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

.orders-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 12px;
  text-align: left;
}

.orders-data-table tbody td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  vertical-align: top;
}

.orders-data-table tbody tr {
  height: 50px;
  cursor: pointer;
}

.orders-data-table tbody tr:hover,
.orders-data-table tbody tr.active {
  background: var(--surface-hover);
}

.orders-data-table small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.orders-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.orders-detail-toolbar,
.orders-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.orders-detail-summary {
  flex-wrap: wrap;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px;
}

.orders-detail-summary-main,
.orders-detail-summary-meta {
  display: grid;
  gap: 4px;
}

.orders-detail-summary-meta {
  grid-auto-flow: column;
  gap: 14px;
}

.orders-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.driver-tab {
  min-height: 56px;
  padding: 10px 12px;
}

.driver-tab.active {
  border-color: #b2ddff;
  background: var(--primary-subtle);
}

.driver-tab-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.driver-readonly-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.driver-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.driver-info-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px 12px;
}

.driver-info-card.wide {
  grid-column: 1 / -1;
}

.driver-info-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.driver-info-card strong,
.driver-info-card p {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.vehicle-map-filters {
  margin-bottom: 8px;
}

.vehicle-map-count {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.vehicle-ops-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.vehicle-ops-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.calculator-results-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calculator-results-empty-wrap {
  display: block;
}

.calculator-results-empty,
.compact-empty-state {
  display: grid;
  gap: 6px;
  justify-items: start;
  max-width: 520px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 16px;
}

.compact-empty-icon {
  font-size: 20px;
}

.earnings-empty.compact-empty-state {
  margin: 12px 0;
}

.main-pane {
  display: grid;
  gap: 8px;
}

.layout {
  padding-top: 12px;
  padding-bottom: 24px;
  gap: 8px;
}

@media (max-width: 1280px) {
  .orders-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fleet-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-detail-grid,
  .vehicle-ops-grid,
  .calculator-results-kpi {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .fleet-table-toolbar {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .orders-kpi-row,
  .fleet-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── UX v2: operational tables, compact cards ── */

.fleet-toolbar-menu {
  position: relative;
}

.fleet-toolbar-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 2px;
  min-width: 180px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 4px;
}

.fleet-toolbar-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.fleet-toolbar-dropdown-item:hover,
.fleet-toolbar-dropdown-item.active {
  background: var(--surface-hover);
  color: var(--primary-brand);
}

.fleet-data-table [data-column-id="type"] {
  display: none;
}

.fleet-data-table [data-column-id="status"] {
  width: 130px;
  min-width: 130px;
}

.fleet-data-table [data-column-id="registration"] {
  width: 130px;
  min-width: 130px;
}

.fleet-data-table [data-column-id="make"] {
  width: 150px;
  min-width: 150px;
}

.fleet-data-table [data-column-id="year"] {
  width: 70px;
  min-width: 70px;
}

.fleet-data-table [data-column-id="vin"] {
  width: 140px;
  max-width: 180px;
}

.fleet-data-table [data-column-id="inspection"] {
  width: 140px;
  min-width: 140px;
}

.fleet-data-table [data-column-id="days"] {
  width: 70px;
  min-width: 70px;
}

.fleet-data-table [data-column-id="custom:dowod"] {
  width: 56px;
  min-width: 56px;
}

.fleet-data-table [data-column-id="custom:euro"] {
  width: 56px;
  min-width: 56px;
}

.fleet-data-table [data-column-id="custom:mileage"] {
  width: 110px;
  min-width: 110px;
}

.fleet-data-table [data-column-id="custom:mileageUpdatedAt"] {
  width: 120px;
  min-width: 120px;
}

.fleet-data-table [data-column-id="custom:oilLastMileage"] {
  width: 120px;
  min-width: 120px;
}

.fleet-data-table [data-column-id="custom:oilRemaining"] {
  width: 90px;
  min-width: 90px;
}

.fleet-data-table [data-column-id="actions"] {
  width: 48px;
  min-width: 48px;
}

.fleet-data-table thead th {
  min-height: 42px;
  padding: 8px 10px;
}

.fleet-data-table tbody td {
  min-height: 44px;
  padding: 6px 10px;
}

.fleet-data-table tbody tr {
  height: 46px;
}

.cell-text-value {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.cell-overview-value {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  padding: 4px 2px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cell-overview-value:hover {
  background: var(--surface-hover);
}

.cell-overview-value.success {
  color: var(--success-text, #027a48);
}

.cell-overview-value.warning {
  color: var(--warning-text, #b54708);
}

.cell-overview-value.danger {
  color: var(--danger-text, #b42318);
}

.cell-overview-value.readonly {
  cursor: default;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.cell-overview-value.readonly:hover {
  background: transparent;
}

.cell-flat-input {
  width: 100%;
  min-width: 0;
  max-height: 32px;
  min-height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 4px 6px;
  font-size: 12px;
}

.cell-flat-input:focus {
  border-color: var(--primary-brand);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-subtle);
}

.compact-doc-link {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

.row-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
}

.row-action-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.expanded-row-details {
  background: var(--surface-subtle) !important;
}

.expanded-row-details-cell {
  padding: 12px 14px !important;
  white-space: normal;
}

.expanded-row-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.expanded-row-section h4 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.expanded-detail-field {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.expanded-detail-field span {
  color: var(--text-muted);
  font-size: 11px;
}

.expanded-detail-field strong,
.expanded-detail-readonly {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.expanded-detail-readonly.danger {
  color: var(--danger-text, #b42318);
}

.expanded-row-note .compact-note-input {
  min-height: 72px;
  max-height: 120px;
}

.expanded-row-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.driver-hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.driver-hero-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.driver-hero-title h3 {
  margin: 0;
  font-size: 20px;
}

.driver-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.driver-hero-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.driver-hero-separator {
  color: var(--text-muted);
}

.driver-info-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.driver-info-card {
  min-height: 76px;
  max-height: 88px;
}

.driver-info-card span {
  font-size: 12px;
}

.driver-info-card strong,
.driver-info-card p {
  font-size: 15px;
}

.driver-note-card {
  max-height: 140px;
  margin-top: 10px;
}

.driver-note-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin: 4px 0 0;
  line-height: 1.4;
}

.driver-extra-section {
  margin-top: 12px;
}

.driver-extra-section h4 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.driver-copy-preview {
  min-height: 0;
  max-height: 160px;
  padding: 10px 12px;
  font-size: 12px;
}

.driver-tab {
  min-height: 48px;
  padding: 8px 10px;
}

.driver-tab-name {
  font-size: 14px;
}

.vehicle-ops-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px 16px;
}

.vehicle-ops-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}

.vehicle-ops-registration {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vehicle-ops-model {
  margin: 4px 0 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.vehicle-ops-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vehicle-ops-signal {
  color: var(--text-muted);
  font-size: 12px;
}

.vehicle-ops-signal strong {
  color: var(--text-primary);
  font-weight: 600;
}

.vehicle-ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vehicle-ops-metric {
  min-height: 72px;
}

.vehicle-map-list-item {
  min-height: 52px;
  padding: 8px 10px;
}

.calculator-results-kpi {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.calculator-result-card {
  min-height: 72px;
  padding: 10px 12px;
}

.calculator-results-empty,
.compact-empty-state {
  justify-items: center;
  text-align: center;
}

.calculator-results-pending {
  max-width: 420px;
  margin: 0 auto;
}

.earnings-table-wrap {
  min-height: 0;
}

.earnings-table-panel .panel-heading + .earnings-table-wrap {
  min-height: 180px;
}

.earnings-empty.compact-empty-state {
  width: min(100%, 480px);
  margin: 24px auto;
  justify-items: center;
  text-align: center;
}

.earnings-empty {
  min-height: 0;
}

@media (max-width: 1280px) {
  .expanded-row-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-info-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-ops-main {
    grid-template-columns: 1fr;
  }

  .vehicle-ops-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .expanded-row-layout,
  .driver-info-grid-3,
  .vehicle-ops-metrics {
    grid-template-columns: 1fr;
  }

  .driver-hero-header {
    flex-direction: column;
  }
}

/* ── UX v3: clean enterprise, no glow, unified chips ── */

.topbar-cta {
  display: none !important;
}

.filter-group,
.ct-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  border-radius: 10px;
}

.filter-chip,
.ct-filter-chip {
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  background-image: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
}

.filter-chip:hover,
.ct-filter-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.filter-chip.is-active,
.filter-chip--active,
.ct-filter-chip.is-active,
.ct-filter-chip--active {
  background: var(--primary-subtle);
  background-image: none;
  color: var(--primary);
  border-color: #b2ddff;
  box-shadow: none;
}

.fleet-filter-group {
  flex-wrap: wrap;
}

/* Flota — flat table, no gradients/glow */

.table-wrap.fleet-data-table,
.fleet-data-table.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: none;
}

.table-wrap.fleet-data-table::before,
.table-wrap.fleet-data-table::after,
.fleet-data-table.table-wrap::before,
.fleet-data-table.table-wrap::after {
  content: none !important;
  display: none !important;
}

.fleet-data-table table {
  background: #fff;
}

.fleet-data-table thead th {
  background: var(--surface-subtle);
  box-shadow: none;
  background-image: none;
}

.fleet-data-table tbody tr,
.fleet-data-table tbody tr:nth-child(even) {
  background: #fff;
}

.fleet-data-table tbody tr:hover {
  background: #f9fafb;
  box-shadow: none;
  transform: none;
}

.fleet-data-table .vehicle-row td:first-child {
  border-left: 0;
}

.fleet-data-table .expanded-row-details {
  background: #f9fafb !important;
}

.fleet-data-table tbody tr.expanded-row-details:hover {
  background: #f9fafb;
}

/* Planer — flat surfaces */

.orders-timeline-scroll {
  background: var(--surface);
  background-image: none;
}

.planner-alert-card.warning,
.planner-alert-card.danger,
.planner-alert-note.clear {
  background: var(--surface-strong);
  background-image: none;
}

.timeline-day-header.today {
  color: var(--primary-brand);
  background: var(--primary-subtle);
  background-image: none;
  box-shadow: inset 0 0 0 1px #b2ddff;
}

.timeline-day-cell.today {
  background: #f9fafb;
  background-image: none;
}

.timeline-today-column-outline {
  border-color: #b2ddff;
  box-shadow: none;
}

/* Mapa — bez filtrów, czysta lista */

.vehicle-map-list-meta {
  margin-bottom: 8px;
}

.vehicle-map-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.vehicle-map-list-item {
  min-height: 52px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
  padding: 8px 10px;
  transform: none;
}

.vehicle-map-list-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-subtle);
  box-shadow: none;
  transform: none;
}

.vehicle-map-list-item.active {
  border-color: #84caff;
  background: var(--primary-subtle);
  box-shadow: none;
}

.vehicle-map-list-item em {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.vehicle-map-list-item.online em,
.vehicle-map-list-item.stale em,
.vehicle-map-list-item.missing em {
  background: transparent;
}

/* Mapa — panel pojazdu */

.vehicle-ops-panel {
  padding: 12px 14px;
}

.vehicle-ops-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.vehicle-ops-metric {
  min-height: 68px;
  padding: 8px 10px;
}

.vehicle-ops-metric span {
  font-size: 12px;
}

.vehicle-ops-metric strong {
  font-size: 14px;
}

/* Mapa — markery bez glow i bez etykiet poza aktywnym */

.vehicle-map-marker .gps-dot,
.vehicle-map-marker.online .gps-dot,
.vehicle-map-marker.stale .gps-dot,
.vehicle-map-marker.active .gps-dot {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
  transform: none;
}

.vehicle-map-marker.online .gps-dot::after,
.vehicle-map-marker.active .gps-dot::after {
  content: none;
  animation: none;
}

.vehicle-map-marker:not(.active) .gps-label {
  display: none;
}

.vehicle-map-marker.active .gps-label {
  background: #fff;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

/* Widoki zleceń — spójne chipy */

.orders-view-nav {
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  width: fit-content;
}

.orders-view-tab {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  background-image: none;
  box-shadow: none;
}

.orders-view-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.orders-view-tab.active {
  border-color: #b2ddff;
  background: var(--primary-subtle);
  background-image: none;
  color: var(--primary);
  box-shadow: none;
}

/* Zlecenia — operacyjna lista, szczegóły i planer (v4) */

.orders-view-tab {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
}

.orders-table-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.orders-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.orders-data-table {
  table-layout: fixed;
  min-width: 1320px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.orders-col-status {
  width: 110px;
}

.orders-col-select {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.orders-col-document {
  width: 22%;
}

.orders-col-contractor {
  width: 16%;
}

.orders-col-route {
  width: 20%;
}

.orders-col-term {
  width: 170px;
}

.orders-col-vehicle {
  width: 110px;
}

.orders-col-driver {
  width: 160px;
}

.orders-col-freight {
  width: 110px;
}

.orders-col-rate {
  width: 90px;
}

.orders-col-actions {
  width: 100px;
}

.orders-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  box-shadow: none;
}

.orders-data-table tbody td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  vertical-align: middle;
}

.orders-data-table tbody tr {
  height: 54px;
  cursor: pointer;
  background: #fff;
}

.orders-data-table tbody tr:hover,
.orders-data-table tbody tr.active {
  background: #f9fafb;
  box-shadow: none;
}

.orders-data-table strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-data-table small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-cell-ellipsis {
  overflow: hidden;
  max-width: 0;
}

.orders-cell-route strong {
  color: var(--text-primary);
}

.orders-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
  white-space: nowrap;
}

.orders-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.orders-open-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orders-open-btn:hover {
  background: var(--surface-hover);
  border-color: #d0d5dd;
}

/* Szczegóły dokumentu */

.orders-form-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  padding: 14px;
}

.orders-detail-toolbar {
  margin-bottom: 10px;
}

.orders-detail-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 12px 14px;
}

.orders-detail-summary-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.orders-detail-summary-main strong {
  font-size: 16px;
  font-weight: 700;
}

.orders-detail-summary-main span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-detail-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.orders-detail-summary-meta span {
  display: grid;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
}

.orders-detail-summary-meta em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 14px;
  align-items: start;
}

.order-detail-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.order-detail-aside {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.order-detail-form {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.order-detail-section,
.order-detail-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
}

.order-detail-section-head,
.order-detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
}

.order-detail-section-head h3,
.order-detail-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.order-detail-card-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.order-detail-section-body,
.order-detail-card-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.order-detail-note-section .order-assignment-note textarea {
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
}

.order-doc-row {
  display: grid;
  gap: 4px;
}

.order-doc-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.order-doc-value {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-doc-preview-btn {
  justify-self: start;
}

.order-history-empty-state {
  margin: 0;
  padding: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.order-detail-actions-card .order-assignment-button-row {
  display: grid;
  gap: 8px;
}

.order-detail-updated {
  color: var(--text-muted);
  font-size: 11px;
}

.order-plan-check {
  gap: 8px;
  min-height: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  background-image: none;
  box-shadow: none;
}

.order-plan-check.ok {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.order-plan-check.acknowledged {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.order-plan-check.warning {
  border-color: #fec84b;
  background: #fffaeb;
}

.order-plan-check.warning strong {
  color: #b54708;
}

.order-plan-check li {
  border-color: var(--border-subtle);
  border-radius: 8px;
  background: #fff;
}

.order-assignment-form.order-detail-form .order-assignment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-handover-compact {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.order-rate-summary {
  border: 1px solid #b2ddff;
  border-radius: 8px;
  background: var(--primary-subtle);
}

/* Planer tygodnia — płaski styl operacyjny */

.orders-timeline-panel.panel {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.orders-planner-alerts {
  grid-template-columns: repeat(3, minmax(120px, 160px)) minmax(200px, 1fr);
  gap: 8px;
}

.planner-alert-card {
  min-height: 68px;
  max-height: 72px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: none;
}

.planner-alert-card strong {
  font-size: 20px;
  font-weight: 700;
}

.planner-alert-card span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.planner-alert-card.warning {
  border-color: #fec84b;
  background: #fff;
}

.planner-alert-card.danger {
  border-color: #fda29b;
  background: #fff;
}

.planner-alert-card.warning strong {
  color: #b54708;
}

.planner-alert-card.danger strong {
  color: #b42318;
}

.planner-alert-note {
  min-height: 48px;
  max-height: 56px;
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.planner-alert-note.clear {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.orders-timeline-scroll {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.timeline-corner,
.timeline-day-header {
  min-height: 48px;
  background: var(--surface-subtle);
  backdrop-filter: none;
  box-shadow: none;
}

.timeline-day-header.today {
  color: #175cd3;
  background: #eff8ff;
  border-bottom-color: #b2ddff;
  box-shadow: inset 0 0 0 1px #b2ddff;
}

.timeline-day-header.today strong,
.timeline-day-header.today span {
  color: #175cd3;
}

.timeline-day-header strong {
  font-size: 12px;
  font-weight: 700;
}

.timeline-day-header span {
  font-size: 11px;
  font-weight: 500;
}

.timeline-day-cell.today {
  background: rgba(239, 248, 255, 0.45);
  box-shadow: none;
}

.timeline-today-column-outline {
  border-color: #b2ddff;
  border-width: 1px;
  border-radius: 0;
  box-shadow: none;
}

.timeline-vehicle-cell {
  min-height: 52px;
  background: #fff;
  padding: 6px 12px;
}

.timeline-vehicle-cell strong {
  font-size: 13px;
  font-weight: 700;
}

.timeline-row-track {
  min-height: 52px;
  background: #fff;
}

.timeline-row-track.has-orders,
.timeline-row-track.has-warning,
.timeline-row-track.has-conflict {
  background: #fff;
  background-image: none;
}

.timeline-row-track.has-warning {
  background: #fff;
}

.timeline-row-track.has-conflict {
  background: #fff;
}

.timeline-day-cell.drag-over {
  background: var(--primary-subtle);
  box-shadow: inset 0 0 0 1px #b2ddff;
}

.planner-job-card,
.timeline-order-card.planner-job-card {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  box-shadow: none;
  padding: 6px 8px;
  font-size: 12px;
  margin: 3px 5px;
  min-height: 34px;
  backdrop-filter: none;
  transform: none;
}

.planner-job-card > strong {
  font-size: 11px;
  font-weight: 700;
}

.planner-job-card > span {
  font-size: 10px;
  font-weight: 500;
}

.planner-job-card:hover,
.planner-job-card.active,
.timeline-order-card.planner-job-card:hover,
.timeline-order-card.planner-job-card.active {
  border-color: #84caff;
  background: var(--primary-subtle);
  box-shadow: none;
  transform: none;
}

.planner-job-card.planned,
.planner-job-card.in_progress,
.planner-job-card.done,
.planner-job-card.cancelled,
.planner-job-card.has-conflict,
.planner-job-card.has-warning,
.planner-job-card.secondary-segment {
  background: #fff;
  background-image: none;
  border-width: 1px;
  border-style: solid;
}

.planner-job-card.in_progress {
  border-color: #84caff;
}

.planner-job-card.done {
  border-color: #6ce9a6;
}

.planner-job-card.has-conflict {
  border-color: #fda29b;
}

.planner-job-card.has-warning {
  border-color: #fec84b;
}

.planner-job-card.secondary-segment {
  border-style: dashed;
}

.planner-job-card em {
  position: absolute;
  right: 6px;
  bottom: 4px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.planner-job-card.has-conflict em {
  background: #fef3f2;
  color: #b42318;
}

@media (max-width: 1180px) {
  .order-detail-layout {
    grid-template-columns: 1fr;
  }

  .orders-detail-summary {
    grid-template-columns: 1fr;
  }

  .orders-detail-summary-meta {
    justify-content: flex-start;
  }
}

/* Zlecenia — TMS Control Tower v5: tabela, KPI, planer */

.orders-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.orders-kpi-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 64px;
  max-height: 72px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  box-shadow: none;
}

.orders-kpi-chip-label {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.orders-kpi-chip-value {
  grid-column: 1;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.orders-kpi-dot {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d0d5dd;
}

.orders-kpi-dot.info {
  background: #53b1fd;
}

.orders-kpi-dot.neutral {
  background: #98a2b3;
}

.orders-kpi-dot.warning {
  background: #fdb022;
}

.orders-kpi-dot.success {
  background: #32d583;
}

.orders-table-panel .fleet-table-toolbar {
  min-height: 44px;
  max-height: 52px;
  margin-bottom: 6px;
  gap: 10px;
}

.orders-table-panel {
  padding: 10px 12px 12px;
}

.orders-data-table {
  min-width: 1520px;
}

.orders-col-select {
  width: 44px;
  min-width: 44px;
}

.orders-col-contractor {
  width: 18%;
}

.orders-col-order-number {
  width: 18%;
}

.orders-col-loading,
.orders-col-unloading {
  width: 15%;
}

.orders-col-term {
  width: 130px;
}

.orders-col-vehicle {
  width: 110px;
}

.orders-col-driver {
  width: 130px;
}

.orders-col-freight {
  width: 110px;
}

.orders-col-rate {
  width: 90px;
}

.orders-col-actions {
  width: 110px;
  min-width: 110px;
}

.orders-data-table thead th {
  height: 40px;
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  vertical-align: middle;
}

.orders-data-table tbody tr {
  height: 56px;
  max-height: 60px;
}

.orders-data-table tbody tr.selected {
  background: #eff6ff;
}

.orders-data-table tbody td {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.25;
}

.orders-col-select {
  padding-right: 4px !important;
  padding-left: 8px !important;
}

.orders-row-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.orders-row-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.orders-row-check span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #b8c2d2;
  border-radius: 5px;
  background: #fff;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.orders-row-check input:checked + span {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.orders-row-check input:checked + span::after {
  width: 8px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.orders-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  padding: 3px 4px 3px 10px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.orders-bulk-actions.active {
  border-color: #b2ccff;
  background: #eff6ff;
  color: #175cd3;
}

.orders-bulk-actions select {
  height: 28px;
  min-width: 132px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  padding: 0 28px 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.orders-bulk-actions select:disabled {
  background: #f8fafc;
  color: #98a2b3;
  cursor: not-allowed;
}

.orders-cell-status {
  width: 120px;
}

.orders-table-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.orders-table-status-badge.neutral {
  border-color: #eaecf0;
  background: #f9fafb;
  color: #475467;
}

.orders-table-status-badge.info {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.orders-table-status-badge.warning {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.orders-table-status-badge.success {
  border-color: #a6f4c5;
  background: #ecfdf3;
  color: #027a48;
}

.orders-table-status-badge.danger {
  border-color: #fecdca;
  background: #fef3f2;
  color: #b42318;
}

.orders-cell-stack strong,
.orders-cell-stack small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-cell-stack small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.orders-cell-term strong {
  font-size: 12px;
  font-weight: 600;
}

.orders-cell-route strong {
  font-weight: 600;
}

.orders-open-btn {
  height: 32px;
  min-height: 32px;
  border-color: var(--border, #d0d5dd);
}

.orders-timeline-grid {
  --timeline-sidebar-width: 180px;
  --timeline-header-height: 48px;
  grid-template-columns: 180px repeat(7, minmax(128px, 1fr));
}

.timeline-today-column-outline {
  display: none;
}

.timeline-corner,
.timeline-day-header {
  min-height: 48px;
  background: #f9fafb;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.timeline-day-header {
  background: #fff;
}

.timeline-day-header.today {
  background: #eff8ff;
  box-shadow: inset 0 0 0 1px #b2ddff;
}

.timeline-day-cell.today {
  background: rgba(239, 248, 255, 0.35);
}

.timeline-vehicle-cell {
  min-height: 72px;
  width: 180px;
  background: #fff;
}

.timeline-row-track {
  min-height: 72px;
  grid-template-rows: repeat(var(--timeline-lanes, 1), 34px);
}

.planner-alert-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  max-height: 54px;
  padding: 8px 12px;
}

.planner-alert-note.attention {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.planner-alert-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.planner-alert-card {
  min-height: 60px;
  max-height: 68px;
}

.planner-job-card,
.timeline-order-card.planner-job-card {
  border-radius: 7px;
  padding: 5px 7px;
  line-height: 1.25;
  overflow: hidden;
  min-height: 30px;
  margin: 2px 4px;
}

.planner-job-card.has-warning,
.planner-job-card.has-conflict {
  padding-right: 22px;
}

.planner-card-flag {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: #f9fafb;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.planner-card-flag.warning {
  border-color: #fedf89;
  background: #fff;
  color: #b54708;
}

.planner-card-flag.danger {
  border-color: #fecdca;
  background: #fff;
  color: #b42318;
}

.planner-job-card.has-warning {
  border-color: #d0d5dd;
}

.planner-job-card.has-conflict {
  border-color: #fda29b;
}

.timeline-order-card em {
  display: none;
}

/* Zlecenia v6 — master-detail, lista operacyjna, panel szczegółów */

.orders-master-detail {
  display: grid;
  grid-template-columns: clamp(520px, 38vw, 620px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.orders-master-panel,
.orders-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  padding: 10px 12px;
}

.orders-list-toolbar .fleet-table-toolbar {
  min-height: 40px;
  max-height: 48px;
  margin-bottom: 6px;
  padding: 0;
}

.orders-list-wrap {
  display: grid;
  gap: 0;
  overflow: auto;
  min-height: 520px;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
}

.order-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 88px;
  max-height: 104px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface, #fff);
  color: inherit;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s ease;
}

.order-list-item:last-child {
  border-bottom: 0;
}

.order-list-item:hover {
  background: var(--surface-hover, #f9fafb);
}

.order-list-item.is-active {
  background: var(--primary-subtle, #eff8ff);
  box-shadow: inset 3px 0 0 var(--primary, #1570ef);
}

.order-list-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-list-item-top .orders-table-status-badge {
  flex: 0 0 auto;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-item-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-item-freight {
  flex: 0 0 auto;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.order-list-item-route {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-item-meta {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-list-empty,
.orders-form-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 220px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.orders-detail-panel .orders-form-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.orders-detail-panel-scroll {
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 520px;
  max-height: calc(100vh - 260px);
  padding-right: 2px;
}

.orders-detail-header {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 12px;
}

.orders-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.orders-detail-header-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.orders-detail-title {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-detail-subtitle {
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.orders-detail-header-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.orders-detail-header-grid span {
  display: grid;
  gap: 2px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-detail-header-grid em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.order-detail-stack {
  display: grid;
  gap: 10px;
}

.order-detail-form {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
}

.order-detail-form.is-readonly .order-detail-edit-only {
  display: none;
}

.order-detail-form.is-readonly .field input:not([type="hidden"]),
.order-detail-form.is-readonly .field select,
.order-detail-form.is-readonly .field textarea {
  border-color: transparent;
  background: transparent;
  min-height: 28px;
  padding-left: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  pointer-events: none;
}

.order-detail-form.is-readonly .field span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.order-detail-form.is-readonly .order-place-add,
.order-detail-form.is-readonly .order-place-remove {
  display: none;
}

.order-detail-form.is-readonly .order-places-heading span {
  display: none;
}

.order-detail-section {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.order-detail-section-compact {
  border: 0;
  background: transparent;
  padding: 0;
}

.order-detail-section-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.order-detail-form .order-assignment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-detail-form .field input,
.order-detail-form .field select,
.order-detail-form .field textarea {
  min-height: 34px;
  font-size: 13px;
}

.order-handover-compact summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.orders-kpi-row {
  gap: 6px;
  margin-bottom: 8px;
}

.orders-kpi-chip {
  min-height: 56px;
  max-height: 64px;
  padding: 6px 10px;
}

.orders-kpi-chip-value {
  font-size: 24px;
}

.orders-kpi-chip-label {
  font-size: 11px;
}

/* Planer v6 — lżejszy grid */

.orders-planner-alerts {
  gap: 6px;
}

.planner-alert-card {
  min-height: 56px;
  max-height: 64px;
  padding: 8px 10px;
}

.planner-alert-card strong {
  font-size: 18px;
}

.planner-alert-note {
  min-height: 44px;
  max-height: 52px;
  padding: 8px 10px;
  font-size: 11px;
}

.timeline-vehicle-cell {
  min-height: 64px;
}

.timeline-row-track {
  min-height: 64px;
  grid-template-rows: repeat(var(--timeline-lanes, 1), 32px);
}

.planner-job-card,
.timeline-order-card.planner-job-card {
  min-height: 30px;
  max-height: 36px;
  margin: 2px 3px;
  padding: 4px 6px;
  border-radius: 6px;
  border-color: #e4e7ec;
}

.planner-job-card > strong {
  font-size: 11px;
  line-height: 1.2;
}

.planner-job-card > span,
.planner-job-card > .timeline-empty-run {
  font-size: 10px;
  line-height: 1.15;
}

.planner-card-flag {
  top: 3px;
  right: 3px;
  max-width: 42px;
  height: auto;
  min-height: 12px;
  padding: 1px 3px;
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-job-card.in_progress,
.planner-job-card.has-conflict,
.planner-job-card.has-warning,
.planner-job-card.done {
  border-width: 1px;
  box-shadow: none;
}

.timeline-day-cell.today {
  background: rgba(239, 248, 255, 0.35);
}

@media (max-width: 1100px) {
  .orders-master-detail {
    grid-template-columns: 1fr;
  }

  .orders-list-wrap,
  .orders-detail-panel-scroll {
    max-height: none;
    min-height: 320px;
  }
}

/* Zlecenia v7 — czytelna lista master-detail */

.orders-master-panel {
  min-width: 0;
}

.orders-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.orders-detail-header-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-detail-section-head h3 {
  font-size: 14px;
}

.order-plan-check {
  padding: 8px 10px;
  font-size: 12px;
}

.planner-alert-card {
  min-height: 52px;
  max-height: 60px;
}

.planner-alert-note {
  min-height: 40px;
  max-height: 48px;
}

.timeline-row-track {
  min-height: 60px;
  grid-template-rows: repeat(var(--timeline-lanes, 1), 30px);
}

.planner-job-card,
.timeline-order-card.planner-job-card {
  min-height: 28px;
  max-height: 32px;
  padding: 3px 5px;
}

/* Zlecenia v8 — pola adresowe, skrócona trasa, zwarty edytor */

.order-list-item {
  min-height: 96px;
  max-height: 112px;
  gap: 5px;
}

.order-list-item-contractor {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-detail-header-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 10px;
}

.orders-detail-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 12px;
  align-items: start;
}

.order-detail-main-col,
.order-detail-side-col {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.order-route-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.order-location-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-subtle, #f9fafb);
  padding: 10px;
}

.order-location-card-head h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.order-location-fields {
  display: grid;
  gap: 8px;
}

.order-route-inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.order-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.order-finance-metric {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.order-finance-metric span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.order-finance-metric strong {
  font-size: 13px;
  font-weight: 600;
}

.order-detail-form .order-assignment-note textarea {
  min-height: 72px;
  max-height: 120px;
}

.order-history-list {
  max-height: 200px;
}

.order-detail-footer-meta {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.order-detail-form.is-readonly .order-location-extra {
  display: none;
}

@media (max-width: 1100px) {
  .order-detail-body,
  .order-route-cards,
  .order-route-inline-fields,
  .order-finance-grid {
    grid-template-columns: 1fr;
  }
}

/* Zlecenia v9 — planer tygodnia: czytelne karty transportu i stabilny grid */

#ordersPlannerSection .orders-timeline-scroll {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

#ordersPlannerSection .orders-timeline-grid {
  --timeline-sidebar-width: 182px;
  --timeline-header-height: 48px;
  min-width: 1180px;
  grid-template-columns: 182px repeat(7, minmax(134px, 1fr));
}

#ordersPlannerSection .timeline-today-column-outline {
  display: none;
}

#ordersPlannerSection .timeline-corner,
#ordersPlannerSection .timeline-day-header,
#ordersPlannerSection .timeline-vehicle-cell,
#ordersPlannerSection .timeline-row-track {
  border-color: var(--border-subtle);
}

#ordersPlannerSection .timeline-corner,
#ordersPlannerSection .timeline-day-header {
  min-height: 48px;
  height: 48px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: none;
  box-shadow: none;
}

#ordersPlannerSection .timeline-corner {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

#ordersPlannerSection .timeline-day-header {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #fff;
  text-align: center;
}

#ordersPlannerSection .timeline-day-header strong {
  color: #101828;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

#ordersPlannerSection .timeline-day-header span {
  color: #667085;
  font-size: 11px;
  font-weight: 500;
}

#ordersPlannerSection .timeline-day-header.today {
  color: inherit;
  background: #f9fafb;
  box-shadow: inset 0 -2px 0 #84caff;
}

#ordersPlannerSection .timeline-day-header.today strong,
#ordersPlannerSection .timeline-day-header.today span {
  color: #175cd3;
}

#ordersPlannerSection .timeline-vehicle-cell {
  min-height: 92px;
  width: 182px;
  padding: 10px 12px;
  background: #fff;
}

#ordersPlannerSection .timeline-vehicle-cell strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

#ordersPlannerSection .timeline-vehicle-cell span {
  font-size: 11px;
  font-weight: 500;
}

#ordersPlannerSection .timeline-row-track {
  min-height: 92px;
  grid-template-rows: repeat(var(--timeline-lanes, 1), 52px);
  background: #fff;
  background-image: none;
}

#ordersPlannerSection .timeline-row-track.has-orders,
#ordersPlannerSection .timeline-row-track.has-warning,
#ordersPlannerSection .timeline-row-track.has-conflict {
  background: #fff;
  background-image: none;
}

#ordersPlannerSection .timeline-day-cell {
  min-height: var(--timeline-row-height, 92px);
  background: #fff;
  transition: background 0.12s ease;
}

#ordersPlannerSection .timeline-day-cell.today {
  background: rgba(249, 250, 251, 0.95);
  box-shadow: none;
}

#ordersPlannerSection .timeline-day-cell:hover {
  background: #fcfcfd;
}

#ordersPlannerSection .timeline-day-cell.drag-over {
  background: #eff8ff;
  box-shadow: inset 0 0 0 1px #b2ddff;
}

#ordersPlannerSection .timeline-empty {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 500;
}

#ordersPlannerSection .planner-job-card,
#ordersPlannerSection .timeline-order-card.planner-job-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  align-self: center;
  min-height: 44px;
  max-height: 64px;
  margin: 4px 6px;
  padding: 6px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

#ordersPlannerSection .planner-job-card-content {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

#ordersPlannerSection .planner-job-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#ordersPlannerSection .planner-job-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #101828;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersPlannerSection .planner-job-card-route {
  overflow: hidden;
  color: #475467;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersPlannerSection .planner-job-card-meta {
  overflow: hidden;
  color: #667085;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersPlannerSection .planner-card-flag {
  position: static;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  max-width: 72px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ordersPlannerSection .planner-card-flag.warning {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #b54708;
}

#ordersPlannerSection .planner-card-flag.danger {
  border: 1px solid #fecdca;
  background: #fef3f2;
  color: #b42318;
}

#ordersPlannerSection .planner-job-card:hover,
#ordersPlannerSection .planner-job-card.active,
#ordersPlannerSection .timeline-order-card.planner-job-card:hover,
#ordersPlannerSection .timeline-order-card.planner-job-card.active {
  border-color: #84caff;
  background: #f5faff;
  box-shadow: none;
  transform: none;
}

#ordersPlannerSection .planner-job-card.dragging,
#ordersPlannerSection .timeline-order-card.planner-job-card.dragging {
  opacity: 0.55;
  transform: none;
}

#ordersPlannerSection .planner-job-card.planned,
#ordersPlannerSection .planner-job-card.in_progress,
#ordersPlannerSection .planner-job-card.done,
#ordersPlannerSection .planner-job-card.cancelled,
#ordersPlannerSection .planner-job-card.has-conflict,
#ordersPlannerSection .planner-job-card.has-warning,
#ordersPlannerSection .planner-job-card.secondary-segment {
  background: #fff;
  background-image: none;
  border-width: 1px;
  border-style: solid;
}

#ordersPlannerSection .planner-job-card.in_progress {
  border-color: #84caff;
}

#ordersPlannerSection .planner-job-card.done {
  border-color: #6ce9a6;
}

#ordersPlannerSection .planner-job-card.has-conflict {
  border-color: #fda29b;
}

#ordersPlannerSection .planner-job-card.has-warning:not(.has-conflict) {
  border-color: #fec84b;
}

#ordersPlannerSection .planner-job-card.secondary-segment {
  border-style: dashed;
}

#ordersPlannerSection .planner-job-card.has-warning,
#ordersPlannerSection .planner-job-card.has-conflict {
  padding-right: 8px;
}

#ordersPlannerSection .timeline-order-card em {
  display: none;
}

#ordersPlannerSection .timeline-order-card > .timeline-empty-run {
  display: none;
}

/* Zlecenia v10 — compact density (tylko moduł Zlecenia) */

#ordersPanel.orders-compact {
  --orders-font-xs: 10px;
  --orders-font-sm: 11px;
  --orders-font-md: 12px;
  --orders-font-base: 13px;
  --orders-font-lg: 15px;
  --orders-font-xl: 18px;

  --orders-space-1: 3px;
  --orders-space-2: 4px;
  --orders-space-3: 6px;
  --orders-space-4: 8px;
  --orders-space-5: 10px;
  --orders-space-6: 12px;

  --orders-radius: 7px;
  --orders-input-height: 30px;
  --orders-button-height: 30px;
  --orders-row-height: 58px;
  --orders-section-padding: 10px;
}

#ordersPanel.orders-compact.orders-layout {
  padding: var(--orders-space-6) var(--orders-space-5) 18px;
}

#ordersPanel.orders-compact .orders-pane {
  gap: var(--orders-space-5);
}

#ordersPanel.orders-compact .orders-module-header {
  gap: var(--orders-space-5);
  margin-bottom: var(--orders-space-3);
  padding: var(--orders-space-5) var(--orders-space-6);
}

#ordersPanel.orders-compact .orders-module-header .eyebrow {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .orders-module-header h2 {
  margin: 0 0 var(--orders-space-1);
  font-size: var(--orders-font-lg);
  line-height: 1.2;
}

#ordersPanel.orders-compact .module-header-desc {
  font-size: var(--orders-font-sm);
  line-height: 1.35;
}

#ordersPanel.orders-compact .orders-module-actions {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .orders-module-actions .status-pill {
  min-height: 24px;
  padding: 0 var(--orders-space-4);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .orders-view-nav {
  gap: var(--orders-space-2);
  margin-bottom: var(--orders-space-4);
}

#ordersPanel.orders-compact .orders-view-tab {
  min-height: 28px;
  padding: var(--orders-space-2) var(--orders-space-5);
  font-size: var(--orders-font-sm);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .orders-kpi-row {
  gap: var(--orders-space-3);
  margin-bottom: var(--orders-space-4);
}

#ordersPanel.orders-compact .orders-kpi-chip {
  min-height: 46px;
  max-height: 52px;
  gap: 1px var(--orders-space-3);
  padding: var(--orders-space-3) var(--orders-space-4);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .orders-kpi-chip-label {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .orders-kpi-chip-value {
  font-size: 20px;
}

#ordersPanel.orders-compact .orders-kpi-dot {
  width: 6px;
  height: 6px;
}

#ordersPanel.orders-compact .orders-master-detail {
  grid-template-columns: clamp(400px, 34vw, 500px) minmax(0, 1fr);
  gap: var(--orders-space-5);
}

#ordersPanel.orders-compact .orders-master-panel,
#ordersPanel.orders-compact .orders-detail-panel {
  padding: var(--orders-space-4) var(--orders-space-5);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .orders-list-toolbar .fleet-table-toolbar {
  min-height: 32px;
  max-height: 36px;
  margin-bottom: var(--orders-space-2);
}

#ordersPanel.orders-compact .fleet-table-title {
  font-size: var(--orders-font-md);
}

#ordersPanel.orders-compact .fleet-inline-search input {
  min-height: var(--orders-input-height);
  height: var(--orders-input-height);
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .orders-list-wrap {
  min-height: 380px;
  max-height: calc(100vh - 210px);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-list-item {
  gap: var(--orders-space-1);
  min-height: var(--orders-row-height);
  max-height: calc(var(--orders-row-height) + 4px);
  padding: var(--orders-space-4) var(--orders-space-5);
}

#ordersPanel.orders-compact .order-list-item-top {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .orders-table-status-badge {
  height: 20px;
  padding: 0 var(--orders-space-3);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .order-list-item-top .orders-table-status-badge {
  max-width: 96px;
}

#ordersPanel.orders-compact .order-list-item-title {
  font-size: var(--orders-font-md);
  line-height: 1.2;
}

#ordersPanel.orders-compact .order-list-item-freight {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .order-list-item-contractor {
  font-size: var(--orders-font-xs);
  line-height: 1.2;
}

#ordersPanel.orders-compact .order-list-item-route {
  font-size: var(--orders-font-sm);
  line-height: 1.2;
}

#ordersPanel.orders-compact .order-list-item-meta {
  font-size: var(--orders-font-xs);
  line-height: 1.2;
}

#ordersPanel.orders-compact .orders-list-empty,
#ordersPanel.orders-compact .orders-form-empty {
  gap: var(--orders-space-3);
  min-height: 160px;
  padding: var(--orders-space-6);
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .orders-detail-panel-scroll {
  gap: var(--orders-space-4);
  min-height: 380px;
  max-height: calc(100vh - 210px);
}

#ordersPanel.orders-compact .orders-detail-header,
#ordersPanel.orders-compact .orders-detail-header-sticky {
  gap: var(--orders-space-4);
  margin-bottom: var(--orders-space-4);
  padding: var(--orders-space-4);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .orders-detail-header-top {
  gap: var(--orders-space-4);
}

#ordersPanel.orders-compact .orders-detail-header-copy {
  gap: var(--orders-space-1);
}

#ordersPanel.orders-compact .orders-detail-title {
  font-size: var(--orders-font-lg);
  line-height: 1.2;
}

#ordersPanel.orders-compact .orders-detail-subtitle {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .orders-detail-header-actions {
  gap: var(--orders-space-2);
}

#ordersPanel.orders-compact .orders-detail-header-grid {
  gap: var(--orders-space-3) var(--orders-space-4);
}

#ordersPanel.orders-compact .orders-detail-header-grid span {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .orders-detail-header-grid em {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .order-detail-body {
  gap: var(--orders-space-4);
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
}

#ordersPanel.orders-compact .order-detail-main-col,
#ordersPanel.orders-compact .order-detail-side-col {
  gap: var(--orders-space-4);
}

#ordersPanel.orders-compact .order-detail-section,
#ordersPanel.orders-compact .order-detail-card {
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-detail-section-head,
#ordersPanel.orders-compact .order-detail-card-head {
  gap: var(--orders-space-3);
  padding: var(--orders-space-4) var(--orders-section-padding);
}

#ordersPanel.orders-compact .order-detail-section-head h3,
#ordersPanel.orders-compact .order-detail-card-head h3 {
  font-size: var(--orders-font-md);
}

#ordersPanel.orders-compact .order-detail-section-body,
#ordersPanel.orders-compact .order-detail-card-body {
  gap: var(--orders-space-4);
  padding: var(--orders-section-padding);
}

#ordersPanel.orders-compact .order-detail-form .field span {
  font-size: var(--orders-font-xs);
  line-height: 1.2;
}

#ordersPanel.orders-compact .order-detail-form .field input,
#ordersPanel.orders-compact .order-detail-form .field select,
#ordersPanel.orders-compact .order-detail-form .field textarea {
  min-height: var(--orders-input-height);
  padding: 0 var(--orders-space-4);
  font-size: var(--orders-font-sm);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-detail-form .field select {
  height: var(--orders-input-height);
}

#ordersPanel.orders-compact .order-detail-form.is-readonly .field input:not([type="hidden"]),
#ordersPanel.orders-compact .order-detail-form.is-readonly .field select,
#ordersPanel.orders-compact .order-detail-form.is-readonly .field textarea {
  min-height: 22px;
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .order-detail-form.is-readonly .field span {
  font-size: 9px;
}

#ordersPanel.orders-compact .order-detail-form .order-assignment-grid {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .order-detail-form .order-assignment-note textarea {
  min-height: 56px;
  max-height: 96px;
}

#ordersPanel.orders-compact .order-route-cards {
  gap: var(--orders-space-4);
}

#ordersPanel.orders-compact .order-location-card {
  padding: var(--orders-space-4);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-location-card-head h4 {
  margin: 0 0 var(--orders-space-3);
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .order-location-fields {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .order-route-inline-fields,
#ordersPanel.orders-compact .order-finance-grid {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .order-finance-metric {
  gap: var(--orders-space-1);
  padding: var(--orders-space-3) var(--orders-space-4);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-finance-metric span {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .order-finance-metric strong {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .order-plan-check {
  padding: var(--orders-space-4);
  font-size: var(--orders-font-sm);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .order-history-list {
  max-height: 160px;
}

#ordersPanel.orders-compact .order-history-empty-state {
  padding: var(--orders-space-4);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .order-doc-label {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .order-doc-value {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .order-detail-footer-meta {
  margin-top: var(--orders-space-3);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .button.compact-button,
#ordersPanel.orders-compact .compact-button {
  min-height: var(--orders-button-height);
  height: var(--orders-button-height);
  padding: 0 var(--orders-space-5);
  font-size: var(--orders-font-sm);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact .orders-timeline-panel {
  gap: var(--orders-space-5);
}

#ordersPanel.orders-compact .orders-timeline-heading h2 {
  font-size: var(--orders-font-lg);
}

#ordersPanel.orders-compact .orders-timeline-heading span {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact .orders-planner-alerts {
  gap: var(--orders-space-3);
}

#ordersPanel.orders-compact .planner-alert-card {
  min-height: 44px;
  max-height: 50px;
  padding: var(--orders-space-3) var(--orders-space-4);
}

#ordersPanel.orders-compact .planner-alert-card strong {
  font-size: 16px;
}

#ordersPanel.orders-compact .planner-alert-card span {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact .planner-alert-note {
  min-height: 34px;
  max-height: 40px;
  padding: var(--orders-space-3) var(--orders-space-4);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact #ordersPlannerSection .orders-timeline-grid {
  --timeline-sidebar-width: 168px;
  --timeline-header-height: 40px;
  grid-template-columns: 168px repeat(7, minmax(120px, 1fr));
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-corner,
#ordersPanel.orders-compact #ordersPlannerSection .timeline-day-header {
  min-height: 40px;
  height: 40px;
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-corner {
  padding: 0 var(--orders-space-4);
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-day-header strong {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-day-header span {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-vehicle-cell {
  min-height: 72px;
  width: 168px;
  padding: var(--orders-space-4);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-vehicle-cell strong {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-vehicle-cell span {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-row-track {
  min-height: 72px;
  grid-template-rows: repeat(var(--timeline-lanes, 1), 44px);
}

#ordersPanel.orders-compact #ordersPlannerSection .timeline-day-cell {
  min-height: var(--timeline-row-height, 72px);
}

#ordersPanel.orders-compact #ordersPlannerSection .planner-job-card,
#ordersPanel.orders-compact #ordersPlannerSection .timeline-order-card.planner-job-card {
  min-height: 36px;
  max-height: 52px;
  margin: 3px 5px;
  padding: var(--orders-space-2) var(--orders-space-3);
  border-radius: var(--orders-radius);
}

#ordersPanel.orders-compact #ordersPlannerSection .planner-job-card-title {
  font-size: var(--orders-font-sm);
}

#ordersPanel.orders-compact #ordersPlannerSection .planner-job-card-route {
  font-size: var(--orders-font-xs);
}

#ordersPanel.orders-compact #ordersPlannerSection .planner-job-card-meta {
  font-size: 9px;
}

#ordersPanel.orders-compact #ordersPlannerSection .planner-card-flag {
  max-width: 60px;
  padding: 1px 4px;
  font-size: 8px;
}

@media (max-width: 1100px) {
  #ordersPanel.orders-compact .orders-master-detail {
    grid-template-columns: 1fr;
  }

  #ordersPanel.orders-compact .orders-list-wrap,
  #ordersPanel.orders-compact .orders-detail-panel-scroll {
    max-height: none;
    min-height: 280px;
  }
}

/* Zlecenia v11 — pełnoszeroka tabela operacyjna + drawer szczegółów */

#ordersPanel.orders-compact .orders-table-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--orders-radius, 7px);
  background: #fff;
  padding: var(--orders-space-4, 8px) var(--orders-space-5, 10px);
}

#ordersPanel.orders-compact .orders-table-wrap {
  min-width: 0;
}

#ordersPanel.orders-compact .orders-table-scroll {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--orders-radius, 7px);
  background: #fff;
}

#ordersPanel.orders-compact .orders-operational-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
  font-size: var(--orders-font-md, 12px);
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-contractor {
  width: 18%;
  min-width: 180px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-order-number {
  width: 18%;
  min-width: 190px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-loading,
#ordersPanel.orders-compact .orders-operational-table .orders-col-unloading {
  width: 15%;
  min-width: 155px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-term {
  width: 118px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-vehicle {
  width: 100px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-driver {
  width: 130px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-freight {
  width: 90px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-rate {
  width: 75px;
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-actions {
  width: 90px;
}

#ordersPanel.orders-compact .orders-operational-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  padding: 0 var(--orders-space-4, 8px);
  border-bottom: 1px solid var(--border-subtle);
  background: #f9fafb;
  color: #475467;
  font-size: var(--orders-font-sm, 11px);
  font-weight: 600;
  text-align: left;
  box-shadow: none;
}

#ordersPanel.orders-compact .orders-operational-table tbody td {
  height: 50px;
  padding: 0 var(--orders-space-4, 8px);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

#ordersPanel.orders-compact .orders-operational-table tbody tr {
  cursor: pointer;
  background: #fff;
}

#ordersPanel.orders-compact .orders-operational-table tbody tr:hover,
#ordersPanel.orders-compact .orders-operational-table tbody tr.active {
  background: #f9fafb;
}

#ordersPanel.orders-compact .orders-cell-text {
  display: block;
  overflow: hidden;
  min-width: 0;
  color: #101828;
  font-size: var(--orders-font-md, 12px);
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersPanel.orders-compact .orders-operational-table .orders-table-status-badge {
  height: 20px;
  padding: 0 6px;
  font-size: var(--orders-font-xs, 10px);
}

#ordersPanel.orders-compact .orders-operational-table .orders-col-actions {
  text-align: right;
}

#ordersPanel.orders-compact .orders-open-btn {
  min-width: 72px;
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
  font-size: var(--orders-font-sm, 11px);
  white-space: nowrap;
}

.orders-detail-drawer-panel {
  width: min(620px, 96vw);
}

.orders-detail-drawer .orders-form-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.orders-detail-drawer .orders-detail-panel-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  max-height: none;
  padding: var(--orders-space-4, 8px) var(--orders-space-5, 10px) var(--orders-space-6, 12px);
}

.orders-detail-drawer .orders-detail-close {
  flex: 0 0 auto;
}

/* Zlecenia v12 — drawer: zwinięta historia i czysta prawa kolumna */

.orders-detail-drawer .order-detail-side-col {
  gap: 8px;
  align-content: start;
  align-self: start;
}

.orders-detail-drawer .order-detail-doc-card .order-detail-card-head {
  min-height: 0;
  padding: 8px 10px;
}

.orders-detail-drawer .order-detail-doc-card .order-detail-card-head h3 {
  font-size: 13px;
}

.orders-detail-drawer .order-detail-doc-card .order-detail-card-body {
  gap: 8px;
  padding: 8px 10px 10px;
}

.order-history-collapsible,
.order-note-collapsible {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
}

.order-history-toggle,
.order-note-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  height: 38px;
  border: 0;
  background: var(--surface, #fff);
  color: inherit;
  padding: 0 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.order-history-toggle:hover,
.order-note-toggle:hover {
  background: #f9fafb;
}

.order-history-toggle-label,
.order-note-toggle-label {
  font-size: 13px;
  font-weight: 600;
}

.order-history-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.order-history-toggle-count {
  color: var(--text-muted, #667085);
  font-size: 11px;
  font-weight: 500;
}

.order-history-chevron {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.order-history-chevron::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.order-history-collapsible.is-open .order-history-chevron::before,
.order-note-collapsible.is-open .order-history-chevron::before {
  transform: rotate(45deg);
}

.order-history-content,
.order-note-content {
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 8px;
}

.order-history-collapsible:not(.is-open) .order-history-content,
.order-note-collapsible:not(.is-open) .order-note-content {
  display: none;
}

.orders-detail-drawer .order-history-list {
  display: grid;
  gap: 6px;
  max-height: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orders-detail-drawer .order-history-list li {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

.orders-detail-drawer .order-history-list strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.orders-detail-drawer .order-history-list span,
.orders-detail-drawer .order-history-list small {
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted, #667085);
}

.orders-detail-drawer .order-history-empty-state {
  margin: 0;
  padding: 4px 2px;
  color: var(--text-muted, #667085);
  font-size: 11px;
}

.orders-detail-drawer .order-side-note-text {
  margin: 0;
  color: var(--text-secondary, #475467);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Zlecenia v13 — pełnoekranowy panel roboczy zlecenia */

.order-workspace-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px 32px;
}

.order-workspace-modal[hidden] {
  display: none;
}

.order-workspace-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.48);
}

.order-workspace-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1440px, calc(100vw - 64px));
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.16);
  overflow: hidden;
}

.order-workspace-modal .orders-form-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.order-workspace-form {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.order-workspace-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.order-workspace-header {
  flex: 0 0 auto;
  z-index: 2;
  margin: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: #fff;
}

.order-workspace-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 18px;
}

.order-workspace-modal .order-detail-body {
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.order-workspace-modal .order-detail-main-col,
.order-workspace-modal .order-detail-side-col {
  gap: 12px;
  min-width: 0;
}

.order-workspace-modal .order-route-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-workspace-modal .order-finance-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-workspace-modal .order-assignment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.order-workspace-modal .order-detail-form .field input,
.order-workspace-modal .order-detail-form .field select,
.order-workspace-modal .order-detail-form .field textarea {
  width: 100%;
  min-width: 0;
}

.order-workspace-modal .orders-detail-header-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 14px;
}

.order-workspace-modal .orders-detail-title {
  font-size: 18px;
  white-space: nowrap;
}

.order-workspace-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.order-workspace-close:hover {
  background: #f9fafb;
}

.order-workspace-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  background: #fff;
}

.order-workspace-footer-meta {
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 500;
}

.order-workspace-footer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-workspace-modal .order-detail-side-col {
  gap: 8px;
  align-content: start;
}

.order-workspace-modal .order-history-list {
  display: grid;
  gap: 6px;
  max-height: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-workspace-modal .order-history-list li {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

.order-workspace-modal .order-history-empty-state {
  margin: 0;
  padding: 4px 2px;
  color: var(--text-muted, #667085);
  font-size: 11px;
}

.order-workspace-modal .order-side-note-text {
  margin: 0;
  color: var(--text-secondary, #475467);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .order-workspace-modal .order-detail-body {
    grid-template-columns: 1fr;
  }

  .order-workspace-modal .order-finance-grid,
  .order-workspace-modal .order-assignment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-workspace-modal .orders-detail-header-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .order-workspace-modal {
    padding: 0;
  }

  .order-workspace-dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .order-workspace-modal .order-route-cards,
  .order-workspace-modal .order-finance-grid,
  .order-workspace-modal .order-assignment-grid {
    grid-template-columns: 1fr;
  }

  .order-workspace-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .order-workspace-footer-actions {
    justify-content: flex-end;
  }
}
