/* ==========================================================================
   theme.css — هوية «الأسفلت وخطوط الطريق» v2 (Premium)
   طبقة فوق Design System "Ledger" داخل @layer legacy
   أقوى من النسخة السابقة: tokens أغنى · ظلال طبقية · أزرار متدرجة · دخول فاخر
   ========================================================================== */

/* ---------- 1) الرموز (Tokens) — فاتح ---------- */
:root {
  /* هوية الطريق */
  --asphalt:        #12151a;
  --asphalt-2:      #1a1e25;
  --asphalt-3:      #242a33;
  --marking:        #f5b800;
  --marking-hover:  #ffc933;
  --marking-deep:   #d99a00;
  --marking-ink:    #1f1600;
  --marking-soft:   #fff8e0;
  --marking-glow:   rgba(245, 184, 0, 0.32);

  /* حالات مالية */
  --paid:           #0f8a5a;
  --paid-soft:      #e3f6ee;
  --due:            #c43b28;
  --due-soft:       #fdecea;

  /* سطوح */
  --bg:             #eef1f5;
  --surface:        #ffffff;
  --surface-2:      #f6f8fb;
  --surface-3:      #eaedf3;
  --border:         #e0e5ed;
  --border-strong:  #c8d0dc;

  /* نص */
  --text:           #11151c;
  --text-2:         #353d4c;
  --muted:          #667084;
  --faint:          #97a1b4;

  /* أساسي = الأسفلت مع لمسة صفراء */
  --primary:        var(--asphalt);
  --primary-hover:  #000;
  --primary-soft:   var(--marking-soft);
  --primary-muted:  rgba(245, 184, 0, 0.22);
  --primary-glow:   var(--marking-glow);

  /* نظام */
  --success:        var(--paid);
  --success-soft:   var(--paid-soft);
  --warning:        #b45309;
  --warning-soft:   #fff4dc;
  --error:          var(--due);
  --error-soft:     var(--due-soft);
  --info:           #2a49d6;
  --info-soft:      #eaf0ff;

  /* مخططات */
  --chart-1:        #f5b800;
  --chart-2:        #3d63f0;
  --chart-3:        #0f8a5a;
  --chart-4:        #c43b28;
  --chart-5:        #7c5cfc;
  --chart-6:        #94a3b8;

  /* شريط جانبي */
  --sidebar-bg:     var(--asphalt);
  --sidebar-bg-2:   var(--asphalt-2);
  --sidebar-text:   rgba(255,255,255,0.92);
  --sidebar-muted:  rgba(255,255,255,0.48);
  --sidebar-hover:  rgba(255,255,255,0.07);
  --sidebar-active: linear-gradient(270deg, rgba(245,184,0,0.18), rgba(245,184,0,0.04));

  /* ظلال */
  --shadow-xs:  0 1px 2px rgba(14, 18, 28, 0.05);
  --shadow:     0 1px 2px rgba(14, 18, 28, 0.04), 0 8px 24px rgba(14, 18, 28, 0.06);
  --shadow-md:  0 12px 36px rgba(14, 18, 28, 0.12), 0 3px 8px rgba(14, 18, 28, 0.06);
  --shadow-lg:  0 28px 70px rgba(14, 18, 28, 0.20), 0 8px 20px rgba(14, 18, 28, 0.08);

  /* شكل */
  --radius:     14px;
  --radius-sm:  10px;
  --radius-lg:  18px;
  --ring:       0 0 0 4px rgba(245, 184, 0, 0.28);
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --dur:        0.2s;
  --sidebar-w:  268px;
  --sidebar-w-collapsed: 78px;
  --topbar-h:   66px;
}

/* ---------- 1b) الوضع الداكن ---------- */
html.dark, [data-theme="dark"] {
  --bg:             #0b0e14;
  --surface:        #141820;
  --surface-2:      #1a1f2a;
  --surface-3:      #222836;
  --border:         #2a3140;
  --border-strong:  #3a4356;
  --text:           #eef1f7;
  --text-2:         #c5cddc;
  --muted:          #8b95a8;
  --faint:          #5c677c;

  --primary:        #f5b800;
  --primary-hover:  #ffc933;
  --primary-soft:   rgba(245, 184, 0, 0.14);
  --primary-muted:  rgba(245, 184, 0, 0.28);
  --primary-glow:   rgba(245, 184, 0, 0.36);

  --paid:           #34d399;
  --paid-soft:      rgba(52, 211, 153, 0.14);
  --due:            #fb7185;
  --due-soft:       rgba(251, 113, 133, 0.14);

  --success:        #34d399;
  --success-soft:   rgba(52, 211, 153, 0.14);
  --warning:        #fbbf24;
  --warning-soft:   rgba(251, 191, 36, 0.14);
  --error:          #fb7185;
  --error-soft:     rgba(251, 113, 133, 0.14);
  --info:           #7f9fff;
  --info-soft:      rgba(127, 159, 255, 0.14);

  --chart-1:        #f5b800;
  --chart-2:        #6e92ff;
  --chart-3:        #34d399;
  --chart-4:        #fb7185;
  --chart-5:        #a78bfa;
  --chart-6:        #4b5568;

  --sidebar-bg:     #080b11;
  --sidebar-bg-2:   #0f131c;
  --sidebar-hover:  rgba(255,255,255,0.06);
  --sidebar-active: linear-gradient(270deg, rgba(245,184,0,0.22), rgba(245,184,0,0.05));

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.35);
  --shadow:     0 1px 2px rgba(0,0,0,0.35), 0 10px 28px rgba(0,0,0,0.28);
  --shadow-md:  0 14px 40px rgba(0,0,0,0.45);
  --shadow-lg:  0 32px 80px rgba(0,0,0,0.6);
  --ring:       0 0 0 4px rgba(245, 184, 0, 0.32);
  color-scheme: dark;
}

[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- 2) الشريط الجانبي (Premium) ---------- */
.sidebar {
  background:
    radial-gradient(380px 240px at 100% 0%, rgba(245,184,0,0.10), transparent 70%),
    linear-gradient(180deg, var(--asphalt-2) 0%, var(--asphalt) 100%);
  box-shadow: none;
  border-inline-end: 1px solid rgba(255,255,255,0.04);
}
.sidebar::after { display: none; }

.brand {
  padding: 22px 18px 18px;
  gap: 13px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--marking) 0%, var(--marking-deep) 100%);
  color: var(--marking-ink);
  box-shadow: 0 4px 14px var(--marking-glow), inset 0 1px 0 rgba(255,255,255,0.25);
  display: grid; place-items: center; flex: none;
}
.brand-icon svg { width: 22px; height: 22px; }
.brand b { font-size: 15.5px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.brand span { font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.52); }
.brand span::before { display: none; }

.sidebar-nav { padding: 6px 12px 20px; }
.nav-group {
  padding: 18px 12px 7px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}

a.nav {
  height: 44px;
  padding: 0 13px;
  gap: 12px;
  margin-bottom: 3px;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,0.76);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform 0.15s;
}
a.nav .nav-ic {
  width: 22px; height: 22px;
  background: none; box-shadow: none; border-radius: 0;
  color: rgba(255,255,255,0.48);
  transform: none;
  transition: color var(--dur);
}
a.nav:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
a.nav:hover .nav-ic { color: #fff; }
a.nav.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(245,184,0,0.12);
}
a.nav.active .nav-ic { color: var(--marking); }
a.nav.active::after {
  content: "";
  position: absolute;
  inset-inline-start: -12px;
  top: 10px; bottom: 10px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--marking), var(--marking-deep));
  box-shadow: 0 0 10px var(--marking-glow);
}
a.nav:focus-visible { box-shadow: inset 0 0 0 2px var(--marking); }

/* ---------- 3) الشريط العلوي والمحتوى ---------- */
.topbar {
  min-height: var(--topbar-h);
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
}
.topbar h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.content {
  padding: 26px 28px 64px;
  max-width: 1480px;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 56px 16px;
}

/* ---------- 4) الأزرار (أقوى) ---------- */
.btn, button:not(.nav):not(.seg button):not(.dz-chips button):not(.tabs button):not(.pw-eye):not(.ghost.pw-eye) {
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: 600 14px/1 "Cairo", system-ui, sans-serif;
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform 0.15s var(--ease),
    color var(--dur);
}
.btn:hover, button:not(.nav):hover {
  background: var(--surface-2);
  border-color: var(--faint);
}
.btn:active, button:not(.nav):active { transform: scale(0.98); }

/* الزر الأساسي = خط الطريق الأصفر (specificity عالية ليتغلب على Ledger) */
.btn.primary,
button.primary,
.auth-submit.primary,
button.btn.primary {
  background: linear-gradient(180deg, #f5b800 0%, #d99a00 100%) !important;
  border-color: #d99a00 !important;
  color: #1f1600 !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.28) inset,
    0 6px 18px rgba(245, 184, 0, 0.32) !important;
  font-weight: 700 !important;
}
.btn.primary:hover,
button.primary:hover,
.auth-submit.primary:hover,
button.btn.primary:hover {
  background: linear-gradient(180deg, #ffc933 0%, #f5b800 100%) !important;
  border-color: #f5b800 !important;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 10px 24px rgba(245, 184, 0, 0.38) !important;
}
.btn.primary:active,
button.primary:active {
  transform: translateY(0);
}

.btn.danger,
button.danger {
  color: var(--due);
  border-color: color-mix(in srgb, var(--due) 35%, transparent);
  background: var(--due-soft);
  box-shadow: none;
}
.btn.danger:hover,
button.danger:hover {
  background: var(--due);
  color: #fff;
  border-color: var(--due);
}

.btn.ghost,
button.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.btn.ghost:hover,
button.ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn.sm,
button.sm {
  height: 32px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 9px;
}
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* مجموعة أزرار مقسمة */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.seg button {
  min-height: 30px;
  padding: 2px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.seg button:hover { background: transparent; color: var(--text); }
.seg button.on {
  background: var(--surface);
  color: var(--asphalt);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
}
html.dark .seg button.on,
[data-theme="dark"] .seg button.on {
  color: var(--marking);
}

/* ---------- 5) النماذج ---------- */
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar input,
.toolbar select,
.modal input:not([type="checkbox"]),
.modal select,
.modal textarea,
.dz-filters select,
.login-card input,
.auth-card input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.form-grid textarea,
.modal textarea {
  height: auto;
  padding: 11px 14px;
  min-height: 88px;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.dz-filters select:focus,
.login-card input:focus,
.auth-card input:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
}
.form-grid label,
.modal label,
.auth-card label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* ---------- 6) البطاقات والجداول ---------- */
.card,
.dz-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.roads-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.roads-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 13px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.roads-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface-3);
}
.roads-table tbody tr {
  transition: background 0.12s;
}
.roads-table tbody tr:hover td {
  background: var(--surface-2);
}
.roads-table tbody tr:last-child td {
  border-bottom: 0;
}

/* الشارات */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.badge::before { display: none; }
.badge.ok {
  background: var(--paid-soft);
  color: #0a6b45;
}
.badge.warn {
  background: #fff3cf;
  color: #7a5a00;
}
.badge.danger,
.badge.err {
  background: var(--due-soft);
  color: #9d2f1a;
}
html.dark .badge.ok,
[data-theme="dark"] .badge.ok { color: #6ee7b7; }
html.dark .badge.warn,
[data-theme="dark"] .badge.warn { color: #fcd34d; }
html.dark .badge.danger,
html.dark .badge.err,
[data-theme="dark"] .badge.danger,
[data-theme="dark"] .badge.err { color: #fda4af; }

/* النوافذ المنبثقة */
.modal {
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ---------- 7) الجرس ---------- */
.bell-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  background: var(--surface);
}
.bell-n {
  top: -5px;
  inset-inline-start: -5px;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- 8) لوحة التحكم ---------- */
.dz { gap: 20px; }

.dz-road {
  border-radius: var(--radius-lg);
  padding: 26px 28px 24px;
  background:
    radial-gradient(500px 220px at 80% 0%, rgba(245,184,0,0.12), transparent 65%),
    linear-gradient(160deg, #1f252e 0%, #12151a 75%);
  box-shadow: var(--shadow-md);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.dz-road::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 40px,
    rgba(245,184,0,0.04) 40px,
    rgba(245,184,0,0.04) 42px
  );
  pointer-events: none;
}

.dz-kpi {
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.dz-kpi b { font-size: 26px; letter-spacing: -0.02em; }

.dz-panel {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}
.dz-panel h2 {
  font-size: 15.5px;
  margin-bottom: 16px;
  font-weight: 700;
}

.dz-setup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.dz-setup h2 { margin: 0 0 2px; font-size: 17px; }
.dz-setup > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.dz-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.dz-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color var(--dur), background var(--dur);
}
.dz-step .n {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.dz-step b { font-size: 14px; }
.dz-step > span:not(.n) {
  flex: 1;
  font-size: 12.5px;
  color: var(--muted);
}
.dz-step.done { background: var(--surface-2); }
.dz-step.done .n { background: var(--paid); color: #fff; }
.dz-step.next {
  border-color: var(--marking);
  background: var(--marking-soft);
}
.dz-step.next .n {
  background: linear-gradient(145deg, var(--marking), var(--marking-deep));
  color: var(--marking-ink);
  box-shadow: 0 2px 8px var(--marking-glow);
}

/* بطاقات المؤشرات */
.kpi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-card .kl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.kpi-ic {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex: none;
  color: var(--kc);
  background: color-mix(in srgb, var(--kc) 14%, transparent);
}
.kpi-ic svg { width: 18px; height: 18px; }
.kpi-card .kv {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 11px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-card .kv small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.kpi-card .kmeta {
  min-height: 22px;
  font-size: 12px;
  color: var(--muted);
}
.kpi-card .spark {
  display: block;
  width: calc(100% + 40px);
  height: 54px;
  margin: 6px -20px 0;
}
.kpi-card .spark .line {
  fill: none;
  stroke: var(--kc);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.delta.up   { color: #0a6b45; background: var(--paid-soft); }
.delta.down { color: #9d2f1a; background: var(--due-soft); }
.delta.neu  { color: var(--text-2); background: var(--surface-3); }
.delta.flat { color: var(--muted); background: var(--surface-3); }

/* المخطط */
.dz-chartbox { position: relative; }
.dz-chart {
  display: block;
  width: 100%;
  height: auto;
  direction: ltr;
  overflow: visible;
}
.dz-chart .grid { stroke: var(--border); stroke-dasharray: 3 4; }
.dz-chart text {
  font-size: 11px;
  fill: var(--muted);
  font-family: inherit;
  text-anchor: start;
}
.dz-chart text.xl { text-anchor: middle; }
.dz-line {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: dzdraw 1.1s cubic-bezier(.2,.7,.2,1) .1s forwards;
}
@keyframes dzdraw { to { stroke-dashoffset: 0; } }
.hov { display: none; }
.dz-cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.dz-chart circle.hov { stroke: #fff; stroke-width: 2.5; }
.dz-tip {
  position: absolute;
  top: 4px;
  z-index: 5;
  pointer-events: none;
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--asphalt);
  color: #fff;
  font-size: 12px;
  line-height: 1.8;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}
.dz-tip b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.dz-tip i {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-inline-end: 7px;
}

/* التحكم المقطّع + الأفاتار + الهيكل */
.dz-chips {
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-3);
  border-color: transparent;
}
.dz-chips button {
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font-weight: 600;
}
.dz-chips button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
}
.dz-row .av {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  margin-inline-end: 10px;
  font-size: 13px;
  font-weight: 700;
}
.skel {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: dzshimmer 1.4s infinite;
}
@keyframes dzshimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .dz-line { animation: none; stroke-dashoffset: 0; }
  .skel { animation: none; }
  .kpi-card { transition: none; }
}

/* ---------- 9) صفحات القوائم ---------- */
.pg-stats { margin-bottom: 18px; }
.kpi-card.no-spark { padding-bottom: 18px; }

.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 15px;
  background: var(--marking-soft);
  border: 1px solid #f0dfa0;
  border-inline-start: 3.5px solid var(--marking);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}
html.dark .hint,
[data-theme="dark"] .hint {
  background: rgba(245,184,0,0.1);
  border-color: rgba(245,184,0,0.25);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar > span { color: var(--muted); font-size: 13px; }

.tb-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 250px;
}
.tb-search svg {
  position: absolute;
  inset-inline-start: 13px;
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.tb-search input {
  width: 100%;
  padding-inline-start: 38px;
}

.tbl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 60px 16px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.tbl-empty .ic {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--marking-soft);
  color: #8a6500;
}
.tbl-empty .ic svg { width: 24px; height: 24px; }
.tbl-empty b { font-size: 16px; }
.tbl-empty span:not(.ic) {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.tbl-none {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
}
.roads-table tbody tr[hidden] { display: none; }

/* Command palette */
.cmd-btn kbd,
.cmd-foot kbd {
  font: 600 11px/1 "Cairo", sans-serif;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-inline-start: 6px;
  direction: ltr;
}
.cmd-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 15, 22, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 0;
}
.cmd {
  width: min(620px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdin 0.18s cubic-bezier(.2,.7,.2,1);
  border: 1px solid var(--border);
}
@keyframes cmdin {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
}
.cmd input {
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font: 600 16px "Cairo", sans-serif;
  outline: none;
  box-shadow: none;
  background: transparent;
}
.cmd-list {
  max-height: 50vh;
  overflow: auto;
  padding: 6px;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.cmd-item .tag {
  flex: none;
  min-width: 52px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.cmd-item small {
  margin-inline-start: auto;
  color: var(--muted);
}
.cmd-item.on,
.cmd-item:hover {
  background: var(--marking-soft);
}
html.dark .cmd-item.on,
html.dark .cmd-item:hover,
[data-theme="dark"] .cmd-item.on,
[data-theme="dark"] .cmd-item:hover {
  background: rgba(245,184,0,0.12);
}
.cmd-none {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.cmd-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 10) صفحة الدخول الفاخرة ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
/* في RTL: النموذج على اليمين (البداية) والبرومو على اليسار — نثبّت الترتيب البصري */
.auth-shell > .auth-form-side { order: 1; }
.auth-shell > .auth-promo { order: 2; }
html[dir="rtl"] .auth-shell > .auth-form-side { order: 2; }
html[dir="rtl"] .auth-shell > .auth-promo { order: 1; }
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(160deg, #f4f6f9 0%, #e8ecf2 100%);
}
html.dark .auth-form-side,
[data-theme="dark"] .auth-form-side {
  background: linear-gradient(160deg, #0e1219 0%, #0b0e14 100%);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 22px;
  padding: 36px 34px 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-card .logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.auth-card .logo-wrap img {
  width: 72px; height: 72px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.auth-card h1 {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.auth-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 22px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}
.auth-tabs button {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px;
  border-radius: 9px;
  font: 600 14px "Cairo", system-ui, sans-serif;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s var(--ease);
  box-shadow: none;
  height: auto;
}
.auth-tabs button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
  font-weight: 700;
}
.auth-tabs button:hover:not(.on) {
  color: var(--text-2);
}
.auth-card .field {
  margin-bottom: 14px;
}
.auth-card .field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.auth-card .field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  font: inherit;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.auth-card .field input:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
}
.auth-err {
  color: var(--due);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
}
.auth-submit {
  width: 100%;
  height: 48px !important;
  margin-top: 6px;
  font-size: 15.5px !important;
  border-radius: 12px !important;
}
.auth-hint {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.6;
}

/* الجانب التسويقي */
.auth-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(245,184,0,0.14), transparent 60%),
    radial-gradient(500px 360px at 90% 80%, rgba(245,184,0,0.08), transparent 55%),
    linear-gradient(155deg, #1a1f28 0%, #0f1218 55%, #0a0d12 100%);
  color: #fff;
  overflow: hidden;
}
.auth-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 48px,
      rgba(245,184,0,0.035) 48px,
      rgba(245,184,0,0.035) 50px
    );
  pointer-events: none;
}
.auth-promo .promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(245,184,0,0.14);
  border: 1px solid rgba(245,184,0,0.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--marking);
  width: fit-content;
  margin-bottom: 28px;
  position: relative;
}
.auth-promo h2 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.28;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  position: relative;
  max-width: 440px;
}
.auth-promo .lead {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.68);
  margin: 0 0 36px;
  max-width: 400px;
  position: relative;
}
.auth-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  position: relative;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
}
.auth-points li::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(245,184,0,0.18);
  border: 1.5px solid var(--marking);
  flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23f5b800'%3E%3Cpath d='M6.5 11.2L3.3 8l1.1-1.1 2.1 2.1 4.6-4.6L12.2 5.6z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}
.auth-promo .promo-foot {
  margin-top: auto;
  padding-top: 40px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.38);
  position: relative;
}

/* استجابة الدخول */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-promo { display: none; }
  .auth-form-side { min-height: 100vh; }
}

@media (max-width: 900px) {
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; }
}
@media (max-width: 700px) {
  .cmd-btn kbd { display: none; }
  .tb-search { min-width: 100%; order: 5; }
}
@media (prefers-reduced-motion: reduce) {
  .cmd { animation: none; }
}

/* ==========================================================================
   كشف حساب المقاول — فلاتر + رأس + مؤشرات + جداول
   ========================================================================== */
.stmt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.sf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sf-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.sf-field select,
.sf-field input[type="date"] {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.sf-field select:focus,
.sf-field input[type="date"]:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
}
.sf-contractor {
  flex: 1 1 280px;
  min-width: 240px;
  max-width: 420px;
}
.sf-contractor select {
  width: 100%;
  min-width: 240px;
}
.sf-field:not(.sf-contractor) {
  flex: 0 0 auto;
  width: 150px;
}
.sf-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
  padding-bottom: 1px;
}
.sf-actions .btn {
  height: 42px;
  min-width: 110px;
}

/* رأس الكشف */
.stmt-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(245,184,0,0.12), transparent 65%),
    linear-gradient(145deg, #1f252e 0%, #12151a 80%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.stmt-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stmt-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--marking), var(--marking-deep));
  color: var(--marking-ink);
  box-shadow: 0 4px 14px var(--marking-glow);
  flex: none;
}
.stmt-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}
.stmt-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.62);
}
.stmt-hero-due {
  text-align: end;
}
.stmt-hero-due .lbl {
  display: block;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
  font-weight: 600;
}
.stmt-hero-due strong {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stmt-hero-due strong.due { color: #ffb4a8; }
.stmt-hero-due strong.paid { color: #6ee7b7; }

/* بطاقات الملخص */
.stmt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stmt-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stmt-kpi.strong {
  border-color: color-mix(in srgb, var(--marking) 40%, var(--border));
  background: linear-gradient(180deg, var(--marking-soft), var(--surface));
}
html.dark .stmt-kpi.strong,
[data-theme="dark"] .stmt-kpi.strong {
  background: linear-gradient(180deg, rgba(245,184,0,0.1), var(--surface));
}
.sk-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.sk-value {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* عناوين الأقسام */
.stmt-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
}
.stmt-section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.stmt-section-head .badge {
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
}

.stmt-table-wrap {
  overflow: auto;
  margin-bottom: 8px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stmt-table-wrap .roads-table {
  box-shadow: none;
  margin: 0;
}
.stmt-total-row td {
  background: var(--surface-2) !important;
  border-top: 2px solid var(--border) !important;
  font-weight: 700;
}
.tbl-none-cell {
  text-align: center !important;
  color: var(--muted);
  padding: 28px 16px !important;
  font-size: 13.5px;
}

@media (max-width: 720px) {
  .stmt-filters { padding: 14px; gap: 12px; }
  .sf-contractor { flex: 1 1 100%; max-width: none; min-width: 0; }
  .sf-field:not(.sf-contractor) { width: calc(50% - 7px); flex: 1 1 auto; }
  .sf-actions { width: 100%; margin-inline-start: 0; }
  .sf-actions .btn { flex: 1; }
  .stmt-hero { padding: 18px; }
  .stmt-name { font-size: 17px; }
  .stmt-hero-due strong { font-size: 22px; }
  .stmt-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .stmt-filters, .hint { display: none !important; }
  .stmt-hero {
    background: #111 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .stmt-kpi, .stmt-table-wrap, .roads-table {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* ==========================================================================
   ترقية احترافية شاملة للنظام (v2.5 Premium System-wide)
   ========================================================================== */

/* ——— الطباعة والتباعد العام ——— */
.content {
  padding: 28px 32px 72px;
}
.hint {
  margin-bottom: 18px;
  border-radius: 13px;
  padding: 13px 16px;
  line-height: 1.75;
}

/* ——— الشريط العلوي الأقوى ——— */
.topbar {
  min-height: 68px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, var(--shadow-xs);
}
html.dark .topbar,
[data-theme="dark"] .topbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: none;
}
.topbar h1 {
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-end .btn,
.topbar-end button {
  height: 38px;
}
.menu-btn {
  border-radius: 11px !important;
}

/* ——— الشريط الجانبي أدق ——— */
.sidebar {
  width: var(--sidebar-w);
}
.brand {
  padding: 22px 18px 18px;
}
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}
.nav-group {
  padding: 22px 14px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
}
a.nav {
  height: 44px;
  border-radius: 12px;
  font-size: 13.75px;
}
a.nav.active {
  font-weight: 700;
}

/* ——— شريط الأدوات في الصفحات ——— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.toolbar .spacer { flex: 1 1 auto; min-width: 8px; }
.toolbar label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.toolbar label > select,
.toolbar label > input {
  min-width: 160px;
  height: 40px;
  font-weight: 500;
  color: var(--text);
}
.toolbar > select,
.toolbar > input[type="search"],
.toolbar > input[type="text"],
.toolbar #q {
  height: 40px;
  min-width: 200px;
  max-width: 320px;
  flex: 1 1 200px;
}
.toolbar .btn { height: 40px; }

/* ——— النماذج داخل النوافذ ——— */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px 18px;
}
.form-grid > label,
.form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0;
}
.form-grid > label.full,
.form-grid .field.full {
  grid-column: 1 / -1;
}
.form-grid input,
.form-grid select,
.form-grid textarea,
.modal input:not([type="checkbox"]),
.modal select,
.modal textarea {
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font: 500 14px/1.4 "Cairo", system-ui, sans-serif;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-grid textarea,
.modal textarea {
  height: auto;
  min-height: 90px;
  padding: 11px 13px;
  resize: vertical;
}
.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover,
.modal input:hover,
.modal select:hover,
.modal textarea:hover {
  border-color: var(--faint);
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
  background: var(--surface);
}

/* ——— النوافذ المنبثقة ——— */
.modal-overlay {
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal {
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  max-width: min(640px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-head h2,
.modal-head h3,
.modal h2,
.modal h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  padding: 0;
  border: 0;
}
.modal-body {
  padding: 22px;
}
.modal .row[style*="flex-end"],
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  margin: 0;
}
.modal .btn-icon,
.modal [data-close] {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal .btn-icon:hover,
.modal [data-close]:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ——— الجداول الاحترافية ——— */
.roads-table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
.roads-table th {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 13px 15px;
  letter-spacing: 0.02em;
  text-transform: none;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.roads-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--surface-3);
  vertical-align: middle;
}
.roads-table tbody tr {
  transition: background 0.12s ease;
}
.roads-table tbody tr:hover td {
  background: color-mix(in srgb, var(--marking) 5%, var(--surface));
}
.roads-table tbody tr:last-child td {
  border-bottom: 0;
}
.roads-table .btn.sm,
.roads-table button.sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
}

/* ——— الشارات والحالات ——— */
.badge {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge.ok {
  background: var(--paid-soft);
  color: #0a6b45;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paid) 18%, transparent);
}
.badge.warn {
  background: #fff6d6;
  color: #8a5b00;
  box-shadow: inset 0 0 0 1px rgba(245, 184, 0, 0.25);
}
.badge.danger,
.badge.err {
  background: var(--due-soft);
  color: #9d2f1a;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--due) 20%, transparent);
}

/* ——— بطاقات عامة ——— */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

/* ——— الحالة الفارغة ——— */
.tbl-empty {
  padding: 64px 20px;
  border-radius: 18px;
  border: 1.5px dashed var(--border-strong);
  background:
    radial-gradient(400px 160px at 50% 0%, var(--marking-soft), transparent 70%),
    var(--surface);
}
.tbl-empty .ic {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--marking-soft), #fff);
  color: #9a7200;
  box-shadow: 0 4px 14px rgba(245, 184, 0, 0.15);
}
html.dark .tbl-empty .ic,
[data-theme="dark"] .tbl-empty .ic {
  background: rgba(245, 184, 0, 0.12);
  color: var(--marking);
}
.tbl-empty b {
  font-size: 16.5px;
  margin-top: 4px;
}
.tbl-empty span:not(.ic) {
  max-width: 320px;
  line-height: 1.7;
}

/* ——— أزرار الإجراءات في الصفوف ——— */
.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* ——— تحسينات لوحة التحكم ——— */
.dz-road {
  position: relative;
  overflow: hidden;
}
.dz-kpis {
  gap: 14px;
}
.kpi-card {
  border-radius: 16px;
}
.kpi-card:hover {
  transform: translateY(-3px);
}

/* ——— حقول البحث ——— */
.tb-search {
  min-width: 260px;
}
.tb-search input {
  height: 40px;
  border-radius: 11px;
}

/* ——— تجاوب عام أقوى ——— */
@media (max-width: 900px) {
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 0 14px; min-height: 60px; }
  .toolbar { padding: 10px; gap: 8px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar label > select,
  .toolbar label > input {
    min-width: 0;
    width: 100%;
  }
  .toolbar > select,
  .toolbar > input {
    min-width: 0;
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ——— طباعة أنظف ——— */
@media print {
  .sidebar, .topbar, .toolbar, .hint, .menu-btn, .bell-btn, .stmt-filters {
    display: none !important;
  }
  .layout { display: block !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .roads-table, .card, .stmt-kpi, .stmt-hero {
    box-shadow: none !important;
  }
}

/* ——— إجراءات الصف في الجداول ——— */
.rd-actions,
.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.rd-actions .btn,
.row-actions .btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

/* ——— أرقام وأعمدة مالية ——— */
.roads-table td strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.roads-table .num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: end;
}

/* ——— تحسين الـ select العام ——— */
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23667084' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-inline-end: 14px;
  padding-inline-start: 14px;
}
html[dir="rtl"] select {
  background-position: left 12px center;
}

/* ——— سكرول الجداول ——— */
.table-wrap,
[style*="overflow:auto"] {
  border-radius: 14px;
}
[style*="overflow:auto"] .roads-table {
  border-radius: 14px;
}

/* ——— توست (إن وُجد) ——— */
.toast {
  border-radius: 12px !important;
  box-shadow: var(--shadow-md) !important;
  font-weight: 600 !important;
  border: 1px solid var(--border) !important;
}

/* ==========================================================================
   طبقة احترافية عليا v3 — تفاصيل دقيقة على مستوى المنتج
   ========================================================================== */

/* هيكل الشريط الجانبي بذيل */
.sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.02em;
}
.sidebar-foot .sf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--marking);
  box-shadow: 0 0 0 3px rgba(245,184,0,0.18);
  flex: none;
}

/* شريحة المستخدم في الشريط العلوي */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-inline-end: 4px;
}
.user-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--marking), var(--marking-deep));
  color: var(--marking-ink);
  flex: none;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  color: var(--muted) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.logout-btn:hover {
  color: var(--due) !important;
  background: var(--due-soft) !important;
}
.cmd-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  color: var(--text-2) !important;
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 11px !important;
  padding: 0 12px !important;
  height: 36px !important;
}
.cmd-btn kbd {
  font: 600 10.5px/1 ui-monospace, monospace;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-inline-start: 2px;
  direction: ltr;
}
.cmd-btn svg { opacity: 0.7; }

/* عنوان الصفحة داخل المحتوى */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.page-head .ph-text h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-head .ph-text p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 560px;
}
.page-head .ph-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* سطح المحتوى أنعم */
.main {
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(245,184,0,0.04), transparent 55%),
    var(--bg);
}
html.dark .main,
[data-theme="dark"] .main {
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(245,184,0,0.05), transparent 55%),
    var(--bg);
}

/* بطاقات أوضح قليلاً */
.card, .dz-panel, .toolbar, .stmt-filters {
  border-color: color-mix(in srgb, var(--border) 80%, var(--border-strong));
}

/* زر أساسي أكثر لمعانًا */
.btn.primary,
button.primary {
  letter-spacing: 0.01em;
}

/* الجداول: صف إجمالي + تحديد أفضل */
.roads-table thead th:first-child { border-start-start-radius: 13px; }
.roads-table thead th:last-child { border-start-end-radius: 13px; }

/* الهيكل أثناء التحميل */
.skel {
  border: 1px solid var(--border);
}

/* تحسين التلميحات */
.hint {
  background: linear-gradient(90deg, var(--marking-soft), color-mix(in srgb, var(--marking-soft) 40%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--marking) 28%, var(--border));
  border-inline-start: 3.5px solid var(--marking);
  box-shadow: var(--shadow-xs);
}
html.dark .hint,
[data-theme="dark"] .hint {
  background: linear-gradient(90deg, rgba(245,184,0,0.1), rgba(245,184,0,0.03));
}

/* شارات الحالة أكثر حدة */
.badge.ok::before,
.badge.warn::before,
.badge.danger::before,
.badge.err::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-inline-end: 6px;
  background: currentColor;
  opacity: 0.85;
}

/* نافذة الأمر أرقى */
.cmd {
  border: 1px solid var(--border-strong);
}
.cmd input {
  font-weight: 600;
}
.cmd-item.on,
.cmd-item:hover {
  background: linear-gradient(90deg, var(--marking-soft), transparent);
}

/* توست أنظف */
.toast {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  z-index: 300;
  padding: 12px 18px;
  border-radius: 13px;
  background: var(--asphalt);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: #9d2f1a; }
.toast.ok { background: #0a6b45; }

@media (max-width: 700px) {
  .user-name { display: none; }
  .user-chip { padding: 3px; }
  .cmd-btn kbd { display: none; }
  .sidebar-foot { display: none; }
}

/* ==========================================================================
   لوحة التحكم v3 — إعادة تصميم كاملة
   ========================================================================== */
.dz-v3 {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* شريط الفلاتر العلوي */
.dz-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.dz-bar-title h2 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dz-bar-title span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.dz-bar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dz-bar-controls select {
  height: 38px;
  min-width: 180px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 0 14px;
  font: 600 13.5px "Cairo", system-ui, sans-serif;
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.dz-bar-controls select:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
}
.dz-v3 .dz-chips {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.dz-v3 .dz-chips button {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px "Cairo", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.15s;
}
.dz-v3 .dz-chips button:hover { color: var(--text); }
.dz-v3 .dz-chips button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
  font-weight: 700;
}

/* البطل */
.dz-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 30px;
  border-radius: 20px;
  background:
    radial-gradient(500px 240px at 90% 10%, rgba(245,184,0,0.14), transparent 60%),
    radial-gradient(400px 200px at 10% 90%, rgba(245,184,0,0.06), transparent 50%),
    linear-gradient(145deg, #1c222c 0%, #12151a 70%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.dz-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 44px,
    rgba(245,184,0,0.03) 44px,
    rgba(245,184,0,0.03) 46px
  );
  pointer-events: none;
}
.dz-hero-main,
.dz-hero-side {
  position: relative;
}
.dz-hero-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}
.dz-hero-value {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dz-hero-value small {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-inline-start: 8px;
}
.dz-hero-sub {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.dz-hero-sub b {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
}

.dz-progress-track {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin-bottom: 12px;
}
.dz-progress-track .p {
  background: linear-gradient(90deg, #0f8a5a, #34d399);
  height: 100%;
}
.dz-progress-track .d {
  background: linear-gradient(90deg, #c43b28, #fb7185);
  height: 100%;
}
.dz-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}
.dz-progress-meta b {
  color: #fff;
  font-weight: 700;
  margin-inline: 4px;
}
.dz-progress-meta em {
  font-style: normal;
  color: rgba(255,255,255,0.45);
  font-size: 11.5px;
}
.dz-progress-meta .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 6px;
  vertical-align: middle;
}
.dz-progress-meta .dot.paid { background: #34d399; }
.dz-progress-meta .dot.due { background: #fb7185; }

.dz-hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dz-hero-split > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.dz-hero-split .lbl {
  display: block;
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 4px;
  font-weight: 600;
}
.dz-hero-split b {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* شبكة اللوحات */
.dz-v3 .dz-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.dz-grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.dz-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.dz-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* اللوحات */
.dz-v3 .dz-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.dz-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.dz-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dz-panel-head .badge {
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.dz-panel-chart .dz-chartbox {
  margin: 0 -4px;
}
.dz-v3 .dz-key {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.dz-v3 .dz-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
  vertical-align: middle;
}

/* قائمة الذمم */
.dz-list .dz-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--surface-3);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
  border-radius: 10px;
}
.dz-list .dz-row:last-child { border-bottom: 0; }
.dz-list .dz-row:hover { background: var(--surface-2); }
.dz-list .dz-row .nm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13.5px;
  grid-column: 1;
}
.dz-list .dz-row .nm em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-inline-start: 6px;
}
.dz-list .dz-row .am {
  font-weight: 700;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  grid-column: 2;
  grid-row: 1;
}
.dz-list .dz-row .am.ok { color: var(--paid); }
.dz-list .dz-row .dz-mini {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  display: flex;
  margin-top: 2px;
}
.dz-list .dz-row .dz-mini i:first-child {
  background: var(--paid);
  height: 100%;
}
.dz-list .dz-row .dz-mini i:last-child {
  background: var(--due);
  height: 100%;
}
.dz-list .dz-row .dz-sub {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.dz-list .av {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

/* النشاط */
.dz-activity .dz-act {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-3);
  font-size: 13px;
}
.dz-activity .dz-act:last-child { border-bottom: 0; }
.dz-activity .tag {
  flex: none;
  min-width: 48px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-2);
}
.dz-activity .tag.pay {
  background: var(--paid-soft);
  color: #0a6b45;
}
.dz-activity .tag.veh {
  background: var(--marking-soft);
  color: #8a6500;
}
.dz-activity .tx { flex: 1; min-width: 0; color: var(--text-2); }
.dz-activity .dt { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* تنبيهات */
.dz-v3 .dz-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--due-soft);
  border: 1px solid color-mix(in srgb, var(--due) 20%, transparent);
  margin-bottom: 8px;
}
.dz-v3 .dz-alert.idle {
  background: var(--marking-soft);
  border-color: color-mix(in srgb, var(--marking) 30%, transparent);
}
.dz-v3 .dz-alert .tx { flex: 1; min-width: 0; }
.dz-v3 .dz-alert .tx b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.dz-v3 .dz-alert .tx small { color: var(--muted); font-size: 12px; }
.dz-v3 .dz-alert i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--due);
  margin-top: 6px;
  flex: none;
}
.dz-v3 .dz-alert.idle i { background: var(--marking); }

/* صفوف الترتيب */
.dz-v3 .dz-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-3);
  font-size: 13px;
}
.dz-v3 .dz-row:last-child { border-bottom: 0; }
.dz-v3 .dz-row .nm { font-weight: 600; color: var(--text); }
.dz-v3 .dz-row .am { font-weight: 700; font-variant-numeric: tabular-nums; }
.dz-v3 .dz-row .dz-mini {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.dz-v3 .dz-row .dz-mini i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.dz-v3 .dz-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 13.5px;
}

/* دونات */
.dz-v3 .dz-donut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 0;
}
.dz-v3 .dz-dleg {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.dz-v3 .dz-dleg > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.dz-v3 .dz-dleg i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.dz-v3 .dz-dleg b { font-weight: 700; }
.dz-v3 .dz-dleg small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
}

/* دليل البدء */
.dz-v3 .dz-setup {
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.dz-v3 .dz-step.next {
  box-shadow: 0 0 0 1px var(--marking);
}

@media (max-width: 1100px) {
  .dz-v3 .dz-kpis { grid-template-columns: repeat(2, 1fr); }
  .dz-grid-2 { grid-template-columns: 1fr; }
  .dz-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .dz-hero { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .dz-hero-value { font-size: 34px; }
  .dz-v3 .dz-kpis { grid-template-columns: 1fr; }
  .dz-grid-3 { grid-template-columns: 1fr; }
  .dz-bar { flex-direction: column; align-items: stretch; }
  .dz-bar-controls { width: 100%; }
  .dz-bar-controls select { flex: 1; min-width: 0; }
}

/* ==========================================================================
   تشطيب احترافي نهائي — Product polish
   ========================================================================== */

/* مقياس تباعد أوضح */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
}

/* أسطح أنظف وحدود أدق */
.card,
.dz-panel,
.toolbar,
.stmt-filters,
.dz-bar,
.auth-card {
  border-color: color-mix(in srgb, var(--border) 70%, #c5cdd8);
  box-shadow:
    0 1px 2px rgba(15, 20, 30, 0.04),
    0 8px 24px rgba(15, 20, 30, 0.045);
}
html.dark .card,
html.dark .dz-panel,
html.dark .toolbar,
html.dark .stmt-filters,
html.dark .dz-bar,
[data-theme="dark"] .card,
[data-theme="dark"] .dz-panel,
[data-theme="dark"] .toolbar,
[data-theme="dark"] .stmt-filters,
[data-theme="dark"] .dz-bar {
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 10px 28px rgba(0,0,0,0.2);
}

/* الشريط الجانبي أكثر هدوءًا */
.sidebar {
  background:
    radial-gradient(360px 200px at 100% 0%, rgba(245,184,0,0.09), transparent 70%),
    linear-gradient(180deg, #171b22 0%, #10141a 100%);
}
a.nav {
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
a.nav.active {
  background: linear-gradient(270deg, rgba(245,184,0,0.16), rgba(245,184,0,0.04));
  box-shadow: inset 0 0 0 1px rgba(245,184,0,0.1);
}

/* الشريط العلوي أنحف وأكثر أناقة */
.topbar {
  min-height: 62px;
  background: rgba(255,255,255,0.86);
  border-bottom-color: color-mix(in srgb, var(--border) 85%, transparent);
}
html.dark .topbar,
[data-theme="dark"] .topbar {
  background: rgba(20, 24, 32, 0.88);
}
.topbar h1 {
  font-size: 17.5px;
  font-weight: 700;
}
.topbar .sub {
  font-size: 12px;
  opacity: 0.9;
}

/* المحتوى */
.content {
  padding: 26px 30px 68px;
  max-width: 1400px;
}

/* مؤشرات KPI بمظهر منتج */
.kpi-card {
  padding: 16px 18px 0;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, #c8d0dc);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15,20,30,0.04), 0 6px 18px rgba(15,20,30,0.04);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15,20,30,0.1), 0 2px 6px rgba(15,20,30,0.05);
}
.kpi-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.kpi-card .kl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.kpi-card .kv {
  font-size: 26px;
  margin-top: 8px;
  letter-spacing: -0.03em;
}
.kpi-card .kmeta {
  font-size: 11.5px;
  margin-top: 2px;
  margin-bottom: 2px;
}

/* البطل في اللوحة */
.dz-hero {
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 16px 40px rgba(0,0,0,0.28);
}
.dz-hero-value {
  font-size: 40px;
  letter-spacing: -0.035em;
}
.dz-hero-label {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* رؤوس اللوحات */
.dz-panel-head h2,
.dz-v3 .dz-panel > h2 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.dz-panel-head .badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 700;
}

/* الجداول أكثر هدقة */
.roads-table {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, #c5cdd8);
  box-shadow: 0 1px 2px rgba(15,20,30,0.035), 0 6px 18px rgba(15,20,30,0.035);
  font-size: 13.25px;
}
.roads-table th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-3) 70%, var(--surface-2)) 100%);
}
.roads-table td {
  padding: 12px 14px;
}
.roads-table tbody tr:hover td {
  background: color-mix(in srgb, var(--marking) 4%, var(--surface));
}

/* الأزرار */
.btn,
button.btn {
  border-radius: 10px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.btn.primary,
button.primary {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 4px 12px rgba(245, 184, 0, 0.28) !important;
}
.btn.primary:hover,
button.primary:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 8px 20px rgba(245, 184, 0, 0.35) !important;
}

/* التلميح */
.hint {
  font-size: 13px;
  line-height: 1.7;
  border-radius: 12px;
  padding: 12px 15px;
}

/* شريط الأدوات */
.toolbar {
  padding: 11px 14px;
  border-radius: 14px;
  gap: 10px;
}

/* النوافذ */
.modal {
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 28px 70px rgba(10, 12, 18, 0.35);
}
.modal-head {
  padding: 16px 20px;
}
.modal-body {
  padding: 20px;
}
.modal-foot {
  padding: 14px 20px;
}

/* شريحة المستخدم */
.user-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.user-av {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

/* دخول */
.auth-card {
  border-radius: 20px;
  padding: 34px 32px 30px;
  box-shadow:
    0 1px 2px rgba(15,20,30,0.04),
    0 24px 56px rgba(15,20,30,0.1);
}
.auth-card h1 {
  font-size: 20px;
  letter-spacing: -0.025em;
}
.auth-submit {
  height: 46px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
}

/* كشف الحساب */
.stmt-hero {
  border-radius: 18px;
}
.stmt-filters {
  border-radius: 16px;
  padding: 16px 18px;
}
.stmt-kpi {
  border-radius: 12px;
  padding: 12px 14px;
}
.sk-value {
  font-size: 16px;
  letter-spacing: -0.025em;
}

/* تحسين عام للنص */
body {
  font-feature-settings: "kern" 1, "liga" 1;
}
h1, h2, h3, .topbar h1, .dz-hero-value, .kpi-card .kv {
  text-rendering: geometricPrecision;
}

/* تقليل الضوضاء البصرية في الشبكة */
.dz-v3 {
  gap: 16px;
}
.dz-grid-2,
.dz-grid-3 {
  gap: 14px;
}
.dz-v3 .dz-panel {
  padding: 16px 18px 14px;
  border-radius: 16px;
}

@media (max-width: 900px) {
  .content { padding: 16px 14px 48px; }
  .dz-hero-value { font-size: 32px; }
}

/* ==========================================================================
   أيقونات ورسومات احترافية
   ========================================================================== */

/* أيقونات القائمة */
a.nav .nav-ic {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  color: rgba(255,255,255,0.48);
  transition: color 0.18s, transform 0.18s, background 0.18s;
}
a.nav .nav-ic svg {
  width: 18px;
  height: 18px;
  display: block;
}
a.nav:hover .nav-ic {
  color: rgba(255,255,255,0.92);
}
a.nav.active .nav-ic {
  color: var(--marking);
  background: rgba(245,184,0,0.12);
  border-radius: 8px;
  width: 30px;
  height: 30px;
}
a.nav.active .nav-ic svg {
  width: 17px;
  height: 17px;
}

/* أيقونة العلامة */
.brand-icon {
  display: grid;
  place-items: center;
}
.brand-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}

/* أيقونات الأزرار */
.btn svg,
button svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.btn.sm svg,
button.sm svg {
  width: 14px;
  height: 14px;
}

/* حالات فارغة برسومات أوضح */
.tbl-empty .ic {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), transparent 55%),
    linear-gradient(145deg, #fff6d1, #ffe8a0);
  color: #9a7200;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 8px 20px rgba(245,184,0,0.18);
}
.tbl-empty .ic svg {
  width: 28px;
  height: 28px;
}
html.dark .tbl-empty .ic,
[data-theme="dark"] .tbl-empty .ic {
  background: rgba(245,184,0,0.14);
  color: var(--marking);
  box-shadow: none;
}

/* أيقونات KPI */
.kpi-ic svg {
  width: 17px;
  height: 17px;
}

/* رسوم صغيرة في التلميحات */
.hint::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  background: center / 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6500' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16h.01'/%3E%3C/svg%3E");
}
.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* أيقونة الخروج */
.logout-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

/* تحسين أيقونة البحث في الشريط */
.cmd-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.75;
}

/* نقاط التنبيه كأيقونات */
.dz-v3 .dz-alert i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--due) 16%, transparent);
  position: relative;
  margin-top: 1px;
}
.dz-v3 .dz-alert i::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--due);
  background: none;
}
.dz-v3 .dz-alert.idle i {
  background: color-mix(in srgb, var(--marking) 18%, transparent);
}
.dz-v3 .dz-alert.idle i::after {
  content: "⏱";
  font-size: 11px;
  color: #8a6500;
}

/* ==========================================================================
   تأثيرات حركية للأيقونات (Micro-interactions)
   ========================================================================== */

/* أساسيات الحركة */
a.nav .nav-ic,
a.nav .nav-ic svg,
.brand-icon,
.brand-icon svg,
.kpi-ic,
.kpi-ic svg,
.btn svg,
button svg,
.tbl-empty .ic,
.user-av,
.cmd-btn svg,
.logout-btn svg {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.25s ease,
    opacity 0.2s ease;
}

/* القائمة: حركة عند المرور */
a.nav:hover .nav-ic {
  transform: translateX(-2px) scale(1.06);
  color: #fff;
}
a.nav:hover .nav-ic svg {
  transform: scale(1.05);
}
html[dir="rtl"] a.nav:hover .nav-ic {
  transform: translateX(2px) scale(1.06);
}

/* القائمة: العنصر النشط */
a.nav.active .nav-ic {
  transform: scale(1.08);
  animation: navPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
a.nav.active .nav-ic svg {
  transform: scale(1);
}
@keyframes navPop {
  0%   { transform: scale(0.86); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1.08); }
}

/* عند النقر على عنصر القائمة */
a.nav:active .nav-ic {
  transform: scale(0.94);
  transition-duration: 0.1s;
}

/* أيقونة العلامة (البراند) */
.brand-icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.brand:hover .brand-icon {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 6px 18px var(--marking-glow), inset 0 1px 0 rgba(255,255,255,0.3);
}
.brand:hover .brand-icon svg {
  transform: scale(1.05);
}

/* أيقونات الأزرار */
.btn:hover svg,
button:hover svg {
  transform: scale(1.1);
}
.btn:active svg,
button:active svg {
  transform: scale(0.92);
  transition-duration: 0.08s;
}
.btn.primary:hover svg {
  transform: scale(1.12) translateY(-0.5px);
}

/* زر الخروج */
.logout-btn:hover svg {
  transform: translateX(3px);
}
html[dir="rtl"] .logout-btn:hover svg {
  transform: translateX(-3px);
}

/* زر البحث */
.cmd-btn:hover svg {
  transform: scale(1.12) rotate(-8deg);
  opacity: 1;
}

/* بطاقات KPI */
.kpi-card:hover .kpi-ic {
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--kc) 22%, transparent);
}
.kpi-card:hover .kpi-ic svg {
  transform: scale(1.05);
}

/* الحالات الفارغة */
.tbl-empty .ic {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.tbl-empty:hover .ic {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 12px 28px rgba(245,184,0,0.22);
}

/* أفاتار المستخدم */
.user-chip:hover .user-av {
  transform: scale(1.08);
  box-shadow: 0 2px 8px var(--marking-glow);
}

/* تنبيهات اللوحة */
.dz-v3 .dz-alert i {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.dz-v3 .dz-alert:hover i {
  transform: scale(1.12);
}

/* ظهور تدريجي لأيقونات القائمة عند التحميل */
@keyframes navFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sidebar-nav a.nav {
  animation: navItemIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.sidebar-nav a.nav:nth-child(1) { animation-delay: 0.02s; }
.sidebar-nav a.nav:nth-child(2) { animation-delay: 0.04s; }
.sidebar-nav a.nav:nth-child(3) { animation-delay: 0.06s; }
.sidebar-nav a.nav:nth-child(4) { animation-delay: 0.08s; }
.sidebar-nav a.nav:nth-child(5) { animation-delay: 0.10s; }
.sidebar-nav a.nav:nth-child(6) { animation-delay: 0.12s; }
.sidebar-nav a.nav:nth-child(7) { animation-delay: 0.14s; }
.sidebar-nav a.nav:nth-child(8) { animation-delay: 0.16s; }
.sidebar-nav a.nav:nth-child(9) { animation-delay: 0.18s; }
.sidebar-nav a.nav:nth-child(10) { animation-delay: 0.20s; }
.sidebar-nav a.nav:nth-child(11) { animation-delay: 0.22s; }
.sidebar-nav a.nav:nth-child(12) { animation-delay: 0.24s; }
@keyframes navItemIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
html[dir="rtl"] .sidebar-nav a.nav {
  animation-name: navItemInRtl;
}
@keyframes navItemInRtl {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* نبضة خفيفة لأيقونة البراند عند التحميل */
.brand-icon {
  animation: brandIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes brandIn {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  a.nav .nav-ic,
  a.nav .nav-ic svg,
  .brand-icon,
  .brand-icon svg,
  .kpi-ic,
  .kpi-ic svg,
  .btn svg,
  button svg,
  .tbl-empty .ic,
  .user-av,
  .cmd-btn svg,
  .logout-btn svg,
  .sidebar-nav a.nav {
    animation: none !important;
    transition: none !important;
  }
  a.nav:hover .nav-ic,
  a.nav.active .nav-ic,
  .brand:hover .brand-icon,
  .kpi-card:hover .kpi-ic,
  .btn:hover svg {
    transform: none !important;
  }
}

/* ==========================================================================
   دقة بصرية عالية — Precision layer
   شبكة 4px · محاذاة صارمة · ارتفاعات موحّدة · تباين أوضح
   ========================================================================== */

:root {
  /* شبكة */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  /* ارتفاعات مكوّنات */
  --h-xs: 28px;
  --h-sm: 32px;
  --h-md: 40px;
  --h-lg: 44px;
  --h-xl: 48px;
  /* خطوط */
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-base: 14px;
  --fs-lg: 15.5px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 32px;
  /* أنصاف أقطار أدق */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
}

/* ——— شريط جانبي: محاذاة بكسلية ——— */
.sidebar {
  width: 260px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  min-height: 72px;
}
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex: none;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-text b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.brand-text span {
  display: block;
  font-size: 11.5px;
  line-height: 1.3;
  margin-top: 2px;
}
.sidebar-nav { padding: 4px 10px 16px; }
.nav-group {
  padding: 16px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.34);
}
a.nav {
  height: 40px;
  padding: 0 10px;
  gap: 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  font-size: 13.25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
}
a.nav .nav-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
a.nav .nav-ic svg {
  width: 17px;
  height: 17px;
}
a.nav.active .nav-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(245,184,0,0.14);
}
a.nav.active::after {
  width: 3px;
  border-radius: 0 3px 3px 0;
  top: 8px;
  bottom: 8px;
}
a.nav .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot {
  padding: 12px 16px 16px;
  font-size: 11.5px;
}

/* ——— شريط علوي ——— */
.topbar {
  min-height: 60px;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title { min-width: 0; flex: 1; }
.topbar h1 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.topbar .sub {
  font-size: 12px;
  line-height: 1.3;
  margin-top: 1px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.menu-btn {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 9px !important;
}

/* شريحة المستخدم */
.user-chip {
  height: 34px;
  padding: 3px 10px 3px 4px;
  gap: 8px;
}
.user-av {
  width: 26px;
  height: 26px;
  font-size: 11.5px;
}
.user-name {
  font-size: 12.5px;
  max-width: 120px;
}
.cmd-btn {
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 12.5px !important;
  border-radius: 9px !important;
  gap: 6px !important;
}
.cmd-btn kbd {
  font-size: 10px;
  padding: 2px 5px;
}
.logout-btn {
  height: 34px !important;
  font-size: 12.5px !important;
  padding: 0 10px !important;
}

/* ——— المحتوى ——— */
.content {
  padding: 22px 24px 56px;
  max-width: 1360px;
}

/* ——— أزرار موحّدة ——— */
.btn,
button.btn,
button:not(.nav):not(.seg button):not(.dz-chips button):not(.auth-tabs button):not(.pw-eye) {
  height: var(--h-md);
  min-height: var(--h-md);
  padding: 0 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.btn.sm,
button.sm {
  height: var(--h-sm);
  min-height: var(--h-sm);
  padding: 0 11px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}
.btn.primary,
button.primary {
  font-weight: 700;
}

/* ——— حقول ——— */
.form-grid input,
.form-grid select,
.form-grid textarea,
.toolbar input,
.toolbar select,
.modal input:not([type="checkbox"]),
.modal select,
.modal textarea,
.sf-field select,
.sf-field input,
.dz-bar-controls select,
.login-card input,
.auth-card input {
  height: var(--h-md);
  min-height: var(--h-md);
  padding: 0 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.3;
}
.form-grid textarea,
.modal textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.55;
}
.form-grid > label,
.form-grid .field,
.modal label,
.sf-field label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
  gap: 6px;
  letter-spacing: -0.01em;
}

/* ——— شريط أدوات ——— */
.toolbar {
  min-height: 56px;
  padding: 10px 12px;
  gap: 8px;
  border-radius: var(--r-xl);
  align-items: center;
}
.toolbar .btn { height: var(--h-md); }
.toolbar label {
  font-size: 11.5px;
  gap: 4px;
}
.toolbar label > select,
.toolbar label > input {
  height: var(--h-md);
  min-width: 150px;
  font-size: var(--fs-md);
}

/* ——— جداول دقيقة ——— */
.roads-table {
  border-radius: var(--r-xl);
  font-size: 13px;
  line-height: 1.35;
}
.roads-table th {
  height: 42px;
  padding: 0 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.roads-table td {
  height: 48px;
  padding: 8px 14px;
  vertical-align: middle;
}
.roads-table .rd-actions {
  gap: 4px;
}
.roads-table .btn.sm {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

/* ——— شارات ——— */
.badge {
  height: 22px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  border-radius: 999px;
}

/* ——— تلميح ——— */
.hint {
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.65;
  border-radius: var(--r-lg);
  gap: 10px;
  margin-bottom: 14px;
}
.hint::before {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background-size: 16px;
}

/* ——— بطاقات KPI ——— */
.kpi-card {
  padding: 14px 16px 0;
  border-radius: var(--r-xl);
  min-height: 132px;
}
.kpi-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.kpi-ic svg { width: 16px; height: 16px; }
.kpi-card .kl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.kpi-card .kv {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 8px;
}
.kpi-card .kv small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.kpi-card .kmeta {
  font-size: 11.5px;
  min-height: 18px;
  color: var(--muted);
}
.kpi-card .spark {
  height: 44px;
  margin-top: 4px;
}
.delta {
  height: 20px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* ——— لوحة التحكم ——— */
.dz-bar {
  padding: 12px 16px;
  border-radius: var(--r-xl);
  gap: 12px;
}
.dz-bar-title h2 {
  font-size: 15.5px;
  letter-spacing: -0.02em;
}
.dz-bar-title span { font-size: 12px; }
.dz-bar-controls select {
  height: 34px;
  min-height: 34px;
  font-size: 13px;
  border-radius: 9px;
}
.dz-v3 .dz-chips button {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}
.dz-hero {
  padding: 24px 26px;
  border-radius: 18px;
  gap: 24px;
}
.dz-hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.dz-hero-value {
  font-size: 36px;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.dz-hero-value small {
  font-size: 14px;
  margin-inline-start: 6px;
}
.dz-hero-sub { font-size: 12.5px; margin-top: 8px; }
.dz-progress-track { height: 10px; margin-bottom: 10px; }
.dz-progress-meta { font-size: 12px; gap: 12px 16px; margin-bottom: 14px; }
.dz-hero-split > div {
  padding: 10px 12px;
  border-radius: 10px;
}
.dz-hero-split .lbl { font-size: 11px; margin-bottom: 3px; }
.dz-hero-split b { font-size: 15px; }

.dz-v3 .dz-panel {
  padding: 14px 16px 12px;
  border-radius: var(--r-xl);
}
.dz-panel-head {
  margin-bottom: 12px;
  min-height: 28px;
}
.dz-panel-head h2 {
  font-size: 14px;
  letter-spacing: -0.015em;
}
.dz-panel-head .badge {
  height: 20px;
  font-size: 10.5px;
  padding: 0 8px;
}

/* قائمة الذمم */
.dz-list .dz-row {
  padding: 10px 4px;
  gap: 3px 10px;
}
.dz-list .dz-row .nm { font-size: 13px; gap: 8px; }
.dz-list .av {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
}
.dz-list .dz-row .am { font-size: 13px; }
.dz-list .dz-row .dz-mini { height: 4px; }
.dz-list .dz-row .dz-sub { font-size: 11px; }

/* نشاط */
.dz-activity .dz-act {
  padding: 9px 0;
  gap: 8px;
  font-size: 12.5px;
}
.dz-activity .tag {
  min-width: 44px;
  padding: 2px 7px;
  font-size: 10.5px;
  border-radius: 6px;
}
.dz-activity .dt { font-size: 11.5px; }

/* ——— كشف الحساب ——— */
.stmt-filters {
  padding: 14px 16px;
  gap: 12px;
  border-radius: var(--r-xl);
}
.sf-field label { font-size: 11.5px; }
.sf-field select,
.sf-field input[type="date"] {
  height: var(--h-md);
  font-size: 13.5px;
}
.sf-contractor { min-width: 220px; max-width: 380px; }
.sf-actions .btn { height: var(--h-md); min-width: 100px; }
.stmt-hero { padding: 20px 22px; border-radius: 18px; gap: 16px; }
.stmt-avatar { width: 48px; height: 48px; border-radius: 13px; font-size: 20px; }
.stmt-name { font-size: 18px; letter-spacing: -0.02em; }
.stmt-meta { font-size: 12.5px; }
.stmt-hero-due strong { font-size: 26px; }
.stmt-kpis { gap: 10px; margin-bottom: 20px; }
.stmt-kpi { padding: 12px 14px; border-radius: 11px; gap: 4px; }
.sk-label { font-size: 11.5px; }
.sk-value { font-size: 15.5px; }
.stmt-section-head { margin: 18px 0 8px; }
.stmt-section-head h3 { font-size: 14px; }

/* ——— نوافذ ——— */
.modal { border-radius: 18px; max-width: min(560px, 100%); }
.modal-head { padding: 14px 18px; min-height: 52px; }
.modal-head h2 { font-size: 15.5px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px; gap: 8px; }
.modal .btn-icon,
.modal [data-close] {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
}

/* ——— دخول ——— */
.auth-card {
  width: min(400px, 100%);
  padding: 32px 28px 28px;
  border-radius: 18px;
}
.auth-card .logo-wrap img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.auth-card h1 { font-size: 18.5px; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; margin-bottom: 18px; }
.auth-tabs {
  padding: 3px;
  border-radius: 11px;
  margin-bottom: 18px;
}
.auth-tabs button {
  padding: 9px;
  font-size: 13px;
  border-radius: 8px;
}
.auth-card .field { margin-bottom: 12px; }
.auth-card .field label { font-size: 12.5px; margin-bottom: 5px; }
.auth-card .field input {
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
}
.auth-submit {
  height: 44px !important;
  font-size: 14.5px !important;
  border-radius: 11px !important;
  margin-top: 4px;
}
.auth-promo { padding: 44px 48px; }
.auth-promo h2 {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  max-width: 420px;
}
.auth-promo .lead {
  font-size: 15px;
  max-width: 380px;
  margin-bottom: 28px;
}
.auth-points { gap: 12px; }
.auth-points li { font-size: 14px; gap: 10px; }
.auth-points li::before {
  width: 20px;
  height: 20px;
  background-size: 11px;
}
.promo-badge {
  font-size: 12px;
  padding: 6px 12px;
  margin-bottom: 22px;
}

/* ——— حالات فارغة ——— */
.tbl-empty {
  padding: 48px 20px;
  border-radius: 16px;
  gap: 6px;
}
.tbl-empty .ic {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 4px;
}
.tbl-empty .ic svg { width: 24px; height: 24px; }
.tbl-empty b { font-size: 15px; }
.tbl-empty span:not(.ic) { font-size: 12.5px; max-width: 280px; }

/* ——— توست ——— */
.toast {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  inset-inline-end: 18px;
  bottom: 18px;
}

/* ——— تجاوب أدق ——— */
@media (max-width: 1100px) {
  .dz-v3 .dz-kpis { grid-template-columns: repeat(2, 1fr); }
  .dz-grid-2, .dz-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 0 12px; height: 56px; min-height: 56px; }
  .topbar h1 { font-size: 15.5px; }
  .dz-hero { padding: 20px; }
  .dz-hero-value { font-size: 30px; }
}
@media (max-width: 600px) {
  .dz-v3 .dz-kpis { grid-template-columns: 1fr; }
  .user-name { display: none; }
  .cmd-btn kbd { display: none; }
  .sf-contractor { min-width: 0; max-width: none; flex: 1 1 100%; }
}

/* ==========================================================================
   لوحة التحكم — اختصارات سريعة وبلاطات الملخص
   ========================================================================== */
.dz-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.dz-q {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.88);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.dz-q:hover {
  background: rgba(245,184,0,0.16);
  border-color: rgba(245,184,0,0.35);
  color: #fff;
  transform: translateY(-1px);
}
.dz-q .qi {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--marking);
}
.dz-q .qi svg {
  width: 16px;
  height: 16px;
}

.dz-hero-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dz-tile {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}
.dz-tile .lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.dz-tile b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dz-tile.accent {
  background: rgba(245,184,0,0.12);
  border-color: rgba(245,184,0,0.22);
}
.dz-tile.accent .lbl { color: rgba(245,184,0,0.75); }
.dz-tile.accent b { color: var(--marking); }

/* إخفاء التقسيم القديم إن وُجد */
.dz-hero-split { display: none; }

@media (max-width: 720px) {
  .dz-quick { margin-top: 14px; }
  .dz-q { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .dz-hero-tiles { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   نظام قوائم احترافي — إحصائيات أعلى الصفحة + بحث + فارغ
   ========================================================================== */
.pg-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pg-stats .kpi-card {
  min-height: 96px;
  padding: 14px 16px 14px;
}
.pg-stats .kpi-card .spark { display: none; }
.pg-stats .kpi-card .kv {
  font-size: 22px;
  margin-top: 6px;
}

.tbl-none {
  margin-top: 12px;
  padding: 28px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--muted);
}
.tbl-none b {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}
.tbl-none span {
  font-size: 12.5px;
}

.tb-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 220px;
  flex: 1 1 200px;
  max-width: 320px;
}
.tb-search svg {
  position: absolute;
  inset-inline-start: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.tb-search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  font: 500 13.5px "Cairo", system-ui, sans-serif;
  box-shadow: var(--shadow-xs);
}
html[dir="rtl"] .tb-search input {
  padding: 0 36px 0 12px;
}
html[dir="rtl"] .tb-search svg {
  inset-inline-start: auto;
  inset-inline-end: 12px;
}
.tb-search input:focus {
  border-color: var(--marking);
  box-shadow: var(--ring);
  outline: none;
}

.toolbar .badge {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .pg-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pg-stats { grid-template-columns: 1fr; }
  .tb-search { max-width: none; flex: 1 1 100%; }
}

/* ==========================================================================
   تحسينات احترافية مركّزة — Focus · Selection · Sticky · Scroll · Print
   ========================================================================== */

/* تحديد النص بلون الهوية */
::selection {
  background: rgba(245, 184, 0, 0.28);
  color: var(--text);
}

/* تركيز لوحة المفاتيح واضح ومتسق */
:focus-visible {
  outline: 2px solid var(--marking);
  outline-offset: 2px;
  border-radius: 6px;
}
button:focus-visible,
.btn:focus-visible,
a.nav:focus-visible {
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--marking) !important;
  box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.22) !important;
}

/* شريط التمرير أنيق */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 112, 132, 0.35) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(102, 112, 132, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 112, 132, 0.45);
  background-clip: padding-box;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
}

/* رؤوس جداول ثابتة عند التمرير */
.roads-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
}

/* حاوية الجدول */
div[style*="overflow"] {
  border-radius: 16px;
}

/* انتقال ناعم للمحتوى */
.content > * {
  animation: contentIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes contentIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* زر أساسي مضمون اللون */
.btn.primary,
button.primary,
.auth-submit {
  background: linear-gradient(135deg, #ffcc33 0%, #f5b800 45%, #e0a800 100%) !important;
  color: #1f1600 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-weight: 700 !important;
}
.btn.primary:hover,
button.primary:hover,
.auth-submit:hover {
  background: linear-gradient(135deg, #ffd54a 0%, #ffc107 50%, #f5b800 100%) !important;
  filter: brightness(1.02);
}

/* بطاقات بمحيط أدق */
.kpi-card,
.dz-panel,
.card,
.toolbar,
.stmt-filters,
.dz-bar {
  position: relative;
}

/* شارات الحالة أوضح */
.badge.ok {
  background: var(--paid-soft);
  color: #0a6b45;
}
.badge.warn {
  background: var(--marking-soft);
  color: #8a6500;
}
.badge.danger,
.badge.err {
  background: var(--due-soft);
  color: #9d2f1a;
}

/* تحسين الطباعة (كشف الحساب) */
@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .stmt-filters,
  .dz-bar,
  .dz-quick,
  .menu-btn,
  .cmd-btn,
  .logout-btn,
  .user-chip,
  .btn,
  button {
    display: none !important;
  }
  .layout { display: block !important; }
  .main, .content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    background: #fff !important;
  }
  .stmt-hero,
  .stmt-kpi,
  .roads-table {
    break-inside: avoid;
    box-shadow: none !important;
  }
  body { background: #fff !important; color: #000 !important; }
}

/* تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .content > * { animation: none !important; }
}

/* ==========================================================================
   2026 SaaS Design — Quiet Chrome · High Density · Exception-first
   مستوحى من Linear / Stripe / Vercel / لوحات الإنشاء التنفيذية
   ========================================================================== */

/* خلفية أهدأ — أقل «بطاقات فوق بطاقات» */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --border: #e6e8ee;
  --border-strong: #d5d9e2;
  --shadow-xs: 0 1px 0 rgba(15, 18, 28, 0.04);
  --shadow: 0 1px 2px rgba(15, 18, 28, 0.04), 0 2px 8px rgba(15, 18, 28, 0.03);
  --shadow-md: 0 4px 16px rgba(15, 18, 28, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 18, 28, 0.1);
}

/* الشريط الجانبي — Linear-like */
.sidebar {
  border-inline-end: 1px solid rgba(255,255,255,0.06);
  background: #0e1218;
}
a.nav {
  height: 36px;
  margin-bottom: 1px;
  border-radius: 8px;
  font-weight: 500;
  color: rgba(255,255,255,0.62);
}
a.nav:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.92);
}
a.nav.active {
  background: rgba(245,184,0,0.1);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}
a.nav.active::after {
  width: 2px;
  background: var(--marking);
  top: 8px;
  bottom: 8px;
  border-radius: 2px;
}
a.nav .nav-ic {
  width: 22px;
  height: 22px;
  background: transparent !important;
}
a.nav.active .nav-ic {
  color: var(--marking);
  background: transparent !important;
  transform: none;
  animation: none;
}
.nav-group {
  padding: 18px 12px 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.28);
}

/* شريط علوي زجاجي خفيف */
.topbar {
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(15,18,28,0.06);
  box-shadow: none;
  height: 56px;
  min-height: 56px;
}
html.dark .topbar,
[data-theme="dark"] .topbar {
  background: rgba(14, 18, 24, 0.8);
  border-bottom-color: rgba(255,255,255,0.06);
}
.topbar h1 {
  font-size: 15.5px;
  font-weight: 600;
}

/* المحتوى — كثافة أعلى */
.content {
  padding: 18px 20px 48px;
}

/* كروت بهدوء: حدود رفيعة وظل خفيف جدًا */
.kpi-card,
.dz-panel,
.toolbar,
.stmt-filters,
.dz-bar,
.card,
.auth-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  border-radius: 12px;
}
.kpi-card:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

/* KPI: رقم كبير + تسمية صغيرة — نمط Stripe */
.kpi-card {
  padding: 14px 16px 12px;
  min-height: 0;
}
.kpi-card .kl {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.kpi-card .kv {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  box-shadow: none;
}

/* جداول عالية الكثافة — نمط Linear */
.roads-table {
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 12px;
  font-size: 13px;
}
.roads-table th {
  height: 36px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.roads-table td {
  height: 44px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--surface-3);
}
.roads-table tbody tr:hover td {
  background: rgba(245, 184, 0, 0.03);
}
.roads-table tbody tr:last-child td {
  border-bottom: 0;
}

/* شارات حالة: نقطة + نص (أقل ضوضاء) */
.badge {
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  border: 0;
}
.badge.ok {
  background: rgba(15, 138, 90, 0.1);
  color: #0a6b45;
}
.badge.warn {
  background: rgba(245, 184, 0, 0.14);
  color: #8a6500;
}
.badge.danger,
.badge.err {
  background: rgba(196, 59, 40, 0.1);
  color: #9d2f1a;
}

/* أزرار: أقل لمعانًا، أكثر دقة */
.btn,
button.btn {
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
}
.btn.primary,
button.primary,
.auth-submit {
  background: var(--marking) !important;
  background-image: none !important;
  color: var(--marking-ink) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
.btn.primary:hover,
button.primary:hover,
.auth-submit:hover {
  background: var(--marking-hover) !important;
  filter: none;
  box-shadow: none !important;
}
.btn:not(.primary):not(.danger) {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}
.btn:not(.primary):not(.danger):hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* لوحة التحكم: بطل أقل درامية وأكثر وظيفية */
.dz-hero {
  background: linear-gradient(145deg, #141820 0%, #0e1218 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  box-shadow: none;
  padding: 22px 24px;
}
.dz-hero::before { opacity: 0.35; }
.dz-hero-value {
  font-size: 34px;
  font-weight: 650;
}
.dz-q {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
  border-radius: 8px;
  height: 32px;
  font-size: 12px;
}
.dz-q:hover {
  background: rgba(245,184,0,0.12);
  border-color: rgba(245,184,0,0.28);
  transform: none;
}
.dz-tile {
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.06);
}
.dz-tile.accent {
  background: rgba(245,184,0,0.1);
  border-color: rgba(245,184,0,0.18);
}

/* لوحات: عناوين هادئة */
.dz-panel-head h2,
.dz-v3 .dz-panel > h2 {
  font-size: 13.5px;
  font-weight: 600;
}
.dz-panel-head .badge {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* شريط الفلاتر */
.dz-bar,
.toolbar,
.stmt-filters {
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}

/* التلميح — أخف */
.hint {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--marking);
  box-shadow: none;
  color: var(--text-2);
}

/* نوافذ */
.modal {
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.modal-overlay {
  background: rgba(10, 12, 18, 0.45);
  backdrop-filter: blur(4px);
}

/* دخول — هدوء */
.auth-card {
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.auth-submit {
  border-radius: 10px !important;
}

/* إلغاء حركات زائدة للقائمة (quiet) */
a.nav:hover .nav-ic,
a.nav.active .nav-ic {
  transform: none;
}
.sidebar-nav a.nav {
  animation: none;
}

/* كثافة الإحصائيات أعلى الصفحة */
.pg-stats {
  gap: 10px;
  margin-bottom: 14px;
}
.pg-stats .kpi-card {
  min-height: 84px;
  padding: 12px 14px;
}
.pg-stats .kpi-card .kv { font-size: 20px; }

/* تجاوب */
@media (max-width: 900px) {
  .content { padding: 12px 12px 36px; }
  .topbar { height: 52px; min-height: 52px; }
}

/* ==========================================================================
   حركة بصرية احترافية — Motion layer
   دخول ناعم · تفاعل عند المرور · نوافذ · جداول · مؤشرات
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.15s;
  --dur: 0.22s;
  --dur-slow: 0.35s;
}

/* ——— انتقالات أساسية ——— */
.btn,
button.btn,
a.nav,
.kpi-card,
.dz-panel,
.dz-q,
.dz-tile,
.dz-row,
.roads-table tbody tr,
.user-chip,
.cmd-btn,
.badge,
.toolbar,
.card,
.stmt-kpi,
.auth-tabs button {
  transition:
    background var(--dur) var(--ease-in-out),
    border-color var(--dur) var(--ease-in-out),
    color var(--dur) var(--ease-in-out),
    box-shadow var(--dur) var(--ease-in-out),
    transform var(--dur) var(--ease-out),
    opacity var(--dur) var(--ease-in-out);
}

/* ——— دخول المحتوى ——— */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInEnd {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInStart {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.content > * {
  animation: riseIn var(--dur-slow) var(--ease-out) both;
}
.content > *:nth-child(1) { animation-delay: 0.02s; }
.content > *:nth-child(2) { animation-delay: 0.05s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.11s; }
.content > *:nth-child(5) { animation-delay: 0.14s; }
.content > *:nth-child(6) { animation-delay: 0.17s; }

/* مؤشرات KPI تظهر متتابعة */
.pg-stats .kpi-card,
.dz-kpis .kpi-card {
  animation: riseIn 0.4s var(--ease-out) both;
}
.pg-stats .kpi-card:nth-child(1),
.dz-kpis .kpi-card:nth-child(1) { animation-delay: 0.04s; }
.pg-stats .kpi-card:nth-child(2),
.dz-kpis .kpi-card:nth-child(2) { animation-delay: 0.08s; }
.pg-stats .kpi-card:nth-child(3),
.dz-kpis .kpi-card:nth-child(3) { animation-delay: 0.12s; }
.pg-stats .kpi-card:nth-child(4),
.dz-kpis .kpi-card:nth-child(4) { animation-delay: 0.16s; }

/* ——— تفاعل البطاقات ——— */
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.dz-panel:hover {
  border-color: color-mix(in srgb, var(--border-strong) 80%, var(--marking) 20%);
}

/* ——— القائمة الجانبية ——— */
a.nav {
  transition:
    background var(--dur-fast) var(--ease-in-out),
    color var(--dur-fast) var(--ease-in-out),
    transform var(--dur-fast) var(--ease-out);
}
a.nav:hover {
  transform: translateX(-2px);
}
html[dir="rtl"] a.nav:hover {
  transform: translateX(2px);
}
a.nav:active {
  transform: scale(0.98);
}
a.nav .nav-ic {
  transition: color var(--dur-fast) ease, transform var(--dur) var(--ease-out);
}
a.nav:hover .nav-ic {
  transform: scale(1.08);
  color: var(--marking);
}
a.nav.active .nav-ic {
  color: var(--marking);
}

/* ظهور عناصر القائمة */
.sidebar-nav a.nav {
  animation: slideInStart 0.35s var(--ease-out) both;
}
html[dir="rtl"] .sidebar-nav a.nav {
  animation-name: slideInEnd;
}
.sidebar-nav a.nav:nth-child(1) { animation-delay: 0.03s; }
.sidebar-nav a.nav:nth-child(2) { animation-delay: 0.05s; }
.sidebar-nav a.nav:nth-child(3) { animation-delay: 0.07s; }
.sidebar-nav a.nav:nth-child(4) { animation-delay: 0.09s; }
.sidebar-nav a.nav:nth-child(5) { animation-delay: 0.11s; }
.sidebar-nav a.nav:nth-child(6) { animation-delay: 0.13s; }
.sidebar-nav a.nav:nth-child(7) { animation-delay: 0.15s; }
.sidebar-nav a.nav:nth-child(8) { animation-delay: 0.17s; }
.sidebar-nav a.nav:nth-child(9) { animation-delay: 0.19s; }
.sidebar-nav a.nav:nth-child(10) { animation-delay: 0.21s; }
.sidebar-nav a.nav:nth-child(11) { animation-delay: 0.23s; }
.sidebar-nav a.nav:nth-child(12) { animation-delay: 0.25s; }

/* البراند */
.brand-icon {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease;
}
.brand:hover .brand-icon {
  transform: scale(1.06) rotate(-4deg);
}

/* ——— الأزرار ——— */
.btn:hover,
button.btn:hover {
  transform: translateY(-1px);
}
.btn:active,
button.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.08s;
}
.btn.primary:hover,
button.primary:hover {
  box-shadow: 0 4px 14px rgba(245, 184, 0, 0.28);
}
.btn svg,
button svg {
  transition: transform var(--dur-fast) var(--ease-out);
}
.btn:hover svg,
button:hover svg {
  transform: scale(1.08);
}

/* ——— صفوف الجدول ——— */
.roads-table tbody tr {
  transition: background var(--dur-fast) ease;
}
.roads-table tbody tr:hover td {
  background: rgba(245, 184, 0, 0.045);
}
.roads-table .btn.sm {
  opacity: 0.75;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.roads-table tr:hover .btn.sm {
  opacity: 1;
}

/* ——— النوافذ المنبثقة ——— */
.modal-overlay {
  animation: fadeIn 0.2s ease both;
}
.modal {
  animation: scaleIn 0.28s var(--ease-out) both;
}

/* ——— التوست ——— */
.toast {
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.toast.show {
  animation: riseIn 0.3s var(--ease-out) both;
}

/* ——— لوحة التحكم ——— */
.dz-hero {
  animation: riseIn 0.4s var(--ease-out) both;
}
.dz-q:hover {
  transform: translateY(-1px);
}
.dz-q .qi {
  transition: transform var(--dur) var(--ease-out);
}
.dz-q:hover .qi {
  transform: scale(1.12);
}
.dz-tile {
  transition: background var(--dur) ease, border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}
.dz-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
}
.dz-progress-track .p,
.dz-progress-track .d {
  transition: width 0.8s var(--ease-out);
}

/* شرائح الفترة */
.dz-chips button {
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.dz-chips button:hover {
  transform: translateY(-1px);
}
.dz-chips button.on {
  box-shadow: var(--shadow-xs);
}

/* ——— الحالات الفارغة ——— */
.tbl-empty .ic {
  transition: transform var(--dur-slow) var(--ease-out);
}
.tbl-empty:hover .ic {
  transform: scale(1.06) translateY(-2px);
}

/* ——— شريحة المستخدم ——— */
.user-chip {
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.user-chip:hover {
  border-color: var(--border-strong);
}
.user-av {
  transition: transform var(--dur) var(--ease-out);
}
.user-chip:hover .user-av {
  transform: scale(1.08);
}

/* ——— البحث السريع ——— */
.cmd-back {
  animation: fadeIn 0.15s ease both;
}
.cmd {
  animation: scaleIn 0.22s var(--ease-out) both;
}

/* ——— هيكل التحميل (skeleton pulse) ——— */
@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
.skel {
  background: linear-gradient(
    90deg,
    var(--surface-3) 0%,
    var(--surface-2) 40%,
    var(--surface-3) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
}

/* ——— احترام تقليل الحركة ——— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .kpi-card:hover,
  a.nav:hover,
  .btn:hover,
  .dz-q:hover,
  .dz-tile:hover {
    transform: none !important;
  }
}
