:root {
  --page-bg: #f4f6fb;
  --sidebar-bg: #f9fafc;
  --panel-bg: #ffffff;
  --table-head: #2a5db8;
  --table-head-dark: #214e9f;
  --border: #dfe8f8;
  --soft-border: #edf2ff;
  --text: #1e2a3a;
  --muted: #68768f;
  --muted-strong: #32415e;
  --button-red: #2f6edb;
  --button-red-dark: #255cc0;
  --pill-bg: #eef4ff;
  --shadow: rgba(26, 55, 106, 0.08);
  --brand-warm: #f7d873;
  --brand-soft: #fff3bf;
  --success: #3bbf8e;
  --accent-blue: #5a8df6;
  --butter: #f8e28c;
  --butter-deep: #eac95c;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

button, input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  background: var(--page-bg);
}

.sidebar {
  display: none;
}

.brand-block {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 18px;
}

.brand-mark {
  width: 104px;
  height: 52px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  align-items: center;
  justify-items: center;
}

.dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--button-red), var(--butter));
  box-shadow: 0 0 0 5px rgba(47, 110, 219, 0.12);
}

.dot.red {
  background: linear-gradient(135deg, var(--button-red), var(--butter));
}

.dot.small {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-item.active {
  color: var(--button-red);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--button-red);
}

.nav-item:hover {
  background: rgba(0,0,0,0.02);
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  position: relative;
  opacity: 0.8;
}

.grid::before,
.grid::after,
.bookmark::before,
.offer::before,
.invoice::before,
.contacts::before,
.more::before,
.load::before,
.inbox::before,
.search::before {
  content: "";
  position: absolute;
  inset: 0;
}

.grid::before {
  border: 2px solid #666;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px transparent;
}

.grid::after {
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  background: #666;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: -6px 0 0 #666, 6px 0 0 #666, 0 -6px 0 #666, 0 6px 0 #666;
}

.inbox::before {
  border: 2px solid #666;
  border-radius: 3px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 58% 72%, 50% 100%, 42% 72%, 0 72%);
}

.search::before {
  border: 2px solid #666;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  left: 2px;
  top: 2px;
}

.search::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 6px;
  height: 2px;
  background: #666;
  transform: rotate(45deg);
  transform-origin: left center;
}

.bookmark::before {
  width: 10px;
  height: 12px;
  left: 3px;
  top: 2px;
  border: 2px solid #666;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.offer::before {
  border: 2px solid #666;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px transparent;
}

.offer::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  background: #666;
  transform: translateY(-50%);
  box-shadow: 0 -5px 0 #666, 0 5px 0 #666;
}

.load::before {
  border: 2px solid #666;
  border-radius: 2px;
  width: 12px;
  left: 2px;
  top: 2px;
}

.load::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  background: #666;
  transform: translateY(-50%);
}

.invoice::before {
  border: 2px solid #666;
  border-radius: 2px;
}

.invoice::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 4px;
  height: 2px;
  background: #666;
  box-shadow: 0 5px 0 #666, 0 10px 0 #666;
}

.contacts::before {
  border-radius: 50%;
  width: 8px;
  height: 8px;
  left: 4px;
  top: 2px;
  border: 2px solid #666;
}

.contacts::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 7px;
  border: 2px solid #666;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.more::before {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #666 0 18%, transparent 19% 100%);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
}

.pin-truck {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  color: var(--button-red);
  font-size: 28px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.truck-box {
  width: 150px;
  height: 86px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f2f1, #ece9e7);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.truck-icon {
  width: 88px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, #dad9d7, #c3c0bf);
  position: relative;
}

.truck-icon::before,
.truck-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8d8d8d;
  bottom: -8px;
}

.truck-icon::before { left: 14px; }
.truck-icon::after { right: 14px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px 0;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4b5b5, #ee7777);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.profile-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.profile-text strong {
  font-size: 13px;
}

.profile-text span {
  color: var(--muted);
}

.main-panel {
  width: 100%;
  padding: 18px 26px 18px 30px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 2px 16px;
}

.toolbar h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 420px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.02);
}

.search-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 2px solid #7d7d7d;
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: #7d7d7d;
  right: -5px;
  bottom: -2px;
  transform: rotate(45deg);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  width: 100%;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #8c8c8c;
}

.toggle-btn,
.tab-btn,
.status-pill,
.notification-btn,
.user-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-btn {
  padding: 0 16px;
  color: var(--muted-strong);
  font-size: 14px;
}

.tab-btn {
  padding: 0 18px;
  font-weight: 600;
  color: var(--text);
}

.tab-btn.primary {
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  color: white;
  border-color: var(--button-red);
  box-shadow: 0 8px 20px rgba(47, 110, 219, 0.18);
}

.tab-btn.ghost {
  background: transparent;
}

.tab-btn.add-load {
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  border-color: var(--button-red);
  color: white;
  padding: 0 20px;
  box-shadow: 0 8px 18px rgba(47, 110, 219, 0.18);
}

.notification-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f0f0ef);
  position: relative;
}

.bell {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid #5f5f5f;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.bell::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  background: #5f5f5f;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border-radius: 999px;
}

.user-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fdf6d5, var(--butter));
  color: #3d5aa9;
  font-weight: 700;
  border: 2px solid rgba(78, 120, 222, 0.38);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--soft-border);
}

.status-pill {
  background: #f3f3f2;
  padding: 0 18px;
  height: 38px;
  font-size: 15px;
  color: var(--muted-strong);
  font-weight: 500;
}

.status-pill.selected {
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  color: white;
  border-color: var(--button-red);
  box-shadow: 0 6px 16px rgba(47, 110, 219, 0.14);
}

.status-pill span {
  margin-left: 4px;
  font-weight: 700;
}

.logout-form {
  margin: 0;
}

.jarvis-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 18px 0 12px;
}

.jarvis-panel,
.jarvis-focus-panel {
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 24px var(--shadow);
  padding: 18px 20px;
}

.jarvis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.remi-trigger-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remi-label-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 110, 219, 0.06);
  border: 1px solid rgba(47, 110, 219, 0.12);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.remi-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 110, 219, 0.12), rgba(248, 226, 140, 0.22));
  border: 1px solid rgba(47, 110, 219, 0.18);
  overflow: visible;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.remi-orb {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--button-red), var(--butter));
  box-shadow: 0 0 18px rgba(47, 110, 219, 0.35), 0 0 30px rgba(248, 226, 140, 0.28);
  z-index: 2;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  animation: idleFloat 2.8s ease-in-out infinite;
}

.remi-avatar.thinking .remi-orb {
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(47, 110, 219, 0.5), 0 0 30px rgba(248, 226, 140, 0.32);
  animation: thinkingPulse 1.2s ease-in-out infinite;
}

.remi-avatar.listening .remi-orb,
.remi-avatar.speaking .remi-orb {
  transform: scale(calc(1.12 + (var(--mic-level, 0) * 1.4)));
  box-shadow: 0 0 22px rgba(47, 110, 219, 0.55), 0 0 42px rgba(248, 226, 140, 0.38);
  animation: speakingPulse 0.85s ease-in-out infinite alternate;
}

.remi-avatar.listening .wave,
.remi-avatar.speaking .wave {
  transform: scale(calc(0.9 + (var(--mic-level, 0) * 1.2)));
  opacity: 0.9;
}

.remi-avatar.alert .remi-orb {
  transform: scale(1.16);
  box-shadow: 0 0 28px rgba(246, 191, 50, 0.75), 0 0 44px rgba(247, 169, 44, 0.45);
  animation: alertPulse 0.7s ease-in-out infinite alternate;
}

.remi-avatar.listening .wave,
.remi-avatar.speaking .wave {
  border-color: rgba(47, 110, 219, 0.6);
  animation-duration: 1.2s;
}

.wave {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(47, 110, 219, 0.3);
  animation: orbitPulse 2.4s ease-out infinite;
}

.wave-2 {
  animation-delay: 0.6s;
}

.wave-3 {
  animation-delay: 1.2s;
}

@keyframes idleFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-2px) scale(1.04); }
}

@keyframes thinkingPulse {
  0%, 100% { transform: scale(1.08); filter: brightness(1); }
  50% { transform: scale(1.16); filter: brightness(1.18); }
}

@keyframes speakingPulse {
  0% { transform: scale(1.12); }
  100% { transform: scale(1.3); }
}

@keyframes listeningPulse {
  0%, 100% { transform: scale(1.1); filter: brightness(1); }
  50% { transform: scale(1.28); filter: brightness(1.2); }
}

@keyframes alertPulse {
  0% { transform: scale(1.1); filter: brightness(1); }
  100% { transform: scale(1.22); filter: brightness(1.3); }
}

@keyframes orbitPulse {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  30% {
    opacity: 0.55;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.jarvis-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.jarvis-header h2 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.jarvis-brief h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.jarvis-brief p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.5;
}

.jarvis-status {
  display: inline-flex;
  background: rgba(59, 191, 142, 0.12);
  color: var(--success);
  border: 1px solid rgba(59, 191, 142, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.jarvis-score {
  margin-top: 12px;
  color: var(--button-red);
  font-weight: 700;
}

.jarvis-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.jarvis-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #eef5ff);
  border: 1px solid var(--soft-border);
  color: var(--muted-strong);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--button-red), var(--butter));
  box-shadow: 0 0 0 5px rgba(47, 110, 219, 0.12);
}

.jarvis-focus-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.jarvis-focus-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.jarvis-focus-panel li {
  background: rgba(47, 110, 219, 0.04);
  border: 1px solid var(--soft-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted-strong);
}

.chat-panel {
  margin-top: 16px;
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  background: #f9fbff;
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(180deg, rgba(47, 110, 219, 0.08), rgba(47, 110, 219, 0.02));
  border-bottom: 1px solid var(--soft-border);
  padding: 10px 14px;
  color: var(--muted-strong);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: 230px;
  overflow-y: auto;
  padding: 12px 12px 8px;
}

.message {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.94rem;
}

.message.bot {
  align-self: flex-start;
  background: #eef4ff;
  color: var(--muted-strong);
  border: 1px solid var(--soft-border);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  color: white;
}

.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 0;
  min-height: 24px;
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.thinking-indicator.hidden {
  display: none;
}

.thinking-core {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 110, 219, 0.08);
  border: 1px solid rgba(47, 110, 219, 0.12);
}

.thinking-core .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--button-red), var(--butter));
  animation: thinkingPulse 1.2s infinite ease-in-out;
}

.thinking-core .dot:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-core .dot:nth-child(3) {
  animation-delay: 0.3s;
}

.thinking-text {
  letter-spacing: 0.02em;
}

@keyframes thinkingPulse {
  0%, 80%, 100% {
    transform: scale(0.75);
    opacity: 0.45;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--soft-border);
  background: white;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
}

.chat-form button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  color: white;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.count-row {
  margin-top: 18px;
  margin-bottom: 12px;
  color: var(--muted-strong);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-row span {
  color: var(--button-red);
  font-weight: 700;
}

.driver-directory-panel {
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,255,0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 24px var(--shadow);
  padding: 16px 18px;
}

.driver-directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.driver-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.driver-directory-header h3 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.driver-refresh-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--button-red), var(--button-red-dark));
  color: white;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

.driver-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.driver-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.driver-card:hover,
.driver-card.selected {
  transform: translateY(-1px);
  border-color: rgba(47, 110, 219, 0.32);
  box-shadow: 0 12px 20px rgba(47, 110, 219, 0.08);
}

.driver-detail-panel {
  margin-top: 16px;
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(47, 110, 219, 0.04), rgba(248, 226, 140, 0.08));
  padding: 14px 16px;
}

.driver-detail-panel.hidden {
  display: none;
}

.driver-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.driver-detail-header h4 {
  margin: 0;
  font-size: 1rem;
}

.driver-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.86rem;
}

.driver-detail-grid strong {
  color: var(--text);
}

.driver-detail-alerts {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.driver-detail-alerts .alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(249, 83, 82, 0.08);
  border: 1px solid rgba(249, 83, 82, 0.18);
  color: #a92e2e;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.driver-detail-alerts .alert-chip.good {
  background: rgba(59, 191, 142, 0.1);
  border-color: rgba(59, 191, 142, 0.2);
  color: #1f7d5b;
}

.gps-tracker-panel {
  margin: 18px 0 20px;
  background: linear-gradient(180deg, rgba(15, 51, 119, 0.95), rgba(24, 74, 165, 0.9));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px 18px;
  color: white;
  box-shadow: 0 16px 30px rgba(15, 51, 119, 0.18);
}

.gps-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gps-header-row h3 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

.gps-health-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(155, 214, 189, 0.18);
  border: 1px solid rgba(155, 214, 189, 0.32);
  color: #d8f8ea;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gps-tracker {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.live-map {
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255,255,255,0.05);
}

.gps-stop-list {
  display: grid;
  gap: 8px;
}

.gps-stop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.04);
}

.gps-stop-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #93c5fd;
}

.gps-stop-item .dot.warn {
  background: #ffd166;
}

.gps-stop-item .dot.active {
  background: #ff6b6b;
}

.gps-stop-item .name {
  font-weight: 700;
}

.gps-stop-item .meta {
  color: rgba(234,243,255,0.8);
  font-size: 0.72rem;
}

.gps-stop-item .status {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #dfeeff;
}

.dispatch-actions-panel {
  margin: 18px 0 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,246,255,0.94));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 24px var(--shadow);
}

.dispatch-actions-header h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.dispatch-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dispatch-action-btn {
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(47, 110, 219, 0.08), rgba(47, 110, 219, 0.03));
  color: var(--muted-strong);
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.dispatch-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 110, 219, 0.28);
}

.dispatch-action-log {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.action-log-entry {
  padding: 10px 12px;
  border: 1px solid var(--soft-border);
  border-left: 4px solid var(--button-red);
  border-radius: 10px;
  background: rgba(47, 110, 219, 0.03);
  color: var(--muted-strong);
  font-size: 0.84rem;
}

.driver-card {
  border: 1px solid var(--soft-border);
  border-radius: 14px;
  background: rgba(255,255,255,0.76);
  padding: 14px 14px 12px;
}

.driver-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.driver-name {
  font-weight: 800;
  color: var(--text);
}

.driver-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(59, 191, 142, 0.12);
  color: var(--success);
}

.driver-status.needs-rest {
  background: rgba(247, 179, 52, 0.12);
  color: #b67400;
}

.driver-meta {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 0.85rem;
}

.driver-schedule {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--soft-border);
}

.schedule-title {
  margin: 0 0 8px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.schedule-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: rgba(47, 110, 219, 0.04);
  border: 1px solid var(--soft-border);
  padding: 7px 9px;
  font-size: 0.8rem;
  color: var(--muted-strong);
}

.schedule-list strong {
  color: var(--text);
}

.data-table-wrap {
  background: rgba(255,255,255,0.26);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-head,
.table-filters,
.load-row {
  display: grid;
  grid-template-columns: 1.7fr 1.7fr 1fr 1.3fr 1.2fr 1.2fr 1fr 1.4fr;
  gap: 0;
  width: 100%;
}

.table-head {
  background: linear-gradient(180deg, var(--table-head), var(--table-head-dark));
  color: white;
  font-weight: 700;
}

.table-head > div,
.table-filters > input,
.load-row > div {
  min-height: 54px;
  padding: 14px 12px;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.table-head > div:last-child,
.table-filters > input:last-child,
.load-row > div:last-child {
  border-right: none;
}

.table-head > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort {
  opacity: 0.9;
  font-size: 12px;
}

.table-filters {
  background: #f8f7f6;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.table-filters > input {
  background: transparent;
  border: 1px solid var(--soft-border);
  margin: 10px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}

.table-filters > input::placeholder {
  color: #8d8d8d;
}

.load-rows {
  background: rgba(255,255,255,0.2);
}

.load-row {
  background: #f9f8f7;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.4;
}

.load-row:last-child {
  border-bottom: none;
}

.load-row > div {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-right: 1px solid var(--soft-border);
}

@media (max-width: 1200px) {
  .search-box { width: 300px; }
  .table-head, .table-filters, .load-row {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar-actions {
    flex-wrap: wrap;
  }
  .search-box {
    width: 100%;
  }
  .status-bar {
    flex-wrap: wrap;
  }
}

/* ----- Public demo banner ----- */
.demo-banner {
  position: sticky; top: 0; z-index: 1000;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #1d2433; color: #fff; font-size: 0.9rem;
}
.demo-banner a { color: #f8e28c; font-weight: 600; text-decoration: none; }
.demo-banner a:hover { text-decoration: underline; }
.demo-banner-links { display: flex; gap: 16px; align-items: center; }
.demo-banner .demo-banner-cta { background: #2f6edb; color: #fff; padding: 6px 12px; border-radius: 8px; }
