/* =====================================================================
   هوية الخط الأسرع — غيّر الألوان من هنا
   ===================================================================== */
:root {
  --ink: #0f1b2d;          /* اللون الأساسي الغامق */
  --ink-2: #1b2b44;
  --accent: #d91e18;       /* أحمر شعار الخط الأسرع */
  --accent-2: #ff4b3e;
  --accent-soft: #fdeceb;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #16202e;
  --muted: #64748b;
  --ok: #138a52;  --ok-bg: #e6f6ee;
  --warn: #b26a00; --warn-bg: #fff4dc;
  --info: #1f5fbf; --info-bg: #e8f0fd;
  --bad: #c0362c;  --bad-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- عناصر النماذج ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #5b6b82; box-shadow: 0 0 0 3px rgba(91,107,130,.15); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 11px 18px;
  background: var(--accent); color: #fff; cursor: pointer; transition: transform .05s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #b8150f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; padding: 13px; }
.btn.dark { background: var(--ink); } .btn.dark:hover { background: var(--ink-2); }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid var(--line); }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 600; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
.btn.ghost .spin { border-color: rgba(0,0,0,.15); border-top-color: var(--text); }
@keyframes sp { to { transform: rotate(360deg); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.muted { color: var(--muted); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* ---------- الشارات ---------- */
.chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.st-new   { background: var(--info-bg); color: var(--info); }
.st-proc  { background: var(--warn-bg); color: var(--warn); }
.st-ready { background: #f0eafd; color: #5b34c4; }
.st-done  { background: var(--ok-bg); color: var(--ok); }
.st-bad   { background: var(--bad-bg); color: var(--bad); }
.st-muted { background: #eef1f5; color: #8a96a8; text-decoration: line-through; }

/* ---------- الشعار ---------- */
.logo-mark { display: inline-grid; place-items: center; border-radius: 12px; background: var(--accent); color: #fff; flex: none; transform: skewX(-8deg); }
.logo-mark svg { width: 62%; height: 62%; }
.logo-img { display: block; object-fit: contain; }

/* =====================================================================
   صفحة الدخول
   ===================================================================== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
  background: radial-gradient(1200px 500px at 110% -10%, #24406a 0%, transparent 60%), var(--ink);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.hero::after { /* خطوط السرعة */
  content: ""; position: absolute; inset: auto -10% 18% -10%; height: 180px; pointer-events: none;
  background: repeating-linear-gradient(-8deg, transparent 0 22px, rgba(217,30,24,.22) 22px 26px, transparent 26px 52px);
  mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
.hero .brand-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.hero .brand-row b { font-size: 22px; display: block; }
.hero .brand-row small { letter-spacing: .18em; opacity: .65; font-size: 11.5px; display: block; direction: ltr; text-align: right; }
.hero h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; position: relative; z-index: 1; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 17px; opacity: .8; max-width: 460px; margin: 0; position: relative; z-index: 1; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li span { flex: none; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); display: grid; place-items: center; font-weight: 800; color: var(--accent-2); }
.steps li b { display: block; } .steps li small { opacity: .65; }
.hero-links { display: flex; gap: 18px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-links a { color: #fff; opacity: .8; font-weight: 600; font-size: 14px; }

.panel-side { padding: 40px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.panel-side > * { width: 100%; max-width: 420px; }
.panel-side h2 { font-size: 22px; }
.tabs { display: flex; background: #e9edf3; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 700; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-foot { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 16px; font-size: 14px; }
.verify-card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.verify-card h3 small { color: var(--muted); font-weight: 500; font-size: 12px; direction: ltr; }
.verify-row { display: flex; gap: 8px; }
.verify-row input { direction: ltr; text-align: left; text-transform: uppercase; }
.verify-result { margin-top: 12px; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.verify-result.ok { background: var(--ok-bg); }
.verify-result.no { background: var(--bad-bg); color: var(--bad); }
.verify-result dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
.verify-result dt { color: var(--muted); } .verify-result dd { margin: 0; font-weight: 600; }
.secure-note { font-size: 12.5px; color: var(--muted); text-align: center; }

/* =====================================================================
   الهيدر والصفحات الداخلية
   ===================================================================== */
.topbar { background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand b { display: block; font-size: 16px; } .topbar .brand small { display: block; opacity: .6; font-size: 12px; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.08); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 80px; }
.page-tabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.page-tabs button { border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); padding: 12px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.page-tabs button.on { color: var(--text); border-color: var(--accent); }
.page-tabs .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11.5px; padding: 1px 7px; margin-inline-start: 4px; }
.banner { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- الكتالوج والسلة ---------- */
.order-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.cat-title { font-size: 14px; color: var(--muted); font-weight: 700; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.cat-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cat-title:first-child { margin-top: 0; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.item { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.item.in { border-color: var(--accent); background: linear-gradient(0deg, #fff, var(--accent-soft)); }
.item .nm { font-weight: 700; }
.item .pr { color: var(--muted); font-size: 13.5px; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; align-self: flex-start; }
.qty button { width: 36px; height: 36px; border: 0; background: #f3f5f8; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--text); }
.qty button:hover { background: #e7ebf1; }
.qty input { width: 54px; border: 0; border-radius: 0; text-align: center; padding: 6px 0; font-weight: 700; direction: ltr; }
.qty input:focus { box-shadow: none; }
.cart { position: sticky; top: 84px; }
.cart h3 { font-size: 17px; display: flex; justify-content: space-between; }
.cart-lines { max-height: 300px; overflow-y: auto; margin: 0 -6px 12px; padding: 0 6px; }
.cart-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cart-line span:first-child { flex: 1; }
.totals { display: grid; gap: 4px; font-size: 14px; margin-bottom: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 800; border-top: 1.5px solid var(--line); padding-top: 8px; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.mobile-cart { display: none; }

/* ---------- الجداول ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; padding: 8px 12px; }
.toolbar .grow { flex: 1; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-weight: 700; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #fafbfd; }
td.wrap-cell { white-space: normal; min-width: 180px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat small { color: var(--muted); font-weight: 600; display: block; }
.stat b { font-size: 26px; font-weight: 800; display: block; margin-top: 2px; }
.stat.hot { border-color: var(--accent); background: linear-gradient(135deg, #fff 60%, var(--accent-soft)); }
.logo-img { filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }

/* ---------- نافذة منبثقة + تنبيهات ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15,27,45,.5); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fi .18s; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; position: relative; animation: up .2s; }
.modal.wide { max-width: 720px; }
.modal-x { position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: #f1f4f8; font-size: 22px; cursor: pointer; line-height: 1; }
.modal h2 { font-size: 19px; padding-left: 40px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 16px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 12px 0 16px; font-size: 14px; }
.kv small { display: block; color: var(--muted); font-size: 12.5px; }
@keyframes fi { from { opacity: 0; } }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; text-align: center; }
.toast.err { background: var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); }
.demo-bar { background: #fff4dc; color: #7a4a00; font-size: 13px; text-align: center; padding: 7px 12px; }
.demo-bar button { background: none; border: 0; text-decoration: underline; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }

/* =====================================================================
   الجوال
   ===================================================================== */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .hero { padding: 28px 22px; gap: 22px; }
  .hero .steps, .hero p.lead { display: none; }
  .hero h1 { font-size: 24px; margin: 0; }
  .hero::after { inset: auto -10% -40px -10%; }
  .panel-side { padding: 22px 16px 40px; justify-content: flex-start; }
  .order-grid { grid-template-columns: 1fr; }
  .cart { display: none; }
  .mobile-cart { display: flex; position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; gap: 12px; align-items: center; justify-content: space-between; z-index: 30; box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .stats { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 14px; }
  .topbar .who span { display: none; }
  .wrap { padding: 16px 14px 100px; }
  .row2 { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1; }
}

/* =====================================================================
   ملف الشركة والتبويبات
   ===================================================================== */
.co-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 18px; padding: 18px 20px; }
.co-logo { width: 72px; height: 72px; border-radius: 14px; border: 1px solid var(--line); background: #f8fafc; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 800; font-size: 22px; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; }
.co-card h2 { font-size: 17px; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.co-card h2 small, .sec-title small { color: var(--muted); font-weight: 500; font-size: 12px; direction: ltr; }
.co-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.co-facts div { display: flex; gap: 9px; align-items: flex-start; min-width: 0; }
.co-facts svg { flex: none; width: 18px; height: 18px; color: var(--accent); margin-top: 3px; }
.co-facts dt { font-size: 12px; color: var(--muted); }
.co-facts dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.co-facts dd.num { direction: ltr; text-align: right; overflow-wrap: normal; }
.co-facts dd.missing { color: var(--warn); font-weight: 500; }

.tab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.tab-grid button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 8px 10px; border: 1.5px solid var(--line); background: #fff; border-radius: 11px; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; text-align: center; line-height: 1.3; transition: border-color .15s, background .15s; }
.tab-grid button:hover { border-color: #cfd6e0; background: #fafbfc; }
.tab-grid button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab-grid button svg { width: 17px; height: 17px; flex: none; }
.tab-grid .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11.5px; padding: 0 7px; }
.tab-grid button.on .count { background: #fff; color: var(--accent); }

.sec { padding: 22px; margin-bottom: 16px; }
.sec-title { font-size: 16.5px; margin: 0 0 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sec-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
input.locked { background: #f1f4f7; color: var(--muted); cursor: not-allowed; border-style: dashed; }
.lock-tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: #eef1f5; border-radius: 6px; padding: 1px 7px; margin-inline-start: 6px; }
.req { color: var(--accent); }
.hint { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.hint .bad { color: var(--bad); font-weight: 600; }
.hint .ok { color: var(--ok); font-weight: 600; }
.counter { direction: ltr; font-variant-numeric: tabular-nums; }
input.invalid { border-color: var(--bad); }
.prefix { display: flex; direction: ltr; }
.prefix span { display: grid; place-items: center; padding: 0 12px; background: #f1f4f7; border: 1.5px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; font-weight: 700; color: var(--muted); }
.prefix input { border-radius: 0 10px 10px 0; }

.logo-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-edit .co-logo { width: 104px; height: 104px; }
.logo-edit .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger-ghost { background: transparent; color: var(--bad); border: 1.5px solid #f2c4c0; }
.btn.danger-ghost:hover { background: var(--bad-bg); }

.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.drop { border: 2px dashed #cdd5df; border-radius: 12px; padding: 16px 14px; text-align: center; background: #fafbfd; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 150px; justify-content: center; transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { font-size: 14px; }
.drop small { color: var(--muted); font-size: 12px; }
.drop svg { width: 28px; height: 28px; color: var(--muted); }
.drop.done { border-style: solid; border-color: #b7e2cb; background: var(--ok-bg); cursor: default; }
.drop.done svg { color: var(--ok); }
.drop .file-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.save-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.save-bar .btn { min-width: 220px; padding: 14px; }
.save-bar .muted { font-size: 13.5px; }

.policy { white-space: pre-line; line-height: 2; font-size: 15px; margin: 0; }
.support-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.support-grid .card { padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: none; }
.support-grid b { font-size: 15px; }
.support-grid .val { font-weight: 700; direction: ltr; text-align: right; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .co-card { grid-template-columns: 1fr; }
  .co-facts { grid-template-columns: 1fr 1fr; }
  .co-card { padding: 16px; gap: 12px; }
  .co-card .co-logo { width: 56px; height: 56px; }
  .grid3, .grid2, .docs, .support-grid { grid-template-columns: 1fr; }
  .tab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .save-bar .btn { width: 100%; }
}

@media (max-width: 480px) { .co-facts { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- أماكن الاستلام ---------- */
.pick-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pick-filter button { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 14px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text); }
.pick-filter button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick { position: relative; display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.pick:hover { border-color: #c4ccd8; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick input:focus-visible + .pick-dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b6c0cd; margin-top: 2px; display: grid; place-items: center; background: #fff; }
.pick.on .pick-dot { border-color: var(--accent); }
.pick.on .pick-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.pick-body { display: grid; gap: 4px; min-width: 0; }
.pick-body b { font-size: 15px; }
.pick-line { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.pick-line svg { width: 14px; height: 14px; flex: none; }
.pick-map { font-size: 13px; font-weight: 600; }
.pick-summary { display: flex; gap: 10px; align-items: flex-start; background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.pick-summary > svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.pick-summary > div { flex: 1; min-width: 0; }
.pick-summary small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .pick-list { grid-template-columns: 1fr; } }

/* ---------- دخول الإدارة ---------- */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 400px at 100% 0%, #24406a 0%, transparent 60%), var(--ink); }
.admin-login .card { width: 100%; max-width: 400px; }
.admin-login .brand-row { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.admin-login .brand-row b { display: block; font-size: 19px; }
.admin-login .brand-row small { display: block; color: var(--muted); }
.pick-body .chip { justify-self: start; }

/* ---------- الدفع ---------- */
.st-muted-plain { background: #eef1f5; color: #5b6b82; }
.pay-panel { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; display: grid; gap: 10px; }
.pay-panel p { margin: 0; font-size: 14px; line-height: 1.8; }
.pay-panel.ok { border-color: #b7e2cb; background: var(--ok-bg); }
.pay-panel.bad { border-color: #f2c4c0; }
.pay-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pay-head .link-btn { margin-inline-start: auto; font-size: 13.5px; }
.bank-box { background: #f6f8fb; border-radius: 10px; padding: 6px 12px; display: grid; }
.bank-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; min-height: 40px; }
.bank-row:last-child { border-bottom: 0; }
.bank-row small { color: var(--muted); }
.bank-row .num { overflow-wrap: anywhere; font-weight: 700; text-align: right; }
.pay-upload { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.pay-upload .drop.done svg { color: var(--ok); }
details > summary { cursor: pointer; list-style: none; margin-top: 2px; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }
@media (max-width: 700px) { .pay-upload { grid-template-columns: 1fr; } .bank-row { grid-template-columns: 76px 1fr auto; } }
.proof { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; font-weight: 600; font-size: 14px; }
.proof img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: #f1f4f7; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bank-row .num { white-space: normal; word-spacing: 2px; }
@media (max-width: 700px) {
  .bank-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .bank-row small { grid-column: 1 / -1; }
}
.st-wait { background: #eceff8; color: #4a5a8a; }

/* ---------- طريقة الدفع في ملخص الطلب ---------- */
.cart { max-height: calc(100vh - 100px); overflow-y: auto; }
.pay-choose { display: grid; gap: 8px; margin-bottom: 14px; }
.pay-choose-title { font-weight: 700; font-size: 13.5px; }
.pay-opt { padding: 10px 12px; }
.pay-opt .pick-body b { font-size: 14px; }
.pay-opt .pick-line { font-size: 12.5px; }
.pay-bank-inline { display: grid; gap: 8px; }
.pay-bank-inline .bank-row { grid-template-columns: 1fr auto; row-gap: 0; font-size: 13px; min-height: 0; padding: 5px 0; }
.pay-bank-inline .bank-row small { grid-column: 1 / -1; }
.pay-bank-inline .bank-row .btn.sm { padding: 3px 9px; font-size: 12px; }
.pay-bank-inline .bank-row .num { font-size: 12.5px; white-space: nowrap; word-spacing: 0; }

/* ---------- شرط استكمال البيانات قبل الطلب ---------- */
.gate { max-width: 640px; }
.gate-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.gate-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.gate-list li svg { width: 18px; height: 18px; flex: none; }
.gate-list li small { margin-inline-start: auto; font-weight: 600; font-size: 12.5px; }
.gate-list li.ok { background: var(--ok-bg); color: var(--ok); }
.gate-list li.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- رسائل البنك ---------- */
.sms-raw { white-space: pre-wrap; font-family: inherit; font-size: 12.5px; background: #f6f8fb; border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; max-width: 340px; }
.sms-link { display: grid; gap: 6px; min-width: 220px; }
.sms-link select { padding: 7px 10px; font-size: 13px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 12px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { min-width: 0; flex: 1; font-size: 13px; }
.steps-ios { padding-inline-start: 22px; margin: 0 0 10px; display: grid; gap: 8px; line-height: 1.8; font-size: 14.5px; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: " ▾"; color: var(--muted); }
@media (max-width: 900px) { .setup-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   الجوال — في آخر الملف حتى تتقدّم على ما سبقها
   ===================================================================== */
@media screen and (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; margin-bottom: 16px; }
  .stat { padding: 12px 14px; min-width: 0; }
  .stat small { font-size: 12.5px; line-height: 1.5; }
  .stat b { font-size: 21px; overflow-wrap: anywhere; line-height: 1.3; }
  .stat b small, .stat b .cur { display: inline; font-size: 13px; }

  /* بطاقة المنشأة مختصرة: الاسم والسجل فقط */
  .co-card { grid-template-columns: auto 1fr; align-items: center; padding: 12px 14px; gap: 12px; margin-bottom: 12px; }
  .co-card .co-logo { width: 46px; height: 46px; font-size: 16px; border-radius: 10px; }
  .co-card h2 { font-size: 15px; margin: 0 0 4px; }
  .co-card h2 small { display: none; }
  .co-facts { grid-template-columns: 1fr; gap: 4px; }
  .co-facts > div:nth-child(n+3) { display: none; }
  .co-facts dt { display: none; }
  .co-facts svg { width: 15px; height: 15px; margin-top: 2px; }
  .co-facts dd { font-size: 13.5px; }

  /* تبويبات البوابة: شريط أفقي قابل للتمرير */
  .tab-grid { display: flex; overflow-x: auto; gap: 6px; margin: 0 -14px 16px; padding: 2px 14px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .tab-grid::-webkit-scrollbar { display: none; }
  .tab-grid button { flex: none; min-height: 40px; padding: 6px 13px; font-size: 13.5px; white-space: nowrap; scroll-snap-align: start; }
  .page-tabs { margin-inline: -14px; padding-inline: 10px; scrollbar-width: none; }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tabs button { padding: 11px 10px; }

  /* أدوات التصفية: عمودان */
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .toolbar input, .toolbar select, .toolbar .btn { min-width: 0; width: 100%; }
  .toolbar input[type="search"], .toolbar .grow { grid-column: 1 / -1; }

  /* الجداول بطاقاتٍ */
  .table-wrap:has(table.mcards) { overflow: visible; }
  table.mcards, table.mcards tbody, table.mcards tr, table.mcards td { display: block; width: 100%; }
  table.mcards thead { display: none; }
  table.mcards tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.mcards tr:last-child { border-bottom: 0; }
  table.mcards td { position: relative; border: 0 !important; padding: 4px 0; padding-inline-start: 38%; min-height: 26px; white-space: normal; text-align: start; overflow-wrap: anywhere; }
  table.mcards td::before { content: attr(data-label); position: absolute; inset-inline-start: 0; top: 5px; width: 35%; color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.4; }
  table.mcards td.nolabel { padding-inline-start: 0; }
  table.mcards td.nolabel::before { content: none; }
  table.mcards td:empty { display: none; }
  table.mcards tr td:first-child { font-weight: 700; }

  .modal { padding: 18px 16px; max-height: calc(100dvh - 24px); }
  .sec { padding: 16px; }
  h1 { font-size: 22px; }
}
@media screen and (max-width: 700px) {
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- الموظفون والصلاحيات ---------- */
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip { background: #eef1f6; color: var(--ink); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 6px; margin: 0; min-width: 0; }
.perm-group legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.perm-group .check { margin: 6px 0; font-size: 13.5px; }
@media (max-width: 700px) { .perm-grid { grid-template-columns: 1fr; } }

/* ---------- التحديد والحذف ---------- */
.sel-col { width: 36px; text-align: center; }
.sel-col input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--accent); }
.del-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--bad-bg, #fdecec); border: 1px solid #f2c4c0; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
.del-bar span { margin-inline-end: auto; }
@media screen and (max-width: 700px) {
  table.mcards td.sel-col { position: absolute; inset-inline-end: 12px; top: 10px; width: auto; padding: 0; min-height: 0; }
  table.mcards tr { position: relative; }
}
@media screen and (max-width: 700px) {
  table.mcards td, table.mcards td.num { direction: rtl; text-align: right; }
  table.mcards td.sel-col { left: 12px; right: auto; }
}
