/* =========================================================
   شور+ القانوني — نظام التصميم
   زمرّد عميق + ذهب + بورسلين | Cairo للعناوين، Tajawal للنص
   Powered by REFAI AI · Powered By Palmyra Technology Ltd.
   ========================================================= */
:root {
  --primary: #0f3b2d;
  --accent: #c9a24c;
  --deep: color-mix(in srgb, var(--primary) 78%, #000);
  --deeper: color-mix(in srgb, var(--primary) 62%, #000);
  --p-50: color-mix(in srgb, var(--primary) 5%, #fff);
  --p-100: color-mix(in srgb, var(--primary) 11%, #fff);
  --p-200: color-mix(in srgb, var(--primary) 22%, #fff);
  --a-50: color-mix(in srgb, var(--accent) 10%, #fff);
  --a-100: color-mix(in srgb, var(--accent) 22%, #fff);
  --a-300: color-mix(in srgb, var(--accent) 55%, #fff);
  --a-700: color-mix(in srgb, var(--accent) 62%, #000);
  --gold-grad: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 45%, color-mix(in srgb, var(--accent) 75%, #000) 100%);
  --bg: #f1f4f2;
  --surface: #ffffff;
  --ink: #13211b;
  --ink-2: #33433c;
  --muted: #66746d;
  --line: #e0e6e2;
  --line-2: #edf1ee;
  --ok: #1f7a4d;
  --warn: #a5661a;
  --bad: #b3261e;
  --info: #22609c;
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --sh-1: 0 1px 2px rgba(10, 40, 30, .05);
  --sh-2: 0 1px 2px rgba(10, 40, 30, .04), 0 8px 24px rgba(10, 40, 30, .07);
  --sh-3: 0 24px 60px rgba(8, 30, 22, .22);
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cairo', 'Tajawal', sans-serif;
  --sidebar: 272px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23d9b866' stroke-opacity='.10' stroke-width='1'%3E%3Crect x='31' y='31' width='26' height='26'/%3E%3Crect x='31' y='31' width='26' height='26' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='6'/%3E%3Cpath d='M0 0 25.6 25.6M88 0 62.4 25.6M0 88 25.6 62.4M88 88 62.4 62.4M44 0v12M44 76v12M0 44h12M76 44h12'/%3E%3C/g%3E%3C/svg%3E");
  --pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%230f3b2d' stroke-opacity='.045' stroke-width='1'%3E%3Crect x='31' y='31' width='26' height='26'/%3E%3Crect x='31' y='31' width='26' height='26' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='6'/%3E%3Cpath d='M0 0 25.6 25.6M88 0 62.4 25.6M0 88 25.6 62.4M88 88 62.4 62.4M44 0v12M44 76v12M0 44h12M76 44h12'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.75; font-size: 16px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.4; margin: 0 0 .45em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.95rem); font-weight: 800; }
h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); font-weight: 800; }
h3 { font-size: 1.06rem; }
h4 { font-size: .97rem; margin-top: 1.1em; }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: var(--line-2); padding: .1em .4em; border-radius: 6px; direction: ltr; unicode-bidi: embed; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.container.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.4rem; }
.mt-s { margin-top: .5rem; }
.hint { font-size: .84rem; color: var(--muted); margin: .25rem 0 .6rem; }
.link { color: var(--primary); font-weight: 700; }
.link:hover { text-decoration: underline; }
.hp { position: absolute !important; top: 0; right: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px; border: 0 !important; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); } .t-muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.15rem; border-radius: var(--r-md); border: 1px solid transparent; font: 700 .95rem/1.2 var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--deep); }
.btn-accent { background: var(--gold-grad); color: #241a05; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { filter: brightness(1.04); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn-danger { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, #fff); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { min-height: 34px; padding: .32rem .75rem; font-size: .84rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: .15s; flex-shrink: 0; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.icon-btn.starred { color: var(--a-700); border-color: var(--accent); background: var(--a-50); }
.icon-btn.starred svg { fill: var(--accent); }
.icon-btn.ghost-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- التنبيهات والشارات ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--r-md); margin: 0 0 1rem; border: 1px solid; font-size: .95rem; white-space: pre-line; }
.alert-ok { background: #ebf6ef; border-color: #c1e2cd; color: #175a37; }
.alert-warn { background: #fcf4e6; border-color: #eed7a9; color: #74470f; }
.alert-bad { background: #fcedeb; border-color: #f2c5bf; color: #8c1b14; }
.alert-info { background: #ebf2fa; border-color: #c4d9ef; color: #1c4673; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: #e7f4ec; color: var(--ok); }
.pill-warn { background: #fbf0dc; color: var(--warn); }
.pill-bad { background: #fbe8e6; color: var(--bad); }
.pill-info { background: #e6eff9; color: var(--info); }
.pill-muted { background: var(--line-2); color: var(--muted); }
.pill-accent { background: var(--a-100); color: var(--a-700); }
.pill-info::before, .pill-warn::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .7rem; border-radius: 999px; background: var(--p-50); border: 1px solid var(--p-100); font-size: .85rem; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: .45rem; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--info); }
.count { min-width: 26px; height: 26px; padding: 0 .45rem; display: inline-grid; place-items: center; border-radius: 8px; background: var(--line-2); font-size: .82rem; font-weight: 700; color: var(--muted); }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; color: var(--muted); direction: ltr; unicode-bidi: embed; letter-spacing: .02em; }
small.ref { display: block; margin-top: 2px; font-family: var(--font); letter-spacing: 0; unicode-bidi: plaintext; direction: inherit; font-size: .78rem; }

/* ---------- البطاقات والنماذج ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--sh-1); margin-bottom: 1rem; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-head h3 .ic { color: var(--primary); }
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; color: var(--ink-2); }
.field > span small { font-weight: 500; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: .62rem .9rem; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; font: 500 1rem/1.5 var(--font); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--primary) 13%, transparent); }
input:disabled, textarea:disabled { background: var(--line-2); color: var(--muted); }
textarea { resize: vertical; min-height: 80px; line-height: 1.8; }
input[type=file] { font: 500 .88rem var(--font); width: 100%; }
input[type=file]::file-selector-button { font: 700 .85rem var(--font); padding: .45rem .9rem; margin-inline-end: .7rem; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2366746d' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left .9rem center; padding-left: 2.3rem !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-2.align-start { align-items: start; gap: 1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0 1rem; cursor: pointer; font-size: .93rem; }
.check input { margin-top: .35rem; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.check.inline { display: inline-flex; margin: 0; align-items: center; }
.check.inline input { margin-top: 0; }
.form-actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.form-row-between { display: flex; justify-content: flex-end; margin: -.4rem 0 1rem; font-size: .9rem; }
.field-foot { display: flex; justify-content: space-between; margin-top: -.6rem; }
.counter { font-size: .8rem; color: var(--muted); }
.sec-title { margin: 1.4rem 0 .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); font-size: 1rem; }
.stack { display: grid; gap: .55rem; }
.req-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; font-size: .92rem; }
.req-list li { display: flex; gap: .55rem; align-items: center; }
.req-list li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-size: .8rem; font-weight: 800; }
.req-list .ok span { background: #e7f4ec; color: var(--ok); }
.req-list .bad span { background: #fbe8e6; color: var(--bad); }

/* ---------- الهوية والإسناد ---------- */
.lockup { display: inline-flex; align-items: center; gap: .7rem; min-width: 0; color: inherit; }
.lockup-logo { height: 46px; width: auto; flex-shrink: 0; object-fit: contain; }
.lockup-text { display: grid; line-height: 1.35; min-width: 0; }
.lockup-text strong { font: 800 1.05rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lockup-text small { font-size: .76rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lockup-dark { color: #fff; }
.lockup-dark small { color: var(--a-300); opacity: 1; }
.credit { display: inline-flex; align-items: center; gap: .55rem; direction: ltr; text-align: left; white-space: nowrap; line-height: 1.15; }
.credit img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.credit-refai img { border-radius: 8px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.cr-text { display: grid; }
.cr-text small { font: 600 .62rem/1.2 var(--font); letter-spacing: .06em; opacity: .7; }
.cr-text b { font: 800 .82rem/1.25 var(--font); letter-spacing: .01em; }
.credit-refai .cr-text b { color: var(--a-700); }
.credits-dark .credit { color: rgba(255, 255, 255, .88); }
.credits-dark .credit-refai .cr-text b { color: var(--a-300); }
.credits-light .credit { color: var(--ink-2); }
.credit.powered-mini img { width: 20px; height: 20px; border-radius: 5px; }
.credit.powered-mini .cr-text small { font-size: .55rem; }
.credit.powered-mini .cr-text b { font-size: .7rem; }
.side-foot .credits { flex-direction: column; align-items: flex-end; gap: .6rem; }
.admin-title { font-size: 1.45rem; margin: 0 0 1.1rem; }
.credits { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; direction: ltr; }

/* ---------- هيكل التطبيق: شريط علوي ---------- */
.shell-body { background: var(--pattern-light) fixed, var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; color: #fff; background: radial-gradient(600px 120px at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), linear-gradient(180deg, var(--primary), var(--deep)); box-shadow: 0 6px 24px rgba(5, 25, 18, .18); padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { max-width: 1240px; margin: 0 auto; height: 70px; padding: 0 1.4rem; display: flex; align-items: center; gap: 1.2rem; }
.topbar .lockup-logo { height: 46px; }
.topbar .lockup-text strong { font-size: 1.02rem; }
.tb-menu { display: none; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .15); color: #fff; }
.tb-nav { display: flex; align-items: center; gap: .2rem; margin-inline-start: 1rem; height: 100%; }
.tb-nav a { position: relative; display: inline-flex; align-items: center; gap: .45rem; height: 100%; padding: 0 .85rem; color: rgba(255, 255, 255, .72); font-weight: 600; font-size: .94rem; }
.tb-nav a .ic { opacity: .8; }
.tb-nav a:hover { color: #fff; }
.tb-nav a.active { color: #fff; }
.tb-nav a.active .ic { color: var(--accent); opacity: 1; }
.tb-nav a.active::after { content: ''; position: absolute; inset: auto .85rem 0 .85rem; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-grad); }
.tb-nav .badge-dot { min-width: 20px; height: 20px; font-size: .7rem; }
.tb-end { margin-inline-start: auto; display: flex; align-items: center; gap: .6rem; }
.tb-cta { min-height: 42px; padding: .45rem 1rem; }
.tb-install { width: 42px; height: 42px; padding: 0; border-radius: 12px; }
.topbar .lockup { flex-shrink: 0; }
.area-admin .topbar-inner { max-width: 1320px; gap: .8rem; }
.area-admin .content-inner { max-width: 1320px; }
.area-admin .tb-nav { margin-inline-start: .4rem; gap: 0; min-width: 0; }
.area-admin .tb-nav a { padding: 0 .7rem; font-size: .9rem; }
.area-admin .tb-nav a.active::after { inset: auto .7rem 0 .7rem; }
@media (max-width: 1380px) { .area-admin .tb-nav a .ic { display: none; } .area-admin .topbar .lockup-text small { display: none; } }
.badge-dot { font-style: normal; min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #241a05; font-size: .74rem; font-weight: 800; display: grid; place-items: center; }
.install-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: .4rem .85rem; border-radius: var(--r-md); border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: transparent; color: var(--a-300); font: 700 .86rem var(--font); cursor: pointer; }
.install-btn:hover { background: rgba(255, 255, 255, .06); }
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; height: 44px; padding: 0 .35rem 0 .7rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; font: 700 .9rem var(--font); cursor: pointer; }
.user-chip .avatar { width: 34px; height: 34px; }
.user-chip .ic { transform: rotate(-90deg); opacity: .6; }
.uc-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; left: 0; top: calc(100% + 10px); width: 250px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: .45rem; z-index: 70; }
.mp-head { padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--line-2); margin-bottom: .3rem; display: grid; }
.mp-head small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; }
.menu-pop a { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.menu-pop a:hover { background: var(--bg); color: var(--primary); }
.menu-pop a.mp-out { color: var(--bad); }
.drawer { display: none; }
.side-overlay { display: none; }
.content { flex: 1; }
.content-inner { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.8rem 1.4rem 1.4rem; }
.admin-title { font-size: 1.45rem; margin: 0 0 1.1rem; }
/* ---------- الفوتر الموحد (داكن) ---------- */
.app-footer { position: relative; margin-top: 2.2rem; color: rgba(255, 255, 255, .72); background: var(--pattern) repeat, radial-gradient(700px 260px at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), linear-gradient(180deg, var(--primary), var(--deep)); }
.app-footer::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold-grad); }
.af-wrap { max-width: 1240px; margin: 0 auto; padding: 2.4rem 1.4rem 0; }
.af-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, .8fr) auto; gap: 2rem; align-items: start; padding-bottom: 2rem; }
.af-brand .lockup-logo { height: 54px; }
.af-brand .lockup-text strong { font-size: 1.15rem; }
.af-brand p { margin: .9rem 0 .8rem; font-size: .9rem; line-height: 1.8; max-width: 360px; color: rgba(255, 255, 255, .66); }
.af-secure { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--a-300); padding: .35rem .75rem; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); }
.af-col h4 { margin: .3rem 0 .9rem; color: #fff; font-size: .95rem; }
.af-col nav { display: grid; gap: .55rem; }
.af-col a { color: rgba(255, 255, 255, .66); font-size: .9rem; width: fit-content; }
.af-col a:hover { color: var(--a-300); }
.af-credits { display: grid; gap: .7rem; }
.credit.credit-card { gap: .75rem; padding: .65rem 1rem .65rem .7rem; min-width: 245px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.credit.credit-card img { width: 40px; height: 40px; }
.credit.credit-card .cr-text small { font-size: .66rem; color: rgba(255, 255, 255, .6); opacity: 1; }
.credit.credit-card .cr-text b { font-size: .95rem; color: #fff; }
.credit-refai.credit-card { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.credit-refai.credit-card .cr-text b { color: var(--a-300); }
.af-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 0 1.2rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .8rem; color: rgba(255, 255, 255, .5); }
.af-top { display: inline-flex; align-items: center; gap: .35rem; color: rgba(255, 255, 255, .6); }
.af-top .ic { transform: rotate(90deg); }
.af-top:hover { color: #fff; }
.area-admin .af-wrap { max-width: 1320px; }
.tabbar { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--gold-grad); color: #241a05; font-weight: 800; flex-shrink: 0; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.6rem; }

/* ---------- الصفحات العامة ---------- */
.public-body { background: var(--surface); }
.pub-head { position: absolute; inset: 0 0 auto 0; z-index: 10; padding: 1rem 0; }
.pub-head.solid { position: sticky; top: 0; background: var(--deep); }
.pub-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pub-nav { display: flex; gap: 1.6rem; }
.pub-nav a { color: rgba(255, 255, 255, .78); font-weight: 600; font-size: .95rem; }
.pub-nav a:hover { color: #fff; }
.pub-cta { display: flex; gap: .5rem; }
.pub-head .btn-ghost { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hero { position: relative; overflow: hidden; color: #fff; padding: 8.5rem 0 5rem; background: radial-gradient(900px 520px at 85% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%), linear-gradient(165deg, var(--primary), var(--deeper)); }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, rgba(0, 0, 0, .18)); pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem); line-height: 1.32; color: #fff; margin-bottom: .6rem; }
.hero .lead { font-size: 1.1rem; color: rgba(255, 255, 255, .82); max-width: 34rem; margin: 1rem 0 1.8rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 1.4rem; margin-top: 1.8rem; font-size: .88rem; color: rgba(255, 255, 255, .72); flex-wrap: wrap; }
.hero-trust span { display: inline-flex; gap: .4rem; align-items: center; }
.hero-mark { display: grid; place-items: center; }
.hero-mark img { width: min(360px, 80%); filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .35)); }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg); }
.sec-head { max-width: 640px; margin: 0 auto 2.4rem; text-align: center; }
.sec-head p { color: var(--muted); }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.how { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.8rem 1.5rem; position: relative; }
.how-n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--accent); font: 800 1.1rem var(--display); margin-bottom: 1rem; }
.how p { color: var(--muted); margin: 0; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feat { padding: 1.4rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.feat > .ic { color: var(--a-700); margin-bottom: .6rem; }
.feat p { color: var(--muted); margin: 0; font-size: .94rem; }
.cats-band { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: center; margin-top: 2rem; }
.privacy-band { display: grid; grid-template-columns: auto 1fr auto; gap: 1.6rem; align-items: center; background: var(--deep); color: rgba(255, 255, 255, .8); border-radius: var(--r-xl); padding: 2rem; }
.privacy-band h2 { color: #fff; }
.privacy-ic { width: 72px; height: 72px; border-radius: 20px; background: rgba(255, 255, 255, .08); color: var(--accent); display: grid; place-items: center; }
.privacy-band p { margin: 0; }
.page-prose { padding: 2rem; }
.site-footer { background: var(--deeper); color: rgba(255, 255, 255, .75); padding: 2.4rem 0 1.4rem; }
.foot-top { display: flex; justify-content: space-between; align-items: center; gap: 1.4rem; flex-wrap: wrap; padding-bottom: 1.4rem; }
.foot-links { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.foot-links a, .foot-links span { color: rgba(255, 255, 255, .75); }
.foot-links a:hover { color: #fff; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .84rem; }

/* ---------- الدخول والتسجيل ---------- */
.auth-body { background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth-art { background: radial-gradient(600px 400px at 80% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), linear-gradient(160deg, var(--primary), var(--deeper)); color: rgba(255, 255, 255, .82); display: flex; align-items: center; justify-content: center; padding: 3rem 2.5rem; position: sticky; top: 0; height: 100vh; }
.auth-art-inner { max-width: 380px; text-align: center; display: grid; justify-items: center; gap: .4rem; }
.auth-art-logo { width: 190px; filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .35)); margin-bottom: .6rem; }
.auth-art h2 { color: #fff; font-size: 1.6rem; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 1.4rem 0 2rem; display: grid; gap: .7rem; text-align: right; width: 100%; }
.auth-points li { display: flex; gap: .65rem; align-items: center; padding: .7rem .9rem; border-radius: var(--r-md); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: .93rem; }
.auth-points .ic { color: var(--accent); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.2rem; }
.auth-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 2rem; box-shadow: var(--sh-2); }
.auth-card.wide { max-width: 640px; }
.auth-title { font-size: 1.45rem; margin-bottom: 1.2rem; }
.auth-mobile-logo { display: none; }
.auth-alt { text-align: center; margin: 1.1rem 0 0; font-size: .93rem; color: var(--muted); }
.auth-alt a { font-weight: 800; }
.auth-foot { margin-top: 1.4rem; display: none; }

/* ---------- لوحة المستخدم ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; }
.welcome { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.6rem 1.7rem; border-radius: var(--r-xl); margin-bottom: 1rem; color: rgba(255, 255, 255, .8); background: radial-gradient(500px 260px at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 65%), linear-gradient(150deg, var(--primary), var(--deep)); }
.welcome h1 { color: #fff; margin: 0; }
.welcome p { margin: .15rem 0 0; color: rgba(255, 255, 255, .7); }
.welcome .eyebrow { color: var(--a-300); font-weight: 700; font-size: .85rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.05rem 1.2rem; }
.stat span { color: var(--muted); font-size: .86rem; }
.stat strong { display: block; font: 800 1.75rem/1.3 var(--display); }
.stat strong small { font-size: .95rem; color: var(--muted); }
.bar { height: 6px; border-radius: 6px; background: var(--line-2); margin-top: .5rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold-grad); border-radius: 6px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem .2rem; border-top: 1px solid var(--line-2); color: var(--ink); }
.list-row:first-child { border-top: 0; }
.list-row small { display: block; color: var(--muted); font-size: .8rem; }
.list-row:hover strong { color: var(--primary); }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.case-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.case-card:hover { border-color: var(--p-200); box-shadow: var(--sh-2); }
.case-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.case-card h4 { margin: .2rem 0; font-size: 1rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.case-card-meta { display: flex; gap: .35rem; flex-wrap: wrap; }
.case-card-meta span { font-size: .74rem; color: var(--muted); background: var(--bg); padding: .08rem .5rem; border-radius: 6px; }
.empty { text-align: center; padding: 2.4rem 1rem; }
.empty-ic { width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 22px; display: grid; place-items: center; background: var(--p-50); color: var(--primary); }
.empty p { color: var(--muted); max-width: 26rem; margin: 0 auto 1.2rem; }

/* استشارة جديدة */
.step-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--primary); color: var(--accent); font-size: .85rem; font-weight: 800; }
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.type-opt input { position: absolute; opacity: 0; }
.type-opt span { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; padding: .95rem .5rem; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; font-size: .86rem; transition: .15s; height: 100%; }
.type-opt span .ic { color: var(--muted); }
.type-opt input:checked + span { border-color: var(--primary); background: var(--p-50); box-shadow: inset 0 0 0 1px var(--primary); }
.type-opt input:checked + span .ic { color: var(--primary); }
.type-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.dropzone { border: 2px dashed var(--p-200); border-radius: var(--r-lg); padding: 1.8rem 1rem; text-align: center; background: var(--p-50); transition: .15s; }
.dropzone.drag { border-color: var(--primary); background: var(--p-100); }
.dz-ic { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto .7rem; display: grid; place-items: center; background: var(--surface); color: var(--primary); border: 1px solid var(--line); }
.dz-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.file-list { display: grid; gap: .5rem; margin-top: .9rem; }
.file-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.file-thumb { width: 44px; height: 44px; border-radius: 9px; background: var(--p-50); color: var(--primary); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info { flex: 1; min-width: 0; }
.file-info b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info small { color: var(--muted); font-size: .78rem; }
.submit-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); margin-bottom: 1rem; z-index: 5; }
.submit-bar p { margin: 0; font-size: .88rem; display: flex; gap: .35rem; align-items: center; }

/* المؤشرات — بدون دوران */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8, 26, 20, .6); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.overlay-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-xl); padding: 2rem 1.6rem; text-align: center; box-shadow: var(--sh-3); }
.seal { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(150deg, var(--primary), var(--deep)); color: var(--accent); flex-shrink: 0; position: relative; }
.seal::after { content: ''; position: absolute; inset: -6px; border-radius: 26px; border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); animation: breathe 2.2s ease-in-out infinite; }
.overlay-card .seal { margin: 0 auto 1rem; }
@keyframes breathe { 0%, 100% { opacity: .15; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
.progress { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; margin: 1rem 0 .6rem; position: relative; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); border-radius: 8px; transition: width .6s ease; }
.progress.indeterminate i { width: 30%; position: absolute; animation: slide 1.7s ease-in-out infinite; }
@keyframes slide { 0% { right: -30%; } 100% { right: 100%; } }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--accent); vertical-align: -2px; margin-inline-start: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- مكتب الدراسة (الانتظار الحي) ---------- */
.desk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--sh-2); }
.desk-head { display: flex; gap: 1.1rem; align-items: center; padding: 1.4rem 1.5rem; color: rgba(255, 255, 255, .8); background: radial-gradient(500px 220px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%), linear-gradient(150deg, var(--primary), var(--deep)); }
.desk-head .seal { background: rgba(255, 255, 255, .08); }
.desk-head h3 { color: #fff; margin: 0 0 .15rem; font-size: 1.15rem; }
.desk-head p { margin: 0; font-size: .9rem; }
.desk-time { margin-inline-start: auto; text-align: center; flex-shrink: 0; }
.desk-time b { display: block; font: 800 1.5rem/1 var(--display); color: #fff; direction: ltr; }
.desk-time small { font-size: .74rem; color: var(--a-300); }
.desk-rail { display: grid; grid-template-columns: repeat(4, 1fr); padding: 1rem 1.5rem .2rem; gap: .5rem; }
.rail-step { display: grid; gap: .45rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.rail-step i { height: 5px; border-radius: 5px; background: var(--line-2); overflow: hidden; position: relative; }
.rail-step.done { color: var(--ok); }
.rail-step.done i { background: var(--ok); }
.rail-step.now { color: var(--ink); }
.rail-step.now i::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--gold-grad); border-radius: 5px; animation: slide 1.6s ease-in-out infinite; }
.desk-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; padding: 1rem 1.5rem 1.4rem; }
.desk-pct { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: var(--muted); }
.desk-pct b { font: 800 1.1rem var(--display); color: var(--ink); direction: ltr; }
.sections { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .15rem; }
.sections li { display: flex; align-items: center; gap: .6rem; padding: .42rem .55rem; border-radius: 10px; font-size: .9rem; color: var(--muted); transition: background .3s, color .3s; }
.sections li .mk { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex-shrink: 0; background: #fff; }
.sections li.done { color: var(--ink); }
.sections li.done .mk { background: var(--primary); border-color: var(--primary); color: var(--accent); }
.sections li.now { background: var(--a-50); color: var(--ink); font-weight: 700; }
.sections li.now .mk { border-color: var(--accent); }
.sections li.now .mk::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.sections li.now em { margin-inline-start: auto; font-style: normal; font-size: .75rem; color: var(--a-700); }
.live-preview { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; background: linear-gradient(180deg, #fff, var(--bg)); min-height: 190px; display: flex; flex-direction: column; }
.live-preview h4 { margin: 0 0 .5rem; font-size: .85rem; color: var(--a-700); display: flex; align-items: center; gap: .4rem; }
.live-preview .lp-text { font-size: .95rem; line-height: 1.95; color: var(--ink-2); flex: 1; }
.live-preview .lp-wait { color: var(--muted); font-size: .9rem; display: flex; gap: .6rem; align-items: center; }
.desk-tip { display: flex; gap: .6rem; align-items: flex-start; margin-top: .9rem; padding: .75rem .9rem; border-radius: var(--r-md); background: var(--p-50); font-size: .88rem; color: var(--ink-2); min-height: 3.4em; }
.desk-tip .ic { color: var(--primary); margin-top: .2rem; }
.desk-tip span { transition: opacity .4s; }
.desk-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .9rem 1.5rem; border-top: 1px solid var(--line-2); background: var(--bg); font-size: .84rem; color: var(--muted); flex-wrap: wrap; }

/* ---------- صفحة الاستشارة ---------- */
.back { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); margin-bottom: .8rem; }
.back .ic { transform: scaleX(-1); }
.back:hover { color: var(--primary); }
.case-head { margin-bottom: 1.2rem; }
.case-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.case-head h1, .admin-case-head h2 { margin: .35rem 0 .4rem; }
.case-ids { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.case-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.case-meta span { font-size: .8rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: .12rem .6rem; border-radius: 999px; }
.case-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; align-items: start; }
.case-main { min-width: 0; }
.case-side { position: sticky; top: 1.2rem; min-width: 0; }
.files-side { display: grid; gap: .3rem; }
.files-side a { display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border-radius: 10px; color: var(--ink); font-size: .86rem; border: 1px solid transparent; min-width: 0; overflow: hidden; }
.files-side a:hover { background: var(--bg); border-color: var(--line); }
.files-side a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.files-side a small { color: var(--muted); font-size: .72rem; flex-shrink: 0; }
.files-side .ic { color: var(--primary); }
.body-text { font-size: .9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.clamp { max-height: 220px; overflow: hidden; position: relative; }
.clamp.open { max-height: none; }
.clamp:not(.open)::after { content: ''; position: absolute; inset: auto 0 0 0; height: 60px; background: linear-gradient(transparent, #fff); }
.clamp-btn { margin-top: .4rem; background: none; border: 0; color: var(--primary); font: 700 .85rem var(--font); cursor: pointer; padding: 0; }
.mini-timeline { list-style: none; padding: 0; margin: 0; }
.mini-timeline li { position: relative; padding: 0 1.6rem .9rem 0; font-size: .9rem; color: var(--muted); }
.mini-timeline li::before { content: ''; position: absolute; right: 3px; top: .45rem; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.mini-timeline li::after { content: ''; position: absolute; right: 8px; top: 1.2rem; bottom: 0; width: 1.5px; background: var(--line); }
.mini-timeline li:last-child::after { display: none; }
.mini-timeline li.done { color: var(--ink); font-weight: 600; }
.mini-timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; counter-reset: toc; }
.toc a { display: flex; gap: .55rem; align-items: center; padding: .4rem .5rem; border-radius: 9px; font-size: .87rem; color: var(--ink-2); counter-increment: toc; }
.toc a::before { content: counter(toc); width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--bg); font-size: .72rem; font-weight: 800; color: var(--muted); flex-shrink: 0; }
.toc a:hover { background: var(--bg); color: var(--primary); }
.failed-card { border-color: #f2c5bf; background: #fffafa; }
.cancel-card { background: var(--bg); }
.prelim .kv { margin: .8rem 0; padding: .8rem 1rem; background: var(--bg); border-radius: var(--r-md); }
.kv span { font-size: .8rem; font-weight: 700; color: var(--a-700); }
.kv p { margin: .2rem 0 0; }
.note { display: flex; gap: .55rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-md); font-size: .92rem; margin: .7rem 0; }
.note-warn { background: #fbf2e1; color: #6f440e; }
.doc-list { display: grid; gap: .45rem; }
.doc-list div { display: grid; grid-template-columns: auto minmax(0, auto) 1fr; gap: .5rem; align-items: baseline; font-size: .9rem; padding: .55rem .7rem; background: var(--bg); border-radius: 10px; }
.doc-list span { color: var(--muted); }
.questions { border-color: var(--a-100); box-shadow: 0 0 0 4px var(--a-50); }
.q-item { padding: 1rem 0; border-top: 1px solid var(--line-2); }
.q-item:first-of-type { border-top: 0; }
.q-label { display: flex; gap: .65rem; font-weight: 700; margin-bottom: .3rem; }
.q-n { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: var(--accent); display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.q-why { font-size: .84rem; color: var(--muted); margin: 0 2.2rem .6rem 0; }
.q-item input, .q-item textarea, .q-item .seg { margin-inline-start: 2.2rem; width: calc(100% - 2.2rem); }
.seg { display: flex; gap: .45rem; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: .35rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; font-size: .9rem; transition: .12s; background: #fff; }
.seg input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.qa-list { display: grid; gap: .6rem; }
.qa { padding: .75rem .95rem; background: var(--bg); border-radius: var(--r-md); }
.qa .q { font-weight: 700; margin: 0 0 .2rem; font-size: .92rem; }
.qa .a { margin: 0; font-size: .92rem; }
.collapsible summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .5rem; list-style: none; }
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible[open] summary { margin-bottom: 1rem; }
.collapsible .card { box-shadow: none; }

/* الاستشارة النهائية — بطابع المذكرة القانونية */
.opinion { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 2rem 2.1rem; margin-bottom: 1rem; }
.opinion::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--gold-grad); }
.op-head { display: flex; gap: 1rem; align-items: center; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; }
.op-seal { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(150deg, var(--primary), var(--deep)); color: var(--accent); flex-shrink: 0; }
.op-head h2 { margin: .1rem 0 .35rem; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--a-700); }
.op-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.op-meta span { font-size: .78rem; color: var(--muted); background: var(--bg); padding: .08rem .55rem; border-radius: 6px; }
.op-summary { background: linear-gradient(135deg, var(--a-50), #fff 70%); border: 1px solid var(--a-100); border-inline-start: 4px solid var(--accent); border-radius: var(--r-md); padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.op-summary h3 { color: var(--a-700); }
.meter { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 1.2rem; }
.meter-head { display: flex; justify-content: space-between; font-weight: 700; }
.meter-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: .55rem 0 .7rem; }
.meter-bars i { height: 9px; border-radius: 5px; background: var(--line-2); }
.meter-bars i.on.ok { background: var(--ok); } .meter-bars i.on.warn { background: var(--warn); } .meter-bars i.on.bad { background: var(--bad); }
.meter p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.op-sec { padding: 1.15rem 0; border-top: 1px solid var(--line-2); scroll-margin-top: 1rem; }
.op-sec > h3, .op-sec .card-head h3 { display: flex; align-items: center; gap: .5rem; color: var(--primary); }
.regs { display: grid; gap: .6rem; }
.reg { padding: .85rem 1rem; border-radius: var(--r-md); background: var(--bg); border-inline-start: 3px solid var(--primary); }
.reg-name { font-weight: 800; display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.reg-name small { font-weight: 700; color: var(--a-700); font-size: .82rem; }
.reg p { margin: .3rem 0 0; font-size: .93rem; }
.sw { padding: 1rem 1.1rem; border-radius: var(--r-md); border-top: 0 !important; margin-top: 1rem; }
.sw-ok { background: #f0f8f3; } .sw-ok h3 { color: var(--ok) !important; }
.sw-bad { background: #fcf3f1; } .sw-bad h3 { color: var(--bad) !important; }
.clean-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.clean-list li { position: relative; padding-inline-start: 1.2rem; }
.clean-list li::before { content: ''; position: absolute; right: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.clean-list.checks li::before { content: '✓'; width: auto; height: auto; background: none; top: 0; color: var(--ok); font-weight: 800; }
.num-list { padding-inline-start: 1.3rem; margin: 0; display: grid; gap: .5rem; }
.num-list li::marker { color: var(--a-700); font-weight: 800; }
.risk-list { display: grid; gap: .55rem; }
.risk { padding: .75rem .95rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.risk > div { display: flex; gap: .6rem; align-items: center; }
.risk p { margin: .35rem 0 0; font-size: .9rem; color: var(--muted); }
.steps { display: grid; }
.step { display: flex; gap: .9rem; position: relative; padding-bottom: 1rem; }
.step:not(:last-child)::after { content: ''; position: absolute; right: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; z-index: 1; }
.step strong { display: block; }
.step-auth { display: inline-block; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--a-700); background: var(--a-50); padding: .05rem .5rem; border-radius: 6px; margin: .15rem 0; }
.step p { margin: .2rem 0 0; font-size: .93rem; color: var(--ink-2); }
.deadlines { display: grid; gap: .55rem; }
.deadlines > div { padding: .7rem .9rem; background: var(--bg); border-radius: var(--r-md); }
.deadlines strong { margin-inline-end: .5rem; }
.deadlines p { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); }
.draft { background: var(--bg); border: 1px solid var(--line) !important; border-radius: var(--r-md); padding: 1.1rem 1.2rem !important; margin-top: 1rem; }
.draft-body { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.3rem 1.5rem; font-size: .96rem; }
.verify { background: #f1f6fb; border-radius: var(--r-md); padding: 1rem 1.1rem !important; border-top: 0 !important; margin-top: 1rem; }
.verify h3 { color: var(--info) !important; }
.op-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.disclaimer { display: flex; gap: .5rem; font-size: .82rem; color: var(--muted); line-height: 1.75; }
.disclaimer .ic { margin-top: .2rem; color: var(--primary); }
.op-powered { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; padding: .7rem .9rem; border-radius: var(--r-md); background: var(--bg); font-size: .85rem; color: var(--muted); }
.prose { font-size: .98rem; line-height: 1.95; overflow-wrap: anywhere; }
.prose h3, .prose h4 { color: var(--primary); margin: 1.1em 0 .4em; }
.prose ul, .prose ol { padding-inline-start: 1.3rem; margin: .4em 0 .9em; }
.prose li { margin-bottom: .25em; }
.prose blockquote { margin: .8em 0; padding: .6em 1em; border-inline-start: 3px solid var(--accent); background: var(--a-50); border-radius: 8px; }
.prose p:last-child { margin-bottom: 0; }

/* أسئلة المتابعة */
.thread { display: grid; gap: .8rem; margin-bottom: 1rem; }
.bubble { max-width: 88%; padding: .8rem 1rem; border-radius: 18px; font-size: .95rem; overflow-wrap: anywhere; }
.bubble.me { justify-self: start; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { justify-self: end; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.pending { min-width: 220px; }
.bubble .b-wait { display: flex; gap: .6rem; align-items: center; color: var(--muted); }
.bubble.failed { background: #fcefed; color: var(--bad); }
.bubble.cancelled { background: var(--line-2); color: var(--muted); font-style: italic; }
.b-meta { font-size: .72rem; opacity: .7; margin-bottom: .2rem; }
.b-foot { margin-top: .6rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.b-cancel { background: none; border: 0; color: var(--muted); font: 600 .78rem var(--font); cursor: pointer; text-decoration: underline; }
.composer { display: flex; gap: .6rem; align-items: flex-end; margin-top: .6rem; }
.composer textarea { min-height: 54px; border-radius: var(--r-lg); }
.composer .btn { height: 54px; width: 58px; padding: 0; border-radius: var(--r-lg); }

/* ---------- الجداول والفلاتر ---------- */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .75rem; }
.filters select { width: auto; min-width: 150px; }
.search-input { flex: 1; min-width: 220px; position: relative; }
.search-input .ic { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding-right: 2.5rem !important; }
.date-f { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.date-f input { width: auto !important; }
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 1rem 1.15rem 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: right; font-size: .76rem; font-weight: 700; color: var(--muted); padding: .75rem .9rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.table td { padding: .75rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--bg) 55%, #fff); }
.table.compact td, .table.compact th { padding: .55rem .75rem; }
.card > .table.compact { margin: 0 -1.25rem -1.25rem; width: calc(100% + 2.5rem); }
.card.table-card > .table, .card.table-card > .table.compact { margin: 0; width: 100%; }
.table-card > .card-head { margin-bottom: .9rem; }
.table .cb { width: 36px; }
.table .cb input { width: 18px; height: 18px; accent-color: var(--primary); }
.td-wrap { white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
.err-text { display: block; margin-top: 3px; font: .74rem/1.5 ui-monospace, Menlo, monospace; color: var(--bad); direction: ltr; text-align: left; white-space: normal; overflow-wrap: anywhere; max-width: 460px; }
.t-title { font-weight: 700; color: var(--ink); }
.t-title:hover { color: var(--primary); }
.star-on { color: var(--accent); }
.row-actions form { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.pager { display: flex; gap: .35rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.pager a { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.result-line { margin: -.3rem 0 .8rem; }
.bulk-bar { position: sticky; bottom: 1rem; z-index: 6; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .7rem .9rem; margin: .5rem 0 1rem; background: var(--deep); color: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); }
.bulk-bar b { margin-inline-end: auto; }
.bulk-bar .btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); }

/* ---------- لوحة الإدارة ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; padding-inline-end: 3.8rem; position: relative; }
.kpi > span { color: var(--muted); font-size: .85rem; display: block; }
.kpi strong { display: block; font: 800 1.8rem/1.3 var(--display); margin: .1rem 0; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi-ic { position: absolute; left: 1rem; top: 1rem; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--p-50); color: var(--primary); }
.kpis.small .kpi { padding-inline-end: 1.2rem; }
.kpis.small .kpi strong { font-size: 1.3rem; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
.admin-grid > .card { overflow: hidden; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 1rem; overflow: hidden; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.vbar i { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--primary))); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.vbar small { font-size: .66rem; color: var(--muted); direction: ltr; }
.vbar-n { font-size: .72rem; font-weight: 700; min-height: 1em; }
.hbars { display: grid; gap: .55rem; }
.hbar { display: grid; grid-template-columns: 7.5rem 1fr 2.4rem; gap: .6rem; align-items: center; font-size: .86rem; }
.hbar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar div { height: 9px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.hbar b { text-align: left; }
.status-list > div { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line-2); font-size: .92rem; }
.status-list > div:first-child { border-top: 0; }
.jobs { display: grid; gap: .5rem; }
.job { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.job > div { flex: 1; min-width: 0; }
.job strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job small { color: var(--muted); font-size: .76rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs-inline { display: flex; gap: .3rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .3rem; }
.tabs-inline a { padding: .42rem .85rem; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .88rem; display: inline-flex; gap: .4rem; align-items: center; }
.tabs-inline a em { font-style: normal; font-size: .75rem; background: var(--line-2); padding: 0 .4rem; border-radius: 6px; }
.tabs-inline a.active { background: var(--primary); color: #fff; }
.tabs-inline a.active em { background: rgba(255, 255, 255, .2); }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .75rem 1rem; color: var(--muted); font-weight: 700; font-size: .93rem; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
.save-bar { grid-column: 1 / -1; position: sticky; bottom: 0; padding: .9rem 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; }
.upload-row { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem; border: 1px dashed var(--line); border-radius: var(--r-md); margin-bottom: 1rem; background: var(--bg); }
.upload-row .field { margin-bottom: .2rem; }
.upload-prev { width: 96px; height: 96px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; padding: 8px; }
.upload-prev.sm { width: 64px; height: 64px; }
.upload-prev.dark { background: var(--deep); border-color: var(--deep); }
.upload-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload-row > div:last-child { flex: 1; min-width: 0; }
.color-in { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.color-in input[type=color] { width: 44px; height: 34px; border: 0; background: none; cursor: pointer; padding: 0; }
.brand-preview { overflow: hidden; padding: 0; }
.brand-preview .card-head { padding: 1rem 1.1rem 0; }
.pv-shell { display: grid; grid-template-columns: 120px 1fr; margin: 0 1.1rem 1.1rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); min-height: 220px; }
.pv-side { background: var(--deep); padding: .8rem .6rem; display: grid; align-content: start; gap: .5rem; justify-items: center; }
.pv-side img { height: 54px; }
.pv-side i { display: block; width: 100%; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.pv-side i.on { background: var(--gold-grad); height: 22px; border-radius: 7px; }
.pv-main { background: var(--bg); padding: .9rem; display: grid; align-content: start; gap: .55rem; }
.pv-main .pv-name { font: 800 1rem var(--display); }
.pv-main small { color: var(--muted); font-size: .78rem; }
.pv-hero { border-radius: 10px; padding: .8rem; color: #fff; background: linear-gradient(150deg, var(--primary), var(--deep)); font-size: .8rem; }
.pv-accent { display: inline-block; margin-top: .4rem; padding: .25rem .7rem; border-radius: 7px; background: var(--gold-grad); color: #241a05; font-size: .75rem; font-weight: 700; }
.pv-light { display: flex; gap: .6rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem; }
.pv-light img { height: 38px; }
.radio-cards { display: grid; gap: .5rem; }
.radio-cards label { cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; }
.radio-cards span { display: block; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-md); transition: .12s; }
.radio-cards span small { display: block; color: var(--muted); font-size: .84rem; }
.radio-cards input:checked + span { border-color: var(--primary); background: var(--p-50); }
.adv { margin-bottom: 1rem; }
.adv summary { cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--muted); margin-bottom: .6rem; }
.cat-rows { display: grid; gap: .5rem; }
.cat-row { display: flex; gap: .6rem; align-items: center; padding: .6rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.cat-row.off { opacity: .55; }
.cat-row .sort { width: 64px !important; text-align: center; }
.cat-fields { flex: 1; display: grid; grid-template-columns: 1fr 1.4fr; gap: .5rem; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { right: 23px; }
.user-hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.user-hero h2 { margin: 0; }
.user-hero p { margin: .2rem 0 0; font-size: .88rem; }
.user-hero > div:nth-child(2) { flex: 1; min-width: 0; }
.mini-stats { display: flex; gap: 1.4rem; }
.mini-stats div { text-align: center; }
.mini-stats b { display: block; font: 800 1.35rem var(--display); }
.mini-stats span { font-size: .78rem; color: var(--muted); }
.activity > div { padding: .55rem 0; border-top: 1px solid var(--line-2); font-size: .88rem; min-width: 0; }
.activity > div:first-child { border-top: 0; }
.activity small { display: block; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.danger-zone { border-color: #f2c5bf; }
.modal { position: fixed; inset: 0; z-index: 300; background: rgba(8, 26, 20, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-xl); padding: 1.4rem; box-shadow: var(--sh-3); }
.toast { position: fixed; bottom: calc(22px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 400; background: var(--ink); color: #fff; padding: .75rem 1.2rem; border-radius: var(--r-md); font-size: .92rem; box-shadow: var(--sh-3); white-space: pre-line; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- عرض الطباعة (احتياطي) ---------- */
.print-body { background: #e7ebe8; }
.print-toolbar { display: flex; gap: .6rem; justify-content: center; padding: 1rem; position: sticky; top: 0; background: #e7ebe8; z-index: 5; }
.print-page { max-width: 860px; margin: 0 auto 2rem; background: #fff; padding: 2.4rem 2.6rem; box-shadow: var(--sh-3); }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 3px double var(--primary); }
.ph-brand { display: flex; gap: .7rem; align-items: center; }
.ph-brand img { height: 64px; }
.ph-brand strong { display: block; font: 800 1.2rem var(--display); color: var(--primary); }
.ph-brand small { color: var(--muted); font-size: .8rem; }
.ph-meta { display: grid; gap: .1rem; font-size: .82rem; color: var(--muted); text-align: left; }
.ph-meta b { color: var(--ink); }
.confidential { text-align: center; font-size: .75rem; font-weight: 800; color: var(--bad); margin: .7rem 0 1rem; }
.print-page .opinion { border: 0; box-shadow: none; padding: 0; }
.print-page .opinion::before { display: none; }
.print-qa { margin-bottom: 1rem; }
.print-qa .q { font-weight: 700; background: var(--bg); padding: .5rem .8rem; border-radius: 8px; }
.print-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; font-size: 12.5px; }
  .no-print { display: none !important; }
  .print-page { box-shadow: none; padding: 0; margin: 0; max-width: none; }
  .op-sec, .reg, .risk, .step, .meter { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- الشاشات المتوسطة والجوال ---------- */
@media (max-width: 1100px) {
  .af-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .af-credits { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, max-content)); }
}
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid .span-2, .admin-grid .span-3 { grid-column: 1 / -1; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .case-grid { grid-template-columns: 1fr 1fr; }
  .desk-body { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .tb-nav { display: none; }
  .tb-menu { display: inline-grid; }
  .drawer { display: flex; flex-direction: column; position: fixed; inset: 0 0 0 auto; width: min(310px, 86vw); z-index: 100; transform: translateX(105%); transition: transform .25s ease; background: var(--deep); color: #fff; box-shadow: var(--sh-3); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer.open { transform: none; }
  .side-overlay.open { display: block; position: fixed; inset: 0; background: rgba(5, 20, 15, .5); z-index: 90; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem; padding-top: calc(1rem + env(safe-area-inset-top, 0px)); border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .drawer-head .icon-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .18); }
  .drawer-cta { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 1rem; min-height: 48px; border-radius: var(--r-md); background: var(--gold-grad); color: #241a05; font-weight: 800; }
  .drawer-nav { display: grid; align-content: start; gap: 2px; padding: .4rem .75rem; flex: 1; overflow-y: auto; }
  .drawer-nav a:last-child { margin-top: .5rem; border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0 0 var(--r-md) var(--r-md); color: #f3b4ab; }
  .drawer-nav a { display: flex; align-items: center; gap: .7rem; padding: .75rem .85rem; border-radius: var(--r-md); color: rgba(255, 255, 255, .8); font-weight: 600; }
  .drawer-nav a span { flex: 1; }
  .drawer-nav a.active { background: rgba(255, 255, 255, .1); color: #fff; }
  .drawer-nav a.active .ic { color: var(--accent); }
  .drawer-foot { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
  .drawer-foot .install-btn { width: 100%; }
}
@media (max-width: 960px) {
  .side-overlay.open { display: block; position: fixed; inset: 0; background: rgba(5, 20, 15, .5); z-index: 90; }
  .content-inner { padding: 1.1rem 1rem .6rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .case-layout { grid-template-columns: minmax(0, 1fr); }
  .case-side { position: static; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions, .hero-trust { justify-content: center; }
  .hero .lead { margin-inline: auto; }
  .hero-mark { order: -1; }
  .hero-mark img { width: 180px; }
  .how-grid, .feat-grid { grid-template-columns: 1fr; }
  .privacy-band { grid-template-columns: 1fr; text-align: center; }
  .privacy-ic { margin: 0 auto; }
  .pub-nav { display: none; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-logo { display: block; text-align: center; margin-bottom: .6rem; }
  .auth-mobile-logo img { height: 96px; }
  .auth-foot { display: block; }
  .auth-title { text-align: center; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .topbar-inner { height: 60px; padding: 0 .8rem; gap: .6rem; }
  .topbar .lockup-logo { height: 38px; }
  .topbar .lockup-text strong { font-size: .95rem; }
  .topbar .lockup-text small, .tb-cta, .uc-name, .user-chip > .ic { display: none; }
  .user-chip { padding: 0 3px; height: 42px; }
  .tb-install { width: 40px; height: 40px; }
  .content-inner { padding: 1.1rem 1rem .8rem; }
  .area-app .app-footer { padding-bottom: calc(78px + var(--safe-b)); }
  .af-wrap { padding: 1.8rem 1rem 0; }
  .af-grid { grid-template-columns: 1fr 1fr; gap: 1.4rem 1rem; padding-bottom: 1.4rem; }
  .af-brand, .af-credits { grid-column: 1 / -1; }
  .af-credits { grid-template-columns: 1fr; }
  .credit.credit-card { min-width: 0; }
  .af-bottom { justify-content: center; text-align: center; }
  .af-top { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; inset: auto 0 0 0; z-index: 60; background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: .35rem .3rem calc(.4rem + var(--safe-b)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); padding: .25rem 0; }
  .tabbar a.active { color: var(--primary); }
  .tabbar .tab-fab { align-self: center; justify-self: center; width: 56px; height: 56px; margin-top: -22px; border-radius: 18px; background: var(--gold-grad); color: #241a05; display: grid; place-items: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent); padding: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .case-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .op-grid { grid-template-columns: 1fr; }
  .opinion { padding: 1.3rem 1.1rem; border-radius: var(--r-lg); }
  .op-head { flex-direction: column; align-items: flex-start; }
  .card { padding: 1rem; }
  .card > .table.compact { margin: 0 -1rem -1rem; width: calc(100% + 2rem); }
  .kpis { gap: .7rem; }
  .kpi { padding-inline-end: 1rem; }
  .kpi strong { font-size: 1.4rem; }
  .kpi-ic { display: none; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .submit-bar { bottom: calc(76px + var(--safe-b)); padding: .6rem; }
  .submit-bar p { display: none; }
  .submit-bar .btn { width: 100%; }
  .bubble { max-width: 96%; }
  .q-item input, .q-item textarea, .q-item .seg { margin-inline-start: 0; width: 100%; }
  .q-why { margin-right: 0; }
  .filters > * { flex: 1 1 100%; }
  .filters select { width: 100%; }
  .foot-bottom, .foot-top { flex-direction: column; align-items: flex-start; }
  .cat-row { flex-wrap: wrap; }
  .cat-fields { grid-template-columns: 1fr; flex-basis: 100%; order: -1; }
  .hero { padding: 6.5rem 0 3.5rem; }
  .pub-cta .btn-ghost { display: none; }
  .desk-head { flex-wrap: wrap; padding: 1.1rem; }
  .desk-time { margin-inline-start: 0; text-align: right; display: flex; gap: .5rem; align-items: baseline; }
  .desk-rail { padding: .9rem 1rem .2rem; }
  .rail-step { font-size: .68rem; }
  .desk-body { padding: .9rem 1rem 1.1rem; }
  .desk-foot { padding: .8rem 1rem; }
  .mini-stats { width: 100%; justify-content: space-around; }
  .table th, .table td { padding: .6rem .65rem; }
  .table-card, .admin-grid > .card { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .table-card::-webkit-scrollbar { display: none; }
  .welcome { padding: 1.3rem 1.2rem; }
  .welcome .btn { width: 100%; }
  .print-page { padding: 1.2rem; }
  .print-head { flex-direction: column; }
  .ph-meta { text-align: right; }
  .pv-shell { grid-template-columns: 100px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (display-mode: standalone) {
  .install-btn { display: none !important; }
}

/* =========================================================
   لوحة المستخدم — الواجهة الرئيسية
   ========================================================= */
.hero-dash { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 1.5rem; padding: 2.2rem 2.3rem; margin-bottom: 1.2rem; border-radius: 26px; color: rgba(255, 255, 255, .78); background: var(--pattern) repeat, radial-gradient(520px 320px at 8% 50%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), radial-gradient(420px 260px at 100% 0%, rgba(255, 255, 255, .07), transparent 70%), linear-gradient(140deg, var(--primary) 10%, var(--deeper)); box-shadow: 0 18px 50px rgba(8, 35, 25, .22); isolation: isolate; }
.hero-dash::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--gold-grad); opacity: .85; }
.hd-dates { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.hd-dates span { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .75rem; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; color: rgba(255, 255, 255, .8); }
.hd-dates .ic { color: var(--a-300); }
.hero-dash h1 { margin: 0; color: #fff; font: 800 clamp(1.7rem, 2.8vw, 2.4rem)/1.35 var(--display); }
.hero-dash h1 span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hd-main > p { margin: .6rem 0 1.4rem; max-width: 560px; font-size: 1rem; line-height: 1.9; color: rgba(255, 255, 255, .72); }
.hd-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.qa { display: flex; align-items: center; gap: .75rem; padding: .85rem .9rem; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #fff; transition: background .15s, border-color .15s, transform .15s; }
.qa:hover { background: rgba(255, 255, 255, .11); border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-2px); }
.qa i { flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--gold-grad); color: #241a05; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.qa span { display: grid; min-width: 0; line-height: 1.35; }
@media (min-width: 761px) { .qa { flex-direction: column; align-items: flex-start; gap: .65rem; padding: 1rem; } .qa b { white-space: nowrap; } }
.qa b { font-size: .98rem; }
.qa small { font-size: .76rem; color: rgba(255, 255, 255, .6); }
.hd-art { position: relative; height: 270px; display: grid; place-items: center; }
.hd-ring { position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.hd-ring.r1 { width: 250px; height: 250px; border-style: dashed; opacity: .55; }
.hd-ring.r2 { width: 190px; height: 190px; opacity: .8; }
.hd-ring.r3 { width: 136px; height: 136px; background: radial-gradient(circle, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.hd-emblem { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.hd-emblem img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); }
.hd-chip { position: absolute; display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; white-space: nowrap; background: rgba(10, 40, 30, .55); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); backdrop-filter: blur(6px); }
.hd-chip .ic { color: var(--a-300); }
.hd-chip.c1 { top: 12%; right: 6%; }
.hd-chip.c2 { bottom: 14%; right: 0; }
.hd-chip.c3 { top: 46%; left: 0; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi-card { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-2); }
.kpi-card span { display: block; color: var(--muted); font-size: .85rem; }
.kpi-card strong { display: block; font: 800 1.75rem/1.2 var(--display); color: var(--ink); }
.k-ic { flex-shrink: 0; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; }
.k-ic.k1 { background: var(--p-100); color: var(--primary); }
.k-ic.k2 { background: #e3f3ea; color: var(--ok); }
.k-ic.k3 { background: var(--a-100); color: var(--a-700); }
.k-ic.k4 { background: #e4eef8; color: var(--info); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.dash-main > .card, .dash-side > .card { border-radius: 18px; box-shadow: var(--sh-2); }
.card-head .link { display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; }
.case-rows { display: grid; gap: .35rem; }
.case-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .8rem .85rem; border-radius: 14px; border: 1px solid transparent; color: inherit; transition: background .15s, border-color .15s; }
.case-row:hover { background: var(--p-50); border-color: var(--line); }
.cr-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--p-100); color: var(--primary); }
.cr-ic.st-warn { background: var(--a-100); color: var(--a-700); }
.cr-ic.st-info { background: #e4eef8; color: var(--info); }
.cr-ic.st-bad { background: #fbe7e5; color: var(--bad); }
.cr-body { min-width: 0; display: grid; }
.cr-body strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-body small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-body .ref { font-size: .74rem; }
.cr-end { display: grid; justify-items: end; gap: .2rem; }
.cr-end small { color: var(--muted); font-size: .76rem; }
.cr-go { color: var(--muted); opacity: .5; display: grid; }
.case-row:hover .cr-go { opacity: 1; color: var(--primary); }
.attn-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(180deg, var(--a-50), var(--surface) 70%); }

.empty-hero { text-align: center; padding: 1.6rem 1rem 1.2rem; }
.eh-art { width: 96px; height: 96px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--pattern) center, radial-gradient(circle, var(--primary), var(--deeper)); box-shadow: 0 0 0 8px var(--p-50), 0 14px 30px rgba(8, 35, 25, .2); }
.empty-hero h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.empty-hero p { margin: 0 auto 1.1rem; max-width: 420px; color: var(--muted); }

.steps-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.2rem; border-radius: 18px; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); }
.sb-step { display: flex; gap: .75rem; align-items: flex-start; }
.sb-step > b { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-grad); color: #241a05; font: 800 .95rem var(--display); }
.sb-step strong { display: block; font-size: .95rem; }
.sb-step small { color: var(--muted); font-size: .82rem; line-height: 1.6; }

.quota-card { display: flex; align-items: center; gap: 1.1rem; }
.q-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; display: grid; place-items: center; }
.q-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.q-ring circle { fill: none; stroke-width: 10; }
.q-bg { stroke: var(--line-2); }
.q-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1) 100; }
.q-ring > div { position: relative; text-align: center; display: grid; line-height: 1.2; }
.q-ring strong { font: 800 1.6rem var(--display); }
.q-ring small { color: var(--muted); font-size: .74rem; }
.q-text h4 { margin: 0 0 .3rem; font-size: 1rem; }
.q-text p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.cat-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.cat-chips a { padding: .42rem .8rem; border-radius: 999px; background: var(--p-50); border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; font-weight: 600; transition: background .15s, color .15s, border-color .15s; }
.cat-chips a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tip-card { position: relative; overflow: hidden; padding: 1.3rem 1.25rem; border-radius: 18px; color: rgba(255, 255, 255, .78); background: var(--pattern) repeat, linear-gradient(150deg, var(--primary), var(--deeper)); box-shadow: var(--sh-2); }
.tip-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .65rem; border-radius: 999px; background: var(--gold-grad); color: #241a05; font-size: .76rem; font-weight: 800; }
.tip-card h4 { margin: .75rem 0 .35rem; color: #fff; font-size: 1.05rem; }
.tip-card p { margin: 0; font-size: .88rem; line-height: 1.8; }

@media (max-width: 1100px) {
  .hero-dash { grid-template-columns: 1fr; }
  .hd-art { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .dash-side > * { margin: 0; }
  .tip-card { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .hero-dash { padding: 1.4rem 1.15rem; border-radius: 22px; }
  .hd-main > p { font-size: .92rem; margin-bottom: 1rem; }
  .hd-actions { grid-template-columns: 1fr; gap: .55rem; }
  .qa { padding: .7rem .8rem; }
  .qa i { width: 42px; height: 42px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .kpi-card { flex-direction: column; align-items: flex-start; gap: .55rem; padding: .95rem; }
  .k-ic { width: 42px; height: 42px; border-radius: 12px; }
  .kpi-card strong { font-size: 1.5rem; }
  .dash-side { grid-template-columns: 1fr; }
  .case-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .15rem .75rem; padding: .75rem .45rem; }
  .case-row > .pill { grid-column: 2; justify-self: start; }
  .cr-end { grid-column: 2; display: flex; align-items: center; gap: .6rem; }
  .cr-body strong, .cr-body small { white-space: normal; }
  .cr-go { display: none; }
  .cr-ic { width: 40px; height: 40px; }
  .steps-band { grid-template-columns: 1fr; }
}
.dropzone.dz-focus { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); transition: box-shadow .4s, border-color .4s; }
.og-prev { display: grid; max-width: 460px; margin: .4rem 0 1rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f0f2f5; }
.og-prev img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; display: block; background: var(--deep); }
.og-prev div { display: grid; gap: .15rem; padding: .6rem .8rem .7rem; }
.og-prev b { font-size: .92rem; }
.og-prev small { color: var(--muted); font-size: .8rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.og-prev span { color: var(--muted); font-size: .72rem; text-align: right; }
