/* ==========================================================================
   HỆ THỐNG 4 CAMERA AI TRẠM CÂN BÊ TÔNG NAM PHONG GIA LAI
   Design System: Modern SaaS Clean Dashboard (UI_STYLE_GUIDE.md)
   Philosophy: "AI Tech + Clean Business Productivity"
   Typography: Be Vietnam Pro + JetBrains Mono
   ========================================================================== */

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

/* --- 1. DESIGN TOKENS (UI_STYLE_GUIDE.md Section 2) --- */
:root {
  /* Brand & Signature Accents */
  --brand-orange: #FD6900;
  --brand-orange-light: #FF8533;
  --brand-coral: #FF647E;
  --brand-blue: #006AFF;
  --brand-blue-light: #388AFF;
  --brand-emerald: #10B981;
  --brand-rose: #F43F5E;
  --brand-amber: #F59E0B;
  --brand-purple: #8B5CF6;

  /* Surfaces & Neutrals (Light Clean Theme) */
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F8FAFC;
  --bg-card-hover: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-video: #0B1120;

  /* Borders */
  --border-card: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-subtle-darker: #CBD5E1;
  --border-glow: rgba(253, 105, 0, 0.35);
  --border-focus: #FD6900;

  /* Typography & Text */
  --text-main: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --text-orange: #FD6900;
  --text-blue: #006AFF;
  --text-emerald: #10B981;

  /* Typography System */
  --font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-main: var(--font-family);
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-orange: 0 3px 10px rgba(253, 105, 0, 0.3);
  --shadow-blue: 0 3px 10px rgba(0, 106, 255, 0.3);
  --shadow-modal: 0 20px 45px rgba(15, 23, 42, 0.2);

  /* Component Status Aliases */
  --primary: var(--brand-orange);
  --primary-hover: var(--brand-orange-light);
  --primary-subtle: rgba(253, 105, 0, 0.1);
  --primary-border: rgba(253, 105, 0, 0.3);

  --success: var(--brand-emerald);
  --success-subtle: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.25);

  --warning: var(--brand-amber);
  --warning-subtle: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.25);

  --danger: var(--brand-rose);
  --danger-subtle: rgba(244, 63, 94, 0.1);
  --danger-border: rgba(244, 63, 94, 0.25);

  /* Corner Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --glass-blur: blur(12px);
}

/* --- 2. GLOBAL RESET & BASE LAYOUT --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-page);
  background-image: linear-gradient(180deg, #F1F5F9 0%, #F8FAFC 300px);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* --- 3. TOP NAVIGATION HEADER (48px) --- */
header.header {
  height: 48px;
  min-height: 48px;
  background: var(--bg-header);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-card);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-coral) 50%, var(--brand-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(253, 105, 0, 0.35);
}

.logo-badge svg {
  width: 18px;
  height: 18px;
  fill: #FFFFFF;
}

.title-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.brand-gradient {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

/* Header Center: Clock Widget */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.clock-widget {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.clock-widget #live-clock {
  color: var(--brand-orange);
  font-weight: 800;
}

.clock-divider {
  color: var(--text-dim);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid var(--border-card);
  background: #FFFFFF;
}

.chip-live {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--brand-emerald);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-emerald);
  box-shadow: 0 0 6px var(--brand-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.ai-status-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.ai-status-pill:hover {
  border-color: var(--brand-orange);
  box-shadow: 0 2px 8px rgba(253, 105, 0, 0.2);
  transform: translateY(-1px);
}

.ai-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-emerald);
}

.btn-nav {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-nav:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  transform: translateY(-1px);
}

.btn-nav-icon {
  width: 32px;
  height: 32px;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-nav-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  transform: translateY(-1px);
}

.badge-counter {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-coral));
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* --- 4. DASHBOARD 2-COLUMN MAIN LAYOUT --- */
.dashboard-main-layout {
  height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 8px;
  padding: 8px 10px;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

/* LEFT COLUMN: QUAD CAMERA CONTAINER (SEAMLESS FIT 100%, KHÔNG VIỀN ĐEN) */
main.quad-camera-container {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

.camera-card {
  position: relative;
  background: #000000;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  width: 100%;
  height: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.camera-card:hover {
  border-color: rgba(253, 105, 0, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* FLOATING TRANSLUCENT HUD OVERLAY (Không chiếm diện tích, video tràn 100%) */
.camera-header-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

.camera-title-pill,
.camera-tools-pill {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cam-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(253, 105, 0, 0.25);
  border: 1px solid rgba(253, 105, 0, 0.5);
  color: #FF8A3D;
}

.cam-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.cam-ai-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cam-ai-tag:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #FFFFFF;
}

.fps-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.btn-cam-tool {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cam-tool:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #FFFFFF;
  transform: scale(1.1);
}

/* Video Wrapper Viewport (100% Edge-to-Edge) */
.video-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Reticle AI Corners (UI_STYLE_GUIDE.md Section 6.3) */
.video-wrapper::before,
.video-wrapper::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 4;
}

.video-wrapper::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid var(--brand-orange);
  border-left: 2px solid var(--brand-orange);
}

.video-wrapper::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 2px solid var(--brand-orange);
  border-right: 2px solid var(--brand-orange);
}

/* 100% SEAMLESS FIT KHÍT KHÔNG VIỀN ĐEN */
.video-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.video-container img,
.video-container iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 8px;
}

.hud-live-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-live-tag .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-rose);
  box-shadow: 0 0 6px var(--brand-rose);
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

/* --- 5. RIGHT SIDEBAR COCKPIT (Clean Modern SaaS Console) --- */
.cockpit-sidebar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  box-sizing: border-box;
}

.cockpit-sidebar::-webkit-scrollbar {
  width: 4px;
}

.cockpit-sidebar::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}

.cockpit-panel-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cockpit-panel-card:hover {
  border-color: rgba(253, 105, 0, 0.35);
  box-shadow: var(--shadow-md);
}

.panel-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 22px;
}

.panel-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.panel-card-title svg {
  color: var(--brand-orange);
}

/* Authentic Vietnamese License Plate Styling */
.plate-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}

.plate-badge {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #0F172A;
  background: #FFFFFF;
  border: 2px solid #0F172A;
  border-radius: 6px;
  padding: 2px 14px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  display: inline-block;
  line-height: 1.2;
  position: relative;
}

.plate-badge::before, .plate-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94A3B8;
  border: 1px solid #475569;
}
.plate-badge::before { left: 4px; }
.plate-badge::after { right: 4px; }

.plate-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.vehicle-model-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  border-top: 1px dashed var(--border-card);
  font-size: 0.68rem;
}

.flow-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.68rem;
  color: var(--brand-orange);
}

.station-pill {
  color: var(--text-muted);
  font-weight: 600;
}

/* Direction Badge (IN / OUT) */
.direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.direction-badge.in {
  background: rgba(0, 106, 255, 0.1);
  border: 1px solid rgba(0, 106, 255, 0.3);
  color: var(--brand-blue);
}

.direction-badge.out {
  background: rgba(253, 105, 0, 0.1);
  border: 1px solid rgba(253, 105, 0, 0.3);
  color: var(--brand-orange);
}

.direction-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Card 2: Scale Metric Display */
.scale-hero-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
}

.scale-metric-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.scale-number {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--brand-emerald);
  letter-spacing: -0.02em;
  line-height: 1;
}

.scale-unit {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand-emerald);
  opacity: 0.85;
}

.scale-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid var(--border-card);
}

.sub-metric-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sub-label {
  font-size: 0.60rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sub-val {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-main);
}

.text-emerald {
  color: var(--brand-emerald) !important;
}

/* Card 3: Cargo & Reconcile */
.cargo-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cargo-tag {
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

.cargo-tag.loaded {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--brand-emerald);
}

.cargo-tag.empty {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--brand-amber);
}

.material-name-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Card 4: Compact 5-Step Stepper */
.clean-stepper-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  width: 100%;
}

.clean-stepper-compact .step-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.clean-stepper-compact .step-pill span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #E2E8F0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.clean-stepper-compact .step-pill.active {
  background: rgba(253, 105, 0, 0.1);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.clean-stepper-compact .step-pill.active span {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-coral));
  color: #FFFFFF;
}

.clean-stepper-compact .step-pill.done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--brand-emerald);
}

.clean-stepper-compact .step-pill.done span {
  background: var(--brand-emerald);
  color: #FFFFFF;
}

.clean-stepper-compact .step-line {
  flex: 1;
  height: 2px;
  background: var(--border-card);
  min-width: 4px;
}

/* Card 5: Simulator Buttons Grid */
.sim-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-coral) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-family);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(253, 105, 0, 0.45);
}

.blue-btn {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-light) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-family);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.blue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 106, 255, 0.45);
}

.secondary-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  transform: translateY(-1px);
}

.meta-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.meta-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: translateY(-1px);
}

.sim-status-banner {
  background: #FFFFFF;
  border: 1px solid var(--brand-orange);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-orange);
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}

.spinner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 8px var(--brand-orange);
  animation: pulseDot 1.2s infinite;
}

/* --- Simulator Section Labels & Warning Grid --- */
.sim-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 6px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.text-warning-label {
  color: #ea580c;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sim-warning-box {
  background: rgba(254, 242, 242, 0.5);
  border: 1px dashed rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-top: 6px;
}

.sim-warn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.warn-sim-btn {
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-warn-plate {
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #d97706;
}
.btn-warn-plate:hover {
  background: #fffbeb;
  border-color: #d97706;
  transform: translateY(-1px);
}

.btn-warn-cargo {
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #ea580c;
}
.btn-warn-cargo:hover {
  background: #fff7ed;
  border-color: #ea580c;
  transform: translateY(-1px);
}

.btn-warn-reconcile {
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #e11d48;
}
.btn-warn-reconcile:hover {
  background: #fff1f2;
  border-color: #e11d48;
  transform: translateY(-1px);
}

.btn-warn-weight {
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #dc2626;
}
.btn-warn-weight:hover {
  background: #fef2f2;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.btn-warn-fire {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.btn-warn-fire:hover {
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.55);
  transform: translateY(-1px);
}

.btn-badge-toggle {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-badge-toggle:hover {
  background: rgba(239, 68, 68, 0.16);
}

/* Warning & Danger UI States for Cockpit Cards */
.plate-badge.plate-error {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  background: rgba(254, 242, 242, 0.9) !important;
  animation: pulseBorder 1.2s infinite;
}

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

.cargo-tag.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #dc2626;
  animation: pulseBorder 1.2s infinite;
}

.chip-danger {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  font-weight: 800 !important;
}

.sim-status-banner.is-anomaly {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

.sim-status-banner.is-anomaly .spinner-dot {
  background: #dc2626 !important;
  box-shadow: 0 0 8px #dc2626 !important;
}

/* RESPONSIVE LAYOUT FOR MOBILE & TABLET */
@media (max-width: 1024px) {
  .dashboard-main-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  main.quad-camera-container {
    height: 600px;
  }
}


/* --- 6. MODALS STYLING (Modern Clean White Dialogs) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.2s var(--ease-spring);
  overflow: hidden;
}

@keyframes modalPop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 14px 20px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--brand-rose);
  border-color: var(--brand-rose);
  color: #FFFFFF;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #FFFFFF;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(253, 105, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-coral) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-family);
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(253, 105, 0, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

/* Trips Table Modal Styling */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.kpi-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.table-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-card);
}

.input-search {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  color: var(--text-main);
  width: 240px;
}

.select-filter {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  color: var(--text-main);
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.data-table th {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card-subtle);
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
