/* ==========================================================================
   OSN NGO — Design System
   لتغيير الهوية كلها عدّل متغيرات :root فقط.
   ========================================================================== */
:root {
  /* Brand — زمردي عميق */
  --brand-950: #060d24;
  --brand-900: #0a1a47;
  --brand-800: #0f2a6b;
  --brand-700: #163a8f;
  --brand-600: #1f4fb5;
  --brand-500: #3a6fd8;
  --brand-100: #dbe6fb;
  --brand-50:  #eef3fd;
  /* Accent — ذهبي */
  --gold-600: #b8891f;
  --gold-500: #cda349;
  --gold-100: #f7ecd0;
  /* Neutrals — دافئة */
  --ink: #0f1c18;
  --ink-2: #3b4a44;
  --muted: #5b6a64;   /* تباين 5.2+ على كل الخلفيات الفاتحة (كان #6f7e78 = 3.9) */
  --line: #e8e6dd;
  --line-soft: #f0eee6;
  --canvas: #f6f5f0;
  --surface: #ffffff;
  --soft: #fbfaf6;
  --soft-2: #fcfbf8;
  --field: #ffffff;
  --line-strong: #d3d0c4;
  --link: #1e4fb0;
  /* Status */
  --ok: #138a6c;   --ok-bg: #e2f5ee;
  --info: #3569c9; --info-bg: #e5edfb;
  --warn: #a8761a; --warn-bg: #fbf0d6;
  --bad: #b3361f;  --bad-bg: #fbe6e1;
  --off: #667570;  --off-bg: #eceee9;
  /* Charts (categorical, fixed order) */
  --ch-1: #1f4fb5; --ch-2: #cda349; --ch-3: #8e4fa3;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,28,24,.05);
  --shadow: 0 1px 2px rgba(15,28,24,.04), 0 12px 32px -14px rgba(15,28,24,.14);
  --shadow-lg: 0 2px 4px rgba(15,28,24,.05), 0 30px 60px -24px rgba(6,13,36,.30);

  --bs-body-font-family: var(--font), "Segoe UI", Tahoma, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--canvas);
  --bs-primary: var(--brand-700);
  --bs-primary-rgb: 22, 58, 143;
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--brand-900);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--ink);
  --bs-border-color: var(--line);
}

* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body { font-family: var(--bs-body-font-family); background: var(--canvas); color: var(--ink); font-size: .96rem; line-height: 1.65; font-feature-settings: "tnum"; }
h1,h2,h3,h4,h5 { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
a { text-decoration: none; }
::selection { background: var(--brand-100); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); padding: .6rem 1.15rem; transition: all .18s ease; display: inline-flex; align-items: center; gap: .5rem; justify-content: center; }
.btn-sm { padding: .38rem .8rem; border-radius: 10px; font-size: .86rem; }
.btn-primary { --bs-btn-bg: var(--brand-700); --bs-btn-border-color: var(--brand-700); --bs-btn-hover-bg: var(--brand-800); --bs-btn-hover-border-color: var(--brand-800); --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900); --bs-btn-focus-shadow-rgb: 22,58,143;
  background-image: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0)); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(22,58,143,.55); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 22px -8px rgba(22,58,143,.6); }
.btn-gold { background: linear-gradient(180deg, #d9b25a, var(--gold-500)); color: #2b2008; border: 0; box-shadow: 0 6px 16px -6px rgba(184,137,31,.6); }
.btn-gold:hover { color: #2b2008; transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-soft { background: var(--brand-50); color: var(--brand-800); border: 1px solid var(--brand-100); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-900); }
.btn-line { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-line:hover { border-color: var(--line-strong); color: var(--ink); background: var(--soft-2); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn-danger-soft { background: var(--bad-bg); color: var(--bad); border: 1px solid transparent; }
.btn-danger-soft:hover { background: #f7d6cf; color: var(--bad); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: .4rem; }
.form-control, .form-select { border-radius: var(--radius-sm); border: 1px solid var(--line); padding: .72rem .95rem; background-color: var(--field); color: var(--ink); transition: all .15s; }
.form-control::placeholder { color: #a3aea9; }
.form-control:hover, .form-select:hover { border-color: var(--line-strong); }
.form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(58,111,216,.16); }
.form-check-input:checked { background-color: var(--brand-700); border-color: var(--brand-700); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .form-control { padding-inline-start: 2.6rem; }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; padding: 16px; gap: 16px; }
.rail { width: 272px; flex-shrink: 0; position: sticky; top: 16px; height: calc(100vh - 32px); border-radius: 26px; display: flex; flex-direction: column; color: #cfe3dc; overflow: hidden;
  background:
    radial-gradient(420px 260px at 85% -6%, rgba(205,163,73,.20), transparent 70%),
    radial-gradient(380px 300px at -10% 105%, rgba(58,111,216,.22), transparent 70%),
    linear-gradient(170deg, var(--brand-900), var(--brand-950));
  box-shadow: var(--shadow-lg); z-index: 1040; }
.rail::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(180deg, #000, transparent 60%); }
.rail-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 24px 22px 18px; color: #fff; }
.rail-brand .mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; color: var(--brand-950);
  background: linear-gradient(145deg, #e6c571, var(--gold-500)); box-shadow: 0 8px 20px -8px rgba(205,163,73,.8), inset 0 1px 0 rgba(255,255,255,.5); }
.rail-brand b { display: block; font-size: 1.12rem; letter-spacing: .02em; line-height: 1.2; }
.rail-brand small { display: block; font-size: .72rem; opacity: .6; line-height: 1.3; }
.rail nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 8px 14px; scrollbar-width: none; }
.rail nav::-webkit-scrollbar { display: none; }
.rail-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.38); padding: 18px 12px 8px; }
.rail-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 3px; border-radius: 14px; color: #bcd5cc; font-weight: 500; transition: all .16s ease; }
.rail-link .ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.06); font-size: 1.05rem; transition: all .16s; }
.rail-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail-link:hover .ico { background: rgba(255,255,255,.12); }
.rail-link.active { background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.rail-link.active .ico { background: linear-gradient(145deg, #e6c571, var(--gold-500)); color: var(--brand-950); box-shadow: 0 6px 14px -6px rgba(205,163,73,.9); }
.rail-link.is-soon { opacity: .5; cursor: default; }
.rail-link.is-soon:hover { background: transparent; }
.rail-link .tag { margin-inline-start: auto; font-size: .64rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: rgba(255,255,255,.1); color: #d9ebe4; }
.rail-foot { position: relative; z-index: 1; margin: 10px 14px 14px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(8px); }
.rail-foot .org { font-weight: 600; color: #fff; font-size: .92rem; line-height: 1.35; }
.rail-foot .meta { font-size: .76rem; opacity: .65; margin-top: 2px; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 18px; }
.topbar .where { display: flex; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: .86rem; box-shadow: var(--shadow-sm); }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.userbtn { font: inherit; color: inherit; text-align: inherit; display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; }
[dir="rtl"] .userbtn { padding: 5px 14px 5px 6px; }
.userbtn .nm { font-weight: 600; font-size: .86rem; line-height: 1.2; }
.userbtn .rl { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 210px; }
.dropdown-item { border-radius: 10px; padding: 9px 12px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.dropdown-item:active { background: var(--brand-700); }
.topbar, .page { width: 100%; max-width: 1400px; margin-inline: auto; }
.page { flex: 1; padding: 0 8px 32px; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head > div:first-child { flex: 1 1 280px; min-width: 0; }
.page-head > div:last-child:not(:first-child) { flex: 0 0 auto; }
.page-head .eyebrow { font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 4px; }
.page-head h1 { font-size: 1.75rem; margin: 0; line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 1.02rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.card-head h3 .hi { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; font-size: 1rem; }
.card-body { padding: 22px; }
/* الأسماء الطويلة من غير مسافات مابتطلعش برّه العنوان أو الكارت (مراجعة QA الجولة الخامسة) */
.page-head h1, .page-head p, .page-head .eyebrow { overflow-wrap: anywhere; }
.card-head h3 { min-width: 0; overflow-wrap: anywhere; }
.card-head h3 .hi { flex: 0 0 auto; }
.card .fw-bold, .card .fw-semibold, .cell-main .t, .tile .min-w-0 { overflow-wrap: break-word; word-break: break-word; min-width: 0; }
/* كلمة السر + زرار العين (إظهار/إخفاء) */
.pw-field { position: relative; }
/* الخانة dir="ltr" فالزرار على الشمال دايمًا والمسافة على شمال الخانة (أوضح في الصفحة العربي) */
.pw-field > .form-control { padding-left: 2.6rem; }
.pw-field > .pw-eye { position: absolute; top: 0; bottom: 0; left: 0; width: 2.5rem; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius); }
.pw-field > .pw-eye:hover, .pw-field > .pw-eye:focus-visible { color: var(--brand-700); }
.pw-field > .pw-eye[aria-pressed="true"] { color: var(--brand-700); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 34px 36px; color: #fff; margin-bottom: 22px; box-shadow: var(--shadow-lg);
  background:
    radial-gradient(520px 300px at 90% -20%, rgba(205,163,73,.38), transparent 70%),
    radial-gradient(420px 320px at 0% 120%, rgba(58,111,216,.45), transparent 70%),
    linear-gradient(135deg, var(--brand-800), var(--brand-950)); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(120deg, transparent 30%, #000); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .78rem; font-weight: 600; margin-bottom: 14px; }
.hero h1 { color: #fff; font-size: 2rem; margin: 0 0 6px; }
.hero p { margin: 0; color: rgba(255,255,255,.75); max-width: 560px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; padding: 20px 22px; height: 100%; }
.kpi::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tint, var(--brand-50)); opacity: .9; }
.kpi .ico { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 1.3rem; background: var(--tint, var(--brand-50)); color: var(--tone, var(--brand-700)); margin-bottom: 18px; }
.kpi .num { position: relative; z-index: 1; font-size: 2.25rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.kpi .lbl { position: relative; z-index: 1; color: var(--muted); font-weight: 500; margin-top: 8px; font-size: .88rem; }
.tone-ok   { --tint: var(--ok-bg);   --tone: var(--ok); }
.tone-info { --tint: var(--info-bg); --tone: var(--info); }
.tone-warn { --tint: var(--warn-bg); --tone: var(--warn); }
.tone-bad  { --tint: var(--bad-bg);  --tone: var(--bad); }
.tone-gold { --tint: var(--gold-100); --tone: var(--gold-600); }

/* ---------- Tables ---------- */
.table-modern { margin: 0; --bs-table-bg: transparent; }
.table-modern thead th { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--soft); border-bottom: 1px solid var(--line); padding: 13px 22px; white-space: nowrap; }
.table-modern tbody td { padding: 16px 22px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr { transition: background .12s; }
.table-modern tbody tr:hover { background: var(--soft-2); }
.cell-main { display: flex; align-items: center; gap: 14px; }
.cell-main .t { font-weight: 600; line-height: 1.3; }
.cell-main .s { font-size: .8rem; color: var(--muted); line-height: 1.3; }

.avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; color: var(--c, var(--brand-800)); background: var(--bg, var(--brand-100)); }
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: .88rem; }
.avatar.round { border-radius: 50%; }
.av-0 { --c: #0f2a6b; --bg: #dbe6fb; } .av-1 { --c: #8a6414; --bg: #f7ecd0; } .av-2 { --c: #274f9e; --bg: #e0e9fb; } .av-3 { --c: #7a3a8a; --bg: #f1e3f6; } .av-4 { --c: #a8431f; --bg: #fbe4da; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 12px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--off-bg); color: var(--off); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { background: var(--ok-bg); color: var(--ok); }
.pill-trial { background: var(--info-bg); color: var(--info); }
.pill-expired { background: var(--bad-bg); color: var(--bad); }
.pill-suspended { background: var(--warn-bg); color: var(--warn); }
.pill-soon { background: var(--gold-100); color: var(--gold-600); }

.empty { text-align: center; padding: 56px 24px; }
.empty .art { width: 84px; height: 84px; border-radius: 28px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 2.1rem; color: var(--brand-600);
  background: radial-gradient(circle at 30% 20%, var(--surface), var(--brand-50)); border: 1px solid var(--brand-100); box-shadow: 0 14px 30px -14px rgba(22,58,143,.4); }
.empty h4 { font-size: 1.1rem; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

/* ---------- Module tiles ---------- */
.tile { position: relative; overflow: hidden; padding: 24px; height: 100%; transition: all .2s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.tile .ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; margin-bottom: 18px; box-shadow: 0 12px 24px -10px var(--glow, rgba(22,58,143,.7)); background: linear-gradient(145deg, var(--g1, #1ca585), var(--g2, #0e4f42)); }
.tile h3 { font-size: 1.08rem; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.t-green { --g1:#4f86f0; --g2:#163a8f; --glow: rgba(22,58,143,.7); }
.t-gold  { --g1:#e0b960; --g2:#b8891f; --glow: rgba(184,137,31,.7); }
.t-blue  { --g1:#5b8def; --g2:#2a53b5; --glow: rgba(42,83,181,.6); }
.t-plum  { --g1:#b06cc6; --g2:#6b2f82; --glow: rgba(107,47,130,.6); }
.t-coral { --g1:#f08a5d; --g2:#b3431f; --glow: rgba(179,67,31,.6); }

.ring { --p: 70; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--line-soft) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; text-align: center; line-height: 1.1; }
.ring b { display: block; font-size: 1.9rem; letter-spacing: -.02em; }
.ring small { color: var(--muted); font-size: .72rem; }

.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line-soft); gap: 3px; }
.stackbar i { display: block; height: 100%; border-radius: 99px; min-width: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.legend div { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .88rem; }
.legend i { width: 10px; height: 10px; border-radius: 4px; }

.qa { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); transition: all .16s; background: #fff; }
.qa + .qa { margin-top: 10px; }
.qa:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--ink); transform: translateX(-2px); }
[dir="ltr"] .qa:hover { transform: translateX(2px); }
.qa .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: 1.15rem; }
.qa b { display: block; line-height: 1.3; } .qa small { color: var(--muted); }
.qa .go { margin-inline-start: auto; color: var(--muted); }
[dir="rtl"] .qa .go { transform: scaleX(-1); }

.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 1.05rem; }
.form-section { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding: 26px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-of-type { border-bottom: 0; }
.form-section .hint h3 { font-size: 1rem; margin-bottom: 4px; }
.form-section .hint p { color: var(--muted); font-size: .86rem; margin: 0; }
.form-actions { display: flex; gap: 10px; padding: 18px 26px; background: var(--soft); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.mod-check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: all .15s; margin: 0; }
.mod-check:hover { border-color: var(--line-strong); }
.mod-check:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }

.alert { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--ok-bg); color: #0b5e49; }
.alert-danger { background: var(--bad-bg); color: #8b2814; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(640px 420px at 100% 0%, rgba(205,163,73,.38), transparent 70%),
    radial-gradient(560px 460px at 0% 100%, rgba(58,111,216,.5), transparent 70%),
    linear-gradient(150deg, var(--brand-800), var(--brand-950)); }
.auth-brand::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); pointer-events: none; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand h2 { color: #fff; font-size: 2.6rem; line-height: 1.25; max-width: 520px; margin-bottom: 14px; }
.auth-brand h2 em { font-style: normal; color: #e8c978; }
.auth-brand .lead { color: rgba(255,255,255,.72); max-width: 480px; font-size: 1.05rem; }
.feat { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; }
.feat .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); font-size: 1.1rem; color: #e8c978; flex-shrink: 0; }
.feat b { display: block; line-height: 1.3; } .feat span { color: rgba(255,255,255,.65); font-size: .88rem; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; position: relative; background: radial-gradient(500px 300px at 100% 0%, var(--brand-50), transparent 70%), var(--surface); }
.auth-form .box { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form .lang { position: absolute; top: 28px; inset-inline-end: 32px; }
.auth-form h1 { font-size: 1.8rem; margin-bottom: 6px; }

@media (max-width: 991px) {
  .shell { padding: 10px; }
  .rail { position: fixed; top: 10px; bottom: 10px; inset-inline-start: 10px; height: auto; transform: translateX(calc(110% * var(--dir, 1))); transition: transform .28s ease; }
  [dir="rtl"] .rail { --dir: 1; } [dir="ltr"] .rail { --dir: -1; }
  body.rail-open .rail { transform: none; }
  body.rail-open::before { content: ""; position: fixed; inset: 0; background: rgba(6,13,36,.5); backdrop-filter: blur(3px); z-index: 1030; }
  .hero { padding: 26px 22px; } .hero h1 { font-size: 1.55rem; }
  .form-section { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .auth { grid-template-columns: 1fr; } .auth-brand { display: none; } .auth-form { padding: 28px 20px; }
  .userbtn .txt { display: none; }
}
.pill-scheduled { background: var(--info-bg); color: var(--info); }
.pill-completed { background: var(--ok-bg); color: var(--ok); }
.pill-cancelled { background: var(--bad-bg); color: var(--bad); }

/* ==========================================================================
   الوضع الليلي — يُفعَّل بـ <html data-bs-theme="dark">
   ========================================================================== */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --ink: #e8ecf8; --ink-2: #c3cbe0; --muted: #8e9ab8;
  --line: #27304f; --line-soft: #1d2543; --line-strong: #38436a;
  --canvas: #0a0f20; --surface: #121a33; --soft: #161f3c; --soft-2: #19244a; --field: #0d1530;
  --brand-50: #15224a; --brand-100: #1f3472; --brand-600: #5b8def; --link: #8fb2ff;
  --ch-1: #6f9bff; --ch-2: #d9b25a; --ch-3: #c58ad8;
  --gold-100: #3a2f12; --gold-600: #e6c36f;
  --ok: #4fd1a5; --ok-bg: #0f3a30; --info: #86abf6; --info-bg: #172a57;
  --warn: #e7b862; --warn-bg: #3a2d10; --bad: #ff917d; --bad-bg: #3d1a14;
  --off: #9aa6c2; --off-bg: #1f2842;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 14px 34px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 30px 60px -24px rgba(0,0,0,.75);
  --bs-body-bg: var(--canvas); --bs-body-color: var(--ink);
  --bs-border-color: var(--line); --bs-tertiary-bg: var(--soft);
}
[data-bs-theme="dark"] .text-brand, [data-bs-theme="dark"] .page-head .eyebrow { color: #8fb2ff !important; }
[data-bs-theme="dark"] .card-head h3 .hi, [data-bs-theme="dark"] .qa .ico { color: #8fb2ff; }
[data-bs-theme="dark"] .btn-soft { color: #b9ceff; }
[data-bs-theme="dark"] .btn-soft:hover { color: #fff; }
[data-bs-theme="dark"] .alert-success { color: #7fe0bd; }
[data-bs-theme="dark"] .alert-danger { color: #ff9f8d; }
[data-bs-theme="dark"] .empty .art, [data-bs-theme="dark"] .tile .ico { filter: none; }
[data-bs-theme="dark"] .av-0 { --c: #a9c4ff; --bg: #1c2f66; }
[data-bs-theme="dark"] .av-1 { --c: #ecc874; --bg: #3a2f12; }
[data-bs-theme="dark"] .av-2 { --c: #9fbcff; --bg: #1b2c5e; }
[data-bs-theme="dark"] .av-3 { --c: #d8a8e6; --bg: #36224a; }
[data-bs-theme="dark"] .av-4 { --c: #ffb08f; --bg: #432418; }
[data-bs-theme="dark"] .auth-form { background: radial-gradient(500px 300px at 100% 0%, #15224a, transparent 70%), var(--surface); }
[data-bs-theme="dark"] .form-control::placeholder { color: #5f6c8d; }
[data-bs-theme="dark"] .btn-line:hover { background: var(--soft-2); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-color: var(--ink); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--soft); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-border-color: var(--line); --bs-dropdown-divider-bg: var(--line); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--ink); --bs-list-group-border-color: var(--line-soft); --bs-list-group-action-hover-bg: var(--soft); --bs-list-group-action-hover-color: var(--ink); --bs-list-group-action-color: var(--ink); }
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-color: var(--ink-2); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--soft); --bs-pagination-hover-color: var(--ink); --bs-pagination-disabled-bg: var(--soft); --bs-pagination-active-bg: var(--brand-700); --bs-pagination-active-border-color: var(--brand-700); }

/* ==========================================================================
   أدوات الشريط العلوي: ساعة رقمية، مبدّل اللغة، الوضع الليلي
   ========================================================================== */
.tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); cursor: pointer; transition: all .18s; font-size: 1.05rem; padding: 0; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn .i-sun { display: none; }
[data-bs-theme="dark"] .icon-btn .i-sun { display: inline; color: #e7b862; }
[data-bs-theme="dark"] .icon-btn .i-moon { display: none; }

.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lang-switch > i { padding-inline: 9px 4px; color: var(--muted); font-size: .95rem; }
.lang-switch a { min-width: 40px; text-align: center; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .8rem; color: var(--ink-2); line-height: 1.3; transition: all .18s; }
.lang-switch a:hover { color: var(--ink); background: var(--soft); }
.lang-switch a.on { background: linear-gradient(145deg, var(--brand-700), var(--brand-900)); color: #fff; box-shadow: 0 6px 14px -6px rgba(22,58,143,.8); pointer-events: none; }
.lang-switch a.en { font-family: "Segoe UI", system-ui, sans-serif; letter-spacing: .04em; }

.clock { gap: 10px; padding: 5px 16px 5px 12px; }
.clock .face { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: .95rem; }
[data-bs-theme="dark"] .clock .face { color: #8fb2ff; }
.clock .digits { font-weight: 700; font-size: 1.02rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; color: var(--ink); }
.clock .digits .sec { color: var(--gold-600); }
.clock .digits .ap { font-size: .68rem; letter-spacing: 0; margin-inline-start: 5px; color: var(--muted); font-weight: 700; }
.clock .digits .sep { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (max-width: 575px) { .clock .face { display: none; } .clock { padding: 5px 12px; } .lang-switch > i { display: none; } }
/* ===== الشريط الجانبي: هوية الجمعية + قائمة مرتبة ===== */
.rail-brand .mark { width: 48px; height: 48px; flex-shrink: 0; }
.rail-brand .mark.has-logo { background: #fff; padding: 5px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); }
.rail-brand .mark.has-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.rail-brand > span:last-child { min-width: 0; }
.rail-brand b { letter-spacing: .06em; }
.rail-brand small { opacity: .8; font-size: .78rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.rail-more { margin-top: 10px; }
.rail-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.5); }
.rail-more summary::-webkit-details-marker { display: none; }
.rail-more summary:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.8); }
.rail-more summary .count { margin-inline-start: auto; font-size: .68rem; background: rgba(255,255,255,.1); padding: 1px 8px; border-radius: 99px; }
.rail-more summary .chev { transition: transform .2s; font-size: .7rem; }
.rail-more[open] summary .chev { transform: rotate(180deg); }
.rail-more .rail-link { padding: 7px 12px; }
.rail-more .rail-link .ico { width: 30px; height: 30px; font-size: .95rem; }
/* كارت الاشتراك أسفل القائمة */
.rail-foot .meta-label { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.rail-foot .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.rail-foot .dot.ok { background: #4fd1a5; } .rail-foot .dot.bad { background: #ff917d; }
.rail-foot .bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.12); margin: 8px 0 6px; overflow: hidden; }
.rail-foot .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #e6c571, var(--gold-500)); }
/* أسفل القائمة: الإعدادات ثابتة + اشتراك مصغّر */
.rail-pinned { position: relative; z-index: 1; padding: 8px 14px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.rail-pinned .rail-link { margin-bottom: 8px; }
.rail-sub { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.rail-sub .plan { font-weight: 600; font-size: .84rem; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.rail-sub .left { font-size: .74rem; opacity: .7; }
.rail-sub .dot { width: 7px; height: 7px; border-radius: 50%; }
.rail-sub .dot.ok { background: #4fd1a5; } .rail-sub .dot.bad { background: #ff917d; }
.rail-sub .bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); margin-top: 8px; overflow: hidden; }
.rail-sub .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #e6c571, var(--gold-500)); }
@media (max-height: 760px) {
  .rail-brand { padding: 16px 18px 12px; }
  .rail-link { padding: 7px 10px; margin-bottom: 1px; }
  .rail-link .ico { width: 30px; height: 30px; }
  .rail-label { padding: 12px 12px 5px; }
}
.pill-applicant { background: var(--info-bg); color: var(--info); }
.pill-rejected, .pill-dropped { background: var(--bad-bg); color: var(--bad); }
.pill-withdrawn { background: var(--off-bg); color: var(--off); }
/* ---------- Charts & reports ---------- */
.chart { width: 100%; height: auto; display: block; direction: ltr; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart .bar { transition: opacity .12s; }
.chart .bar:hover { opacity: .75; }
.ch-1 { fill: var(--ch-1); background: var(--ch-1); } .ch-2 { fill: var(--ch-2); background: var(--ch-2); } .ch-3 { fill: var(--ch-3); background: var(--ch-3); }
.mini-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); }
.mini-kpi b { font-size: 1.25rem; } .mini-kpi span { color: var(--muted); font-size: .82rem; }
.progress-thin { height: 10px; border-radius: 99px; background: var(--line-soft); overflow: hidden; } .progress-thin i { display: block; height: 100%; background: var(--ch-1); border-radius: 99px; }
.alert-list a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.alert-list a:hover { border-color: var(--line-strong); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; margin: 26px 0 12px; }
.section-title i { color: var(--gold-600); }
.report-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; height: 100%; color: inherit; text-decoration: none; }
.report-card .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-size: 1.15rem; flex-shrink: 0; }
.report-card:hover { border-color: var(--line-strong); }
[data-bs-theme="dark"] .report-card .ico { color: #8fb2ff; }

/* مجموعات القائمة الجانبية (الشكل الجديد 2026-11-14): عنوان واضح بأيقونة، وقسم واحد مفتوح، وعناصر فرعية من غير أيقونات */
.rail-group > summary.rail-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 7px 10px; margin-bottom: 1px;
    border-radius: 14px; color: #dbe9e3; font-weight: 600; font-size: .92rem; user-select: none; transition: background .16s, color .16s; }
.rail-group > summary.rail-head::-webkit-details-marker { display: none; }
.rail-group > summary.rail-head:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail-group > summary.rail-head .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: .98rem; flex-shrink: 0; }
.rail-group > summary.rail-head .chev { margin-inline-start: auto; font-size: .7rem; opacity: .6; transition: transform .2s ease; }
.rail-group > summary.rail-head .pill { font-size: .66rem; padding: 1px 7px; }
.rail-group[open] > summary.rail-head { color: #fff; }
.rail-group[open] > summary.rail-head .chev { transform: rotate(180deg); }
.rail-group[data-active] > summary.rail-head .ico { background: rgba(230,197,113,.18); color: #e6c571; }
.rail-children { margin: 2px 0 6px; padding-inline-start: 24px; position: relative; }
.rail-children::before { content: ""; position: absolute; inset-block: 4px; inset-inline-start: 24px; width: 1px; background: rgba(255,255,255,.12); }
.rail-children .rail-link { padding: 6px 12px; font-size: .86rem; margin-bottom: 0; border-radius: 10px; gap: 8px; }
.rail-children .rail-link.active { background: rgba(255,255,255,.1); box-shadow: none; }
.rail-children .rail-link.active::before { content: ""; position: absolute; inset-inline-start: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #e6c571; }
.rail > nav > .rail-link { padding: 7px 10px; margin-bottom: 1px; font-weight: 600; font-size: .92rem; color: #dbe9e3; }
.rail > nav > .rail-link .ico { width: 30px; height: 30px; }
.rail-brand { padding: 14px 18px 10px; }
.rail-brand .mark { width: 40px; height: 40px; }
.rail nav { padding: 4px 12px 8px; }
/* تحت: سطر صغير (إعدادات الجمعية + المستخدمون) بدل المربع الكبير */
.rail-pinned { display: flex; gap: 6px; padding: 6px 12px 10px; }
.rail-pinned a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 12px; font-size: .78rem; font-weight: 600; color: #cfe3dc; background: rgba(255,255,255,.05); }
.rail-pinned a:hover, .rail-pinned a.active { background: rgba(255,255,255,.12); color: #fff; }
.rail-renew { position: relative; z-index: 1; margin: 0 12px 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,145,125,.12); border: 1px solid rgba(255,145,125,.3); font-size: .76rem; color: #ffd2c9; line-height: 1.6; }
.rail-renew a { color: #fff; font-weight: 700; }

/* الموبايل: رأس الصفحة والشريط العلوي يلفّان بدل ما يوسّعوا الصفحة */
@media (max-width: 767.98px) {
  .topbar { flex-wrap: wrap; }
  .page-head > div:last-child:not(:first-child) { flex: 1 1 100%; min-width: 0; }
  .page-head > div:last-child .d-flex { flex-wrap: wrap; }
  .page-head > div:last-child .btn { flex: 1 1 auto; }
}
@media (max-width: 991px) {
  /* القائمة الجانبية المخفية (translateX خارج الشاشة) كانت توسّع الصفحة أفقيًا على الموبايل */
  html, body { overflow-x: hidden; }
}

/* ===== الجداول على الموبايل: كروت افتراضيًا + زر تبديل للجدول بسحب أفقي محسّن ===== */
@media (max-width: 767.98px) {
  .card-head { flex-wrap: wrap; }
  .card-head > form, .card-head > .d-flex { flex-wrap: wrap; }
  .card-head form .input-icon { min-width: 0 !important; flex: 1 1 100%; }
  /* سحب أفقي محسّن: سطر واحد لكل صف، العمود الأول ثابت، وظل يدل على أعمدة مخفية */
  .table-responsive { position: relative; }
  .table-responsive th, .table-responsive td { white-space: nowrap; }
  .table-responsive .table-modern th:first-child, .table-responsive .table-modern td:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
  .table-responsive .table-modern thead th:first-child { background: var(--soft); }
  .table-responsive .table-modern thead th, .table-responsive .table-modern tbody td { padding-inline: 14px; }
  .table-responsive.has-scroll-hint::after { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 22px; pointer-events: none; background: linear-gradient(to right, rgba(0,0,0,.08), transparent); }
  [dir="ltr"] .table-responsive.has-scroll-hint::after { background: linear-gradient(to left, rgba(0,0,0,.08), transparent); }
  /* كروت: كل صف كارت وفيه سطر لكل عمود */
  .table-responsive.has-cards { overflow: visible; }
  .table-responsive.has-cards::after { display: none; }
  .is-cards > thead { display: none; }
  .is-cards, .is-cards > tbody, .is-cards > tbody > tr { display: block; width: 100%; }
  .is-cards > tbody > tr { border: 1px solid var(--line); border-radius: 14px; margin: 10px 12px; padding: 4px 0; background: var(--surface); box-shadow: var(--shadow-sm); }
  .is-cards > tbody > tr:hover { background: var(--surface); }
  .is-cards > tbody > tr > td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px !important; border: 0 !important; text-align: start !important; white-space: normal; position: static !important; }
  .is-cards > tbody > tr > td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; flex-shrink: 0; }
  .is-cards > tbody > tr > td[data-label=""]::before { display: none; }
  .is-cards > tbody > tr > td[data-label=""] { justify-content: flex-end; }
  .is-cards > tbody > tr > td.is-main::before { display: none; }
  .is-cards > tbody > tr > td.is-main > * { width: 100%; }
  .is-cards tfoot { display: block; border-top: 1px solid var(--line); margin: 0 12px; }
  .is-cards tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 0; }
  .is-cards tfoot td, .is-cards tfoot th { display: inline-block; padding: 2px 0 !important; border: 0 !important; white-space: normal; }
  .mobile-table-toggle { display: inline-flex; margin: 10px 12px 0; }
  /* جداول الإدخال كروت (الحضور والمرتبات): اسم الموظف عنوان الكارت، والخانات بعرض مريح */
  .is-cards.is-entry td.is-main { background: var(--soft); border-radius: 13px 13px 0 0; margin: -4px 0 4px; padding: 10px 14px !important; }
  .is-cards.is-entry td > .form-control, .is-cards.is-entry td > .form-select, .is-cards.is-entry td > input { width: 58% !important; max-width: 220px; flex-shrink: 1; }
  .is-cards.is-entry td > .btn-group { flex-wrap: wrap; justify-content: flex-end; }
  .is-cards.is-entry td > .btn-group > .btn { flex: 0 0 auto; }
}
@media (min-width: 768px) { .mobile-table-toggle { display: none !important; } }
/* الحضور اليومي على الموبايل: أزرار الحالة الأربعة صف واحد بأعمدة متساوية، و2×2 على الشاشات الضيقة جدًا — مراجعة QA الجولة الرابعة P2-20 */
@media (max-width: 767.98px) {
  .is-cards.is-entry td.att-status-cell { flex-wrap: wrap; }
  .is-cards.is-entry td.att-status-cell > .btn-group.att-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: 1 1 100%; width: 100%; }
  .is-cards.is-entry td.att-status-cell > .btn-group.att-status > .btn { width: 100%; margin: 0 !important; border-radius: var(--bs-border-radius) !important; padding-inline: 4px; text-align: center; white-space: nowrap; }
}
@media (max-width: 359.98px) {
  .is-cards.is-entry td.att-status-cell > .btn-group.att-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== الجرس (مركز الإشعارات) ===== */
.bell .icon-btn { overflow: visible; }
.bell-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-menu { min-width: 320px; max-width: 92vw; }
/* الجرس بيتهز هزة قصيرة كل 6 ثواني طول ما فيه إشعار غير مقروء — ومايتحركش لو الجهاز على «تقليل الحركة» */
@keyframes bell-ring { 0%, 12%, 100% { transform: rotate(0); } 2% { transform: rotate(14deg); } 4% { transform: rotate(-12deg); } 6% { transform: rotate(9deg); } 8% { transform: rotate(-6deg); } 10% { transform: rotate(3deg); } }
.bell.has-unread .icon-btn > i { display: inline-block; transform-origin: 50% 8%; animation: bell-ring 6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .bell.has-unread .icon-btn > i { animation: none; } }
.bell-item { white-space: normal; align-items: flex-start; font-size: .88rem; line-height: 1.45; }
.bell-item i { margin-top: 2px; flex-shrink: 0; }
/* حالات رسائل اتصل بنا */
.pill-new { background: var(--info-bg); color: var(--info); }
.pill-in_progress { background: var(--warn-bg); color: var(--warn); }
.pill-replied { background: var(--ok-bg); color: var(--ok); }

/* ===== البحث العام في الشريط العلوي ===== */
.gsearch { position: relative; width: min(320px, 26vw); }
.gsearch .form-control { padding-block: .5rem; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); }
.gsearch-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; width: min(440px, 92vw); max-height: 70vh; overflow-y: auto; padding: 6px; }
.gsearch-menu.show { display: block; }
.gs-head { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.gs-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; white-space: normal; }
.gs-item .gs-t { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-item .gs-s { font-size: .78rem; color: var(--muted); }
.gs-item .pill { font-size: .66rem; padding: 1px 8px; }
@media (max-width: 991.98px) { .gsearch { width: min(300px, 40vw); } }

/* هوية المنصة أعلى نموذج الدخول على الموبايل (القسم الأزرق مخفي هناك) */
.auth-mobile-brand { display: flex; align-items: center; gap: 14px; margin: 44px 0 26px; padding: 14px 16px; border-radius: 18px; color: #fff;
  background: radial-gradient(300px 160px at 100% 0%, rgba(205,163,73,.35), transparent 70%), linear-gradient(135deg, var(--brand-800), var(--brand-950)); box-shadow: var(--shadow-lg); }
.auth-mobile-brand .mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; color: var(--brand-950); flex-shrink: 0;
  background: linear-gradient(145deg, #e6c571, var(--gold-500)); box-shadow: 0 8px 20px -8px rgba(205,163,73,.8); }
.auth-mobile-brand b { display: block; font-size: 1.15rem; letter-spacing: .06em; line-height: 1.2; }
.auth-mobile-brand small { display: block; font-size: .76rem; opacity: .75; line-height: 1.4; margin-top: 2px; }

/* ===== الصفحة التسويقية العامة (landing) ===== */
body.lp { background: var(--canvas); }
.lp-wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 20px; }
.lp-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
[data-bs-theme="dark"] .lp-nav { background: rgba(10,15,32,.85); }
.lp-nav .lp-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.lp-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.15rem; letter-spacing: .06em; }
.lp-brand .mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--brand-950); background: linear-gradient(145deg, #e6c571, var(--gold-500)); font-size: 1.15rem; }
.lp-links { display: flex; gap: 22px; } .lp-links a { color: var(--ink-2); font-weight: 600; } .lp-links a:hover { color: var(--brand-700); }
.lp-hero { position: relative; overflow: hidden; color: #fff; padding: 72px 0 64px;
  background: radial-gradient(640px 420px at 100% 0%, rgba(205,163,73,.35), transparent 70%), radial-gradient(560px 460px at 0% 100%, rgba(58,111,216,.45), transparent 70%), linear-gradient(150deg, var(--brand-800), var(--brand-950)); }
.lp-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(120deg, transparent 30%, #000); pointer-events: none; }
.lp-hero .lp-wrap { position: relative; z-index: 1; }
.lp-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.25; margin: 14px 0 10px; }
.lp-hero .lead { color: rgba(255,255,255,.8); max-width: 560px; font-size: 1.1rem; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-size: .82rem; font-weight: 600; color: #e8c978; }
.lp-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 36px; }
.lp-stats b { display: block; font-size: 1.7rem; line-height: 1; color: #e8c978; } .lp-stats span { font-size: .85rem; opacity: .75; }
.lp-mock { border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(8px); box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); overflow: hidden; }
.lp-mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.1); } .lp-mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); }
.lp-mock-body { padding: 18px; }
.lp-mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.lp-mock-kpis div { background: rgba(255,255,255,.1); border-radius: 14px; padding: 12px; } .lp-mock-kpis b { display: block; font-size: 1.4rem; color: #fff; } .lp-mock-kpis small { opacity: .7; font-size: .72rem; }
.lp-mock-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 0 6px; margin-bottom: 16px; } .lp-mock-bars i { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #e6c571, var(--gold-500)); opacity: .9; }
.lp-mock-rows span { display: block; height: 12px; border-radius: 6px; background: rgba(255,255,255,.12); margin-bottom: 8px; } .lp-mock-rows span:nth-child(2) { width: 80%; } .lp-mock-rows span:nth-child(3) { width: 60%; }
.lp-section { padding: 64px 0; } .lp-section.alt { background: var(--soft); border-block: 1px solid var(--line-soft); }
.lp-h2 { text-align: center; font-size: 1.8rem; margin-bottom: 8px; } .lp-sub { text-align: center; color: var(--muted); max-width: 720px; margin: 0 auto 32px; }
.lp-feat { height: 100%; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s; }
.lp-feat:hover { transform: translateY(-3px); } .lp-feat.soft { background: var(--soft); box-shadow: none; }
.lp-feat .ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(145deg, #4f86f0, var(--brand-800)); margin-bottom: 14px; }
.lp-feat.soft .ico { background: linear-gradient(145deg, #e0b960, #b8891f); }
.lp-feat h3 { font-size: 1.05rem; margin-bottom: 6px; } .lp-feat p { color: var(--muted); font-size: .9rem; margin: 0; }
.lp-step { height: 100%; padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.lp-step .n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-700); color: #fff; font-weight: 700; margin-bottom: 12px; }
.lp-step h3 { font-size: 1.05rem; } .lp-step p { color: var(--muted); margin: 0; font-size: .92rem; }
.lp-plan { height: 100%; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lp-plan h3 { font-size: 1.2rem; } .lp-plan .price { margin: 6px 0 14px; } .lp-plan .price b { font-size: 2rem; letter-spacing: -.02em; } .lp-plan .price span { color: var(--muted); margin-inline-start: 6px; }
.lp-plan ul { list-style: none; padding: 0; margin: 0 0 12px; } .lp-plan li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); display: flex; gap: 8px; align-items: center; }
.lp-plan .mods { display: flex; flex-wrap: wrap; gap: 6px; } .lp-plan .mods span { font-size: .78rem; padding: 3px 10px; border-radius: 99px; background: var(--brand-50); color: var(--brand-800); }
.lp-plan .btn { margin-top: auto; }
.lp-cta { padding: 64px 0; color: #fff; background: linear-gradient(135deg, var(--brand-800), var(--brand-950)); } .lp-cta h2 { color: #fff; } .lp-cta p { color: rgba(255,255,255,.75); }
.lp-footer { padding: 26px 0; border-top: 1px solid var(--line); background: var(--surface); font-size: .9rem; } .lp-footer a { color: var(--ink-2); }
.lp-prose { max-width: 820px; } .lp-prose h1 { font-size: 1.9rem; margin-bottom: 4px; } .lp-prose h2 { font-size: 1.15rem; margin: 26px 0 8px; } .lp-prose p, .lp-prose li { color: var(--ink-2); line-height: 1.8; }
@media (max-width: 767.98px) { .lp-hero { padding: 44px 0 40px; } .lp-section { padding: 44px 0; } .lp-nav .lp-wrap { height: 60px; } .lp-brand b { display: none; } }
/* عروض الباقات في الصفحة التسويقية */
.lp-plan { position: relative; } .lp-plan.featured { border-color: var(--gold-500); box-shadow: 0 20px 44px -22px rgba(184,137,31,.55); }
.lp-badge { position: absolute; top: -12px; inset-inline-start: 22px; padding: 4px 12px; border-radius: 99px; font-size: .74rem; font-weight: 700; color: #2b2008; background: linear-gradient(180deg, #e6c571, var(--gold-500)); box-shadow: 0 6px 14px -6px rgba(184,137,31,.8); }
.lp-plan .price .old { color: var(--muted); font-size: 1.05rem; margin-inline-end: 8px; }
.lp-offer { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 10px; background: var(--gold-100); color: var(--gold-600); font-size: .82rem; font-weight: 600; margin-bottom: 12px; }
/* الوضع الليلي للصفحة التسويقية: وضوح شارات الأقسام والنصوص */
[data-bs-theme="dark"] .lp-plan .mods span { background: rgba(143,178,255,.14); color: #b9ceff; }
[data-bs-theme="dark"] .lp-feat .ico { background: linear-gradient(145deg, #5b8def, #2a53b5); }
[data-bs-theme="dark"] .lp-nav .lp-links a { color: var(--ink-2); }

/* ===== الوضع الليلي: القائمة الجانبية منفصلة عن الخلفية + دوائر الكروت باهتة ===== */
[data-bs-theme="dark"] .rail {
  background:
    radial-gradient(420px 260px at 85% -6%, rgba(205,163,73,.16), transparent 70%),
    radial-gradient(380px 300px at -10% 105%, rgba(58,111,216,.20), transparent 70%),
    linear-gradient(170deg, #16285f, #0d1840);
  box-shadow: 0 0 0 1px rgba(143,178,255,.14), 0 30px 60px -24px rgba(0,0,0,.8);
}
[data-bs-theme="dark"] .kpi::after { opacity: .28; }
/* تنبيهات لوحة التحكم: شريط بلون الأهمية (في الوضعين) */
.alert-list a[class*="tone-"] { border-inline-start: 4px solid var(--tone); }
.alert-list a.tone-bad { background: color-mix(in srgb, var(--bad-bg) 55%, var(--surface)); }
/* كروت الجداول على الموبايل: داخل حدود الصندوق بهامش متساوٍ بدل الخروج عنه */
@media (max-width: 767.98px) { .is-cards > tbody > tr { width: auto; } }

/* ===== الشريط العلوي على اللابتوب (992–1399): بدون سحب بالعرض ===== */
.topbar .where { flex: 1 1 auto; min-width: 0; }
.topbar > .d-flex { flex-shrink: 0; }
.gsearch { flex: 1 1 auto; width: auto; min-width: 150px; max-width: 340px; }
.topbar .chip:not(.clock) { white-space: nowrap; }
@media (max-width: 1399.98px) {
  .topbar .chip:not(.clock) { display: none !important; }
  .userbtn .txt { display: none; }
  .userbtn, [dir="rtl"] .userbtn { padding: 4px; }
}

/* ===== الشريط العلوي على الموبايل والتابلت: سطر واحد ثابت أعلى الشاشة ===== */
@media (max-width: 991.98px) {
  .topbar { position: sticky; top: 0; z-index: 1020; flex-wrap: nowrap; margin: -10px -10px 12px; padding: 10px 12px; width: auto;
    background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .topbar .where { gap: 8px; }
  /* hidden كان بيعطّل التثبيت (sticky)؛ clip يمنع السحب بالعرض من غير ما يعطّله، والمتصفحات القديمة تفضل على hidden */
  html, body { overflow-x: hidden; overflow-x: clip; }
}
/* أصغر من 576: اللغة والوضع الليلي ينتقلوا لقائمة المستخدم */
@media (max-width: 575.98px) {
  .topbar .tools .lang-switch, .topbar #themeToggle { display: none; }
  .topbar > .d-flex { gap: 6px !important; }
}
.menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; }

/* زرار رفع الملف بالعربي (partials/form-ar): الخانة الأصلية شفافة فوقه */
.file-ar { position: relative; display: flex; align-items: center; gap: .75rem; overflow: hidden; cursor: pointer; }
.file-ar-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-ar-btn { flex-shrink: 0; margin-block: calc(-1 * var(--bs-border-width) - .375rem); margin-inline-start: -.75rem; padding: .375rem .75rem; background: var(--bs-tertiary-bg); border-inline-end: var(--bs-border-width) solid var(--bs-border-color); font-weight: 600; }
.file-ar.form-control-sm .file-ar-btn { margin-block: calc(-1 * var(--bs-border-width) - .25rem); margin-inline-start: -.5rem; padding: .25rem .5rem; }
.file-ar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bs-secondary-color); }
.file-ar.has-file .file-ar-name { color: var(--bs-body-color); }
.file-ar:hover .file-ar-btn { background: var(--bs-secondary-bg); }
.file-ar:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(58,111,216,.16); }
.file-ar.disabled { background: var(--bs-secondary-bg); opacity: .75; cursor: default; }

/* نافذة التأكيد بشكل البرنامج (partials/confirm-dialog) */
.confirm-box { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg, 0 20px 50px rgba(0,0,0,.25)); }
.confirm-ico { width: 52px; height: 52px; margin-inline: auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--soft); color: var(--brand-700); }
.confirm-ico.is-danger { background: rgba(220, 53, 69, .12); color: #dc3545; }
#confirmText { white-space: pre-line; line-height: 1.8; }

/* الخانة اللي فيها غلط (partials/field-errors) */
.file-ar.is-invalid, .btn-group.is-invalid { border: 1px solid var(--bs-form-invalid-border-color, #dc3545) !important; border-radius: var(--bs-border-radius); }
.field-error { font-weight: 600; }

/* حاجات الموبايل الصغيرة (المرحلة 5) */
.unlock-form input { min-width: 220px; }
.filter-toggle { display: none; }
@media (max-width: 767.98px) {
  /* جدول صغير جوه كارت (زي «عرض التغييرات» في سجل التعديلات) */
  .is-cards > tbody > tr > td details { width: 100%; }
  .is-cards > tbody > tr > td table { width: 100%; table-layout: fixed; word-break: break-word; }
  /* «فك القفل» جوه الصندوق: الخانة والزرار سطر لوحدهم */
  .unlock-form { flex: 1 1 100%; }
  .unlock-form input { min-width: 0; flex: 1 1 auto; }
  /* الفلاتر: البحث ظاهر والباقي ورا زرار */
  .filter-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .filters-collapsed .filter-item { display: none !important; }
  .has-filter-toggle .filter-item, .has-filter-toggle .filter-item select { width: 100% !important; }
  /* أزرار أكبر للمس */
  .btn-sm { min-height: 38px; }
  .btn-sm.btn-icon, .btn-icon { min-width: 40px; min-height: 40px; }
}
/* إطار واضح حوالين اللي عليه الدور لما المستخدم يتنقل بلوحة المفاتيح (Tab) — مش مع الماوس */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible,
.form-check-input:focus-visible, .rail-link:focus-visible, .userbtn:focus-visible {
  outline: 3px solid var(--brand-600); outline-offset: 2px; box-shadow: none;
}
.btn-check:focus-visible + .btn { outline: 3px solid var(--brand-600); outline-offset: 2px; }
[data-bs-theme="dark"] :is(a, button, .btn, summary, [role="button"], [tabindex], .form-check-input, .rail-link, .userbtn):focus-visible,
[data-bs-theme="dark"] .btn-check:focus-visible + .btn { outline-color: #8fb0ff; }/* الصفحة التسويقية: جزء تطبيق الموبايل والأسئلة الشائعة والدفع (2026-10-16) */
.lp-app { color: #fff; background: linear-gradient(135deg, var(--brand-800), var(--brand-950)); }
.lp-app-h { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 14px 0 8px; } .lp-app-sub { color: rgba(255,255,255,.78); max-width: 600px; margin-bottom: 22px; }
.lp-app-role { height: 100%; padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.lp-app-role h3 { color: #e8c978; font-size: 1rem; margin-bottom: 8px; } .lp-app-role ul { margin: 0; padding-inline-start: 18px; } .lp-app-role li { color: rgba(255,255,255,.85); font-size: .88rem; padding: 2px 0; }
.lp-app-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; } .lp-app-chips span { padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: .82rem; }
.lp-store { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 12px; background: #000; border: 1px solid rgba(255,255,255,.35); opacity: .9; }
.lp-store .bi { font-size: 1.7rem; } .lp-store small { display: block; font-size: .7rem; opacity: .75; line-height: 1.1; } .lp-store b { font-size: 1.1rem; line-height: 1.1; direction: ltr; }
.lp-phone { width: 250px; border-radius: 34px; padding: 10px; background: #0b1220; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.12); }
.lp-phone-top { border-radius: 24px 24px 0 0; background: #1b2a4a; color: #fff; padding: 16px 14px 12px; font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.lp-phone-top .dot { width: 22px; height: 22px; border-radius: 7px; background: #c9a227; display: inline-block; }
.lp-phone-body { background: #f6f7fb; padding: 10px; } .lp-phone-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.lp-phone-kpis div { background: #fff; border: 1px solid #dde1ea; border-radius: 12px; padding: 8px 10px; } .lp-phone-kpis b { display: block; color: #1b2a4a; font-size: 1.2rem; } .lp-phone-kpis small { color: #5b6a64; font-size: .68rem; }
.lp-phone-row { background: #fff; border: 1px solid #dde1ea; border-radius: 12px; padding: 9px 10px; margin-bottom: 7px; color: #1b2a4a; font-size: .78rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.lp-phone-row .bi { color: #c9a227; font-size: 1rem; } .lp-phone-row em { margin-inline-start: auto; font-style: normal; background: #c9a227; color: #1b2a4a; border-radius: 99px; padding: 0 7px; font-size: .7rem; }
.lp-phone-nav { display: flex; justify-content: space-around; background: #fff; border-radius: 0 0 24px 24px; padding: 10px 0; color: #5b6a64; border-top: 1px solid #dde1ea; } .lp-phone-nav .bi-house-fill { color: #1b2a4a; }
.lp-pay { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 760px; margin: -12px auto 26px; padding: 10px 16px; border-radius: 14px; background: var(--brand-50); color: var(--brand-800); font-size: .92rem; text-align: center; } .lp-pay .bi { font-size: 1.3rem; }
.lp-faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.lp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
.lp-faq summary { cursor: pointer; list-style: none; padding: 12px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; } .lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary .bi { transition: transform .2s; color: var(--muted); } .lp-faq details[open] summary .bi { transform: rotate(180deg); } .lp-faq p { color: var(--ink-2); line-height: 1.8; margin: 0 0 14px; }
