/* ============================================================
   إقرار — نظام التصميم ثلاثي الأبعاد
   مبدأ واحد: كل عنصر تفاعلي له سُمك حقيقي (حافة سفلية + ظل بعيد)،
   وكل بطاقة تطفو فوق خلفيتها وتميل نحو المؤشر.
   الخطوط: Aref Ruqaa للعناوين · IBM Plex Sans Arabic للواجهة · Amiri للوثائق
   ============================================================ */
@import url('/assets/fonts/fonts.css');

:root {
  --disp: 'Aref Ruqaa', 'Amiri', serif;
  --ui:   'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --doc:  'Amiri', 'Traditional Arabic', serif;

  --ink:   #0b2230;
  --ink-2: #33505f;
  --ink-3: #6a8391;
  --line:  #dbe4e9;
  --line-2:#c9d6dd;
  --bg:    #e9eff1;
  --card:  #ffffff;

  --navy:   #0a2a3a;
  --navy-2: #103f54;
  --pri:    #0e7c66;
  --pri-2:  #17b38d;
  --pri-3:  #075846;
  --gold:   #c8a04a;
  --gold-2: #e9c978;
  --gold-3: #8f6d1e;
  --ok:     #12805c;
  --warn:   #d28a0a;
  --dan:    #c0392b;
  --info:   #2b6cb0;

  --r: 20px;
  --r-s: 12px;
  --sh-1: 0 1px 0 #fff inset, 0 2px 4px rgba(11,34,48,.05), 0 10px 22px -12px rgba(11,34,48,.22);
  --sh-2: 0 1px 0 #fff inset, 0 -1px 0 rgba(11,34,48,.04) inset, 0 2px 4px rgba(11,34,48,.05),
          0 14px 26px -14px rgba(11,34,48,.22), 0 36px 54px -36px rgba(11,34,48,.30);
  --sh-3: 0 2px 0 rgba(255,255,255,.7) inset, 0 4px 6px rgba(11,34,48,.06),
          0 26px 40px -18px rgba(11,34,48,.32), 0 60px 80px -50px rgba(11,34,48,.4);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; direction: rtl;
  font-family: var(--ui); font-size: 15px; line-height: 1.75; color: var(--ink);
  background:
    radial-gradient(1100px 560px at 88% -8%, #d6efe8 0, transparent 60%),
    radial-gradient(900px 520px at -8% 108%, #f1e7cf 0, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.4; }
h1, h2 { font-family: var(--disp); font-weight: 700; }
a { color: var(--pri); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
svg.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.mono { font-family: 'IBM Plex Sans Arabic', ui-monospace, monospace; direction: ltr; unicode-bidi: embed; letter-spacing: .3px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.hide { display: none !important; }
.noprint {}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #b7c6cf; border: 3px solid transparent; background-clip: padding-box; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- تخطيط عام ---------- */
.row   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.grid  { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ============================================================
   البطاقة — تطفو وتميل نحو المؤشر
   ============================================================ */
.card {
  position: relative; background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
  border: 1px solid rgba(11,34,48,.06); border-radius: var(--r);
  box-shadow: var(--sh-2); padding: 22px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.card.flat { box-shadow: var(--sh-1); }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 17px; font-weight: 700; font-family: var(--ui); }
.card-h .sub { color: var(--ink-3); font-size: 12.5px; }

.tilt { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.tilt::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.65), transparent 55%);
  opacity: 0; transition: opacity .25s; mix-blend-mode: soft-light;
}
.tilt.on { box-shadow: var(--sh-3); }
.tilt.on::after { opacity: 1; }

/* ============================================================
   الأزرار — سُمك حقيقي يُضغط عند النقر
   ============================================================ */
.btn {
  --edge: #b5c3cc; --hi: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; user-select: none; white-space: nowrap;
  padding: 10px 20px; border-radius: 13px; font-weight: 600; font-size: 14.5px;
  color: var(--ink); background: linear-gradient(180deg, #ffffff, #eaf0f3);
  border: 1px solid #c8d5dc;
  box-shadow: 0 1px 0 var(--hi) inset, 0 4px 0 var(--edge), 0 10px 16px -6px rgba(11,34,48,.32);
  transform: translateY(0); transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--hi) inset, 0 6px 0 var(--edge), 0 16px 20px -8px rgba(11,34,48,.34); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 var(--edge), 0 2px 4px rgba(11,34,48,.3); }
.btn:focus-visible { outline: 3px solid rgba(23,179,141,.45); outline-offset: 2px; }
.btn[disabled], .btn.off { opacity: .55; pointer-events: none; filter: grayscale(.4); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.pri  { --edge: var(--pri-3); --hi: rgba(255,255,255,.35); color: #fff; border-color: #0a6a56;
            background: linear-gradient(180deg, #1fc39c 0%, #0e7c66 100%); text-shadow: 0 1px 0 rgba(0,0,0,.22); }
.btn.gold { --edge: var(--gold-3); --hi: rgba(255,255,255,.5); color: #3a2806; border-color: #b58c34;
            background: linear-gradient(180deg, #f3d98f 0%, #c8a04a 100%); }
.btn.dan  { --edge: #8a2218; --hi: rgba(255,255,255,.3); color: #fff; border-color: #a52f22;
            background: linear-gradient(180deg, #e8655a 0%, #c0392b 100%); text-shadow: 0 1px 0 rgba(0,0,0,.22); }
.btn.navy { --edge: #041620; --hi: rgba(255,255,255,.18); color: #fff; border-color: #0a2a3a;
            background: linear-gradient(180deg, #1a5570 0%, #0a2a3a 100%); }
.btn.ghost { --edge: transparent; background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(11,34,48,.06); transform: none; box-shadow: none; }
.btn.ghost:active { transform: scale(.97); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; border-radius: 11px; box-shadow: 0 1px 0 var(--hi) inset, 0 3px 0 var(--edge), 0 8px 12px -6px rgba(11,34,48,.3); }
.btn.sm:hover { box-shadow: 0 1px 0 var(--hi) inset, 0 5px 0 var(--edge), 0 12px 16px -8px rgba(11,34,48,.3); }
.btn.sm:active { box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 var(--edge), 0 2px 4px rgba(11,34,48,.3); transform: translateY(3px); }
.btn.xs { padding: 4px 10px; font-size: 12.5px; border-radius: 9px; box-shadow: 0 1px 0 var(--hi) inset, 0 2px 0 var(--edge), 0 5px 8px -4px rgba(11,34,48,.3); }
.btn.xs:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--hi) inset, 0 0 0 var(--edge); }
.btn.icon { padding: 9px; width: 40px; height: 40px; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 28px; font-size: 16.5px; border-radius: 16px; }

/* ============================================================
   النماذج
   ============================================================ */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f > span, .flabel { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.f-hint { font-size: 12px; color: var(--ink-3); line-height: 1.7; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel],
input[type=search], input[type=email], input:not([type]), select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #f3f7f9, #fff); outline: none;
  box-shadow: inset 0 2px 4px rgba(11,34,48,.09), 0 1px 0 #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.85; }
input:focus, select:focus, textarea:focus {
  border-color: var(--pri-2); box-shadow: inset 0 2px 4px rgba(11,34,48,.07), 0 0 0 4px rgba(23,179,141,.2);
}
input::placeholder, textarea::placeholder { color: #9bb0bb; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--pri); flex: none; }
input[type=file] { padding: 9px; background: #fff; }
input[type=range] { padding: 0; box-shadow: none; background: none; border: 0; accent-color: var(--pri); }
.ltr { direction: ltr; text-align: left; }
.ffull { grid-column: 1 / -1; }
.fgrid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .fgrid { grid-template-columns: 1fr; } }

.pledge {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: linear-gradient(180deg, #fbf7ea, #f5eed6); border: 1px solid #e3d5a4; border-radius: 15px;
  box-shadow: 0 1px 0 #fff inset, 0 3px 0 #e0cf94;
}
.pledge .tx { font-size: 14px; line-height: 1.85; color: #4a3b0c; }

.search { position: relative; min-width: 220px; }
.search svg { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input { padding-right: 40px; }

.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 2; margin: 0; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #c4d1d8; box-shadow: inset 0 2px 4px rgba(11,34,48,.25); transition: .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(180deg, #fff, #e6edf1); box-shadow: 0 2px 4px rgba(11,34,48,.35); transition: .2s; }
.switch input:checked + i { background: linear-gradient(180deg, #1fc39c, #0e7c66); }
.switch input:checked + i::after { right: 23px; }

/* ============================================================
   الشارات والحالات
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.9;
  background: #eaf0f3; color: var(--ink-2); box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(11,34,48,.08);
}
.chip.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.chip.signed, .chip.pub  { background: #dcf3ea; color: #0b6b4c; }
.chip.paper              { background: #e1ecfa; color: #1f5a9a; }
.chip.viewed, .chip.warn { background: #fbf0d3; color: #8c6205; }
.chip.none, .chip.draft  { background: #e9eef1; color: #5b7482; }
.chip.arch               { background: #ece6f5; color: #5b3f8c; }
.chip.dan                { background: #fbe1de; color: #a5271b; }
.chip.gold               { background: #f7ecc9; color: #7a5a10; }

/* ============================================================
   أشرطة نسب ثلاثية الأبعاد — وجه أمامي مع سُمك تحته
   ============================================================ */
.b3 { position: relative; display: flex; height: 13px; border-radius: 8px; background: #d9e3e8;
      box-shadow: inset 0 3px 4px rgba(11,34,48,.2), 0 1px 0 #fff; margin: 4px 0 8px; }
.b3 > i { display: block; height: 100%; width: var(--w, 0%); transition: width .9s cubic-bezier(.2,.9,.2,1);
  background: linear-gradient(180deg, var(--c1, #22c69c), var(--c2, #0e7c66));
  box-shadow: 0 4px 0 var(--c3, #075846), 0 8px 8px -3px rgba(11,34,48,.35), inset 0 1px 0 rgba(255,255,255,.55);
  border-radius: 8px; position: relative; transform: translateY(-2px); }
.b3 > i + i { margin-right: -6px; }
.b3 > i.paper  { --c1: #5aa2e8; --c2: #2b6cb0; --c3: #174a7f; }
.b3 > i.viewed { --c1: #f1c04f; --c2: #d28a0a; --c3: #8c5c04; }
.b3 > i.none   { --c1: #b6c4cc; --c2: #93a5b0; --c3: #6b7f8b; }
.b3.thin { height: 9px; }
.b3.tall { height: 18px; border-radius: 10px; }
.b3.tall > i { border-radius: 10px; }

/* حلقة النسبة — قرص بارز */
.ring3 { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.ring3::before { content: ''; position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff, #e9f0f3); box-shadow: inset 0 3px 6px rgba(255,255,255,.9), inset 0 -6px 10px rgba(11,34,48,.12), 0 10px 18px -6px rgba(11,34,48,.35); }
.ring3 svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 7px 4px rgba(11,34,48,.28)); }
.ring3 .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--disp); font-weight: 700; font-size: 28px; color: var(--ink); line-height: 1.1; }
.ring3 .val small { font-family: var(--ui); font-size: 11px; font-weight: 500; color: var(--ink-3); display: block; }

/* ============================================================
   بطاقات الأرقام — مكعّب بارز بجانب القيمة
   ============================================================ */
.kpi { display: flex; align-items: center; gap: 16px; }
.kpi .cube { --c1: #22c69c; --c2: #0e7c66; --c3: #075846;
  width: 58px; height: 58px; flex: none; display: grid; place-items: center; color: #fff; border-radius: 17px;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 0 2px 2px rgba(255,255,255,.55), inset 0 -5px 8px rgba(0,0,0,.2),
              0 8px 0 -1px var(--c3), 0 16px 18px -6px rgba(11,34,48,.4);
  transform: translateY(-4px) rotate(-3deg); transition: transform .25s; }
.card:hover .kpi .cube { transform: translateY(-7px) rotate(3deg); }
.kpi .cube svg { width: 27px; height: 27px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)); }
.kpi .cube.gold { --c1: #f3d98f; --c2: #c8a04a; --c3: #8f6d1e; color: #4a3407; }
.kpi .cube.blue { --c1: #5aa2e8; --c2: #2b6cb0; --c3: #174a7f; }
.kpi .cube.warn { --c1: #f5c95c; --c2: #d28a0a; --c3: #8c5c04; }
.kpi .cube.dan  { --c1: #ee7a70; --c2: #c0392b; --c3: #8a2218; }
.kpi .cube.navy { --c1: #2a6f8c; --c2: #0a2a3a; --c3: #04141d; }
.kpi .num { font-family: var(--disp); font-size: 36px; font-weight: 700; line-height: 1.05; }
.kpi .lbl { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ============================================================
   الهيكل: قائمة جانبية + محتوى
   ============================================================ */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px;
  color: #d6e6ec; overflow-y: auto;
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(23,179,141,.28), transparent 60%),
    radial-gradient(420px 320px at 0% 100%, rgba(200,160,74,.22), transparent 60%),
    linear-gradient(180deg, #0d3346 0%, #081f2c 100%);
  box-shadow: -20px 0 40px -20px rgba(4,20,29,.5), inset -1px 0 0 rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; color: #fff; }
.brand .mark { width: 46px; height: 46px; flex: none; }
.brand b { font-family: var(--disp); font-size: 27px; line-height: 1; display: block; }
.brand small { font-size: 11.5px; color: #9cbccb; display: block; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav .sec { font-size: 11px; letter-spacing: .5px; color: #7ea3b3; padding: 14px 12px 4px; }
.nav a, .nav button.nv {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; cursor: pointer;
  padding: 11px 14px; border-radius: 14px; border: 0; background: transparent; color: #cfe1e8; font-weight: 500; font-size: 14.5px;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.nav a svg, .nav button.nv svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav a:hover, .nav button.nv:hover { background: rgba(255,255,255,.07); transform: translateX(-3px); }
.nav a.on, .nav button.nv.on {
  color: #fff; font-weight: 700; transform: translateX(-6px);
  background: linear-gradient(180deg, #1e8f77 0%, #0e6653 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 4px 0 #063f33, 0 12px 20px -6px rgba(0,0,0,.5);
}
.nav a.on::after { content: ''; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-2); box-shadow: 0 0 10px var(--gold-2); transform: translateY(-50%); }
.nav .cnt { margin-right: auto; background: rgba(255,255,255,.14); border-radius: 99px; padding: 0 9px; font-size: 12px; }
.side .foot { margin-top: auto; padding: 14px 10px 4px; font-size: 12px; color: #86a9b8; border-top: 1px solid rgba(255,255,255,.08); }
.side .who { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 700; color: #3a2806;
  background: linear-gradient(145deg, #f3d98f, #c8a04a); box-shadow: inset 0 2px 2px rgba(255,255,255,.55), 0 4px 0 #8f6d1e, 0 8px 12px -4px rgba(0,0,0,.45); }

.veil { position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0; background: rgba(4,20,29,.55); backdrop-filter: blur(3px); transition: opacity .25s; }
.veil.open { opacity: 1; pointer-events: auto; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 80px; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.top h1 { font-size: 34px; line-height: 1.35; }
.top .sub { color: var(--ink-3); font-size: 14px; margin-top: 6px; }
.burger { display: none; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; width: 292px; right: 0; transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .side { visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s; }
  .side.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .burger { display: inline-flex; }
}

/* ============================================================
   الجداول
   ============================================================ */
.tw { overflow: auto; border-radius: 16px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 14px; }
table.t th { position: sticky; top: 0; z-index: 2; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--ink-3);
  padding: 4px 14px; background: transparent; white-space: nowrap; }
table.t td { padding: 12px 14px; background: #fff; vertical-align: middle;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table.t td:first-child { border-right: 1px solid var(--line); border-radius: 0 14px 14px 0; }
table.t td:last-child { border-left: 1px solid var(--line); border-radius: 14px 0 0 14px; }
table.t tbody tr { transition: transform .15s, filter .15s; filter: drop-shadow(0 3px 3px rgba(11,34,48,.05)); }
table.t tbody tr:hover { transform: translateY(-2px) scale(1.002); filter: drop-shadow(0 10px 8px rgba(11,34,48,.12)); }
table.t tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: center !important; white-space: nowrap; }

/* ============================================================
   التبويبات والأزرار المقسّمة
   ============================================================ */
.seg { display: inline-flex; padding: 5px; gap: 4px; border-radius: 16px; background: #dbe5ea;
  box-shadow: inset 0 3px 5px rgba(11,34,48,.16), 0 1px 0 #fff; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; cursor: pointer; padding: 8px 16px; border-radius: 12px; font-weight: 600; color: var(--ink-2); font-size: 14px;
  transition: .18s; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); background: linear-gradient(180deg, #fff, #f1f6f8); box-shadow: 0 1px 0 #fff inset, 0 3px 0 #b5c3cc, 0 8px 12px -6px rgba(11,34,48,.35); transform: translateY(-1px); }
.seg .n { display: inline-block; margin-right: 6px; background: rgba(11,34,48,.08); border-radius: 99px; padding: 0 8px; font-size: 12px; }

/* ============================================================
   النوافذ المنبثقة
   ============================================================ */
.modal-bg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
  background: rgba(6,26,37,.55); backdrop-filter: blur(6px); animation: fadeIn .2s; overflow-y: auto; perspective: 1400px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fff, #f6fafb); border-radius: 24px; box-shadow: var(--sh-3), 0 0 0 1px rgba(255,255,255,.4) inset;
  animation: pop3d .42s cubic-bezier(.2,1.1,.3,1); transform-origin: 50% 100%; }
.modal.wide { width: min(880px, 100%); }
.modal.xl { width: min(1100px, 100%); }
.modal-hd { display: flex; align-items: center; gap: 12px; padding: 18px 24px 8px; }
.modal-hd h3 { font-family: var(--disp); font-size: 25px; flex: 1; }
.modal-hd .x { width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; background: #e7eef1; font-size: 15px;
  box-shadow: 0 2px 0 #b5c3cc; }
.modal-hd .x:active { transform: translateY(2px); box-shadow: none; }
.modal-bd { padding: 10px 24px 18px; overflow-y: auto; }
.modal-ft { display: flex; gap: 12px; flex-wrap: wrap; padding: 14px 24px 22px; border-top: 1px solid var(--line); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop3d { from { opacity: 0; transform: rotateX(16deg) translateY(50px) scale(.94); } }

/* ============================================================
   الإشعارات
   ============================================================ */
#toast { position: fixed; z-index: 300; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
#toast .t { pointer-events: auto; padding: 12px 22px; border-radius: 15px; font-weight: 600; color: #fff; max-width: min(92vw, 520px); text-align: center;
  background: linear-gradient(180deg, #16455a, #0a2a3a); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 0 #04141d, 0 18px 26px -10px rgba(0,0,0,.5);
  animation: toastIn .45s cubic-bezier(.2,1.2,.3,1); }
#toast .t.ok  { background: linear-gradient(180deg, #1fc39c, #0e7c66); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 4px 0 #063f33, 0 18px 26px -10px rgba(0,0,0,.45); }
#toast .t.dan { background: linear-gradient(180deg, #e8655a, #c0392b); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 4px 0 #7a1d13, 0 18px 26px -10px rgba(0,0,0,.45); }
#toast .t.warn{ background: linear-gradient(180deg, #f3d98f, #c8a04a); color: #3a2806; box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 4px 0 #8f6d1e, 0 18px 26px -10px rgba(0,0,0,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(30px) rotateX(40deg) scale(.9); } }

/* ============================================================
   أشكال مساعدة
   ============================================================ */
.empty { text-align: center; padding: 46px 18px; color: var(--ink-3); }
.empty .em-ic { width: 86px; height: 86px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 26px; color: var(--ink-3);
  background: linear-gradient(145deg, #fff, #e3ebef); box-shadow: inset 0 2px 2px #fff, inset 0 -5px 8px rgba(11,34,48,.08), 0 8px 0 -1px #c5d2d9, 0 18px 22px -8px rgba(11,34,48,.25); transform: rotate(-4deg); }
.empty .em-ic svg { width: 40px; height: 40px; }
.empty h3 { font-family: var(--disp); font-size: 24px; color: var(--ink); margin-bottom: 4px; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 15px; font-size: 14px; line-height: 1.85;
  background: linear-gradient(180deg, #eef7fb, #e5f1f7); border: 1px solid #c7e0ec; color: #1a4a64; box-shadow: 0 3px 0 #c7e0ec; }
.note.warn { background: linear-gradient(180deg, #fdf6df, #f9edc7); border-color: #ecd691; color: #6b4d05; box-shadow: 0 3px 0 #ecd691; }
.note.dan  { background: linear-gradient(180deg, #fdeceb, #fadbd8); border-color: #f0b1ab; color: #8a2218; box-shadow: 0 3px 0 #f0b1ab; }
.note svg { width: 22px; height: 22px; flex: none; margin-top: 3px; }
.hr { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 18px 0; border: 0; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 8px; background: #e6eef2; color: var(--ink-2); font-size: 12.5px; }
.skeleton { border-radius: 12px; min-height: 18px; background: linear-gradient(100deg, #e4ecef 30%, #f3f7f9 50%, #e4ecef 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { width: 22px; height: 22px; border: 3px solid rgba(11,34,48,.15); border-top-color: var(--pri); border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.rise { animation: rise .55s cubic-bezier(.2,.9,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) rotateX(10deg); } }

/* ============================================================
   لوحة التوقيع — ورقة على مكتب، تنتصب عند اللمس
   ============================================================ */
.sigpad { position: relative; perspective: 900px; }
.sigpad .sheet {
  position: relative; height: 210px; border-radius: 16px; overflow: hidden; touch-action: none; cursor: crosshair;
  background: linear-gradient(180deg, #fffefb, #f8f4e8);
  border: 1px solid #dfd6b8;
  box-shadow: 0 1px 0 #fff inset, 0 6px 0 #d9cfa9, 0 22px 30px -12px rgba(60,44,8,.45), inset 0 0 40px rgba(200,160,74,.10);
  transform: rotateX(9deg) translateY(0); transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.2,.9,.2,1), box-shadow .35s;
}
.sigpad:hover .sheet, .sigpad.active .sheet { transform: rotateX(0deg) translateY(-3px); box-shadow: 0 1px 0 #fff inset, 0 9px 0 #d9cfa9, 0 30px 36px -14px rgba(60,44,8,.5), inset 0 0 40px rgba(200,160,74,.10); }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sigpad .base { position: absolute; right: 26px; left: 26px; bottom: 54px; height: 0; border-top: 2px dashed rgba(143,109,30,.4); pointer-events: none; }
.sigpad .mark { position: absolute; right: 30px; bottom: 60px; font-family: var(--disp); font-size: 34px; color: rgba(143,109,30,.4); pointer-events: none; line-height: 1; }
.sigpad .hint { position: absolute; inset: auto 0 16px 0; text-align: center; font-size: 13px; color: #a08a4c; pointer-events: none; transition: opacity .2s; }
.sigpad.filled .hint, .sigpad.filled .mark { opacity: 0; }
.sigpad .tools { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   المخطط الزمني
   ============================================================ */
.tl { position: relative; padding-right: 26px; }
.tl::before { content: ''; position: absolute; right: 8px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, var(--pri-2), var(--line-2)); }
.tl .it { position: relative; padding: 4px 0 16px; }
.tl .it::before { content: ''; position: absolute; right: -25px; top: 9px; width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--c, var(--pri-2))); box-shadow: 0 3px 0 rgba(11,34,48,.2), 0 0 0 3px #fff; }

/* ============================================================
   الطباعة
   ============================================================ */
@media print {
  body { background: #fff !important; }
  .noprint, .side, .top .row, .veil, #toast { display: none !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}
