/* ═══════════════════════════════════════════════════════════
   لينامارا أعمال — نظام التصميم «سَنَد»
   ───────────────────────────────────────────────────────────
   لغة الورق المالي: الشيك، والسند، والشهادة الرسمية. حبرٌ كحليّ على
   ورق أمان، شعراتٌ تفصل بدل البطاقات العائمة، أرقامٌ محفورة بخطّ
   مذيَّل، والذهبيّ رقائق في مواضع معدودة: الربح، والختم، والتبويب
   النشط. الزخرفة (غيلوشيه، ختم، طباعة دقيقة) في ثلاثة مواضع لا غير —
   الشريط التنفيذي، والدخول، والترحيب — وهي ساكنة: النقش المتحرّك
   أثقل الصفحة في العيّنة، والجداول وإدخال القيود يجب أن تبقى سريعة.

   أسماء المتغيّرات القديمة (‎--ink-*‎ و‎--tx*‎ و‎--gold*‎) باقية لأن مئات
   القواعد والشيفرة تقرؤها؛ تغيّرت قيمها فقط. ‎:root‎ هو «ليل الخزنة»
   (الداكن)، و‎[data-theme="light"]‎ هو ورق الأمان (الافتراضي).
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── الخطوط — ملفّاتها محلّية (css/fonts.css)، ولكلٍّ بديلٌ من خطوط الجهاز إن تعذّر تحميلها.
     الأرقام المحفورة لا تحوي العربية، فيسقط الحرف العربيّ داخلها (٪، ل.س)
     إلى خطّ الواجهة لا إلى خطٍّ غريب. ── */
  --font:      'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif;
  --f-display: 'Markazi Text', 'Noto Naskh Arabic', 'Sakkal Majalla', 'Traditional Arabic', 'Times New Roman', serif;
  --f-fig:     'Source Serif 4', Cambria, Georgia, 'Noto Serif', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, serif;
  --mono:      'IBM Plex Mono', 'Cascadia Mono', Consolas, 'SF Mono', monospace;
  --f-hand:    'Aref Ruqaa', 'Markazi Text', 'Noto Naskh Arabic', 'Traditional Arabic', serif;

  /* ── ليل الخزنة: الأسطح ─────────────────────────────── */
  --ink-990: #09101C;   /* الصفحة خلف الإطار */
  --ink-950: #0C1524;   /* الإطار */
  --ink-900: #0F192A;   /* النوافذ والقوائم المنسدلة */
  --ink-870: #0E1727;   /* الورقة — البطاقة */
  --ink-840: #131E31;   /* تحويم / رأس مرتفع */
  --ink-820: #111B2D;
  --ink-800: #16223A;   /* سطح داخليّ */
  --ink-760: #1F2C44;   /* شعرة */
  --ink-720: #2C3B58;   /* شعرة أوضح — حدّ البطاقة */
  --rule-strong: #ECE6D8;   /* خطّ المجموع — بلون الحبر */

  /* حقول الإدخال: صندوقٌ خافت وسطرٌ أوضح تحته — سطر الاستمارة */
  --field:      #0A1220;
  --field-edge: #2C3B58;
  --field-line: #66779A;   /* ‎≥3:1‎ مع الحقل */

  /* المصمَت: الأزرار الأساسية والمقطع النشط بلون الحبر لا الذهب */
  --solid: #ECE6D8; --solid-hover: #FFFFFF; --on-solid: #0C1524;

  /* ── رقائق الذهب ─────────────────────────────────────── */
  --gold:       #DDB868;   /* نصّ ذهبيّ — يمرّ AA على الداكن */
  --gold-brand: #D2A954;   /* الرقاقة نفسها: حدود وأيقونات وخطوط */
  --gold-deep:  #B48A3A;
  --gold-soft:  rgba(210,169,84,.14);
  --gold-line:  rgba(210,169,84,.36);
  --on-gold:    #1A1306;
  --navy-brand: #14294C;

  /* ── دلالات مالية ─────────────────────────────────────── */
  --profit: #62C99E;  --profit-soft: rgba(98,201,158,.12);
  --loss:   #F2887D;  --loss-soft:   rgba(242,136,125,.11);
  --danger: #F2887D;  --danger-soft: rgba(242,136,125,.11);
  --warn:   #E5B456;  --warn-soft:   rgba(229,180,86,.12);
  --info:   #86B4E3;  --info-soft:   rgba(134,180,227,.12);
  --purple: #B9A6EC;  --purple-soft: rgba(185,166,236,.12);

  /* ── الحبر على الداكن: عاجيّ دافئ ────────────────────── */
  --tx:   #ECE6D8;
  --tx-2: #B9C0CC;
  --tx-3: #939DAE;

  /* ── «الورقة النقدية»: الكحليّ المحفور — واحدٌ في المظهرين ── */
  --note:        #122441;
  --note-ink:    #F4F0E6;
  --note-ink-2:  #C5CDDA;
  --note-art:    rgba(214,176,96,.30);
  --note-foil:   #DDB665;
  --note-profit: #7FD6AE;
  --note-loss:   #F6A79D;

  /* اللوحة البيضاء (معاينة الورق) */
  --paper:     #FFFFFF;
  --paper-2:   #F4F6F5;
  --paper-3:   #E8ECEB;
  --paper-line:#DCE1E6;
  --paper-tx:  #14294C;
  --paper-tx2: #3D4E6C;
  --paper-tx3: #56657E;

  /* أسماءٌ تقرؤها الشيفرة في أنماطٍ مضمَّنة */
  --line: var(--ink-720);
  --bg-sunk: var(--ink-840);

  /* ── هندسة: حوافّ الورق المقصوص لا الحبّة ─────────────── */
  --r-pill: 3px;
  --r-xs: 2px;
  --r-sm: 3px;
  --r:    3px;
  --r-lg: 3px;
  --r-xl: 4px;
  --frame-r: 4px;

  --sh-1: 0 0 0 1px rgba(0,0,0,.18);
  --sh-2: 0 0 0 1px rgba(0,0,0,.22), 0 14px 30px -18px rgba(0,0,0,.85);
  --sh-3: 0 0 0 1px rgba(0,0,0,.25), 0 22px 44px -26px rgba(0,0,0,.9);

  /* الغيلوشيه — منحنى وردةٍ مرسومٌ مرّة واحدة، ساكن، بلا JS */
  --rosette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-170 -170 340 340' fill='none' stroke='rgba(214,176,96,.34)' stroke-width='.6'%3E%3Cpath d='M126 0c0-10.2-8.9-19.9-21-21.4c-12.1-1.6-26.6 5.4-34.3 17.9c-7.8 12.5-8.2 29.8-1.3 42.2c6.8 12.5 20.4 19.4 31.7 17.8c11.3-1.6 19.3-11.5 18.4-21.8c-.8-10.4-10.6-20.3-23.5-22c-13-1.8-28.3 4.9-36.8 17.2c-8.6 12.2-9.8 29.1-3.8 41.3c6.1 12.1 18.9 18.6 29.4 16.6c10.5-2 17.7-12.3 16.1-23.1c-1.5-10.8-12-21.2-25.7-23.5c-13.6-2.3-29.6 3.9-38.8 15.6c-9.2 11.6-11.1 28-5.7 39.5c5.5 11.5 17.7 17.4 27.6 14.8c9.9-2.7 16.6-13.7 14.5-25.2c-2.1-11.5-13.1-22.6-27.2-25.6c-14.1-3-30.6 2.5-40.2 13.4c-9.6 10.9-11.9 26.4-6.8 37.2c5.1 10.7 16.9 15.8 26.6 12.3c9.6-3.5 16-15.3 13.7-27.6c-2.4-12.4-13.5-24.3-27.9-28.1c-14.3-3.9-30.8 .7-40.6 10.7c-9.7 10.1-12.1 24.8-7.1 34.6c5.1 9.9 17 14.1 26.6 9.8c9.6-4.4 16.1-17.1 13.8-30.3c-2.2-13.2-13.3-26-27.4-30.7c-14.2-4.7-30.6-1-40.2 8.2c-9.5 9.2-11.6 23.1-6.3 32.1c5.3 9.1 17.5 12.5 27.4 7.3c10-5.2 16.8-18.6 14.9-32.6c-1.8-14-12.5-27.6-26.2-33c-13.7-5.4-29.6-2.5-38.7 6c-9 8.5-10.6 21.7-4.8 30c5.9 8.4 18.6 11.2 29.2 5.4c10.6-5.8 18-19.9 16.8-34.5c-1.3-14.5-11.2-28.7-24.3-34.7c-13-5.9-28.2-3.5-36.5 4.5c-8.4 8-9.2 20.8-2.6 28.7c6.6 7.9 20.1 10.3 31.5 4.1c11.3-6.2 19.6-20.6 19.1-35.5c-.4-14.9-9.5-29.3-21.7-35.5c-12.3-6.2-26.6-4-34.1 3.8c-7.5 7.8-7.5 20.4 0 28.2c7.5 7.8 21.8 10 34.1 3.8c12.2-6.2 21.3-20.6 21.7-35.5c.5-14.9-7.8-29.3-19.1-35.5c-11.4-6.2-24.9-3.8-31.5 4.1c-6.6 7.9-5.8 20.7 2.6 28.7c8.3 8 23.5 10.4 36.5 4.5c13.1-6 23-20.2 24.3-34.7c1.2-14.6-6.2-28.7-16.8-34.5c-10.6-5.8-23.3-3-29.2 5.4c-5.8 8.3-4.2 21.5 4.8 30c9.1 8.5 25 11.4 38.7 6c13.7-5.4 24.4-19 26.2-33c1.9-14-4.9-27.4-14.9-32.6c-9.9-5.2-22.1-1.8-27.4 7.3c-5.3 9-3.2 22.9 6.3 32.1c9.6 9.2 26 12.9 40.2 8.2c14.1-4.7 25.2-17.5 27.4-30.7c2.3-13.2-4.2-25.9-13.8-30.3c-9.6-4.3-21.5-.1-26.6 9.8c-5 9.8-2.6 24.5 7.1 34.6c9.8 10 26.3 14.6 40.6 10.7c14.4-3.8 25.5-15.7 27.9-28.1c2.3-12.3-4.1-24.1-13.7-27.6c-9.7-3.5-21.5 1.6-26.6 12.3c-5.1 10.8-2.8 26.3 6.8 37.2c9.6 10.9 26.1 16.4 40.2 13.4c14.1-3 25.1-14.1 27.2-25.6c2.1-11.5-4.6-22.5-14.5-25.2c-9.9-2.6-22.1 3.3-27.6 14.8c-5.4 11.5-3.5 27.9 5.7 39.5c9.2 11.7 25.2 17.9 38.8 15.6c13.7-2.3 24.2-12.7 25.7-23.5c1.6-10.8-5.6-21.1-16.1-23.1c-10.5-2-23.3 4.5-29.4 16.6c-6 12.2-4.8 29.1 3.8 41.3c8.5 12.3 23.8 19 36.8 17.2c12.9-1.7 22.7-11.6 23.5-22c.9-10.3-7.1-20.2-18.4-21.8c-11.3-1.6-24.9 5.3-31.7 17.8c-6.9 12.4-6.5 29.7 1.3 42.2c7.7 12.5 22.2 19.5 34.3 17.9c12.1-1.5 21-11.2 21-21.4zM129.1 2.8c-.8-11.5-11.3-22.1-24.9-23.4c-13.7-1.4-29.6 6.8-37.7 20.7c-8.1 13.9-7.9 32.8 .2 45.9c8 13.2 23.2 19.8 35.5 17.2c12.2-2.7 20.4-14.3 18.8-26c-1.5-11.8-12.9-22.5-27.4-24.2c-14.5-1.6-31.2 6.3-40.1 19.9c-8.9 13.6-9.5 32.1-2.2 44.9c7.2 12.7 21.7 19 33.2 15.9c11.4-3.1 18.9-15.2 16.6-27.4c-2.3-12.2-14.3-23.5-29.5-25.7c-15.2-2.1-32.5 5.2-42.1 18.2c-9.5 13-10.7 30.9-4.1 43c6.7 12.1 20.6 17.7 31.5 13.9c11-3.7 17.9-16.5 15.1-29.4c-2.7-13-15.2-25-30.9-27.9c-15.6-2.9-33.3 3.6-43.3 15.9c-9.9 12.2-11.5 29.2-5.1 40.6c6.3 11.3 19.9 16.1 30.6 11.5c10.7-4.6 17.4-18.2 14.4-32c-3-13.8-15.6-26.7-31.4-30.4c-15.8-3.8-33.6 1.9-43.6 13.2c-10 11.4-11.7 27.6-5.3 38c6.3 10.5 20 14.4 30.7 8.9c10.7-5.4 17.5-19.9 14.7-34.5c-2.9-14.7-15.4-28.4-31-33c-15.6-4.6-33.2 .2-43 10.7c-9.8 10.5-11.1 25.9-4.4 35.5c6.6 9.7 20.6 12.8 31.7 6.5c11-6.2 18.3-21.5 15.8-36.9c-2.4-15.4-14.5-29.9-29.6-35.2c-15.1-5.3-32.2-1.2-41.5 8.6c-9.2 9.9-10 24.6-2.8 33.6c7.3 9 21.8 11.4 33.5 4.6c11.8-6.9 19.6-22.7 17.9-38.7c-1.8-15.9-13.2-31-27.6-36.8c-14.4-5.9-30.8-2.2-39.3 7.2c-8.5 9.4-8.5 23.6-.5 32.2c8 8.6 23.3 10.7 35.9 3.5c12.5-7.2 21.2-23.3 20.2-39.5c-1-16.3-11.5-31.5-25.1-37.6c-13.5-6-29.1-2.6-36.7 6.6c-7.6 9.3-6.8 23.4 2.1 31.9c8.8 8.6 25 10.6 38.4 3.4c13.4-7.2 23-23.4 22.9-39.6c-.1-16.2-9.8-31.4-22.5-37.3c-12.7-6-27.4-2.4-34.1 7c-6.8 9.4-5.1 23.8 4.6 32.5c9.7 8.8 26.7 11.1 40.9 4.1c14.2-6.9 24.6-22.7 25.3-38.6c.7-15.8-8.2-30.6-20.1-36.2c-12-5.5-25.9-1.5-31.9 8.4c-6.1 9.8-3.7 24.7 6.7 33.9c10.4 9.3 28.2 12.1 43 5.8c14.9-6.4 25.9-21.6 27.2-36.8c1.3-15.3-7-29.4-18.3-34.3c-11.4-4.9-24.8-.2-30.3 10.3c-5.5 10.6-2.6 26.2 8.2 36.2c10.9 9.9 29.1 13.5 44.3 7.9c15.3-5.6 26.7-20 28.4-34.4c1.7-14.5-6.3-27.8-17.4-31.9c-11.1-4.1-24.2 1.4-29.5 12.9c-5.3 11.4-2.2 27.8 8.8 38.6c11.1 10.9 29.4 15.3 44.8 10.6c15.3-4.8 26.8-18.3 28.5-31.9c1.7-13.6-6.2-26.1-17.3-29.3c-11.1-3.2-24.3 3.2-29.7 15.5c-5.4 12.3-2.4 29.5 8.5 41.2c10.9 11.7 29 17 44.2 13.1c15.1-3.9 26.3-16.6 27.8-29.3c1.4-12.8-6.9-24.5-18.3-26.9c-11.4-2.4-25 4.8-30.7 17.9c-5.8 13-3.3 31 7.2 43.5c10.4 12.4 28.1 18.5 42.7 15.3c14.7-3.2 25.4-15.2 26.2-27.3c.9-12.1-7.9-23.1-20-24.9c-12-1.8-26.2 6-32.6 19.6c-6.4 13.7-4.5 32.2 5.2 45.2c9.8 13 26.7 19.5 40.6 16.8c14-2.7 23.9-14.3 24.1-25.9c.1-11.7-9.6-22.3-22.4-23.7c-12.8-1.4-27.8 6.7-35 20.6c-7.2 14-6.2 32.8 2.7 46c9 13.3 25 20 38.1 17.5c13.1-2.5 22.2-13.9 21.5-25.5zM131.9 5.4c-1.6-12.9-13.8-24.2-29.1-25.2c-15.2-1.1-32.4 8.4-40.8 23.8c-8.3 15.3-7.3 35.7 2 49.4c9.3 13.7 26.1 20 39.3 16.2c13.1-3.8 21.4-17.2 19-30.3c-2.4-13.1-15.5-24.6-31.6-26c-16-1.3-34 7.8-43.1 22.8c-9.2 15.1-9 35-.4 48.3c8.5 13.3 24.6 19.1 37 14.9c12.4-4.3 20-18.2 16.9-31.8c-3.1-13.6-16.8-25.7-33.6-27.6c-16.7-1.9-35.3 6.6-45 21c-9.8 14.4-10.2 33.7-2.2 46.4c8 12.6 23.5 17.8 35.4 12.8c11.9-5 19-19.6 15.4-33.9c-3.5-14.4-17.7-27.2-34.8-29.9c-17.1-2.7-36.1 5-46.2 18.6c-10.1 13.7-10.8 32.1-3.1 44c7.7 11.8 23 16.1 34.6 10.3c11.7-5.8 18.6-21.3 14.9-36.5c-3.8-15.2-18-28.9-35.3-32.4c-17.2-3.6-36.2 3.3-46.4 16c-10.1 12.8-10.8 30.4-3.1 41.4c7.7 10.9 23.1 14.3 34.9 7.7c11.7-6.7 18.8-23 15.2-39.1c-3.6-16-17.7-30.6-34.7-35c-17-4.4-35.8 1.7-45.6 13.6c-9.9 11.9-10.3 28.7-2.2 38.9c8 10.1 23.8 12.8 35.9 5.3c12.2-7.4 19.7-24.5 16.5-41.3c-3.1-16.7-16.7-32-33.2-37.1c-16.5-5.2-34.7 .2-44 11.5c-9.3 11.2-9.1 27.4-.5 36.9c8.7 9.6 25.1 11.6 37.9 3.6c12.8-8 20.9-25.7 18.5-43c-2.4-17.3-15.3-33.1-31.1-38.6c-15.7-5.6-33.2-.7-41.8 10.1c-8.5 10.9-7.6 26.6 1.9 35.8c9.5 9.2 26.7 10.9 40.3 2.6c13.6-8.3 22.6-26.2 21-43.8c-1.6-17.5-13.7-33.5-28.6-39.3c-14.9-5.7-31.5-1-39.2 9.7c-7.7 10.8-5.9 26.5 4.5 35.6c10.3 9.1 28.4 10.8 42.8 2.5c14.5-8.3 24.4-26.2 23.7-43.6c-.8-17.5-12-33.4-26-39c-14.1-5.6-29.9-.7-36.7 10.3c-6.9 10.9-4.2 26.8 7 36.2c11.1 9.4 30 11.4 45.3 3.4c15.3-8 26-25.5 26-42.5c.1-17.1-10.4-32.6-23.7-37.8c-13.3-5.1-28.3 .3-34.5 11.7c-6.1 11.4-2.7 27.9 9.1 37.8c11.8 10 31.4 12.5 47.3 5.1c15.9-7.4 27.2-24.2 27.8-40.7c.7-16.4-9.2-31.2-22-35.7c-12.8-4.5-27.3 1.6-32.9 13.8c-5.7 12.1-1.8 29.3 10.4 40c12.3 10.7 32.2 14 48.5 7.4c16.3-6.6 27.9-22.7 28.9-38.3c.9-15.6-8.6-29.6-21.2-33.3c-12.5-3.6-26.8 3.3-32.2 16.3c-5.5 13-1.5 31.1 10.9 42.6c12.4 11.6 32.4 15.8 48.8 10c16.4-5.7 28-20.9 29-35.7c.9-14.7-8.7-27.9-21.3-30.7c-12.5-2.7-26.9 5.1-32.5 18.9c-5.6 13.9-1.8 32.8 10.4 45.2c12.3 12.4 32.1 17.4 48.2 12.5c16.1-4.9 27.5-19.3 28.1-33.2c.6-14-9.3-26.3-22.3-28.3c-12.9-2-27.7 6.6-33.7 21.2c-6 14.6-2.6 34.3 9.1 47.4c11.7 13.1 31 18.9 46.6 14.6c15.6-4.2 26.4-17.9 26.4-31.2c.1-13.3-10.5-25-24.1-26.4c-13.5-1.4-29 7.7-35.7 22.9c-6.6 15.2-4 35.3 7.1 49c11 13.6 29.5 19.8 44.4 16c14.8-3.7 24.8-17.1 24.1-30c-.7-12.9-12-24.2-26.4-25.3c-14.4-1.1-30.7 8.4-38.2 23.8c-7.5 15.5-5.6 35.9 4.5 49.7c10.2 13.8 27.9 20.2 41.9 16.6c14-3.6 23.1-16.8 21.6-29.6zM134.4 7.6c-2.6-14.1-16.6-26-33.4-26.7c-16.8-.6-35.2 10.3-43.7 27.1c-8.5 16.9-6.6 38.7 4 52.9c10.7 14.2 29.2 19.9 43.1 14.9c14-5.1 22.3-20.4 18.9-34.7c-3.4-14.4-18.2-26.6-35.9-27.6c-17.6-1-36.7 9.5-46 26c-9.3 16.5-8.1 37.9 1.8 51.6c9.9 13.8 27.6 19 40.9 13.5c13.2-5.6 20.8-21.4 16.7-36.3c-4-14.9-19.5-27.7-37.8-29.3c-18.2-1.6-37.9 8.3-47.8 24.2c-9.9 15.8-9.3 36.5 .1 49.6c9.3 13 26.6 17.5 39.4 11.3c12.7-6.3 19.8-22.8 15.4-38.5c-4.5-15.7-20.4-29.3-39-31.6c-18.6-2.4-38.7 6.7-48.9 21.7c-10.2 15-9.8 34.9-.7 47.1c9.1 12.3 26.1 16 38.7 8.8c12.6-7.1 19.5-24.5 15-41c-4.6-16.6-20.6-31-39.3-34.2c-18.7-3.2-38.8 4.9-49 19.1c-10.1 14.2-9.8 33.2-.6 44.5c9.2 11.4 26.3 14.2 39 6.2c12.7-8 19.9-26.2 15.5-43.6c-4.4-17.4-20.2-32.6-38.6-36.7c-18.4-4-38.2 3.3-48.1 16.7c-9.8 13.3-9.1 31.5 .4 42.1c9.6 10.6 27.1 12.6 40.3 3.9c13.1-8.7 20.7-27.7 16.8-45.8c-3.9-18.1-19.2-34.1-37-38.8c-17.9-4.8-37.1 2-46.4 14.7c-9.3 12.7-8 30.3 2.2 40.3c10.2 9.9 28.4 11.4 42.2 2.1c13.9-9.3 22.2-28.7 19-47.3c-3.2-18.6-17.7-35.1-34.9-40.3c-17.1-5.1-35.6 1.2-44.1 13.5c-8.4 12.3-6.3 29.6 4.7 39.2c11 9.7 30 10.9 44.6 1.3c14.7-9.5 23.8-29.3 21.5-48.1c-2.4-18.8-16.1-35.4-32.3-40.7c-16.3-5.3-33.9 .9-41.5 13.2c-7.6 12.2-4.7 29.4 7.2 39c11.9 9.7 31.8 10.9 47.3 1.4c15.5-9.5 25.5-29.1 24-47.8c-1.5-18.7-14.3-35.2-29.7-40.3c-15.4-5.1-32.2 1.3-39 13.8c-6.8 12.5-3 29.9 9.7 39.9c12.7 9.9 33.4 11.5 49.7 2.3c16.3-9.1 27.1-28.3 26.4-46.6c-.8-18.3-12.8-34.3-27.5-38.9c-14.7-4.7-30.8 2.2-36.9 15.2c-6 13.1-1.6 31.1 11.8 41.6c13.3 10.6 34.6 12.7 51.5 4.2c16.9-8.5 28.3-27.1 28.1-44.7c-.1-17.6-11.7-32.9-25.8-36.9c-14.2-4-29.8 3.7-35.5 17.4c-5.6 13.8-.7 32.6 13 43.9c13.8 11.3 35.5 14.2 52.7 6.5c17.3-7.7 28.9-25.5 29-42.3c.1-16.7-11.1-31.2-25.1-34.3c-14-3.2-29.3 5.3-34.8 19.9c-5.5 14.7-.5 34.3 13.3 46.5c13.8 12.2 35.6 15.9 52.9 9.1c17.3-6.8 28.9-23.8 29-39.7c.1-15.9-11.3-29.5-25.4-31.7c-14-2.3-29.5 7.1-35.2 22.5c-5.6 15.5-.8 36 12.8 49c13.6 13 35.1 17.6 52.1 11.6c16.9-6 28.3-22.1 28-37.2c-.3-15.1-12-28-26.5-29.5c-14.4-1.4-30.4 8.7-36.5 24.9c-6.1 16.2-1.8 37.4 11.3 51.1c13.1 13.7 34 19 50.5 13.6c16.4-5.3 27.1-20.8 26.2-35.3c-.8-14.5-13.2-26.7-28.3-27.6c-15.2-.9-31.8 9.7-38.6 26.4c-6.8 16.8-3.2 38.5 9.2 52.7c12.3 14.1 32.5 19.9 48.2 14.9c15.6-4.9 25.6-20 23.9-34.1c-1.7-14.2-14.8-26.1-30.8-26.7c-15.9-.6-33.4 10.3-41 27.2c-7.7 17-4.9 38.9 6.6 53.2c11.5 14.4 30.8 20.3 45.6 15.4c14.8-4.8 23.9-19.8 21.4-33.9zM156 0c0-3.4-4.8-6.3-10.1-4.4c-5.3 1.9-10.2 8.5-10.3 15.6c-.2 7.1 4.4 13.7 9.4 15.5c5.1 1.9 9.6-1 9.3-4.4c-.3-3.4-5.4-6.3-11-4.5c-5.6 1.8-10.7 8.4-11.1 15.5c-.5 7 3.8 13.6 8.6 15.4c4.7 1.8 9-1.2 8.4-4.6c-.6-3.5-5.9-6.5-11.8-4.7c-5.9 1.7-11.3 8.2-12 15.2c-.7 6.9 3.4 13.4 7.8 15.1c4.5 1.7 8.5-1.4 7.6-4.9c-.8-3.6-6.4-6.7-12.5-5.1c-6.2 1.7-11.9 8.1-12.8 14.9c-1 6.8 2.8 13.2 7 14.8c4.3 1.5 8-1.7 6.9-5.4c-1.1-3.7-6.9-7-13.3-5.5c-6.4 1.5-12.3 7.7-13.5 14.4c-1.1 6.7 2.4 12.8 6.4 14.2c4 1.4 7.5-2 6.2-5.9c-1.3-3.9-7.4-7.3-14-6c-6.5 1.3-12.7 7.3-14.1 13.8c-1.4 6.5 2 12.5 5.8 13.6c3.8 1.2 7.1-2.4 5.6-6.5c-1.5-4.1-7.7-7.8-14.5-6.7c-6.8 1.1-13.1 6.9-14.6 13.1c-1.6 6.3 1.6 12 5.2 13c3.6 .9 6.8-2.9 5.1-7.2c-1.6-4.4-8-8.3-14.9-7.5c-6.9 .9-13.4 6.4-15.1 12.4c-1.7 6 1.4 11.5 4.9 12.2c3.5 .7 6.5-3.4 4.8-8c-1.8-4.6-8.3-8.8-15.3-8.2c-7.1 .6-13.6 5.9-15.4 11.6c-1.8 5.7 1.1 10.9 4.6 11.4c3.4 .4 6.3-4 4.5-8.9c-1.8-4.9-8.4-9.3-15.5-9c-7.1 .3-13.7 5.3-15.6 10.7c-1.8 5.5 1.1 10.4 4.5 10.6c3.4 .1 6.3-4.5 4.4-9.7c-1.9-5.2-8.5-9.9-15.6-9.9c-7.1 0-13.7 4.7-15.6 9.9c-1.9 5.2 1 9.8 4.4 9.7c3.4-.2 6.3-5.1 4.5-10.6c-1.9-5.4-8.5-10.4-15.6-10.7c-7.1-.3-13.7 4.1-15.5 9c-1.8 4.9 1.1 9.3 4.5 8.9c3.5-.5 6.4-5.7 4.6-11.4c-1.8-5.7-8.3-11-15.4-11.6c-7-.6-13.5 3.6-15.3 8.2c-1.7 4.6 1.3 8.7 4.8 8c3.5-.7 6.6-6.2 4.9-12.2c-1.7-6-8.2-11.5-15.1-12.4c-6.9-.8-13.3 3.1-14.9 7.5c-1.7 4.3 1.5 8.1 5.1 7.2c3.6-1 6.8-6.7 5.2-13c-1.5-6.2-7.8-12-14.6-13.1c-6.8-1.1-13 2.6-14.5 6.7c-1.5 4.1 1.8 7.7 5.6 6.5c3.8-1.1 7.2-7.1 5.8-13.6c-1.4-6.5-7.6-12.5-14.1-13.8c-6.6-1.3-12.7 2.1-14 6c-1.3 3.9 2.2 7.3 6.2 5.9c4-1.4 7.5-7.5 6.4-14.2c-1.2-6.7-7.1-12.9-13.5-14.4c-6.4-1.5-12.2 1.8-13.3 5.5c-1.1 3.7 2.6 6.9 6.9 5.4c4.2-1.6 8-8 7-14.8c-.9-6.8-6.6-13.2-12.8-14.9c-6.1-1.6-11.7 1.5-12.5 5.1c-.9 3.5 3.1 6.6 7.6 4.9c4.4-1.7 8.5-8.2 7.8-15.1c-.7-7-6.1-13.5-12-15.2c-5.9-1.8-11.2 1.2-11.8 4.7c-.6 3.4 3.7 6.4 8.4 4.6c4.8-1.8 9.1-8.4 8.6-15.4c-.4-7.1-5.5-13.7-11.1-15.5c-5.6-1.8-10.7 1.1-11 4.5c-.3 3.4 4.2 6.3 9.3 4.4c5-1.8 9.6-8.4 9.4-15.5c-.1-7.1-5-13.7-10.3-15.6c-5.3-1.9-10.1 1-10.1 4.4c0 3.4 4.8 6.3 10.1 4.4c5.3-1.9 10.2-8.5 10.3-15.6c.2-7.1-4.4-13.7-9.4-15.5c-5.1-1.9-9.6 1-9.3 4.4c.3 3.4 5.4 6.3 11 4.5c5.6-1.8 10.7-8.4 11.1-15.5c.5-7-3.8-13.6-8.6-15.4c-4.7-1.8-9 1.2-8.4 4.6c.6 3.5 5.9 6.5 11.8 4.7c5.9-1.7 11.3-8.2 12-15.2c.7-6.9-3.4-13.4-7.8-15.1c-4.5-1.7-8.5 1.4-7.6 4.9c.8 3.6 6.4 6.7 12.5 5.1c6.2-1.7 11.9-8.1 12.8-14.9c1-6.8-2.8-13.2-7-14.8c-4.3-1.5-8 1.7-6.9 5.4c1.1 3.7 6.9 7 13.3 5.5c6.4-1.5 12.3-7.7 13.5-14.4c1.1-6.7-2.4-12.8-6.4-14.2c-4-1.4-7.5 2-6.2 5.9c1.3 3.9 7.4 7.3 14 6c6.5-1.3 12.7-7.3 14.1-13.8c1.4-6.5-2-12.5-5.8-13.6c-3.8-1.2-7.1 2.4-5.6 6.5c1.5 4.1 7.7 7.8 14.5 6.7c6.8-1.1 13.1-6.9 14.6-13.1c1.6-6.3-1.6-12-5.2-13c-3.6-.9-6.8 2.9-5.1 7.2c1.6 4.4 8 8.3 14.9 7.5c6.9-.9 13.4-6.4 15.1-12.4c1.7-6-1.4-11.5-4.9-12.2c-3.5-.7-6.5 3.4-4.8 8c1.8 4.6 8.3 8.8 15.3 8.2c7.1-.6 13.6-5.9 15.4-11.6c1.8-5.7-1.1-10.9-4.6-11.4c-3.4-.4-6.3 4-4.5 8.9c1.8 4.9 8.4 9.3 15.5 9c7.1-.3 13.7-5.3 15.6-10.7c1.8-5.5-1.1-10.4-4.5-10.6c-3.4-.1-6.3 4.5-4.4 9.7c1.9 5.2 8.5 9.9 15.6 9.9c7.1 0 13.7-4.7 15.6-9.9c1.9-5.2-1-9.8-4.4-9.7c-3.4 .2-6.3 5.1-4.5 10.6c1.9 5.4 8.5 10.4 15.6 10.7c7.1 .3 13.7-4.1 15.5-9c1.8-4.9-1.1-9.3-4.5-8.9c-3.5 .5-6.4 5.7-4.6 11.4c1.8 5.7 8.3 11 15.4 11.6c7 .6 13.5-3.6 15.3-8.2c1.7-4.6-1.3-8.7-4.8-8c-3.5 .7-6.6 6.2-4.9 12.2c1.7 6 8.2 11.5 15.1 12.4c6.9 .8 13.3-3.1 14.9-7.5c1.7-4.3-1.5-8.1-5.1-7.2c-3.6 1-6.8 6.7-5.2 13c1.5 6.2 7.8 12 14.6 13.1c6.8 1.1 13-2.6 14.5-6.7c1.5-4.1-1.8-7.7-5.6-6.5c-3.8 1.1-7.2 7.1-5.8 13.6c1.4 6.5 7.6 12.5 14.1 13.8c6.6 1.3 12.7-2.1 14-6c1.3-3.9-2.2-7.3-6.2-5.9c-4 1.4-7.5 7.5-6.4 14.2c1.2 6.7 7.1 12.9 13.5 14.4c6.4 1.5 12.2-1.8 13.3-5.5c1.1-3.7-2.6-6.9-6.9-5.4c-4.2 1.6-8 8-7 14.8c.9 6.8 6.6 13.2 12.8 14.9c6.1 1.6 11.7-1.5 12.5-5.1c.9-3.5-3.1-6.6-7.6-4.9c-4.4 1.7-8.5 8.2-7.8 15.1c.7 7 6.1 13.5 12 15.2c5.9 1.8 11.2-1.2 11.8-4.7c.6-3.4-3.7-6.4-8.4-4.6c-4.8 1.8-9.1 8.4-8.6 15.4c.4 7.1 5.5 13.7 11.1 15.5c5.6 1.8 10.7-1.1 11-4.5c.3-3.4-4.2-6.3-9.3-4.4c-5 1.8-9.6 8.4-9.4 15.5c.1 7.1 5 13.7 10.3 15.6c5.3 1.9 10.1-1 10.1-4.4zM158.6 3.3c-.3-4.7-6.5-8.7-13.2-6.7c-6.7 2.1-12.7 10.1-12.7 18.5c-.1 8.5 5.9 16.2 12.2 17.9c6.3 1.6 11.9-2.7 11.4-7.4c-.5-4.8-7-8.8-14-6.8c-7 2-13.3 9.9-13.6 18.3c-.3 8.4 5.3 16.1 11.4 17.7c6 1.6 11.3-2.8 10.5-7.6c-.7-4.8-7.5-8.9-14.8-7c-7.3 1.9-13.8 9.8-14.4 18.1c-.6 8.3 4.8 15.8 10.6 17.3c5.8 1.5 10.8-2.9 9.8-7.9c-1.1-4.9-8.1-9.1-15.6-7.4c-7.6 1.8-14.4 9.6-15.2 17.7c-.8 8.2 4.3 15.6 9.8 17c5.6 1.4 10.4-3.3 9.1-8.4c-1.3-5.1-8.6-9.4-16.4-7.8c-7.7 1.6-14.8 9.2-15.8 17.2c-1.1 8 3.8 15.2 9.1 16.4c5.4 1.2 9.9-3.6 8.4-8.9c-1.5-5.3-9-9.8-16.9-8.4c-8 1.4-15.3 8.8-16.5 16.6c-1.3 7.8 3.4 14.8 8.6 15.8c5.1 1 9.5-4 7.8-9.5c-1.7-5.5-9.4-10.3-17.5-9.1c-8.2 1.2-15.6 8.3-17 15.9c-1.4 7.6 3.1 14.4 8.1 15.1c4.9 .8 9.1-4.5 7.3-10.2c-1.8-5.8-9.6-10.8-17.9-9.9c-8.3 1-15.9 7.9-17.4 15.2c-1.6 7.3 2.8 13.8 7.7 14.3c4.8 .5 8.9-5 7-11c-1.9-6-9.9-11.3-18.3-10.6c-8.3 .6-16 7.3-17.6 14.3c-1.7 7.1 2.6 13.3 7.4 13.5c4.8 .3 8.8-5.5 6.8-11.8c-2-6.3-10-11.9-18.4-11.5c-8.5 .4-16.2 6.8-17.9 13.5c-1.7 6.8 2.6 12.8 7.3 12.7c4.8-.1 8.8-6.2 6.7-12.7c-2-6.6-10-12.5-18.5-12.3c-8.4 .1-16.1 6.1-17.8 12.6c-1.7 6.5 2.6 12.2 7.3 11.8c4.7-.3 8.7-6.7 6.7-13.5c-2-6.9-10-13-18.4-13.2c-8.4-.2-16.1 5.6-17.8 11.8c-1.6 6.2 2.7 11.6 7.5 11c4.8-.7 8.9-7.3 6.9-14.4c-1.9-7.2-9.9-13.6-18.2-14c-8.4-.5-16 5-17.6 10.9c-1.5 6 2.9 11.1 7.8 10.2c4.9-.9 9-7.8 7.2-15.2c-1.9-7.4-9.7-14.1-17.9-14.8c-8.3-.7-15.8 4.5-17.2 10.2c-1.5 5.7 3.1 10.5 8.1 9.4c5-1.2 9.3-8.3 7.6-16c-1.7-7.6-9.4-14.6-17.5-15.5c-8.1-1-15.4 4.1-16.7 9.5c-1.3 5.4 3.5 10.1 8.6 8.7c5.2-1.4 9.7-8.8 8.2-16.7c-1.6-7.9-9-15-17-16.2c-7.9-1.1-15 3.7-16.1 8.9c-1.1 5.2 3.8 9.7 9.2 8.1c5.4-1.6 10.1-9.2 8.8-17.3c-1.3-8-8.6-15.4-16.3-16.7c-7.7-1.4-14.6 3.3-15.5 8.3c-.8 5 4.3 9.3 9.9 7.6c5.6-1.8 10.6-9.5 9.5-17.8c-1.1-8.2-8.1-15.7-15.6-17.2c-7.4-1.5-14.1 3-14.7 7.9c-.6 4.9 4.8 9.1 10.6 7.2c5.9-1.9 11.1-9.8 10.3-18.1c-.9-8.4-7.6-16-14.8-17.6c-7.2-1.6-13.6 2.8-13.9 7.6c-.4 4.8 5.3 8.8 11.4 6.9c6.2-2 11.6-10 11-18.4c-.5-8.4-7-16.1-13.9-17.8c-6.9-1.7-13 2.6-13.1 7.4c-.1 4.7 5.9 8.7 12.3 6.7c6.4-2 12.2-10 11.9-18.5c-.3-8.4-6.5-16.2-13.1-17.9c-6.6-1.7-12.5 2.6-12.3 7.4c.3 4.7 6.5 8.7 13.2 6.7c6.7-2.1 12.7-10.1 12.7-18.5c.1-8.5-5.9-16.2-12.2-17.9c-6.3-1.6-11.9 2.7-11.4 7.4c.5 4.8 7 8.8 14 6.8c7-2 13.3-9.9 13.6-18.3c.3-8.4-5.3-16.1-11.4-17.7c-6-1.6-11.3 2.8-10.5 7.6c.7 4.8 7.5 8.9 14.8 7c7.3-1.9 13.8-9.8 14.4-18.1c.6-8.3-4.8-15.8-10.6-17.3c-5.8-1.5-10.8 2.9-9.8 7.9c1.1 4.9 8.1 9.1 15.6 7.4c7.6-1.8 14.4-9.6 15.2-17.7c.8-8.2-4.3-15.6-9.8-17c-5.6-1.4-10.4 3.3-9.1 8.4c1.3 5.1 8.6 9.4 16.4 7.8c7.7-1.6 14.8-9.2 15.8-17.2c1.1-8-3.8-15.2-9.1-16.4c-5.4-1.2-9.9 3.6-8.4 8.9c1.5 5.3 9 9.8 16.9 8.4c8-1.4 15.3-8.8 16.5-16.6c1.3-7.8-3.4-14.8-8.6-15.8c-5.1-1-9.5 4-7.8 9.5c1.7 5.5 9.4 10.3 17.5 9.1c8.2-1.2 15.6-8.3 17-15.9c1.4-7.6-3.1-14.4-8.1-15.1c-4.9-.8-9.1 4.5-7.3 10.2c1.8 5.8 9.6 10.8 17.9 9.9c8.3-1 15.9-7.9 17.4-15.2c1.6-7.3-2.8-13.8-7.7-14.3c-4.8-.5-8.9 5-7 11c1.9 6 9.9 11.3 18.3 10.6c8.3-.6 16-7.3 17.6-14.3c1.7-7.1-2.6-13.3-7.4-13.5c-4.8-.3-8.8 5.5-6.8 11.8c2 6.3 10 11.9 18.4 11.5c8.5-.4 16.2-6.8 17.9-13.5c1.7-6.8-2.6-12.8-7.3-12.7c-4.8 .1-8.8 6.2-6.7 12.7c2 6.6 10 12.5 18.5 12.3c8.4-.1 16.1-6.1 17.8-12.6c1.7-6.5-2.6-12.2-7.3-11.8c-4.7 .3-8.7 6.7-6.7 13.5c2 6.9 10 13 18.4 13.2c8.4 .2 16.1-5.6 17.8-11.8c1.6-6.2-2.7-11.6-7.5-11c-4.8 .7-8.9 7.3-6.9 14.4c1.9 7.2 9.9 13.6 18.2 14c8.4 .5 16-5 17.6-10.9c1.5-6-2.9-11.1-7.8-10.2c-4.9 .9-9 7.8-7.2 15.2c1.9 7.4 9.7 14.1 17.9 14.8c8.3 .7 15.8-4.5 17.2-10.2c1.5-5.7-3.1-10.5-8.1-9.4c-5 1.2-9.3 8.3-7.6 16c1.7 7.6 9.4 14.6 17.5 15.5c8.1 1 15.4-4.1 16.7-9.5c1.3-5.4-3.5-10.1-8.6-8.7c-5.2 1.4-9.7 8.8-8.2 16.7c1.6 7.9 9 15 17 16.2c7.9 1.1 15-3.7 16.1-8.9c1.1-5.2-3.8-9.7-9.2-8.1c-5.4 1.6-10.1 9.2-8.8 17.3c1.3 8 8.6 15.4 16.3 16.7c7.7 1.4 14.6-3.3 15.5-8.3c.8-5-4.3-9.3-9.9-7.6c-5.6 1.8-10.6 9.5-9.5 17.8c1.1 8.2 8.1 15.7 15.6 17.2c7.4 1.5 14.1-3 14.7-7.9c.6-4.9-4.8-9.1-10.6-7.2c-5.9 1.9-11.1 9.8-10.3 18.1c.9 8.4 7.6 16 14.8 17.6c7.2 1.6 13.6-2.8 13.9-7.6c.4-4.8-5.3-8.8-11.4-6.9c-6.2 2-11.6 10-11 18.4c.5 8.4 7 16.1 13.9 17.8c6.9 1.7 13-2.6 13.1-7.4c.1-4.7-5.9-8.7-12.3-6.7c-6.4 2-12.2 10-11.9 18.5c.3 8.4 6.5 16.2 13.1 17.9c6.6 1.7 12.5-2.6 12.3-7.4z'/%3E%3Ccircle r='160'/%3E%3Ccircle r='164'/%3E%3C/svg%3E");
  /* الختم — حلقتان ونصٌّ على قوس ووردةٌ صغيرة في القلب */
  --seal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23DDB665'%3E%3Cdefs%3E%3Cpath id='a' d='M50 50m-37 0a37 37 0 1 1 74 0a37 37 0 1 1-74 0'/%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='47' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='44' stroke-width='.8' stroke-dasharray='1.5 2'/%3E%3Ccircle cx='50' cy='50' r='29' stroke-width='1'/%3E%3Ctext fill='%23DDB665' stroke='none' font-family='Consolas,monospace' font-size='7.2' letter-spacing='1.55'%3E%3CtextPath href='%23a'%3ELINAMARA %C2%B7 AAMAL %C2%B7 OFFICIAL LEDGER %C2%B7%3C/textPath%3E%3C/text%3E%3Cpath stroke-width='.55' d='M70 50L69.6 48.1L68.3 46.5L66.3 45.4L63.9 45.1L61.4 45.7L59 47.1L57 49.2L55.7 51.9L55.2 54.8L55.5 57.7L56.7 60.2L58.4 62.1L60.5 63.3L62.7 63.6L64.7 63L66.2 61.8L66.9 59.9L66.9 57.9L65.9 55.9L64.1 54.2L61.8 53.2L59 52.9L56.1 53.5L53.5 54.9L51.4 56.9L50 59.5L49.4 62.2L49.7 64.8L50.7 66.9L52.3 68.5L54.2 69.2L56.2 69L57.9 68L59 66.3L59.4 64.1L58.9 61.7L57.6 59.5L55.6 57.6L52.9 56.4L50 56L47.1 56.4L44.4 57.6L42.4 59.5L41.1 61.7L40.6 64.1L41 66.3L42.1 68L43.8 69L45.8 69.2L47.7 68.5L49.3 66.9L50.3 64.8L50.6 62.2L50 59.5L48.6 56.9L46.5 54.9L43.9 53.5L41 52.9L38.2 53.2L35.9 54.2L34.1 55.9L33.1 57.9L33.1 59.9L33.8 61.8L35.3 63L37.3 63.6L39.5 63.3L41.6 62.1L43.3 60.2L44.5 57.7L44.8 54.8L44.3 51.9L43 49.2L41 47.1L38.6 45.7L36.1 45.1L33.7 45.4L31.7 46.5L30.4 48.1L30 50L30.4 51.9L31.7 53.5L33.7 54.6L36.1 54.9L38.6 54.3L41 52.9L43 50.8L44.3 48.1L44.8 45.2L44.5 42.3L43.3 39.8L41.6 37.9L39.5 36.7L37.3 36.4L35.3 37L33.8 38.2L33.1 40.1L33.1 42.1L34.1 44.1L35.9 45.8L38.2 46.8L41 47.1L43.9 46.5L46.5 45.1L48.6 43.1L50 40.5L50.6 37.8L50.3 35.2L49.3 33.1L47.7 31.5L45.8 30.8L43.8 31L42.1 32L41 33.7L40.6 35.9L41.1 38.3L42.4 40.5L44.4 42.4L47.1 43.6L50 44L52.9 43.6L55.6 42.4L57.6 40.5L58.9 38.3L59.4 35.9L59 33.7L57.9 32L56.2 31L54.2 30.8L52.3 31.5L50.7 33.1L49.7 35.2L49.4 37.8L50 40.5L51.4 43.1L53.5 45.1L56.1 46.5L59 47.1L61.8 46.8L64.1 45.8L65.9 44.1L66.9 42.1L66.9 40.1L66.2 38.2L64.7 37L62.7 36.4L60.5 36.7L58.4 37.9L56.7 39.8L55.5 42.3L55.2 45.2L55.7 48.1L57 50.8L59 52.9L61.4 54.3L63.9 54.9L66.3 54.6L68.3 53.5L69.6 51.9L70 50z'/%3E%3Ccircle cx='50' cy='50' r='2.2' fill='%23DDB665' stroke='none'/%3E%3C/svg%3E");

  --topbar-h: 62px;
  --ai-w: 460px;
  color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════
   ورق الأمان — المظهر الافتراضي
   ───────────────────────────────────────────────────────────
   ورقٌ مائل للرماديّ الأخضر، ورقةٌ أبيض منها للبطاقات، حبرٌ كحليّ
   (‎#14294C‎ — لون الشعار) للنصّ والبنية، وذهبٌ داكن (‎#82600F‎) حين يكون
   الذهب نصّاً كي يمرّ تباين AA؛ الرقاقة الفاتحة (‎#B4862C‎) للخطوط فقط.
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --ink-990: #EDF0EF;   /* ورق الأمان */
  --ink-950: #FAFBFA;   /* الإطار */
  --ink-900: #FFFFFF;
  --ink-870: #FFFFFF;   /* البطاقة */
  --ink-840: #F3F5F4;
  --ink-820: #F2F4F3;
  --ink-800: #EEF1F0;
  --ink-760: #DCE1E6;   /* شعرة */
  --ink-720: #C3CCD5;   /* حدّ البطاقة */
  --rule-strong: #14294C;

  --field:      #FFFFFF;
  --field-edge: #C3CCD5;
  --field-line: #7D8BA1;

  --solid: #14294C; --solid-hover: #1D3A69; --on-solid: #FFFFFF;

  /* الكحليّ — يقرؤه ما بقي من قواعد المظهر الفاتح */
  --navy:      #14294C;
  --navy-2:    #1D3A69;
  --navy-3:    #2B5490;
  --navy-soft: rgba(20,41,76,.07);
  --navy-line: rgba(20,41,76,.18);
  --on-navy:   #FFFFFF;

  --gold:       #82600F;
  --gold-brand: #B4862C;
  --gold-deep:  #6E510C;
  --gold-soft:  rgba(180,134,44,.14);
  --gold-line:  rgba(180,134,44,.42);
  --on-gold:    #FFFDF6;

  --tx:   #14294C;
  --tx-2: #3D4E6C;
  --tx-3: #56657E;

  --profit: #1A6A4B; --profit-soft: rgba(26,106,75,.10);
  --loss:   #A3271F; --loss-soft:   rgba(163,39,31,.08);
  --danger: #A3271F; --danger-soft: rgba(163,39,31,.08);
  --warn:   #875806; --warn-soft:   rgba(135,88,6,.10);
  --info:   #24548A; --info-soft:   rgba(36,84,138,.09);
  --purple: #5A3F9E; --purple-soft: rgba(90,63,158,.09);

  --note: #14294C;

  --sh-1: 0 1px 0 rgba(20,41,76,.05);
  --sh-2: 0 1px 0 rgba(20,41,76,.05), 0 10px 26px -16px rgba(20,41,76,.40);
  --sh-3: 0 1px 0 rgba(20,41,76,.05), 0 14px 34px -22px rgba(20,41,76,.45);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--ink-990);
  color: var(--tx);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--tx-3); font-size: .875em; }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num   { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable { cursor: pointer; }
.spacer { flex: 1; }
.center { text-align: center; }
.end { text-align: end; }
.nowrap { white-space: nowrap; }
.pos { color: var(--profit); }
.neg { color: var(--loss); }
.dim { opacity: .5; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-720); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }
:focus-visible { outline: 2px solid var(--gold-brand); outline-offset: 2px; border-radius: 2px; }

/* الروابط داخل النصّ بالحبر نفسه وخطٍّ رقيق تحتها — لا أزرق المتصفّح
   الذي يختفي على الداكن. كل ما له صنفٌ (زرّ، بلاطة، تبويب) يغلب هذا. */
a { color: var(--tx); text-decoration-color: var(--ink-720); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold-brand); }

/* الأرقام المحفورة: خطٌّ مذيَّل بأرقامٍ مصطفّة متساوية العرض */
.fig { font-family: var(--f-fig); font-variant-numeric: lining-nums tabular-nums; }

/* ═══ الدخول — ورقةٌ رسمية تُفتح ═══════════════════════
   نصفٌ كحليّ محفور (وردة غيلوشيه ساكنة، إطاران، سطر طباعة دقيقة)
   ونصفٌ ورقيّ حقوله على سطر — استمارةٌ تُملأ لا صناديق تُنقَر. */
.login {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  height: 100vh; height: 100dvh; overflow-y: auto; background: var(--ink-950);
}
.login-art {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(36px, 5vw, 64px) clamp(30px, 4.6vw, 60px) clamp(48px, 6vw, 72px);
  background: var(--rosette) right -190px top -210px / 640px 640px no-repeat, var(--note);
  color: var(--note-ink);
}
[dir="ltr"] .login-art { background-position: left -190px top -210px, 0 0; }
/* الإطار المزدوج: خطٌّ متّصل وآخر متقطّع داخله */
.login-art::before {
  content: ''; position: absolute; inset: 12px; pointer-events: none;
  border: 1px solid var(--note-art); outline: 1px dashed rgba(214,176,96,.16); outline-offset: -5px;
}
/* سطر الطباعة الدقيقة — كما على ظهر الشيك */
.login-art::after, .exec-band::after {
  content: 'LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER · LINAMARA · SYRIA · AAMAL · LEDGER ·' / '';
  position: absolute; inset-inline: 24px; bottom: 20px; height: 9px; overflow: hidden;
  white-space: nowrap; direction: ltr; pointer-events: none;
  font: 500 6.5px/9px var(--mono); letter-spacing: .14em; color: var(--note-foil); opacity: .55;
}
.login-art-text { position: relative; z-index: 1; max-width: 480px; }
.login-logo { height: 40px; margin-bottom: 26px; filter: brightness(0) invert(1); opacity: .95; }
.login-art h1 { font-family: var(--f-display); font-size: clamp(2.6rem, 4.4vw, 3.5rem); font-weight: 600; line-height: 1.05; }
.login-art-text > p { color: var(--note-foil); font-size: 1rem; margin-top: 10px; font-weight: 500; }
.login-features { list-style: none; margin-top: 26px; display: grid; gap: 10px; }
.login-features li { position: relative; padding-inline-start: 20px; color: var(--note-ink-2); font-size: .9rem; line-height: 1.65; }
.login-features li::before {
  content: ''; position: absolute; inset-inline-start: 1px; top: .62em; width: 6px; height: 6px;
  transform: rotate(45deg); border: 1px solid var(--note-foil);
}
.login-form-wrap { position: relative; display: grid; place-items: center; padding: 32px 28px; background: var(--ink-950); }
.login-form { width: min(380px, 100%); }
.login-form h2 { font-family: var(--f-display); font-size: 2.4rem; font-weight: 600; line-height: 1.1; }
.login-form > .muted { margin: 4px 0 30px; display: block; }
.login-form .field { margin-bottom: 20px; }
.login-form input {
  padding: 10px 2px; font-size: 1rem; border: 0; border-bottom: 1px solid var(--tx-3);
  border-radius: 0; background: transparent;
}
.login-form input:focus {
  background: transparent; border-bottom-color: var(--gold-brand);
  box-shadow: inset 0 -1px 0 var(--gold-brand);
}
.login-form .btn.primary { margin-top: 8px; padding: 12px 20px; font-size: 1rem; }
.login-hint { margin-top: 20px; text-align: center; font-size: .8rem; }
/* تسخينٌ صامت للخطّين اللذين لا تستعملهما هذه الشاشة: الأرقام المحفورة
   للوحة القيادة، والرقعة لتحيّة الترحيب — فلا يتبدّل الخطّ أمام العين
   في أول ثانية بعد الدخول. نصٌّ شفّاف بحجم بكسلين لا يقرؤه قارئ الشاشة. */
.login-form-wrap::before, .login-form-wrap::after {
  position: absolute; inset-inline-start: 0; bottom: 0; font-size: 2px; line-height: 1;
  opacity: 0; pointer-events: none; overflow: hidden;
}
.login-form-wrap::before { content: '0123456789' / ''; font-family: var(--f-fig); font-weight: 500; }
.login-form-wrap::after { content: 'أهلاً Welcome' / ''; font-family: var(--f-hand); font-weight: 700; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art {
    padding: 30px 26px 42px;
    background-size: 520px 520px, auto; background-position: right -200px top -230px, 0 0;
  }
  [dir="ltr"] .login-art { background-position: left -200px top -230px, 0 0; }
  .login-logo { height: 30px; margin-bottom: 14px; }
  .login-art h1 { font-size: 2.3rem; }
  .login-features { display: none; }
  .login-form-wrap { place-items: start center; padding: 30px 22px 36px; }
}

/* ═══ الهيكل ════════════════════════════════════════════ */
.app { height: 100vh; padding: 12px; }
@media (max-width: 720px) { .app { padding: 0; } }

.frame {
  height: 100%; background: var(--ink-950); border-radius: var(--frame-r);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--ink-720); box-shadow: var(--sh-3);
}
@media (max-width: 720px) { .frame { border-radius: 0; border: none; } }

/* الترويسة: شعرةٌ تحتها لا ظلّ؛ الهوية مفصولة عن التنقّل بشعرة أخرى */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: var(--topbar-h);
  flex-shrink: 0; border-bottom: 1px solid var(--ink-760);
}
.brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding-inline-end: 16px; border-inline-end: 1px solid var(--ink-760);
}
.brand-logo { height: 21px; filter: brightness(0) invert(1); opacity: .92; }
[data-theme="light"] .brand-logo { filter: none; opacity: 1; }
.brand-name { font-family: var(--f-display); font-size: 1.36rem; font-weight: 600; line-height: 1; color: var(--gold); }
@media (max-width: 1240px) { .brand-name { display: none; } }

/* التنقّل: كلماتٌ على السطر، والنشط تحته خطّان ذهبيّان — خطّ المجموع
   في الدفتر. لا حبّة ملوّنة. */
.pillnav {
  display: flex; align-items: center; gap: 2px; padding: 0;
  background: transparent; border: 0; overflow-x: auto; scrollbar-width: none;
}
.pillnav::-webkit-scrollbar { display: none; }
.pillnav a {
  padding: 9px 12px 11px; border-radius: 2px; font-size: .9rem; font-weight: 500;
  color: var(--tx-2); text-decoration: none; white-space: nowrap;
  /* لونٌ وخلفية فقط — «all» كان يحرّك موضع الخطّ الذهبي فيطير من زاوية الزرّ */
  transition: color .16s, background-color .16s;
  display: flex; align-items: center; gap: 6px;
  /* الكلمات الإنجليزية أطول من العربية، والعنصر المرن ينكمش حتى تُقصّ
     إلى حرفين. المنع هنا يجعل الشريط ينزلق بدل أن يمسخ الأسماء. */
  flex: 0 0 auto;
}
.pillnav a:hover { color: var(--tx); background: var(--ink-840); }
/* المختار بوزن خطّ جيرانه نفسه: الخطّ الأثخن كان يعرّض الزرّ فيزيح الشريط كلّه
   بكسلين أو ثلاثة مع كل انتقال. يميّزه اللون والخطّان الذهبيّان، وظلٌّ رقيق
   يثخّن الحروف بصرياً دون أن يغيّر عرضها. */
.pillnav a.active, .pillnav a.active:hover {
  color: var(--tx); text-shadow: .35px 0 0 currentColor;
  background:
    linear-gradient(var(--gold-brand) 0 0) 50% 100% / calc(100% - 20px) 2px no-repeat,
    linear-gradient(var(--gold-brand) 0 0) 50% calc(100% - 4px) / calc(100% - 20px) 1px no-repeat;
}
.pill-badge {
  font-family: var(--f-fig); font-variant-numeric: lining-nums tabular-nums;
  font-size: .74rem; font-weight: 600; line-height: 1.55; padding: 0 5px; border-radius: 999px;
  background: transparent; border: 1px solid var(--ink-720); color: var(--tx-2); min-width: 20px; text-align: center;
}
.pillnav a.active .pill-badge { color: var(--gold); border-color: var(--gold-line); }
.pill-badge:empty { display: none; }

.rail { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.rail-btn {
  width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--ink-760); border-radius: var(--r-sm);
  color: var(--tx-2); font-size: 1rem; cursor: pointer; transition: all .16s;
  position: relative; text-decoration: none;
}
.rail-btn:hover { background: var(--ink-840); color: var(--tx); border-color: var(--ink-720); }
.rail-btn.active { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.rail-btn .dot {
  position: absolute; top: 3px; inset-inline-end: 3px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--ink-950);
}
/* ═══ زرّ «كل الأقسام» ═══
   كان الشريط الثانوي هنا: أربعةَ عشرَ رمزاً تنحسر تدريجياً مع ضيق
   الشاشة، وزرُّ «كل الأقسام» يُبرَز ذهبياً حين تختفي. انتقلت الأقسام
   إلى شبكةٍ فوق لوحة القيادة، فحُذفت قواعدُ الانحسار — وحُذف معها
   الإبراز الذهبيّ: شرطُه زال، والزرّ صار يحمل اسمه فيُرى بلا لون. */

/* الحساب: قرصٌ بلون صاحبه (يضعه app.js من إعداداته) داخل حلقة رقائق —
   كالعملة المسكوكة. الحرفان بالحبر الكحليّ فوق ألوان الأقراص الفاتحة. */
.avatar-btn {
  width: 37px; height: 37px; flex: 0 0 37px; border-radius: 50%; border: 1px solid var(--gold-brand);
  display: grid; place-items: center; background: var(--gold-brand); color: #14294C;
  box-shadow: inset 0 0 0 2px var(--ink-950);
  font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; line-height: 1;
  cursor: pointer; transition: filter .16s;
}
.avatar-btn:hover { filter: brightness(1.07); }

.page { flex: 1; overflow-y: auto; padding: 14px 24px 26px; }
@media (max-width: 720px) { .page { padding: 10px 14px 18px; } }

.page-head { display: flex; align-items: center; gap: 14px; padding: 10px 0 20px; flex-wrap: wrap; }
.page-back {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--ink-720); border-radius: var(--r-sm);
  color: var(--tx-2); cursor: pointer; font-size: 1.05rem; transition: all .16s;
}
.page-back:hover { background: var(--ink-840); color: var(--tx); }
/* العناوين بخطّ العرض المذيَّل — أصغر عيناً من خطّ الواجهة فيُكبَّر */
.page-title { font-family: var(--f-display); font-size: clamp(2.1rem, 3.6vw, 2.75rem); font-weight: 600; line-height: 1.05; }
.page-sub { font-size: .84rem; color: var(--tx-3); margin-top: 4px; }
.page-head .actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ═══ البطاقات ══════════════════════════════════════════ */
.card { background: var(--ink-870); border: 1px solid var(--ink-720); border-radius: var(--r-lg); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.card-head h3, .card-head h2 { font-family: var(--f-display); font-size: 1.42rem; font-weight: 600; line-height: 1.2; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 12px; }

.section { margin-bottom: 16px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--f-display); font-size: 1.62rem; font-weight: 600; line-height: 1.2; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* minmax(0,…): حقلٌ عريض المحتوى (قائمة باسمٍ طويل) لا يدفع جيرانه خارج النافذة */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── شريط الإحصاءات ──────────────────────────────────── */
/* سطرٌ من دفتر: الخلايا متجاورة تفصلها شعرة (ظلّ بكسلٍ واحد يتراكب في
   فجوة البكسل)، فلا يبقى خطٌّ معلّق حين تلتفّ الخلايا إلى سطرين. */
.stat-strip {
  background: var(--ink-870); border: 1px solid var(--ink-720); border-radius: var(--r-xl);
  padding: 0; overflow: hidden;
}
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 1px; }
.stat { min-width: 0; padding: 15px 20px 14px; box-shadow: 0 0 0 1px var(--ink-760); }
.stat-label { font-size: .8rem; font-weight: 500; color: var(--tx-3); margin-bottom: 2px; }
.stat-value {
  font-family: var(--f-fig); font-size: clamp(1.45rem, 2.2vw, 2.05rem); font-weight: 500;
  line-height: 1.15; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-value .cur { font-family: var(--font); font-size: .4em; font-weight: 500; color: var(--tx-3); letter-spacing: 0; }
.stat-value.accent { color: var(--gold); }
.stat-value.profit { color: var(--profit); }
.stat-value.loss { color: var(--loss); }
.stat-note {
  font-size: .76rem; color: var(--tx-2); margin-top: 6px; padding-top: 6px;
  border-top: 1px dotted var(--ink-720);
}
@media (max-width: 460px) {
  .stat { padding: 13px 14px 12px; }
  .stat-value { font-size: 1.35rem; }
}

/* المقارنة تحت الأرقام: حبرٌ مصمَت ثم تظليل حفر — لا ألوانٌ متعدّدة؛
   والرقاقة الذهبية للربح وحده */
.track-row { display: flex; gap: 14px; margin-top: 0; padding: 14px 20px 16px; border-top: 1px solid var(--ink-720); }
.track { flex: 1; min-width: 30px; }
.track-label { font-size: .74rem; color: var(--tx-3); margin-bottom: 6px; }
.track-bar { height: 10px; border-radius: 0; background: var(--ink-840); overflow: hidden; }
.track-bar i { display: block; height: 100%; background: var(--tx); border-radius: 0; transition: width .5s; }
.track:nth-child(2) .track-bar i {
  background: repeating-linear-gradient(-45deg, var(--tx-2) 0 1.2px, transparent 1.2px 4px);
  box-shadow: inset 0 0 0 1px var(--tx-2);
}
.track:nth-child(3) .track-bar i {
  background: repeating-linear-gradient(0deg, var(--tx-3) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 1px var(--tx-3);
}
.track:nth-child(4) .track-bar i {
  background: repeating-linear-gradient(45deg, var(--gold-brand) 0 1.6px, var(--gold-soft) 1.6px 5px);
  box-shadow: inset 0 0 0 1px var(--gold-brand);
}

/* ═══ الأزرار ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--r-pill); font-family: inherit; font-size: .87rem;
  font-weight: 500; cursor: pointer; transition: all .16s; white-space: nowrap;
  background: var(--ink-870); border: 1px solid var(--ink-720); color: var(--tx); text-decoration: none;
}
.btn:hover { background: var(--ink-840); border-color: var(--tx-3); }
/* الأساسيّ بلون الحبر: كحليّ على الورق، عاجيّ في الخزنة */
.btn.primary { background: var(--solid); border-color: var(--solid); color: var(--on-solid); font-weight: 600; }
.btn.primary:hover { background: var(--solid-hover); border-color: var(--solid-hover); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--ink-950); }
.btn.ok { background: var(--profit-soft); border-color: var(--profit); color: var(--profit); }
.btn.ok:hover { background: var(--profit); color: var(--ink-950); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--ink-840); }
.btn.sm { padding: 5px 11px; font-size: .8rem; }
.btn.lg { padding: 11px 22px; font-size: .95rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: transparent; border: none; color: var(--tx-2); cursor: pointer;
  font-size: .95rem; transition: all .14s;
}
.icon-btn:hover { background: var(--ink-840); color: var(--tx); }

.seg {
  display: inline-flex; padding: 3px; background: var(--ink-870);
  border: 1px solid var(--ink-720); border-radius: var(--r-pill); gap: 2px;
}
.seg button {
  padding: 5px 13px; border-radius: var(--r-pill); border: none; background: transparent;
  color: var(--tx-2); font-family: inherit; font-size: .82rem; cursor: pointer;
  transition: all .16s; display: flex; align-items: center; gap: 5px;
}
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--solid); color: var(--on-solid); font-weight: 600; }
.seg button .cnt { font-size: .72rem; opacity: .75; }

/* ═══ الحقول ════════════════════════════════════════════ */
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: .81rem; font-weight: 500; color: var(--tx-2); margin-bottom: 6px; }

/* صفّ حقول أفقيّ فيه زرّ.
   المحاذاة من الأعلى: التسميات كلها سطر واحد فتصطفّ، وتصطفّ المدخلات
   تحتها. لو حوذي من الأسفل، ارتفع صندوقُ أيّ حقل تحته تلميح فوق أخوته.
   والزرّ بلا تسمية، فيُزاح بمقدار سطر التسمية ليجلس على خطّ المدخلات. */
.form-row { align-items: start; }
.form-row-btn { margin-top: calc(.81rem * 1.4 + 9px); align-self: start; }
/* الحقل: صندوقٌ خافت فوق سطرٍ أوضح — سطر الاستمارة الذي يُكتب عليه */
input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm); font-family: inherit; font-size: .88rem;
  background: var(--field); border: 1px solid var(--field-edge); border-bottom-color: var(--field-line);
  color: var(--tx); transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold-brand); background: var(--field);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
input::placeholder, textarea::placeholder { color: var(--tx-3); }
select { cursor: pointer; }
input[type=date] { color-scheme: dark; }
[data-theme="light"] input[type=date] { color-scheme: light; }
textarea { resize: vertical; line-height: 1.65; }
input[type=range] { padding: 0; background: transparent; border: none; accent-color: var(--gold); }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select, .toolbar input[type=date] {
  width: auto; min-width: 130px; padding: 7px 12px; font-size: .84rem; border-radius: var(--r-pill);
  background: var(--field);
}
.filters-label { font-size: .86rem; color: var(--tx-2); display: flex; align-items: center; gap: 8px; }

/* ═══ الشارات ═══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 2px;
  font-size: .74rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--ink-840); color: var(--tx-2); border: 1px solid transparent;
}
/* الحالة الموجبة ختمٌ مضغوط: إطارٌ مزدوج بلا تعبئة. الحشوة أقلّ بقدر
   الإطار فيبقى ارتفاع الشارات واحداً في الصفّ. */
.badge.ok     { background: transparent; color: var(--profit); border: 3px double var(--profit); padding: 0 7px; border-radius: 3px; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn   { background: var(--warn-soft);   color: var(--warn); }
.badge.info   { background: var(--info-soft);   color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.gold   { background: var(--gold-soft);   color: var(--gold); border-color: var(--gold-line); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; color: #14294C; flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55);
}

/* ═══ الجداول ═══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th {
  text-align: start; padding: 10px 14px; font-size: .76rem; font-weight: 600; color: var(--tx-3);
  background: var(--ink-870); border-bottom: 3px double var(--ink-720); white-space: nowrap; position: sticky; top: 0;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--ink-760); vertical-align: middle; }
table.data tbody tr:hover { background: var(--ink-840); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tr.clickable { cursor: pointer; }
table.data td.n, table.data th.n { text-align: end; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
table.data td.n { font-family: var(--f-fig); font-size: 1.05em; }
/* المجموع كما في الدفتر: خطٌّ فوقه وخطّان تحته */
table.data tfoot td {
  padding: 12px 14px; font-weight: 600; border-top: 1px solid var(--rule-strong);
  border-bottom: 3px double var(--rule-strong);
  background: var(--ink-840); font-variant-numeric: lining-nums tabular-nums;
}
table.data tfoot td.n { font-family: var(--f-fig); font-size: 1.05em; }
.t-title { font-weight: 500; color: var(--tx); }
.t-sub { font-size: .78rem; color: var(--tx-3); }

.row-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 4px;
  border-bottom: 1px solid var(--ink-760);
}
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--ink-840); }

/* ═══ القوائم المالية ═══════════════════════════════════ */
.statement { max-width: 900px; }
.stmt-head { text-align: center; padding: 8px 0 20px; border-bottom: 3px double var(--ink-720); margin-bottom: 6px; }
.stmt-head h3 { font-family: var(--f-display); font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.stmt-head .sub { font-size: .86rem; color: var(--tx-3); margin-top: 4px; }
.stmt-section { margin-top: 20px; }
.stmt-section > h4 {
  font-size: .82rem; font-weight: 700; color: var(--gold); text-transform: none;
  padding: 8px 0; border-bottom: 1px solid var(--gold-line); margin-bottom: 4px;
}
.stmt-line {
  display: flex; align-items: baseline; gap: 10px; padding: 7px 0; font-size: .88rem;
  border-bottom: 1px dotted var(--ink-760);
}
.stmt-line:last-child { border-bottom: none; }
.stmt-line .lbl { flex: 1; min-width: 0; }
.stmt-line .code { font-size: .74rem; color: var(--tx-3); font-family: var(--mono); margin-inline-end: 8px; }
.stmt-line .val {
  font-family: var(--f-fig); font-variant-numeric: lining-nums tabular-nums; font-weight: 500;
  font-size: 1.04em; min-width: 120px; text-align: end;
}
.stmt-line.total {
  border-top: 1px solid var(--tx-3); border-bottom: none; margin-top: 6px;
  padding-top: 11px; font-weight: 700; font-size: .95rem;
}
.stmt-line.grand {
  border-top: 1px solid var(--rule-strong); border-bottom: 3px double var(--rule-strong);
  margin-top: 12px; padding: 12px 0; font-weight: 700; font-size: 1.04rem; color: var(--tx);
}
.stmt-line.grand .val { font-weight: 600; font-size: 1.12em; }
.stmt-line.indent .lbl { padding-inline-start: 16px; }

.balance-check {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r);
  margin-top: 18px; font-size: .87rem;
}
.balance-check.ok { background: var(--profit-soft); color: var(--profit); }
.balance-check.bad { background: var(--danger-soft); color: var(--danger); }

/* ═══ محرّر القيد ═══════════════════════════════════════ */
.jl-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.jl-table th {
  text-align: start; padding: 7px 8px; font-size: .74rem; color: var(--tx-3); font-weight: 600;
  border-bottom: 1px solid var(--ink-760);
}
.jl-table td { padding: 4px; border-bottom: 1px solid var(--ink-760); }
.jl-table input, .jl-table select { padding: 7px 9px; font-size: .84rem; border-radius: var(--r-xs); }
.jl-table td.n input { text-align: end; font-variant-numeric: tabular-nums; }
.jl-table .rm { color: var(--tx-3); }
.jl-table .rm:hover { color: var(--danger); }
.jl-foot {
  display: flex; align-items: center; gap: 18px; padding: 14px 6px 0; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.jl-total { font-size: .88rem; }
.jl-total b { font-family: var(--f-fig); font-variant-numeric: lining-nums tabular-nums; font-size: 1.12rem; font-weight: 600; margin-inline-start: 6px; }
.jl-diff.ok { color: var(--profit); }
.jl-diff.bad { color: var(--danger); font-weight: 700; }

/* ═══ التقدّم ═══════════════════════════════════════════ */
.progress { height: 7px; background: var(--ink-800); border-radius: var(--r-pill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: var(--r-pill); transition: width .45s; }
.progress i.profit { background: var(--profit); }
.progress i.loss { background: var(--loss); }
.meter { display: flex; align-items: center; gap: 9px; }
.meter .progress { flex: 1; min-width: 44px; }
.meter span { font-size: .78rem; color: var(--tx-3); font-variant-numeric: tabular-nums; min-width: 40px; }

/* ═══ التنبيهات ═════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--r); font-size: .87rem; margin-bottom: 14px;
  background: var(--ink-800); border: 1px solid var(--ink-760); line-height: 1.7;
}
.alert.ok     { background: var(--profit-soft); border-color: var(--profit); color: var(--profit); }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert.warn   { background: var(--warn-soft);   border-color: var(--warn);   color: var(--warn); }
.alert.info   { background: var(--info-soft);   border-color: var(--info);   color: var(--info); }

/* ═══ الملاحظات والمخاطر ════════════════════════════════ */
.risk {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r);
  background: var(--ink-840); border: 1px solid var(--ink-760); margin-bottom: 10px;
}
.risk.critical { border-inline-start: 3px solid var(--danger); }
.risk.warn { border-inline-start: 3px solid var(--warn); }
.risk-icon { font-size: 1.05rem; flex-shrink: 0; }
.risk.critical .risk-icon { color: var(--danger); }
.risk.warn .risk-icon { color: var(--warn); }
.risk-body { flex: 1; min-width: 0; }
.risk-title { font-weight: 600; font-size: .92rem; margin-bottom: 3px; }
.risk-detail { font-size: .85rem; color: var(--tx-2); line-height: 1.65; }

/* ═══ الخط الزمني ═══════════════════════════════════════ */
.timeline { position: relative; padding-inline-start: 20px; }
.timeline::before {
  content: ''; position: absolute; inset-inline-start: 4px; top: 5px; bottom: 5px;
  width: 1px; background: var(--ink-760);
}
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item::before {
  content: ''; position: absolute; inset-inline-start: -20px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--ink-950); border: 2px solid var(--gold);
}
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-head strong { font-size: .87rem; font-weight: 600; }
.tl-body { font-size: .85rem; color: var(--tx-2); line-height: 1.65; margin-top: 3px; white-space: pre-wrap; }

/* ═══ النوافذ ═══════════════════════════════════════════ */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(9,16,28,.6); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 18px; animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--ink-900); border: 1px solid var(--ink-760); border-radius: var(--r-lg);
  /* ‎dvh‎ = المرئيّ فعلاً على الهاتف (ومتصفّحٌ لا يعرفه يُبقي ‎vh‎ قبله). هنا في
     القاعدة الأصل لا في تجاوزٍ متأخّر: التجاوز كان يغلب قاعدة الهاتف (ملء الشاشة) */
  width: min(560px, 100%); max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column;
  box-shadow: var(--sh-3); animation: pop .18s;
}
.modal.wide { width: min(900px, 100%); }
.modal.xwide { width: min(1180px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px 14px; border-bottom: 1px solid var(--ink-720); }
.modal-head h3 { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; flex: 1; }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; align-items: center; gap: 9px; padding: 15px 24px;
  border-top: 1px solid var(--ink-760); flex-wrap: wrap;
}

/* ═══ التنبيهات المنبثقة ════════════════════════════════ */
.toast-root {
  position: fixed; inset-block-end: 22px; inset-inline-start: 22px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r);
  background: var(--ink-840); border: 1px solid var(--ink-720); color: var(--tx);
  font-size: .87rem; box-shadow: var(--sh-2); animation: slideIn .22s; max-width: 440px;
}
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } }
.toast.out { animation: fadeOut .22s forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }
.toast.ok { border-color: var(--profit); }
.toast.ok .toast-icon { color: var(--profit); }
.toast.danger { border-color: var(--danger); }
.toast.danger .toast-icon { color: var(--danger); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }

/* ═══ لوحة مدد ══════════════════════════════════════════ */
.ai-panel {
  position: fixed; inset-block: 14px; inset-inline-end: 14px; width: var(--ai-w);
  max-width: calc(100vw - 28px); background: var(--ink-900); border: 1px solid var(--ink-760);
  border-radius: var(--r-lg); display: flex; flex-direction: column; box-shadow: var(--sh-3);
  z-index: 150; transform: translateX(-110%); opacity: 0; pointer-events: none; transition: all .24s;
}
[dir="rtl"] .ai-panel { transform: translateX(-110%); }
.ai-panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
@media (max-width: 720px) { .ai-panel { inset: 0; width: auto; border-radius: 0; } }

.ai-head { display: flex; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--ink-760); }
.ai-agent-pick { flex: 1; min-width: 0; }
.agent-select { font-weight: 600; font-size: .9rem; border-color: transparent; background-color: var(--ink-870); border-radius: var(--r-pill); }
.ai-head-actions { display: flex; gap: 2px; }
.ai-agent-desc { padding: 10px 18px; font-size: .79rem; color: var(--tx-3); border-bottom: 1px solid var(--ink-760); line-height: 1.55; }
.ai-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }

.msg { display: flex; gap: 10px; animation: msgIn .22s; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg-avatar {
  width: 29px; height: 29px; flex: 0 0 29px; border-radius: var(--r-sm); display: grid; place-items: center;
  font-size: .82rem; font-weight: 700; color: var(--on-gold); background: var(--gold);
}
.msg.user .msg-avatar { background: var(--ink-720); color: var(--tx); }
.msg-content { flex: 1; min-width: 0; }
.msg-name { font-size: .73rem; font-weight: 600; color: var(--tx-3); margin-bottom: 4px; }
.msg-text { font-size: .89rem; line-height: 1.8; word-wrap: break-word; }
.msg-text h1, .msg-text h2, .msg-text h3 { font-size: .95rem; font-weight: 700; margin: 14px 0 5px; }
.msg-text h1:first-child, .msg-text h2:first-child, .msg-text h3:first-child { margin-top: 0; }
.msg-text p { margin-bottom: 9px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text ul, .msg-text ol { margin: 7px 0 10px; padding-inline-start: 21px; }
.msg-text li { margin-bottom: 5px; }
.msg-text strong { font-weight: 700; color: var(--tx); }
.msg-text code { font-family: var(--mono); font-size: .84em; background: var(--ink-800); padding: 1.5px 5px; border-radius: 5px; }
.msg-text pre { background: var(--ink-950); padding: 12px 14px; border-radius: var(--r-sm); overflow-x: auto; margin: 9px 0; direction: ltr; text-align: left; }
.msg-text pre code { background: none; padding: 0; }
.msg-text hr { border: none; border-top: 1px solid var(--ink-760); margin: 13px 0; }
.msg-text blockquote { border-inline-start: 3px solid var(--gold); padding-inline-start: 12px; color: var(--tx-2); margin: 9px 0; }
.msg-text table { width: 100%; border-collapse: collapse; font-size: .82em; margin: 9px 0; }
.msg-text th, .msg-text td { border: 1px solid var(--ink-760); padding: 5px 8px; text-align: start; }
.msg-text th { background: var(--ink-800); font-weight: 700; }

.ai-empty { text-align: center; padding: 34px 20px; color: var(--tx-3); }
.ai-empty-icon { font-size: 2.3rem; color: var(--gold); margin-bottom: 12px; }
.ai-empty h4 { font-size: 1.02rem; font-weight: 600; color: var(--tx); margin-bottom: 6px; }
.ai-empty p { font-size: .86rem; line-height: 1.7; }

.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: blink 1.3s infinite; display: block; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .28; } 30% { opacity: 1; } }

.ai-suggest { display: flex; gap: 6px; padding: 0 16px 10px; flex-wrap: wrap; max-height: 112px; overflow-y: auto; }
.ai-suggest button {
  padding: 5px 11px; border-radius: var(--r-pill); background: var(--ink-870);
  border: 1px solid var(--ink-760); color: var(--tx-2); font-family: inherit;
  font-size: .76rem; cursor: pointer; transition: all .16s; text-align: start;
}
.ai-suggest button:hover { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.ai-input { display: flex; gap: 8px; padding: 13px 16px; border-top: 1px solid var(--ink-760); align-items: flex-end; }
.ai-input textarea { flex: 1; resize: none; max-height: 156px; min-height: 42px; padding: 10px 15px; border-radius: var(--r); font-size: .89rem; line-height: 1.55; }
.ai-input .btn { width: 42px; height: 42px; padding: 0; flex-shrink: 0; font-size: 1.15rem; border-radius: 50%; }
.ai-meta { padding: 0 17px 10px; font-size: .71rem; color: var(--tx-3); min-height: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* بطاقة اقتراح مدد */
.proposal {
  border: 1px solid var(--gold-line); background: var(--gold-soft);
  border-radius: var(--r); padding: 13px 15px; margin-top: 10px;
}
.proposal-head { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--gold); margin-bottom: 9px; }
.proposal-lines { font-size: .8rem; font-variant-numeric: tabular-nums; }
.proposal-lines .pl { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--ink-760); }
.proposal-lines .pl:last-child { border-bottom: none; }
.proposal-lines .pl .acc { flex: 1; min-width: 0; }
.proposal-lines .pl .amt { min-width: 90px; text-align: end; }
.proposal-actions { display: flex; gap: 7px; margin-top: 11px; }
.proposal.done { opacity: .6; }

/* ═══ الحالة الفارغة ════════════════════════════════════ */
.empty { text-align: center; padding: 52px 22px; color: var(--tx-3); }
.empty-icon { font-size: 2.4rem; opacity: .4; margin-bottom: 14px; color: var(--gold); }
.empty h3 { font-size: 1.05rem; font-weight: 600; color: var(--tx-2); margin-bottom: 7px; }
.empty p { font-size: .88rem; max-width: 420px; margin: 0 auto 18px; line-height: 1.75; }

/* ═══ الرسوم ════════════════════════════════════════════ */
.chart { width: 100%; overflow: visible; display: block; }
.chart text { font-family: var(--font); fill: var(--tx-3); font-size: 11px; }
.chart .grid-line { stroke: var(--ink-760); stroke-width: 1; opacity: .7; }
.chart .axis-line { stroke: var(--ink-720); stroke-width: 1; }
.chart .mark-ring { stroke: var(--ink-870); stroke-width: 2; }
.chart .bar { transition: opacity .16s; }
.chart .bar:hover { opacity: .8; }
.chart-legend { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; margin-top: 12px; font-size: .8rem; color: var(--tx-2); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.chart-tip {
  position: fixed; padding: 6px 11px; background: var(--ink-950); border: 1px solid var(--ink-720);
  border-radius: var(--r-sm); font-size: .78rem; pointer-events: none; z-index: 400; display: none;
  box-shadow: var(--sh-2); white-space: nowrap;
}

.hbar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.hbar-name { font-size: .83rem; min-width: 92px; color: var(--tx-2); flex-shrink: 0; }
.hbar-track { flex: 1; background: var(--ink-800); border-radius: var(--r-pill); height: 26px; position: relative; overflow: hidden; min-width: 60px; }
.hbar-fill { height: 100%; border-radius: var(--r-pill); display: flex; align-items: center; padding-inline-start: 11px; transition: width .5s; min-width: 3px; }
.hbar-val { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.hbar-cnt { font-size: .78rem; color: var(--tx-3); min-width: 54px; text-align: start; flex-shrink: 0; }

/* ═══ التبويبات ═════════════════════════════════════════ */
/* التبويب النشط بخطّي الدفتر الذهبيّين — كما في الترويسة */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ink-720); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  padding: 10px 14px 12px; background: none; border: none;
  color: var(--tx-2); font-family: inherit; font-size: .88rem; cursor: pointer;
  transition: color .16s, background .16s; white-space: nowrap;
}
.tabs button:hover { color: var(--tx); background: var(--ink-840); }
.tabs button.on, .tabs button.on:hover {
  color: var(--tx); font-weight: 600;
  background:
    linear-gradient(var(--gold-brand) 0 0) 50% 100% / calc(100% - 16px) 2px no-repeat,
    linear-gradient(var(--gold-brand) 0 0) 50% calc(100% - 4px) / calc(100% - 16px) 1px no-repeat;
}

/* ═══ البحث ═════════════════════════════════════════════ */
.searchbox { position: relative; }
.searchbox input { width: 190px; padding: 8px 15px; font-size: .85rem; border-radius: var(--r-pill); background: var(--ink-870); }
.searchbox input:focus { width: 290px; }
.search-results {
  position: absolute; top: calc(100% + 7px); inset-inline-end: 0; width: 380px; max-height: 420px;
  overflow-y: auto; background: var(--ink-900); border: 1px solid var(--ink-760);
  border-radius: var(--r); box-shadow: var(--sh-3); z-index: 120; padding: 6px;
}
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; }
.search-item:hover { background: var(--ink-840); }
.si-title { flex: 1; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-sub { font-size: .74rem; color: var(--tx-3); white-space: nowrap; }
.search-empty { padding: 22px; text-align: center; color: var(--tx-3); font-size: .87rem; }
.search-group-label { padding: 9px 12px 4px; font-size: .7rem; font-weight: 700; color: var(--tx-3); }

/* ═══ متنوعات ═══════════════════════════════════════════ */
.row { display: flex; align-items: center; gap: 9px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 9px; }
.divider { height: 1px; background: var(--ink-760); margin: 17px 0; }
.line-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .87rem; gap: 12px; }
.line-row + .line-row { border-top: 1px solid var(--ink-760); }
.line-row b { font-weight: 600; font-variant-numeric: tabular-nums; }

.spinner {
  width: 30px; height: 30px; border: 3px solid var(--ink-760); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 13px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; padding: 70px; color: var(--tx-3); }

.provider-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--ink-840); border: 1px solid var(--ink-760); border-radius: var(--r); margin-bottom: 10px;
}
.provider-info { flex: 1; min-width: 0; }
.provider-info strong { font-size: .92rem; font-weight: 600; display: block; }
.provider-info small { font-size: .78rem; color: var(--tx-3); }
.provider-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.agent-card {
  background: var(--ink-870); border: 1px solid var(--ink-760); border-radius: var(--r-lg);
  padding: 18px 20px; cursor: pointer; transition: all .18s;
}
.agent-card:hover { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-soft), 0 0 20px -8px var(--glow-gold); }
.agent-icon { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; font-size: 1.15rem; color: var(--on-gold); margin-bottom: 12px; }
.agent-card h4 { font-size: .95rem; font-weight: 600; }
.agent-card .role { font-size: .78rem; color: var(--gold); font-weight: 500; margin-bottom: 7px; }
.agent-card p { font-size: .83rem; color: var(--tx-2); line-height: 1.65; }

/* شارة الطبقات — صفحة جاهزية الإنتاج */
.layer-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--ink-760); font-size: .87rem;
}
.layer-row:last-child { border-bottom: none; }
.layer-name { flex: 0 0 190px; font-weight: 600; }
.layer-how { flex: 1; color: var(--tx-2); font-size: .84rem; }
.layer-tick { color: var(--profit); font-size: 1rem; }

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .app { height: auto; padding: 0; }
  .frame { border: none; box-shadow: none; border-radius: 0; height: auto; }
  .topbar, .ai-panel, .page-head .actions, .page-back, .toolbar, .tabs { display: none !important; }
  .page { overflow: visible; padding: 0; }
  .card, .stat-strip { border-color: #ccc; background: #fff; }
  /* الورقة الكحلية تُطبع ورقاً عادياً: لا نقش ولا إطار متقطّع ولا سطر دقيق */
  .section.exec-band { background: #fff; box-shadow: none; outline: none; border: 1px solid #ccc; }
  .exec-band::before, .exec-band::after { display: none; }

  /* الطباعة من الشاشة بالأسود توفيراً للحبر — إلا المستندات الرسمية.
     كانت `*` تطال `.doc-page` أيضاً، فتُطبع كلمة «الإجمالي» ومبلغه
     أسودَين داخل المربّع الكحليّ فلا يُقرآن. المستند له ألوان هويته
     وورقه الرسميّ في print.css. */
  *:not(.doc-page):not(.doc-page *) { color: #000 !important; }
}

/* [gate-ledger] دفتر الأستاذ يُطبع كاملاً: جدولٌ للطباعة وحدها يحلّ محلّ صفحة الشاشة
   (views.js ledger — «طباعة» يجلب الصفحات كلّها حين تتجاوز الحركات صفحةً واحدة) */
.print-only { display: none; }
@media print {
  .lg-print-all .print-only { display: block; }
  .lg-print-all .lg-screen { display: none !important; }
}

/* ── بطاقات القوالب ─────────────────────────────────── */
/* كانت `.grid-3` نفسها تُعرَّف هنا ثانيةً فتغلب شبكة النماذج أعلاه في كل
   مكان: محرّر القيد بأربعة أعمدةٍ رابعها فارغ، ونوافذ التوقّع بحقولٍ
   متراكمة عمودياً. لبطاقات القوالب اسمها الخاصّ الآن. */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.tpl-card h4 { font-size: .98rem; font-weight: 600; color: var(--tx); }
.tpl-card p { flex: 1; font-size: .84rem; line-height: 1.65; }
.tpl-card .btn { margin-top: 6px; }
.tpl-ico {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-sm); font-size: 1.15rem;
  background: var(--gold-soft); color: var(--gold-brand);
  border: 1px solid var(--gold-line);
  transition: transform var(--t) var(--ease-spring);
}
.tpl-card:hover .tpl-ico { transform: rotate(-6deg) scale(1.08); }
.tpl-ico.doc { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* حاوية المخطّط المرن — تُقاس ثم يُرسَم بعرضها فلا ينضغط النصّ */
.chart-box { width: 100%; min-height: 40px; }
.chart-box svg.chart { width: 100%; display: block; }

/* ═══ الشريط التنفيذي ═══════════════════════════════════
   المدير يقرأ سطراً واحداً ورقماً واحداً. التفصيل تحته لمن أراده. */
/* ═══ الورقة النقدية — الحكم التنفيذي ═══════════════════
   الموضع الوحيد في اللوحة الذي يحمل الزخرفة: كحليٌّ عميق في المظهرين،
   وردة غيلوشيه ساكنة، إطارٌ متّصل وآخر متقطّع، وسطر طباعة دقيقة. الرقم
   الكبير محفور بالعاجيّ؛ الأخضر للسهم وحده، والمرجانيّ للخسارة. */
.exec-band {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 40px; align-items: end;
  padding: 32px 38px 46px; border-radius: var(--r-lg); border: 0;
  background: var(--rosette) left -150px center / 560px 560px no-repeat, var(--note);
  color: var(--note-ink); box-shadow: var(--sh-2);
  outline: 1px dashed rgba(214,176,96,.18); outline-offset: -14px;
}
[dir="ltr"] .exec-band { background-position: right -150px center, 0 0; }
.exec-band::before {
  content: ''; position: absolute; inset: 9px; pointer-events: none;
  border: 1px solid var(--note-art);
}
.exec-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.exec-text { font-size: 1.06rem; font-weight: 500; line-height: 1.6; color: var(--note-ink); }
.exec-band .live-dot {
  flex: none; width: 8px; height: 8px; background: var(--note-profit);
  box-shadow: 0 0 0 3px rgba(127,214,174,.22); animation: none;
}
.exec-figure { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.exec-num {
  font-family: var(--f-fig); font-size: clamp(3rem, 7vw, 5.6rem); font-weight: 500; line-height: .9;
  letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--note-ink);
}
.exec-sign { font-size: 1.05rem; align-self: center; }
.exec-figure.profit .exec-sign { color: var(--note-profit); }
.exec-figure.loss .exec-sign, .exec-figure.loss .exec-num { color: var(--note-loss); }
.exec-figure .cur { font-size: .95rem; color: var(--note-ink-2); font-weight: 500; padding-bottom: .45em; }
.exec-sub { margin-top: 10px; font-size: .86rem; color: var(--note-ink-2); }
.exec-band .local-eq { color: var(--note-ink-2); opacity: .9; }

/* شريط «إلى أين بعد هذا؟» — يمنع الشاشة أن تكون طريقاً مسدوداً */
.gobar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 26px; padding: 14px 16px;
  background: var(--ink-840); border: 1px solid var(--ink-720);
  border-radius: var(--r-lg);
}
.gobar-title {
  font-size: .8rem; color: var(--tx-3); font-weight: 500;
  margin-inline-end: 4px;
}
.gobar-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--r-sm);
  background: var(--ink-870); border: 1px solid var(--ink-720);
  color: var(--tx-2); font-size: .84rem; font-family: inherit;
  cursor: pointer; transition: background .14s, border-color .14s, color .14s;
}
.gobar-item:hover { background: var(--ink-840); border-color: var(--tx-3); color: var(--tx); }
.gobar-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gobar-ico { color: var(--gold); font-size: .92rem; }

/* شارة الفترة — الرقم الكبير بلا مداه رقمٌ مضلِّل */
/* شارة الفترة على الورقة الكحلية */
.exec-period {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 4px 12px; border-radius: 2px;
  background: rgba(255,255,255,.04); border: 1px solid var(--note-art);
  font-size: .82rem; color: var(--note-ink);
}
.exec-period-k { color: var(--note-ink-2); font-size: .76rem; }
.exec-period b { color: var(--note-ink); font-weight: 600; }
/* حين تكون الفترة جزءاً من الدفتر لا كلَّه، تُقرأ الشارة كتنبيه */
.exec-period.partial { background: rgba(221,182,101,.12); border-color: rgba(221,182,101,.55); }
.exec-period.partial b { color: var(--note-foil); }
.exec-period-note { color: var(--note-ink-2); font-size: .74rem; }

/* «الفئات» على الورقة: مربّعاتٌ بإطارٍ داخليّ كفئات الأوراق النقدية */
.exec-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.exec-chip {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 12px 16px 10px; border-radius: 0;
  background: color-mix(in srgb, var(--note) 84%, transparent);
  border: 1px solid var(--note-art); outline: 1px solid rgba(214,176,96,.2); outline-offset: -5px;
}
.exec-chip-l { font-size: .76rem; color: var(--note-ink-2); }
.exec-chip-v {
  font-family: var(--f-fig); font-size: 1.75rem; font-weight: 500; line-height: 1.15;
  font-variant-numeric: lining-nums tabular-nums; color: var(--note-ink);
}

@media (max-width: 860px) {
  .exec-band { grid-template-columns: 1fr; padding: 28px 26px 44px; }
  .exec-side { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .exec-band { background-position: center bottom -330px, 0 0; padding: 26px 22px 42px; }
  .exec-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exec-chip-v { font-size: 1.45rem; }
}

/* ═══ ما يحتاج قراراً ═══════════════════════════════════ */
.decision-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.decision {
  padding: 15px 17px; border-radius: var(--r); background: var(--ink-870);
  border: 1px solid var(--ink-720); border-inline-start: 3px solid var(--warn);
}
.decision.urgent { border-inline-start-color: var(--danger); }
.decision-t { font-weight: 600; font-size: .94rem; margin-bottom: 4px; }
[data-theme="light"] .decision-t { color: var(--navy); }
.decision-d { font-size: .84rem; color: var(--tx-2); line-height: 1.6; margin-bottom: 10px; }

/* ═══ بطاقة مدد داخل اللوحة ════════════════════════════ */
.madad-inline { padding: 20px 22px; }
.madad-head { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.madad-head h3 { font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.madad-head p { font-size: .84rem; margin-top: 2px; }
.madad-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: var(--r-sm); font-size: 1.05rem;
  background: var(--gold-soft); color: var(--gold-brand);
  border: 1px solid var(--gold-line);
}
.madad-asks { display: flex; flex-wrap: wrap; gap: 9px; }
.ask-chip {
  padding: 9px 15px; border-radius: var(--r-pill); cursor: pointer;
  font: inherit; font-size: .85rem; text-align: start;
  background: var(--ink-840); color: var(--tx-2);
  border: 1px solid var(--ink-760);
  transition: background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
}
.ask-chip:hover {
  background: var(--gold-soft); border-color: var(--gold-line); color: var(--tx);
}

/* ═══ سجلّ أفعال الوكلاء ═══════════════════════════════ */
.ai-log { display: flex; flex-direction: column; gap: 10px; }
.ai-entry {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px; border-radius: var(--r);
  background: var(--ink-870); border: 1px solid var(--ink-760);
  border-inline-start: 3px solid var(--gold-brand);
}
.ai-entry.dim { opacity: .5; }
.ai-entry-mark {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: var(--r-xs); font-size: .82rem;
  background: var(--gold-soft); color: var(--gold-brand);
}
.ai-entry-body { flex: 1; min-width: 0; }
.ai-entry-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.ai-entry-sum { font-size: .9rem; margin-bottom: 4px; }
[data-theme="light"] .ai-entry-sum { color: var(--navy); }
.ai-entry-acts { display: flex; gap: 7px; flex-shrink: 0; }
@media (max-width: 700px) {
  .ai-entry { flex-wrap: wrap; }
  .ai-entry-acts { width: 100%; }
}

/* ═══ الاستيراد ═══════════════════════════════════════ */
.imp-problems { max-height: 240px; overflow-y: auto; margin-top: 10px; }
.imp-problem {
  padding: 8px 12px; margin-bottom: 5px; border-radius: var(--r-xs);
  background: var(--danger-soft); border-inline-start: 3px solid var(--danger);
  font-size: .85rem; line-height: 1.55;
}
.imp-preview { max-height: 240px; overflow-y: auto; }
.imp-row {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px; margin-bottom: 5px; border-radius: var(--r-xs);
  background: var(--ink-840); font-size: .85rem;
}
.imp-row .num { font-variant-numeric: tabular-nums; }
.modal .box.wide { max-width: 760px; }

/* المقابل بالعملة المحلّية — حاضر لمن يريده، لا يزاحم الرقم الرسميّ */
.local-eq {
  font-size: .74rem;
  color: var(--tx-3);
  opacity: .72;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.exec-verdict .local-eq { font-size: .82rem; margin-top: 4px; }

/* ═══ حاسبة التسعير ═══════════════════════════════════ */
.calc-rate {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 15px; margin-bottom: 16px; border-radius: var(--r-sm);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-out { min-height: 8px; }
.calc-result {
  padding: 15px 18px; border-radius: var(--r); margin: 6px 0 4px;
  background: var(--ink-840); border: 1px solid var(--ink-760);
}
.calc-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; font-size: .9rem;
}
.calc-line.big b { font-family: var(--f-fig); font-size: 1.6rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
[data-theme="light"] .calc-line.big b { color: var(--navy); }
.calc-line.big small, .calc-line.local small { font-size: .72rem; color: var(--tx-3); font-weight: 500; }
.calc-line.local { padding-top: 0; }
.calc-line.local b { font-size: 1rem; color: var(--tx-3); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .calc-grid { grid-template-columns: 1fr; } }

/* ═══ محرّر عرض السعر ═══════════════════════════════════ */
/* رأس العرض والفاتورة: أعمدةٌ تتّسع لـ«USD — الدولار الأمريكي» وللاسم الطويل،
   والعميل بعرض عمودين. كانت ١٥٠px فتُقصّ القوائم وتنكسر الملاحظات سطرين. */
.q-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; align-items: start; }
.q-head > .field.wide { grid-column: span 2; }
@media (max-width: 520px) { .q-head > .field.wide { grid-column: auto; } }
.q-lines-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 8px; padding-bottom: 7px; border-bottom: 1px solid var(--ink-760);
}
.q-line {
  display: grid;
  grid-template-columns: 1fr 80px 80px 100px 100px 34px;
  gap: 7px; align-items: center; margin-bottom: 7px;
}
.q-line input { margin: 0; }
.q-amt {
  text-align: end; font-family: var(--f-fig); font-size: .92rem; font-variant-numeric: lining-nums tabular-nums;
  color: var(--tx-2); padding-inline-end: 4px;
}
.q-del { padding: 0; width: 34px; height: 34px; line-height: 1; }
.q-total {
  padding: 9px 14px; border-radius: 0; background: transparent;
  border: 1px solid var(--rule-strong); outline: 1px solid var(--gold-brand); outline-offset: 2px;
  font-family: var(--f-fig); font-size: 1.2rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums;
}
[data-theme="light"] .q-total { color: var(--navy); }
.q-total small { display: block; font-family: var(--font); font-size: .7rem; font-weight: 400; color: var(--tx-3); }
/* خانة «المبلغ كتابةً» قبل أن يُكتب مبلغ: سطرٌ منقّط ينتظر، لا إطارٌ فارغ */
.q-total:empty { border: 1px dashed var(--ink-720); outline-color: transparent; }
@media (max-width: 760px) {
  .q-line { grid-template-columns: 1fr 1fr; }
  .q-line .q-amt { grid-column: 1 / -2; }
}
/* السند: جدول «البيان — القيمة» على الورقة */
.voucher-table th { width: 28%; text-align: start; font-weight: 600; }
.voucher-table td { font-weight: 600; }

/* مقابل سعر الوحدة بعملة المستند حين تُكتب الأسعار بعملة الدفتر */
.q-amt small { display: block; font-family: var(--font); font-size: .68rem; color: var(--tx-3); line-height: 1.3; }

/* ═══ مراحل المستند — أين هو وما التالي ════════════════════ */
.stages {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px; counter-reset: none;
}
.stages li {
  flex: 1 1 120px; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--ink-760); color: var(--tx-3); font-size: .84rem;
}
.stages .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  border: 1px solid currentColor;
}
.stages li.done { color: var(--tx-2); }
.stages li.done .dot { background: transparent; border: 3px double var(--profit); color: var(--profit); font-size: .66rem; }
.stages li.now { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); font-weight: 600; }
.stages li.now .dot { background: var(--gold); border-color: var(--gold); color: var(--ink-900, #0B1530); }
.stage-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-draft {
  display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 2px;
  border: 1px dashed currentColor; font-size: .7em; font-weight: 600; letter-spacing: 0;
}

/* ═══ لوحة الأوامر (Ctrl+K) ════════════════════════════ */
.palette-scrim {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(8, 14, 26, .5);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: fadeUp 160ms var(--ease-out);
}
.palette {
  width: min(620px, 92vw);
  background: var(--ink-870);
  border: 1px solid var(--ink-720);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.palette-input {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ink-760);
}
.palette-icon { font-size: 1.15rem; color: var(--gold); }
.palette-input input {
  flex: 1; border: none; background: none; margin: 0; padding: 0;
  font: inherit; font-size: 1.02rem; color: var(--tx); outline: none;
}
.palette-list { max-height: 46vh; overflow-y: auto; padding: 7px; }
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px; border-radius: var(--r-xs); cursor: pointer;
}
.palette-item.on { background: var(--gold-soft); }
.palette-item-icon { width: 20px; text-align: center; color: var(--gold-brand); }
.palette-item-label { flex: 1; font-size: .93rem; }
[data-theme="light"] .palette-item.on .palette-item-label { color: var(--navy); font-weight: 600; }
.palette-item-hint { font-size: .76rem; color: var(--tx-3); }
.palette-empty { padding: 24px; text-align: center; color: var(--tx-3); }
.palette-foot {
  display: flex; gap: 16px; padding: 10px 18px;
  border-top: 1px solid var(--ink-760);
  font-size: .75rem; color: var(--tx-3);
}
.palette-foot kbd {
  padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: .72rem;
  background: var(--ink-800); border: 1px solid var(--ink-760);
}
.palette-input kbd {
  padding: 2px 7px; border-radius: 5px; font-family: var(--mono); font-size: .72rem;
  background: var(--ink-800); border: 1px solid var(--ink-760); color: var(--tx-3);
}

/* ═══ تصفية المشروع ═══════════════════════════════════ */
.settle-hero {
  text-align: center; padding: 20px; border-radius: var(--r-lg); margin-bottom: 16px;
  background: var(--profit-soft); border: 1px solid var(--profit);
}
.settle-hero.bad { background: var(--loss-soft); border-color: var(--loss); }
.settle-label { font-size: .84rem; color: var(--tx-2); margin-bottom: 5px; }
.settle-num {
  font-family: var(--f-fig); font-size: 2.6rem; font-weight: 500; color: var(--profit);
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em;
}
.settle-hero.bad .settle-num { color: var(--loss); }
.settle-num small { font-family: var(--font); font-size: .9rem; font-weight: 500; color: var(--tx-3); margin-inline-start: 6px; }

.settle-flow {
  display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.settle-step {
  flex: 1; min-width: 110px; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--ink-840); border: 1px solid var(--ink-760);
}
.settle-step span { display: block; font-size: .76rem; color: var(--tx-3); margin-bottom: 3px; }
.settle-step b { font-family: var(--f-fig); font-size: 1.1rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.settle-step.accent { background: var(--gold-soft); border-color: var(--gold-line); }
[data-theme="light"] .settle-step.accent b { color: var(--navy); }
.settle-op { display: grid; place-items: center; font-size: 1.2rem; color: var(--tx-3); }

/* ═══ اللغة والترجمة ══════════════════════════════════ */
.lang-en { font-family: 'Segoe UI', system-ui, sans-serif; }
.lang-en .mono, .lang-en .num { font-family: var(--mono); }
#langBtn { font-weight: 700; font-size: .82rem; }

.tr-src, .tr-out {
  padding: 13px 16px; border-radius: var(--r-sm); line-height: 1.8;
  background: var(--ink-840); border: 1px solid var(--ink-760);
}
.tr-out { background: var(--gold-soft); border-color: var(--gold-line); }
.tr-arrow { text-align: center; padding: 8px; color: var(--tx-3); font-size: 1.2rem; }
.tr-done { border-bottom: 1px dashed var(--gold-line); }

/* ═══ إرفاق ملفّ في محادثة مدد ═════════════════════════ */
.ai-clip {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: var(--ink-840); border: 1px solid var(--ink-760);
  font-size: .95rem; transition: all var(--t-fast, .14s) ease;
}
.ai-clip:hover { background: var(--gold-soft); border-color: var(--gold-line); }
.ai-attached {
  display: flex; align-items: center; gap: 9px;
  margin: 0 14px 8px; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
  font-size: .82rem;
}
.ai-att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-att-size { color: var(--tx-3); font-size: .74rem; }
.ai-att-x {
  border: none; background: none; cursor: pointer; color: var(--tx-3);
  font-size: 1.1rem; line-height: 1; padding: 0 3px;
}
.ai-att-x:hover { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   الاعتماد — المُنشئ والمعتمِد

   المطلب حرفياً: «لازم يكون في حدا منشئ لو، وحدا معتمد لو».
   فيظهران جنباً إلى جنب بسهمٍ بينهما — لا سطرَين في جدول.
   ═══════════════════════════════════════════════════════════ */
.who-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.who {
  display: flex; align-items: center; gap: 11px; flex: 1 1 200px;
  padding: 11px 14px; border-radius: var(--r);
  background: var(--ink-870); border: 1px solid var(--ink-720);
}
.who.ok   { border-color: var(--profit); background: var(--profit-soft); }
.who.warn { border-color: var(--gold-line); background: var(--gold-soft); }
.who-avatar {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border-radius: 50%; background: transparent; color: var(--gold);
  border: 1px solid var(--gold-brand); box-shadow: inset 0 0 0 3px var(--ink-870), inset 0 0 0 4px var(--gold-soft);
  font-family: var(--f-display); font-weight: 700; font-size: 1.1rem;
}
.who-arrow { color: var(--tx-2); font-size: 1.3rem; flex: 0 0 auto; }

/* ═══ سلسلة الصفقة: عرض ← أمر شراء ← فاتورة ═══ */
.chain { display: flex; gap: 8px; flex-wrap: wrap; }
.chain-step {
  flex: 1 1 140px; text-align: start; padding: 11px 14px; border-radius: var(--r);
  background: var(--ink-870); border: 1px solid var(--ink-760);
  color: var(--tx); cursor: pointer; transition: all .16s; font: inherit;
}
.chain-step.on { border-color: var(--gold-line); background: var(--gold-soft); }
.chain-step.off { opacity: .6; cursor: default; }
.chain-step:not(:disabled):hover { border-color: var(--gold); }
.chain-label { display: block; font-size: .72rem; color: var(--tx-2); margin-bottom: 3px; }
.chain-value { display: block; font-weight: 600; font-size: .9rem; }
.chain-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ═══ قواعد الاعتماد في النافذة ═══ */
.rules { display: grid; gap: 10px; margin: 14px 0; }
.rule-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r); background: var(--ink-870);
}
.rule-row .field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.rule-row .field.inline input { width: 110px; }
.switch { display: flex; align-items: center; gap: 9px; flex: 1 1 160px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--gold-brand); }

/* ═══ المعاينة: الورقة وحدها داخل نافذة ═══ */
.doc-preview {
  max-height: 68vh; overflow: auto; background: #fff; border-radius: var(--r);
  padding: 6px;
}
.doc-preview .doc-page { box-shadow: none; margin: 0; }

/* ═══════════════════════════════════════════════════════════
   شبكة الأقسام — الأيقونات تأخذ راحتها

   طلبٌ صريح: «الأيقونات اللي فوق تتكبّر… يكونوا فوق الداشبورد
   مشان ياخدوا راحتهم». فالبلاطة هنا ٥٦ بكسلاً للأيقونة واسمٌ
   وسطرُ شرح — لا رمزٌ في ٣٧ بكسلاً يُحفَظ ولا يُقرأ.
   ═══════════════════════════════════════════════════════════ */
.launcher .launcher-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px;
}
.launcher.closed .launcher-body { display: none; }
.lg-title {
  font-size: .78rem; font-weight: 600; color: var(--tx-3);
  letter-spacing: .02em; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--ink-720);
}
.lg-grid { display: grid; gap: 6px; }
.tile {
  display: flex; align-items: center; gap: 12px; position: relative;
  padding: 10px 12px; border-radius: var(--r); text-decoration: none;
  background: var(--ink-870); border: 1px solid var(--ink-760);
  color: var(--tx); transition: background .16s, border-color .16s;
}
.tile:hover { background: var(--ink-840); border-color: var(--ink-720); }
.tile.active, .tile[data-nav].active { border-color: var(--gold-line); background: var(--gold-soft); }
.tile-ico {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  border-radius: 50%; background: transparent; color: var(--gold);
  border: 1px solid var(--gold-line); font-size: 1.2rem; line-height: 1;
  transition: background .16s, border-color .16s;
}
.tile:hover .tile-ico { background: var(--gold-soft); border-color: var(--gold-brand); }
.tile-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-txt b { font-size: .92rem; font-weight: 600; }
.tile-txt small { font-size: .74rem; color: var(--tx-2); line-height: 1.45; }
.tile-dot {
  position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%);
  min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 999px; background: var(--danger); color: var(--ink-950);
  font-family: var(--f-fig); font-size: .74rem; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   الترويسة — ترتيب نهائي

   ثلاثة أعطال ظهرت بعد نقل الشريط الثانوي إلى شبكة لوحة القيادة،
   وكلها من قاعدةٍ كُتبت بعد أختها فغلبتها:

   ١. زرّ «كل الأقسام» عريضٌ باسمه، لكن `.topbar .rail .rail-btn`
      (وزنها ٠٫٣٫٠) غلبت `.rail-btn.wide` (٠٫٢٫٠) فحشرته في دائرة
      ٤٠ بكسل — فبانَ اسمُه نصفَ كلمةٍ داخل الدائرة. الوزن هنا
      مطابقٌ لها ومسبوقٌ بـ`.wide`، فيغلب بالترتيب لا بالتخصيص.

   ٢. حقل البحث عرضُه ثابتٌ ١٩٠ بكسلاً داخل صندوقٍ مرن ٢٦٧ — فبقي
      ٧٧ بكسلاً فراغاً على يساره. الحقل يملأ صندوقه الآن.

   ٣. `:focus` كان يقفز بالحقل من ١٩٠ إلى ٢٩٠ فيزيح الشريط كلَّه عند
      كل نقرة. صار يتّسع الصندوق نفسه بلا إزاحة ما حوله.
   ═══════════════════════════════════════════════════════════ */

/* الترتيب: الهوية · التنقّل · [فراغ] · البحث · الإجراءات */
.topbar { gap: 10px; }
.topbar .pillnav { min-width: 0; }

/* ── الإجراءات ── */
.topbar .rail { gap: 6px; }
.topbar .rail .rail-btn { width: 38px; height: 38px; flex: 0 0 38px; font-size: 1.05rem; }
.topbar .rail .avatar-btn { width: 38px; height: 38px; flex: 0 0 38px; }

/* «كل الأقسام»: الزرّ الوحيد الذي يحمل اسمه — صار الطريق الرئيسي
   إلى ما اختفى من الشريط، لا مخرجاً احتياطياً. */
.topbar .rail .rail-btn.wide {
  /* `display` صريحٌ هنا: أصل `.rail-btn` شبكةٌ تُوسِّط عنصراً واحداً،
     فيركب فيها الرمزُ فوق الاسم بدل أن يصطفّا. */
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; flex: 0 0 auto; padding: 0 14px; gap: 7px;
  border-radius: var(--r-pill); font-size: .84rem;
}
.rail-ico { font-size: 1.05rem; line-height: 1; }
.rail-lbl { font-size: .82rem; white-space: nowrap; font-weight: 500; }
/* تحت ١٠٨٠ يبقى الرمز وحده — الاسم أوّل ما يُضحّى به لا الزرّ */
@media (max-width: 1080px) {
  .topbar .rail .rail-btn.wide { width: 38px; flex: 0 0 38px; padding: 0; }
  .rail-lbl { display: none; }
}

/* ── البحث ──
   يتمدّد بما يفيض عن التنقّل، ولا يقفز عند التركيز. */
.searchbox { flex: 1 1 300px; min-width: 190px; max-width: 420px; }
.searchbox input {
  width: 100%; height: 38px; padding: 0; padding-inline: 4px 30px;
  font-size: .86rem; border-radius: 0; background: transparent;
  border: 0; border-bottom: 1px solid var(--ink-720); transition: border-color .16s, box-shadow .16s;
}
.searchbox input:focus {
  width: 100%; background: transparent; border-bottom-color: var(--gold-brand);
  box-shadow: inset 0 -1px 0 var(--gold-brand);
}
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* عدسة مرسومة بالحدود — لا صورة ولا خطّ أيقونات، فلا تحمّل شيئاً */
.searchbox::before {
  content: '⌕'; position: absolute; inset-inline-end: 13px; top: 50%;
  transform: translateY(-50%); color: var(--tx-3); font-size: 1.15rem;
  pointer-events: none; line-height: 1;
}
.searchbox::before { inset-inline-end: 6px; }
@media (max-width: 760px) { .searchbox { flex: 1 1 auto; min-width: 0; } }

/* ── قائمة النتائج ── */
.search-results { width: min(420px, calc(100vw - 32px)); }
.search-item { display: flex; align-items: center; gap: 11px; }
.search-item.on { background: var(--gold-soft); }
.si-ico {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  border-radius: 50%; background: transparent; border: 1px solid var(--gold-line); color: var(--gold); font-size: .9rem;
}
.si-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.si-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-foot {
  padding: 8px 13px; font-size: .72rem; color: var(--tx-2);
  border-top: 1px solid var(--ink-800);
}

/* ═══ الترويسة على الشاشات الضيّقة ═══════════════════════
   صفٌّ واحد لا يتّسع لأربعة أقسام تحت ٨٦٠ بكسلاً: قيس فعليّ على
   ٧٦٨ أعطى شريط التنقّل ٨١ بكسلاً — سلسلةَ حروفٍ لا قائمة. وعلى
   ٣٧٥ انكمش حقل البحث إلى **صفر** فبقي عنصراً غير مرئيّ لا يُنقَر.

   الحلّ صفوفٌ لا ضغط: الهوية والإجراءات معاً، ثم البحث بعرض كامل،
   ثم التنقّل بعرض كامل ينزلق أفقياً. لا شيء يختفي، ولا شيء يُسحق. */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; row-gap: 9px; align-items: center; padding: 10px 14px 6px; }
  .brand { border-inline-end: 0; padding-inline-end: 0; }
  .topbar .spacer { display: none; }
  .brand { order: 1; }
  .topbar .rail { order: 2; margin-inline-start: auto; }
  .searchbox { order: 3; flex: 1 1 100%; max-width: none; min-width: 0; }
  .pillnav { order: 4; flex: 1 1 100%; min-width: 0; }
}

/* على الهاتف تضيق الأزرار بدل أن يُحذف منها شيء — لا زرَّ في الشريط
   له بديلٌ في مكان آخر، فحذفُ أيّها يقطع طريقاً. */
@media (max-width: 430px) {
  .topbar { padding: 10px 12px; }
  .topbar .rail { gap: 4px; }
  .topbar .rail .rail-btn,
  .topbar .rail .rail-btn.wide,
  .topbar .rail .avatar-btn { width: 34px; height: 34px; flex: 0 0 34px; font-size: .98rem; }
  .topbar .rail .rail-btn.wide { padding: 0; }
  .brand-name { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   ما يملكه المستخدم — شاشات التخصيص
   ═══════════════════════════════════════════════════════════ */

/* صور الهوية: المعاينة بحجم يُحكَم منه على الصورة قبل اعتمادها */
.asset-slot {
  display: flex; flex-direction: column; gap: 8px;
  padding: 13px; border-radius: var(--r);
  background: var(--ink-870); border: 1px solid var(--ink-720);
}
.asset-head { display: flex; align-items: center; gap: 8px; }
.asset-head b { flex: 1; font-size: .9rem; }
.asset-box {
  display: grid; place-items: center; min-height: 84px; padding: 10px;
  border-radius: 2px; background: #fff; border: 1px dashed var(--ink-720);
}
.asset-box.tall { min-height: 150px; }
.asset-box img { max-width: 100%; max-height: 132px; object-fit: contain; }
.asset-slot .btn { align-self: flex-start; }

/* معاينة الذيل على أرضية بيضاء — كما يخرج من الطابعة */
.doc-foot-preview {
  position: relative; margin-top: 10px; padding: 12px 14px;
  border-radius: 2px; background: #fff; color: #56657E;
  border: 1px solid var(--ink-760);
  display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .76rem;
}
.doc-foot-preview span { white-space: nowrap; }
.doc-foot-preview .addr { white-space: normal; }

/* عيّنة الرقم: تُقرأ رقماً لا نصّاً */
.num-sample {
  font-family: var(--mono); font-size: .86rem; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 2px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-line);
}

/* نصّ طويل يُقتطع لثلاثة أسطر — القائمة تُمسح بالعين لا تُقرأ */
.text-clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap; line-height: 1.7;
}

/* متغيّرات القالب: تُنقر فتُدرَج */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.var-chips .chip {
  padding: 5px 11px; border-radius: var(--r-sm); cursor: pointer; font: inherit;
  font-size: .78rem; background: var(--ink-840); color: var(--tx-2);
  border: 1px solid var(--ink-760); transition: all .14s;
}
.var-chips .chip:hover { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }

/* التغيير: القديم مشطوبٌ والجديد بارز — يُقرأ بلمحة */
.chg { font-size: .82rem; color: var(--tx-2); margin-inline-start: 6px; }

/* اختيار القالب فوق الحقل — يُبدَّل النصّ لا يُكتب من الصفر */
/* رأس حقلٍ فيه زرّ («＋ جديد»، «↻ تلقائي»، منتقي النصوص): بارتفاع عنوانٍ عاديّ
   تماماً، فيبقى الحقل على سطر جيرانه. كان `.field > span {display:block}` يغلبه
   فيعلو الحقل ١٠px. والنصّ <label for> مستقلّ: النقر عليه يركّز الحقل لا الزرّ. */
.field > .field-head { display: flex; align-items: center; gap: 8px; min-height: 21px; flex-wrap: nowrap; }
.field-head > label { cursor: pointer; }
.field-head .btn.sm { height: 21px; min-height: 0; padding: 0 9px; font-size: .74rem; line-height: 19px; margin-inline-start: auto; }
.field-head select { height: 24px; padding-block: 0; font-size: .78rem; }
/* ملاحظة تحت الحقل: سطرٌ كاملٌ مقروء، لا كلمةٌ معلّقة */
.field-note, .field > small.t-sub { display: block; margin-top: 5px; font-size: .74rem; line-height: 1.5; color: var(--tx-3); }
.field-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-head .text-pick {
  margin-inline-start: auto; max-width: 220px; padding: 4px 10px;
  font-size: .78rem; border-radius: var(--r-sm);
  background: var(--ink-870); border: 1px solid var(--ink-760); color: var(--tx-2);
}

/* الحقول الإضافية داخل محرّر المستند — مجموعةٌ باسمها لا مبعثرةٌ بين حقول النظام */
.custom-block {
  margin-top: 14px; padding: 13px; border-radius: var(--r);
  background: var(--ink-870); border: 1px solid var(--ink-760);
}
.custom-head {
  font-size: .76rem; font-weight: 600; color: var(--tx-2);
  letter-spacing: .03em; margin-bottom: 10px;
}

/* ═══ شريط التبويبات: ينزلق ولا يُسحق ═══════════════════
   `overflow-x: auto` وحدها لا تكفي: عناصر الفليكس تنكمش قبل أن تفيض،
   فخمسة عشر تبويباً في الإعدادات ضُغطت إلى ٥٣ بكسلاً — عناوينُ مبتورة
   لا تُقرأ. `flex-shrink: 0` يجعلها تحتفظ بعرضها فيفيض الشريط وينزلق. */
.tabs button { flex: 0 0 auto; }
.tabs { scrollbar-width: thin; scrollbar-color: var(--ink-720) transparent; scroll-snap-type: x proximity; }
.tabs button { scroll-snap-align: start; }
/* شريط تمرير رفيع يظهر عند الحاجة — فيُعرف أن وراءه المزيد */
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--ink-720); border-radius: 2px; }

/* ═══ القائمة المنسدلة من داخل النظام (SelectMenu في ui.js) ════════
   بدل قائمة المتصفّح الزرقاء: سطح النظام، خطّه، وتمييز الاختيار بالذهبي. */
.selmenu {
  position: fixed; z-index: 600; display: flex; flex-direction: column;
  background: var(--ink-900); color: var(--tx);
  border: 1px solid var(--ink-760); border-top: 2px solid var(--gold-brand);
  border-radius: var(--r-sm); box-shadow: var(--sh-3);
  font-family: var(--font); font-size: .9rem; overflow: hidden;
  animation: selmenu-in .12s ease-out;
}
@keyframes selmenu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.selmenu-q {
  margin: 8px; width: auto; padding: 7px 10px; font-size: .86rem;
  border: 1px solid var(--ink-760); border-radius: var(--r-xs); background: var(--ink-870); color: var(--tx);
}
.selmenu-list { overflow-y: auto; padding: 4px 0; min-height: 0; flex: 1 1 auto; }
.selmenu-group {
  padding: 8px 14px 4px; font-family: var(--f-display); font-size: .95rem; font-weight: 600;
  color: var(--gold); border-top: 1px solid var(--ink-760); margin-top: 4px;
}
.selmenu-group:first-child { border-top: none; margin-top: 0; }
.selmenu-opt {
  padding: 8px 14px; cursor: pointer; line-height: 1.45; white-space: normal;
  border-inline-start: 2px solid transparent;
}
.selmenu-opt.act { background: var(--gold-soft); }
.selmenu-opt.on { font-weight: 700; border-inline-start-color: var(--gold-brand); }
.selmenu-opt.on::after { content: '✓'; float: inline-end; color: var(--gold); font-weight: 700; margin-inline-start: 10px; }
.selmenu-opt.off { color: var(--tx-3); cursor: not-allowed; }
.selmenu-empty { padding: 12px 14px; color: var(--tx-3); font-size: .86rem; }
select.selmenu-open { border-color: var(--gold-brand); box-shadow: 0 0 0 3px var(--gold-soft); }
@media print { .selmenu { display: none !important; } }

/* ═══ حقل التاريخ: يوم/شهر/سنة على كل جهاز (datefield.js) ═══
   الحقل الأصليّ يبقى تحته شفّافاً — منه يُفتح التقويم ومنه تُقرأ القيمة. */
.df { position: relative; display: flex; width: 100%; }
.df > .df-text { flex: 1; min-width: 0; padding-right: 34px; font-variant-numeric: tabular-nums; }
.df > .df-text.bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.df > .df-pick {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--tx-3); cursor: pointer;
}
.df > .df-pick:hover { color: var(--gold); background: var(--gold-soft); }
.df > .df-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; z-index: -1;
}

/* ═══ إصلاحات التدقيق الشامل — أكتوبر ٢٠٢٦ (قسمٌ لكل مجال) ═══ */
/* [area:ledger] */
/* [/area:ledger] */
/* [area:reports] */
/* شريط الفترة: ستة أزرار — تلتفّ على الشاشة الضيّقة بدل أن تخرج منها */
.seg.period-seg { flex-wrap: wrap; border-radius: var(--r-md, 14px); max-width: 100%; }
.seg.period-seg button { white-space: nowrap; }
/* نافذة «فترة أخرى…» */
.pp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pp-k { min-width: 96px; color: var(--tx-2); font-size: .86rem; }
.pp-hint { font-size: .8rem; margin-top: -4px; }
/* سطرٌ خافت في القوائم: «بلا مشروع» و«أخرى» — يكمّل المجموع ولا يزاحم */
tr.row-muted td, .stmt-line.muted-line .lbl { color: var(--tx-3); font-style: italic; }
.aging-note { margin-top: 8px; font-size: .8rem; color: var(--tx-3); }
/* [/area:reports] */
/* [area:parties] */
/* [/area:parties] */
/* [area:purchase] */
/* [/area:purchase] */
/* [area:funding] */
/* [/area:funding] */
/* [area:admin] */
/* [/area:admin] */
/* [area:excel] */
/* معاينة الاستيراد: الأخطاء حمراء والتنبيهات كهرمانية، والتغييرات «قبل ← بعد» تحت كل سطر */
.imp-h { margin: 12px 0 6px; font-weight: 600; }
.imp-problem.warn { background: var(--warn-soft, rgba(181, 71, 8, .08)); border-inline-start-color: var(--warn, #b54708); }
.imp-preview .imp-row { grid-template-columns: 3.5em auto minmax(5em, auto) 1fr auto; align-items: start; }
.imp-chg { display: inline-block; margin-inline-end: 10px; font-size: .85em; color: var(--muted, #667085); unicode-bidi: isolate; }
.imp-ask { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-weight: 600; }
.imp-ask input { margin-top: 3px; }
/* [/area:excel] */
/* [area:word] */
/* [/area:word] */
/* [area:editors] */
/* ── المحرّرات: الحقل المطلوب، والخطأ عند الحقل نفسه ── */
.field .req { color: var(--danger); font-weight: 700; margin-inline-start: 3px; }
.field-error { display: block; margin-top: 5px; font-size: .76rem; line-height: 1.5; color: var(--danger); }
[aria-invalid="true"], [aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
/* زرّ الحفظ أثناء الطلب: يُرى أنه يعمل، ولا يُضغط ثانيةً */
.modal-foot .btn[aria-busy="true"] { cursor: progress; opacity: .75; }
.modal-foot .btn[aria-busy="true"]::after {
  content: ''; width: 11px; height: 11px; margin-inline-start: 7px; display: inline-block; vertical-align: -1px;
  border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* رأس الحقل: النصّ في أوّله وكل أدواته (قالب، شرط سداد، ＋) في آخره، ويلتفّ
   سطراً ثانياً إن ضاق — لا يدفع الحقل خارج النافذة على الهاتف */
.field-head > label { margin-inline-end: auto; }
.field-head > .text-pick, .field-head > .btn.sm { margin-inline-start: 0; }
.field > .field-head:has(.text-pick) { flex-wrap: wrap; row-gap: 6px; }

/* الرقم مجمَّعاً بالآلاف تحت خانة المبلغ أثناء الكتابة (NumEcho في ui.js) */
.num-echo {
  position: fixed; z-index: 400; pointer-events: none; padding: 2px 8px;
  font-family: var(--f-fig, inherit); font-size: .76rem; font-variant-numeric: tabular-nums;
  color: var(--tx-2); background: var(--ink-840); border: 1px solid var(--ink-720);
  border-radius: var(--r-xs, 6px); box-shadow: var(--sh-2); text-align: start;
}

/* ── بنود العرض والفاتورة (‎.q-line‎، ‎.q-tools‎، ‎.q-undo‎) ومجموعات السند (‎.v-group‎):
   نسخةٌ واحدة في كتلة ‎[area:ui]‎ أدناه. كانت هنا نسخةٌ ثانية بقيمٍ أخرى — شبكة
   ‎.q-line‎ منها ميّتة (التالية تغلبها) وحشوة ‎fieldset.v-group‎ تغلب تلك بخصوصيّتها،
   فمكوّنٌ واحد يصونه موضعان. ── */

/* ── النوافذ على الهاتف: ملءُ الشاشة، وجدول السطور يمرَّر أفقياً لا يُعصَر ──
   كانت خانة الحساب ٥٧px وخانة المبلغ ٣٣px على شاشة ٣٩٠px. */
@media (max-width: 600px) {
  .modal-scrim { padding: 0; }
  .modal, .modal.wide, .modal.xwide { width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0; border-inline: none; }
  .modal-head { padding: 12px 14px 10px; }
  .modal-head h3 { font-size: 1.25rem; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 10px 14px; }
  .modal .table-wrap > .jl-table { min-width: 640px; }
}
/* [/area:editors] */
/* [area:robust] */
/* [/area:robust] */
/* [area:ui] */
/* ── (css) تدقيق الواجهة: الطباعة، الجداول، الترويسة، لوحة المفاتيح، الهاتف ── */

/* الطباعة من الشاشة (قائمة القيود، الفواتير، التقارير): كان وعاء الجدول
   يمرّر أفقياً على الورق أيضاً، فتُقصّ أعمدة المبلغ والحالة عند حافّة الصفحة
   وتبقى الأوصاف مبتورةً بـ«…». على الورق يلتفّ النصّ ويصغر الخطّ قليلاً،
   ويتكرّر رأس الجدول أعلى كل صفحة. (ورق المستندات الرسمية في print.css) */
@media print {
  .table-wrap, .table-wrap.fits { overflow: visible !important; }
  table.data { font-size: 8.5pt; }
  /* حشوة أضيق، والخلايا النصّية والشارات تلتفّ (الأرقام تبقى سطراً واحداً):
     قائمة المشاريع بأعمدتها الإحدى عشرة كانت أعرض من الورقة بنحو ١٤px فيُقصّ آخر عمود */
  table.data th, table.data td { padding: 4px 5px; }
  table.data td:not(.n), table.data td .badge { white-space: normal; }
  table.data th { position: static; white-space: normal; }
  table.data thead { display: table-header-group; }
  table.data tr { break-inside: avoid; }
  .truncate, .si-title {
    white-space: normal !important; overflow: visible !important;
    text-overflow: clip !important; max-width: none !important;
  }
}

/* النصّ الإنجليزيّ في خليّةٍ عربية: يُقصّ من آخره لا من أوّله. كانت الخلية
   ترث اتجاه الصفحة فيُرى «…able for 10 units» بدل «Settlement of payable…». */
table.data td .truncate, table.data td.truncate { unicode-bidi: plaintext; }

/* رأس الجدول يثبت أعلى الشاشة أثناء التمرير. وعاء الجدول كان حاوية تمريرٍ
   أفقيّ دائماً فيصير هو مرجع الثبات — وهو لا يمرّر عمودياً، فيذهب الرأس مع
   الصفحة. الجدول الذي يتّسع لوعائه (يقيسه ux.js) لا يحتاج تمريراً: يُقصّ
   بحوافّه المستديرة ولا يصير حاويةً، فيثبت الرأس. الأعرض يبقى يمرّر أفقياً. */
.table-wrap.fits { overflow: clip; }

/* شريط الأقسام: كان يُقصّ بصمتٍ بين ٨٦١ و١٤٤٠ بكسلاً (يختفي «مدد» و«التوريدات»)
   بلا شريط تمرير ولا إشارة. الآن: روابط أضيق قليلاً، وشريط تمريرٍ رفيع يظهر
   حين يفيض (والعجلة تمرّره — ux.js)، وبين ٨٦١ و١٢٦٠ يأخذ التنقّل سطراً كاملاً
   تحت البحث والأزرار فلا يُخفى منه شيء.
   والبحث أساسه ١٦٠ لا ٣٠٠: الانكماش يُوزَّع بنسبة الأساس، فكان التنقّل (٤٨٢)
   يتنازل عن أكثر المساحة والبحثُ باقٍ نحو ٢٥٠ — فيُقصّ «مدد» و«التوريدات» كما
   كانا. الآن يأخذ البحث ما فاض عن التنقّل فقط، ولا ينزل عن ١٦٠. */
@media (max-width: 1440px) { .pillnav a { padding-inline: 9px; } }
@media (min-width: 861px) and (max-width: 1440px) { .searchbox { flex: 1 1 160px; min-width: 160px; } }
@media (hover: hover) and (pointer: fine) {
  .pillnav { scrollbar-width: thin; scrollbar-color: var(--ink-720) transparent; }
  .pillnav::-webkit-scrollbar { display: block; height: 4px; }
  .pillnav::-webkit-scrollbar-thumb { background: var(--ink-720); border-radius: 4px; }
}
@media (min-width: 861px) and (max-width: 1260px) {
  .topbar { flex-wrap: wrap; row-gap: 4px; }
  .topbar .spacer { display: none; }
  .brand { order: 1; }
  .searchbox { order: 2; flex: 1 1 200px; max-width: none; }
  .topbar .rail { order: 3; }
  .topbar .pillnav { order: 4; flex: 1 1 100%; }
}

/* نماذج الترقيم (الإعدادات › الترقيم) كانت تستعمل `.grid-4` ولا قاعدة لها،
   فتصير ستّة حقولٍ متراكمة لكل مستند. و`.form-actions` كذلك بلا قاعدة. */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* نشاط الفريق: القيمة القديمة ← الجديدة هي المعلومة نفسها، وكانت داخل سطرٍ
   مقصوص فلا تُقرأ (وعلى الهاتف تخرج من الشاشة). لها سطرها الملتفّ الآن. */
.t-title.truncate > .chg, .t-title.truncate > .t-sub {
  display: block; margin-inline-start: 0; white-space: normal; overflow-wrap: anywhere;
}

/* لوحة المفاتيح: صفوف القوائم تُفتح بـEnter (ui.js bindRows) ولها حلقة تركيزٍ
   ظاهرة. وحلقة التبويبات وروابط الشريط داخلية: الحاوية تمرّر أفقياً فكانت
   تقصّ الحلقة الخارجية فلا يبقى منها إلا خطّان جانبيّان. */
.tabs button:focus-visible, .pillnav a:focus-visible { outline-offset: -3px; }
table.data tbody tr[tabindex]:focus-visible { outline: none; }
table.data tbody tr[tabindex]:focus-visible > td {
  background: var(--gold-soft);
  box-shadow: inset 0 2px 0 var(--gold-brand), inset 0 -2px 0 var(--gold-brand);
}

/* الهاتف: ‎100vh‎ هو الارتفاع وشريط المتصفّح مطويّ، فكان أسفل الصفحة وأزرار
   «حفظ» في ذيل النافذة تحت شريط العنوان. ‎dvh‎ هو المرئيّ فعلاً (ومتصفّحٌ لا
   يعرفه يُبقي ‎vh‎ أعلاه). والنافذة الأطول من الشاشة تُمرَّر مع خلفيتها.
   (‎90dvh‎ للنافذة في قاعدة ‎.modal‎ الأصل: هنا كان يأتي بعد قاعدة الهاتف
   ‎100dvh‎ بالخصوصية نفسها فيغلبها، فلا تملأ النافذة شاشة الهاتف.) */
@media screen {
  .app { height: 100dvh; }
}
.modal-scrim { overflow-y: auto; }

/* شاشة «تعذّر تحميل النظام»: كانت بألوانٍ ثابتة للمظهر الداكن (#A3B2CC على
   أرضية فاتحة — تباين ١٫٩:١) فلا تُقرأ رسالة الخطأ، وهي أهمّ ما فيها. */
.boot-fail { display: grid; place-items: center; min-height: 100vh; padding: 24px; color: var(--tx); }
.boot-fail-card { max-width: 520px; text-align: center; }
.boot-fail-ico { font-size: 2.4rem; color: var(--gold-brand); margin-bottom: 14px; }
.boot-fail h2 { margin-bottom: 10px; }
.boot-fail p { color: var(--tx-2); line-height: 1.8; margin-bottom: 18px; overflow-wrap: anywhere; }

/* القوائم المالية في وسط الشاشة العريضة لا ملتصقةً بطرفها وفراغٌ بجانبها */
.statement { margin-inline: auto; }

/* صناديق الشعار والختم بيضاء في المظهرين — «لم تُرفع بعد» بلون الفاتح دائماً
   (كان رمادي الداكن على أبيض: تباين ٢٫٧:١) */
.asset-box .muted { color: #5B6577; }

/* مشبك الإرفاق في «مدد»: رسمٌ خطّيّ بلون الأزرار — كان 📎 يظهر على Windows
   رمزاً تعبيرياً ملوّناً غريباً عن بقية الأيقونات */
.ai-clip svg { width: 17px; height: 17px; display: block; color: var(--tx-2); }
.ai-clip:hover svg { color: var(--gold-brand); }
/* ── (/css) ── */

/* ── i18n: الاتجاه في الواجهة الإنجليزية ── */
/* لوحة مدد تقع على الطرف الأيمن في LTR فتُخفى إلى اليمين؛ كانت تُخفى يساراً
   فتعبر الصفحة كلّها عند فتحها */
[dir="ltr"] .ai-panel:not(.open) { transform: translateX(110%); }
/* السهم الرمزيّ «←» بين طرفين يتبع اتجاه القراءة */
[dir="ltr"] .who-arrow { display: inline-block; transform: scaleX(-1); }
/* معادلة السعر «1 USD = 133,000 SYP» كتلةٌ واحدة لا يقسمها السطر */
.rate-eq { unicode-bidi: isolate; white-space: nowrap; }
/* (misc) شريط «إلى أين بعد هذا؟» أزرارُ تنقّل لا مكان لها على الورق — كانت
   تُطبع على «نشاط الفريق» و«ملخّص التجارة» وهما يعرضان «تحميل PDF / طباعة» */
@media print { .gobar { display: none !important; } }
/* (sales) بنود العرض والفاتورة: رأسُ أعمدة يسمّي الخانات (كانت عناوينها
   placeholder يختفي بالكتابة)، وعمود مبلغٍ يتّسع لمبالغ الليرة «61,058,504.50»
   وسطر «للوحدة» تحته بلا التفاف، وأدوات البند: ↑ ↓ ✎ ×.
   [rel-20-10:print] مساراتٌ ثابتة: كل ‎.q-line‎ شبكةٌ وحدها، و‎auto‎ الأخير كان صفراً في
   الرأس (لا أدوات فيه) و118px في البنود، فتنزاح العناوين خانةً نحو اليسار («الوحدة» فوق
   الكمية…). 168px تسع «11,183,850,000.00» وسطر «للوحدة»، و118px = ‎3×26 + 34 + 3×2‎. */
.q-line { grid-template-columns: minmax(0, 1fr) 76px 72px 112px 168px 118px; }
.q-line-head { margin-bottom: 3px; font-size: .74rem; font-weight: 600; color: var(--tx-3); }
.q-line-head .n { text-align: end; padding-inline-end: 4px; }
.q-line-head > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-amt { white-space: nowrap; }
.q-tools { display: flex; align-items: center; gap: 2px; }
.q-tools .icon-btn { width: 26px; height: 32px; font-size: .85rem; }
.q-tools .icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.q-tools .q-note-btn.on { color: var(--gold-brand); }
.q-line > .q-note { grid-column: 1 / -1; margin: 0; min-height: 0; font-size: .86rem; }
/* [rel-20-10:print] الكمية والسعر يساريّا الاتجاه (لا ينقلب السالب ولا الفاصلة) ومحاذاتهما
   يمينٌ تحت عنوانيهما. والوصف والوحدة والتفاصيل باتجاه البيان على الورق (Doc.dirOf):
   يُرى أوّل الوصف الإنجليزيّ لا آخره، و«UPS 6kVA مع بطاريات» يُقرأ من اليمين كما يُطبع،
   وكلّها ملاصقةٌ لليمين في الواجهة العربية. */
.q-line .q-qty, .q-line .q-price { text-align: right; }
[dir="rtl"] .q-line .q-desc, [dir="rtl"] .q-line .q-unit, [dir="rtl"] .q-line .q-note { text-align: right; }
.q-undo {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; padding: 6px 10px;
  border: 1px dashed var(--ink-720); border-radius: var(--r-sm); font-size: .84rem; color: var(--tx-2);
  background: var(--ink-870);
}
.q-undo .btn { margin-inline-start: auto; }
/* [gate-ui] حقل التاريخ في شريط المرشّحات وفي صفٍّ أفقيّ: غلافه (span.df) بعرض
   ‎100%‎ كان يأخذ سطراً كاملاً لكل مرشّح، والمرئيّ نصّيٌّ فلا يلحقه شكل
   ‎.toolbar input[type=date]‎ — فيُعطى الحجم والشكل الكبسوليّ نفسه. */
.toolbar .df, .row .df, .field.inline .df { width: auto; flex: 0 0 150px; }
.toolbar .df > .df-text {
  padding: 7px 34px 7px 12px; font-size: .84rem; border-radius: var(--r-pill); background: var(--field);
}
/* السند: ثلاث مجموعات بترتيب كتابته (الطرف، المبلغ، الدفع والقيد).
   ‎min-width: 0‎: الـfieldset يتّسع افتراضاً لأعرض محتواه فيدفع النافذة أفقياً */
.v-group { border: 1px solid var(--ink-760); border-radius: var(--r-sm); margin: 0 0 12px; padding: 8px 12px 4px; min-width: 0; }
.v-group > legend { padding: 0 6px; font-size: .8rem; font-weight: 600; color: var(--tx-2); }
@media (max-width: 760px) {
  .q-line-head { display: none; }
  .q-line { grid-template-columns: 1fr 1fr; }
  .q-line .q-amt { grid-column: auto; }
  .q-line .q-tools { grid-column: -2 / -1; justify-content: flex-end; }
}
/* [/area:ui] */
