/* ===================================================================
   فواترا — بوابة المطوّرين
   -------------------------------------------------------------------
   نفس لغة «السجل الرسمي» المستعملة في الموقع التسويقي (../../style.css):
   ورق دافئ، حبر عميق، خطوط شعرة فاصلة، أرقام جدولية بخط أحادي، وزوايا
   شبه قائمة. اللوحة أداة عمل محاسبية — فالأولوية للوضوح والكثافة
   المعلوماتية، لا للظلال والانحناءات.
   =================================================================== */

:root {
  /* الورق والحبر — مطابق لرموز الموقع */
  --paper:     #F6F4EE;
  --paper-2:   #EFEBE1;
  --paper-3:   #E6E1D4;
  --white:     #FFFFFF;

  --ink:       #151B19;
  --ink-2:     #3A4440;
  --ink-3:     #68726D;
  --ink-4:     #97A09B;

  --line:      #D9D3C5;
  --line-soft: #E8E3D8;

  --pine-900:  #0C2A23;
  --pine-800:  #11372E;
  --pine-700:  #184A3D;
  --pine-600:  #1F6050;
  --pine-50:   #EAF1EE;

  --seal-600:  #8E2B24;
  --seal-50:   #F7EDEB;

  --brass-700: #7C5C17;
  --brass-600: #9A7324;
  --brass-500: #B48B33;
  --brass-50:  #F7F1E2;

  /* أسماء دلالية (تُستعمل في القوالب) */
  --primary:       var(--pine-800);
  --primary-light: var(--pine-600);
  --primary-50:    var(--pine-50);
  --accent:        var(--brass-600);
  --accent-light:  var(--brass-500);
  --text:          var(--ink);
  --muted:         var(--ink-3);
  --bg:            var(--paper);
  --success:       var(--pine-600);
  --success-bg:    var(--pine-50);
  --danger:        var(--seal-600);
  --danger-bg:     var(--seal-50);
  --warn:          var(--brass-700);
  --warn-bg:       var(--brass-50);
  --info-bg:       var(--pine-50);

  --radius:    3px;
  --radius-sm: 2px;
  --shadow:     2px 2px 0 var(--paper-3);
  --shadow-lg:  6px 6px 0 rgba(21, 27, 25, .07);

  --font:       'IBM Plex Sans Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-head:  'Noto Kufi Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  /* احتياط عربي في آخر الحزمة: أي حرف عربي يقع داخل نصّ أحادي المسافة
     يُرسم بخط عربي سليم التشكيل بدل خط النظام الافتراضي. */
  --mono:       'IBM Plex Mono', 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
                'IBM Plex Sans Arabic', monospace;
  /* العربية خط متّصل — لا تُكتب بخط أحادي لاتيني ولا تُباعَد حروفها */
  --font-label: var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.38;
  margin: 0 0 .6rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

:focus-visible { outline: 2px solid var(--pine-700); outline-offset: 2px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* العلامات الرسومية المشتركة (lib/marks.php) */
.mark { display: inline-block; vertical-align: -.14em; flex: none; stroke-width: 1.5; }

/* ---------- الترويسة العامة ---------- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; }

.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-head);
  font-weight: 800; font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -.015em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  background: var(--pine-800); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: .85rem; font-weight: 700;
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 6px; height: 6px;
  border-top: 2px solid var(--brass-500);
  border-inline-start: 2px solid var(--brass-500);
}

.topnav { display: flex; gap: 1.1rem; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.topnav a:hover { color: var(--pine-800); text-decoration: none; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--pine-800);
  background: var(--pine-800); color: #fff;
  font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(21, 27, 25, .08);
  transition: background-color .15s, border-color .15s, box-shadow .12s, transform .08s;
}
.btn:hover { background: var(--pine-700); border-color: var(--pine-700); text-decoration: none; color: #fff; }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(21, 27, 25, .08); }

.btn-accent { background: var(--brass-600); border-color: var(--brass-600); color: #231a06; }
.btn-accent:hover { background: var(--brass-500); border-color: var(--brass-500); color: #231a06; }

.btn-ghost {
  background: var(--white); color: var(--ink);
  border-color: var(--line);
  box-shadow: 2px 2px 0 var(--paper-3);
}
.btn-ghost:hover { background: var(--white); color: var(--ink); border-color: var(--ink-3); }

.btn-danger { background: var(--seal-600); border-color: var(--seal-600); }
.btn-danger:hover { background: #74211C; border-color: #74211C; }

.btn-sm { padding: .34rem .7rem; font-size: .82rem; box-shadow: 2px 2px 0 rgba(21,27,25,.07); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- البطاقات ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.2rem;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: .88rem; margin: -.3rem 0 1rem; }

.grid   { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- النماذج ---------- */
label {
  display: block; font-weight: 600; font-size: .87rem;
  margin-bottom: .35rem; color: var(--ink-2);
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem;
  background: var(--white); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pine-700);
  box-shadow: 0 0 0 3px rgba(31, 96, 80, .1);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
textarea { resize: vertical; min-height: 110px; font-family: var(--mono); font-size: .86rem; line-height: 1.7; }
.field { margin-bottom: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.err  { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.checkline { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-bottom: .4rem; }
.checkline input { width: auto; accent-color: var(--pine-700); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

/* ---------- إقرار الحزمة القانونية ---------- */
.consent {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--pine-700);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem 1rem; margin: 0 0 1.1rem;
  background: var(--pine-50);
}
.consent legend { font-size: .84rem; font-weight: 700; color: var(--pine-800); padding: 0 .4rem; }
.consent-intro { font-size: .85rem; color: var(--ink-2); line-height: 1.8; margin: 0 0 .6rem; }
.consent-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .15rem .9rem; margin: 0 0 .8rem; padding-inline-start: 1.1rem; font-size: .85rem;
}
.consent-list a { color: var(--pine-700); text-decoration: underline; }
.consent-check { align-items: flex-start; font-size: .88rem; line-height: 1.7; margin-bottom: 0; }
.consent-check input { margin-top: .28rem; width: 1rem; height: 1rem; }
.consent .hint { margin-top: .5rem; }
.consent .hint a { color: var(--pine-700); text-decoration: underline; }

/* ---------- الشارات ---------- */
/* لصيقة وثيقة مربّعة بحافّة شعرة — لا «حبّة» دائرية ملوّنة */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .16rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 600;
  background: var(--white); color: var(--ink-2);
  white-space: nowrap;
}
.badge .mark { font-size: .95em; }
.badge-ok    { background: var(--pine-50);  color: var(--pine-700);  border-color: #CCDFD8; }
.badge-err   { background: var(--seal-50);  color: var(--seal-600);  border-color: #E6CFCB; }
.badge-warn  { background: var(--brass-50); color: var(--brass-700); border-color: #E4D7B6; }
.badge-muted { background: var(--paper-2);  color: var(--muted); }
.badge-live  { background: var(--pine-50);  color: var(--pine-700);  border-color: #CCDFD8; }
.badge-test  { background: var(--brass-50); color: var(--brass-700); border-color: #E4D7B6; }
.badge-live::before, .badge-test::before {
  content: ''; width: 6px; height: 6px; background: currentColor; flex: none;
}

/* ---------- التنبيهات ---------- */
.alert {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-inline-start-width: 3px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .92rem;
  background: var(--white); color: var(--ink-2);
}
.alert .mark { flex: none; font-size: 1.1rem; margin-top: .15rem; }
.alert-success { background: var(--success-bg); border-color: #CCDFD8; border-inline-start-color: var(--success); }
.alert-success .mark { color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: #E6CFCB; border-inline-start-color: var(--danger); }
.alert-error .mark { color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: #CCDFD8; border-inline-start-color: var(--pine-600); }
.alert-info .mark { color: var(--pine-700); }
.alert-warn { background: var(--warn-bg); border-color: #E4D7B6; border-inline-start-color: var(--warn); }
.alert-warn .mark { color: var(--warn); }

/* ---------- الجداول ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
thead th {
  background: var(--paper-2);
  text-align: start; padding: .68rem .9rem;
  font-family: var(--font-label);
  font-weight: 600; font-size: .82rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: .68rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper); }
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: .85rem; direction: ltr; text-align: start; unicode-bidi: plaintext;
}

/* ---------- الكود ---------- */
code {
  font-family: var(--mono); font-size: .85em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--pine-800);
  padding: .1em .4em; border-radius: var(--radius-sm);
  direction: ltr; display: inline-block; unicode-bidi: plaintext;
}
pre {
  background: var(--pine-900); color: #CFDAD6;
  border: 1px solid var(--pine-800);
  padding: 1rem 1.15rem; border-radius: var(--radius);
  overflow-x: auto; direction: ltr; text-align: left;
  font-family: var(--mono); font-size: .84rem; line-height: 1.8; margin: 0 0 1rem;
}
pre code { background: none; border: 0; color: inherit; padding: 0; font-size: 1em; display: block; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(12, 42, 35, .96); color: #A9BAB4;
  border: 1px solid var(--pine-800); border-bottom: 0;
  padding: .45rem .9rem; font-size: .8rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--mono);
}
.code-head + pre { border-radius: 0 0 var(--radius) var(--radius); margin-top: 0; }
.copy-btn {
  background: none; color: #A9BAB4;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-sm);
  padding: .12rem .5rem; font-size: .75rem; cursor: pointer;
  font-family: var(--mono);
}
.copy-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- الإحصاءات ---------- */
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass-600);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.05rem 1.2rem;
}
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.stat-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 1.75rem; font-weight: 600;
  color: var(--ink); line-height: 1.15; letter-spacing: -.03em;
}
.stat-foot { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* شريط الاستهلاك — مصمت بحافّة، لا تدرّج */
.progress {
  height: 7px; background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden; margin-top: .6rem;
}
.progress > span { display: block; height: 100%; background: var(--pine-600); }
.progress.warn > span { background: var(--brass-600); }
.progress.danger > span { background: var(--seal-600); }

/* ---------- لوحة التحكم ---------- */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--white);
  border-inline-end: 1px solid var(--line);
  padding: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-group { margin-bottom: 1.3rem; }
.side-title {
  font-family: var(--font-label);
  font-size: .78rem; font-weight: 600;
  color: var(--ink-4);
  margin: 0 .6rem .45rem;
}
.side-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; font-size: .9rem;
  margin-bottom: .1rem;
}
.side-link:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.side-link.active {
  background: var(--pine-50); color: var(--pine-800); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--brass-600);
}
[dir='rtl'] .side-link.active { box-shadow: inset -2px 0 0 var(--brass-600); }
.side-link .ico { width: 18px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.side-link.active .ico { color: var(--pine-700); }

.main { padding: 1.5rem 2rem 4rem; min-width: 0; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0 0 .2rem; font-size: 1.45rem; }
.page-head p  { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- التوثيق ---------- */
.docs { display: grid; grid-template-columns: 250px 1fr; gap: 2.4rem; align-items: start; padding: 2rem 0 5rem; }
.docs-nav {
  position: sticky; top: 86px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem;
}
.docs-nav a {
  display: block; padding: .4rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--ink-3); font-size: .89rem; font-weight: 500;
}
.docs-nav a:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.docs-nav a.active { background: var(--pine-50); color: var(--pine-800); font-weight: 600; }
.docs-body {
  min-width: 0; background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
}
.docs-body h1 { margin-top: 0; }
.docs-body h2 { margin-top: 2.2rem; padding-top: 1.1rem; border-top: 2px solid var(--ink); }
.docs-body h3 { margin-top: 1.6rem; }
.docs-body ul, .docs-body ol { padding-inline-start: 1.3rem; }
.docs-body li { margin-bottom: .4rem; }
.docs-body li::marker { color: var(--brass-600); }
.docs-foot {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line); font-size: .9rem;
}

.method {
  font-family: var(--mono); font-weight: 600; font-size: .74rem;
  padding: .14rem .5rem; border-radius: var(--radius-sm);
  letter-spacing: .06em;
}
.m-get    { background: var(--pine-600);  color: #04140F; }
.m-post   { background: var(--brass-600); color: #231a06; }
.m-delete { background: var(--seal-600);  color: #fff; }
.endpoint {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .88rem; direction: ltr;
  background: var(--paper-2); border: 1px solid var(--line);
  padding: .5rem .8rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
}

/* ---------- التبويبات ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; flex-wrap: wrap; }
.tab {
  padding: .5rem .95rem; border: 0; background: none; font: inherit;
  font-weight: 500; font-size: .88rem; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--brass-600); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* قائمة فحص بمربّعات مرسومة — محرف ☐ يختلف شكله بين أنظمة التشغيل */
.checkbox-list { list-style: none; padding-inline-start: 0 !important; }
.checkbox-list li {
  display: flex; align-items: flex-start; gap: .65rem;
  margin-bottom: .55rem;
}
.checkbox-list li::before {
  content: ''; flex: none;
  width: 13px; height: 13px; margin-top: .45rem;
  border: 1px solid var(--ink-4);
  border-radius: 1px;
}

/* ---------- التسعير ---------- */
.plan-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem 1.5rem;
  position: relative; display: flex; flex-direction: column;
}
.plan-card.featured { background: var(--paper); box-shadow: inset 0 3px 0 var(--brass-600); }
.plan-flag {
  position: absolute; top: 0; inset-inline-end: 0;
  background: var(--brass-600); color: #231a06;
  font-size: .72rem; font-weight: 600; padding: .18rem .7rem;
}
.plan-name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.plan-tag  { color: var(--muted); font-size: .85rem; min-height: 2.4em; }
.plan-price {
  font-size: 2.2rem; font-weight: 600; color: var(--ink);
  margin: .5rem 0 0;
}
/* الرقم وحده أحادي المسافة ومضموم التباعد — «مجانًا» تبقى بالخط العربي */
.plan-price .amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -.04em;
}
.plan-price .free { font-family: var(--font-head); font-size: 1.85rem; }
.plan-price small { font-family: var(--font); font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-features { list-style: none; padding: 0; margin: 1.2rem 0; flex: 1; }
.plan-features li {
  padding-inline-start: 1.5rem; position: relative;
  margin-bottom: .5rem; font-size: .89rem; color: var(--ink-2);
}
/* علامة صحّ مرسومة بالحدود — لا محرف ✓ */
.plan-features li::before {
  content: ''; position: absolute;
  inset-inline-start: 0; top: .62em;
  width: 9px; height: 5px;
  border-left: 2px solid var(--pine-600);
  border-bottom: 2px solid var(--pine-600);
  transform: rotate(-45deg);
}

/* ---------- الواجهة التسويقية داخل المنصّة ---------- */
.hero {
  background: var(--pine-900); color: #C8D5D0;
  padding: 4rem 0 3.6rem;
  position: relative; overflow: hidden;
  border-bottom: 3px solid var(--brass-600);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 100% 30px,
              linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 30px 100%;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: 2.3rem; max-width: 20ch; }
.hero p  { color: #AFBEB9; font-size: 1.05rem; max-width: 56ch; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); box-shadow: none; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.4rem; align-items: center; }
.hero pre { background: rgba(2, 12, 9, .5); border-color: rgba(255,255,255,.14); }

.section { padding: 3.4rem 0; }
.section-title { text-align: center; margin-bottom: 2.1rem; }
.section-title p { color: var(--muted); max-width: 60ch; margin: .4rem auto 0; }

.feature { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; }
/* بلاطة مربّعة بحافّة شعرة وعلامة قَصّ في الركن — توقيع الهوية */
.feature-ico {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--pine-700);
  display: grid; place-items: center;
  font-size: 1.15rem; margin-bottom: .8rem;
  position: relative;
}
.feature-ico::after {
  content: ''; position: absolute; top: -1px; inset-inline-start: -1px;
  width: 7px; height: 7px;
  border-top: 2px solid currentColor;
  border-inline-start: 2px solid currentColor;
}
.feature h3 { font-size: 1rem; margin-bottom: .3rem; }
.feature p  { font-size: .88rem; color: var(--muted); margin: 0; }

.steps { counter-reset: s; }
.step { display: flex; gap: 1rem; margin-bottom: 1.4rem; }
.step-no {
  flex: 0 0 32px; height: 32px;
  background: var(--white); color: var(--pine-800);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass-600);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: .85rem;
}
.step h3 { margin: .1rem 0 .2rem; font-size: 1rem; }
.step p  { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- المصادقة ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2.5rem 1rem;
  background: var(--pine-900);
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
}
.auth-card {
  width: 100%; max-width: 470px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass-600);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.1rem;
  position: relative;
}
/* علامتا قَصّ في الركنين — الورقة الرسمية */
.auth-card::before, .auth-card::after {
  content: ''; position: absolute; width: 11px; height: 11px; pointer-events: none;
}
.auth-card::before {
  top: 9px; inset-inline-start: 9px;
  border-top: 2px solid var(--brass-600);
  border-inline-start: 2px solid var(--brass-600);
}
.auth-card::after {
  bottom: 9px; inset-inline-end: 9px;
  border-bottom: 2px solid var(--brass-600);
  border-inline-end: 2px solid var(--brass-600);
}
.auth-card h1 { font-size: 1.35rem; margin-bottom: .2rem; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ---------- الفوتر ---------- */
.footer {
  background: var(--pine-900); color: #93A5A0;
  padding: 2.4rem 0 1.9rem; font-size: .88rem; margin-top: 3rem;
  border-top: 3px solid var(--brass-600);
}
.footer a { color: #93A5A0; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.8rem; margin-bottom: 1.5rem; }
.footer h4 {
  color: #fff; font-family: var(--font-label);
  font-size: .85rem; font-weight: 600; margin-bottom: .6rem;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .35rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 1.15rem;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: .6rem; font-size: .82rem; color: #74857F;
}

/* ---------- عناصر متنوّعة ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; font-size: .89rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

.secret-box {
  background: var(--pine-900); color: var(--brass-500);
  border: 1px solid var(--pine-800);
  font-family: var(--mono); font-size: .88rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  direction: ltr; word-break: break-all;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.empty {
  text-align: center; padding: 2.6rem 1rem; color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-ico { font-size: 1.8rem; color: var(--ink-4); display: block; margin: 0 auto .5rem; }
.empty-ico .mark { margin: 0 auto; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.pagination { display: flex; gap: .25rem; justify-content: center; margin-top: 1.2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .33rem .72rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .85rem; background: var(--white);
  font-variant-numeric: tabular-nums;
}
.pagination .current { background: var(--pine-800); color: #fff; border-color: var(--pine-800); }

.inline-form { display: inline; }
.muted  { color: var(--muted); }
.small  { font-size: .85rem; }
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums slashed-zero;
  direction: ltr; unicode-bidi: plaintext;
}
.nowrap { white-space: nowrap; unicode-bidi: plaintext; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .6rem; } .mb-2 { margin-bottom: 1.2rem; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.text-end { text-align: end; }
.text-center { text-align: center; }

/* ---------- الاستجابة ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .3rem; }
  .side-group { margin-bottom: .6rem; width: 100%; }
  .side-title { display: none; }
  .side-link { display: inline-flex; }
  .main { padding: 1.2rem; }
  .docs { grid-template-columns: 1fr; gap: 1.2rem; }
  .docs-nav { position: static; }
  .docs-body { padding: 1.4rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.85rem; }
}
@media (max-width: 560px) {
  .topnav { gap: .7rem; }
  .topnav a { font-size: .85rem; }
  .card { padding: 1.1rem; }
  .main { padding: 1rem; }
}

/* --- اقتباسات من المرجع الرسمي + لقطات شاشة ------------------------- */
.srcquote {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1.1rem 0;
}
.srcquote p { margin: 0; line-height: 1.95; }
.srcquote p + p { margin-top: .6rem; }
.srcquote q { quotes: '\201D' '\201C' '\2019' '\2018'; }
.srcquote cite {
  display: block; margin-top: .7rem;
  font-style: normal; font-size: .8rem; color: var(--muted);
  padding-inline-start: .9rem; position: relative;
}
/* شرطة مرجع مرسومة بدل محرف الكتاب */
.srcquote cite::before {
  content: ''; position: absolute;
  inset-inline-start: 0; top: .72em;
  width: 6px; height: 1.5px; background: var(--brass-600);
}
.srcquote-warn {
  background: var(--warn-bg);
  border-color: #E4D7B6;
  border-inline-start-color: var(--warn);
}
.srcquote-warn cite::before { background: var(--warn); }

.shot { margin: 1.2rem 0; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 5px;
}
.shot figcaption {
  margin-top: .55rem;
  font-size: .8rem; line-height: 1.7; color: var(--muted); text-align: center;
}
.shot-sm { max-width: 380px; margin-inline: auto; }
.shot-md { max-width: 620px; margin-inline: auto; }

.source-note {
  font-size: .8rem; line-height: 1.8; color: var(--muted);
  background: var(--white); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-top: 1.8rem;
}

@media print {
  .sidebar, .topbar, .footer, .btn, .toolbar { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}
