/* =====================================================================
   نظام متابعة الكفالات — فريق المرقاة الخيري
   ===================================================================== */

/* خط الفريق: Lama Sans (يُستعمل في كل مشاريع الفريق) */
@font-face { font-family: "Lama Sans"; font-weight: 400; font-display: swap; src: url(../assets/fonts/lama-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Lama Sans"; font-weight: 500; font-display: swap; src: url(../assets/fonts/lama-sans-500.woff2) format("woff2"); }
@font-face { font-family: "Lama Sans"; font-weight: 600; font-display: swap; src: url(../assets/fonts/lama-sans-600.woff2) format("woff2"); }
@font-face { font-family: "Lama Sans"; font-weight: 700; font-display: swap; src: url(../assets/fonts/lama-sans-700.woff2) format("woff2"); }
@font-face { font-family: "Lama Sans"; font-weight: 800; font-display: swap; src: url(../assets/fonts/lama-sans-800.woff2) format("woff2"); }
/* احتياطي لرمز الشيكل ₪ وبعض الرموز غير الموجودة في Lama Sans */
@font-face { font-family: "Sym Fallback"; font-weight: 400 800; font-display: swap; src: url(../assets/fonts/plex-latin-600.woff2) format("woff2"); unicode-range: U+20AA, U+20AC, U+2122, U+2190-2193; }

:root {
  /* ألوان مأخوذة من شعار فريق المرقاة الخيري: الكحلي #0A4165 والرمادي #606262 */
  --ink: #0a4165;
  --ink-deep: #07314d;
  --ink-2: #0f5384;
  --ink-3: #2470a5;
  --sky: #8cc3e8;
  --ink-soft: #e2ecf3;
  --paper: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --line: #dce2e5;
  --line-strong: #c3ccd1;
  --text: #1c2a32;
  --muted: #606262;
  --faint: #8d9496;
  --olive: #2f7a4f;
  --olive-bg: #e2f1e8;
  --brass: #9a6a12;
  --brass-strong: #d9a238;
  --brass-bg: #fbf0d9;
  --clay: #b0412c;
  --clay-bg: #f9e5df;
  --teal: #2ba99c;
  --teal-bright: #45c6b6;
  --teal-bg: #def3f0;
  --teal-ink: #1d7f75;

  --font: "Lama Sans", "Sym Fallback", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Lama Sans", "Sym Fallback", sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --shadow-pop: 0 18px 50px -12px rgba(7, 49, 77, .35), 0 2px 6px rgba(7, 49, 77, .08);
  --sidebar: 236px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink-3); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.35; margin: 0; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------------- Boot / login ---------------- */
.boot { min-height: calc(100vh / var(--z, 1)); display: grid; place-items: center; color: var(--muted); }
.login {
  min-height: calc(100vh / var(--z, 1));
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr);
}
.login-brand {
  background: var(--ink-deep);
  color: #fff;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  /* رمز الشعار كعلامة مائية كبيرة */
  content: "";
  position: absolute;
  width: 460px; height: 745px;
  left: -150px; bottom: -190px;
  background: url(../assets/logo-mark-white.png) no-repeat center / contain;
  opacity: .05;
  pointer-events: none;
}
.login-brand .mark { width: 82px; height: 132px; }
.login-brand .mark img { width: 100%; height: 100%; object-fit: contain; object-position: right; }
.login-brand h1 { color: #fff; font-size: 40px; margin-top: 28px; }
.login-brand p { color: rgba(255,255,255,.72); max-width: 34ch; font-size: 17px; margin: 10px 0 0; }
.login-brand small { color: rgba(255,255,255,.5); position: relative; z-index: 1; }
.login-brand > div { position: relative; z-index: 1; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 18px; }
.login-form h2 { font-size: 24px; }
.login-form .hint { color: var(--muted); margin: -10px 0 4px; }

/* ---------------- Shell ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh / var(--z, 1)); }
.sidebar {
  background: var(--ink-deep);
  color: #dfe8ef;
  position: sticky;
  top: 0;
  height: calc(100vh / var(--z, 1));
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  /* مساحة أسفل القائمة حتى لا تغطي شارة Netlify آخر عنصر */
  padding-bottom: 64px;
}
/* الشعار بخطّه الأصلي + اسم النظام تحته */
.lockup { display: block; height: auto; max-width: 100%; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 2px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.brand .lockup { width: 140px; }
@media (max-height: 820px) and (min-width: 1025px) { .brand .lockup { width: 112px; } .brand { gap: 4px; padding-bottom: 14px; margin-bottom: 8px; } }
.brand span { font-size: 12.5px; color: rgba(255,255,255,.6); padding-inline-start: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 12px; color: rgba(255,255,255,.45); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: #d6e1ea;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--surface); color: var(--ink); }
.nav a.active svg { opacity: 1; color: var(--ink-3); }
.nav .count {
  margin-inline-start: auto;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: var(--brass-strong);
  color: #1a1407;
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.nav a.active .count { background: var(--ink); color: #fff; }
.me { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 8px 2px; display: flex; align-items: center; gap: 10px; }
.me .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-3); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.me div { flex: 1; min-width: 0; }
.me strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { font-size: 12px; color: rgba(255,255,255,.55); }
.me button { background: none; border: 0; color: rgba(255,255,255,.65); cursor: pointer; padding: 6px; border-radius: var(--r-sm); }
.me button:hover { color: #fff; background: rgba(255,255,255,.08); }
.me button svg { width: 18px; height: 18px; }

.main { min-width: 0; padding: 24px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Tabs (segmented) ---------------- */
.tabs { display: inline-flex; gap: 4px; background: #e4e9ec; padding: 4px; border-radius: var(--r); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 7px;
  cursor: pointer; color: var(--muted); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(7,49,77,.14); }
.tabs .count { background: var(--brass-bg); color: var(--brass); border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }

/* ---------------- Buttons & inputs ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.accent { background: var(--brass-strong); border-color: var(--brass-strong); color: #1d1606; }
.btn.danger { color: var(--clay); border-color: #e3b8ab; }
.btn.danger:hover { background: var(--clay-bg); }
.btn.solid-danger { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--ink-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; font-weight: 500; }
.btn.icon { width: 34px; padding: 0; }
.btn.olive { background: var(--olive); border-color: var(--olive); color: #fff; }

.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--ink-soft); }
.input.sm, .select.sm { height: 32px; font-size: 13.5px; padding: 0 8px; }
.input[type="date"], .input[type="month"] { direction: ltr; text-align: right; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }

.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search .input { padding-inline-start: 36px; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
  padding: 12px 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar label.inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }

/* ---------------- Summary strip ---------------- */
.summary {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: 0;
}
.summary .s { padding: 12px 18px; border-inline-end: 1px solid var(--line); min-width: 130px; }
.summary .s:last-child { border-inline-end: 0; }
.summary .s b { display: block; font-size: 19px; font-weight: 700; color: var(--ink); }
.summary .s span { font-size: 12.5px; color: var(--muted); }
.summary .s.progress { flex: 1; min-width: 260px; }
.bar { height: 8px; background: #e1e7ea; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--olive); border-radius: 4px; transition: width .4s; }

/* ---------------- Ledger table ---------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r) var(--r);
  overflow: auto;
  max-height: calc(100vh / var(--z, 1) - 290px);
  min-height: 200px;
}
.table-wrap.standalone { border-radius: var(--r); min-height: 0; }
table.ledger { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ledger th {
  position: sticky; top: 0; z-index: 2;
  background: #edf1f3;
  color: var(--muted);
  font-weight: 600; font-size: 12.5px;
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
/* عناوين الأعمدة تنكسر لسطرين بدل أن تفرض عرضًا زائدًا على الجدول */
.ledger.fit th { white-space: normal; line-height: 1.35; vertical-align: bottom; }
.ledger td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: #f7fafc; }
.ledger td.num, .ledger th.num { text-align: center; color: var(--faint); width: 44px; font-size: 13px; }
.ledger td.file { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ledger td.money { white-space: nowrap; font-weight: 600; }
.ledger td.total { white-space: nowrap; font-weight: 700; color: var(--ink); }
.ledger tr.is-delivered td:first-child { box-shadow: inset -3px 0 0 var(--olive); }
.ledger tr.flash td { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--brass-bg); } to { background: transparent; } }

.name-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 600; color: var(--ink); text-align: start;
  border-bottom: 1px dashed transparent;
}
.name-link:hover { color: var(--ink-3); border-bottom-color: var(--ink-3); }
.ledger td.name-col { min-width: 165px; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

.delivery { display: flex; align-items: center; gap: 6px; }
.delivery .input { width: 124px; padding: 0 6px; }
/* التاريخ فوق زر التأكيد: عمود التسليم أضيق */
.ledger.fit .delivery { flex-direction: column; align-items: stretch; gap: 5px; min-width: 132px; }
.ledger.fit .delivery > * { width: 100%; justify-content: center; }
.done-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--olive-bg); color: var(--olive);
  border-radius: 20px; padding: 3px 10px 3px 6px;
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.done-chip svg { width: 16px; height: 16px; }
.done-chip button { border: 0; background: none; color: var(--olive); cursor: pointer; padding: 0 2px; opacity: .6; }
.done-chip button:hover { opacity: 1; }

.extra-btn {
  border: 1px dashed var(--line-strong); background: transparent;
  color: var(--muted); border-radius: var(--r-sm);
  padding: 3px 9px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.extra-btn:hover { border-color: var(--brass); color: var(--brass); }
.extra-val { border: 0; background: var(--brass-bg); color: var(--brass); font-weight: 700; border-radius: var(--r-sm); padding: 3px 9px; cursor: pointer; white-space: nowrap; }

.files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 240px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2);
  padding: 2px 6px 2px 4px; font-size: 12.5px; max-width: 170px;
}
.file-chip a { color: var(--ink-3); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip a:hover { text-decoration: underline; }
.file-chip button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0 2px; font-size: 14px; line-height: 1; }
.file-chip button:hover { color: var(--clay); }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ccd4d8; border-radius: 22px; cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--olive); }
.switch input:checked + span::before { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink-3); outline-offset: 2px; }

/* Notes column: wide, full text, readable */
.ledger th.notes-col, .ledger td.notes-col { min-width: 205px; width: 30%; }
.ledger.fit th.notes-col, .ledger.fit td.notes-col { min-width: 150px; width: 24%; }
.ledger.fit td.name-col { min-width: 130px; }
.ledger.fit td { padding: 10px 8px; }
.ledger.fit th { padding-inline: 8px; }
.note-box { white-space: pre-wrap; word-break: break-word; line-height: 1.7; font-size: 14px; }
.note-empty { color: var(--faint); font-size: 13px; }
.note-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.note-new { background: var(--brass-bg); border-inline-start: 3px solid var(--brass-strong); padding: 8px 10px; border-radius: 0 6px 6px 0; }
.note-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.active, .badge.ok { background: var(--olive-bg); color: var(--olive); }
.badge.inactive, .badge.archived { background: #e7e9e6; color: var(--muted); }
.badge.candidate, .badge.warn { background: var(--brass-bg); color: var(--brass); }
.badge.err, .badge.pending { background: var(--clay-bg); color: var(--clay); }
.badge.info { background: var(--ink-soft); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass-strong); display: inline-block; flex: none; }

/* empty state */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 46ch; }
/* مؤشر التحميل: الشعار في منتصف مساحة المحتوى تمامًا */
.loading {
  position: fixed; top: 0; bottom: 0; left: 0; right: var(--sidebar);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); pointer-events: none; z-index: 1;
}
.loading img { width: 56px; height: 91px; object-fit: contain; animation: breathe 1.6s ease-in-out infinite; }
.drawer .loading, .modal .loading, .panel .loading { position: static; flex: 1; min-height: 240px; }
@media (max-width: 1024px) { .loading { right: 0; } }

/* ---------------- Panels / cards (sparingly) ---------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: 16px; }
.panel-body { padding: 18px; }
.stack { display: grid; gap: 16px; }

/* ---------------- Dashboard ---------------- */
.dash { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.dash-hero {
  grid-column: span 2;
  background: var(--ink-deep);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 26px 30px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; pointer-events: none;
  width: 240px; height: 390px; left: 30px; top: -70px;
  background: url(../assets/logo-mark-white.png) no-repeat center / contain;
  opacity: .06;
}
.ring { position: relative; width: 156px; height: 156px; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.ring .val span { font-size: 12.5px; color: rgba(255,255,255,.7); display: block; margin-top: 6px; }
.hero-info { z-index: 1; }
.hero-info h2 { color: #fff; font-size: 22px; }
.hero-info p { color: rgba(255,255,255,.72); margin: 4px 0 18px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0; }
.hero-stats div { padding: 0 22px; border-inline-start: 1px solid rgba(255,255,255,.18); }
.hero-stats div:first-child { padding-inline-start: 0; border-inline-start: 0; }
.hero-stats b { display: block; font-size: 22px; font-weight: 700; }
.hero-stats span { font-size: 12.5px; color: rgba(255,255,255,.65); }

.cat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cat-table th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cat-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.cat-table tr:last-child td { border-bottom: 0; }
.mini-bar { width: 90px; height: 6px; background: #e1e7ea; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-inline-start: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--olive); }

.attention { display: grid; gap: 2px; }
.attention a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.attention a:last-child { border-bottom: 0; }
.attention a:hover { color: var(--ink-3); }
.attention b { font-size: 20px; color: var(--ink); min-width: 40px; text-align: end; }
.chart-box { position: relative; height: 260px; }

/* ---------------- Drawer (بطاقة المستفيد) ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(7, 30, 47, .45); z-index: 40; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(680px, 94vw);
  background: var(--paper);
  z-index: 41;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop);
  animation: slide .22s cubic-bezier(.2,.7,.2,1);
}
@keyframes slide { from { transform: translateX(-40px); opacity: 0; } }
.drawer-head {
  background: var(--ink-deep); color: #fff;
  padding: 22px 26px 0;
  position: relative;
}
.drawer-head .close { position: absolute; left: 16px; top: 16px; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.drawer-head .close:hover { background: rgba(255,255,255,.2); }
.drawer-head .close svg { width: 18px; height: 18px; }
.file-no { font-family: var(--font-display); font-size: 13px; color: var(--sky); letter-spacing: .02em; }
.file-no b { font-size: 30px; color: #fff; margin-inline-start: 8px; vertical-align: middle; }
.drawer-head h2 { color: #fff; font-size: 23px; margin: 6px 0 10px; padding-inline-end: 40px; }
.drawer-head .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.drawer-head .tags .badge { background: rgba(255,255,255,.12); color: #fff; }
.drawer-head .tags .badge.active { background: rgba(120, 200, 150, .22); color: #cdeedb; }
.drawer-head .tags .badge.candidate { background: rgba(200, 150, 45, .3); color: #f6dfa8; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 16px; }
.drawer-actions .btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.drawer-actions .btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }
.drawer-tabs { display: flex; gap: 2px; margin: 0 -26px; padding: 0 22px; background: var(--ink); }
.drawer-tabs button { background: none; border: 0; color: rgba(255,255,255,.65); padding: 11px 14px; cursor: pointer; font-weight: 500; border-bottom: 3px solid transparent; }
.drawer-tabs button:hover { color: #fff; }
.drawer-tabs button.active { color: #fff; border-bottom-color: var(--sky); font-weight: 600; }
.drawer-body { overflow-y: auto; padding: 22px 26px 40px; flex: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts div { padding: 12px 16px; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.facts div:nth-child(odd) { border-inline-start: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.facts dd.empty-val { color: var(--faint); font-weight: 400; }
.facts .wide { grid-column: span 2; border-inline-start: 0; }
.section-title { font-family: var(--font-display); font-size: 15px; color: var(--ink); margin: 24px 0 10px; }
.section-title:first-child { margin-top: 0; }
.this-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.this-month span { font-size: 12.5px; color: var(--muted); display: block; }
.this-month b { font-size: 17px; color: var(--ink); }
.thread { display: grid; gap: 10px; }
.thread-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.thread-item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.thread-item p { margin: 6px 0 0; white-space: pre-wrap; }
.thread-item .reply { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-inline-start: 3px solid var(--ink-3); border-radius: 0 6px 6px 0; }
.audit-item { font-size: 13.5px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-item .meta { color: var(--muted); font-size: 12.5px; }
.audit-item ul { margin: 4px 0 0; padding-inline-start: 18px; }
.audit-item del { color: var(--clay); text-decoration: line-through; }
.audit-item ins { color: var(--olive); text-decoration: none; font-weight: 600; }

/* ---------------- Modal ---------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(7, 30, 47, .48); animation: fade .15s ease-out; }
.modal {
  background: var(--surface);
  width: min(520px, 100%);
  max-height: calc(90vh / var(--z, 1));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2,.7,.2,1);
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { padding: 20px 24px 6px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 14px 24px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }

/* Admin notes on open */
.notice-list { display: grid; gap: 12px; }
.notice {
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brass-strong);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 16px;
  background: var(--surface-2);
}
.notice p { margin: 0 0 8px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.75; }
.notice .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; bottom: 22px; left: 22px; display: grid; gap: 8px; z-index: 90; }
.toast {
  background: var(--ink-deep); color: #fff; padding: 12px 18px; border-radius: var(--r);
  box-shadow: var(--shadow-pop); width: max-content; max-width: 420px; font-weight: 500;
  animation: pop .2s ease-out;
  display: flex; align-items: center; gap: 10px;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.error { background: var(--clay); }
.toast.success { background: var(--olive); }

/* ---------------- Notifications ---------------- */
.split { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.filter-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; position: sticky; top: 20px; }
.filter-list button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 0; background: none; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text); text-align: start;
}
.filter-list button:hover { background: var(--surface-2); }
.filter-list button.active { background: var(--ink-soft); color: var(--ink); font-weight: 600; }
.filter-list .c { font-size: 12px; font-weight: 700; color: var(--brass); background: var(--brass-bg); border-radius: 10px; padding: 0 7px; }
.filter-list .c.zero { background: transparent; color: var(--faint); font-weight: 500; }
.notif-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.notif-day { padding: 10px 18px 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.notif {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: #f7fafc; }
.notif .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--ink-soft); color: var(--ink-2); }
.notif .ico svg { width: 20px; height: 20px; }
.notif .ico.k-amount_request, .notif .ico.k-request_decision { background: var(--brass-bg); color: var(--brass); }
.notif .ico.k-record_note, .notif .ico.k-admin_note { background: var(--olive-bg); color: var(--olive); }
.notif .ico.k-candidate, .notif .ico.k-candidate_review { background: var(--teal-bg); color: var(--teal-ink); }
.notif h4 { margin: 0; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notif p { margin: 3px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.notif .ben { font-size: 13px; color: var(--ink-3); margin-top: 4px; display: inline-block; }
.notif .time { font-size: 12.5px; color: var(--faint); white-space: nowrap; text-align: end; }
.notif.read h4 { font-weight: 500; color: var(--muted); }
.notif.read .ico { opacity: .55; }
.notif .acts { display: flex; gap: 6px; margin-top: 10px; }

/* ---------------- Import ---------------- */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--r-lg);
  padding: 46px 20px; text-align: center; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--ink-3); background: #f4f8fb; }
.dropzone h3 { font-size: 18px; margin-bottom: 6px; }
.dropzone p { color: var(--muted); margin: 0; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.steps { display: flex; gap: 0; margin-bottom: 18px; counter-reset: step; }
.steps div { flex: 1; padding: 10px 14px; border-bottom: 3px solid var(--line); color: var(--faint); font-weight: 600; font-size: 14px; counter-increment: step; }
.steps div::before { content: counter(step) ". "; }
.steps div.on { border-bottom-color: var(--ink-3); color: var(--ink); }
.steps div.done { border-bottom-color: var(--olive); color: var(--olive); }
.row-err td { background: #fdf5f2; }
.row-warn td { background: #fdfaf1; }
.row-skip td { opacity: .5; }

/* ---------------- Settings ---------------- */
.settings-grid { display: grid; gap: 18px; max-width: 860px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

/* picker */
.picker { position: relative; }
.picker-list {
  position: absolute; top: 100%; inset-inline: 0; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop); max-height: 240px; overflow-y: auto; z-index: 5;
}
.picker-list button { display: block; width: 100%; text-align: start; padding: 8px 12px; border: 0; background: none; cursor: pointer; }
.picker-list button:hover, .picker-list button.hl { background: var(--ink-soft); }
.picker-list small { color: var(--muted); margin-inline-start: 6px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 13.5px; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .dash-hero { grid-column: auto; }
  .split { grid-template-columns: 1fr; }
  .filter-list { position: static; }
}
/* الشريط العلوي يظهر فقط في الشاشات الضيقة */
.topbar { display: none; }
.nav-scrim { display: none; }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    background: var(--ink-deep); padding: 8px 12px; min-height: 60px;
  }
  .topbar-brand { display: block; margin-inline-start: 4px; }
  .topbar-brand .lockup { width: 84px; }
  .topbar-menu {
    position: relative; width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08);
    color: #fff; display: grid; place-items: center; cursor: pointer;
  }
  .topbar-menu:hover, .topbar-menu:focus-visible { background: rgba(255,255,255,.16); }
  .topbar-menu svg { width: 24px; height: 24px; }
  .topbar-menu .count { position: absolute; top: -5px; left: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--brass-strong); color: #1a1407; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
  .topbar-menu .count[hidden] { display: none; }
  /* القائمة الجانبية: درج ينزلق من اليمين فوق المحتوى */
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; height: calc(100vh / var(--z, 1)); height: calc(100dvh / var(--z, 1)); z-index: 60;
    width: min(300px, 86vw); overflow-y: auto; padding-bottom: 24px;
    transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
    box-shadow: -12px 0 40px rgba(0,0,0,.25);
  }
  .shell.nav-open .sidebar { transform: none; visibility: visible; transition: transform .25s ease; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(6, 25, 38, .45); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .nav { overflow: visible; flex: none; }
  .loading { top: 60px; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 260px; }
  .main { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   شريط التمرير: رفيع وبألوان الصفحة (والتمرير بالماوس يعمل كالمعتاد)
   ===================================================================== */
* { scrollbar-width: thin; scrollbar-color: #b9c6ce transparent; }
.sidebar, .sidebar * { scrollbar-color: rgba(255,255,255,.22) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b9c6ce; border-radius: 10px; border: 1px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #8fa3af; }
.sidebar ::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); }
::-webkit-scrollbar-corner { background: transparent; }

/* =====================================================================
   الشاشات الصغيرة أو المكبّرة من ويندوز: تصغير متناسق للواجهة كاملة
   ===================================================================== */
html { --z: 1; background: var(--paper); }
@media (max-width: 1440px) { html { zoom: .94; --z: .94; } }
@media (max-width: 1300px) { html { zoom: .88; --z: .88; } }
@media (max-width: 1180px) { html { zoom: .82; --z: .82; } }
@media (max-width: 860px) { html { zoom: .76; --z: .76; } }
@media (max-width: 700px) { html { zoom: 1; --z: 1; } }
@media (max-height: 720px) and (min-width: 1025px) {
  .brand { padding-bottom: 14px; margin-bottom: 8px; }
  .nav a { padding: 7px 12px; }
  .nav-group { padding: 10px 12px 4px; }
  .me { padding-top: 10px; }
}

/* شاشة البدء */
.boot { position: fixed; inset: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.boot img { width: 64px; height: 104px; object-fit: contain; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

/* =====================================================================
   التقويم
   ===================================================================== */
.dp-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; min-width: 150px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); cursor: pointer;
  font-weight: 500; text-align: start; white-space: nowrap;
}
.dp-trigger svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.dp-trigger:hover { border-color: var(--ink-3); }
.dp-trigger.empty .dp-text { color: var(--faint); font-weight: 400; }
.dp-trigger.sm { height: 32px; padding: 0 9px; min-width: 0; font-size: 13.5px; gap: 6px; }
.dp-trigger.sm svg { width: 15px; height: 15px; }
.field .dp-trigger { width: 100%; }
.dp-pop {
  position: absolute; z-index: 80;
  width: 292px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  animation: pop .14s ease-out;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 15px; }
.dp-title-btn { border: 0; background: none; cursor: pointer; padding: 4px 10px; border-radius: 8px; }
.dp-title-btn:hover { background: var(--ink-soft); }
.dp-month[disabled] { color: #c9d0d3; cursor: not-allowed; }
.dp-nav { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--ink-soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 11px; color: var(--faint); padding: 4px 0 6px; font-weight: 600; }
.dp-day { height: 34px; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.dp-day:hover:not([disabled]) { background: var(--ink-soft); color: var(--ink); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--ink-3); font-weight: 700; color: var(--ink); }
.dp-day.sel { background: var(--ink); color: #fff; font-weight: 700; box-shadow: none; }
.dp-day[disabled] { color: #c9d0d3; cursor: not-allowed; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-months { width: 270px; }
.dp-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-month { height: 40px; border: 0; border-radius: 8px; background: var(--surface-2); cursor: pointer; font-weight: 500; color: var(--text); }
.dp-month:hover { background: var(--ink-soft); color: var(--ink); }
.dp-month.today { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.dp-month.sel { background: var(--ink); color: #fff; font-weight: 700; box-shadow: none; }

/* =====================================================================
   اختيار العملة
   ===================================================================== */
.cur-toggle { display: inline-flex; background: #e4e9ec; padding: 3px; border-radius: 9px; gap: 3px; height: 40px; width: max-content; justify-self: start; }
.cur-toggle.compact button { padding: 0 11px; }
.cur-toggle.compact button b { font-size: 14px; }
.cur-toggle button { border: 0; background: transparent; padding: 0 16px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.cur-toggle button b { font-size: 15px; }
.cur-toggle button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(7,49,77,.14); }
.cur-toggle.sm { height: 32px; }
.cur-toggle.sm button { padding: 0 9px; font-size: 13px; }

/* =====================================================================
   عناوين الأعمدة القابلة للفرز
   ===================================================================== */
.ledger th.sortable { padding: 0; }
.th-sort {
  width: 100%; display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 12.5px; color: var(--muted); text-align: start; white-space: nowrap;
}
.th-sort:hover { color: var(--ink); background: #e4eaee; }
.th-sort .arrow { font-size: 10px; opacity: .45; }
.ledger th.sorted .th-sort { color: var(--ink); }
.ledger th.sorted .arrow { opacity: 1; color: var(--ink-3); }


/* =====================================================================
   صفحة الدخول (حسب تصميم فريق المرقاة الخيري)
   ===================================================================== */
.auth {
  min-height: calc(100vh / var(--z, 1));
  display: grid;
  grid-template-columns: minmax(420px, 43fr) minmax(460px, 57fr);
  background: var(--surface);
}
.auth-brand {
  position: relative; overflow: hidden;
  background: #0b3d5e; color: #fff;
  padding: 56px 64px 40px;
  display: flex; flex-direction: column;
}
.auth-id { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.auth-id .lockup { width: clamp(170px, 18vw, 240px); }
.auth-id span { display: block; color: rgba(255,255,255,.72); font-size: 18px; }
.auth-pitch { margin-top: auto; margin-bottom: auto; padding: 48px 0 24px; max-width: 460px; }
.auth-bars { display: flex; direction: ltr; justify-content: flex-end; align-items: flex-end; gap: 9px; height: 46px; margin-bottom: 12px; }
.auth-bars i { width: 28px; border-radius: 2px; display: block; }
.auth-bars i:nth-child(1) { height: 16px; background: #b9c9d8; }
.auth-bars i:nth-child(2) { height: 30px; background: #4d8fbf; }
.auth-bars i:nth-child(3) { height: 46px; background: var(--teal-bright); }
.auth-tag { color: var(--teal-bright); font-weight: 600; font-size: 16px; margin-bottom: 26px; }
.auth-brand h1 { color: #fff; font-size: clamp(36px, 3.6vw, 50px); line-height: 1.5; margin: 0 0 22px; white-space: nowrap; }
.auth-brand p { color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.85; margin: 0; max-width: 340px; }
.auth-brand footer { color: rgba(255,255,255,.7); font-size: 14px; position: relative; z-index: 1; }
.auth-brand::after {
  /* رمز المرقاة كعلامة مائية كبيرة */
  content: ""; position: absolute; pointer-events: none;
  width: 440px; height: 712px; left: -140px; bottom: -170px;
  background: url(../assets/logo-mark-white.png) no-repeat center / contain;
  opacity: .06;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-panel { position: relative; display: flex; flex-direction: column; padding: 32px 48px; }
.auth-portal { align-self: flex-end; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.auth-portal svg { width: 26px; height: 26px; color: var(--muted); }
.auth-box { flex: 1; display: grid; place-items: center; padding: 24px 0; }
.auth-form { width: min(440px, 100%); display: flex; flex-direction: column; }
.auth-hello { color: var(--teal-ink); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.auth-form h2 { font-size: 38px; margin-bottom: 14px; }
.auth-sub { color: var(--muted); font-size: 17px; line-height: 1.75; margin: 0 0 26px; }
.auth-field { display: grid; gap: 8px; margin-bottom: 18px; }
.auth-field > span { font-weight: 600; color: var(--text); font-size: 15px; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input input {
  width: 100%; height: 54px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); padding: 0 50px 0 16px; font-size: 16px; text-align: left;
}
.auth-input input::placeholder { color: #9aa4a8; }
.auth-input input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--ink-soft); }
.auth-input .lead { position: absolute; right: 16px; width: 22px; height: 22px; color: #6b777c; pointer-events: none; }
.auth-input .eye { position: absolute; left: 8px; width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; color: #6b777c; cursor: pointer; display: grid; place-items: center; }
.auth-input .eye:hover { background: var(--surface-2); color: var(--ink); }
.auth-input .eye svg { width: 22px; height: 22px; }
.auth-input:has(.eye) input { padding-left: 52px; }
.auth-link { align-self: flex-start; border: 0; background: none; color: var(--teal-ink); font-weight: 600; cursor: pointer; padding: 0; margin: -6px 0 24px; font-size: 15px; }
.auth-link:hover { text-decoration: underline; }
.auth-submit {
  height: 56px; border: 0; border-radius: 10px; background: #0b3d5e; color: #fff;
  font-weight: 700; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.auth-submit:hover { background: var(--ink-2); }
.auth-submit:disabled { opacity: .7; cursor: wait; }
.auth-submit svg { width: 22px; height: 22px; }
.auth-note { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.auth-foot .ver { color: var(--faint); font-size: 12px; margin-inline-start: 10px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.me .ver { color: rgba(255,255,255,.4); font-size: 11px; }
.auth-foot svg { width: 20px; height: 20px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 28px; }
  .auth-pitch { padding: 28px 0 8px; }
  .auth-id .lockup { width: 170px; }
  .auth-panel { padding: 24px 20px; }
}

/* =====================================================================
   بطاقة سعر الصرف اليومي + المحوّل السريع
   ===================================================================== */
.rate-card {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(7, 49, 77, .05);
  cursor: pointer; text-align: start; color: var(--text);
}
.rate-card:hover { border-color: var(--teal); box-shadow: 0 4px 14px -6px rgba(43, 169, 156, .45); }
.rate-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(160deg, var(--teal-bg), #eaf3f8); color: var(--teal-ink); flex: none; }
.rate-ico svg { width: 21px; height: 21px; }
.rate-body { display: grid; gap: 1px; }
.rate-top { font-size: 12px; color: var(--muted); font-weight: 500; }
.rate-val { display: flex; align-items: baseline; gap: 4px; direction: ltr; justify-content: flex-end; }
.rate-val b { font-family: var(--font-display); font-size: 21px; color: var(--ink); line-height: 1.2; letter-spacing: .01em; }
.rate-val i { font-style: normal; font-weight: 700; color: var(--teal-ink); font-size: 16px; }
.rate-val em { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 4px; }
.rate-meta { align-self: stretch; display: flex; align-items: center; gap: 6px; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.rate-meta.fresh { color: var(--teal-ink); }
.rate-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.rate-meta.fresh .rate-dot { background: var(--teal-bright); box-shadow: 0 0 0 3px var(--teal-bg); }
.rate-pop { width: 280px; }
.rate-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; }
.rate-row .cur { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ink-soft); color: var(--ink); font-weight: 700; }
.rate-row .cur.ils { background: var(--teal-bg); color: var(--teal-ink); }
.rate-row .input { text-align: left; font-weight: 600; font-size: 16px; }
.rate-row .lbl { font-size: 12.5px; color: var(--muted); width: 34px; }
.rate-swap { display: grid; place-items: center; color: var(--faint); margin: 4px 0; }
.rate-swap svg { width: 18px; height: 18px; transform: rotate(90deg); }
.rate-pop .dp-foot small { color: var(--muted); }

/* =====================================================================
   التسليم المنفصل للكفالة والإضافي + عملة التحويل
   ===================================================================== */
.dl-stack { display: grid; gap: 8px; }
.dl-line { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dl-label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.dl-label small { color: var(--faint); font-size: 11.5px; }
.done-chip.extra { background: var(--brass-bg); color: var(--brass); }
.done-chip.extra button { color: var(--brass); }
.pay-cell { display: grid; gap: 5px; justify-items: start; min-width: 84px; }
.pay-amount b { display: block; color: var(--teal-ink); font-size: 14.5px; white-space: nowrap; }
.pay-amount small { color: var(--faint); font-size: 11.5px; white-space: nowrap; }

/* صف فئات الترشيحات */
.cat-row { margin-bottom: 12px; }

/* =====================================================================
   نافذة قرار الترشيح: اعتماد / مراجعة / حذف
   ===================================================================== */
.cand-summary {
  display: grid; gap: 10px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
}
.cand-summary > div:first-child b { display: block; font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.cand-summary > div:first-child span { color: var(--muted); font-size: 13px; }
.cand-summary dl { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.cand-summary dl div { display: flex; gap: 6px; font-size: 13.5px; }
.cand-summary dt { color: var(--faint); }
.cand-summary dd { margin: 0; font-weight: 600; color: var(--text); }
.decide-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #e4e9ec; padding: 4px; border-radius: 12px; }
.decide-seg button {
  height: 42px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--muted);
}
.decide-seg button svg { width: 18px; height: 18px; }
.decide-seg button:hover { color: var(--ink); }
.decide-seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(7,49,77,.14); }
.decide-seg button.approve.on { color: var(--olive); }
.decide-seg button.review.on { color: var(--brass); }
.decide-seg button.delete.on { color: var(--clay); }
.decide-info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--brass-bg); color: #6b4c0c; font-size: 14px; line-height: 1.7; }
.decide-info svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.decide-info.danger { background: var(--clay-bg); color: #7d2f20; }
.input-group { display: flex; gap: 10px; align-items: center; }
.input-group .input { flex: 1; max-width: 260px; font-size: 16px; font-weight: 600; }
.new-sponsor { padding: 12px 14px; border: 1px dashed var(--teal); border-radius: var(--r); background: #f4fbfa; }
.new-sponsor .input { max-width: 380px; }
.check-line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }

/* ملاحظات المراجعة في جدول الترشيحات */
.row-review td { background: #fffcf4; }
.review-box { margin-top: 10px; padding: 10px 12px; border-inline-start: 3px solid var(--brass-strong); background: var(--brass-bg); border-radius: 0 8px 8px 0; color: var(--text); }
.review-box .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brass); font-weight: 600; }
.review-box .meta svg { width: 14px; height: 14px; }
.review-box p { margin: 6px 0 8px; font-size: 14px; white-space: pre-wrap; line-height: 1.7; }
.review-box .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.row-skip-soft td { color: var(--muted); }

/* التحقق من الحقول */
.input.invalid { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-bg); }
.field-msg { color: var(--clay) !important; min-height: 0; }
.field-msg:empty { display: none; }


/* =====================================================================
   1.7.0 — وضوح الإجراءات وإمكانية الوصول
   ===================================================================== */
/* زر تأكيد التسليم: واضح وبحجم يسهل الضغط */
.btn.confirm-dl {
  height: 34px; padding: 0 12px; gap: 6px; font-weight: 600; white-space: nowrap;
  background: #fff; color: var(--olive); border: 1.5px solid var(--olive);
}
.btn.confirm-dl:hover:not(:disabled) { background: var(--olive); color: #fff; }
.btn.confirm-dl.extra { color: var(--brass); border-color: var(--brass); }
.btn.confirm-dl.extra:hover:not(:disabled) { background: var(--brass); color: #fff; }
.btn.confirm-dl:disabled { opacity: .7; cursor: progress; }
.btn.confirm-dl svg { width: 15px; height: 15px; }
.delivery .input { height: 34px; }
.dl-status { font-size: 12px; color: var(--muted); font-weight: 600; }

/* أزرار الصف جنب بعض */
.row-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; white-space: nowrap; }

/* تفاصيل المرشح سطرًا سطرًا */
.details-col { font-size: 13px; color: var(--muted); min-width: 220px; }
.detail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.detail-list li { white-space: nowrap; }

/* غير المسلَّم حسب الفئة في الرئيسية */
.pending-group { padding: 12px 4px; }
.pending-group .pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pending-group .pg-head b { font-size: 20px; min-width: 40px; text-align: end; }
.pg-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pg-links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-strong);
  border-radius: 20px; color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600; background: #fff;
}
.pg-links a:hover { border-color: var(--ink-3); background: var(--surface-2, #f4f7f8); }
.pg-links a b { font-size: 14px; color: var(--brass); min-width: 0; }

/* رابط التخطي إلى المحتوى */
.skip-link {
  position: fixed; top: 8px; inset-inline-start: 8px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transform: translateY(-160%); transition: transform .15s; text-decoration: none; font-weight: 600;
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* زر مسح البحث */
.search { position: relative; }
.search input[type=search]::-webkit-search-cancel-button { display: none; }
.search input { padding-inline-end: 30px; }
.search-clear {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; display: none;
}
.search-clear svg { width: 14px; height: 14px; }
.search.has-value .search-clear { display: inline-flex; }
.search-clear:hover { color: var(--ink); background: var(--line); }

/* الترقيم */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager .pg-ctrl { display: flex; align-items: center; gap: 6px; }
.pager .pg-ctrl .select { width: auto; }
.pager .btn[disabled] { opacity: .45; cursor: default; }

/* مصدر سعر الصرف */
.rate-source { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* صفحة الدخول على الشاشات الأضيق: العنوان يلتف بدل ما يطلع برا */
@media (max-width: 1100px) {
  .auth-brand h1 { white-space: normal; font-size: 34px; }
}
@supports (height: 100dvh) {
  .auth, .boot { min-height: calc(100dvh / var(--z, 1)); }
}
.drawer:focus { outline: none; }
.notif-open { all: unset; cursor: pointer; font: inherit; color: inherit; }
.notif-open:focus-visible { outline: 2px solid var(--ink-3); outline-offset: 2px; border-radius: 3px; }

/* =====================================================================
   1.8.0 — بيانات التحويل، مستلم من الكافل، الإشعارات
   ===================================================================== */
.wallet-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.wallet-badge img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.wallet-badge.sm { gap: 6px; font-size: 12.5px; }
.wallet-badge.sm img { width: 20px; height: 20px; border-radius: 5px; }

.wallet-select { position: relative; }
.wallet-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: start; cursor: pointer; background-image: none; min-height: 40px; }
.wallet-btn .placeholder, .wallet-opt .placeholder { color: var(--muted); font-weight: 400; }
.wallet-btn .chev { color: var(--muted); font-size: 12px; }
.wallet-list {
  position: absolute; z-index: 90;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: 0 10px 30px rgba(10,65,101,.14); padding: 4px; display: grid; gap: 2px;
}
.wallet-opt { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.wallet-opt:hover, .wallet-opt.active { background: var(--ink-soft, #e9f0f5); }
.wallet-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--ink); }

.transfer-set { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 14px; margin: 0; background: var(--surface-2); }
.transfer-set legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 700; color: var(--ink); font-size: 14px; }
.transfer-set legend svg { width: 16px; height: 16px; }
.transfer-set legend small { color: var(--muted); font-weight: 400; font-size: 12px; margin-inline-start: 4px; }

.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 10px; }
.section-row .section-title { margin: 0; }
.pay-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* مستلم من الكافل */
.yn-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.yn-seg button { border: 0; background: none; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-width: 44px; }
.yn-seg button + button { border-inline-start: 1px solid var(--line-strong); }
.yn-seg button.yes.on { background: var(--olive); color: #fff; }
.yn-seg button.no.on { background: #e6eaed; color: var(--ink); }
.yn-seg button:not(.on):hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.yn-seg button:disabled { cursor: progress; }
.yn-badge { display: inline-block; padding: 2px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.yn-badge.yes { background: var(--olive-bg); color: var(--olive); }
.yn-badge.no { background: #eef1f3; color: var(--muted); }

/* الإشعارات المرفقة: سطر واحد صغير */
.files { flex-wrap: nowrap; gap: 4px; max-width: none; }
.file-chip { padding: 1px 4px; font-size: 12px; max-width: none; gap: 2px; height: 26px; }
.file-chip a { display: inline-flex; align-items: center; gap: 3px; }
.ftype { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 5px; line-height: 1.5; }
.ftype.img { background: #e3eef7; color: var(--ink-3); }
.ftype.pdf { background: #fbe8e1; color: #a14b2a; }
.files .upload-btn { height: 26px; padding: 0 7px; }
.files .upload-btn svg { width: 14px; height: 14px; }

/* شريط تقدم عام */
.load-bar { height: 8px; background: #e1e7ea; border-radius: 4px; overflow: hidden; }
.load-bar i { display: block; height: 100%; background: var(--ink); transition: width .2s; }

/* تحديث بيانات التحويل من ملف */
.pay-diff { display: grid; gap: 2px; }
.pay-diff small { color: var(--muted); font-size: 12px; }
.warn-list li { color: var(--clay); font-size: 12px; white-space: normal; }
.muted { color: var(--muted); }

/* إخفاء شريط التمرير في القائمة الجانبية (يبقى التمرير بالعجلة) */
.sidebar, .sidebar * { scrollbar-width: none; }
.sidebar ::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.decide-info.warn { background: var(--brass-bg); color: #6b4c0c; }
.pay-required .transfer-set { background: #fff; border-color: var(--brass-strong); }

/* إخفاء شريط تمرير الصفحة الرئيسي (التمرير بالعجلة واللمس يبقى) */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* القائمة السياقية (كليك يمين) */
.ctx-menu { position: absolute; z-index: 120; min-width: 220px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(10,65,101,.18); padding: 4px; display: grid; gap: 1px; }
.ctx-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: start; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.ctx-menu button svg { width: 16px; height: 16px; color: var(--muted); }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--ink-soft); outline: none; }
.ctx-menu button.danger { color: var(--clay); }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 3px 4px; }
.notif.archived { opacity: .75; }
.notif-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.filter-list button svg { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 4px; }

/* تذكير نهاية الشهر */
.eom-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--brass-bg); color: #6b4c0c; border: 1px solid var(--brass-strong); font-size: 14.5px; }
.eom-banner svg { width: 20px; height: 20px; flex: none; color: var(--brass); }
.modal .pg-links { margin-top: 0; }
.combo-list .wallet-opt { font-size: 14px; }

/* سندات البطاقة: روابط صغيرة مرقّمة */
.files-count { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.file-group { margin-bottom: 14px; }
.file-month { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.file-month span { background: var(--ink-soft); color: var(--ink-2, var(--ink)); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.file-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.file-list li { font-size: 13.5px; color: var(--muted); }
.file-list li::marker { color: var(--muted); font-size: 12px; }
.file-list a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none; font-weight: 600; }
.file-list a:hover { text-decoration: underline; }
.file-list small { margin-inline-start: 10px; font-size: 12px; color: var(--faint); }

/* المشرف (اطلاع فقط) */
.extra-val.ro { cursor: default; display: inline-block; }
.no-voucher { font-size: 12.5px; color: var(--faint); }
.no-voucher.warn { color: var(--clay); font-weight: 700; }

/* لوحة المتابعة */
.num-strong { font-weight: 700; color: var(--ink); }
.seg-filter { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-filter button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-filter button + button { border-inline-start: 1px solid var(--line-strong); }
.seg-filter button.on { background: var(--ink); color: #fff; }
.change-list s { color: var(--faint); }
.change-list .to { color: var(--olive); font-weight: 700; }

/* =====================================================================
   1.13.0 — الشعار المتحرك
   ===================================================================== */
.logo-motion { display: block; width: var(--motion-w, 180px); height: auto; aspect-ratio: 8 / 5; object-fit: contain; pointer-events: none; }
.logo-motion.opaque { mix-blend-mode: multiply; }
/* مؤشر التحميل يظهر فقط إذا طال التحميل (بدون وميض في التحميل السريع) */
.loading .logo-motion { opacity: 0; animation: motion-in .3s ease .25s forwards; }
@keyframes motion-in { to { opacity: 1; } }
.logo-motion.sm { width: var(--motion-w, 180px); }
.boot .logo-motion { width: var(--motion-w, 180px); }
.intro-overlay { position: fixed; inset: 0; z-index: 2000; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .45s ease; }
.intro-overlay.out { opacity: 0; pointer-events: none; }
.intro-overlay .logo-motion { width: var(--motion-w, 180px); }
.offline-overlay { position: fixed; inset: 0; z-index: 1900; background: rgba(247, 248, 249, .97); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; }
.offline-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; }
.offline-box .logo-motion { width: var(--motion-w, 180px); margin-bottom: 8px; }
.offline-box b { font-size: 20px; color: var(--ink); }
.offline-box span { color: var(--muted); font-size: 15px; max-width: 360px; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .intro-overlay { transition: none; } }
.loading img.logo-motion, .boot img.logo-motion { height: auto; animation: none; opacity: 1; }
.ledger.fit .th-sort { white-space: normal; line-height: 1.35; padding: 10px 8px; gap: 4px; }
/* نوافذ أضيق: تصغير بسيط للخط والمسافات حتى يبقى الجدول كاملًا بلا تمرير أفقي */
@media (max-width: 1100px) {
  .ledger.fit { font-size: 13px; }
  .ledger.fit td { padding: 8px 6px; }
  .ledger.fit th, .ledger.fit .th-sort { padding-inline: 6px; font-size: 12px; }
  .ledger.fit td.name-col { min-width: 110px; }
  .ledger.fit th.notes-col, .ledger.fit td.notes-col { min-width: 120px; }
  .ledger.fit .delivery { min-width: 118px; }
  .ledger.fit .delivery .input, .ledger.fit .dp-trigger.sm { font-size: 12.5px; padding: 0 6px; }
}
/* نوافذ ضيقة جدًا: نوع المحفظة بالشعار فقط (الاسم يظهر عند المرور) */
@media (max-width: 860px) { .ledger.fit .wallet-badge.sm .wb-label { display: none; } }
/* سعر الصرف لهذا التسليم */
.rate-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rate-box .rate-in { width: 76px; height: 30px; padding: 0 6px; font-size: 13px; text-align: center; }
.rate-box .rate-out { color: var(--ink); font-weight: 600; }
/* المستخدمون: الصفحة أعرض والجدول كامل بلا تمرير جانبي */
.settings-grid.wide { max-width: 1240px; }
.users-table table { table-layout: auto; }
.users-table td.email-col { word-break: break-all; min-width: 160px; }
.users-table tr[tabindex]:focus-visible td { background: var(--ink-soft); outline: none; }
.users-table tr.row-archived td { color: var(--muted); }
.ctx-menu button[disabled] { opacity: .5; cursor: default; }
/* اختيار طريقة تأكيد التسليم */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { display: grid; gap: 6px; justify-items: start; text-align: start; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.choice-card svg { width: 26px; height: 26px; color: var(--ink-3); }
.choice-card b { font-size: 16px; color: var(--ink); }
.choice-card span { font-size: 13px; color: var(--muted); line-height: 1.6; }
.choice-card:hover, .choice-card:focus-visible { border-color: var(--ink-3); background: var(--ink-soft); outline: none; }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }
.ledger tr.row-warn td { background: #fffaf0; }
.rate-fix { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.rate-fix svg { width: 12px; height: 12px; }
.rate-fix:hover { color: var(--ink); text-decoration: underline; }
.btn.warn-btn { color: var(--brass); border-color: var(--brass-strong); }
/* حالة النظام */
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.health-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.health-row b { display: block; font-size: 14px; }
.health-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; word-break: break-word; }
.health-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; color: #fff; }
.health-row.ok .health-dot { background: var(--olive); }
.health-row.bad .health-dot { background: #b42318; }
.health-row.warn .health-dot { background: var(--brass-strong); color: #1a1407; }
