@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   TransFleet Enterprise OS — Design System & Stylesheet
   Copyright (c) 2026 TVB Network (Pty) Ltd.
   ========================================================================== */

:root, [data-theme="dark"] {
  --tf-bg-page: #070c14;
  --tf-bg-sidebar: #0a121e;
  --tf-bg-topbar: rgba(10, 18, 30, 0.92);
  --tf-bg-card: #0f1a2c;
  --tf-bg-surface: #142238;
  --tf-bg-hover: #192b47;
  --tf-bg-input: #09101d;
  
  --tf-border: #17263d;
  --tf-border-subtle: rgba(255, 255, 255, 0.05);
  --tf-border-strong: #223756;
  --tf-border-accent: rgba(16, 185, 129, 0.35);
  
  --tf-emerald: #10b981;
  --tf-emerald-dark: #059669;
  --tf-emerald-soft: rgba(16, 185, 129, 0.14);
  --tf-lime: #d8f35e;
  --tf-forest: #174d40;
  
  --tf-amber: #f59e0b;
  --tf-amber-soft: rgba(245, 158, 11, 0.14);
  --tf-red: #ef4444;
  --tf-red-soft: rgba(239, 68, 68, 0.14);
  --tf-blue: #38bdf8;
  --tf-blue-soft: rgba(56, 189, 248, 0.14);

  --tf-text-main: #f8fafc;
  --tf-text-muted: #94a3b8;
  --tf-text-dim: #64748b;

  --tf-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --tf-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --tf-shadow-glow: 0 0 40px rgba(16, 185, 129, 0.15);

  --tf-radius-sm: 6px;
  --tf-radius-md: 10px;
  --tf-radius-lg: 14px;
  --tf-radius-xl: 20px;
}

[data-theme="light"] {
  --tf-bg-page: #f8fafc;
  --tf-bg-sidebar: #ffffff;
  --tf-bg-topbar: rgba(255, 255, 255, 0.94);
  --tf-bg-card: #ffffff;
  --tf-bg-surface: #f1f5f9;
  --tf-bg-hover: #f1f5f9;
  --tf-bg-input: #ffffff;
  
  --tf-border: #e2e8f0;
  --tf-border-subtle: rgba(0, 0, 0, 0.04);
  --tf-border-strong: #cbd5e1;
  --tf-border-accent: rgba(16, 185, 129, 0.35);

  --tf-emerald: #059669;
  --tf-emerald-dark: #047857;
  --tf-emerald-soft: rgba(16, 185, 129, 0.1);
  --tf-lime: #16a34a;
  --tf-forest: #064e3b;

  --tf-amber: #d97706;
  --tf-amber-soft: rgba(245, 158, 11, 0.1);
  --tf-red: #dc2626;
  --tf-red-soft: rgba(239, 68, 68, 0.1);
  --tf-blue: #0284c7;
  --tf-blue-soft: rgba(2, 132, 199, 0.1);

  --tf-text-main: #0f172a;
  --tf-text-muted: #475569;
  --tf-text-dim: #94a3b8;
  
  --tf-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --tf-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--tf-bg-page);
  color: var(--tf-text-main);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ==========================================================================
   APP SHELL & LAYOUT
   ========================================================================== */
.tf-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Off-canvas backdrop overlay for mobile/tablet */
.tf-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 995;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tf-sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   LEFT SIDEBAR (LEFT SIDE PANEL)
   ========================================================================== */
.tf-sidebar {
  background: var(--tf-bg-sidebar);
  border-right: 1px solid var(--tf-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  z-index: 100;
  box-sizing: border-box;
}

.tf-sidebar-header {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--tf-border);
  background: var(--tf-bg-sidebar);
}

.tf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--tf-text-main);
}

.tf-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--tf-radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.tf-brand span {
  color: var(--tf-emerald);
}

.tf-brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tf-emerald);
  background: var(--tf-emerald-soft);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-left: auto;
}

.tf-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--tf-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.tf-sidebar-close:hover {
  background: var(--tf-bg-hover);
  color: var(--tf-text-main);
}

.tf-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--tf-border) transparent;
}

.tf-sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.tf-sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--tf-border);
  border-radius: 4px;
}

.tf-nav-group {
  margin-bottom: 24px;
}

.tf-nav-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tf-text-dim);
  padding: 6px 12px 10px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tf-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tf-text-muted);
  border-radius: var(--tf-radius-md);
  transition: all 0.15s ease;
  margin-bottom: 4px;
  line-height: 1.4;
  position: relative;
  cursor: pointer;
}

.tf-nav-link:hover {
  background: var(--tf-bg-hover);
  color: var(--tf-text-main);
}

.tf-nav-link.active {
  background: var(--tf-emerald-soft);
  color: var(--tf-emerald);
  font-weight: 700;
}

[data-theme="dark"] .tf-nav-link.active {
  color: var(--tf-lime);
}

.tf-nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.tf-nav-link.active svg {
  opacity: 1;
  color: var(--tf-emerald);
}
[data-theme="dark"] .tf-nav-link.active svg {
  color: var(--tf-lime);
}

.tf-nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--tf-bg-surface);
  color: var(--tf-text-muted);
  border: 1px solid var(--tf-border);
}

.tf-nav-badge.alert {
  background: var(--tf-red-soft);
  color: var(--tf-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.tf-nav-badge.live {
  background: var(--tf-emerald-soft);
  color: var(--tf-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   BOTTOM OF LEFT SIDEBAR: PLAN UPGRADE WIDGET & PROFILE CHIP
   ========================================================================== */
.tf-sidebar-footer {
  padding: 14px 12px 16px;
  border-top: 1px solid var(--tf-border);
  background: var(--tf-bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* The Plan Upgrade Widget */
.tf-plan-widget {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--tf-radius-lg);
  padding: 12px 14px;
  box-shadow: var(--tf-shadow-sm);
  position: relative;
  overflow: hidden;
}

.tf-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tf-plan-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tf-emerald);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-theme="dark"] .tf-plan-badge {
  color: var(--tf-lime);
}

.tf-plan-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-emerald);
  box-shadow: 0 0 6px var(--tf-emerald);
}
[data-theme="dark"] .tf-plan-badge::before {
  background: var(--tf-lime);
  box-shadow: 0 0 6px var(--tf-lime);
}

.tf-plan-price {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--tf-text-main);
}

.tf-plan-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tf-text-main);
  margin-bottom: 4px;
}

.tf-plan-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--tf-text-muted);
  margin-bottom: 4px;
}

.tf-plan-meter-track {
  height: 5px;
  background: var(--tf-bg-surface);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.tf-plan-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tf-emerald), #38bdf8);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.tf-plan-upgrade-btn {
  width: 100%;
  padding: 7px 12px;
  background: linear-gradient(135deg, var(--tf-emerald) 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--tf-radius-md);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tf-plan-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

/* User Profile Chip */
.tf-user-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-md);
}

.tf-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tf-emerald), #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.tf-user-info {
  flex: 1;
  min-width: 0;
}

.tf-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tf-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-user-role {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tf-emerald);
  text-transform: uppercase;
}

.tf-logout-btn {
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  color: var(--tf-text-dim);
  padding: 6px;
  cursor: pointer;
  border-radius: var(--tf-radius-sm);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.tf-logout-btn:hover {
  color: var(--tf-red);
  background: var(--tf-red-soft);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   TOPBAR NAVIGATION (TOP ACTION STRIP)
   ========================================================================== */
.tf-topbar {
  height: 68px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--tf-border);
  background: var(--tf-bg-topbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.tf-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tf-hamburger {
  display: none;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  color: var(--tf-text-main);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--tf-radius-md);
  align-items: center;
  justify-content: center;
}
.tf-hamburger:hover {
  background: var(--tf-bg-hover);
}

.tf-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--tf-text-dim);
}

.tf-breadcrumbs span.active {
  color: var(--tf-text-main);
  font-weight: 700;
}

/* Telemetry GPS online beacon */
.tf-telemetry-beacon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tf-emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tf-emerald);
}

.tf-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-emerald);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: tfPulse 2s infinite;
}

@keyframes tfPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Search Bar */
.tf-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tf-bg-input);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-md);
  padding: 8px 14px;
  width: 360px;
  max-width: 480px;
  transition: all 0.2s ease;
}

.tf-search-bar:focus-within {
  border-color: var(--tf-emerald);
  box-shadow: 0 0 0 3px var(--tf-emerald-soft);
  width: 420px;
}

.tf-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.82rem;
  color: var(--tf-text-main);
  width: 100%;
}

.tf-search-bar input::placeholder {
  color: var(--tf-text-dim);
}

.tf-search-kbd {
  font-size: 0.68rem;
  padding: 1px 5px;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  border-radius: 4px;
  color: var(--tf-text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* Topbar Actions */
.tf-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--tf-radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.tf-btn-primary {
  background: linear-gradient(135deg, var(--tf-emerald), var(--tf-emerald-dark));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.tf-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.tf-btn-secondary {
  background: var(--tf-bg-surface);
  border-color: var(--tf-border);
  color: var(--tf-text-main);
}

.tf-btn-secondary:hover {
  background: var(--tf-bg-hover);
  border-color: var(--tf-border-strong);
}

.tf-btn-outline {
  background: transparent;
  border-color: var(--tf-emerald);
  color: var(--tf-emerald);
}

.tf-btn-outline:hover {
  background: var(--tf-emerald-soft);
}

.tf-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--tf-radius-md);
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  color: var(--tf-text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.tf-icon-btn:hover {
  color: var(--tf-text-main);
  background: var(--tf-bg-hover);
}

.tf-dot-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--tf-rose);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--tf-bg-topbar);
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   WORKSPACE CONTENT & TAB PANELS
   ========================================================================== */
.tf-workspace {
  padding: 24px 28px 48px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

.tf-tab-panel {
  display: none;
}

.tf-tab-panel.active {
  display: block;
  animation: tfFadeIn 0.2s ease-out;
}

@keyframes tfFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Card Grid */
.tf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.tf-kpi-card {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  padding: 22px;
  box-shadow: var(--tf-shadow-sm);
  position: relative;
  overflow: hidden;
}

.tf-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--tf-border);
}

.tf-kpi-card.emerald::before { background: var(--tf-emerald); }
.tf-kpi-card.lime::before { background: var(--tf-lime); }
.tf-kpi-card.amber::before { background: var(--tf-amber); }
.tf-kpi-card.blue::before { background: var(--tf-blue); }

.tf-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tf-kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tf-text-dim);
}

.tf-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--tf-radius-sm);
  display: grid;
  place-items: center;
}

.tf-kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--tf-text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}

.tf-kpi-sub {
  font-size: 0.8rem;
  color: var(--tf-text-muted);
}

/* Card & Table Containers */
.tf-card {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  box-shadow: var(--tf-shadow-sm);
  overflow: hidden;
  margin-bottom: 28px;
}

.tf-card-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--tf-border);
  flex-wrap: wrap;
  gap: 14px;
}

.tf-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tf-card-sub {
  font-size: 0.85rem;
  color: var(--tf-text-muted);
  margin-top: 2px;
}

.tf-table-container {
  overflow-x: auto;
}

.tf-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.tf-table th {
  background: var(--tf-bg-surface);
  color: var(--tf-text-dim);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--tf-border);
}

.tf-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--tf-border-subtle);
  color: var(--tf-text-muted);
}

.tf-table tr:hover td {
  background: var(--tf-bg-hover);
  color: var(--tf-text-main);
}

.tf-table td strong {
  color: var(--tf-text-main);
}

/* Status Badges */
.tf-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.tf-badge-status.active,
.tf-badge-status.on-route,
.tf-badge-status.delivered,
.tf-badge-status.passed {
  background: var(--tf-emerald-soft);
  color: var(--tf-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tf-badge-status.idle,
.tf-badge-status.pending,
.tf-badge-status.expiring {
  background: var(--tf-amber-soft);
  color: var(--tf-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tf-badge-status.maintenance,
.tf-badge-status.delayed,
.tf-badge-status.failed {
  background: var(--tf-red-soft);
  color: var(--tf-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tf-badge-status.grounded {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 800;
  animation: tfPulseDanger 1.8s infinite;
}

.tf-badge-status.rented {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

.tf-badge-status.completed {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.tf-badge-status.overdue {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Vehicle Type Badges */
.tf-vtype-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.tf-vtype-badge.truck {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}
.tf-vtype-badge.car {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.tf-vtype-badge.bike {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* License Disc Renewal Indicators */
.tf-disc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.tf-disc-pill.valid {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.tf-disc-pill.expiring {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.tf-disc-pill.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Filter Pills Strip */
.tf-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tf-pill-btn {
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  color: var(--tf-text-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tf-pill-btn:hover {
  border-color: var(--tf-border-strong);
  color: var(--tf-text-main);
}
.tf-pill-btn.active {
  background: var(--tf-emerald-soft);
  border-color: var(--tf-emerald);
  color: var(--tf-emerald);
  font-weight: 700;
}

/* Grounded Hazard Banner */
.tf-grounded-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--tf-radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.tf-grounded-banner-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
}

@keyframes tfPulseDanger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Empty State */
.tf-empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--tf-text-dim);
}

.tf-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tf-bg-surface);
  color: var(--tf-text-dim);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.tf-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tf-text-main);
  margin-bottom: 6px;
}

.tf-empty-sub {
  font-size: 0.9rem;
  color: var(--tf-text-muted);
  max-width: 440px;
  margin: 0 auto 20px;
}

/* ==========================================================================
   MODALS & FORMS
   ========================================================================== */
.tf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 0;
}

.tf-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.tf-modal-box {
  background: var(--tf-bg-card);
  border-left: 1px solid var(--tf-border-strong);
  border-radius: 0;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 640px;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: 32px 36px 48px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tf-modal-backdrop.open .tf-modal-box {
  transform: translateX(0);
}

.tf-form-group {
  margin-bottom: 18px;
}

.tf-form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tf-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tf-input, .tf-select, .tf-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--tf-bg-input);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-md);
  color: var(--tf-text-main);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tf-input:focus, .tf-select:focus, .tf-textarea:focus {
  border-color: var(--tf-emerald);
  box-shadow: 0 0 0 3px var(--tf-emerald-soft);
}

.tf-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Pricing / Upgrade Plan Modal Cards */
.tf-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 20px 0 24px;
}

.tf-plan-card-opt {
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.tf-plan-card-opt:hover,
.tf-plan-card-opt.selected {
  border-color: var(--tf-emerald);
  background: var(--tf-emerald-soft);
}

.tf-plan-card-opt.selected::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background-color: var(--tf-emerald);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
}

.tf-plan-opt-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.tf-plan-opt-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--tf-lime);
  margin-bottom: 8px;
}

.tf-plan-opt-features {
  font-size: 0.75rem;
  color: var(--tf-text-muted);
  line-height: 1.4;
}

/* Toast */
.tf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--tf-forest);
  color: #ffffff;
  border: 1px solid var(--tf-emerald);
  border-radius: var(--tf-radius-md);
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--tf-shadow-md);
  display: none;
  z-index: 2000;
  animation: tfToastPop 0.2s ease-out;
}

.tf-toast.show {
  display: block;
}

@keyframes tfToastPop {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */
.tf-mobile-nav {
  display: none;
}

@media (max-width: 1024px) {
  .tf-shell {
    grid-template-columns: 1fr;
  }

  .tf-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 285px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex !important;
  }

  .tf-sidebar.open {
    transform: translateX(0);
  }

  .tf-sidebar-close {
    display: block;
  }

  .tf-hamburger {
    display: flex !important;
  }

  .tf-topbar {
    padding: 0 16px;
    height: 62px;
  }

  .tf-workspace {
    padding: 20px 16px 80px;
  }

  .tf-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tf-telemetry-beacon {
    display: none;
  }

  .tf-search-bar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .tf-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--tf-bg-card);
    border-top: 1px solid var(--tf-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 900;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 4px;
  }

  .tf-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    color: var(--tf-text-muted);
    text-decoration: none;
    flex: 1;
    height: 100%;
    cursor: pointer;
  }

  .tf-mobile-nav-item.active {
    color: var(--tf-emerald);
  }

  .tf-mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .tf-breadcrumbs {
    display: none;
  }

  .tf-kpi-grid {
    grid-template-columns: 1fr;
  }

  .tf-search-bar {
    display: none;
  }

  .tf-modal-box {
    padding: 22px 16px;
    border-radius: var(--tf-radius-lg);
    max-height: 85vh;
  }

  .tf-form-row {
    grid-template-columns: 1fr;
  }

  .tf-pricing-grid {
    grid-template-columns: 1fr;
  }

  .tf-topbar-right button.tf-btn span.tf-btn-text {
    display: none;
  }
}

/* ==========================================================================
   NOTIFICATIONS SLIDE-OUT PANEL
   ========================================================================== */
.tf-notifications-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100%;
  background: var(--tf-bg-card);
  border-left: 1px solid var(--tf-border);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--tf-shadow-md);
}

.tf-notifications-panel.open {
  right: 0;
}

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

.tf-notif-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tf-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
  color: var(--tf-text-dim);
}

/* ==========================================================================
   TEXTAREA & SELECT FORM ELEMENTS
   ========================================================================== */
.tf-input[rows],
textarea.tf-input {
  min-height: 72px;
  line-height: 1.5;
  padding: 10px 14px;
}

.tf-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--tf-bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-sm);
  color: var(--tf-text-main);
  font-family: inherit;
  font-size: 0.88rem;
  height: 42px;
  padding: 10px 36px 10px 14px;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tf-select:focus {
  outline: none;
  border-color: var(--tf-emerald);
  box-shadow: 0 0 0 3px var(--tf-emerald-soft);
}

.tf-select option {
  background: var(--tf-bg-card);
  color: var(--tf-text-main);
}

[data-theme="light"] .tf-select {
  background-color: var(--tf-bg-input);
  color: var(--tf-text-main);
}

/* ==========================================================================
   TOPBAR USER PROFILE PILL & DROPDOWN MENU
   ========================================================================== */
.tf-user-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tf-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tf-user-pill:hover {
  background: var(--tf-bg-card);
  border-color: var(--tf-border-strong);
}

.tf-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.tf-user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tf-text-main);
}

.tf-user-role {
  font-size: 0.68rem;
  color: var(--tf-text-muted);
}

.tf-user-chevron {
  color: var(--tf-text-muted);
  transition: transform 0.2s ease;
}

.tf-user-pill.active .tf-user-chevron,
.tf-user-menu-wrap.active .tf-user-chevron {
  transform: rotate(180deg);
}

.tf-user-pill:hover,
.tf-user-pill.active {
  background: var(--tf-bg-card);
  border-color: var(--tf-border-strong);
}

/* User Dropdown Dialogue Card */
.tf-user-dropdown,
.tf-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 285px;
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
  padding: 8px;
  overflow: hidden;
  pointer-events: none;
}

.tf-user-dropdown.show,
.tf-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

[data-theme="light"] .tf-user-dropdown,
[data-theme="light"] .tf-dropdown-menu {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

.tf-user-dropdown-header,
.tf-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 6px;
}

.tf-user-dropdown-header .tf-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.tf-user-dropdown-header .tf-user-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--tf-text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.tf-user-dropdown-header .tf-plan-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tf-emerald);
  background: var(--tf-emerald-soft);
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 3px;
}

.tf-dropdown-head-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--tf-text-main);
}

.tf-dropdown-head-sub {
  font-size: 0.74rem;
  color: var(--tf-text-muted);
  margin-top: 2px;
}

.tf-dropdown-head-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
}

.tf-user-dropdown-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
}

.tf-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tf-text-main);
  text-decoration: none;
  border-radius: var(--tf-radius-sm);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tf-dropdown-item:hover {
  background: var(--tf-bg-surface);
  color: var(--tf-emerald);
}

.tf-dropdown-item svg {
  color: var(--tf-text-muted);
  flex-shrink: 0;
  transition: color 0.15s;
}

.tf-dropdown-item:hover svg {
  color: var(--tf-emerald);
}

.tf-dropdown-item.danger {
  color: var(--tf-rose);
}

.tf-dropdown-item.danger svg {
  color: var(--tf-rose);
}

.tf-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--tf-rose);
}

.tf-dropdown-divider {
  border: none;
  border-top: 1px solid var(--tf-border);
  margin: 6px 0;
}

.tf-user-dropdown-footer {
  padding-top: 2px;
}

/* ==========================================================================
   TOPBAR NOTIFICATIONS
   ========================================================================== */
.tf-notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tf-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-lg);
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.tf-notif-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tf-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tf-border);
  background: var(--tf-bg-surface);
}

.tf-notif-head-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--tf-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tf-notif-body {
  max-height: 320px;
  overflow-y: auto;
}

.tf-notif-empty {
  padding: 32px 20px;
  text-align: center;
}

.tf-notif-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--tf-emerald-soft);
  color: var(--tf-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.tf-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tf-border);
  transition: background 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.tf-notif-item:hover {
  background: var(--tf-bg-surface);
}
.tf-notif-item:last-child {
  border-bottom: none;
}
.tf-notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tf-notif-item-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.tf-notif-item-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.tf-notif-item-icon.info {
  background: rgba(37, 99, 235, 0.15);
  color: #3b82f6;
}
.tf-notif-item-content {
  flex: 1;
  min-width: 0;
}
.tf-notif-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tf-text-main);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tf-notif-item-msg {
  font-size: 0.76rem;
  color: var(--tf-text-muted);
  line-height: 1.35;
}
.tf-notif-item-time {
  font-size: 0.68rem;
  color: var(--tf-text-dim);
  margin-top: 4px;
}

.tf-notif-foot {
  padding: 8px 16px;
  background: var(--tf-bg-surface);
  border-top: 1px solid var(--tf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   COMPACT SIDEBAR PLAN WIDGET
   ========================================================================== */
.tf-plan-widget.compact {
  padding: 12px 14px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--tf-radius-md);
}

.tf-plan-widget.compact .tf-plan-header {
  margin-bottom: 6px;
}

.tf-plan-widget.compact .tf-plan-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--tf-text-main);
  margin-bottom: 6px;
}

.tf-plan-widget.compact .tf-plan-meter-label {
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.tf-plan-widget.compact .tf-plan-meter-track {
  height: 4px;
  margin-bottom: 8px;
}

.tf-plan-widget.compact .tf-plan-upgrade-btn {
  padding: 6px 10px;
  font-size: 0.74rem;
  border-radius: var(--tf-radius-sm);
  background: var(--tf-sapphire, #2563eb);
  color: #fff;
  border: none;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  transition: background 0.2s;
}

.tf-plan-widget.compact .tf-plan-upgrade-btn:hover {
  background: var(--tf-sapphire-hover, #1d4ed8);
}

/* ==========================================================================
   LIVE DELIVERY TRACKING & TELEMETRY HUD MAP STAGE
   ========================================================================== */
.tf-tracking-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 1024px) {
  .tf-tracking-wrapper {
    grid-template-columns: 1fr;
  }
}

.tf-map-stage {
  position: relative;
  width: 100%;
  height: 480px;
  background: #0b0f19;
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6);
}

.tf-map-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.tf-telemetry-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  gap: 20px;
  z-index: 10;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.tf-telemetry-hud-item {
  display: flex;
  flex-direction: column;
}

.tf-hud-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.tf-hud-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.tf-map-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  gap: 14px;
  z-index: 10;
}

.tf-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

/* 5-Stage Delivery Milestone Progression Stepper */
.tf-milestone-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 18px;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-md);
  padding: 16px;
}

@media (max-width: 768px) {
  .tf-milestone-stepper {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.tf-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.tf-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tf-bg-card);
  border: 2px solid var(--tf-border);
  color: var(--tf-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  z-index: 2;
  transition: all 0.3s;
}

.tf-step-node.completed .tf-step-circle {
  background: var(--tf-emerald);
  border-color: var(--tf-emerald);
  color: #fff;
}

.tf-step-node.active .tf-step-circle {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

.tf-step-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tf-text-main);
  margin-bottom: 2px;
}

.tf-step-time {
  font-size: 0.68rem;
  color: var(--tf-text-muted);
}

/* ==========================================================================
   BARCODE DISPATCH DESK
   ========================================================================== */
.tf-scanner-desk {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  padding: 24px;
}

.tf-scanner-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .tf-scanner-grid {
    grid-template-columns: 1fr;
  }
}

.tf-scanner-viewfinder {
  position: relative;
  width: 100%;
  height: 220px;
  background: #000;
  border: 2px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.tf-scanner-laser {
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--tf-rose);
  box-shadow: 0 0 10px var(--tf-rose);
  animation: tfSweep 2.2s infinite ease-in-out;
  z-index: 5;
}

@keyframes tfSweep {
  0%, 100% { transform: translateY(-60px); }
  50% { transform: translateY(60px); }
}

/* ==========================================================================
   MODERN UPGRADE MODAL & BILLING SWITCHER
   ========================================================================== */
.tf-billing-toggle {
  display: inline-flex;
  background: var(--tf-bg-surface);
  border: 1px solid var(--tf-border);
  border-radius: 999px;
  padding: 3px;
  margin: 0 auto 20px;
}

.tf-cycle-btn {
  background: transparent;
  border: none;
  color: var(--tf-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tf-cycle-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.tf-badge-discount {
  background: #10b981;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tf-modern-plan-card {
  background: var(--tf-bg-surface);
  border: 2px solid var(--tf-border);
  border-radius: var(--tf-radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tf-modern-plan-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.tf-modern-plan-card.selected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 1px #2563eb;
}

.tf-modern-plan-card.popular::before {
  content: "MOST POPULAR";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 999px;
}

