:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #eef2ff;
  --text: #101828;
  --text-soft: #344054;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --primary: #155eef;
  --primary-dark: #004eeb;
  --primary-soft: #eff4ff;
  --success: #12b76a;
  --success-soft: #ecfdf3;
  --warning: #f79009;
  --warning-soft: #fffaeb;
  --danger: #f04438;
  --danger-soft: #fff1f3;
  --nav: #0b1220;
  --nav-2: #111827;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 14px 34px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 28px 80px rgba(16, 24, 40, 0.18);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(21, 94, 239, 0.14), transparent 32%),
    linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  border: 0;
}

.app-hidden,
.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 0%, rgba(46, 144, 250, 0.28), transparent 34%),
    linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #d0d5dd;
  padding: 24px 18px;
}

.brand {
  padding: 4px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand h1 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand p {
  margin-top: 4px;
  color: #98a2b3;
  font-size: 13px;
}

.menu {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.sidebar-section-title {
  margin: 4px 8px 6px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-item,
.workspace-switch {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #d0d5dd;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 13px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.menu-item:hover,
.workspace-switch:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.menu-item.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #101828;
  box-shadow: 0 14px 30px rgba(2, 8, 23, 0.28);
}

.module-card-mini {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.module-card-mini strong {
  color: inherit;
  font-size: 14px;
}

.module-card-mini span {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 500;
}

.workspace-switch {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 850;
  letter-spacing: -0.05em;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

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

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #abefc6;
  border-radius: 999px;
  background: var(--success-soft);
  color: #027a48;
  font-size: 14px;
  font-weight: 750;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.14);
}

.view-container {
  display: grid;
  gap: 18px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 0%, rgba(132, 173, 255, 0.32), transparent 28%),
    linear-gradient(135deg, #0b1220 0%, #173b77 58%, #155eef 100%);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.eyebrow {
  margin-bottom: 12px;
  color: #b2ccff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel h1 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.hero-copy {
  max-width: 660px;
  margin-top: 16px;
  color: #d1e0ff;
  font-size: 16px;
}

.hero-status {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 10px;
  color: #d1e0ff;
  white-space: nowrap;
}

.module-grid,
.cards,
.health-grid {
  display: grid;
  gap: 16px;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.module-card {
  min-height: 238px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: #84adff;
  box-shadow: 0 24px 60px rgba(21, 94, 239, 0.15);
}

.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  border: 1px solid #d1e0ff;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.module-card strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.module-card p {
  color: var(--muted);
}

.module-card small {
  color: var(--primary);
  font-weight: 800;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.card,
.panel,
.insight-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  min-height: 140px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.card span,
.card h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card strong,
.metric {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.tone-blue {
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.tone-amber {
  background: linear-gradient(180deg, #ffffff 0%, #fffaeb 100%);
}

.tone-green {
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf3 100%);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.insight-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.insight-card h3,
.panel-head h3 {
  color: var(--text);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.insight-card p,
.panel-head p {
  margin-top: 6px;
  color: var(--muted);
}

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

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

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

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

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.filter-grid.compact {
  grid-template-columns: minmax(220px, 320px) auto;
  align-items: end;
}

.filter-grid label,
.modal-form label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.station-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.tab-btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.tab-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #84adff;
  box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
}

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

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f9fafb;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--text-soft);
}

tbody tr:hover {
  background: #fbfdff;
}

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

.link-btn {
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

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

.car-type-thumb {
  display: block;
  width: 64px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge.success {
  background: var(--success-soft);
  color: #027a48;
}

.badge.warning {
  background: var(--warning-soft);
  color: #b54708;
}

.badge.danger {
  background: var(--danger-soft);
  color: #b42318;
}

.badge.default {
  background: #f2f4f7;
  color: #475467;
}

.health-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding: 0 24px 24px;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-muted);
}

.health-item span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(21, 94, 239, 0.22);
}

.btn-secondary {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text-soft);
}

.btn-danger {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: #b42318;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.52);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(92vh, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  cursor: pointer;
  font-size: 22px;
}

.modal-form {
  display: grid;
  gap: 13px;
  padding: 22px;
  overflow-y: auto;
}

.modal-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 18%, rgba(132, 173, 255, 0.3), transparent 28%),
    linear-gradient(135deg, #0b1220 0%, #172554 58%, #155eef 100%);
}

.auth-screen:not(.app-hidden) {
  position: relative;
  z-index: 50;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.auth-card p {
  color: var(--muted);
}

.auth-card form {
  display: grid;
  gap: 10px;
}

.auth-card label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.text-muted {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 14px;
  }
}

@media (max-width: 900px) {
  .layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-radius: 0 0 24px 24px;
  }

  .main-content {
    padding: 18px;
  }

  .topbar,
  .hero-panel,
  .panel-head {
    display: grid;
  }

  .hero-status {
    justify-items: start;
    white-space: normal;
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid.compact {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .filter-actions .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .main-content {
    padding: 14px;
  }

  .topbar,
  .hero-panel,
  .module-card,
  .insight-card,
  .panel-head {
    border-radius: 20px;
    padding: 18px;
  }

  .module-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .topbar-actions .btn,
  .toolbar,
  .toolbar input {
    width: 100%;
  }

  .modal {
    padding: 10px;
  }
}
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(circle at 20% -10%, #dbeafe, transparent 45%), var(--bg);
  color: var(--text);
}

.app-hidden,
.hidden {
  display: none !important;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: linear-gradient(180deg, #0b1736, #10244f);
  color: #dbeafe;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 12px 12px 18px;
  border-bottom: 1px solid rgba(219, 234, 254, 0.16);
}

.brand h1 {
  font-size: 26px;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}

.brand p {
  font-size: 13px;
  color: #9db2d6;
}

.menu {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.menu-item {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #d1dcf5;
  text-align: left;
  font-size: 15px;
  padding: 11px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.menu-item:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(147, 197, 253, 0.2);
}

.menu-item.active {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.main-content {
  flex: 1;
  padding: 26px;
}

.topbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

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

.admin-chip {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #c7dbff;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.view-container {
  display: grid;
  gap: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h4 {
  color: #475569;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric {
  font-size: 28px;
  margin-top: 8px;
  font-weight: 800;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel-head h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.filter-grid.compact {
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: end;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.station-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.tab-btn {
  border: 1px solid #dbe6ff;
  background: #eef4ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-color: transparent;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
}

input,
select,
textarea {
  border: 1px solid #d6e0ef;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
}

th {
  color: #334155;
  font-weight: 700;
  background: #f8fafc;
}

tbody tr:hover {
  background: #f8fbff;
}

.car-type-thumb {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.badge {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge.default {
  background: #e2e8f0;
  color: #334155;
}

.text-muted {
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.18s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #eef4ff;
  color: #1e40af;
  border-color: #cdddff;
}

.btn-danger {
  background: #ffe7eb;
  color: #b4232f;
  border-color: #ffc8d1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: rgba(2, 8, 23, 0.45);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(92vh, calc(100vh - 32px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.btn-close {
  border: none;
  background: transparent;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
}

.modal-form {
  padding: 16px;
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-form label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.modal-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-screen:not(.app-hidden) {
  position: relative;
  z-index: 50;
}

.auth-card {
  width: min(430px, 95vw);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 10px;
}

.auth-card h2 {
  font-size: 30px;
  letter-spacing: -0.4px;
}

.auth-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.auth-card form {
  display: grid;
  gap: 8px;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .sidebar {
    width: 240px;
  }

  .topbar h2 {
    font-size: 26px;
  }
}

@media (max-width: 980px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .main-content {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #155eef;
  --primary-dark: #004eeb;
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --nav: #101828;
  --nav-soft: #1d2939;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 48%, #f7f9fc 100%);
}

.layout {
  background: transparent;
}

.sidebar {
  width: 292px;
  background: radial-gradient(circle at 30% 0%, #244c91 0%, var(--nav) 42%, #0b1220 100%);
  padding: 24px 18px;
  box-shadow: 18px 0 50px rgba(16, 24, 40, 0.14);
}

.brand {
  padding: 6px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand h1 {
  color: #ffffff;
  font-size: 24px;
  letter-spacing: -0.6px;
}

.brand p {
  color: #b8c7df;
}

.sidebar-section-title {
  color: #8ea3c6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 18px 8px 8px;
  text-transform: uppercase;
}

.workspace-switch {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #e4ecfb;
  cursor: pointer;
  font-weight: 800;
  margin-top: 14px;
  padding: 10px 12px;
  text-align: left;
}

.menu {
  margin-top: 14px;
}

.menu-item {
  border-radius: 14px;
  color: #d0d8e8;
  padding: 12px 13px;
}

.menu-item.active {
  background: #ffffff;
  color: #111827;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.module-card-mini {
  display: grid;
  gap: 6px;
}

.module-card-mini strong {
  color: inherit;
  font-size: 14px;
}

.module-card-mini span {
  color: #99a9c2;
  font-size: 12px;
  line-height: 1.45;
}

.main-content {
  padding: 28px;
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(228, 231, 236, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  margin-bottom: 22px;
  padding: 22px 26px;
}

.topbar h2 {
  color: #0f172a;
  font-size: 32px;
  letter-spacing: -0.9px;
}

.topbar p {
  color: #667085;
}

.admin-chip {
  background: #ecfdf3;
  color: #027a48;
  border-color: #abefc6;
}

.btn {
  border-radius: 12px;
  min-height: 38px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 10px 24px rgba(21, 94, 239, 0.22);
}

.btn-secondary {
  background: #f2f4f7;
  color: #344054;
  border-color: #e4e7ec;
}

.btn-danger {
  background: #fff1f3;
  color: #c01048;
  border-color: #ffd6df;
}

.view-container {
  gap: 18px;
}

.hero-panel {
  align-items: flex-start;
  background: linear-gradient(135deg, #0b1220, #173b77);
  border-radius: 28px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 34px;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  top: -90px;
  border-radius: 999px;
  background: rgba(46, 144, 250, 0.28);
}

.eyebrow {
  color: #9ec5ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-panel h1 {
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -1.8px;
  line-height: 1.02;
  max-width: 760px;
}

.hero-copy {
  color: #d3ddf2;
  font-size: 16px;
  line-height: 1.65;
  margin-top: 16px;
  max-width: 680px;
}

.hero-status {
  align-items: flex-end;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.module-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.module-card {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 26px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 28px;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-card:hover {
  border-color: #84adff;
  box-shadow: 0 24px 60px rgba(21, 94, 239, 0.16);
  transform: translateY(-3px);
}

.module-icon {
  align-items: center;
  background: #eff4ff;
  border: 1px solid #d1e0ff;
  border-radius: 18px;
  color: #155eef;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  width: 64px;
}

.module-card strong {
  color: #101828;
  font-size: 28px;
  letter-spacing: -0.8px;
}

.module-card p {
  color: #667085;
  font-size: 15px;
  line-height: 1.55;
}

.module-card small {
  color: #155eef;
  font-weight: 800;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.card {
  border-radius: 22px;
  padding: 20px;
}

.card span,
.card h4 {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card strong,
.metric {
  color: #101828;
  display: block;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.2px;
  margin-top: 10px;
}

.card small {
  color: #667085;
  display: block;
  margin-top: 8px;
}

.tone-blue {
  background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.tone-amber {
  background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.tone-green {
  background: linear-gradient(180deg, #ffffff, #ecfdf3);
}

.split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.insight-card,
.panel {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.insight-card {
  padding: 24px;
}

.insight-card h3,
.panel-head h3 {
  color: #101828;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.insight-card p,
.panel-head p {
  color: #667085;
  line-height: 1.55;
  margin-top: 6px;
}

.muted-card {
  background: #f8fafc;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  padding: 20px 22px;
}

.toolbar input {
  min-width: 270px;
}

.filter-grid,
.station-tabs {
  background: #f8fafc;
  padding: 18px 22px;
}

input,
select,
textarea {
  border-color: #d0d5dd;
  border-radius: 12px;
}

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

table {
  min-width: 860px;
}

th {
  background: #f9fafb;
  color: #475467;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: #344054;
}

tbody tr:hover {
  background: #f9fbff;
}

.empty-state {
  color: #667085;
  padding: 28px;
  text-align: center;
}

.health-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 0 22px 22px;
}

.health-item {
  align-items: center;
  background: #f9fafb;
  border: 1px solid #eaecf0;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.health-item span {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.ops-health {
  border-style: dashed;
}

.modal-card {
  width: min(760px, 100%);
  border-radius: 24px;
}

.modal-header {
  padding: 18px 22px;
}

.modal-header h3 {
  font-size: 22px;
  letter-spacing: -0.4px;
}

.modal-form {
  gap: 12px;
  padding: 22px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
}

.filter-grid input,
.filter-grid select {
  min-height: 42px;
}

.panel-head {
  align-items: flex-start;
}

.toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  min-height: 26px;
}

.auth-screen {
  background: radial-gradient(circle at 20% 20%, rgba(21, 94, 239, 0.22), transparent 32%), linear-gradient(135deg, #0b1220, #172554);
}

.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.34);
  padding: 32px;
}

.auth-card h2 {
  color: #101828;
  font-size: 34px;
}

.auth-card p {
  line-height: 1.55;
}

@media (max-width: 980px) {
  .sidebar {
    border-radius: 0 0 24px 24px;
  }

  .hero-panel,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: grid;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .toolbar input {
    min-width: 0;
    width: 100%;
  }
}
