/* ════════════════════════════════════════════════════════════════════
   بوابة تجار API + دليل التكامل — نظام التصميم (الجولة 12)
   فاتح وداكن، عربي/كردي (RTL) وإنجليزي (LTR)، من شاشة الهاتف للحاسوب.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --brand: #00a6d6;
  --brand-strong: #0086b0;
  --brand-wash: #e3f6fc;
  --ink: #0f1d2b;
  --ink-2: #44546a;
  --ink-3: #7b8a9e;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e2e8ef;
  --nav: #0d1b2a;
  --nav-ink: #c9d6e3;
  --ok: #138a4a;
  --ok-wash: #e7f6ed;
  --bad: #c62828;
  --bad-wash: #fdecec;
  --warn: #b26a00;
  --warn-wash: #fff4e0;
  --info: #2457c5;
  --info-wash: #e9f0fd;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(15, 29, 43, 0.06), 0 4px 16px rgba(15, 29, 43, 0.05);
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --bottom-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #22c3ee;
    --brand-strong: #5fd6f5;
    --brand-wash: #0e3442;
    --ink: #e6edf5;
    --ink-2: #a9b8c9;
    --ink-3: #7d8ea3;
    --bg: #0b141d;
    --surface: #121e2a;
    --surface-2: #172533;
    --line: #23344a;
    --nav: #08111a;
    --nav-ink: #a9b8c9;
    --ok: #3ccf7f;
    --ok-wash: #0f2e1f;
    --bad: #ff6b6b;
    --bad-wash: #3a1517;
    --warn: #ffb347;
    --warn-wash: #3a2a10;
    --info: #7ea6ff;
    --info-wash: #16233f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #22c3ee;
  --brand-strong: #5fd6f5;
  --brand-wash: #0e3442;
  --ink: #e6edf5;
  --ink-2: #a9b8c9;
  --ink-3: #7d8ea3;
  --bg: #0b141d;
  --surface: #121e2a;
  --surface-2: #172533;
  --line: #23344a;
  --nav: #08111a;
  --nav-ink: #a9b8c9;
  --ok: #3ccf7f;
  --ok-wash: #0f2e1f;
  --bad: #ff6b6b;
  --bad-wash: #3a1517;
  --warn: #ffb347;
  --warn-wash: #3a2a10;
  --info: #7ea6ff;
  --info-wash: #16233f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Cairo", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--brand-strong); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
.material-icons-round { font-size: 20px; vertical-align: middle; user-select: none; }

/* ── شاشات الحالة والدخول ───────────────────────────────────────────── */
.state-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  text-align: center;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.login-head { text-align: center; margin-bottom: 18px; }
.login-head img { width: 64px; height: 64px; object-fit: contain; }
.login-head h1 { font-size: 20px; margin: 8px 0 2px; }
.login-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ── الهيكل ─────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--nav);
  color: var(--nav-ink);
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform 0.22s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 10px; color: #fff; }
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand b { display: block; font-size: 15px; line-height: 1.2; }
.sidebar-brand small { color: var(--nav-ink); font-size: 11.5px; }
.sidebar-account { margin: 6px 12px 10px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.06); }
.sidebar-account .name { color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--nav-ink);
  border-radius: 9px;
  cursor: pointer;
  text-align: start;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: var(--brand); color: #00222e; }
.nav-item .count { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; min-width: 20px; text-align: center; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 8px 6px; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar .chip { background: transparent; color: var(--nav-ink); border-color: rgba(255, 255, 255, 0.18); }
.sidebar .chip.active { background: var(--brand); color: #00222e; border-color: var(--brand); }
[dir="ltr"] .flip-ltr { transform: scaleX(-1); }
.overlay { position: fixed; inset: 0; background: rgba(5, 12, 20, 0.5); z-index: 55; display: none; }
.overlay.show { display: block; }

.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h2 { flex: 1; font-size: 16px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--brand-strong); border-color: var(--brand); }
.icon-btn .dot { position: absolute; top: -4px; inset-inline-end: -4px; background: var(--bad); color: #fff; font-size: 10.5px; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.menu-btn { display: none; }
.content { padding: 18px 16px 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 45;
}
.bottom-nav button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
}
.bottom-nav button.active { color: var(--brand-strong); }
.bottom-nav button span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

@media (max-width: 920px) {
  .sidebar { transform: translateX(100%); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none !important; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-grid; }
  .bottom-nav { display: flex; }
  .content { padding-bottom: calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom)); }
}

/* ── عناصر عامة ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.card-sub { color: var(--ink-3); font-size: 12.5px; margin: -6px 0 12px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 920px) { .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }
.mt { margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #00222e; }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-strong); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--brand-strong); cursor: pointer; font-weight: 700; padding: 0; }

.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 5px; }
.field .hint { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  outline: none;
  transition: border-color 0.15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); background: var(--surface); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-inline-end: 44px; }
.input-group .in-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-3); cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; }
.err { color: var(--bad); font-size: 12.5px; min-height: 18px; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  min-height: 46px;
}
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 10px 0; }
.search:focus-within { border-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 99px;
  padding: 5px 12px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { margin: 0; flex: 1; min-width: 140px; }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill.processing { background: var(--info-wash); color: var(--info); }
.pill.completed { background: var(--ok-wash); color: var(--ok); }
.pill.failed { background: var(--bad-wash); color: var(--bad); }
.pill.partial { background: var(--warn-wash); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.brand { background: var(--brand-wash); color: var(--brand-strong); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; }
.alert .material-icons-round { margin-top: 1px; }
.alert.info { background: var(--info-wash); color: var(--info); }
.alert.warn { background: var(--warn-wash); color: var(--warn); }
.alert.bad { background: var(--bad-wash); color: var(--bad); }
.alert.ok { background: var(--ok-wash); color: var(--ok); }
.alert b { display: block; }

/* ── الرئيسية ───────────────────────────────────────────────────────── */
.hero {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: linear-gradient(135deg, #0d1b2a 0%, #123048 60%, #0b5e7a 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.hero .label { opacity: 0.8; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero .value { font-size: 32px; font-weight: 900; line-height: 1.2; margin-top: 4px; word-break: break-word; }
.hero .value small { font-size: 15px; opacity: 0.8; font-weight: 700; }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.mode-tag { border-radius: 99px; padding: 1px 10px; font-size: 11px; font-weight: 800; }
.mode-tag.live { background: #19c37d; color: #032b18; }
.mode-tag.sandbox { background: #ffb347; color: #3a2400; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; min-width: 0; }
.stat .k { color: var(--ink-3); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 22px; font-weight: 900; margin-top: 4px; word-break: break-word; }
.stat .s { color: var(--ink-3); font-size: 12px; }
.progress { height: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--ok)); border-radius: 99px; width: 0; transition: width 0.4s ease; }

.chart { width: 100%; overflow-x: auto; direction: ltr; }
.chart svg { display: block; min-width: 520px; width: 100%; height: 190px; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--brand-strong); }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--ink-3); font-size: 10px; font-family: inherit; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-3); font-size: 12px; margin-top: 6px; }

/* ── القوائم ────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.row.click { cursor: pointer; }
.row.click:hover { border-color: var(--brand); }
.row .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-wash); color: var(--brand-strong); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.row .ico img { width: 100%; height: 100%; object-fit: cover; }
.row .body { flex: 1; min-width: 0; }
.row .title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--ink-3); font-size: 12.5px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.row .end { text-align: end; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row .amount { font-weight: 900; white-space: nowrap; }
.amount.plus { color: var(--ok); }
.amount.minus { color: var(--bad); }
.strike { text-decoration: line-through; color: var(--ink-3); font-size: 12px; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 10px; }
.empty .material-icons-round { font-size: 40px; display: block; margin: 0 auto 6px; opacity: 0.6; }
.more-row { display: flex; justify-content: center; margin-top: 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; height: 64px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--ink-3); font-weight: 700; }
.kv .v { word-break: break-word; min-width: 0; }
.codebox {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  min-width: 0;
}
.codebox .val { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate; word-break: break-all; min-width: 0; flex: 1; }
.codebox .tools { display: flex; gap: 4px; flex-shrink: 0; }
.big-ref { font-size: 26px; font-weight: 900; letter-spacing: 0.5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
table.t th, table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.t th { background: var(--surface-2); color: var(--ink-2); font-weight: 800; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }

/* ── النوافذ ────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 20, 0.55);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-back.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: pop 0.18s ease;
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 620px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-foot .btn { flex: 1; }
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  z-index: 120;
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 920px) { .toast { bottom: calc(var(--bottom-h) + 18px + env(safe-area-inset-bottom)); } }

.notif { border-inline-start: 3px solid transparent; }
.notif.unread { border-inline-start-color: var(--brand); background: color-mix(in srgb, var(--brand-wash) 45%, var(--surface)); }
.terms-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-height: 46vh; overflow-y: auto; font-size: 13px; }
.terms-box ol { margin: 0; padding-inline-start: 20px; }
.terms-box li { margin-bottom: 8px; }
.method-card { display: flex; gap: 12px; align-items: center; }
.method-card img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); }
.preview-img { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); margin-top: 6px; display: block; }
.verify-box { font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.verify-box.ok { color: var(--ok); }
.verify-box.bad { color: var(--bad); }
.verify-box img { width: 26px; height: 26px; border-radius: 50%; }

/* ── دليل التكامل ───────────────────────────────────────────────────── */
.docs-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.docs-top .in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: center; }
.docs-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 900; flex: 1; min-width: 0; }
.docs-top .brand img { width: 32px; height: 32px; }
.docs-top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-layout { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; }
.docs-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; }
.docs-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 13px; }
.docs-toc a:hover { background: var(--surface); color: var(--brand-strong); }
@media (max-width: 860px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } .docs-toc { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; } }
.doc-sec { margin-bottom: 26px; scroll-margin-top: 80px; }
.doc-sec h2 { font-size: 19px; margin: 0 0 8px; }
.doc-sec h3 { font-size: 15px; margin: 16px 0 6px; }
.doc-sec p, .doc-sec li { color: var(--ink-2); }
.endpoint { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; direction: ltr; overflow-x: auto; }
.method { font-weight: 900; font-size: 11px; padding: 2px 8px; border-radius: 6px; flex-shrink: 0; }
.method.get { background: var(--ok-wash); color: var(--ok); }
.method.post { background: var(--info-wash); color: var(--info); }
pre.code {
  direction: ltr;
  text-align: left;
  background: #0b1520;
  color: #d6e4f0;
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 8px 0;
  white-space: pre;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tab { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 10px; font-weight: 700; cursor: pointer; font-size: 12.5px; }
.tab.active { background: var(--ink); color: var(--surface); }