/* ==========================================================================
   نظام البيانات والإحصائيات والتقارير المرورية - Design System
   ========================================================================== */

:root {
  --primary: #008751;
  --primary-hover: #006b40;
  --primary-light: #e6f6ee;
  --primary-glow: rgba(0, 135, 81, 0.18);
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;
  --accent-teal: #0d9488;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow: 0 4px 14px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 28px rgba(0, 135, 81, 0.12);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   Core Layout (Shell, Sidebar, Topbar)
   ========================================================================== */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -2px 0 12px rgba(0,0,0,0.02);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.brand i {
  font-size: 22px;
  color: var(--primary);
}

/* Official Saudi Traffic Brand in Sidebar */
.brand-official {
  padding: 6px 4px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.brand-official .brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid rgba(0, 135, 81, 0.16);
  box-shadow: 0 2px 8px rgba(0, 135, 81, 0.05);
  transition: var(--transition);
}

.brand-official .brand-link:hover {
  background: #ffffff;
  border-color: rgba(0, 135, 81, 0.35);
  box-shadow: 0 4px 14px rgba(0, 135, 81, 0.12);
  transform: translateY(-1px);
}

.brand-emblem-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  padding: 2px;
  border: 1px solid rgba(0, 135, 81, 0.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.brand-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-gov {
  font-size: 10px;
  font-weight: 700;
  color: #008751;
  letter-spacing: -0.2px;
}

.brand-agency {
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  margin-top: 1px;
}

.brand-title {
  font-size: 12.5px;
  font-weight: 900;
  color: #0f172a;
  margin-top: 2px;
}

.nav-head {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 18px 12px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 3px 0;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition);
}

.sidebar a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  transform: translateX(-2px);
}

.sidebar a.active {
  background: var(--primary);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar a.active .nav-num {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  font-family: monospace;
}

.workspace {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.topbar-emblem-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 2px;
  border: 1px solid rgba(0, 135, 81, 0.2);
  box-shadow: 0 2px 8px rgba(0, 135, 81, 0.08);
  transition: var(--transition);
}

.topbar-emblem-wrap:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 135, 81, 0.16);
}

.topbar-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-agency {
  font-size: 11px;
  font-weight: 700;
  color: #008751;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.1px;
}

.topbar-sep {
  opacity: 0.45;
  font-size: 9px;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-app-name,
.topbar-brand b {
  font-size: 15px;
  color: #0f172a;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.official-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.badge-dept {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border);
  color: #475569;
}
.btn-outline:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-logout {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-weight: 700;
}
.btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
}

.content {
  padding: 26px 30px;
  max-width: 1750px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* ==========================================================================
   Cards & Generic Components
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

h1 { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: #0f172a; }
h2 { font-size: 18px; font-weight: 800; margin: 0 0 10px; color: #1e293b; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; color: #334155; }
.subtle, .muted { color: var(--text-muted); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  transition: var(--transition);
}

.btn:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: #cbd5e1;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff5f5;
}
.btn-danger:hover {
  color: #ffffff;
  background: #dc2626;
}

.btn-light {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--primary);
}
.btn-light:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 6px;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.field { min-width: 0; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: #334155;
}
.field label .required { color: #dc2626; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.field textarea { min-height: 90px; resize: vertical; }
.field.wide { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.field .error { font-size: 11px; color: #dc2626; margin-top: 4px; }

/* Tables */
.table-scroll { overflow-x: auto; max-width: 100%; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: right;
}
th, td {
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
  vertical-align: middle;
  white-space: nowrap;
}
thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
}
tr:hover td { background: #f8fafc; }

/* Alerts */
.alert {
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
}
.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.alert-error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.pagination-box {
  padding: 18px 0 6px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
}
.pagination-box a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
}
.pagination-box a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.page-heading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 15px;
}

/* ==========================================================================
   MODERN DASHBOARD V3 (Sleek Executive Aesthetic)
   ========================================================================== */

/* 1. Hero Executive Banner */
.dash-hero {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #013a20 0%, #00683e 45%, #008751 80%, #059669 100%);
  color: #ffffff;
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: 0 16px 36px -10px rgba(0, 135, 81, 0.4);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.dash-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.dash-hero::after {
  content: "";
  position: absolute;
  bottom: -90px;
  right: 20%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,243,208,0.15) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.dash-hero-watermark {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 230px;
  height: 230px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 1;
}

.dash-hero-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.hero-content-group {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 780px;
}

.hero-crest-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  padding: 12px 16px;
  min-width: 115px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  text-align: center;
  transition: transform 0.25s ease;
}

.hero-crest-badge:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

.hero-crest-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  margin-bottom: 6px;
  transition: transform 0.25s ease;
}

.hero-crest-badge:hover .hero-crest-img {
  transform: scale(1.06);
}

.hero-crest-labels {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-crest-gov {
  font-size: 10px;
  font-weight: 700;
  color: #a7f3d0;
  white-space: nowrap;
}

.hero-crest-sub {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.hero-main {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.dash-hero h1 {
  color: #ffffff;
  font-size: 27px;
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.hero-desc {
  margin: 0;
  opacity: 0.92;
  font-size: 13.5px;
  line-height: 1.6;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-hero-solid {
  background: #ffffff;
  color: #008751 !important;
  font-weight: 800;
  font-size: 13px;
  border-radius: 12px;
  padding: 11px 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  border: none;
}
.btn-hero-solid:hover {
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.2);
}

.btn-hero-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 13px;
  border-radius: 12px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}
.btn-hero-glass:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

/* 2. Executive KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--kpi-accent, var(--primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

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

.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: var(--kpi-icon-bg, #ecfdf5);
  color: var(--kpi-accent, var(--primary));
  transition: var(--transition);
}

.kpi-card:hover .kpi-icon-wrap {
  transform: scale(1.08);
}

.kpi-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.kpi-num {
  font-size: 32px;
  font-weight: 900;
  font-family: 'Cairo', monospace;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 4px;
}

.kpi-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
}

.kpi-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 10.5px;
}
.sub-pill-danger { background: #fee2e2; color: #b91c1c; }
.sub-pill-warning { background: #fef3c7; color: #b45309; }
.sub-pill-info { background: #e0f2fe; color: #0369a1; }
.sub-pill-success { background: #dcfce7; color: #15803d; }

/* 3. Analytics & Activity Dual Column */
.dash-split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.panel-title i {
  color: var(--primary);
  font-size: 18px;
}

.distribution-bar {
  display: flex;
  height: 14px;
  border-radius: 20px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 20px;
}

.dist-slice {
  height: 100%;
  transition: width 0.6s ease;
}

.slice-1 { background: #7c3aed; } /* Field */
.slice-2 { background: #e11d48; } /* Incidents */
.slice-3 { background: #d97706; } /* Campaigns */
.slice-4 { background: #008751; } /* Stats */

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

.grp-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.grp-box:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.grp-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.grp-info { min-width: 0; flex: 1; }
.grp-name { font-size: 12.5px; font-weight: 700; color: #334155; }
.grp-count { font-size: 18px; font-weight: 800; font-family: monospace; color: #0f172a; }

/* Timeline Activity */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}
.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.op-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}
.op-insert, .op-create { background: #dcfce7; color: #15803d; }
.op-update { background: #e0f2fe; color: #0369a1; }
.op-delete { background: #fee2e2; color: #b91c1c; }
.op-approve { background: #f3e8ff; color: #7e22ce; }

.timeline-actor {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.timeline-entity {
  font-size: 11.5px;
  color: var(--text-muted);
}

.timeline-time {
  font-size: 10.5px;
  color: var(--text-subtle);
  font-family: monospace;
}

/* 4. Forms Catalog Directory */
.forms-directory {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.directory-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.directory-title h2 {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.directory-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  padding: 7px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  background: #ffffff;
  color: var(--primary);
  border-color: #cbd5e1;
}

.filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.filter-btn-count {
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 10.5px;
  background: rgba(0,0,0,0.08);
}
.filter-btn.active .filter-btn-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.search-wrap {
  position: relative;
  min-width: 260px;
}

.search-wrap i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
}

.search-input {
  width: 100%;
  padding: 9px 38px 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Forms Grid */
.f-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.f-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.f-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--f-accent, var(--primary));
  border-radius: 0 14px 14px 0;
}

.f-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.f-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.f-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.f-num-pill {
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  padding: 2px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
}

.f-grp-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--f-grp-bg, #f1f5f9);
  color: var(--f-grp-color, #475569);
}

.f-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--f-ico-bg, #f1f5f9);
  color: var(--f-accent, var(--primary));
  transition: var(--transition);
}

.f-card:hover .f-card-icon {
  transform: rotate(-6deg) scale(1.1);
}

.f-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 14px;
  min-height: 40px;
}

.f-card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.f-count-wrap {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.f-count-num {
  font-size: 24px;
  font-weight: 900;
  font-family: 'Cairo', monospace;
  color: var(--primary);
  line-height: 1;
}

.f-count-label {
  font-size: 11px;
  color: var(--text-muted);
}

.f-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.btn-card-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-card-primary {
  background: var(--primary-light);
  color: var(--primary) !important;
  border: 1px solid rgba(0, 135, 81, 0.2);
}
.btn-card-primary:hover {
  background: var(--primary);
  color: #ffffff !important;
}

.btn-card-neutral {
  background: #f8fafc;
  color: #475569 !important;
  border: 1px solid var(--border);
}
.btn-card-neutral:hover {
  background: #f1f5f9;
  color: #0f172a !important;
}

.btn-card-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.btn-card-icon:hover {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
}

/* 5. Executive Advisory Card */
.dash-advisory {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.advisory-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #dcfce7;
  color: #15803d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.advisory-content h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: #14532d;
}

.advisory-content p {
  margin: 0;
  font-size: 12.5px;
  color: #166534;
  line-height: 1.6;
}

/* ==========================================================================
   Official Page Footer
   ========================================================================== */

footer.page-footer {
  margin-top: 45px;
  padding: 24px 20px 10px;
  border-top: 1px solid var(--border);
  color: #64748b;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.footer-official-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  color: #0f172a;
  font-size: 12.5px;
}

.footer-emblem-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.footer-meta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #94a3b8;
}

.footer-confidential {
  color: #008751;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-sep { opacity: 0.5; }

/* ==========================================================================
   Official Saudi Traffic Login Screen
   ========================================================================== */

.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 15%, #dff4e8 0%, #eef5f0 45%, #e2e8f0 100%);
  position: relative;
  overflow-x: hidden;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif;
  direction: rtl;
}

.login-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 620px;
  height: 620px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

.login-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 38px 32px 30px;
  border-radius: 24px;
  border: 1px solid rgba(0, 135, 81, 0.16);
  box-shadow: 0 20px 48px -12px rgba(0, 85, 45, 0.22), 0 1px 3px rgba(0, 0, 0, 0.04);
  margin: 20px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-emblem-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #ffffff 60%, #eaf7f0 100%);
  border-radius: 22px;
  padding: 6px;
  border: 2px solid rgba(0, 135, 81, 0.22);
  box-shadow: 0 10px 24px -6px rgba(0, 135, 81, 0.28);
  position: relative;
  transition: transform 0.3s ease;
}

.login-emblem-wrap:hover {
  transform: scale(1.04);
}

.login-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.login-kingdom-badge {
  display: inline-block;
  background: #e6f6ee;
  color: #008751;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 135, 81, 0.2);
  margin-bottom: 6px;
}

.login-agency-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}

.login-title {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 5px;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.login-system-name {
  font-size: 12.5px;
  color: #008751;
  font-weight: 700;
  margin: 0;
}

.login-form .field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  font-family: inherit;
  font-size: 13.5px;
  transition: var(--transition);
  background: #f8fafc;
  box-sizing: border-box;
}

.login-form input:focus {
  outline: none;
  border-color: #008751;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 135, 81, 0.14);
}

.btn-login-submit {
  width: 100%;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 800;
  border-radius: 12px;
  background: linear-gradient(135deg, #008751 0%, #059669 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(0, 135, 81, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: var(--transition);
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #007043 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(0, 135, 81, 0.55);
}

.login-security-notice {
  text-align: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.security-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #008751;
  margin-bottom: 4px;
}

.confidential-text {
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   Official Print Letterhead & Document Styles
   ========================================================================== */

.official-print-letterhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 3px double #008751;
}

.letterhead-right {
  text-align: right;
  line-height: 1.5;
  flex: 1;
}

.lh-kingdom {
  font-size: 13px;
  font-weight: 800;
  color: #008751;
}

.lh-ministry {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.lh-agency {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.lh-dept {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.letterhead-center {
  text-align: center;
  padding: 0 20px;
  flex-shrink: 0;
}

.print-emblem {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.letterhead-left {
  text-align: left;
  line-height: 1.6;
  flex: 1;
}

.lh-meta-item {
  font-size: 11.5px;
  color: #334155;
  text-align: left;
}

.lh-meta-item b {
  color: #0f172a;
}

.print-doc-title-box {
  text-align: center;
  margin-bottom: 22px;
  padding: 10px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.print-doc-title-box h1 {
  font-size: 20px;
  font-weight: 900;
  color: #008751;
  margin: 0 0 5px;
}

.print-doc-title-box p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.print-footer-notice {
  text-align: center;
  margin-top: 35px;
  padding-top: 15px;
  border-top: 1px dashed #cbd5e1;
  font-size: 11px;
  color: #94a3b8;
}

/* Responsive Media Queries */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .f-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .dash-split { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .shell { display: block; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 280px;
  }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .topbar-agency { display: none; }
  .dash-hero { padding: 22px; }
  .hero-content-group { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dash-hero-watermark { display: none; }
  .kpi-grid, .f-cards-grid, .groups-stat-grid { grid-template-columns: 1fr; }
  .directory-toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { width: 100%; }
}

/* ==========================================================================
   Official Action Buttons (View, Edit, Print, Delete) & Official Signatures
   ========================================================================== */
.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.actions form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.btn-action-view,
.btn-action-edit,
.btn-action-print,
.btn-action-delete,
.btn-action-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

/* View: Soft Blue */
.btn-action-view {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-action-view:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* Edit: Soft Emerald Green */
.btn-action-edit {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.btn-action-edit:hover {
  background: #166534;
  color: #ffffff;
  border-color: #166534;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.25);
}

/* Print: Soft Violet / Purple */
.btn-action-print {
  background: #faf5ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}
.btn-action-print:hover {
  background: #6d28d9;
  color: #ffffff;
  border-color: #6d28d9;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
}

/* Delete: Soft Red */
.btn-action-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-action-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

/* Back: Soft Neutral Slate */
.btn-action-back {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-action-back:hover {
  background: #475569;
  color: #ffffff;
  border-color: #475569;
}

/* Official Signatures Block */
.official-signatures-card {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.official-signatures-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f4c3a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 10px;
}
.official-signatures-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}
.signature-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}
.signature-box .sign-role {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.signature-box .sign-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 24px;
}
.signature-box .sign-dots {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 2px;
  border-bottom: 1px dotted #94a3b8;
  padding-bottom: 4px;
  margin-top: 10px;
}
.signature-box .sign-stamp-placeholder {
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   OFFICIAL RECTANGLES & FORM CONTROLS DESIGN SYSTEM (FORMS 08 - 19)
   تحسين وتطوير شكل مستطيلات إدخال وعرض البيانات
   ========================================================================== */

/* 1. الشريط المدمج للبيانات العامة (Compact Elevated General Bar) */
.compact-general-bar {
  background: linear-gradient(135deg, #ffffff 0%, #fbfdfc 100%) !important;
  border: 1px solid #cbd5e1 !important;
  border-right: 4px solid #0f4c3a !important;
  border-radius: 12px !important;
  padding: 10px 18px !important;
  margin-bottom: 16px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 16px !important;
  box-shadow: 0 3px 12px rgba(15, 76, 58, 0.05) !important;
}

.general-bar-badge {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0f4c3a !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding-left: 14px !important;
  border-left: 2px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

.general-bar-content {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 14px !important;
  flex: 1 !important;
}

.compact-field {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 5px 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.compact-field:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.compact-field label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.compact-field span, .compact-field strong {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #0f4c3a !important;
}

.compact-input,
.compact-field select,
.compact-field input {
  height: 36px !important;
  min-height: 36px !important;
  padding: 4px 10px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  outline: none !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.compact-input:focus,
.compact-field select:focus,
.compact-field input:focus {
  border-color: #0f4c3a !important;
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.16) !important;
  background: #ffffff !important;
}

/* 2. مستطيلات إدخال البيانات الموحدة (Inputs, Selects, Textareas, Table Controls) */
.form-control,
.table-control,
.field input,
.field select,
.field textarea,
table input[type="text"],
table input[type="number"],
table input[type="date"],
table select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Cairo', sans-serif !important;
  color: #1e293b !important;
  line-height: 1.5 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

select.form-control,
select.table-control,
.field select,
table select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: left 0.65rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1.1em 1.1em !important;
  padding-left: 2rem !important;
}

.form-control:hover,
.table-control:hover,
.field input:hover,
.field select:hover,
.field textarea:hover,
table input:hover,
table select:hover {
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.form-control:focus,
.table-control:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
table input:focus,
table select:focus {
  border-color: #0f4c3a !important;
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.16) !important;
  background-color: #ffffff !important;
}

.form-control:disabled,
.table-control:disabled,
.field input:disabled,
.field select:disabled,
table input:disabled,
table select:disabled {
  background-color: #f8fafc !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

input[type="number"].form-control,
input[type="number"].table-control,
.field input[type="number"],
table input[type="number"] {
  font-weight: 800 !important;
  text-align: center !important;
  color: #0f4c3a !important;
  letter-spacing: 0.5px !important;
}

.btn-quick-add,
.btn-outline {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f0fdf4 !important;
  border: 1.5px solid #bbf7d0 !important;
  color: #166534 !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
  height: 38px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.btn-quick-add:hover,
.btn-outline:hover {
  background: #166534 !important;
  border-color: #166534 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.25) !important;
}

/* 3. مستطيلات بطاقات الإدخال والعرض (Cards & Containers) */
.card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04) !important;
  padding: 20px 22px !important;
  margin-bottom: 20px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(15, 76, 58, 0.06) !important;
  border-color: #cbd5e1 !important;
}

.card .toolbar {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  padding: 12px 18px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  margin: -20px -22px 18px -22px !important;
  border-radius: 13px 13px 0 0 !important;
}

/* 4. مستطيلات مؤشرات الأداء الإحصائية (KPI Summary Rectangles in Show Pages) */
.kpi-card,
.stat-card,
.card[style*="border-right:4px"],
.card[style*="border-right: 4px"] {
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.kpi-card:hover,
.stat-card:hover,
.card[style*="border-right:4px"]:hover,
.card[style*="border-right: 4px"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
}

/* 5. مستطيلات عرض بيانات السجل في النموذج 19 والشاشات الفردية (.kv grid) */
.kv {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 14px !important;
  margin-top: 10px !important;
}

.kv > div {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-right: 3.5px solid #0f4c3a !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s ease !important;
}

.kv > div:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  border-right-color: #166534 !important;
  box-shadow: 0 4px 14px rgba(15, 76, 58, 0.08) !important;
  transform: translateY(-1px) !important;
}

.kv > div label {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
}

.kv > div strong {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  word-break: break-word !important;
}

/* 6. مستطيلات الحقول في شاشات الإدخال العادية (مثل النموذج 19 في forms/edit.blade.php) */
.form-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 16px !important;
}

.field {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  transition: all 0.2s ease !important;
}

.field:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.field label {
  display: block !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
}

/* 7. مستطيلات جداول الإدخال والعرض المتعددة (Tables, Headers, Rows, Footers) */
table.table,
.multi-entry-table,
.table-scroll table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

table.table thead th,
.multi-entry-table thead th,
.table-scroll table thead th {
  background: #0f4c3a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  padding: 10px 12px !important;
  text-align: center !important;
  border: none !important;
  border-bottom: 2px solid #093327 !important;
  white-space: nowrap !important;
}

table.table tbody td,
.multi-entry-table tbody td,
.table-scroll table tbody td {
  padding: 8px 10px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-left: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
  vertical-align: middle !important;
}

table.table tbody tr:hover td,
.multi-entry-table tbody tr:hover td,
.table-scroll table tbody tr:hover td {
  background: #fbfdfc !important;
}

table.table tfoot tr,
.multi-entry-table tfoot tr,
.table-scroll table tfoot tr {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
  border-top: 2px solid #a7f3d0 !important;
  font-weight: 800 !important;
  color: #065f46 !important;
}

@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .noprint, .toolbar, .pagination-box, .directory-toolbar, .hero-actions, .f-card-footer { display: none !important; }
  .workspace, .content { padding: 0; max-width: none; }
  .card, .f-card, .forms-directory { border: 0; box-shadow: none; padding: 0; }
  @page { size: A4 landscape; margin: 12mm; }
}


