/* ==========================================================================
   DISHUB COMMAND CENTER — 100% LIGHT MODE DESIGN SYSTEM
   Standar Resmi Instansi Pemerintah: Bersih, Elegan, Berwibawa & Kontras Tinggi
   (Sesuai Aturan Ketat 7A & Larangan Mutlak GEMINI.md: DILARANG KERAS DARK MODE)
   ========================================================================== */

/* Local Fonts (Offline - Aturan 7A.1 GEMINI.md) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-700.woff2') format('woff2');
}

/* Light Theme Variables */
:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  
  --border-card: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;
  
  --primary: #1e40af;       /* Dishub Navy Blue */
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-emerald: #059669; /* Status Lancar */
  --accent-amber: #d97706;   /* Status Padat */
  --accent-orange: #ea580c;
  --accent-rose: #dc2626;    /* Status Macet */
  
  --text-main: #0f172a;      /* Slate 900 — Sangat tajam & jelas */
  --text-muted: #334155;     /* Slate 700 */
  --text-dim: #64748b;       /* Slate 500 */
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Status Bar Resmi Command Center */
.simulation-banner {
  background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 50%, #eff6ff 100%);
  color: #1e40af;
  border-bottom: 1px solid #dbeafe;
  padding: 7px 16px;
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  letter-spacing: 0.2px;
}

/* Header Bar Command Center */
.header-bar {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.85rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.25);
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.25px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-instansi {
  font-size: 0.68rem;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #bfdbfe;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-lapangan {
  font-size: 0.65rem;
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid #bfdbfe;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-titles p {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #a7f3d0;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.client-ip-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: #1e3a8a;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.server-clock {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e40af;
  background: #f8fafc;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Regional Filter Navigation */
.nav-filters {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.filter-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.filter-btn.active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

/* Dashboard Flow Layout (Kamera di Atas, Dua Kolom di Bawah - Proporsional & Elegan) */
.dashboard-flow,
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  max-width: 1720px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}

.camera-hero-section {
  width: 100%;
  box-sizing: border-box;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.camera-viewport-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(440px, 1fr);
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .camera-viewport-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.left-section, .right-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* White Panels */
.glass-panel {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.glass-panel:hover {
  border-color: #cbd5e1;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  border: none;
  padding: 0;
}

.panel-title i {
  color: #1e40af;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Intersection Select Bar */
.intersection-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.select-wrapper {
  flex: 1;
}

.custom-select {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.action-btn {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #dbeafe;
  color: #1e40af;
}

/* Video & Canvas Stream Container (CCTV Broadcast Quality - Widescreen & Proporsional) */
.stream-container {
  position: relative;
  width: 100%;
  max-width: 1040px;
  aspect-ratio: 16 / 9;
  max-height: 520px;
  margin: 0 auto;
  background: #0b1120;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.stream-live-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* CCTV Broadcast HUD Header (Terpadu & Tidak Berdempetan) */
.cctv-hud-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.88) 0%, rgba(11, 17, 32, 0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  pointer-events: none;
  z-index: 10;
}

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

.hud-title {
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-ring 1.5s infinite;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
}

.hud-pill {
  background: rgba(30, 64, 175, 0.75);
  color: #bfdbfe;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid rgba(191, 219, 254, 0.4);
}

/* CCTV Broadcast HUD Footer */
.cctv-hud-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34px;
  background: linear-gradient(0deg, rgba(11, 17, 32, 0.88) 0%, rgba(11, 17, 32, 0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  pointer-events: none;
  z-index: 10;
}

.hud-cam-name {
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.hud-status-live {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(6, 78, 59, 0.65);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

/* Quick Control Bar under Stream */
.quick-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem auto 0;
  max-width: 1040px;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* KPI Cards Row & Grid - 4 Kolom Sejajar Horizontal */
.kpi-row,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .kpi-row,
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 84px;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e2e8f0;
}

.kpi-card.los-a::before { background: #059669; }
.kpi-card.los-b::before { background: #10b981; }
.kpi-card.los-c::before { background: #0284c7; }
.kpi-card.los-d::before { background: #d97706; }
.kpi-card.los-e::before { background: #ea580c; }
.kpi-card.los-f::before { background: #dc2626; }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.2rem;
}

.kpi-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 0.25rem;
}

.los-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: #f1f5f9;
  color: #1e40af;
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-footer {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Vehicle Breakdown Pills */
.vehicle-class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .vehicle-class-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.class-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.class-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.class-info {
  display: flex;
  flex-direction: column;
}

.class-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.class-count {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* ANPR Plate Live Feed Ticker */
.anpr-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.anpr-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.anpr-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.anpr-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.plate-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* Light Theme Plate Color Badges */
.plate-badge.plate-putih {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #0f172a;
}

.plate-badge.plate-kuning {
  background: #fef08a;
  color: #713f12;
  border: 2px solid #ca8a04;
}

.plate-badge.plate-merah {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #dc2626;
}

.anpr-details {
  display: flex;
  flex-direction: column;
}

.anpr-meta-top {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.anpr-meta-bottom {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.anpr-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-track {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-track:hover {
  background: #dbeafe;
  color: #1e40af;
}

/* Journey Tracker Search Bar */
.journey-search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.input-plate-search {
  flex: 1;
  padding: 0.65rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  text-transform: uppercase;
  outline: none;
}

.input-plate-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-search-plate {
  background: #1e40af;
  border: 1px solid #1e40af;
  color: #ffffff;
  padding: 0 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-search-plate:hover {
  background: #1d4ed8;
}

/* Hourly Traffic Stats Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.traffic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: #ffffff;
}

.traffic-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  text-align: right;
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.traffic-table th:first-child,
.traffic-table th:last-child {
  text-align: center;
}

.traffic-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.traffic-table td:first-child {
  text-align: center;
  font-weight: 700;
  color: #1e40af;
}

.traffic-table td:last-child {
  text-align: center;
}

.traffic-table tbody tr:hover {
  background: #f8fafc;
}

/* Excel Export Section */
.export-panel-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.export-desc h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.export-desc p {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.btn-export-excel {
  background: #059669;
  border: 1px solid #059669;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-export-excel:hover {
  background: #047857;
}

/* Modal Journey Tracker */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h3 i {
  color: #1e40af;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.timeline-track {
  position: relative;
  padding-left: 24px;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: #cbd5e1;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1e40af;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #cbd5e1;
}

.timeline-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.timeline-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ==========================================================================
   HALAMAN LOGIN (100% LIGHT THEME RESMI - ZERO SCROLL)
   ========================================================================== */
html:has(.login-body), body.login-body {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.login-body {
  background: #f1f5f9;
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 64, 175, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(5, 150, 105, 0.06) 0px, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-elevated);
}

.login-header {
  text-align: center;
  margin-bottom: 0.85rem;
}

.login-badge-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin: 0 auto 0.5rem auto;
  box-shadow: 0 4px 8px rgba(30, 64, 175, 0.25);
}

.login-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.login-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e40af;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-desc {
  display: none;
}

.login-security-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.login-security-notice i {
  color: #1d4ed8;
  font-size: 0.85rem;
}

.login-cred-hint {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.login-cred-hint i {
  color: #15803d;
  font-size: 0.85rem;
}

.login-cred-hint .cred-sep {
  margin: 0 0.25rem;
  color: #86efac;
}

.login-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-label i {
  color: #1e40af;
}

.form-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: #0f172a;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-login-submit {
  background: #1e40af;
  border: none;
  color: #ffffff;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.25);
  margin-top: 0.35rem;
}

.btn-login-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.35);
}

.btn-login-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.login-footer {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.footer-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.footer-copyright {
  font-size: 0.65rem;
  color: #94a3b8;
}

/* ==========================================================================
   APP LAYOUT DENGAN SIDEBAR NAVIGASI (MENU WAJIB SIDEBAR)
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* SIDEBAR KIRI */
.app-sidebar {
  width: 250px;
  min-width: 250px;
  background: #ffffff;
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
  z-index: 100;
}

.sidebar-brand-box {
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--border-card);
}

.sidebar-brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
}

.sidebar-status-tag {
  margin-top: 0.65rem;
}

/* MENU NAVIGASI SIDEBAR */
.sidebar-menu {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  color: #475569;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-nav-item i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-nav-item:hover i {
  color: #1e40af;
}

.sidebar-nav-item.active {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
  font-weight: 700;
}

.sidebar-nav-item.active i {
  color: #1e40af;
}

/* FOOTER SIDEBAR */
.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-card);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: #e2e8f0;
  color: #1e40af;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.btn-sidebar-logout {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #dc2626;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-sidebar-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* MAIN CONTENT WRAPPER */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

/* TOP STATUS BAR (Solid, Non-Wrapping, Responsive) */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-card);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  min-height: 56px;
  box-sizing: border-box;
}

.brand-titles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-shrink: 0;
}

.brand-titles h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.25px;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap !important;
  margin: 0;
}

.brand-titles .tag-instansi,
.brand-titles .badge-live-feed {
  white-space: nowrap !important;
  flex-shrink: 0;
}

.topbar-status-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.client-ip-badge,
.server-clock,
.live-indicator {
  white-space: nowrap !important;
  flex-shrink: 0;
}

@media (max-width: 1150px) {
  .brand-titles .badge-live-feed {
    display: none;
  }
}

@media (max-width: 900px) {
  .brand-titles .tag-instansi {
    display: none;
  }
}

/* VIEW PANES */
.view-pane {
  display: none;
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.view-pane.active {
  display: block;
}

/* KONTROL IDENTIFIKASI AI (MANUAL VS OTOMATIS) */
.ai-control-box {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}

.ai-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.ai-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-title-wrap h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.ai-control-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-ai-action {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-ai-manual {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.btn-ai-manual:hover {
  background: #dbeafe;
}

.btn-ai-start {
  background: #059669;
  color: #ffffff;
}
.btn-ai-start:hover {
  background: #047857;
}

.btn-ai-stop {
  background: #dc2626;
  color: #ffffff;
}
.btn-ai-stop:hover {
  background: #b91c1c;
}

.storage-pill {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.storage-pill strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.btn-clean-disk {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-clean-disk:hover {
  background: #fee2e2;
}

/* MANAJEMEN PENGGUNA */
.users-table-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.users-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.custom-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--border-card);
}

.custom-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-superadmin {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.role-operator {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.role-supervisor {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

.status-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.btn-table-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 0.3rem;
}

.btn-table-action:hover {
  background: #f1f5f9;
}

.btn-table-delete {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-table-delete:hover {
  background: #fee2e2;
}

/* MODAL DIALOG (100% LIGHT THEME) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: var(--shadow-elevated);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
}

/* ==========================================================================
   DESAIN ELEGAN DATABASE PLAT NOMOR TERDETEKSI (LIVE ANPR FEED)
   Standar Command Center: Bebas Gambar Rusak, Tampilan Kartu Bersih & Jelas
   ========================================================================== */

.badge-live-feed {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.plate-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.plate-feed-list::-webkit-scrollbar {
  width: 6px;
}

.plate-feed-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.plate-feed-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.plate-feed-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.plate-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 72px;
  flex-shrink: 0 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.plate-item:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.plate-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #2563eb;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.plate-item:hover::before {
  opacity: 1;
}

/* Plat Nomor Visual Box (Standar Plat Nomor Indonesia: Proporsional & Anti-Overflow) */
.plate-preview-box {
  flex-shrink: 0;
  width: 82px;
  min-width: 82px;
  height: 44px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2px 4px;
  position: relative;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.plate-preview-box.plate-bg-white {
  background: #ffffff;
  border-color: #0f172a;
}

.plate-preview-box.plate-bg-yellow {
  background: #fef08a;
  border-color: #854d0e;
}

.plate-preview-box.plate-bg-red {
  background: #dc2626;
  border-color: #991b1b;
}

.plate-visual-code {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.1;
  text-align: center;
}

.plate-bg-white .plate-visual-code {
  color: #0f172a;
}

.plate-bg-yellow .plate-visual-code {
  color: #854d0e;
}

.plate-bg-red .plate-visual-code {
  color: #ffffff;
}

.plate-visual-sub {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.52rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

.plate-bg-white .plate-visual-sub {
  color: #64748b;
}

.plate-bg-yellow .plate-visual-sub {
  color: #a16207;
}

.plate-bg-red .plate-visual-sub {
  color: #fecaca;
}

.plate-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: none;
}

/* Plate Metadata & Structured 2-Row Layout (Anti-Wrap & Anti-Collision) */
.plate-content-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.plate-row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.plate-text-code {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap !important;
}

.plate-tag-color {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap !important;
}

.plate-tag-color.PUTIH {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.plate-tag-color.HITAM {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #0f172a;
}

.plate-tag-color.KUNING {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.plate-tag-color.MERAH {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.plate-vehicle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap !important;
}

.plate-confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap !important;
}

.plate-confidence.source-cam {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.plate-confidence.source-sim {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.plate-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #64748b;
  min-width: 0;
}

.plate-location-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  color: #475569;
  font-weight: 500;
}

.plate-location-item i {
  color: #2563eb;
  flex-shrink: 0;
}

.plate-telemetry-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.plate-speed {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ecfdf5;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #a7f3d0;
  white-space: nowrap !important;
}

.plate-time {
  font-size: 0.7rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
}

/* Form Search Input Group (Pelacak Rute & Laporan) */
.search-input-group {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  max-width: 540px;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 1rem;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#dedicated-journey-input {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  letter-spacing: 0.03em;
}

#btn-dedicated-search {
  height: 44px;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: #1e40af;
  color: #ffffff;
  border: 1px solid #1e3a8a;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
}

#btn-dedicated-search:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* Primary Action Buttons */
.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #1e40af;
  color: #ffffff;
  border: 1px solid #1e3a8a;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
}

.btn-primary-action:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.28);
}

/* Modal Form Buttons */
.btn-modal-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-modal-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #1e40af;
  color: #ffffff;
  border: 1px solid #1e3a8a;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

.btn-modal-submit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.35);
}

/* Quick Suggested Plate Chips */
.chip-plate-btn {
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  color: #1e40af;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chip-plate-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

/* Journey Corridor Timeline */
.journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  margin-top: 1.25rem;
  padding-left: 2rem;
}

.journey-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: #bfdbfe;
}

.journey-step {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.journey-step-marker {
  position: absolute;
  left: -2rem;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e40af;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #93c5fd;
  z-index: 2;
}

.journey-step-card {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.journey-step-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 10px rgba(30, 64, 175, 0.06);
}

/* Reports Summary Cards */
.reports-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .reports-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.report-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.report-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #1e40af;
}

.report-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.45rem;
}

.report-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.report-stat-sub {
  font-size: 0.76rem;
  color: #475569;
  margin-top: 0.35rem;
  font-weight: 500;
}

/* Action Icons */
.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.8rem;
}

.btn-user-toggle {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-user-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-user-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-user-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

