/* =========================================================
   لؤلؤة بورسعيد — نظام تشغيل الموقع
   الهوية: ملح أبيض، مية البحر (Brine)، رمل الصحرا، وقلم التظليل الأصفر
   اللي العميل بيعلّم بيه الإجماليات في كشوفه.
   ========================================================= */
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/plex-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/plex-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/plex-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(../vendor/fonts/plex-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/plex-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/plex-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/plex-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: 'Plex'; font-weight: 700; font-display: swap; src: url(../vendor/fonts/plex-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --salt: #f2f4f3;
  --paper: #ffffff;
  --paper-2: #f8faf9;
  --brine: #0b3b5c;
  --brine-2: #12507a;
  --brine-soft: #e3edf4;
  --sky: #2f80c8;
  --dune: #c9a56b;
  --dune-soft: #f5ecdc;
  --steel: #1f2b35;
  --steel-2: #3b4a56;
  --muted: #6b7a86;
  --line: #dde4e8;
  --line-2: #e9eef0;
  --hl: #f7dd4d;
  --ok: #1f8a5b;
  --ok-soft: #e4f3ec;
  --bad: #c8372d;
  --bad-soft: #fbe9e7;
  --focus: 0 0 0 3px rgba(47, 128, 200, .28);
  --r-lg: 20px;
  --side: 256px;
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --salt: #0c151c;
  --paper: #121e27;
  --paper-2: #16242f;
  --brine: #3d9ad6;
  --brine-2: #5aaee6;
  --brine-soft: #15324a;
  --dune-soft: #2a2418;
  --steel: #e7eef2;
  --steel-2: #c3d0d8;
  --muted: #8b9ba7;
  --line: #22323e;
  --line-2: #1b2933;
  --hl: #8f7810;
  --ok-soft: #10291e;
  --bad-soft: #31161a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--salt); color: var(--steel); font-family: var(--font);
  font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.hide { display: none !important; }
.hl { background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%); padding: 0 3px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ================= الهيكل ================= */
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); z-index: 40;
  background: var(--paper); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; }
.brand b { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--brine); }
:root[data-theme="dark"] .brand b { color: var(--steel); }
.brand small { font-size: 12px; color: var(--muted); }
.nav { padding: 4px 12px 12px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; margin-bottom: 1px; color: var(--steel-2); font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: var(--paper-2); color: var(--steel); }
.nav a.active { background: var(--brine); color: #fff; }
:root[data-theme="dark"] .nav a.active { color: #08131b; }
.nav a .dot { width: 8px; height: 8px; border-radius: 2px; margin-inline: 6px; transform: rotate(45deg); }
.nav a.active .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--dune-soft); color: #8a6a32; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--muted); font-size: 12px; }
.side-foot button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 7px; border-radius: 9px; display: grid; }
.side-foot button:hover { color: var(--steel); background: var(--paper-2); }

.main { margin-inline-start: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--salt) 88%, transparent); backdrop-filter: blur(12px); }
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .date-chip { font-size: 13.5px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--steel-2); }
.menu-btn { display: none; }
.content { padding: 8px 28px 40px; flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; }
.bottom-nav, .scrim { display: none; }

/* ================= شبكات وأسطح ================= */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.card-b { padding: 14px 20px 20px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 2px 12px; }
.section-title h2 { font-size: 17px; font-weight: 700; margin: 0; flex: 1; }
.section-title a { font-size: 14px; color: var(--brine); font-weight: 600; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi .t { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.35; }
.kpi .v small { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-inline-start: 5px; }
.kpi .s { font-size: 12.5px; color: var(--muted); }
.kpi .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi .ic svg { width: 16px; height: 16px; }

/* ================= الرصيد ================= */
.balance {
  position: relative; overflow: hidden; border-radius: 24px; color: #fff; padding: 22px 24px 0;
  background-color: #0b3b5c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09'%3E%3Crect x='8' y='10' width='10' height='10' transform='rotate(18 13 15)'/%3E%3Crect x='40' y='34' width='7' height='7' transform='rotate(-24 43 37)'/%3E%3Crect x='26' y='50' width='5' height='5' transform='rotate(40 28 52)'/%3E%3C/g%3E%3C/svg%3E");
}
/* الكارت بيفضل أزرق دايماً، والتنبيه بيظهر كشريط أصفر بس */
.balance.low .warn { background: rgba(247,221,77,.18); color: #fbe98a; border: 1px solid rgba(247,221,77,.35); }
.balance .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.balance .lbl { font-size: 14px; color: #b9d0e0; }
.balance .day { font-size: 13px; color: #b9d0e0; }
.balance .big { font-size: 46px; font-weight: 700; line-height: 1.15; margin: 6px 0 2px; letter-spacing: -.5px; }
.balance .big small { font-size: 16px; font-weight: 500; color: #b9d0e0; margin-inline-start: 8px; letter-spacing: 0; }
.balance .warn { display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.14); padding: 3px 10px; border-radius: 8px; font-size: 13px; margin-top: 4px; }
.balance .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.balance .strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px -24px 0; border-top: 1px solid rgba(255,255,255,.12); position: relative; z-index: 1; }
.balance .strip > div { padding: 14px 24px; }
.balance .strip > div + div { border-inline-start: 1px solid rgba(255,255,255,.12); }
.balance .strip b { display: block; font-size: 19px; font-weight: 700; }
.balance .strip span { font-size: 12.5px; color: #b9d0e0; }
.balance .dune { position: absolute; inset-inline-end: 0; top: 0; width: 280px; height: 130px; pointer-events: none; }

/* ================= الخانات ================= */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  --c: var(--brine);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 14px 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; text-align: start; width: 100%;
  transition: border-color .15s, transform .1s;
}
.tile:hover { border-color: var(--c); }
.tile:active { transform: scale(.97); }
.tile .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--c); }
.tile .ti svg { width: 21px; height: 21px; stroke-width: 2; }
.tile b { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.tile .row { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.tile .row strong { font-weight: 700; color: var(--steel); font-size: 14px; }
.tile .row.zero strong { color: var(--muted); font-weight: 500; }
.tiles.big { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tiles.big .tile { padding: 18px; min-height: 130px; }
.tile .desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ================= دفتر النهارده ================= */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.ledger li a { display: contents; }
.ledger .sw { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); flex-shrink: 0; }
.ledger .nm { flex: 1; }
.ledger .am { font-weight: 600; }
.ledger .am.zero { color: var(--line); font-weight: 400; }
.ledger li.total { border-top: 2px solid var(--steel); border-bottom: 0; margin-top: 2px; padding-top: 12px; font-weight: 700; font-size: 16px; }

/* ================= الأزرار ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg.i { width: 18px; height: 18px; }
.btn-primary { background: var(--brine); color: #fff; }
.btn-primary:hover { background: var(--brine-2); }
:root[data-theme="dark"] .btn-primary { color: #08131b; }
.btn-dark { background: var(--steel); color: var(--paper); }
.btn-ghost { background: var(--paper); color: var(--steel-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--steel-2); color: var(--steel); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-gold { background: var(--hl); color: #3b3204; }
.btn-light { background: rgba(255,255,255,.14); color: #fff; }
.btn-light:hover { background: rgba(255,255,255,.24); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ================= الحقول ================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--steel-2); }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); outline: none; font-size: 15.5px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--sky); box-shadow: var(--focus); }
.input.amount { font-size: 22px; font-weight: 700; height: 56px; text-align: center; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 14.5px; }
.switch input { width: 19px; height: 19px; accent-color: var(--brine); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); font-weight: 500; font-size: 14.5px; cursor: pointer; color: var(--steel-2); white-space: nowrap;
}
.chip:hover { border-color: var(--steel-2); }
.chip.on { background: var(--steel); border-color: var(--steel); color: var(--paper); }
.chip.add { border-style: dashed; color: var(--brine); }
.chip small { font-weight: 400; opacity: .7; }

/* ================= الإدخال السريع (لوحة الأرقام) ================= */
.qe { display: flex; flex-direction: column; gap: 14px; }
.qe-label { font-size: 13.5px; font-weight: 600; color: var(--steel-2); display: flex; justify-content: space-between; align-items: baseline; }
.qe-items { display: flex; flex-wrap: wrap; gap: 8px; }
.qe-new { display: flex; gap: 8px; }
.qe-display { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 6px 10px 12px; border-bottom: 2px solid var(--line); min-height: 72px; cursor: text; }
.qe-display.focus { border-bottom-color: var(--sky); }
.qe-display .val { font-size: 46px; font-weight: 700; line-height: 60px; height: 60px; display: block; letter-spacing: -.5px; }
.qe-display .val.empty { color: var(--line); }
.qe-display .cur { font-size: 16px; color: var(--muted); }
.qe-display input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; font-size: 16px; }
.qe-meta { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.qe-meta .input { height: 46px; }
.qe-meta .icon-btn { width: 46px; height: 46px; position: relative; }
.qe-meta .icon-btn.has { border-color: var(--ok); color: var(--ok); }
.qe-meta input[type=date] { width: 150px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; direction: ltr; }
.pad button { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-size: 24px; font-weight: 500; cursor: pointer; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.pad button:active { background: var(--brine-soft); }
.pad button.fn { background: var(--paper-2); color: var(--steel-2); font-size: 18px; }
.qe-done { padding: 12px 16px; border-radius: 16px; background: var(--ok-soft); }
.qe-done .h { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; color: var(--ok); margin-bottom: 4px; }
.qe-done ul { margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
.qe-done li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
.qe-done li span:first-child { flex: 1; }
.qe-done li button { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.qe-wrap { max-width: 480px; margin: 0 auto; }
@media (hover: hover) and (pointer: fine) and (min-width: 901px) { .qe .pad { display: none; } }

/* ================= إدخال متعدد ================= */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.4fr) 44px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2); }
.line.pay { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
.line .field > label { font-size: 12.5px; }
.line .rm { height: 46px; width: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.line .rm:hover { color: var(--bad); border-color: var(--bad); }
.total-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.total-bar b { font-size: 21px; font-weight: 700; }
.total-bar b .num { background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%); padding: 0 3px; }

.sheet { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.sheet th { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 4px 6px; text-align: start; white-space: nowrap; }
.sheet td { padding: 0 4px; vertical-align: middle; }
.sheet .input { height: 44px; font-size: 15px; padding: 0 10px; }
.sheet td.calc { font-weight: 700; text-align: center; white-space: nowrap; min-width: 74px; }
.sheet .idx { color: var(--muted); text-align: center; width: 30px; }

/* ================= الجداول ================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--paper-2); }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--steel); padding-top: 12px; }
table.t tfoot td { background: var(--paper-2); }
table.t td.n, table.t th.n { text-align: end; font-variant-numeric: tabular-nums; }
table.t.matrix td, table.t.matrix th { padding: 9px 10px; font-size: 13.5px; }
table.t.matrix th { white-space: normal; min-width: 90px; line-height: 1.4; vertical-align: bottom; }
table.t.matrix th.n { border-bottom: 3px solid currentColor; }
table.t td.zero { color: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--paper-2); border: 1px solid var(--line); }
.pill .d { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.off { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* ================= سجل الحركات ================= */
.day { margin-bottom: 18px; }
.day-h { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 4px 8px; font-weight: 600; font-size: 14.5px; }
.day-h span { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.day-h span b { font-weight: 700; }
.day-list { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--paper); cursor: pointer; border-bottom: 1px solid var(--line-2); }
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--paper-2); }
.entry .ei { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.entry .ei svg { width: 19px; height: 19px; }
.entry .et { flex: 1; min-width: 0; }
.entry .et b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .et small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .ea { font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.entry .ea.in { color: var(--ok); }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.bar-row .top b { font-weight: 600; }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brine); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 0 13px; height: 36px; border-radius: 9px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--steel); color: var(--paper); }
.range { display: flex; align-items: center; gap: 6px; }
.range .input { height: 42px; width: 156px; font-size: 14.5px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1px solid var(--line); background: var(--paper); padding: 0 16px; height: 40px; border-radius: 999px; font-weight: 500; color: var(--steel-2); cursor: pointer; white-space: nowrap; font-size: 14.5px; }
.tabs button.on { background: var(--steel); border-color: var(--steel); color: var(--paper); }

.cat-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.cat-head .ti { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c); color: #fff; flex-shrink: 0; }
.cat-head .ti svg { width: 26px; height: 26px; stroke-width: 2; }
.cat-head h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.3; }
.cat-head p { margin: 0; color: var(--muted); font-size: 14px; }
.cat-head .grow { flex: 1; min-width: 0; }

.empty { text-align: center; padding: 44px 18px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; stroke-width: 1.4; opacity: .5; margin-bottom: 8px; }
.empty b { display: block; color: var(--steel-2); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { margin: 0 0 12px; }

/* ================= النوافذ ================= */
.modal-back { position: fixed; inset: 0; background: rgba(12, 24, 33, .5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--paper); border-radius: 24px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 70px -20px rgba(12, 24, 33, .45); animation: pop .2s ease; }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 460px; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.modal-h .mi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.modal-h .mi svg { width: 19px; height: 19px; stroke-width: 2; }
.modal-b { padding: 18px 20px 20px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); justify-content: flex-end; flex-wrap: wrap; }
.modal-f .sp { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px); } }

.toasts { position: fixed; z-index: 200; inset-inline: 0; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--steel); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; animation: pop .2s ease; max-width: 520px; font-size: 14.5px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); }
.toast.ok svg { color: #6ee7a8; }
.toast.err { background: var(--bad); color: #fff; }

.loading-screen { min-height: 50vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brine); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= الدخول ================= */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--paper); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(180deg, rgba(11,59,92,0) 30%, rgba(11,59,92,.94) 85%), url(../icons/site.jpg) center/cover no-repeat, #0b3b5c; }
.login-art h2 { font-size: 36px; font-weight: 700; margin: 0 0 10px; line-height: 1.3; max-width: 520px; }
.login-art p { color: #cfe0ec; margin: 0; max-width: 440px; font-size: 16px; }
.login-box { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .logo { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 22px; }
.login-card h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.login-card p { color: var(--muted); margin: 0 0 28px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.err-box { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-weight: 500; font-size: 14px; }

.print-head { display: none; }

/* ================= ستايل اللابتوب: القائمة الجانبية الغامقة ================= */
.sidebar {
  background-color: #0b3b5c; border-inline-end: 0; color: #c5d6e3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05'%3E%3Crect x='8' y='10' width='10' height='10' transform='rotate(18 13 15)'/%3E%3Crect x='40' y='34' width='7' height='7' transform='rotate(-24 43 37)'/%3E%3Crect x='26' y='50' width='5' height='5' transform='rotate(40 28 52)'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-theme="dark"] .sidebar { background-color: #08202f; }
.brand { border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.brand b, :root[data-theme="dark"] .brand b { color: #fff; }
.brand small { color: #8fb0c8; }
.nav-label { color: #7f9fb7; }
.nav a { color: #c5d6e3; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active, :root[data-theme="dark"] .nav a.active { background: #f2f4f3; color: #0b3b5c; font-weight: 600; }
.nav a.active .dot { box-shadow: none; }
.side-foot { border-top-color: rgba(255,255,255,.08); }
.side-foot .who b { color: #fff; }
.side-foot .who small, .side-foot button { color: #8fb0c8; }
.side-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }
.avatar { background: #c9a56b; color: #0b3b5c; }

/* ================= الرئيسية: تقسيمة اللابتوب ================= */
.dash { display: grid; gap: 22px 20px; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-areas: "bal bal" "a b"; align-items: start; }
.dash .col-a { grid-area: a; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.dash .col-b { grid-area: b; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (min-width: 1101px) {
  .dash .balance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 32px; align-content: start; }
  .dash .balance > * { grid-column: 1; }
  .dash .balance .mix { grid-column: 2; grid-row: 1 / span 6; align-self: center; margin: 0; }
  .dash .balance .strip { grid-column: 1 / -1; margin-top: 22px; }
  .dash .balance .dune { display: none; }
  .dash .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .dash .tile b { white-space: normal !important; }
}
.dash > section[style*="chart"], .dash > section[style*="recent"] { align-self: start; }
.balance { display: flex; flex-direction: column; }
.balance .strip { margin-top: auto; grid-template-columns: repeat(4, 1fr); }
.balance .acts { margin-bottom: 20px; }
.mix { position: relative; z-index: 1; margin: 4px 0 22px; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.07); }
.mix-h { display: flex; justify-content: space-between; font-size: 13.5px; color: #b9d0e0; margin-bottom: 10px; }
.mix-h b { color: #fff; font-size: 14px; }
.mix-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.08); }
.mix-bar i { display: block; height: 100%; min-width: 3px; }
.mix-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: #dbe7f0; }
.mix-leg a { display: inline-flex; align-items: center; gap: 7px; }
.mix-leg b { color: #fff; font-weight: 600; }
.mix-leg .sw { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); }

/* الدفتر بشكل وصل ورق */
.receipt {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 18px 20px 22px; display: flex; flex-direction: column;
  margin-bottom: 10px;
}
.receipt::after {
  content: ''; position: absolute; inset-inline: -1px; bottom: -10px; height: 10px;
  background: linear-gradient(-45deg, transparent 6px, var(--paper) 0) 0 0 / 14px 10px repeat-x,
              linear-gradient(45deg, transparent 6px, var(--paper) 0) 0 0 / 14px 10px repeat-x;
  filter: drop-shadow(0 1px 0 var(--line));
}
.receipt-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid var(--steel); margin-bottom: 4px; }
.receipt-h h3 { margin: 0; font-size: 17px; font-weight: 700; }
.receipt-h span { font-size: 13px; color: var(--muted); }
.receipt .ledger li { border-bottom: 0; padding: 7px 0; }
.ledger .dots { flex: 1; border-bottom: 1.5px dotted var(--line); transform: translateY(-4px); min-width: 12px; }
.ledger .nm { flex: 0 1 auto; }
.ledger-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--steel); padding-top: 12px; margin-top: 8px; font-weight: 700; }
.ledger-total b { font-size: 22px; }
.ledger-total small { font-size: 13px; color: var(--muted); font-weight: 500; }
.prod { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 16px; }
.prod a { padding: 12px 14px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.prod a:hover { border-color: var(--line); }
.prod span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.prod span svg { width: 15px; height: 15px; }
.prod b { font-size: 18px; }
.prod b small { font-size: 12px; color: var(--muted); font-weight: 500; }

/* الخانات على اللابتوب: صفوف مدمجة */
.tile .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .go { display: none; }
@media (min-width: 901px) {
  .dash .tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .dash .tile { flex-direction: row; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; }
  .dash .tile .ti { width: 46px; height: 46px; border-radius: 14px; }
  .dash .tile .tx { flex: 1; }
  .dash .tile b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dash .tile .go { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); flex-shrink: 0; transition: all .15s; }
  .dash .tile .go svg { width: 16px; height: 16px; }
  .dash .tile:hover { box-shadow: 0 10px 24px -14px rgba(11,59,92,.35); }
  .dash .tile:hover .go { background: var(--c); border-color: var(--c); color: #fff; }
  .topbar { height: 72px; }
  .topbar h1 { font-size: 22px; }
}
.legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i + * { margin-inline-end: 6px; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bal" "tiles" "led" "chart" "recent"; gap: 20px; }
  .dash .col-a, .dash .col-b { display: contents; }
}
@media (max-width: 900px) {
  .dash { gap: 16px; }
  .balance .strip { grid-template-columns: repeat(2, 1fr); }
  .balance .strip > div:nth-child(3) { border-inline-start: 0; }
  .balance .strip > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.12); }
  .mix { margin-bottom: 18px; }
  .mix-leg { font-size: 12.5px; gap: 4px 12px; }
}

/* ================= لمسات أخيرة ================= */
.main:has(.cat-head) .topbar h1 { font-size: 14.5px; font-weight: 500; color: var(--muted); }
.top-logo { display: none; width: 34px; height: 34px; border-radius: 10px; }
.tile b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 900px) {
  .top-logo { display: block; }
  .cat-head h2 { font-size: 19px; }
  .balance .acts { flex-wrap: nowrap; }
  .balance .acts .btn { flex: 1; padding: 0 8px; font-size: 13px; }
  .balance .acts .btn svg { display: none; }
  .mix { padding: 12px 14px; }
  .mix-leg a:nth-child(n+5) { display: none; }
  .tile b { min-height: 2.8em; }
  .dash .tile .row { margin-top: auto; }
}
@media (max-width: 380px) { .balance .acts .btn:last-child { display: none; } }
@media (max-width: 600px) { .cat-head > .btn { flex: 1 1 100%; } .cat-head .ti { width: 46px; height: 46px; } }

/* صفحة الإدخال السريع: فورم + ملخص جانبي */
.qe-layout { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 20px; align-items: start; }
.qe-side { position: sticky; top: 90px; }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-stats div { padding: 12px 14px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line-2); }
.side-stats span { display: block; font-size: 12.5px; color: var(--muted); }
.side-stats b { font-size: 20px; }
.side-list { list-style: none; margin: 14px 0 0; padding: 0; }
.side-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.side-list li:last-child { border-bottom: 0; }
.side-list small { display: block; color: var(--muted); font-size: 12.5px; }
.view-in { animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.login-card { max-width: 380px; }
.login-card h1 { font-size: 30px; }
.login-box { background: #fff; color: #1f2b35; }
@media (max-width: 1000px) { .qe-layout { grid-template-columns: minmax(0, 1fr); } .qe-side { position: static; } }

/* الجداول ككروت على الموبايل */
@media (max-width: 700px) {
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody { display: block; }
  table.t.stack tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
  table.t.stack tbody tr:last-child { border-bottom: 0; }
  table.t.stack tbody td { display: block; padding: 0; border: 0; white-space: normal; text-align: start !important; font-size: 14px; min-width: 0; }
  table.t.stack tbody td::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 1px; }
  table.t.stack tbody td[data-l=""]::before { display: none; }
  table.t.stack tbody td:empty { display: none; }
  table.t.stack tbody td[data-l="م"] { display: none; }
  table.t.stack tbody td:nth-child(1):not([data-l="م"]), table.t.stack tbody td[data-l="م"] + td { grid-column: 1 / -1; font-size: 15.5px; font-weight: 600; }
  table.t.stack tbody td:nth-child(1):not([data-l="م"])::before, table.t.stack tbody td[data-l="م"] + td::before { display: none; }
  table.t.stack tbody tr.click:hover td { background: none; }
  table.t.stack tfoot { display: block; }
  table.t.stack tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); border-top: 2px solid var(--steel); }
  table.t.stack tfoot td { display: block; padding: 0; border: 0; background: none; }
  table.t.stack tfoot td:empty { display: none; }
  .toolbar > p.grow { flex-basis: 100%; }
  .card .table-wrap { overflow: visible; }
}

/* ================= الموبايل ================= */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); width: 286px; box-shadow: 0 0 60px rgba(0,0,0,.2); }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,24,33,.45); z-index: 35; }
  .main { margin-inline-start: 0; padding-bottom: 84px; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar h1 { font-size: 18px; }
  .topbar .date-chip, #topAdd { display: none; }
  .content { padding: 4px 16px 24px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 4px 0; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brine); }
  .bottom-nav a.fab span.c { width: 50px; height: 50px; margin-top: -22px; border-radius: 16px; background: var(--brine); color: #fff; display: grid; place-items: center; border: 4px solid var(--salt); transform: rotate(45deg); }
  .bottom-nav a.fab span.c svg { transform: rotate(-45deg); width: 24px; height: 24px; stroke-width: 2.2; }
  .balance { padding: 18px 18px 0; border-radius: 22px; }
  .balance .big { font-size: 38px; }
  .balance .strip { margin: 16px -18px 0; }
  .balance .strip > div { padding: 12px 14px; }
  .balance .strip b { font-size: 16px; }
  .balance .dune { width: 170px; height: 80px; opacity: .8; }
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .line .f-desc { grid-column: 1 / -1; grid-row: 2; }
  .line.pay { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .line.pay .field:first-child { grid-column: 1 / -1; }
  .toasts { bottom: 96px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { min-height: 300px; padding: 28px 22px; }
  .login-art h2 { font-size: 26px; }
  .cat-head { flex-wrap: wrap; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { border-radius: 24px 24px 0 0; max-height: 94vh; }
  .modal-f .btn { flex: 1; }
  .range, .range .input { width: 100%; }
  .qe-wrap { max-width: none; }
  .g3.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpis .kpi { padding: 12px; }
  .kpis .kpi .v { font-size: 17px; }
  .kpis .kpi .v small { display: block; margin: 0; font-size: 11.5px; }
  .kpis .kpi .t { font-size: 12px; }
}
@media (max-width: 700px) {
  .sheet thead { display: none; }
  .sheet, .sheet tbody { display: block; }
  .sheet tr.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; position: relative; background: var(--paper-2); }
  .sheet tr.sheet-row td { padding: 0; }
  .sheet tr.sheet-row td .input { min-width: 0 !important; width: 100%; }
  .sheet td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .sheet td[data-l^="اسم"] { grid-column: 1 / -1; padding-inline-end: 48px !important; }
  .sheet td.idx { display: none; }
  .sheet td.rmc { position: absolute; top: 33px; inset-inline-end: 12px; }
  .sheet td.calc { text-align: start; align-self: end; padding-bottom: 10px !important; font-size: 17px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles { gap: 8px; }
  .tile { padding: 12px 10px 10px; border-radius: 16px; gap: 6px; }
  .tile .ti { width: 36px; height: 36px; border-radius: 11px; }
  .tile b { font-size: 13.5px; }
  .tile .row { font-size: 12px; }
  .tile .row strong { font-size: 13px; }
  .tiles.big { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.big .tile { padding: 14px; min-height: 0; }
  .tiles.big .tile .desc { display: none; }
  .kpi { padding: 13px 14px; }
  .kpi .v { font-size: 19px; }
  .toolbar .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { flex: 1; padding: 0 8px; }
  .card-h { padding: 16px 16px 0; }
  .card-b { padding: 12px 16px 16px; }
  .pad button { height: 54px; }
  .qe-display .val { font-size: 42px; line-height: 56px; height: 56px; }
  .qe-meta input[type=date] { width: 132px; font-size: 14px; padding: 0 8px; }
}

/* ================= الطباعة (PDF) ================= */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; color: #000; }
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts, .toolbar { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .card { border-color: #ccc; }
  .print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #0b3b5c; padding-bottom: 8px; margin-bottom: 12px; }
  .print-head b { font-size: 18px; }
  table.t td, table.t th { padding: 5px 6px; font-size: 10.5px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid.g4 { grid-template-columns: repeat(4, 1fr); }
  .g-main, .g2 { grid-template-columns: 1fr 1fr !important; }
  .g3 { grid-template-columns: repeat(3, 1fr) !important; }
  canvas { display: none !important; }
}

/* ================= اللوجو ================= */
.brand { flex-direction: column; align-items: stretch; gap: 8px; padding: 16px 16px 14px; }
.brand-plate { display: block; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.5); }
.brand-plate img { display: block; width: 100%; height: auto; }
.brand small { text-align: center; font-size: 12px; }
.login-logo { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 0 26px; }
.top-logo { object-fit: cover; background: #fff; border: 1px solid var(--line); }
@media (max-width: 900px) { .login-logo { max-width: 260px; } }

/* ================= صفحة الدخول (تصميم محدّث) ================= */
.login-wrap { grid-template-columns: 1.1fr 1fr; }
.login-art { padding: 56px; }
.login-art::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 100% 0%, rgba(201,165,107,.18), transparent 60%); }
.login-art > * { position: relative; z-index: 1; }
.login-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.login-tag .i { width: 15px; height: 15px; }
.login-box { background: var(--salt); color: var(--steel); position: relative;
  background-image: radial-gradient(circle at 1px 1px, rgba(11,59,92,.07) 1px, transparent 0); background-size: 22px 22px; }
.login-card { max-width: 420px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 24px;
  padding: 36px 32px 24px; box-shadow: 0 1px 2px rgba(15,42,67,.04), 0 24px 48px -24px rgba(15,42,67,.22);
  animation: viewIn .35s ease; }
.login-logo { max-width: 230px; margin: 0 auto 26px; }
.login-card h1 { font-size: 26px; margin: 0 0 4px; }
.login-card .login-sub { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.login-card form { gap: 18px; }
.login-input { position: relative; }
.login-input > .i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--muted); pointer-events: none; transition: color .15s; }
.login-input:focus-within > .i { color: var(--sky); }
.login-input .input { height: 52px; padding-inline-start: 44px; background: var(--paper-2); text-align: start; }
.login-input .input:focus { background: var(--paper); }
.login-input .input::placeholder { color: #a9b5be; }
.login-input .input[name=password] { padding-inline-end: 48px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { background: var(--line-2); color: var(--steel); }
.pw-toggle .i { width: 19px; height: 19px; }
.remember { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  font-size: 14.5px; font-weight: 500; color: var(--steel-2); margin-top: -4px; }
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); background: var(--paper);
  display: grid; place-items: center; transition: background .15s, border-color .15s; flex: none; }
.remember .box .i { width: 14px; height: 14px; color: #fff; stroke-width: 3; opacity: 0; transform: scale(.6); transition: .15s; }
.remember input:checked + .box { background: var(--brine); border-color: var(--brine); }
.remember input:checked + .box .i { opacity: 1; transform: none; }
.remember input:focus-visible + .box { box-shadow: var(--focus); }
.login-card .btn-lg { height: 54px; font-size: 16.5px; border-radius: 14px; margin-top: 4px;
  box-shadow: 0 10px 24px -12px rgba(11,59,92,.6); }
.login-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-2); text-align: center; color: var(--muted); font-size: 12.5px; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { min-height: 220px; padding: 24px 20px 64px; }
  .login-art h2 { font-size: 24px; }
  .login-art p { display: none; }
  .login-box { padding: 0 16px 32px; align-items: flex-start; }
  .login-card { margin-top: -44px; padding: 28px 20px 18px; border-radius: 22px; }
  .login-logo { max-width: 200px; margin-bottom: 20px; }
}

/* ================= البوب أب (في النص على كل الشاشات) ================= */
@media screen {
  .modal-back { align-items: center; justify-content: center; padding: 16px; background: rgba(10, 22, 32, .55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .modal { border-radius: 22px; max-height: calc(100dvh - 32px); overflow: hidden; animation: popIn .22s cubic-bezier(.2, .9, .3, 1.2);
    box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 32px 80px -24px rgba(8, 20, 30, .55); }
  .modal-h { padding: 16px 20px; background: var(--paper-2); }
  .modal-h h3 { font-size: 18px; }
  .modal-h .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .modal-b { padding: 20px; }
  .modal-f { padding: 14px 20px; background: var(--paper-2); align-items: center; }
  @keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
}
@media screen and (max-width: 700px) {
  .modal-back { align-items: center; padding: 16px; }
  .modal { border-radius: 20px; max-height: calc(100dvh - 32px); }
  .modal-h { padding: 14px 16px; }
  .modal-b { padding: 16px; }
  .modal-f { padding: 12px 16px; }
  .modal-f .btn { flex: 1; min-width: 0; }
  .modal-f .sp { display: none; }
}

/* ================= الجداول (شكل احترافي) ================= */
@media screen {
  table.t { border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
  table.t thead th { background: var(--paper-2); color: var(--steel-2); font-size: 12.5px; font-weight: 700; letter-spacing: .1px;
    padding: 11px 14px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
  table.t thead th:first-child { border-start-start-radius: 12px; border-inline-start: 1px solid var(--line-2); }
  table.t thead th:last-child { border-start-end-radius: 12px; border-inline-end: 1px solid var(--line-2); }
  table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--steel); }
  table.t tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
  table.t tbody tr { transition: background .12s; }
  table.t tbody tr:hover td { background: var(--brine-soft); }
  table.t td.n { font-weight: 600; font-variant-numeric: tabular-nums; }
  table.t td.n b { font-weight: 700; }
  table.t tfoot td { background: var(--brine-soft); color: var(--brine); font-weight: 700; border-top: 2px solid var(--brine); border-bottom: 0; padding: 13px 14px; }
  table.t tfoot td:first-child { border-end-start-radius: 12px; }
  table.t tfoot td:last-child { border-end-end-radius: 12px; }
  table.t.matrix tbody td:first-child { position: sticky; inset-inline-start: 0; background: var(--paper); font-weight: 600; z-index: 1; }
  table.t.matrix tbody tr:nth-child(even) td:first-child { background: var(--paper-2); }
  .table-wrap { border-radius: 12px; }
  .table-wrap::-webkit-scrollbar { height: 8px; }
  .table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
}

/* الجداول ككروت منظمة على الموبايل */
@media screen and (max-width: 700px) {
  table.t.stack tbody { display: flex; flex-direction: column; gap: 10px; }
  table.t.stack tbody tr { position: relative; gap: 10px 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: 0 1px 2px rgba(15,42,67,.04), 0 6px 16px -12px rgba(15,42,67,.18); }
  table.t.stack tbody tr:last-child { border-bottom: 1px solid var(--line); }
  table.t.stack tbody tr:nth-child(even) td, table.t.stack tbody tr:hover td { background: none; }
  table.t.stack tbody tr.click:active { transform: scale(.99); background: var(--paper-2); }
  table.t.stack tbody td { font-size: 14.5px; font-weight: 500; color: var(--steel); }
  table.t.stack tbody td::before { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
  table.t.stack tbody td.n { font-weight: 700; font-variant-numeric: tabular-nums; }
  table.t.stack tbody td:nth-child(1):not([data-l="م"]), table.t.stack tbody td[data-l="م"] + td {
    font-size: 15.5px; font-weight: 700; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px dashed var(--line); }
  table.t.stack tfoot tr { margin-top: 10px; border-radius: 14px; background: var(--brine-soft); border: 0; border-top: 0; color: var(--brine); }
  table.t.stack tfoot td { color: var(--brine); border: 0 !important; border-radius: 0 !important; }
}
@media screen and (max-width: 700px) {
  .card > .table-wrap:has(table.t.stack) { padding: 10px; }
  .card:has(> .table-wrap table.t.stack) { background: var(--paper-2); }
}

/* ================= هيدر التطبيق ================= */
.top-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-brand { display: none; }
.top-logo-link { display: contents; }
@media screen and (max-width: 900px) {
  .topbar { height: auto; min-height: 64px; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
    background: #0b3b5c; color: #fff; border-radius: 0 0 22px 22px; margin-bottom: 14px;
    -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 10px 28px -16px rgba(11,59,92,.7);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06'%3E%3Crect x='8' y='10' width='10' height='10' transform='rotate(18 13 15)'/%3E%3Crect x='40' y='34' width='7' height='7' transform='rotate(-24 43 37)'/%3E%3C/g%3E%3C/svg%3E"); }
  :root[data-theme="dark"] .topbar { background-color: #08202f; }
  .top-logo-link { display: block; order: 0; flex: none; }
  .top-logo { display: block; width: 42px; height: 42px; border-radius: 13px; border: 0; background: #fff; padding: 3px; object-fit: contain;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); }
  .top-ttl { order: 1; gap: 1px; }
  .top-brand { display: block; font-size: 11.5px; font-weight: 500; color: #9fbdd3; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar h1, .main:has(.cat-head) .topbar h1 { font-size: 17.5px; font-weight: 700; color: #fff; line-height: 1.35; }
  .menu-btn { order: 2; width: 42px; height: 42px; border-radius: 13px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; }
  .menu-btn:active { background: rgba(255,255,255,.2); }
}

/* ================= تحميل التطبيق (PWA) ================= */
.px-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.px-or::before, .px-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.px-btn { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; border-radius: 14px;
  border: 1.5px solid rgba(201,165,107,.65); background: #fdf8ee; color: #6b4a14; cursor: pointer; font-family: inherit;
  transition: background .18s, border-color .18s, transform .12s, box-shadow .18s; }
.px-btn:hover { background: #f8eedb; border-color: var(--dune); box-shadow: 0 10px 22px -14px rgba(201,165,107,.9); transform: translateY(-1px); }
.px-btn:disabled { opacity: .7; cursor: progress; }
.px-ic { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #d9b87e, #b98f4a); color: #fff; display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 14px -8px rgba(185,143,74,.9); }
.px-tx { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.px-tx b { font-size: 15px; font-weight: 700; color: #5a3d0e; }
.px-tx small { font-size: 11.5px; color: #9a7533; font-weight: 500; }
:root[data-theme="dark"] .px-btn { background: #2a2418; border-color: rgba(201,165,107,.45); }
:root[data-theme="dark"] .px-tx b { color: #f0dcb4; }
:root[data-theme="dark"] .px-tx small { color: #c9a56b; }
.login-fix { display: block; text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); text-decoration: underline; }

.px-sheet { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.px-sheet.on { display: flex; }
.px-back { position: absolute; inset: 0; background: rgba(10,22,32,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s; }
.px-sheet.show .px-back { opacity: 1; }
.px-box { position: relative; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--paper); color: var(--steel);
  border-radius: 22px; overflow: hidden; box-shadow: 0 32px 80px -24px rgba(8,20,30,.55); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .2s, transform .22s cubic-bezier(.2,.9,.3,1.2); }
.px-sheet.show .px-box { opacity: 1; transform: none; }
.px-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #0b3b5c; color: #fff; border-bottom: 3px solid var(--dune); }
.px-head img { border-radius: 14px; background: #fff; box-shadow: 0 6px 16px -8px rgba(0,0,0,.4); }
.px-head b { display: block; font-size: 16.5px; font-weight: 700; }
.px-head small { display: block; font-size: 12.5px; color: #b9d0e0; }
.px-close { margin-inline-start: auto; width: 36px; height: 36px; border: 0; border-radius: 11px; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.px-body { padding: 16px 18px 6px; overflow-y: auto; }
.px-foot { padding: 10px 18px 16px; }
.px-step { display: flex; align-items: center; gap: 12px; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 11px 13px; margin-bottom: 8px; font-size: 14px; font-weight: 500; line-height: 1.7; }
.px-n { width: 30px; height: 30px; border-radius: 10px; background: #0b3b5c; color: #f7dd4d; font-weight: 700; display: grid; place-items: center; flex: none; }
.px-flow .px-step { padding: 8px 12px; font-size: 13px; }
.px-flow .px-n { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.px-chip { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #e8f1ff; color: #007aff; vertical-align: middle; margin-inline-start: 4px; }
.px-note { background: #fdf8ee; border: 1px solid rgba(201,165,107,.4); color: #6b4a14; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; font-weight: 500; line-height: 1.8; margin-bottom: 8px; }
:root[data-theme="dark"] .px-note { background: #2a2418; color: #f0dcb4; }
.px-primary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #0b3b5c, #12507a); color: #fff; text-decoration: none; margin-bottom: 12px;
  box-shadow: 0 14px 28px -14px rgba(11,59,92,.9); }
.px-primary img { border-radius: 11px; box-shadow: 0 0 0 2px rgba(201,165,107,.7); }
.px-primary b { display: block; font-size: 15px; font-weight: 700; }
.px-primary small { display: block; font-size: 12px; color: #f7dd4d; font-weight: 500; }
.px-manual { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.px-manual summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; list-style: none; }
.px-manual summary::-webkit-details-marker { display: none; }
.px-manual summary::before { content: '▸ '; color: var(--dune); }
.px-manual[open] summary::before { content: '▾ '; }
.px-copy { width: 100%; height: 46px; border-radius: 13px; border: 1.5px solid #0b3b5c; background: var(--paper); color: var(--brine); font-weight: 700; font-family: inherit; cursor: pointer; margin-bottom: 6px; }
.px-ok-badge { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; text-align: center; margin-bottom: 10px; }

/* تنقل من غير دايرة تحميل: شريط رفيع فوق بس لو الصفحة اتأخرت */
body::before { content: ''; position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 300; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--dune), #f7dd4d, var(--dune), transparent); background-size: 50% 100%; background-repeat: no-repeat; }
body.route-busy::before { opacity: 1; animation: routeBar 1s ease-in-out infinite; }
@keyframes routeBar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
body.route-busy #view { opacity: .75; transition: opacity .2s .1s; }

/* ================= التحميل: هيكل الصفحة بلمعة بدل الدايرة ================= */
.loading-screen.sk-page { min-height: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 4px; place-items: initial; }
.sk { border-radius: 16px; background: linear-gradient(90deg, var(--line-2) 0%, var(--paper-2) 40%, var(--line-2) 80%); background-size: 300% 100%; animation: skShine 1.3s ease-in-out infinite; }
.sk-hero { height: 190px; border-radius: 22px; }
.sk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sk-card { height: 84px; }
.sk-tile { height: 120px; }
.sk-line { height: 16px; border-radius: 8px; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; margin-top: -4px; }
@keyframes skShine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (max-width: 700px) { .sk-hero { height: 220px; } .sk-card { height: 70px; } .sk-tile { height: 104px; } }

/* زرار بيحفظ: 3 نقط بتنبض بدل الدايرة */
.dots { display: inline-flex; gap: 5px; align-items: center; height: 18px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: dotPulse 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse { 0%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ================= أداء أسرع (تقليل اللاج على الموبايل واللابتوب) ================= */
/* البلور بيتعمل على كل فريم وانت بتسكرول وبيتقل الموبايلات الضعيفة → خلفيات سادة بدل البلور */
@media (min-width: 901px) { .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--salt); } }
.modal-back, .px-back { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(10,22,32,.62) !important; }
.login-tag { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* الضغطة تستجيب على طول من غير تأخير ولا تكبير بالدبل كليك */
a, button, .btn, .chip, .tile, input, select, textarea, label { touch-action: manipulation; }
/* القائمة الجانبية والنوافذ على طبقة لوحدها → حركة ناعمة */
.sidebar, .bottom-nav { will-change: transform; }
@media (min-width: 901px) { .sidebar { will-change: auto; } }
.view-in { animation-duration: .16s; }
/* الأجزاء اللي برة الشاشة متترسمش لحد ما توصلها */
table.t.stack tbody tr { content-visibility: auto; contain-intrinsic-size: auto 120px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ================= زرار تحميل التطبيق + الإصلاح (تصميم محدّث) ================= */
.px-or { margin: 22px 0 14px; font-size: 12px; font-weight: 500; color: var(--muted); }
.px-btn { min-height: 0; justify-content: flex-start; gap: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--paper); color: var(--steel); box-shadow: 0 1px 2px rgba(15,42,67,.05), 0 8px 20px -14px rgba(15,42,67,.25); }
.px-btn:hover { background: var(--paper); border-color: var(--brine); box-shadow: 0 1px 2px rgba(15,42,67,.05), 0 14px 28px -16px rgba(11,59,92,.45); transform: translateY(-1px); }
.px-btn:active { transform: translateY(0) scale(.99); }
.px-app { width: 44px; height: 44px; border-radius: 12px; flex: none; border: 1px solid var(--line-2); background: #fff; box-shadow: 0 4px 10px -6px rgba(15,42,67,.4); }
.px-tx { flex: 1; min-width: 0; }
.px-tx b { font-size: 15.5px; color: var(--steel); }
.px-tx small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.px-go { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brine); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(11,59,92,.7); transition: transform .15s; }
.px-btn:hover .px-go { transform: translateY(2px); }
:root[data-theme="dark"] .px-btn { background: var(--paper-2); border-color: var(--line); }
:root[data-theme="dark"] .px-tx b { color: var(--steel); }
:root[data-theme="dark"] .px-tx small { color: var(--muted); }
:root[data-theme="dark"] .px-go { color: #08131b; }
.px-plats { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.px-plat { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line-2); color: var(--steel-2); }
.px-plats > span:last-child { margin-inline-start: 4px; }

.login-fix { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; text-decoration: none;
  background: var(--paper-2); border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; transition: border-color .15s, background .15s; }
.login-fix:hover { border-color: var(--dune); background: #fdf8ee; }
.lf-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line-2); color: var(--dune); flex: none; }
.lf-tx { flex: 1; font-weight: 500; }
.lf-go { padding: 4px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--steel); font-weight: 700; font-size: 12px; }
.login-fix:hover .lf-go { border-color: var(--dune); color: #8a6420; }
:root[data-theme="dark"] .login-fix:hover { background: #2a2418; }

/* منع الزوم: الآيفون بيكبّر الصفحة لوحده لو خط الخانة أقل من 16px وانت بتكتب فيها */
html { touch-action: manipulation; }
@media (max-width: 900px) { .input, .sheet .input, .range .input, .login-input .input, select, textarea { font-size: 16px; } }

/* ================= الحساب + صورة المدير ================= */
.avatar.avatar-logo { background: #fff; padding: 3px; overflow: hidden; box-shadow: 0 4px 12px -6px rgba(0,0,0,.45); }
.avatar.avatar-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; }
.brand { padding-bottom: 16px; }
.acct { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.acct-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.acct-head img { width: 56px; height: 56px; border-radius: 16px; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 6px 16px -10px rgba(15,42,67,.5); }
.acct-head b { display: block; font-size: 17px; }
.acct-head span { color: var(--muted); font-size: 13px; }
.acct-grid { grid-template-columns: 1fr 1fr; }
.acct-grid .span2 { grid-column: 1 / -1; }
.acct-sep { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 12px; padding-top: 16px; border-top: 1px dashed var(--line); }
.acct-sep span { font-weight: 700; font-size: 15px; }
.acct-sep small { color: var(--muted); font-size: 12px; }
.acct-confirm { display: flex; align-items: flex-end; gap: 12px; margin-top: 20px; padding: 14px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line-2); }
.acct-confirm .field { flex: 1; }
.acct-confirm .field label { display: flex; align-items: center; gap: 6px; }
.acct-confirm .field label svg { width: 16px; height: 16px; color: var(--dune); }
.acct-confirm .btn { height: 46px; white-space: nowrap; }
@media (max-width: 700px) {
  .acct-grid { grid-template-columns: 1fr; }
  .acct-confirm { flex-direction: column; align-items: stretch; }
}
