/* ===== المهاب للربط الحكومي — الثيم مأخوذ من برامج المهاب (الحسابات / الفنادق) ===== */
:root {
  --menu: #cfe5cf;          /* شريط القوائم الأخضر الفاتح */
  --menu-dark: #a9d3a9;
  --menu-text: #1d3b1d;
  --orange: #ff8a00;
  --green: #1aa34a;
  --green-dark: #12803a;
  --bg: #f4f7f4;
  --panel: #ffffff;
  --border: #d5e3d5;
  --border-strong: #f0a04b;  /* إطار برتقالي مثل لوحة الأزرار */
  --text: #1f2a1f;
  --muted: #5f6f5f;
  --ok: #1aa34a;     --ok-bg: #e6f6ec;
  --warn: #c77700;   --warn-bg: #fff3e0;
  --bad: #c62828;    --bad-bg: #fdecea;
  --info: #1565c0;   --info-bg: #e8f1fd;
  --wait: #6d4c9f;   --wait-bg: #f1ebfa;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.04);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Cairo", "Tahoma", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  direction: rtl;
}
a { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }

/* ---------- شاشة الدخول ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange) 0%, #f7b733 35%, var(--green) 100%);
  padding: 16px;
}
.login-card {
  background: #fff; border-radius: 16px; width: 100%; max-width: 400px; padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center;
}
.login-card .logo { width: 72px; height: 72px; margin: 0 auto 10px; }
.login-card h1 { margin: 4px 0 2px; font-size: 22px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-card .field { text-align: right; }
.hint-box { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-top: 12px; }

/* ---------- الهيكل العام ---------- */
.menubar {
  background: var(--menu); border-bottom: 1px solid var(--menu-dark);
  display: flex; align-items: center; gap: 4px; padding: 0 12px; height: 48px; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--menu-text); margin-left: 14px; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; }
.menu { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.menu a {
  text-decoration: none; color: var(--menu-text); font-weight: 700; font-size: 14px;
  padding: 6px 9px; border-radius: 6px; white-space: nowrap;
}
.menu a:hover { background: var(--menu-dark); }
.menu a.active { background: #fff; box-shadow: inset 0 -3px 0 var(--green); }
.menubar .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }

.toolbar {
  background: #f0f0f0; border-bottom: 1px solid #ddd; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 13px;
}
.toolbar select { padding: 4px 8px; border-radius: 6px; border: 1px solid #ccc; background: #fff; }
.toolbar .tb-btn { border: 1px solid #ccc; background: #fff; border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.toolbar .tb-btn:hover { background: var(--menu); }

.layout { display: flex; min-height: calc(100vh - 90px); }
.tiles {
  width: 168px; flex: none; background: #fff; border-left: 2px solid var(--border-strong);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
  color: var(--text); font-weight: 700; font-size: 13px; text-align: center;
}
.tile .ic {
  width: 100%; height: 74px; border: 1px solid #c9c9c9; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff, #eef6ee); box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: transform .12s, box-shadow .12s;
}
.tile .ic svg { width: 40px; height: 40px; }
.tile:hover .ic { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.12); border-color: var(--green); }
.tile.active .ic { border: 2px solid var(--green); background: var(--ok-bg); }

main#view { flex: 1; padding: 18px 22px 40px; min-width: 0; }
.banner {
  width: 46px; flex: none; background: linear-gradient(180deg, var(--orange), var(--green));
  display: flex; align-items: center; justify-content: center;
}
.banner span {
  writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 800; font-size: 18px; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.25); white-space: nowrap;
}

/* ---------- عناصر عامة ---------- */
h2.page { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
h2.page svg { width: 30px; height: 30px; }
p.lead { margin: 0 0 18px; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card h3 > svg { width: 26px; height: 26px; flex: none; }
.card h3 .num { background: var(--green); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.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)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: Consolas, "Courier New", monospace; direction: ltr; text-align: left; }
.hidden { display: none !important; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 700; font-size: 13.5px; }
.field label .req { color: var(--bad); }
.field .help { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid #c8d6c8; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--menu-dark); border-color: var(--green); }
.field input.ltr { direction: ltr; text-align: left; }
.pw { position: relative; }
.pw input { padding-left: 38px; }
.pw button { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.switch input { width: 18px; height: 18px; accent-color: var(--green); }

.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; background: #eee; color: var(--text); text-decoration: none; font-size: 14px;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { filter: brightness(.95); }
.btn-outline { background: #fff; border-color: #c8d6c8; }
.btn-outline:hover { background: var(--menu); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f2b8b5; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* حالة العمليات */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st-sent { background: var(--ok-bg); color: var(--ok); }
.st-warning { background: var(--warn-bg); color: var(--warn); }
.st-rejected { background: var(--bad-bg); color: var(--bad); }
.st-failed { background: var(--bad-bg); color: var(--bad); }
.st-pending { background: var(--info-bg); color: var(--info); }
.st-waiting { background: var(--wait-bg); color: var(--wait); }
.st-manual { background: #eceff1; color: #455a64; }
.st-resolved { background: #eef6ee; color: #5b7f5f; }

/* بطاقات الجهات في الرئيسية */
.auth-card { border-top: 5px solid var(--green); }
.auth-card.ntmp { border-top-color: #0b7a75; }
.auth-card.zatca { border-top-color: #1b5e20; }
.auth-card.shomoos { border-top-color: var(--orange); }
.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.auth-head svg { width: 42px; height: 42px; flex: none; }
.auth-head h3 { margin: 0; }
.auth-head .who { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.stat { border-radius: 8px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat span { font-size: 11.5px; }
.progress { height: 10px; background: #e8ece8; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--green), #7ccf6b); border-radius: 99px; transition: width .3s; }

/* قائمة المطلوب */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e2e8e2; align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.checklist .done .mark { background: var(--ok); color: #fff; }
.checklist .todo .mark { background: #fff; border: 2px solid #c8d6c8; color: var(--muted); }
.checklist .t { font-weight: 700; }
.checklist .h { font-size: 12.5px; color: var(--muted); }
.checklist .done .t { color: var(--ok); }

/* الجداول */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { background: var(--menu); color: var(--menu-text); text-align: right; padding: 9px 10px; font-weight: 800; white-space: nowrap; position: sticky; top: 0; }
table.tbl td { padding: 8px 10px; border-top: 1px solid #edf2ed; vertical-align: top; }
table.tbl tr:hover td { background: #f8fbf8; }
table.tbl td.reason { max-width: 420px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* التنبيهات */
.alert { border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.alert-ok { background: var(--ok-bg); color: #0f5e2b; }
.alert-bad { background: var(--bad-bg); color: #8e1c1c; }
.alert-warn { background: var(--warn-bg); color: #7a4a00; }
.alert-info { background: var(--info-bg); color: #0d3c78; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#toast .t { background: #263238; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: 90vw; font-size: 14px; }
#toast .t.ok { background: var(--green-dark); }
#toast .t.bad { background: #b71c1c; }

/* نافذة التفاصيل */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; max-width: 900px; width: 100%; max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h3 { margin-top: 0; }
pre.json { background: #1e2a1e; color: #d7f5d7; padding: 12px; border-radius: 8px; overflow: auto; max-height: 300px; font-size: 12.5px; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-word; }

/* الدليل */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--menu-dark); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; font-weight: 800; cursor: pointer; border-radius: 8px 8px 0 0; color: var(--muted); }
.tabs button svg { width: 18px; height: 18px; vertical-align: middle; }
.tabs button.active { background: var(--menu); color: var(--menu-text); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 4px 46px 14px 0; border-right: 2px solid var(--menu-dark); margin-right: 16px; }
.steps > li::before {
  content: counter(s); position: absolute; right: -17px; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.steps > li:last-child { border-right-color: transparent; }
.steps h4 { margin: 4px 0 4px; }
.steps p { margin: 0 0 4px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 700; }
.callout { border-right: 4px solid var(--orange); background: #fff8ef; padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
code.k { background: #eef4ee; padding: 1px 6px; border-radius: 4px; direction: ltr; display: inline-block; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tiles, .banner { display: none; }
  main#view { padding: 14px 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .kv { grid-template-columns: 1fr; }
}
@media print {
  .menubar, .toolbar, .tiles, .banner, .no-print { display: none !important; }
  main#view { padding: 0; }
  .card { box-shadow: none; }
}

/* ===== شاشة المتابعة ===== */
/* العنوان والشرح في سطر واحد */
.mon-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.mon-title h2.page { margin: 0; font-size: 20px; }
.mon-title h2.page svg { width: 26px; height: 26px; align-self: center; }
/* كارت واحد مضغوط: سطر فلاتر + سطر ملخص */
.mon-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-bottom: 10px; }
.mon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mf { position: relative; min-width: 0; }
.mf input, .mf select {
  height: 36px; width: 100%; padding: 0 10px; font-size: 13.5px; color: var(--text);
  border: 1px solid #cfdccf; border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.mf input:hover, .mf select:hover { border-color: #b4c9b4; }
.mf input:focus, .mf select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,163,74,.14); }
.mf-q { flex: 1 1 170px; }
.mf-auth { flex: 0 0 108px; }
.mf-st { flex: 0 0 168px; }
.mf-date { flex: 0 0 146px; }
.mf-scope { flex: 0 0 128px; }
.mf-search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.mf-search input { padding-inline-start: 34px; background: #fbfdfb; }
.mf-pre { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--muted); pointer-events: none; }
.mf-date input { padding-inline-start: 32px; padding-inline-end: 6px; }
.mf-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.mf-actions .btn { height: 36px; white-space: nowrap; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
/* سطر الملخص جوه نفس الكارت */
.mon-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; border-top: 1px solid #edf3ed; }
.mon-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 600; transition: box-shadow .15s, border-color .15s;
}
.chip:hover { border-color: #b4c9b4; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip b { font-weight: 800; color: var(--text); }
.chip.on { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,138,0,.16); }
.chip.st-sent, .chip.st-warning, .chip.st-rejected, .chip.st-failed, .chip.st-pending, .chip.st-waiting, .chip.st-manual, .chip.st-resolved { background: #fff; }
.mon-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); }
.mon-meta b { color: var(--text); }
.mon-meta .switch { font-weight: 600; color: var(--text); gap: 6px; }
.mon-meta .switch input { width: 16px; height: 16px; }
/* الجدول: مقاسات ثابتة للأعمدة والسبب ياخد الباقي */
table.mon-tbl { table-layout: fixed; min-width: 980px; }
table.mon-tbl th { padding: 9px 8px; }
table.mon-tbl td { padding: 8px; }
table.mon-tbl td.dt { line-height: 1.35; }
table.mon-tbl td.dt span { display: block; color: var(--muted); font-size: 11.5px; }
table.mon-tbl td .badge { white-space: normal; text-align: center; line-height: 1.4; padding: 3px 10px; }
table.mon-tbl td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.mon-tbl td.reason { white-space: normal; line-height: 1.7; }
table.mon-tbl td.mono { direction: ltr; text-align: right; }
table.mon-tbl tr.col-flt th { background: #f2f8f3; padding: 6px; border-bottom: 1px solid var(--border); top: 40px; }
table.mon-tbl tr.col-flt select, table.mon-tbl tr.col-flt input {
  width: 100%; height: 30px; padding: 0 7px; font-size: 12.5px; font-weight: 500; color: var(--text);
  border: 1px solid #d3e0d3; border-radius: 6px; background: #fff;
}
table.mon-tbl tr.col-flt select:focus, table.mon-tbl tr.col-flt input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px rgba(26,163,74,.14); }
table.mon-tbl tr.col-flt .on { border-color: var(--orange); background: #fff7ec; font-weight: 700; }
@media (max-width: 900px) {
  .mf-q { flex-basis: 100%; }
  .mf-auth, .mf-st, .mf-date, .mf-scope { flex: 1 1 140px; }
}

/* شريط "فيه نسخة جديدة" */
.upd-bar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--orange); border-radius: 999px; padding: 8px 10px 8px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.15); font-weight: 700; font-size: 14px; }


/* ===== شاشة تأسيس الضريبة: كل حاجة في شاشة واحدة ===== */
.zs-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.zs-title h2.page { margin: 0; font-size: 20px; }
.zs-title h2.page svg { width: 26px; height: 26px; align-self: center; }
.zs { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); gap: 14px; align-items: start; }
.zs .card { margin-bottom: 0; padding: 12px 16px; }
.zs-sec { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--menu-dark, #1f6b35); margin: 12px 0 6px; padding-top: 10px; border-top: 1px solid #edf3ed; }
.zs-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; font-size: 15.5px; color: var(--text); }
.zs-sec svg { width: 18px; height: 18px; }
.zs-sec .num { background: var(--green); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.zs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.zs-sub { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.zs-form .field { gap: 3px; }
.zs-form .field label { font-size: 12.5px; color: #44524a; }
.zs-form .field input, .zs-form .field select { height: 36px; padding: 0 10px; font-size: 13.5px; border-radius: 8px; border: 1px solid #cfdccf; background: #fff; }
.zs-form .field input:focus, .zs-form .field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,163,74,.14); }
.zs-form .field input::placeholder { color: #a7b3aa; font-size: 12.5px; }
.zs-sw { display: flex; align-items: flex-end; padding-bottom: 8px; }
.zs-sw .switch { white-space: nowrap; font-size: 13px; }
.zs-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf3ed; }
.zs-foot .btn { height: 36px; }
.zs-hint { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.zs-note { margin-top: 10px; padding: 7px 10px; border-radius: 8px; background: #fff8ee; border: 1px solid #f6dfbd; font-size: 12.5px; color: #6b5a3e; }
/* عمود الخطوات */
.zs-steps-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.zs-steps-h h3 { margin: 0; font-size: 15.5px; }
.zs-steps-h b { font-size: 13px; }
.zs-steps .progress { height: 8px; margin-bottom: 6px; }
.zst { list-style: none; margin: 0; padding: 0; }
.zst li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 5px 0; }
.zst li + li { border-top: 1px dashed #e2e8e2; }
.zst .mk { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; background: #fff; border: 2px solid #c8d6c8; color: var(--muted); }
.zst .done .mk { background: var(--ok); border-color: var(--ok); color: #fff; }
.zst .now .mk { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 0 4px rgba(255,138,0,.15); }
.zst .bd { flex: 1; min-width: 0; }
.zst .t { font-weight: 800; font-size: 13.5px; }
.zst .done .t { color: var(--ok); }
.zst .later { opacity: .6; }
.zst .h { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.5; }
.zst .h details summary { cursor: pointer; }
.zst .h ul { margin: 4px 0 0; padding-inline-start: 16px; }
.zst .ac { display: flex; align-items: center; gap: 6px; }
.zst .ac.wide { grid-column: 2 / -1; margin-top: 6px; }
.zst .ac .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.zst .ac .btn svg { width: 15px; height: 15px; }
.zs-otp { width: 92px; height: 30px; padding: 0 8px; text-align: center; letter-spacing: 2px; border: 1px solid #cfdccf; border-radius: 8px; font-size: 14px; }
.zs-otp:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,138,0,.16); }
.zs-last { margin-top: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#zRes .alert { margin: 6px 0 0; padding: 8px 10px; font-size: 13px; }
@media (max-width: 1100px) { .zs { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .zs-grid { grid-template-columns: 1fr 1fr; } }
/* مفاتيح السياحة: سطر للتجريبي وسطر للفعلي */
.zs-keys { display: grid; grid-template-columns: 58px repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: end; }
.zs-tag { align-self: end; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 12.5px; font-weight: 800; }
.zs-tag.test { background: #eef6ff; color: #2563a8; border: 1px solid #cfe0f5; }
.zs-tag.prod { background: #eaf7ee; color: #1a7f3c; border: 1px solid #bfe3ca; }
.zs-form .pw { position: relative; }
.zs-form .pw input { width: 100%; }
.zs-adv { font-size: 12.5px; }
.zs-adv summary { cursor: pointer; color: var(--muted); }
.zs-adv[open] { flex-basis: 100%; order: 9; }
.zs-adv-b { margin-top: 6px; }
.zs-lk { margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf3ed; font-size: 13px; }
.zs-lk summary { cursor: pointer; font-weight: 700; }
.zs-lk .ac { display: flex; gap: 6px; margin-top: 6px; }
.zs-lk input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid #cfdccf; border-radius: 8px; }
#nRes .alert, #lkRes .alert { margin: 6px 0 0; padding: 8px 10px; font-size: 13px; }
.zst .h { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zst .h:has(details) { display: block; overflow: visible; }
/* مشترك لشاشات التأسيس والربط */
.zs-span2 { grid-column: span 2; }
.zs-span4 { grid-column: 1 / -1; }
.zs-sec-btn { margin-inline-start: auto; font-weight: 600; }
.zs-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; margin-top: 10px; }
.zs-checks .switch { font-size: 13px; font-weight: 600; }
.zs-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #f5f8f5; border: 1px solid var(--border); font-size: 12.5px; margin-bottom: 8px; }
.zs-stat.ok { background: #eef8f1; border-color: #bfe3ca; }
.zs-stat.bad { background: #fff2f2; border-color: #f2c4c4; }
.zs-stat span { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zs-how { margin: 6px 0 8px; padding-inline-start: 18px; font-size: 12.5px; line-height: 1.85; }
.zs-det { font-size: 12px; margin-top: 4px; } .zs-det summary { cursor: pointer; color: var(--muted); }
.zs-det ul { margin: 4px 0; padding-inline-start: 16px; max-height: 140px; overflow: auto; }
#hChecks .alert, #aChecks .alert, #hRes .alert, #aRes .alert { margin: 6px 0 0; padding: 8px 10px; font-size: 13px; }
.modal.modal-wide { width: min(1100px, 94vw); max-height: 86vh; display: flex; flex-direction: column; }
.modal.modal-wide .modal-body { overflow: auto; margin-top: 8px; }
@media (max-width: 900px) { .zs-checks { grid-template-columns: 1fr 1fr; } }

/* ===== التقارير ===== */
.rp-period { font-size: 12.5px; color: var(--muted); padding-top: 6px; border-top: 1px solid #edf3ed; }
.rp-period b { color: var(--text); }
.rp-fon { color: var(--orange); font-weight: 800; }
.mf select.on, .mf input.on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,138,0,.14); }
.rp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.rp-kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; border-top: 4px solid #b8c7bb; }
.rp-kpi span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.rp-kpi b { font-size: 26px; line-height: 1.15; }
.rp-kpi.ok { border-top-color: var(--ok); } .rp-kpi.ok b { color: var(--ok); }
.rp-kpi.bad { border-top-color: var(--bad); } .rp-kpi.bad b { color: var(--bad); }
.rp-kpi.mid { border-top-color: #e3a008; } .rp-kpi.mid b { color: #b7791f; }
.rp-kpi.rate.ok b { color: var(--ok); } .rp-kpi.rate.mid b { color: #b7791f; } .rp-kpi.rate.bad b { color: var(--bad); }
.rp-kpi small .rp-bar { width: 100%; margin-top: 4px; }
.rp-main { padding: 12px 14px; margin-bottom: 10px; }
.rp-h { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.rp-h h3 { margin: 0; font-size: 16px; }
table.rp-tbl { table-layout: fixed; }
table.rp-tbl th, table.rp-tbl td { text-align: center; padding: 8px 10px; }
table.rp-tbl th:first-child, table.rp-tbl td:first-child { text-align: start; }
table.rp-tbl td:last-child { display: flex; align-items: center; gap: 10px; }
.rp-grp td { background: #f3f8f4; font-weight: 800; border-top: 2px solid #d5e6d9; }
.rp-auth { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; }
.rp-auth svg { width: 22px; height: 22px; }
.rp-op { padding-inline-start: 40px !important; color: #3d4a42; }
.c-ok { color: var(--ok); font-weight: 800; } .c-bad { color: var(--bad); font-weight: 800; } .c-mid { color: #b7791f; font-weight: 700; }
.rp-bar { flex: 1; height: 9px; background: #e8ece8; border-radius: 99px; overflow: hidden; min-width: 60px; }
.rp-bar > div { height: 100%; border-radius: 99px; }
.rp-bar.ok > div { background: linear-gradient(90deg, #1a9d4a, #6fcf7f); }
.rp-bar.mid > div { background: linear-gradient(90deg, #e08a00, #f6c35b); }
.rp-bar.bad > div { background: linear-gradient(90deg, #d33, #f08a8a); }
.rp-pct { min-width: 44px; text-align: end; font-size: 13px; }
.rp-pct.ok { color: var(--ok); } .rp-pct.mid { color: #b7791f; } .rp-pct.bad { color: var(--bad); }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rp-card { margin-bottom: 0; padding: 12px 14px; }
.rp-card h3 { font-size: 14.5px; margin-bottom: 8px; }
.rp-card h3 svg { width: 22px; height: 22px; }
.rp-n { margin-inline-start: auto; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; }
.rp-n.ok { background: var(--ok); } .rp-n.bad { background: var(--bad); }
.rp-scroll { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
table.rp-mini { margin: 0; }
table.rp-mini th { position: sticky; top: 0; z-index: 1; padding: 7px 8px; }
table.rp-mini td { padding: 6px 8px; }
table.rp-mini tr[onclick] { cursor: pointer; }
.rp-days { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.rp-days span { padding: 3px 10px; border-radius: 99px; background: #fdecec; color: #b42323; font-size: 12px; font-weight: 700; }
.rp-empty { padding: 14px; text-align: center; color: var(--ok); background: #f3faf5; border-radius: 8px; font-weight: 700; font-size: 13px; }
@media (max-width: 1000px) { .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rp-grid { grid-template-columns: 1fr; } }
@media print { .rp-scroll { max-height: none; } .rp-kpi, .card { box-shadow: none; } }

/* ===== الإعدادات ===== */
.st-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.st-card { margin-bottom: 0; padding: 12px 16px; }
.st-card h3 { font-size: 15px; margin-bottom: 10px; }
.st-pw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.st-pw .field label { font-size: 12.5px; }
.st-pw .field input { height: 36px; }
.st-pw .btn { height: 38px; }
.st-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.st-kv div { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; background: #f7faf7; border-radius: 8px; border: 1px solid #e6eee7; }
.st-kv span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.st-kv b { font-size: 13px; font-weight: 600; }
.st-log { padding: 12px 14px; }
.st-log-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.st-log-h h3 { margin: 0; font-size: 15px; }
.st-log-h .mon-row { flex: 1; justify-content: flex-end; }
.st-log-h .mf-q { flex: 0 1 280px; }
.st-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.st-scroll { max-height: calc(100vh - 470px); min-height: 220px; overflow: auto; }
table.st-tbl { table-layout: fixed; }
table.st-tbl th { position: sticky; top: 0; z-index: 1; }
table.st-tbl td { padding: 7px 10px; vertical-align: middle; }
table.st-tbl td.dt span { display: block; color: var(--muted); font-size: 11.5px; }
.st-det { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.st-user { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #eaf6ee; color: #1a7f3c; font-weight: 700; font-size: 12.5px; }
@media (max-width: 1000px) { .st-top { grid-template-columns: 1fr; } }
.zs-form .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zst li:not(.now) .h:not(:has(details)) { -webkit-line-clamp: 1; }
.zst .t { line-height: 1.4; }

/* ===== ربط الفنادق: اختيار القاعدة من مجموعة المهاب ===== */
.hl-srv { margin: 2px 0 8px; font-size: 13px; }
.hl-srv summary { cursor: pointer; color: var(--muted); list-style: none; }
.hl-srv summary::-webkit-details-marker { display: none; }
.hl-srv summary b { color: var(--text); }
.hl-srv[open] summary { margin-bottom: 8px; }
.hl-dbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 10px; }
.hl-dbs > .alert, .hl-dbs > .field, .hl-dbs > .muted { grid-column: 1 / -1; margin: 0; }
.hl-db { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; text-align: start; font: inherit; transition: .15s; position: relative; }
.hl-db:hover { border-color: #9fd0ad; background: #f6fbf7; }
.hl-db svg { width: 26px; height: 26px; flex: none; color: var(--muted); }
.hl-db span { display: flex; flex-direction: column; min-width: 0; }
.hl-db b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-db small { font-size: 11.5px; color: var(--muted); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-db.on { border-color: var(--ok); background: #eef8f1; box-shadow: 0 0 0 3px rgba(26,157,74,.12); }
.hl-db.on svg { color: var(--ok); }
.hl-db i { margin-inline-start: auto; font-style: normal; color: #fff; background: var(--ok); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; }
.hl-pick select.on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,138,0,.14); }
.zs-det:not([open]) > :not(summary) { display: none; }
.hl-srv { margin: 0 0 6px; }
.hl-dbs { margin-bottom: 6px; }
.hl-db { padding: 6px 12px; }
#aDbs { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-height: 108px; overflow: auto; padding: 2px; }
#aDbs .hl-db { padding: 5px 10px; }
#aDbs .hl-db svg { width: 22px; height: 22px; }
.hl-db b, .hl-db small { line-height: 1.3; }
#aDbs { max-height: 86px; }

/* ===== شاشة البداية: اختيار القاعدة ← الشركة ← الفرع ===== */
.sp { max-width: 1180px; margin: 0 auto; }
.sp-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 14px; margin-bottom: 12px; color: #fff;
  background: linear-gradient(90deg, var(--green), #2bb673 60%, var(--orange)); box-shadow: var(--shadow); }
.sp-head svg { width: 42px; height: 42px; flex: none; background: rgba(255,255,255,.18); border-radius: 10px; padding: 6px; }
.sp-head h2 { margin: 0; font-size: 20px; }
.sp-head span { font-size: 12.5px; opacity: .9; direction: ltr; display: block; text-align: right; }
.sp-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 12px; align-items: start; }
.sp-list, .sp-pick { margin: 0; padding: 12px 14px; }
.sp-lh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sp-lh b { font-size: 15px; }
.sp-q { margin-inline-start: auto; width: 200px; }
.sp-dbs { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 330px); min-height: 200px; overflow: auto; padding: 2px; }
.sp-db { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; text-align: start; font: inherit; transition: .12s; }
.sp-db:hover { border-color: #9fd0ad; background: #f6fbf7; }
.sp-db.on { border-color: var(--ok); background: #eef8f1; box-shadow: 0 0 0 3px rgba(26,157,74,.12); }
.sp-db svg { width: 24px; height: 24px; flex: none; color: var(--muted); }
.sp-db.on svg { color: var(--ok); }
.sp-db .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-db b { font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-db small { font-size: 11.5px; line-height: 1.3; color: var(--muted); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tag { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; flex: none; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.sp-tag.h { background: #fff3e0; color: #b45f00; }
.sp-tag.ok { background: #e6f6ec; color: #1a7f3c; }
.sp-srv { margin: 8px 0 0; }
.sp-srv .zs-grid { margin-bottom: 8px; }
.sp-pick { display: flex; flex-direction: column; gap: 10px; }
.sp-sel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #f3f8f4; border: 1px dashed #b9d8c2; }
.sp-sel svg { width: 34px; height: 34px; color: var(--ok); flex: none; }
.sp-sel div { display: flex; flex-direction: column; min-width: 0; }
.sp-sel b { font-size: 15px; }
.sp-sel small { color: var(--muted); font-size: 12px; direction: ltr; text-align: right; }
.sp-pick .field { margin: 0; }
.sp-pick select { height: 40px; }
.sp-link { padding: 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.sp-link.ok { background: #e6f6ec; color: #1a6b35; }
.sp-link.new { background: #fff6e8; color: #8a5300; }
.sp-go { height: 46px; font-size: 16px; justify-content: center; }
.sp-skip { text-align: center; font-size: 12.5px; color: var(--muted); }
.tb-start { font-weight: 700; color: var(--green); }
@media (max-width: 900px) { .sp-body { grid-template-columns: 1fr; } }

/* ===== تاريخ يوم/شهر/سنة + زرار التقويم ===== */
.mf-date { flex: 0 0 158px; }
.mf-date input.dmy { padding-inline-start: 32px; padding-inline-end: 30px; direction: ltr; text-align: center; font-variant-numeric: tabular-nums; }
.mf-date input.dmy.bad { border-color: #d64545; box-shadow: 0 0 0 2px rgba(214,69,69,.14); }
.mf-date input.dmy-pick { position: absolute; inset-inline-end: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; pointer-events: none; }
.mf-date .dmy-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 14px; padding: 2px 4px; line-height: 1; border-radius: 6px; }
.mf-date .dmy-btn:hover { background: #eef6ee; }
/* ===== مسلسل + Excel + تحديث الرئيسية ===== */
td.ser { color: var(--muted); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.btn-xls { color: #1d6f42; border-color: #9fd3b3; font-weight: 700; }
.btn-xls:hover { background: #eaf7ef; }
.mon-more { color: var(--orange); font-size: 12px; font-weight: 700; }
.home-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: #f1f8f2; border: 1px solid #d6ead9; border-radius: 99px; padding: 4px 12px; }
.home-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: livePulse 2s infinite; }
.home-live b { font-weight: 600; color: #3d5a43; }
.home-live b:not(:empty)::before { content: "— "; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(26,163,74,.5); } 70% { box-shadow: 0 0 0 7px rgba(26,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(26,163,74,0); } }
@media print { .dmy-btn, .home-live, .btn-xls { display: none !important; } }
table.mon-tbl td.dd { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* عمود السبب ياخد مساحة تتقري — ولو الشاشة ضيقة الجدول يتحرك يمين وشمال */
table.mon-tbl { min-width: 1120px; }
/* ===== الطباعة ===== */
.btn-print svg { width: 16px; height: 16px; }
.print-only { display: none; }
.print-head h3 { margin: 0 0 2px; font-size: 16px; }
.print-head span { font-size: 12px; color: #333; }
@media print {
  @page { size: A4 landscape; margin: 9mm; }
  html, body { height: auto; background: #fff !important; }
  .print-only { display: block !important; margin-bottom: 8px; }
  .layout { display: block; min-height: 0; }
  .mon-title { display: none; }
  .table-wrap { overflow: visible !important; border: 0; border-radius: 0; }
  table.mon-tbl { min-width: 0 !important; width: 100%; font-size: 10.5px; table-layout: auto; }
  table.mon-tbl col { width: auto !important; }
  table.mon-tbl th, table.mon-tbl td { padding: 3px 5px; border: 1px solid #bbb; position: static !important; }
  table.mon-tbl td { white-space: normal; overflow: visible; }
  table.mon-tbl td.dt span { display: inline-block; margin: 0 6px; }
  table.mon-tbl thead { display: table-header-group; }
  table.mon-tbl tr { break-inside: avoid; }
  table.mon-tbl td .badge { padding: 0; background: none !important; border: 0; color: #000 !important; }
  .rp-kpis, .rp-main, .rp-card { break-inside: avoid; }
  .btn-print, .mon-more { display: none !important; }
}

/* ===== الأيقونات الجانبية: كلها تبان في الشاشة من غير سكرول — بتصغر لوحدها على قد ارتفاع الشاشة ===== */
.tiles {
  position: sticky; top: 0; align-self: flex-start; box-sizing: border-box;
  height: calc(100vh - var(--head-h, 90px)); min-height: 300px;
  padding: clamp(5px, 1.2vh, 12px) 10px; gap: clamp(3px, 1vh, 10px); overflow: hidden;
}
.tile { flex: 1 1 0; min-height: 0; gap: clamp(1px, .5vh, 6px); font-size: clamp(11px, 1.75vh, 13px); line-height: 1.25; white-space: nowrap; }
.tile .ic { flex: 1 1 0; height: auto; min-height: 22px; max-height: 74px; }
.tile .ic svg { width: auto; height: min(40px, 72%); aspect-ratio: 1; }
/* ===== (المنتظر الرفع) في سطر المتابعة ===== */
.mon-meta { flex-wrap: wrap; row-gap: 4px; }
.pend { font-size: 12.5px; font-weight: 700; border-radius: 99px; padding: 2px 10px; white-space: normal; }
.pend.ok { color: #1d6f42; background: #eaf7ef; }
.pend.wait { color: #9a5b00; background: #fff4e0; }
.pend.bad { color: #b42323; background: #fdecec; }
.pend.off { color: var(--muted); background: #f1f1f1; }
/* سطر (المنتظر الرفع) تحت أرقام كل كارت في الرئيسية */
.pend-line { margin: 10px 0 4px; min-height: 24px; line-height: 1.9; }
.pend-line .pend { border-radius: 8px; padding: 3px 9px; display: inline-block; font-size: 12px; line-height: 1.6; }
/* ===== الساعة بالثواني في نفس سطر عنوان الشاشة (المتابعة / التقارير) ===== */
.mon-title .act-clock { margin-inline-start: auto; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: #3d5a43; font-variant-numeric: tabular-nums; }
/* ===== شاشة الدخول: زر (إعدادات) ===== */
.login-setup { margin-top: 14px; width: 100%; background: #fff; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 10px; color: #5a6b5e; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.login-setup:hover { border-color: #ffb347; color: #b45f00; background: #fffaf2; }
.login-card.setup { box-shadow: 0 0 0 3px #ffb347, 0 20px 50px rgba(0,0,0,.18); }
.login-card.setup .sub { color: #b45f00; font-weight: 700; }

/* ===== شاشة البداية: كروت الشركات المسموحة للمستخدم ===== */
.sp-dbs.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; align-content: start; }
.sp-db.co-card { padding: 12px 14px; gap: 12px; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); user-select: none; }
.sp-db.co-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.09); }
.co-ic { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(160deg, #ff8a00, #1aa34a); display: grid; place-items: center; flex: none; }
.sp-db.co-card .co-ic svg, .sp-db.co-card.on .co-ic svg { width: 28px; height: 28px; color: #fff; }
.sp-db.co-card .t b { font-size: 15px; white-space: normal; }
.co-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.sp-tag.a { background: #e8f0fe; color: #1a56b0; }
.sp-tag.n { background: #f1f1f1; color: var(--muted); }
.co-no { display: flex; flex-direction: column; align-items: center; background: #f3f8f4; border: 1px solid #cfe5d5; border-radius: 10px; padding: 4px 10px; flex: none; min-width: 64px; }
.sp-db .co-no small { font-size: 10.5px; color: var(--muted); direction: rtl; text-align: center; }
.sp-db .co-no b { font-size: 19px; color: #1a6b35; font-variant-numeric: tabular-nums; }

/* ===== إعدادات العملاء ===== */
.pt-conn { padding: 10px 14px; }
.pt-conn summary { cursor: pointer; list-style: none; font-size: 13.5px; }
.pt-conn summary::-webkit-details-marker { display: none; }
.pt-conn[open] summary { margin-bottom: 10px; }
.pt-conn .zs-grid { margin-bottom: 10px; }
.pt-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pt-h h3 { margin: 0; }
.pt-h.pt-sub { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.pt-acts { display: flex; gap: 6px; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.pt-acts.start { margin: 10px 0; }
.pt-acts svg { width: 15px; height: 15px; }
table.pt-tbl { table-layout: fixed; min-width: 980px; }
table.pt-tbl.pt-pm { min-width: 0; }
table.pt-tbl td { padding: 4px 5px; vertical-align: middle; }
table.pt-tbl td input:not([type=checkbox]), table.pt-tbl td select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 13px; background: #fff; }
table.pt-tbl td input.ltr, table.pt-tbl td select.ltr { direction: ltr; text-align: left; }
table.pt-tbl td input:focus, table.pt-tbl td select:focus { outline: 2px solid var(--menu-dark); border-color: var(--green); }
table.pt-tbl td.ck { text-align: center; }
table.pt-tbl td.ck input { width: 18px; height: 18px; accent-color: var(--green); }
table.pt-tbl td.con { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.pt-tbl td.con .bad { color: var(--bad); }
table.pt-tbl td.acts { white-space: nowrap; text-align: center; }
table.pt-tbl tr.dirty td.ser { background: #fff1dc; color: #9a5b00; font-weight: 800; }
.pt-foot { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pt-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
table.pt-list tr[data-n], table.pt-list tr[data-id] { cursor: pointer; }
table.pt-list tr.on td { background: #e3f4e9 !important; }
.pt-short { max-height: 190px; overflow: auto; }
.pm-vis { border: 0; border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; width: 100%; }
.pm-vis.on { background: #e6f6ec; color: #1a7f3c; }
.pm-vis.off { background: #fdecec; color: #b42323; }

/* مستخدم الإيميل: من غير إدارة الفروع وسجل النشاط واختيار (كل الفروع) */
body[data-kind="portal"] .tb-branches, body[data-kind="portal"] .st-log, body[data-kind="portal"] .mf-scope { display: none !important; }
.pt-local { margin-inline-start: auto; font-size: 13px; font-weight: 600; color: #5a6b5e; }
.home-ten { margin-inline-start: auto; }
.home-ten .pend { display: inline-flex; align-items: center; gap: 8px; }
.home-ten .btn { padding: 1px 9px; font-size: 12px; }
.home-ten .mono { display: inline-block; unicode-bidi: isolate; }
