/* ═══════════════════════════════════════════════════════════
   Hares Patrol Vision — Design System
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Qomra';
  src: url('/public/fonts/itfQomraArabic-Black.otf') format('opentype'),
       url('/fonts/itfQomraArabic-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:       #0d0d0d;
  --surface:  #001a18;
  --surface2: #032e2a;
  --accent:   #428177;
  --text:     #edebe0;
  --text2:    #b9a779;
  --text3:    #988561;
  --border:   #2a2a2a;
  --red:      #4a151e;
  --red2:     #2a0a0f;
  --blue:     #4a8f85;
  --orange:   #d47a30;
  --danger:   #cf5b64;
  --purple:   #7a5aa5;

  --radius:   14px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* ── الوضع الفاتح — ورق رسمي: كريمي + حبر أخضر + ذهبي داكن (نفس الهوية، بلا أزرق) ── */
:root[data-theme="light"] {
  --bg:       #e9e6da;
  --surface:  #f7f5ec;
  --surface2: #e6e3d4;
  --accent:   #2f6b60;
  --text:     #17211c;
  --text2:    #1f4d41;   /* أخضر سيادي غامق بدل الذهبي (النص الرئيسي بالوضع الفاتح) */
  --text3:    #5a7c71;   /* أخضر مكتوم للنص الثانوي */
  --border:   #d3cdbb;
  --danger:   #a52834;
  --orange:   #a9590d;
  /* --red/--red2/--blue/--purple شارات داكنة تبقى مقبولة على خلفية فاتحة */
}
html { transition: background-color .2s ease; }

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Qomra', 'Inter', sans-serif;
  direction: rtl;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
input, select, button, textarea { font-family: inherit; }
button { cursor: pointer; border: none; outline: none; }
input:focus, select:focus, textarea:focus { outline: none; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  height: 70px;                 /* يطابق ارتفاع topbar بالضبط → خط أفقي مستقيم متّصل */
  flex-shrink: 0;               /* لا يتقلّص في عمود flex (كان ينهار لـ1px بسبب طول القائمة) */
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .brand {
  font-family: 'Qomra', sans-serif;
  font-size: 21px;
  line-height: 1.15;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.sidebar-logo .brand-sub {
  font-size: 12px;
  line-height: 1.1;
  color: var(--text3);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-size: 14px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--surface2);
  color: var(--accent);
  border-color: var(--accent);
  border-right: 3px solid var(--accent);
}

.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-right: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: 70px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 21px;
  color: var(--text);
  font-weight: 700;
}

.officer-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 14px 6px 10px;
}

.officer-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--bg);
  font-weight: 900;
  flex-shrink: 0;
}

.officer-info .name {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.officer-info .rank {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.1;
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-right: 6px solid var(--accent);
  overflow: hidden;
}

.card-header {
  background: var(--surface2);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 14px;
  color: var(--text2);
  font-weight: 700;
}

.card-body {
  padding: 20px;
}

/* ── Officer Profile Card ───────────────────────────────────── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-right: 6px solid var(--accent);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-lg {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-details { flex: 1; }

.profile-name {
  font-size: 20px;
  color: var(--text);
  font-weight: 900;
  margin-bottom: 4px;
}

.profile-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
}

.profile-badge strong {
  color: var(--text2);
  font-family: 'Qomra', sans-serif;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Qomra', sans-serif;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: #509b8e; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: rgba(66,129,119,0.1); }

.btn-danger {
  background: var(--red);
  color: var(--text);
}
.btn-danger:hover { background: #8a2636; }

.btn-ghost {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text3); }

.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Search Button (special) ────────────────────────────────── */
.btn-search {
  background: var(--accent);
  color: var(--bg);
  padding: 14px 36px;
  font-size: 17px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  letter-spacing: 0.5px;
  transition: var(--transition);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-search:hover:not(:disabled) { background: #509b8e; transform: translateY(-1px); }
.btn-search:active:not(:disabled) { transform: translateY(0); }

.btn-search.searching {
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid var(--accent);
  cursor: wait;
}

.btn-search .search-pulse {
  display: none;
}
.btn-search.searching .search-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label .required {
  color: var(--danger);
  margin-right: 3px;
}

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66,129,119,0.15);
}

.form-input::placeholder { color: var(--text3); opacity: 0.6; }

.form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23988561' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}

.form-select:focus { border-color: var(--accent); }

/* خيارات القائمة المنسدلة — خلفية داكنة بدل رمادي النظام المقرف */
.form-select option, select option {
  background: var(--surface2);
  color: var(--text);
}
/* إلغاء تلوين المتصفح للحقول عند autofill/الكتابة (كان يقلبها أبيض/رمادي) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
.form-input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface2) inset !important;
  box-shadow: 0 0 0 1000px var(--surface2) inset !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* ── Toggle (new/old plate) ─────────────────────────────────── */
.toggle-group {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text3);
  background: transparent;
  border: none;
  transition: var(--transition);
  font-family: 'Qomra', sans-serif;
  font-weight: 700;
}

.toggle-btn.active {
  background: var(--accent);
  color: var(--bg);
}

/* ── Checkbox ───────────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--red2);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.checkbox-row:hover { border-color: var(--danger); }

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
  cursor: pointer;
}

.checkbox-row .label-text {
  font-size: 14px;
  color: var(--text2);
  font-weight: 700;
}

.checkbox-row .label-sub {
  font-size: 11px;
  color: var(--text3);
}

/* ═══════════════════════════════════════════════════════════
   SYRIAN LICENSE PLATE COMPONENT
   ═══════════════════════════════════════════════════════════ */

/* Plate shape selector */
.plate-shape-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.shape-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text3);
  padding: 6px 14px;
  font-size: 12px;
  transition: var(--transition);
  font-family: 'Qomra', sans-serif;
}

.shape-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Rectangular plate (most common) ───────────────────────── */
.plate-rect {
  background: #f5f5f0;
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  direction: ltr;
  width: 100%;
  max-width: 520px;
  min-height: 80px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.8);
  position: relative;
}

/* holographic border effect */
.plate-rect::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(66,129,119,0.2);
  border-radius: 5px;
  pointer-events: none;
  z-index: 2;
}

.plate-section-left {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #1a1a1a;
  padding: 8px 4px;
}

.plate-category-input {
  background: transparent;
  border: none;
  font-family: 'Qomra', 'Qomra', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: #1a1a1a;
  width: 60px;
  text-align: center;
  letter-spacing: 2px;
  direction: ltr;
}

.plate-category-input::placeholder { color: #aaa; }
.plate-category-input:focus { outline: 2px solid var(--accent); border-radius: 4px; }

.plate-section-center {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #1a1a1a;
  padding: 6px;
  background: rgba(255,255,255,0.5);
}

.plate-flag-svg {
  width: 44px;
  height: 30px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.plate-country {
  font-size: 9px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 1px;
  margin-top: 3px;
  font-family: 'Arial', sans-serif;
  line-height: 1.1;
  text-align: center;
}

.plate-section-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

.plate-serial-input {
  background: transparent;
  border: none;
  font-family: 'Qomra', 'Qomra', sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #1a1a1a;
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
  direction: ltr;
}

.plate-serial-input::placeholder { color: #bbb; letter-spacing: 8px; }
.plate-serial-input:focus { outline: 2px solid var(--accent); border-radius: 4px; }

/* ── Partial plate: digit boxes ─────────────────────────────── */
.plate-digits-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.digit-box {
  width: 44px;
  height: 52px;
  background: transparent;
  border: 2px dashed #888;
  border-radius: 4px;
  font-family: 'Qomra', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #1a1a1a;
  text-align: center;
  direction: ltr;
  transition: var(--transition);
}

.digit-box:focus {
  border-color: var(--accent);
  border-style: solid;
  outline: none;
  background: rgba(66,129,119,0.08);
}

.digit-box.has-value {
  border-style: solid;
  border-color: #1a1a1a;
}

.digit-separator {
  font-size: 20px;
  font-weight: 900;
  color: #555;
  margin: 0 2px;
}

/* ── Square plate ────────────────────────────────────────────── */
.plate-square {
  background: #f5f5f0;
  border: 3px solid #1a1a1a;
  border-radius: 8px;
  direction: ltr;
  width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.plate-square .row-top {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid #1a1a1a;
}

.plate-square .row-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-bottom: 2px solid #1a1a1a;
  background: rgba(255,255,255,0.4);
}

.plate-square .row-bot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Old plate (6 digits + province + color) ─────────────────── */
.old-color-toggle {
  display: flex;
  gap: 8px;
}

.oc-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-family: 'Qomra', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.oc-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.oc-btn.active {
  background: rgba(66,129,119,0.18);
  border-color: var(--accent);
  color: var(--text);
}

.oc-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
}

.oc-swatch-black { background: #111; }
.oc-swatch-red   { background: #b00020; }

/* اللوحة القديمة = نفس .plate-rect مع تعديلات اللون + خلية المحافظة */

/* اللون: أسود = سياحي، أحمر = عمومي — يطبَّق على الإطار والنص والفواصل */
/* حلقة فاتحة تفصل الإطار الأسود عن خلفية الكرت الغامقة */
.plate-old-rect.is-black {
  border-color: #1a1a1a; color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(237,235,224,0.35),
              0 6px 18px rgba(0,0,0,0.55);
}
.plate-old-rect.is-red   { border-color: #c8102e; color: #c8102e; }

.plate-old-rect.is-red .plate-section-left,
.plate-old-rect.is-red .plate-section-center { border-right-color: #c8102e; }
.plate-old-rect.is-red .plate-country,
.plate-old-rect.is-red .po-serial6,
.plate-old-rect.is-red .po-province { color: #c8102e; }

/* خلية المحافظة — أعرض من خلية كود الفئة لتسع الأسماء */
.po-prov-cell {
  width: 140px;
  position: relative;
  padding: 6px 4px;
}

.po-province {
  background: transparent;
  border: none;
  color: #1a1a1a;
  font-family: 'Qomra', sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  text-align-last: center;
  width: 100%;
  padding: 4px 18px 4px 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* سهم اختيار صغير */
.po-prov-cell::after {
  content: '';
  position: absolute;
  left: 8px; top: 50%;
  width: 0; height: 0;
  margin-top: -2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  opacity: .5;
  pointer-events: none;
}

.po-province:focus { outline: none; }
.po-province option {
  background: #f5f5f0;
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 700;
}

/* الأرقام الستة — تسع 6 خانات */
.po-serial6 {
  font-size: 34px;
  letter-spacing: 4px;
}
.po-serial6::placeholder { letter-spacing: 4px; font-size: 26px; }

/* سوريا/SYR في اللوحة القديمة — أكبر من الجديدة */
.plate-old-rect .plate-country {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 1.5px;
}

/* ── Plate display (results, readonly) ──────────────────────── */
.plate-display {
  background: #f5f5f0;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  direction: ltr;
  padding: 4px 8px;
  gap: 6px;
}

.plate-display .cat {
  font-family: 'Qomra', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: #1a1a1a;
}

.plate-display .serial {
  font-family: 'Qomra', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  letter-spacing: 2px;
}

.plate-display .flag-mini {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-wanted {
  background: rgba(74,21,30,0.3);
  color: #cf5b64;
  border: 1px solid var(--red);
}

.badge-suspicious {
  background: rgba(212,122,48,0.2);
  color: var(--orange);
  border: 1px solid rgba(212,122,48,0.4);
}

.badge-violation {
  background: rgba(185,167,121,0.15);
  color: var(--text2);
  border: 1px solid rgba(185,167,121,0.3);
}

.badge-clean {
  background: rgba(152,133,97,0.1);
  color: var(--text3);
  border: 1px solid var(--border);
}

/* ── Wanted alert box ───────────────────────────────────────── */
.alert-wanted {
  background: var(--red2);
  border: 1px solid var(--red);
  border-right: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.alert-wanted .alert-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-wanted .alert-title {
  font-size: 15px;
  font-weight: 900;
  color: #cf5b64;
  margin-bottom: 4px;
}

.alert-wanted .alert-reason {
  font-size: 13px;
  color: var(--text2);
}

/* ═══════════════════════════════════════════════════════════
   RESULTS TABLE
   ═══════════════════════════════════════════════════════════ */
.results-section {
  margin-top: 24px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.results-count {
  font-size: 13px;
  color: var(--text3);
}

.results-count strong {
  color: var(--text2);
  font-family: 'Qomra', sans-serif;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.results-table thead th {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text3);
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.results-table tbody tr:hover {
  background: rgba(66,129,119,0.05);
}

.results-table tbody tr.row-wanted {
  border-right: 3px solid var(--danger);
  background: rgba(74,21,30,0.08);
}

.results-table tbody tr.row-suspicious {
  border-right: 3px solid var(--orange);
  background: rgba(212,122,48,0.05);
}

.results-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13px; }

/* ── No match state ─────────────────────────────────────────── */
.no-match {
  background: rgba(66,129,119,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.no-match .icon { font-size: 28px; margin-bottom: 8px; }
.no-match .title { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.no-match .sub { font-size: 12px; color: var(--text3); }

/* ═══════════════════════════════════════════════════════════
   CAMERA STATUS
   ═══════════════════════════════════════════════════════════ */
.camera-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  transition: var(--transition);
}

.camera-indicator.active {
  background: rgba(66,129,119,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.cam-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
}

.camera-indicator.active .cam-dot {
  background: var(--accent);
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ═══════════════════════════════════════════════════════════
   STATS GRID (Dashboard)
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  border-right: 4px solid var(--accent);
}

.stat-value {
  font-family: 'Qomra', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--text2);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(66,129,119,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66,129,119,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66,129,119,0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  border-top: 3px solid var(--accent);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  width: 64px;
  height: 64px;
  background: var(--surface2);
  border: 2px solid var(--accent);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.login-title {
  font-family: 'Qomra', sans-serif;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text3);
  letter-spacing: 1px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 14px;
  padding-right: 42px;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
  pointer-events: none;
}

.login-error {
  background: var(--red2);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #cf5b64;
  text-align: center;
}

.login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.text-accent  { color: var(--accent); }
.text-gold    { color: var(--text2); }
.text-muted   { color: var(--text3); }
.text-danger  { color: var(--danger); }
.text-mono    { font-family: 'Qomra', sans-serif; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.section-title {
  font-size: 13px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Top accent bar ─────────────────────────────────────────── */
.accent-bar-top {
  height: 3px;
  background: var(--accent);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

/* ═══════════════════════════════════════════════════════════
   ANPR PANEL
   ═══════════════════════════════════════════════════════════ */
.anpr-result {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: var(--transition);
}

.anpr-result.anpr-alert-active {
  border-color: var(--danger);
  background: var(--red2);
  animation: anprPulse 1s ease-in-out 3;
}

@keyframes anprPulse {
  0%,100% { box-shadow: none; }
  50%      { box-shadow: 0 0 16px rgba(74,21,30,0.4); }
}

.anpr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.anpr-plate {
  font-family: 'Qomra', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 3px;
  direction: ltr;
  margin-bottom: 10px;
}

.anpr-conf { margin-bottom: 10px; }

.anpr-message {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.anpr-alert-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--red);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .brand, .sidebar .nav-item span, .sidebar-footer { display: none; }
  .main-content { margin-right: 60px; }
  .plate-rect { max-width: 100%; }
}

/* ── Vehicle DB autocomplete ──────────────────────────────── */
.vdb-autocomplete { position: relative; }
.vdb-suggest {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.vdb-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(187,167,118,0.08);
}
.vdb-item:last-child { border-bottom: none; }
.vdb-item:hover, .vdb-item.hl {
  background: var(--accent);
  color: #fff;
}
