/* ── GLOBAL ANPR / TRAFFICGUARD CORE STYLES ── */
:root {
  /* Dark Mode Variables (Default) */
  --navy: #060d1a;
  --navy2: #0a1525;
  --panel: #0d1b2e;
  --border: #162840;
  --text: #e2e8f0;
  --sub: #94a3b8;
  --muted: #64748b;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  /* Accents */
  --accent: #f59e0b;
  --danger: #ef4444;
  --teal: #0ea5e9;
  --green: #22c55e;
  --purple: #a855f7;
  --pink: #ec4899;
  --orange: #f97316;
  --footer-h: 30px;
}

body.light-mode {
  /* Light Mode Variables - Ultimate AI Cyber-Light Aesthetic */
  --navy: #f8fafc;
  --navy2: #f1f5f9;
  --panel: rgba(255, 255, 255, 0.75);
  --border: rgba(212, 224, 241, 0.6);
  --text: #0f1e36;
  --sub: #4b5e7d;
  --muted: #8295b0;
  --card-shadow: 0 10px 30px rgba(79, 70, 229, 0.04), 0 1px 8px rgba(0, 0, 0, 0.02);

  /* Cyber/AI Light Accent Colors (Highly Contrast & Vibrant) */
  --accent: #4f46e5;
  /* Indigo AI primary */
  --danger: #ef4444;
  /* Vibrat Red */
  --teal: #06b6d4;
  /* Neon Teal */
  --green: #10b981;
  /* Vibrant Emerald */
  --purple: #8b5cf6;
  /* Royal Violet */
  --pink: #ec4899;
  /* AI Cyber Pink */
  --orange: #f97316;
  /* Electric Orange */
}

/* ── AI MESH GRADIENT BACKGROUND ── */
body.light-mode {
  background: radial-gradient(at 0% 0%, #f5f3ff 0px, transparent 50%),
    radial-gradient(at 50% 0%, #eff6ff 0px, transparent 50%),
    radial-gradient(at 100% 0%, #f0fdfa 0px, transparent 50%),
    #f8fafc !important;
}

/* ── LIGHT MODE GLASSMORPHISM PANELS ── */
body.light-mode .panel,
body.light-mode .search-panel {
  background: var(--panel) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--border) !important;
  box-shadow: var(--card-shadow) !important;
}

body.light-mode .ph {
  background: rgba(255, 255, 255, 0.4) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* ── LIGHT MODE GLASSMORPHIC TOPBAR ── */
body.light-mode .topbar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(243, 246, 250, 0.8)) !important;
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(110%);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.03) !important;
}

/* ── LIGHT MODE TAB OVERRIDES ── */
body.light-mode .nav-tab.active {
  color: var(--accent) !important;
}

body.light-mode .nav-tab.active::after {
  background: linear-gradient(90deg, #4f46e5, #ec4899) !important;
  /* Elegant Indigo-Pink Gradient Underline */
}

body.light-mode .header-clock {
  background: rgba(79, 70, 229, 0.03) !important;
  border-color: rgba(79, 70, 229, 0.15) !important;
}

body.light-mode .header-clock:hover {
  border-color: rgba(79, 70, 229, 0.35) !important;
}

body.light-mode .logo-text span {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

html,
body {
  height: 100vh;
  overflow: hidden;
  background: var(--navy);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  transition: background 0.3s, color 0.3s;
  padding-bottom: var(--footer-h);
}

/* ── TOPBAR ── */
.topbar {
  height: 50px;
  background: linear-gradient(90deg, var(--navy), var(--navy2));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1030;
}

.logo {
  display: flex;
  align-items: center;
  gap: .2rem !important;
  text-decoration: none;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 1px;
}

/* ── HEADER DIVIDER (thin vertical separator after logo) ── */
.header-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
  margin: 0 2px;
}

/* ── BILINGUAL SYSTEM TITLE (নিরীক্ষণ | Nirikhon) ── */
.header-system-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  line-height: 1.15;
  font-size: 14px;
  font-weight: 900;
}

.hst-bn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  white-space: nowrap;
}

.hst-en {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--sub);
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy2);

  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

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

.logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--text);
}

.logo-text span {
  color: var(--accent);
}

.logo-sub {
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--sub);
  text-transform: uppercase;
}

.topbar-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  margin-bottom: 1px;
}

/* ── LIVE CLOCK IN HEADER ── */
.header-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.2;
  cursor: default;
  transition: border-color 0.2s;
}

.header-clock:hover {
  border-color: rgba(245, 158, 11, 0.35);
}

body.light-mode .header-clock {
  background: rgba(0, 0, 0, 0.03);
}

.hc-date {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--sub);
  white-space: nowrap;
}

.hc-time {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.ib {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.ib:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.ib.bell {
  position: relative;
}

.ib.bell::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--navy2);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(14, 165, 233, 0.4);
}

.avatar-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.avatar-trigger {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 55, 0.92);
  background: rgba(7, 11, 18, 0.98);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 1070;
}

.avatar-menu.open .avatar-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.avatar-drop-head {
  padding: 4px 6px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.82);
  margin-bottom: 8px;
}

.avatar-drop-name {
  color: #eff6ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.avatar-drop-email {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
  word-break: break-all;
}

.avatar-drop-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #dbe4f0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}

.avatar-drop-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.avatar-drop-item i {
  width: 14px;
  color: #7dd3fc;
}

.avatar-drop-item.danger i {
  color: #fb7185;
}

.avatar-drop-form {
  margin: 0;
}

body.light-mode .avatar-dropdown {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(202, 214, 232, 0.96);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

body.light-mode .avatar-drop-head {
  border-bottom-color: rgba(202, 214, 232, 0.9);
}

body.light-mode .avatar-drop-name {
  color: #0f1e36;
}

body.light-mode .avatar-drop-email {
  color: #64748b;
}

body.light-mode .avatar-drop-item {
  color: #1e293b;
}

body.light-mode .avatar-drop-item:hover {
  background: rgba(31, 103, 246, 0.07);
  color: #0f172a;
}

body.light-mode .avatar-drop-item i {
  color: #1f67f6;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--danger);
  text-transform: uppercase;
}

.dot-r {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

/* ── HORIZONTAL NAVBAR TABS (shown on all pages except Dashboard) ── */
.nav-tabs-c {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  overflow: hidden;
  align-self: center;
  padding: 5px 10px 4px;
  margin-inline: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--sub);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-tab i {
  font-size: 11px;
  opacity: 0.92;
}

.nav-tab:hover {
  color: var(--text);
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.22);
  background: linear-gradient(135deg, rgba(31, 103, 246, 0.10), rgba(141, 77, 232, 0.08));
  box-shadow: 0 10px 20px rgba(31, 103, 246, 0.10);
}

body.light-mode .nav-tab:hover {
  background: linear-gradient(135deg, rgba(31, 103, 246, 0.07), rgba(141, 77, 232, 0.06));
  color: var(--text);
}

.nav-tab.active {
  color: var(--accent);
  background: linear-gradient(135deg, rgba(31, 103, 246, 0.16), rgba(141, 77, 232, 0.14));
  border-color: rgba(31, 103, 246, 0.28);
  box-shadow: 0 12px 24px rgba(31, 103, 246, 0.14);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  inset: auto 12px 5px 12px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f67f6, #8d4de8);
  opacity: 0.95;
}

body.light-mode .nav-tab.active {
  background: linear-gradient(135deg, rgba(31, 103, 246, 0.12), rgba(141, 77, 232, 0.10));
  border-color: rgba(31, 103, 246, 0.20);
  box-shadow: 0 12px 24px rgba(31, 103, 246, 0.10);
}

body.light-mode .nav-tab.active::after {
  background: linear-gradient(90deg, #4f46e5, #ec4899);
}

/* ── BODY LAYOUT ── */
.body-wrap {
  height: calc(100vh - 50px - var(--footer-h));
  display: grid;
  grid-template-rows: auto 350px 1fr;
  gap: 6px;
  padding: 6px;
  overflow: hidden;
}

/* ── ROW 1 ── */
.row1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 5px;
}

.sc {
  border-radius: 9px;
  padding: 8px 11px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s, background 0.3s;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel);
}

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

.sc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

/* Gradients for stats - modified slightly for light-mode readability */
.sc.r {
  border-color: rgba(239, 68, 68, 0.2);
}

.sc.r::before {
  background: linear-gradient(90deg, #ef4444, #ff6b6b);
}

body.light-mode .sc.r {
  background: linear-gradient(135deg, #fef2f2, var(--panel));
}

.sc.a {
  border-color: rgba(245, 158, 11, 0.2);
}

.sc.a::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

body.light-mode .sc.a {
  background: linear-gradient(135deg, #fffbeb, var(--panel));
}

.sc.t {
  border-color: rgba(14, 165, 233, 0.2);
}

.sc.t::before {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

body.light-mode .sc.t {
  background: linear-gradient(135deg, #f0f9ff, var(--panel));
}

.sc.p {
  border-color: rgba(168, 85, 247, 0.2);
}

.sc.p::before {
  background: linear-gradient(90deg, #a855f7, #c084fc);
}

body.light-mode .sc.p {
  background: linear-gradient(135deg, #faf5ff, var(--panel));
}

.sc.pk {
  border-color: rgba(236, 72, 153, 0.2);
}

.sc.pk::before {
  background: linear-gradient(90deg, #ec4899, #f472b6);
}

body.light-mode .sc.pk {
  background: linear-gradient(135deg, #fdf2f8, var(--panel));
}

.sc.g {
  border-color: rgba(34, 197, 94, 0.2);
}

.sc.g::before {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

body.light-mode .sc.g {
  background: linear-gradient(135deg, #f0fdf4, var(--panel));
}

.sc.o {
  border-color: rgba(249, 115, 22, 0.2);
}

.sc.o::before {
  background: linear-gradient(90deg, #f97316, #fb923c);
}

body.light-mode .sc.o {
  background: linear-gradient(135deg, #fff7ed, var(--panel));
}

/* Non-gradient fallbacks for dark mode panel matching */
body:not(.light-mode) .sc.r {
  background: linear-gradient(135deg, #1a0d0d, #0d1828);
}

body:not(.light-mode) .sc.a {
  background: linear-gradient(135deg, #1a110a, #0d1828);
}

body:not(.light-mode) .sc.t {
  background: linear-gradient(135deg, #091420, #0d1828);
}

body:not(.light-mode) .sc.p {
  background: linear-gradient(135deg, #120d1a, #0d1828);
}

body:not(.light-mode) .sc.pk {
  background: linear-gradient(135deg, #1a0d13, #0d1828);
}

body:not(.light-mode) .sc.g {
  background: linear-gradient(135deg, #091409, #0d1828);
}

body:not(.light-mode) .sc.o {
  background: linear-gradient(135deg, #1a0f06, #0d1828);
}

.sc-icon {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  opacity: 0.08;
  color: var(--text);
}

.sc-val {
  font-family: 'Rajdhani', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.sc-lbl {
  font-size: 9px;
  color: var(--sub);
  line-height: 1.2;
  margin-top: 2px;
}

.sc-chg {
  font-size: 9px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.up {
  color: #f87171;
}

.dn {
  color: #4ade80;
}

@keyframes flash {
  0% {
    opacity: 0.3;
  }

  100% {
    opacity: 1;
  }
}

.sc-val.flash {
  animation: flash 0.4s ease-out;
}

/* ── PANELS & SIDE BLOCKS ── */
.right-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--card-shadow);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--card-shadow);
}

.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.02);
}

body.light-mode .ph {
  background: #f8fafc;
}

.pt {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

.bv {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.bv:hover {
  background: rgba(14, 165, 233, 0.18);
  color: #fff;
}

body.light-mode .bv:hover {
  color: #0ea5e9;
}

.s-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sbox {
  flex: 1;
  position: relative;
}

.sbox i {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.s-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px 5px 26px;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  outline: none;
  height: 28px;
}

body.light-mode .s-input {
  background: #f8fafc;
}

.s-input::placeholder {
  color: var(--muted);
}

.s-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 6px;
  color: var(--sub);
  font-family: 'Barlow', sans-serif;
  font-size: 10px;
  outline: none;
  cursor: pointer;
  height: 28px;
  flex-shrink: 0;
}

body.light-mode .s-select {
  background: #f8fafc;
  color: var(--text);
}

.s-select option {
  background: var(--navy2);
  color: var(--text);
}

.cc-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
}

.color-chips {
  display: flex;
  gap: 3px;
  align-items: center;
}

.cc {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cc:hover,
.cc.on {
  border-color: var(--text);
  transform: scale(1.18);
}

.btn-srch {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  border-radius: 5px;
  padding: 0 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.btn-srch:hover {
  opacity: 0.9;
}

.btn-rst {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--sub);
  border-radius: 5px;
  padding: 0 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  height: 28px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-rst:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  height: 28px;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

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

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(31, 103, 246, 0.08);
  border: 1px solid rgba(31, 103, 246, 0.18);
  border-radius: 999px;
  padding: 8px;
  margin-bottom: 22px;
}

.settings-tab {
  color: var(--sub);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-width: 110px;
  text-align: center;
}

.settings-tab.active {
  background: linear-gradient(135deg, #1f67f6, #3b82f6);
  color: #fff;
  box-shadow: 0 14px 30px rgba(31, 103, 246, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
}

.settings-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.98), rgba(12, 17, 33, 0.95));
  box-shadow: 0 24px 60px rgba(5, 12, 24, 0.28);
  overflow: hidden;
}

.settings-card .ph {
  background: rgba(15, 23, 42, 0.93);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 18px;
}

.settings-card .pt {
  color: #e2e8f0;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.settings-field {
  margin-bottom: 18px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.settings-form-grid .settings-field {
  margin-bottom: 0;
}

.settings-col-full {
  grid-column: span 2;
}

.settings-field label {
  display: block;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.settings-input,
.settings-select,
.settings-textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  font-size: 14px;
  min-height: 42px;
}

.settings-textarea {
  min-height: 90px;
  resize: vertical;
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(31, 41, 55, 0.82);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.settings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  min-width: 100%;
}

.settings-table thead th {
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
}

.settings-table tbody tr {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.settings-table tbody tr:hover {
  transform: translateX(2px);
  box-shadow: 0 10px 18px rgba(31, 103, 246, 0.1);
}

.settings-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border: none;
}

.settings-table td:last-child {
  white-space: nowrap;
}

.settings-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-actions form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.badge-active {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}

.badge-inactive {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
}

.badge-offline {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-action-btn {
  min-width: 110px;
}

.settings-ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.settings-ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(31, 41, 55, 0.82);
  border: 1px solid rgba(71, 85, 105, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  color: #93c5fd;
}

body.light-mode .settings-card {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

body.light-mode .settings-card .ph {
  background: #eef2ff;
  border-color: rgba(148, 163, 184, 0.3);
}

body.light-mode .settings-card .pt,
body.light-mode .settings-field label,
body.light-mode .settings-toggle,
body.light-mode .settings-header-chip {
  color: #0f172a;
}

body.light-mode .settings-input,
body.light-mode .settings-select,
body.light-mode .settings-textarea {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: none;
}

body.light-mode .settings-input:focus,
body.light-mode .settings-select:focus,
body.light-mode .settings-textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.12);
}

body.light-mode .settings-toggle {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.3);
  color: #0f172a;
}

body.light-mode .settings-tab {
  color: #0f172a;
}

body.light-mode .settings-tab.active {
  color: #fff;
}

body.light-mode .settings-table {
  border-spacing: 0 6px;
}

body.light-mode .settings-table tbody tr {
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16);
}

body.light-mode .settings-table thead th {
  color: #64748b;
}

body.light-mode .settings-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

body.light-mode .settings-header-chip {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
  color: #1f2937;
}

.cl {
  flex: 1;
  overflow: hidden;
  padding: 4px 11px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.cr {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ci {
  font-size: 11px;
  width: 14px;
  text-align: center;
}

.clbl {
  flex: 1;
  font-size: 10px;
  color: var(--sub);
}

.cbw {
  width: 60px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

body.light-mode .cbw {
  background: rgba(0, 0, 0, 0.1);
}

.cb {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.cct {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11px;
  min-width: 36px;
  text-align: right;
}

/* ── ROW 2 SLIDER ── */
.row2 {
  height: 350px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.snb {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  padding: 0;
  flex-shrink: 0;
}

body.light-mode .snb {
  background: #f1f5f9;
}

.snb:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icb {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.06);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  padding: 0;
  flex-shrink: 0;
}

.icb:hover {
  background: rgba(245, 158, 11, 0.14);
}

.sctr {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
}

.slider-ctrl {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sl-progress-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

body.light-mode .sl-progress-wrap {
  background: rgba(0, 0, 0, 0.05);
}

.sl-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f97316, var(--danger));
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

.slide-viewport {
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.slide-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.slide-item {
  flex: 0 0 100%;
  height: 100%;
  padding: 8px 12px;
  gap: 10px;
  display: flex;
  align-items: stretch;
}

/* ── VEHICLE CARD ── */
.sl-visual {
  flex: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.sl-visual:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Glow gradient panel cards adjusted for light mode background */
.sl-visual.grad-danger {
  background: #120508;
  border-color: rgba(239, 68, 68, 0.3);
}

.sl-visual.grad-accent {
  background: #120a04;
  border-color: rgba(245, 158, 11, 0.3);
}

.sl-visual.grad-teal {
  background: #041018;
  border-color: rgba(14, 165, 233, 0.3);
}

.sl-visual.grad-purple {
  background: #080514;
  border-color: rgba(168, 85, 247, 0.3);
}

.sl-visual.grad-pink {
  background: #12040c;
  border-color: rgba(236, 72, 153, 0.3);
}

.sl-visual.grad-green {
  background: #041008;
  border-color: rgba(34, 197, 94, 0.3);
}

.sl-visual.grad-orange {
  background: #120700;
  border-color: rgba(249, 115, 22, 0.3);
}

body.light-mode .sl-visual.grad-danger {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.15);
}

body.light-mode .sl-visual.grad-accent {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.15);
}

body.light-mode .sl-visual.grad-teal {
  background: #f0f9ff;
  border-color: rgba(14, 165, 233, 0.15);
}

body.light-mode .sl-visual.grad-purple {
  background: #faf5ff;
  border-color: rgba(168, 85, 247, 0.15);
}

body.light-mode .sl-visual.grad-pink {
  background: #fdf2f8;
  border-color: rgba(236, 72, 153, 0.15);
}

body.light-mode .sl-visual.grad-green {
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, 0.15);
}

body.light-mode .sl-visual.grad-orange {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.15);
}

.sl-visual.is-alert {
  border-color: rgba(239, 68, 68, 0.7) !important;
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {

  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2), 0 0 28px rgba(239, 68, 68, 0.1);
  }

  50% {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5), 0 0 44px rgba(239, 68, 68, 0.3);
  }
}

.sl-visual::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
}

.sl-visual.grad-danger::before {
  background: linear-gradient(90deg, #ef4444, #ff6b6b, transparent);
}

.sl-visual.grad-accent::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24, transparent);
}

.sl-visual.grad-teal::before {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8, transparent);
}

.sl-visual.grad-purple::before {
  background: linear-gradient(90deg, #a855f7, #c084fc, transparent);
}

.sl-visual.grad-pink::before {
  background: linear-gradient(90deg, #ec4899, #f472b6, transparent);
}

.sl-visual.grad-green::before {
  background: linear-gradient(90deg, #22c55e, #4ade80, transparent);
}

.sl-visual.grad-orange::before {
  background: linear-gradient(90deg, #f97316, #fb923c, transparent);
}

.sl-visual.is-alert::before {
  background: linear-gradient(90deg, #ef4444, #ff6b6b, #ef4444) !important;
}

.sl-cam-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px 5px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sl-cam-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--sub);
}

.sl-cam-tag i {
  color: var(--teal);
  font-size: 10px;
}

.sl-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: blink 1.2s infinite;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--green);
}

/* IMAGE AREA */
.sl-img-wrap {
  flex: 1;
  position: relative;
  z-index: 2;
  overflow: hidden;
  min-height: 0;
}

.sl-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.sl-visual:hover .sl-img-wrap img {
  transform: scale(1.05);
}

.sl-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 25%, transparent 50%, rgba(6, 13, 26, 0.85) 100%);
}

body.light-mode .sl-img-wrap::after {
  background: linear-gradient(to bottom, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.8) 100%);
}

.sl-alert-ribbon {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.55);
  border-radius: 5px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--danger);
  backdrop-filter: blur(6px);
}

/* PLATE STRIP */
.sl-plate-strip {
  padding: 8px 11px 10px;
  border-top: 1px solid var(--border);
  background: var(--navy2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sl-plate {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
}

.sl-plate-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.3px;
}

.sl-plate-sub .ps-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

body.light-mode .sl-plate-sub .ps-chip {
  background: rgba(0, 0, 0, 0.02);
}

.sl-plate-sub .ps-chip i {
  font-size: 9px;
  opacity: 0.8;
}

.sl-plate-sub .ps-chip.zone i {
  color: #38bdf8;
}

.sl-plate-sub .ps-chip.time i {
  color: #fbbf24;
}

.sl-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.sdots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  flex-shrink: 0;
}

.sd {
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  cursor: pointer;
  transition: all 0.22s;
  border: none;
  padding: 0;
}

.sd.active {
  background: linear-gradient(90deg, var(--accent), #f97316);
  width: 20px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-new {
  animation: slideIn 0.45s ease-out;
}

.bgt {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-family: 'Barlow Condensed', sans-serif;
  white-space: nowrap;
}

.br {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ba {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.bt {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.bg {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.bp {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.bpk {
  background: rgba(236, 72, 153, 0.1);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

/* FULLSCREEN OVERLAY */
#fsOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy);
  flex-direction: column;
}

#fsOverlay.open {
  display: flex;
}

.fs-hd {
  height: 50px;
  flex-shrink: 0;
  background: var(--navy2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.fs-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fs-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.fs-close:hover {
  background: rgba(239, 68, 68, 0.25);
}

.fs-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── ROW 3 ── */
.row3 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}

.tv-body {
  flex: 1;
  overflow: hidden;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.tv-row {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: all 0.15s;
  cursor: default;
}

.tv-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

body.light-mode .tv-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.tv-rank-wrap {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.tv-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin: 0 5px;
}

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

.tv-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.tv-bar-bg {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

body.light-mode .tv-bar-bg {
  background: rgba(0, 0, 0, 0.08);
}

.tv-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.tv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-left: 8px;
  flex-shrink: 0;
  min-width: 46px;
}

.tv-count {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.tv-pct {
  font-size: 9px;
  color: var(--muted);
}

.tv-row.rank1 {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.15);
}

.tv-row.rank2 {
  background: rgba(148, 163, 184, 0.04);
  border-color: rgba(148, 163, 184, 0.1);
}

.tv-row.rank3 {
  background: rgba(205, 124, 58, 0.04);
  border-color: rgba(205, 124, 58, 0.1);
}

.cw {
  flex: 1;
  padding: 4px 8px;
  position: relative;
  min-height: 0;
}

.cw canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-filters {
  display: flex;
  gap: 4px;
  align-items: center;
}

.cf-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
}

.cf-btn:hover,
.cf-btn.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ── INTERACTIVE SIDEBAR NAVIGATION DRAWER ── */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: linear-gradient(180deg, var(--navy2), var(--navy));
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  z-index: 1050;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.nav-drawer.open {
  right: 0;
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.nav-drawer-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.nav-drawer-close {
  background: transparent;
  border: none;
  color: var(--sub);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-drawer-close:hover {
  color: var(--danger);
}

.nav-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--sub);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.nav-drawer-item i {
  font-size: 16px;
}

.nav-drawer-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(-5px);
}

body.light-mode .nav-drawer-item:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.nav-drawer-item.active {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
  backdrop-filter: blur(2px);
}

.nav-drawer-backdrop.open {
  display: block;
}

/* ── INNER VIEW LAYOUTS (for other pages) ── */
.inner-wrap {
  height: calc(100vh - 50px - var(--footer-h));
  padding: 20px;
  overflow-y: auto;
}

/* ── GLOBAL FOOTER ── */
.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: rgba(6, 13, 26, 0.72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  color: var(--sub);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  z-index: 1040;
  pointer-events: auto;
}

body.light-mode .app-footer {
  background: rgba(255, 255, 255, 0.82);
  border-top-color: var(--border);
  color: var(--muted);
}

.app-footer-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  pointer-events: auto;
}

.app-footer-brand {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.25px;
  text-decoration: none;
  pointer-events: auto;
}

.app-footer-brand:hover {
  text-decoration: underline;
}

.logout-form {
  display: inline-flex;
}

/* ── AUTH PAGES ── */
.auth-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 103, 246, 0.18), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(141, 77, 232, 0.12), transparent 24%),
    linear-gradient(180deg, #060a11 0%, #020406 100%);
}

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

.auth-panel {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  border: 1px solid rgba(31, 41, 55, 0.92);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(8, 12, 19, 0.96), rgba(4, 7, 12, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
}

.auth-aside {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 103, 246, 0.12), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(141, 77, 232, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(8, 15, 28, 0.9), rgba(5, 8, 14, 0.98));
  border-right: 1px solid rgba(31, 41, 55, 0.92);
}

.auth-brand {
  display: grid;
  gap: 18px;
}

.auth-brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(31, 103, 246, 0.25);
  box-shadow: 0 14px 28px rgba(31, 103, 246, 0.14);
  background: #050914;
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-kicker {
  font-family: 'Barlow Condensed', sans-serif;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-brand h1 {
  margin: 0;
  color: #eff6ff;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(28px, 2.4vw, 42px);
  font-weight: 800;
  line-height: 1.05;
}

.auth-brand p {
  margin: 12px 0 0;
  max-width: 520px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.7;
}

.auth-glass {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.92);
  background: rgba(255, 255, 255, 0.03);
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
}

.auth-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(31, 41, 55, 0.85);
}

.auth-meta i {
  color: #38bdf8;
}

.auth-card {
  padding: 34px;
  background: rgba(7, 11, 18, 0.98);
}

.auth-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.auth-title {
  color: #eff6ff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.auth-subtitle {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.auth-badge {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 103, 246, 0.22);
  background: rgba(31, 103, 246, 0.08);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.auth-alert {
  border-radius: 14px;
  font-size: 13px;
}

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

.auth-field {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7f8da1;
  font-size: 13px;
}

.auth-input-wrap input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.92);
  background: rgba(255, 255, 255, 0.03);
  color: #eff6ff;
  outline: none;
  padding: 0 14px 0 40px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input-wrap input:focus {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.auth-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: #1f67f6;
}

.auth-hint {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
}

.auth-submit {
  height: 46px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f67f6, #184fd6);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 22px rgba(31, 103, 246, 0.2);
}

.auth-submit:hover {
  filter: brightness(1.05);
}

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

  .auth-aside {
    border-right: 0;
    border-bottom: 1px solid rgba(31, 41, 55, 0.92);
  }
}

@media (max-width: 576px) {
  .auth-shell {
    padding: 12px;
  }

  .auth-aside,
  .auth-card {
    padding: 22px;
  }

  .auth-card-head {
    flex-direction: column;
  }

  .auth-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.inner-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inner-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.inner-title span {
  color: var(--accent);
}

/* ── THEME SWITCHER ── */
.theme-switch {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-switch:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── THEMED TABLE (light/dark mode aware) ── */
.tg-table {
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.tg-table thead th {
  color: var(--sub);
  background: rgba(0, 0, 0, 0.15);
  border-color: var(--border) !important;
  font-weight: 700;
}

body.light-mode .tg-table thead th {
  background: rgba(0, 0, 0, 0.04);
}

.tg-table tbody tr {
  border-color: var(--border) !important;
}

.tg-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.05) !important;
  color: var(--text) !important;
}

.tg-table tbody td {
  color: var(--text);
  border-color: var(--border) !important;
}

body.light-mode .tg-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

body:not(.light-mode) .tg-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* DASHBOARD PAGE STYLES */
:root {
  --dash-bg: #eef3fb;
  --dash-shell: rgba(255, 255, 255, 0.86);
  --dash-card: rgba(255, 255, 255, 0.93);
  --dash-border: rgba(208, 219, 233, 0.82);
  --dash-shadow: 0 18px 40px rgba(18, 33, 63, 0.08);
  --dash-text: #1d2840;
  --dash-muted: #6c7d94;
  --dash-soft: #8d9ab0;
  --dash-blue: #1f67f6;
  --dash-red: #ff4d4d;
  --dash-orange: #ff8c1a;
  --dash-green: #20b25f;
  --dash-purple: #8d4de8;
  --dash-pink: #ff4f8a;
  --dash-yellow: #f4b400;
}

body.light-mode {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(218, 233, 255, 0.8), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #eaf1fb 100%) !important;
}

body:not(.light-mode) {
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 103, 246, 0.08), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(141, 77, 232, 0.08), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #050b15 100%) !important;
}

body.light-mode .topbar {
  height: 64px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.94)) !important;
  border-bottom: 1px solid rgba(196, 208, 226, 0.82) !important;
  box-shadow: 0 8px 28px rgba(21, 37, 70, 0.08) !important;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  align-items: center;
  padding-left: 22px;
  padding-right: 18px;
}

body:not(.light-mode) .topbar {
  height: 64px;
  background: linear-gradient(180deg, rgba(14, 20, 33, 0.98), rgba(8, 13, 24, 0.96)) !important;
  border-bottom: 1px solid rgba(34, 48, 75, 0.9) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  align-items: center;
  padding-left: 22px;
  padding-right: 18px;
}

body.light-mode .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(31, 103, 246, 0.14);
  background: #fff !important;
  border-color: rgba(193, 207, 227, 0.9) !important;
}

body:not(.light-mode) .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(31, 103, 246, 0.16);
  background: #0d1728 !important;
  border-color: rgba(34, 48, 75, 0.9) !important;
}

body.light-mode .logo-text span,
body:not(.light-mode) .logo-text span {
  background: linear-gradient(90deg, #1f67f6, #8d4de8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .logo-text {
  font-size: 16px;
}

body.light-mode .logo-sub {
  color: #73849d;
  letter-spacing: 2.6px;
}

body:not(.light-mode) .logo-sub {
  color: #8a98ad;
  letter-spacing: 2.6px;
}

body.light-mode .header-clock,
body:not(.light-mode) .header-clock {
  border-radius: 12px;
  padding: 5px 12px;
  min-width: 108px;
}

body.light-mode .header-clock {
  background: rgba(112, 129, 161, 0.06) !important;
  border-color: rgba(182, 196, 219, 0.8) !important;
}

body:not(.light-mode) .header-clock {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(61, 77, 105, 0.75) !important;
}

body.light-mode .hc-date,
body:not(.light-mode) .hc-date {
  font-size: 8px;
  letter-spacing: 0.6px;
}

body.light-mode .hc-date {
  color: #8a98ad;
}

body:not(.light-mode) .hc-date {
  color: #9aa7b8;
}

body.light-mode .hc-time {
  color: #6e3bf4;
  text-shadow: none;
  font-size: 15px;
}

body:not(.light-mode) .hc-time {
  color: #8f6bff;
  text-shadow: 0 0 8px rgba(141, 77, 232, 0.25);
  font-size: 15px;
}

body.light-mode .live-badge {
  background: #fff5f5 !important;
  border-color: rgba(255, 82, 82, 0.18) !important;
  color: #ef4444 !important;
  padding: 5px 10px;
}

body:not(.light-mode) .live-badge {
  background: rgba(239, 68, 68, 0.09) !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
  color: #ff7070 !important;
  padding: 5px 10px;
}

body.light-mode .theme-switch,
body.light-mode .ib {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(192, 204, 223, 0.95) !important;
  color: #6d7d95 !important;
}

body:not(.light-mode) .theme-switch,
body:not(.light-mode) .ib {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(61, 77, 105, 0.75) !important;
  color: #a8b4c7 !important;
}

body.light-mode .theme-switch:hover,
body.light-mode .ib:hover {
  color: var(--dash-blue) !important;
  border-color: rgba(31, 103, 246, 0.4) !important;
  background: rgba(31, 103, 246, 0.06) !important;
}

body:not(.light-mode) .theme-switch:hover,
body:not(.light-mode) .ib:hover {
  color: #e7ecf7 !important;
  border-color: rgba(141, 77, 232, 0.5) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

body.light-mode .avatar {
  background: linear-gradient(135deg, #1f67f6, #2742b8);
  border: 1px solid rgba(31, 103, 246, 0.2);
  box-shadow: 0 10px 22px rgba(31, 103, 246, 0.18);
}

body:not(.light-mode) .avatar {
  background: linear-gradient(135deg, #2643a8, #0ea5e9);
  border: 1px solid rgba(14, 165, 233, 0.22);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.12);
}

.dashboard-shell {
  height: calc(100vh - 64px - var(--footer-h));
  padding: 14px;
  overflow: hidden;
}

.dashboard-frame {
  height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(193, 207, 227, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.9)),
    radial-gradient(circle at 0% 0%, rgba(31, 103, 246, 0.05), transparent 28%);
  box-shadow: var(--dash-shadow);
  padding: 14px;
  overflow: hidden;
}

body:not(.light-mode) .dashboard-frame {
  border-color: rgba(34, 48, 75, 0.85);
  background:
    linear-gradient(180deg, rgba(10, 17, 30, 0.92), rgba(7, 11, 20, 0.9)),
    radial-gradient(circle at 0% 0%, rgba(31, 103, 246, 0.07), transparent 28%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dash-grid {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(300px, 0.95fr);
  grid-template-rows: auto minmax(320px, 1.08fr) minmax(260px, 0.92fr);
  gap: 12px;
  grid-template-areas:
    "stats stats history"
    "classif search history"
    "violations trend trend";
}

.dash-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(18, 33, 63, 0.06);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  overflow: hidden;
  min-width: 0;
}

body:not(.light-mode) .dash-card {
  background: rgba(14, 22, 37, 0.92);
  border-color: rgba(40, 56, 84, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(195, 207, 226, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(249, 251, 255, 0.7));
}

body:not(.light-mode) .dash-card-head {
  border-bottom-color: rgba(49, 64, 92, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.dash-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #263248;
}

body:not(.light-mode) .dash-title {
  color: #e3e8f3;
}

.dash-title i {
  color: #24304f;
  font-size: 14px;
}

body:not(.light-mode) .dash-title i {
  color: #d7deea;
}

.dash-link {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--dash-blue);
  text-decoration: none;
}

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

.stats-area {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  position: relative;
  min-height: 112px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(210, 220, 236, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.95));
  overflow: hidden;
}

body:not(.light-mode) .metric-card {
  border-color: rgba(46, 62, 90, 0.75);
  background: linear-gradient(180deg, rgba(15, 24, 41, 0.98), rgba(12, 19, 33, 0.95));
}

.metric-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  height: 3px;
  width: 100%;
  background: var(--metric-color, #1f67f6);
}

.metric-card::after {
  content: '';
  position: absolute;
  inset: auto -34px -38px auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--metric-rgb) / 0.16), transparent 68%);
  opacity: 0.9;
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--metric-color);
  border: 1px solid rgb(var(--metric-rgb) / 0.28);
  background: linear-gradient(180deg, rgb(var(--metric-rgb) / 0.12), rgb(var(--metric-rgb) / 0.06));
  box-shadow: 0 10px 18px rgb(var(--metric-rgb) / 0.10);
  flex-shrink: 0;
}

.metric-badge i {
  font-size: 19px;
}

.metric-body {
  min-width: 0;
  flex: 1;
}

.metric-value {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 900;
  color: var(--dash-text);
  letter-spacing: 0.2px;
}

body:not(.light-mode) .metric-value {
  color: #edf3ff;
}

.metric-label {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #3e4f66;
}

body:not(.light-mode) .metric-label {
  color: #cfd7e5;
}

.metric-change {
  margin-top: 7px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-change.up {
  color: #ef4444;
}

.metric-change.down {
  color: #16a34a;
}

.metric-mini {
  position: absolute;
  right: 11px;
  top: 11px;
  color: rgba(116, 131, 154, 0.45);
  font-size: 14px;
}

body:not(.light-mode) .metric-mini {
  color: rgba(208, 219, 233, 0.42);
}

.stats-area .metric-card:nth-child(1) {
  --metric-color: var(--dash-red);
  --metric-rgb: 255 77 77;
}

.stats-area .metric-card:nth-child(2) {
  --metric-color: var(--dash-orange);
  --metric-rgb: 255 140 26;
}

.stats-area .metric-card:nth-child(3) {
  --metric-color: var(--dash-blue);
  --metric-rgb: 31 103 246;
}

.stats-area .metric-card:nth-child(4) {
  --metric-color: var(--dash-purple);
  --metric-rgb: 141 77 232;
}

.stats-area .metric-card:nth-child(5) {
  --metric-color: var(--dash-pink);
  --metric-rgb: 255 79 138;
}

.stats-area .metric-card:nth-child(6) {
  --metric-color: var(--dash-green);
  --metric-rgb: 32 178 95;
}

.stats-area .metric-card:nth-child(7) {
  --metric-color: #ff6a2b;
  --metric-rgb: 255 106 43;
}

.stats-area .metric-card:nth-child(8) {
  --metric-color: #f2b01d;
  --metric-rgb: 242 176 29;
}

.history-card {
  grid-area: history;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.history-list {
  padding: 10px;
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 163, 196, 0.72) rgba(14, 22, 37, 0.18);
  scrollbar-gutter: stable;
}

.history-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(14, 22, 37, 0.12);
  border-radius: 999px;
}

.history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(143, 163, 196, 0.92), rgba(93, 112, 142, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(112, 133, 168, 0.96), rgba(80, 100, 130, 0.96));
}

body:not(.light-mode) .history-list {
  scrollbar-color: rgba(109, 128, 159, 0.82) rgba(255, 255, 255, 0.06);
}

body:not(.light-mode) .history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

body:not(.light-mode) .history-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(109, 128, 159, 0.95), rgba(74, 92, 120, 0.95));
  border-color: rgba(14, 22, 37, 0.35);
}

.history-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  padding: 7px;
  border: 1px solid rgba(214, 223, 236, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.88));
}

body:not(.light-mode) .history-item {
  border-color: rgba(49, 64, 92, 0.82);
  background: linear-gradient(180deg, rgba(18, 28, 46, 0.96), rgba(14, 22, 37, 0.94));
}

.history-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(204, 214, 231, 0.7);
  background: #edf2fb;
}

body:not(.light-mode) .history-thumb {
  border-color: rgba(49, 64, 92, 0.8);
  background: #0d1728;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.history-body {
  min-width: 0;
}

.plate {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #1d2840;
  line-height: 1.1;
}

body:not(.light-mode) .plate {
  color: #edf3ff;
}

.history-meta {
  margin-top: 6px;
  display: grid;
  gap: 4px;
  font-size: 10px;
  color: #66758b;
}

body:not(.light-mode) .history-meta {
  color: #95a3ba;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-line i {
  color: #7a8cac;
  font-size: 10px;
  flex-shrink: 0;
}

.tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.tag.blue {
  background: rgba(31, 103, 246, 0.08);
  color: #1f67f6;
  border-color: rgba(31, 103, 246, 0.2);
}

.tag.green {
  background: rgba(32, 178, 95, 0.1);
  color: #1e9b53;
  border-color: rgba(32, 178, 95, 0.22);
}

.tag.soft {
  background: rgba(116, 131, 154, 0.08);
  color: #52657e;
  border-color: rgba(116, 131, 154, 0.16);
}

.history-action {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(203, 214, 229, 0.9);
  color: #8a98ad;
  background: #fff;
  font-size: 12px;
}

body:not(.light-mode) .history-action {
  border-color: rgba(49, 64, 92, 0.85);
  background: #0d1728;
  color: #9aa7b8;
}

.classif-card {
  grid-area: classif;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.classif-list {
  padding: 12px 14px 14px;
  display: grid;
  gap: 11px;
}

.classif-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 104px 52px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}

.classif-ico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--classif-color, #1f67f6);
  font-size: 13px;
}

.classif-name {
  font-weight: 700;
  color: #2b3851;
}

body:not(.light-mode) .classif-name {
  color: #e6edf8;
}

.classif-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(162, 176, 197, 0.26);
  overflow: hidden;
}

body:not(.light-mode) .classif-bar {
  background: rgba(118, 131, 154, 0.2);
}

.classif-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--classif-color), var(--classif-color));
}

.classif-count {
  text-align: right;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #425068;
}

body:not(.light-mode) .classif-count {
  color: #cfd7e5;
}

.classif-pct {
  text-align: right;
  font-size: 10px;
  color: #9aa7b8;
}

.classif-row:nth-child(1) {
  --classif-color: #1f67f6;
}

.classif-row:nth-child(2) {
  --classif-color: #ff5252;
}

.classif-row:nth-child(3) {
  --classif-color: #ff8c1a;
}

.classif-row:nth-child(4) {
  --classif-color: #8d4de8;
}

.classif-row:nth-child(5) {
  --classif-color: #20b25f;
}

.classif-row:nth-child(6) {
  --classif-color: #ff4f8a;
}

.search-card {
  grid-area: search;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.search-body {
  padding: 13px 14px 14px;
  display: grid;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #99a6b8;
  font-size: 12px;
}

.search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(204, 214, 231, 0.9);
  background: #fff;
  padding: 0 12px 0 35px;
  outline: none;
  font-size: 11px;
  color: #263248;
}

body:not(.light-mode) .search-input {
  border-color: rgba(49, 64, 92, 0.85);
  background: #0d1728;
  color: #edf3ff;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.search-select {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(204, 214, 231, 0.9);
  background: #fff;
  padding: 0 10px;
  font-size: 11px;
  color: #31405a;
  outline: none;
}

body:not(.light-mode) .search-select {
  border-color: rgba(49, 64, 92, 0.85);
  background: #0d1728;
  color: #edf3ff;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.color-label {
  font-size: 10px;
  font-weight: 800;
  color: #51617a;
  letter-spacing: 0.5px;
}

body:not(.light-mode) .color-label {
  color: #9aa7b8;
}

.color-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.color-chip {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(174, 188, 208, 0.7);
}

.search-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn-reset {
  height: 32px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid rgba(204, 214, 231, 0.9);
  background: #fff;
  color: #5f7089;
  font-size: 11px;
  font-weight: 700;
}

body:not(.light-mode) .btn-reset {
  border-color: rgba(49, 64, 92, 0.85);
  background: #0d1728;
  color: #9aa7b8;
}

.btn-search {
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f67f6, #184fd6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(31, 103, 246, 0.18);
}

.violations-card {
  grid-area: violations;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.violations-list {
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
}

.violation-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 56px;
  gap: 9px;
  align-items: center;
  padding: 6px 0;
}

.v-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 8px 14px rgba(20, 35, 70, 0.06);
}

.v-info {
  min-width: 0;
}

.v-name {
  font-size: 11px;
  font-weight: 700;
  color: #213047;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

body:not(.light-mode) .v-name {
  color: #e6edf8;
}

.v-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(162, 176, 197, 0.25);
  overflow: hidden;
}

body:not(.light-mode) .v-bar {
  background: rgba(118, 131, 154, 0.2);
}

.v-fill {
  height: 100%;
  border-radius: 999px;
}

.v-right {
  text-align: right;
}

.v-count {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #25324a;
  line-height: 1;
}

body:not(.light-mode) .v-count {
  color: #edf3ff;
}

.v-pct {
  margin-top: 3px;
  font-size: 10px;
  color: #ef4444;
  font-weight: 700;
}

.trend-card {
  grid-area: trend;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.trend-card .dash-card-head {
  flex-shrink: 0;
}

.trend-controls {
  display: inline-flex;
  gap: 8px;
  padding: 2px;
  border: 1px solid rgba(204, 214, 231, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
}

body:not(.light-mode) .trend-controls {
  border-color: rgba(49, 64, 92, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

.trend-pill {
  height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  color: #6c7d94;
}

body:not(.light-mode) .trend-pill {
  color: #9aa7b8;
}

.trend-pill.active {
  background: linear-gradient(135deg, rgba(31, 103, 246, 0.08), rgba(31, 103, 246, 0.14));
  color: #1f67f6;
  border-color: rgba(31, 103, 246, 0.2);
  box-shadow: 0 8px 14px rgba(31, 103, 246, 0.08);
}

.chart-wrap {
  flex: 1;
  padding: 10px 12px 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chart-legend {
  flex-shrink: 0;
}

.cw {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.cw canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-bottom: 12px;
  align-items: center;
  font-size: 10px;
  color: #607185;
}

body:not(.light-mode) .chart-legend {
  color: #96a4b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 700;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-box {
  position: relative;
  height: calc(100% - 28px);
  border-radius: 14px;
  border: 1px solid rgba(214, 223, 236, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  padding: 14px 16px 12px;
  overflow: hidden;
}

body:not(.light-mode) .chart-box {
  border-color: rgba(49, 64, 92, 0.82);
  background: linear-gradient(180deg, rgba(18, 28, 46, 0.96), rgba(14, 22, 37, 0.94));
}

.chart-y {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 42px repeat(16, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.chart-tick {
  font-size: 10px;
  color: #9ca8bb;
  align-self: center;
}

.bar-cell {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 18px;
  border-radius: 6px 6px 2px 2px;
  opacity: 0.98;
  box-shadow: 0 8px 15px rgba(31, 41, 55, 0.08);
}

.line-layer {
  position: absolute;
  inset: 14px 16px 12px 16px;
  pointer-events: none;
  z-index: 2;
}

.line-point {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2d8cff;
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.12);
  transform: translate(-50%, -50%);
}

.line-path {
  position: absolute;
  inset: 0;
}

.chart-footer {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.time-mark {
  text-align: center;
  font-size: 10px;
  color: #7f8da1;
}

body:not(.light-mode) .time-mark {
  color: #93a2b7;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 103, 246, 0.08);
  color: #1f67f6;
  border: 1px solid rgba(31, 103, 246, 0.16);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

@media (max-width: 1400px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    grid-template-areas:
      "stats history"
      "classif search"
      "violations trend";
    grid-template-rows: auto minmax(300px, 1.05fr) minmax(250px, 0.95fr);
  }

  .history-card {
    /* grid-row: span 2; */
  }
}

@media (max-width: 1100px) {
  .dashboard-shell {
    height: auto;
    overflow: auto;
  }

  .dashboard-frame {
    height: auto;
    min-height: calc(100vh - 92px);
    overflow: visible;
  }

  .dash-grid {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-areas:
      "stats"
      "history"
      "classif"
      "search"
      "violations"
      "trend";
  }

  .stats-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-card {
    grid-row: auto;
  }
}

@media (max-width: 720px) {

  body.light-mode .topbar,
  body:not(.light-mode) .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dashboard-shell {
    padding: 10px;
  }

  .dashboard-frame {
    padding: 10px;
    border-radius: 14px;
  }

  .stats-area {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .classif-row,
  .violation-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .classif-count,
  .classif-pct,
  .v-right {
    grid-column: 2;
    text-align: left;
  }

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