/* ==========================================================================
   MADIX Cloud — نظام التصميم: لوحة تحكم بطابع المنصّات الكبرى، عربية RTL،
   وضع ليلي كامل، وتعمل من الجوّال حتى الشاشة العريضة بلا تمرير أفقي.
   ========================================================================== */

:root {
  --bg: #f5f6fb; --surface: #ffffff; --surface-2: #f3f4f9; --surface-3: #eceef6;
  --ink: #0f1430; --ink-2: #4a5275; --muted: #6b7394; --line: #e4e6f0; --line-2: #d6d9e7;
  --brand: #7b2ff7; --brand-2: #5b16d0; --pink: #f107a3; --brand-soft: #f1e9ff; --brand-ink: #ffffff;
  --grad: linear-gradient(120deg, #7b2ff7 0%, #a21cf0 55%, #f107a3 100%);
  --ok: #0c9e6b; --ok-soft: #e3f7ef; --warn: #b86e00; --warn-soft: #fff3dc; --danger: #d92d43; --danger-soft: #fde8eb;
  --info: #2160e0; --info-soft: #e6eefd;
  --shadow-1: 0 1px 2px rgba(17, 20, 48, .05), 0 1px 1px rgba(17, 20, 48, .03);
  --shadow-2: 0 10px 30px -12px rgba(41, 20, 110, .22), 0 2px 6px -2px rgba(17, 20, 48, .06);
  --radius: 14px; --radius-lg: 20px; --side: 268px;
  --series-1: #7b2ff7; --series-2: #f107a3; --series-3: #12a5b8; --series-4: #f59e0b; --series-5: #22c55e; --series-6: #3b82f6; --series-7: #ef4444; --series-8: #8b5cf6;
  --chart-grid: #eceef6; --chart-axis: #d6d9e7; --chart-muted: #8a91b0; --chart-ink: #0f1430; --chart-ink-2: #4a5275; --chart-surface: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c18; --surface: #12152a; --surface-2: #171b34; --surface-3: #1e2341;
    --ink: #eef0fc; --ink-2: #b6bbdb; --muted: #8b91b4; --line: #252a48; --line-2: #31375a;
    --brand-soft: #251a47; --ok-soft: #0e2b22; --warn-soft: #33260b; --danger-soft: #3a1520; --info-soft: #14244a;
    --ok: #31d496; --warn: #ffb547; --danger: #ff6b7f; --info: #6aa1ff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, .8);
    --chart-grid: #222744; --chart-axis: #31375a; --chart-muted: #7e85aa; --chart-ink: #eef0fc; --chart-ink-2: #b6bbdb; --chart-surface: #12152a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c18; --surface: #12152a; --surface-2: #171b34; --surface-3: #1e2341;
  --ink: #eef0fc; --ink-2: #b6bbdb; --muted: #8b91b4; --line: #252a48; --line-2: #31375a;
  --brand-soft: #251a47; --ok-soft: #0e2b22; --warn-soft: #33260b; --danger-soft: #3a1520; --info-soft: #14244a;
  --ok: #31d496; --warn: #ffb547; --danger: #ff6b7f; --info: #6aa1ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, .8);
  --chart-grid: #222744; --chart-axis: #31375a; --chart-muted: #7e85aa; --chart-ink: #eef0fc; --chart-ink-2: #b6bbdb; --chart-surface: #12152a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font: 400 15px/1.65 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  color: var(--ink); background: var(--bg); min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
.ic { flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.mono, code, kbd { font-family: ui-monospace, Consolas, 'Cascadia Mono', monospace; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hidden, [hidden] { display: none !important; }
:root[data-theme="dark"] .when-dark, :root:not([data-theme="dark"]) .when-light { display: inline; }
:root[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .when-light { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .when-dark { display: inline; }
}

/* ————— الهيكل ————— */
.shell { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); z-index: 40;
  background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none !important; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 16px; letter-spacing: .04em; }
.brand small { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .06em; }
.side-close { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; }
.nav-group { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin: 1px 0; border-radius: 11px;
  color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-item.on .ic { color: var(--brand); }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { font-style: normal; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 8px; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; padding: 4px 6px; border-radius: 10px; }
.me:hover { background: var(--surface-2); }
.me span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.main { flex: 1; min-width: 0; margin-inline-start: var(--side); display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line);
}
.burger { display: none; }
.search { flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 9px 0; }
.search kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.content { padding: 24px 26px 40px; max-width: 1480px; width: 100%; }
.foot { margin-top: 36px; color: var(--muted); font-size: 12.5px; text-align: center; }
.scrim { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1080px) {
  /* مخفيّة تمامًا وهي مغلقة (لا تُحسب في عرض الصفحة فلا تمرير أفقي)، وتنزلق عند فتحها */
  .side { display: none; box-shadow: var(--shadow-2); }
  body.nav-open .side { display: flex; animation: side-in .22s ease; }
  .side-close { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 10, 25, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-inline-start: 0; }
  .burger { display: inline-grid; }
  .top { padding: 10px 14px; }
  .content { padding: 18px 14px 32px; }
  .search kbd { display: none; }
}
@media (max-width: 640px) {
  .only-wide { display: none !important; }
  .page-head h1 { font-size: 21px; }
}

/* ————— الأزرار والحقول ————— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 15px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: border-color .15s, background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 20px -10px rgba(123, 47, 247, .7); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-dark { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.btn-ok:hover { background: var(--ok-soft); border-color: var(--ok); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 13px; }
.btn-wa { background: #1faa59; border-color: #1faa59; color: #fff; }
.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field-label i { color: var(--danger); font-style: normal; }
.field-hint { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 11px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: left 16px center, left 11px center; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 12px; padding-inline-start: 30px; }
input[type="file"].input { padding: 7px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--brand); flex: 0 0 auto; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.feats { display: flex; flex-wrap: wrap; gap: 8px; }
.feat { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--muted); text-decoration: line-through; }
.feat input { accent-color: var(--brand); }
.feat.on { color: var(--ink); text-decoration: none; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-soft); }
.feats-tools { display: flex; gap: 8px; margin-top: 10px; }

/* ————— البطاقات والأرقام ————— */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--brand); }
.card-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px 20px 20px; }
.card-body.flush { padding: 10px 0 4px; }
.cards { display: grid; gap: 18px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-main > *, .cols-2 > * { margin: 0 !important; }
.stack > * + * { margin-top: 18px; }
@media (max-width: 1100px) { .cols-main, .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow-1); transition: transform .15s, box-shadow .15s, border-color .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-ok .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi-warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.kpi-danger .kpi-ic { background: var(--danger-soft); color: var(--danger); }
.kpi-info .kpi-ic { background: var(--info-soft); color: var(--info); }
.kpi-label { color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -.01em; line-height: 1.2; }
.kpi-hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi-spark { margin-top: 8px; }
.hero-card { background: var(--grad); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card::after { content: ''; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-card .card-body { position: relative; z-index: 1; }
.hero-card h2 { font-size: 22px; }
.hero-card p { opacity: .92; }
.hero-card .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }

/* ————— الجداول ————— */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .act { text-align: end; white-space: nowrap; }
.table td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main b { display: block; }
.card-body.flush .table th:first-child, .card-body.flush .table td:first-child { padding-inline-start: 20px; }
.card-body.flush .table th:last-child, .card-body.flush .table td:last-child { padding-inline-end: 20px; }
@media (max-width: 760px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.stack-sm td { border: 0; padding: 4px 16px !important; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; text-align: end; }
  .table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: start; flex: 0 0 auto; }
  .table.stack-sm td.act { justify-content: flex-end; }
  .table.stack-sm td.act::before { display: none; }
}

/* ————— شارات وحالات ————— */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.7; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); animation: pulse 2s infinite; }
.dot-off { background: var(--line-2); }
@keyframes side-in { from { transform: translateX(100%); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); } }
.plat { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.plat-windows .ic { color: #1e88e5; }
.plat-android .ic { color: #34a853; }
.plat-mac .ic, .plat-ios .ic { color: var(--ink); }
.copyable { display: inline-flex; align-items: center; gap: 4px; direction: ltr; max-width: 100%; }
.copyable > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-grid; }
.copy-btn:hover { color: var(--brand); background: var(--brand-soft); }
.copy-btn.done { color: var(--ok); }

/* ————— تنبيهات ————— */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid; font-size: 14.5px; }
.alert .ic { margin-top: 2px; }
.alert b { font-weight: 700; }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert-ok div { color: var(--ink); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-danger div { color: var(--ink); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert-warn div { color: var(--ink); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.alert-info div { color: var(--ink); }
.note { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; color: var(--ink-2); font-size: 13.5px; }

/* ————— فارغ، تبويبات، ترقيم، قوائم ————— */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty .ic { color: var(--line-2); margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; font-size: 13.5px; }
.pager a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.pager-info { color: var(--muted); }
.dl { margin: 0; display: grid; gap: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: 13.5px; flex: 0 0 auto; }
.dl dd { margin: 0; font-weight: 600; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .grow-input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none !important; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip em { font-style: normal; color: var(--muted); font-weight: 500; }
.chip.on em { color: inherit; opacity: .7; }

/* خطّ زمني للنشاط */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: 0 0 auto; }
.tl-warn .tl-ic { background: var(--warn-soft); color: var(--warn); }
.tl-critical .tl-ic { background: var(--danger-soft); color: var(--danger); }
.tl-body { flex: 1; min-width: 0; }
.tl-body b { font-weight: 600; }
.tl-body small { display: block; color: var(--muted); font-size: 12.5px; }

/* الرسوم */
.chart { display: block; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty { color: var(--muted); text-align: center; padding: 30px 0; }
.bars-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-track { height: 9px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--grad); }

/* كود التفعيل */
.code-box { direction: ltr; font: 500 12.5px/1.55 ui-monospace, Consolas, monospace; word-break: break-all; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; max-height: 180px; overflow: auto; user-select: all; }
.dev-big { direction: ltr; font: 700 20px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .1em; color: var(--brand); }
.result-card { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); box-shadow: 0 0 0 4px var(--ok-soft); }
.qr svg { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 12px; }

/* نافذة */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 25, .55); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toast-host { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-2); font-weight: 600; font-size: 14px; animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ————— صفحات الدخول ————— */
body.auth {
  display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1100px 560px at 90% -10%, rgba(123, 47, 247, .16), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(241, 7, 163, .12), transparent 60%), var(--bg);
}
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-2); padding: 32px 30px 26px; }
.auth-card .brand { margin-bottom: 22px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.otp { direction: ltr; text-align: center; font: 700 26px/1 ui-monospace, monospace; letter-spacing: .4em; }
.install-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.install-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.install-steps span.on { background: var(--grad); }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checklist .ok-mark { color: var(--ok); font-weight: 700; }
.checklist .bad-mark { color: var(--danger); font-weight: 700; }
.checklist .warn-mark { color: var(--warn); font-weight: 700; }

/* ————— الموقع العام ————— */
body.site { background: var(--bg); }
.site-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.site-top .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.site-nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.site-nav a { color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 10px; text-decoration: none !important; font-size: 14.5px; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.hero { position: relative; overflow: hidden; padding: 74px 0 56px; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto; height: 720px; background: radial-gradient(closest-side, rgba(123, 47, 247, .22), transparent), radial-gradient(closest-side at 70% 60%, rgba(241, 7, 163, .16), transparent); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.15; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--ink-2); margin: 18px 0 26px; max-width: 560px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 13.5px; }
.hero-badges span { display: inline-flex; align-items: center; gap: 6px; }
.hero-badges .ic { color: var(--ok); }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-2); padding: 14px; transform: rotate(-1.2deg); }
.mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mock-kpis div { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.mock-kpis b { display: block; font-size: 18px; }
.mock-kpis small { color: var(--muted); font-size: 11px; }
.mock-chart { height: 120px; border-radius: 12px; background: linear-gradient(180deg, var(--brand-soft), transparent); position: relative; overflow: hidden; }
.mock-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .mock { display: none; } .hero { padding: 48px 0 30px; } .site-nav .hide-sm { display: none; } }
.section { padding: 56px 0; }
.section h2 { font-size: clamp(24px, 3.4vw, 34px); text-align: center; margin-bottom: 10px; letter-spacing: -.01em; }
.section .lead-c { text-align: center; color: var(--ink-2); max-width: 640px; margin: 0 auto 34px; font-size: 16.5px; }
.platforms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .platforms { grid-template-columns: 1fr; } }
.plat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-1); transition: transform .15s, box-shadow .15s; scroll-margin-top: 90px; }
.plat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.plat-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); }
.plat-windows .plat-ic { color: #1e88e5; background: #e8f2fd; }
.plat-android .plat-ic { color: #34a853; background: #e7f6ec; }
.plat-mac .plat-ic, .plat-ios .plat-ic { color: var(--ink); }
:root[data-theme="dark"] .plat-windows .plat-ic, :root[data-theme="dark"] .plat-android .plat-ic { background: var(--surface-2); }
.plat-card h3 { font-size: 19px; }
.plat-card .ver { color: var(--muted); font-size: 13px; }
.plat-card ul { margin: 2px 0 6px; padding-inline-start: 18px; color: var(--ink-2); font-size: 13.5px; }
.plat-card .btn { margin-top: auto; }
.features-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.feature .fi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; }
.feature h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14px; margin: 0; }
.changelog { display: grid; gap: 14px; }
.cl-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.cl-item header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cl-item .notes { color: var(--ink-2); white-space: pre-line; font-size: 14px; }
.cta { background: var(--grad); color: #fff; border-radius: 26px; padding: 38px 30px; text-align: center; }
.cta h2 { color: #fff; }
.cta p { opacity: .92; margin-bottom: 20px; }
.cta .btn { background: #fff; color: var(--brand-2); border: 0; }
.site-foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 13.5px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps-list li::before { content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; }

/* معاينة نظام الزبون */
.snap-tabs { position: sticky; top: 66px; z-index: 5; background: var(--bg); }
.snap-search { margin-bottom: 12px; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mini-kpis div { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.mini-kpis b { display: block; font-size: 20px; }
.mini-kpis small { color: var(--muted); }

@media print { .side, .top, .page-actions, .foot { display: none !important; } .main { margin: 0; } }

/* الإعدادات عن بُعد */
.rs-form .rs-row { display: grid; grid-template-columns: minmax(160px, 1fr) 1.3fr; gap: 6px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rs-form .rs-row:last-of-type { border-bottom: 0; margin-bottom: 12px; }
.rs-form .rs-row .check { padding: 0; }
@media (max-width: 640px) { .rs-form .rs-row { grid-template-columns: 1fr; } }
.rollout-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.rollout-form .input { width: auto; min-width: 84px; padding: 4px 8px; font-size: .85rem; }

/* الدعم الفني: المحادثة */
.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); max-width: 92%; }
.msg header { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: .9rem; }
.msg-customer { justify-self: start; }
.msg-admin { justify-self: end; background: var(--brand-soft); border-color: transparent; }
.msg-body { line-height: 1.85; white-space: normal; overflow-wrap: anywhere; }
.msg-shot { display: block; margin-top: 10px; }
.msg-shot img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.msg-log { margin-top: 10px; }
.msg-log summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; display: flex; gap: 6px; align-items: center; }
.msg-log pre { max-height: 360px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 10px; font-size: .8rem; }
@media (max-width: 640px) { .msg { max-width: 100%; } }
.code-block { display: block; max-width: 100%; box-sizing: border-box; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: .82rem; line-height: 1.6; white-space: pre; }
.section-title { display: flex; gap: 8px; align-items: center; font-size: 1.15rem; margin: 26px 0 12px; }
