@property --m { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --spin { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@property --r { syntax: "<length>"; inherits: true; initial-value: 62px; }

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; font-family: var(--font); font-size: 15px; line-height: 1.7;
  color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 520px at 50% -10%, var(--bg-glow), transparent 70%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; border-radius: var(--r-sm); }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; padding: 8px 14px; background: var(--surface-3); border-radius: var(--r-sm); color: var(--text); z-index: 50; }
.skip:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- الأزرار والحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); font-weight: 600;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:hover { border-color: var(--light); box-shadow: 0 0 0 4px var(--light-soft); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; border-color: var(--line); }
.btn--primary { background: var(--light); color: var(--bg); border-color: transparent; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); transition: border-color var(--fast), box-shadow var(--fast);
}
.input:focus { outline: none; border-color: var(--light); box-shadow: 0 0 0 4px var(--light-soft); }
.hint { font-size: 13px; color: var(--muted); }
.msg { min-height: 24px; font-size: 13.5px; color: var(--text-2); }
.msg[data-kind="bad"] { color: var(--bad); }
.msg[data-kind="ok"] { color: var(--ok); }

/* ---------- شاشة الدخول ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; }
.auth__card {
  position: relative; width: min(440px, 100%); padding: 34px 30px 26px; border: 1px solid var(--line);
  border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
  animation: rise var(--slow) var(--ease) both;
}
/* حافة البطاقة مسطرة تدريج كحلقة الختم، لا شريط لون. */
.auth__card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; background: repeating-linear-gradient(to left, var(--line-strong) 0 1px, transparent 1px 9px); opacity: 0.9; }
.auth__brand { display: grid; justify-items: center; gap: 6px; margin-bottom: 10px; }
.auth__brand .mark { width: 128px; height: 80px; }
.auth__brand .wordmark { font-size: 30px; }
/* ---------- شعار يقظ: عين ساهرة تمر أمامها أظرف المراسلات ---------- */
.mark { width: 48px; height: 30px; flex: none; overflow: hidden; }
.mark__white { fill: #f4f7ff; }
.mark__rim { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
:root:not([data-theme="light"]) .mark__rim { stroke: #9fb4ee; }
.mark__disc { fill: var(--ink); }
.mark__ticks { fill: none; stroke: rgba(255, 255, 255, 0.78); stroke-width: 2.2; stroke-dasharray: 0.8 3.7; }
.mark__pupil { fill: #050a1c; }
.mark__glint { fill: #fff; }
.mark__lid { transform-origin: 32px 20px; transform: scaleY(0.42); transition: transform 520ms var(--ease); }
.mark__iris { transform-origin: 32px 20px; }
.mark__mail { transform: translate(70px, 16px); opacity: 0; }
.mark__mail rect { fill: #fff; stroke: var(--ink); stroke-width: 0.9; }
.mark__mail path { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-linecap: round; stroke-linejoin: round; }
.mark[data-awake] .mark__lid { transform: none; animation: blink 7s ease-in-out infinite; }
.mark[data-awake] .mark__iris { animation: follow 4.8s linear infinite; }
.mark[data-awake] .mark__mail { opacity: 1; animation: pass 4.8s linear infinite; animation-delay: calc(var(--i) * -1.6s); }
@keyframes pass { from { transform: translate(70px, calc(14px + var(--i) * 3px)); } to { transform: translate(-16px, calc(14px + var(--i) * 3px)); } }
@keyframes follow { 0%, 100% { transform: translateX(2.6px); } 50% { transform: translateX(-2.6px); } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: none; } 48% { transform: scaleY(0.08); } }
/* قواعد شعار أقدم كانت هنا تصغّر العين وتشوّه حلقة تدريجها في الترويسة وشاشة الدخول. أُزيلت، فيظهر شعار العين كما صُمم. */
.wordmark { font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { width: 54px; height: 34px; }
.top__end { display: flex; align-items: center; gap: 16px; }
/* الاسم اللاتيني «Yaqiz» أعرض من «يقظّ»: يصغر الشعار قليلًا بعرض الجوال حتى لا تتمدد الصفحة أفقيًا. */
@media (max-width: 520px) { .top__end { gap: 8px; } .brand { gap: 6px; } .brand .mark { width: 42px; height: 26px; } .brand .wordmark { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .mark[data-awake] .mark__lid, .mark[data-awake] .mark__iris, .mark[data-awake] .mark__mail { animation: none; } .mark[data-awake] .mark__mail { transform: translate(calc(8px + var(--i) * 18px), 16px); } }
@media print { .brand { display: none; } }
.auth__eyebrow { font-size: 13px; color: var(--muted); text-align: center; }
.auth__title { margin-top: 4px; font-size: 22px; font-weight: 700; text-align: center; }
.auth__sub { margin: 6px 0 22px; text-align: center; color: var(--text-2); font-size: 14px; }
.auth__body { display: grid; gap: 14px; }
.auth__foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--muted); }
.steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.steps i { width: 26px; height: 3px; border-radius: 3px; background: var(--line-strong); transition: background var(--slow); }
.steps i[data-on] { background: var(--light); }
.qr { display: grid; justify-items: center; gap: 10px; }
.qr img { width: 190px; height: 190px; padding: 10px; border-radius: var(--r-md); background: #fff; }
.secret { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text-2); direction: ltr; word-break: break-all; text-align: center; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; direction: ltr; }
.codes span { padding: 9px 0; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); font-family: var(--mono); text-align: center; letter-spacing: 0.08em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--ok); }
.linklike { background: none; border: 0; padding: 4px; color: var(--text-2); text-decoration: underline; text-underline-offset: 4px; font-size: 13.5px; }

/* ---------- خانات الرمز: تلتف على مدار ثم تندمج في علامة واحدة ---------- */
.otp {
  position: relative; height: 64px; direction: ltr; --m: 0; --spin: 0deg; --r: 62px;
  transition: height var(--slow) var(--ease), --m var(--slow) var(--ease), --spin var(--slow) var(--ease), --r var(--slow) var(--ease);
}
.otp[data-state="verifying"], .otp[data-state="success"] { height: 176px; }
.otp__box {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 56px; margin: -28px 0 0 -24px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2);
  font-size: 22px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; caret-color: var(--light);
  --a: calc(var(--i) * 60deg - 90deg + var(--spin));
  transform: translate(calc(var(--row) * (1 - var(--m)) + var(--r) * cos(var(--a)) * var(--m)), calc(var(--r) * sin(var(--a)) * var(--m)));
  transition: border-color var(--fast), box-shadow var(--fast), opacity 220ms, background var(--fast);
}
.otp__box:nth-child(1) { --i: 0; --row: -145px; }
.otp__box:nth-child(2) { --i: 1; --row: -87px; }
.otp__box:nth-child(3) { --i: 2; --row: -29px; }
.otp__box:nth-child(4) { --i: 3; --row: 29px; }
.otp__box:nth-child(5) { --i: 4; --row: 87px; }
.otp__box:nth-child(6) { --i: 5; --row: 145px; }
.otp__box:focus { outline: none; border-color: var(--light); box-shadow: 0 0 0 4px var(--light-soft); }
.otp__box[data-filled] { background: var(--surface-3); }
.otp[data-state="verifying"] { animation: otp-orbit 1500ms cubic-bezier(0.6, 0, 0.2, 1) forwards; }
.otp[data-state="verifying"] .otp__box { border-color: var(--light); box-shadow: 0 0 18px var(--light-soft); }
.otp[data-state="success"] { --m: 1; --spin: 450deg; --r: 0px; }
.otp[data-state="success"] .otp__box { opacity: 0; }
.otp[data-state="error"] { animation: shake 380ms var(--ease); }
.otp[data-state="error"] .otp__box { border-color: var(--bad); }
.otp__tile {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; display: grid; place-items: center;
  border: 1px solid var(--ok); border-radius: 20px; background: var(--ok-soft); color: var(--ok);
  transform: scale(0.4) rotate(-90deg); opacity: 0; pointer-events: none;
  transition: transform 480ms var(--ease), opacity 260ms; box-shadow: 0 0 0 0 var(--ok-soft);
}
.otp__tile .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.otp[data-state="success"] .otp__tile { transform: none; opacity: 1; animation: halo 900ms var(--ease) 200ms both; }
@keyframes otp-orbit {
  0% { --m: 0; --spin: 0deg; --r: 62px; }
  28% { --m: 1; --spin: 40deg; --r: 62px; }
  78% { --m: 1; --spin: 450deg; --r: 62px; }
  100% { --m: 1; --spin: 450deg; --r: 0px; }
}
@keyframes halo { from { box-shadow: 0 0 0 0 var(--ok-soft); } to { box-shadow: 0 0 0 26px transparent; } }
@keyframes shake { 20% { translate: -7px 0; } 45% { translate: 6px 0; } 70% { translate: -4px 0; } 100% { translate: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- الهيكل ---------- */
.shell { min-height: 100vh; padding: 26px clamp(18px, 4vw, 56px) 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.top__title { font-size: 13px; color: var(--muted); }
/* التنقل: زر الرجوع بجانب عنوان الصفحة، وشريط «أكمل في» تحته. */
.top__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; transition: border-color 140ms, color 140ms, background 140ms; }
.back:hover, .back:focus-visible { border-color: var(--light); color: var(--text); background: var(--light-soft); outline: none; }
.back .icon { width: 15px; height: 15px; }
.rel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -14px 0 22px; font-size: 13px; color: var(--muted); }
.rel__l { margin-inline-end: 2px; }
.rel__tx { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 12px; border-radius: 999px; background: var(--light-soft); color: var(--text); }
.rel__x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.rel__x:hover, .rel__x:focus-visible { background: var(--line-strong); color: var(--text); outline: none; }
.rel__x .icon { width: 13px; height: 13px; }
.rel__go { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.rel__go + .rel__go { margin-inline-start: 8px; }
.rel__go:hover, .rel__go:focus-visible { color: var(--text); border-bottom-color: var(--light); outline: none; }
.rel__go .icon { width: 15px; height: 15px; }
.drawer__jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.drawer__jumps .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.memo-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.memo__find { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.memo-find { max-width: 340px; min-height: 38px; }
.memo-slip[data-focus] { outline: 2px solid var(--light); outline-offset: 6px; border-radius: 10px; transition: outline-color 600ms; }
.palette__kbd { font-size: 11.5px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); direction: ltr; }
@media print { .rel, .back { display: none; } }
.top__h { font-size: 26px; font-weight: 700; line-height: 1.3; }
.pulse { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pulse[data-state="ok"] .dot { background: var(--ok); }
.pulse[data-state="bad"] .dot { background: var(--bad); }
.pulse[data-beat] .dot { animation: beat 900ms var(--ease); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 var(--ok); } 100% { box-shadow: 0 0 0 9px transparent; } }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.auth .msg { text-align: center; }
.card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); animation: rise var(--slow) var(--ease) both; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card--wide { grid-column: 1 / -1; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--text-2); font-size: 13.5px; }
.card__big { font-size: 28px; font-weight: 700; line-height: 1.2; }
.rows { display: grid; gap: 2px; margin-top: 12px; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row span:first-child { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--line-strong); color: var(--text-2); }
.tag[data-kind="ok"] { color: var(--ok); border-color: transparent; background: var(--ok-soft); }
.tag[data-kind="warn"] { color: var(--warn); border-color: transparent; background: var(--warn-soft); }
.tag[data-kind="bad"] { color: var(--bad); border-color: transparent; background: var(--bad-soft); }
.road { display: grid; gap: 0; }
.road__item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.road__item:first-child { border-top: 0; }
.road__n { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; color: var(--muted); flex: none; }
.road__item[data-ready] .road__n { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.road__t { flex: 1; }
.road__item:not([data-ready]) .road__t { color: var(--text-2); }
.events { width: 100%; border-collapse: collapse; font-size: 14px; }
.events th { text-align: start; font-weight: 500; color: var(--muted); padding: 8px 0; }
.events td { padding: 10px 0; border-top: 1px solid var(--line); }
.empty { padding: 26px 0; text-align: center; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table-wrap .events { min-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.actions .btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; font-weight: 500; }
.actions .input { width: 190px; min-height: 36px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; margin-bottom: 12px; }
/* نموذج إضافة المستخدم: أربع خانات في صف، وزر الإضافة تحتها في آخر السطر. */
.form-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-row--4 > [type="submit"] { grid-column: 1 / -1; justify-self: end; }
.form-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
/* علامة صغيرة تحت اسم المستخدم في الجدول */
.cell-note { display: block; margin-top: 4px; }
/* رابط الدعوة: يظهر مرة واحدة تحت جدول المستخدمين حتى ينسخه المالك */
.invite { margin-top: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); display: grid; gap: 10px; }
.invite__t { font-size: 14px; color: var(--text-2); }
.invite__link { font-size: 13px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
@media (max-width: 900px) { .form-row, .form-row--2, .form-row--4 { grid-template-columns: minmax(0, 1fr); } }
/* ما يراه المستخدم داخل جدول المستخدمين: عرض ثابت لا يمد الجدول. */
.events select.input { width: 11.5rem; min-height: 36px; font-size: 13.5px; }
[hidden] { display: none !important; }

/* ---------- الرئيسية التي تتكلم ---------- */
.hero { grid-column: 1 / -1; padding: 6px 2px 10px; animation: rise var(--slow) var(--ease) both; }
.hero__say { font-size: clamp(24px, 3.4vw, 40px); font-weight: 700; line-height: 1.45; max-width: 22em; text-wrap: balance; }
.hero__pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.statepill {
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 14px; transition: border-color var(--fast), color var(--fast), box-shadow var(--fast);
}
.statepill:hover { border-color: var(--light); color: var(--text); box-shadow: 0 0 0 4px var(--light-soft); }
.statepill[data-state="ok"] .dot { background: var(--ok); }
.statepill[data-state="warn"] .dot { background: var(--warn); }
.statepill[data-state="bad"] .dot { background: var(--bad); }
.statepill .icon { width: 17px; height: 17px; }
kbd { padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); direction: ltr; }
.needs, .oldests, .checks { list-style: none; margin: 0; padding: 0; }
.need { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.need:first-child, .oldest:first-child, .check-row:first-child { border-top: 0; }
.need__mark { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
[data-level="bad"] > .need__mark { background: var(--bad); box-shadow: 0 0 0 5px var(--bad-soft); }
[data-level="warn"] > .need__mark { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
[data-level="ok"] > .need__mark { background: var(--ok); }
.need__t { font-weight: 600; }
.need__r { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.need__level { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.need[data-level="bad"] .need__level { color: var(--bad); }
.need[data-level="warn"] .need__level { color: var(--warn); }
.need .btn { min-height: 38px; }
.oldest { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 8px; border-top: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: background var(--fast); }
.oldest:hover, .oldest:focus-visible { background: var(--light-soft); outline: none; }
.oldest__d { font-size: 13px; color: var(--text-2); }
.oldest__d .num { font-size: 20px; font-weight: 700; color: var(--text); }
.oldest__s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.strip__i { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.strip__n { font-size: 22px; font-weight: 700; }
.strip__l { font-size: 13px; color: var(--muted); }
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.verdict__t { font-size: 20px; font-weight: 700; flex: 1; }
.verdict[data-state="ok"] { border-color: transparent; background: var(--ok-soft); }
.verdict[data-state="warn"] { border-color: transparent; background: var(--warn-soft); }
.verdict[data-state="bad"] { border-color: transparent; background: var(--bad-soft); }
.check-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.check-row .need__mark { margin-top: 9px; }
.repairs ul { margin: 0; padding-inline-start: 20px; color: var(--text-2); }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .need { grid-template-columns: auto minmax(0, 1fr); } .need__level { display: none; } .need .btn { grid-column: 2; justify-self: start; } }

.steps-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; color: var(--text-2); }
.path { margin-top: 6px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); font-family: var(--mono); font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; text-align: left; }
.keybox { display: grid; gap: 8px; margin: 12px 0; padding: 14px; border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-soft); }
.keybox .secret { color: var(--text); user-select: all; }

/* ---------- الإحالة: الصفحة هي الرسالة ---------- */
.dp-side { display: grid; gap: 22px; align-content: start; }
.dp-step { display: grid; gap: 10px; }
.dp-step__h { display: flex; align-items: center; gap: 10px; }
.dp-step__h h2 { font-size: 16px; }
.dp-step__n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); flex: none; }
.dp-files { display: grid; gap: 6px; }
.dp-file { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; }
.dp-file input { width: 17px; height: 17px; accent-color: var(--ok); }
.dp-file__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-file .btn { min-height: 30px; padding: 0 6px; }
div.dp-file { grid-template-columns: auto minmax(0, 1fr) auto auto; cursor: default; }
.drop {
  display: grid; justify-items: center; gap: 4px; width: 100%; padding: 20px 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: transparent; color: var(--text-2); transition: border-color var(--fast), background var(--fast), color var(--fast), scale var(--fast);
}
.drop .icon { width: 26px; height: 26px; }
.drop__t { font-weight: 600; color: var(--text); }
.drop:hover, .drop:focus-visible, .drop[data-over] { border-color: var(--light); background: var(--light-soft); color: var(--text); }
.drop[data-over] { scale: 1.01; }
.dp-people { display: grid; gap: 12px; }
.dp-group__t { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.dp-group .chips { margin: 0; align-items: center; }
.dp-warn { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--text); font-size: 13.5px; }
.dp-warn .icon { width: 17px; height: 17px; margin-top: 3px; color: var(--warn); }
.dp-mail { display: grid; gap: 12px; align-content: start; align-self: start; }
.mail { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.mail__head { padding: 6px 16px; border-bottom: 1px solid var(--line); }
.mail__row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: start; }
.mail__row:first-child { border-top: 0; }
.mail__l { color: var(--muted); font-size: 13px; }
.mail__v { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; overflow-wrap: anywhere; }
.mail__who { white-space: nowrap; }
.mail__body { padding: 18px 16px; display: grid; gap: 14px; }
.mail__text { white-space: pre-wrap; line-height: 1.9; }
.mail__sig { max-width: min(100%, 420px); height: auto; justify-self: end; border-radius: 6px; background: #fff; }
.mail__files { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.mail__file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__file .icon { width: 15px; height: 15px; }
.dp-result { display: grid; gap: 8px; }
.dp-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.dp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-manage { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.dp-manage summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-weight: 600; margin-bottom: 12px; }
.dp-manage .form-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; margin-top: 12px; }

/* زر مضيء: حافة من ضوء تدور. الانتباه بالضوء لا باللون. */
.glow { position: relative; display: block; width: 100%; padding: 1.5px; border: 0; border-radius: 16px; background: var(--line-strong); overflow: hidden; color: var(--text); isolation: isolate; transition: scale var(--fast), box-shadow var(--slow); box-shadow: 0 0 26px var(--light-soft); }
.glow::before { content: ""; position: absolute; inset: -150% -20%; z-index: -1; background: conic-gradient(from 0deg, transparent 0 58%, var(--light) 76%, #9fd0ff 86%, transparent 97%); animation: turn 3.4s linear infinite; }
.glow__in { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 14.5px; background: var(--surface); font-size: 16px; font-weight: 700; }
.glow:hover:not([disabled]) { scale: 1.01; box-shadow: 0 0 34px rgba(159, 208, 255, 0.35); }
.glow:active:not([disabled]) { scale: 0.99; }
.glow[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.glow[disabled]::before, .glow[aria-busy="true"]::before { animation-play-state: paused; }
.glow[aria-busy="true"] .glow__in { color: var(--muted); }
@keyframes turn { to { rotate: 360deg; } }
@media (max-width: 900px) { .dp-manage .form-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- المذكرة: ورقة لكل معاملة ---------- */
.memo__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.memo__title { font-size: 21px; line-height: 1.6; max-width: 62ch; }
.memo__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.memo__foot { margin-top: 14px; font-size: 12px; color: var(--muted); }
.memo-group__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.memo-group__h h2 { font-size: 18px; }
.memo-group__h .num { font-size: 20px; font-weight: 600; }
.memo-list { margin: 0; padding: 0; list-style: none; }
.memo-slip { display: grid; grid-template-columns: 112px minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.memo-slip:first-child { border-top: 0; }
.memo-slip[data-urgent="1"] { border-inline-start: 3px solid var(--warn); padding-inline-start: 14px; }
.memo-slip__id { display: grid; align-content: start; gap: 2px; }
.memo-slip__id .num { font-size: 14.5px; font-weight: 600; }
.memo-slip__t { font-size: 16px; line-height: 1.6; font-weight: 600; }
.memo-slip__body { display: grid; align-content: start; gap: 4px; min-width: 0; }
.memo-slip__body .hint .icon { width: 15px; height: 15px; vertical-align: -2px; }
.memo-quote { margin: 4px 0; padding: 6px 12px; border-inline-start: 2px solid var(--line-strong); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.memo-slip__need { display: grid; align-content: start; gap: 6px; min-width: 0; }
.memo-need { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 600; }
.memo-need[data-source="none"], .memo-need[data-source="folder"] { color: var(--text-2); font-weight: 500; }
.memo-late { margin: 0; font-size: 13px; color: var(--warn); }
.memo-note { min-height: 58px; padding: 8px 10px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.7; }
.memo-slip__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* الملاحظات: سجل قصير باسم كاتب كل ملاحظة ووقتها، ثم خانة لملاحظة جديدة. */
.memo-notes-box { display: grid; gap: 8px; }
.memo-notes-box .label { margin: 0; font-size: 13px; color: var(--muted); }
.memo-notes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.memo-notes li { position: relative; padding: 7px 12px 7px 34px; border-inline-start: 2px solid var(--line-strong, rgba(255, 255, 255, 0.25)); background: rgba(255, 255, 255, 0.03); border-radius: 0 8px 8px 0; }
.memo-notes__t { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.memo-notes__x { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.memo-notes__x:hover, .memo-notes__x:focus-visible { background: rgba(255, 255, 255, 0.1); color: var(--text, #fff); outline: none; }
.memo-notes__x .icon { width: 14px; height: 14px; }
.memo-refer { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.memo-refer:hover, .memo-refer:focus-visible { color: var(--text, #fff); text-decoration: underline; outline: none; }
.memo-refer .icon { width: 15px; height: 15px; }
.memo-slip__foot .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
@media (max-width: 980px) { .memo-slip { grid-template-columns: minmax(0, 1fr); gap: 8px; } .memo-slip__id { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; } }

/* ---------- تقارير المعاملات: مسار التقرير في رصد ---------- */
.track { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 4px; padding: 0; list-style: none; }
.track::before { content: ""; position: absolute; inset-inline: 6%; top: 27px; height: 2px; background: repeating-linear-gradient(to left, var(--line-strong) 0 6px, transparent 6px 12px); }
.station { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; }
.station__b { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.station__n { display: grid; place-items: center; min-width: 56px; height: 56px; padding: 0 12px; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--line-strong); font-size: 19px; font-weight: 600; transition: border-color var(--fast), box-shadow var(--fast); }
.station__t { font-size: 14px; font-weight: 600; text-align: center; }
.station__b:hover .station__n, .station__b:focus-visible .station__n, .station[data-on="1"] .station__n { border-color: var(--light); box-shadow: 0 0 0 5px var(--light-soft); }
.station__b:focus-visible { outline: none; }
.station[data-stage="done"] .station__n { border-color: var(--ok); color: var(--ok); }
.station[data-stage="support"] .station__n { border-color: var(--warn); }
.station__s { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.station__s .chip { font-size: 12.5px; }
@media (max-width: 820px) { .track { grid-template-columns: repeat(2, minmax(0, 1fr)); } .track::before { display: none; } }

/* ---------- إنجاز المعاملة ---------- */
.packs { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.pack { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 6px; }
.pack[data-state="warn"] { border-color: var(--warn); }
.pack__h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pack__file { overflow-wrap: anywhere; } .pack__file .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--ok); }
.pack__brief { margin: 4px 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-3); font: inherit; font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.pack-steps { margin: 12px 0 0; padding: 0; list-style: none; }
.pack-steps:empty { display: none; }
.pack-steps li { position: relative; padding: 0 22px 10px 0; color: var(--muted); }
.pack-steps li::before { content: ""; position: absolute; inset-inline-start: 3px; top: 8px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-strong); box-sizing: border-box; }
.pack-steps b { font-weight: 600; } .pack-steps span { display: block; font-size: 13px; }
.pack-steps li[data-s="active"], .pack-steps li[data-s="done"] { color: var(--text); }
.pack-steps li[data-s="active"]::before { border-color: var(--light); background: var(--light); box-shadow: 0 0 0 4px var(--light-soft); }
.pack-steps li[data-s="done"]::before { border-color: var(--ok); background: var(--ok); }
.pack-steps li[data-s="warn"]::before, .pack-steps li[data-s="wait"]::before { border-color: var(--warn); background: var(--warn); }
.pack-steps li[data-s="error"]::before { border-color: var(--bad); background: var(--bad); }

@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #fff; --line: #c9ced8; --line-strong: #9aa3b3; --text: #000; --text-2: #222; --muted: #444; --bad: #9b1c24; --warn: #8a5a00; --warn-soft: transparent; }
  body { background: #fff; }
  .dock, .top, .palette, .toasts, .no-print, .skip { display: none !important; }
  .shell { padding: 0; }
  .card { border: 0; padding: 0; animation: none; }
  .grid { display: block; }
  .memo-group { margin-top: 14pt; }
  .memo-slip { break-inside: avoid; grid-template-columns: 96px minmax(0, 1.3fr) minmax(0, 1fr); font-size: 10.5pt; }
  .memo-slip[hidden] { display: none; }
  .memo-note { border: 1px solid #9aa3b3; min-height: 44pt; }
  @page { size: A4 landscape; margin: 14mm; }
}

/* ---------- لوحة الأوامر ---------- */
.palette { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-content: start; padding: 12vh 16px 0; background: rgba(4, 6, 10, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 160ms ease both; }
.palette__box { width: min(620px, 100%); border: 1px solid var(--glass-line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; animation: rise 260ms var(--ease) both; }
.palette__top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette__input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; outline: none; }
.palette__list { list-style: none; margin: 0; padding: 8px; max-height: 46vh; overflow-y: auto; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); cursor: pointer; color: var(--text-2); }
.palette__item[aria-selected="true"] { background: var(--light-soft); color: var(--text); }
.palette__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__hint { font-size: 12.5px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.palette__empty { padding: 22px; text-align: center; color: var(--muted); }
.palette__foot { padding: 9px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- عناصر تفاعلية ---------- */
.btn { position: relative; overflow: hidden; }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; translate: 120% 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
}
.btn--primary:hover:not([disabled])::after { translate: -120% 0; transition: translate 700ms var(--ease); }
.btn[aria-busy="true"] { color: transparent; }
.btn[aria-busy="true"]::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--muted); border-top-color: var(--text); animation: spin 700ms linear infinite;
}
.btn--primary[aria-busy="true"]::before { border-color: rgba(0, 0, 0, 0.25); border-top-color: var(--bg); }
@keyframes spin { to { rotate: 360deg; } }
.nav__icon { display: grid; place-items: center; flex: none; }
.nav__icon .icon { animation: pop 320ms var(--ease); }
@keyframes pop { from { rotate: -70deg; scale: 0.5; opacity: 0; } to { rotate: 0deg; scale: 1; opacity: 1; } }
.switch { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); opacity: 0; transition: background var(--fast), opacity 200ms; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: inset-inline-start var(--slow) var(--ease); }
.dock[data-wide] .switch { opacity: 1; }
[aria-checked="true"] > .switch { background: var(--light); }
[aria-checked="true"] > .switch::after { inset-inline-start: 19px; background: var(--bg); }
.toasts { position: fixed; inset-block-end: 22px; inset-inline: 0; z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid var(--glass-line); border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); font-size: 14px;
  animation: toast-in 320ms var(--ease) both;
}
.toast[data-kind="ok"] .icon { color: var(--ok); }
.toast[data-kind="bad"] .icon { color: var(--bad); }
.toast[data-leaving] { opacity: 0; translate: 0 8px; transition: opacity 240ms, translate 240ms; }
@keyframes toast-in { from { opacity: 0; translate: 0 14px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }
.spot { position: relative; overflow: hidden; transition: border-color var(--fast), translate var(--fast); }
.spot::before {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 240ms;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--light-soft), transparent 70%);
}
.spot:hover { border-color: var(--line-strong); translate: 0 -2px; }
.spot:hover::before { opacity: 1; }
.skeleton { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- الرسم ---------- */
.chart-wrap { margin: 4px 0 14px; }
.chart { width: 100%; height: auto; display: block; direction: ltr; }
.chart__axis { stroke: var(--line-strong); stroke-width: 1; }
.chart__hit { fill: transparent; }
.chart__day { outline: none; }
.chart__day:hover .chart__hit, .chart__day:focus .chart__hit { fill: var(--light-soft); }
.chart__bar { transform-box: fill-box; transform-origin: bottom; animation: grow 700ms var(--ease) both; }
.chart__bar--in { fill: var(--data-in); }
.chart__bar--out { fill: var(--data-out); }
.chart__label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart__tip { min-height: 22px; text-align: center; font-size: 13px; color: var(--text-2); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.legend { display: flex; gap: 16px; justify-content: flex-end; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.legend__i::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.legend__i--in::before { background: var(--data-in); }
.legend__i--out::before { background: var(--data-out); }

/* ---------- المعاملات ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.kpi__n { font-size: 30px; font-weight: 700; line-height: 1.2; display: block; text-align: start; }
.kpi__l { font-size: 13px; color: var(--muted); }
.card > .btn { margin-top: 14px; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 190px 210px; gap: 10px; margin-bottom: 14px; }
select.input { appearance: none; padding-inline-end: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: left 18px center, left 13px center; background-size: 5px 5px; background-repeat: no-repeat; }
select.input { font-size: 15px; color: var(--text); }
select.input option { background: var(--surface); color: var(--text); }
.tx-summary { color: var(--text-2); margin-bottom: 10px; }
.tx-summary strong { font-size: 20px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { min-height: 34px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13.5px; transition: border-color var(--fast), background var(--fast), color var(--fast); }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--light); color: var(--text); background: var(--light-soft); }
.tx-table { min-width: 860px; }
.tx-row { cursor: pointer; transition: background var(--fast); }
.tx-row:hover, .tx-row:focus-visible { background: var(--light-soft); outline: none; }
.tx-row td { padding: 12px 8px; }
.tx-subject { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.pager .btn { min-height: 38px; }
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 45; width: min(480px, 100vw); padding: 22px 24px 40px; overflow-y: auto;
  border-inline-start: 1px solid var(--glass-line); background: var(--surface); box-shadow: var(--shadow); animation: slide var(--slow) var(--ease) both;
}
@keyframes slide { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.drawer__title { font-size: 19px; line-height: 1.5; }
.drawer__h { margin: 22px 0 10px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.area { padding: 10px 14px; resize: vertical; min-height: 64px; line-height: 1.7; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line-strong); }
.timeline__item { position: relative; padding: 0 16px 16px 0; padding-inline-start: 18px; }
.timeline__item::before { content: ""; position: absolute; inset-inline-start: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--light); }
.timeline__item[data-kind="bot"]::before { border-color: var(--muted); }
.timeline__t { font-weight: 500; }
.timeline__note { margin-top: 2px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .toolbar { grid-template-columns: minmax(0, 1fr); } }

/* ---------- المقبض الجانبي: مختفٍ، يظهر عند الملامسة، ويُسحب ---------- */
.dock { position: fixed; top: 50%; z-index: 40; translate: 0 -50%; display: flex; align-items: center; }
.dock[data-side="start"] { inset-inline-start: 0; flex-direction: row; }
.dock[data-side="end"] { inset-inline-end: 0; flex-direction: row-reverse; }
.dock__handle {
  width: 14px; height: 108px; padding: 0; border: 0; background: transparent; cursor: grab; display: grid; place-items: center; touch-action: none;
}
.dock__handle::before { content: ""; width: 5px; height: 84px; border-radius: 5px; background: var(--line-strong); transition: background var(--fast), box-shadow var(--fast), height var(--fast); }
.dock:hover .dock__handle::before, .dock__handle:focus-visible::before, .dock[data-open] .dock__handle::before { background: var(--light); box-shadow: 0 0 14px var(--light-soft); height: 96px; }
.dock[data-dragging] .dock__handle { cursor: grabbing; }
.dock__panel {
  width: 0; opacity: 0; overflow: hidden; pointer-events: none; padding: 10px 0; border: 1px solid transparent; border-radius: var(--r-xl);
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  transition: width var(--slow) var(--ease), opacity 200ms, padding var(--slow) var(--ease), border-color var(--fast), box-shadow var(--slow);
}
.dock[data-open] .dock__panel { width: 68px; opacity: 1; pointer-events: auto; padding: 10px 8px; border-color: var(--glass-line); box-shadow: var(--shadow); }
.dock[data-open][data-wide] .dock__panel { width: 250px; }
.dock__group { margin: 10px 12px 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity 200ms; height: 18px; }
.dock[data-wide] .dock__group { opacity: 1; }
.nav {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 15px; border: 0; border-radius: 14px;
  background: transparent; color: var(--text-2); text-align: start; white-space: nowrap; transition: background var(--fast), color var(--fast);
}
.nav:hover:not([disabled]), .nav[aria-current="page"] { background: var(--light-soft); color: var(--text); }
.nav[aria-current="page"]::after { content: ""; position: absolute; inset-inline-start: 2px; top: 13px; bottom: 13px; width: 3px; border-radius: 3px; background: var(--light); }
.nav[disabled] { opacity: 0.55; cursor: default; }
.nav__label { flex: 1; opacity: 0; transition: opacity 200ms; overflow: hidden; text-overflow: ellipsis; }
.nav__badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); opacity: 0; transition: opacity 200ms; }
.dock[data-wide] .nav__label, .dock[data-wide] .nav__badge { opacity: 1; }
.nav__kbd { font-size: 11px; color: var(--muted); direction: ltr; opacity: 0; transition: opacity 200ms; }
.dock[data-wide] .nav__kbd { opacity: 0.8; }
.dock__sep { height: 1px; margin: 8px 10px; background: var(--glass-line); }
.dock__who { display: flex; align-items: center; gap: 12px; padding: 6px 11px 2px; white-space: nowrap; }
.dock__avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.dock__meta { opacity: 0; transition: opacity 200ms; line-height: 1.35; font-size: 13px; }
.dock__meta small { display: block; color: var(--muted); font-size: 11.5px; }
.dock[data-wide] .dock__meta { opacity: 1; }

/* ---------- متابعة المعاملات ----------
   المسطرة تدريج كحلقة الختم. الضوء الأبيض لما ينتظرك (بلا تقرير)، واللون للحكم فقط: معتمد، بانتظار، معاد. */
.follow { grid-column: 1 / -1; display: grid; gap: 18px; min-width: 0; }
.follow__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 24px; align-items: start; }
.follow__say { display: grid; gap: 10px; }
.follow__headline { font-size: 22px; font-weight: 700; line-height: 1.5; letter-spacing: 0; }
.follow__src { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 13px; }
.follow__src div { display: flex; gap: 6px; }
.follow__src dt { color: var(--muted); }
.follow__src dd { margin: 0; color: var(--text-2); }
.follow__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.follow__head > .hint[role="status"] { grid-column: 1 / -1; min-height: 0; }
.follow__head > .hint[role="status"]:empty { display: none; }

.follow__lanes { display: grid; gap: 10px; }
.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lane {
  position: relative; display: grid; gap: 8px; align-content: start; padding: 16px 18px 14px; text-align: start;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  transition: border-color var(--fast), background var(--fast), transform var(--fast), box-shadow var(--fast);
}
.lane:hover { border-color: var(--line-strong); background: var(--surface-2); }
.lane:active { transform: scale(0.99); }
.lane[aria-selected="true"] { border-color: var(--light); background: var(--surface-2); box-shadow: 0 0 0 4px var(--light-soft); }
.lane__label { font-size: 13.5px; color: var(--text-2); }
.lane__count { font-size: 32px; font-weight: 700; line-height: 1.1; }
.lane__cap { font-size: 12.5px; color: var(--muted); }
.lane__cap[data-attention="1"] { color: var(--text); }
.lane__cap[data-attention="1"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 6px; border-radius: 50%; background: var(--light); vertical-align: 2px; }
.lane--rasd .lane__count { color: var(--text-2); }
/* عدّ ثابت لا يُضغط: لمن لا يرى صفحة «تقارير رصد». */
.lane[data-still]:hover { border-color: var(--line); background: var(--surface); }
.lane[data-still]:active { transform: none; }

.ruler {
  display: flex; gap: 2px; height: 12px; border-radius: 3px; overflow: hidden;
  -webkit-mask-image: repeating-linear-gradient(to left, #000 0 3px, transparent 3px 5px);
  mask-image: repeating-linear-gradient(to left, #000 0 3px, transparent 3px 5px);
}
.ruler__seg { flex: 1 1 0; min-width: 3px; background: var(--line-strong); }
.ruler__seg[data-kind="none"] { background: var(--light); }
.ruler__seg[data-kind="returned"] { background: var(--bad); }
.ruler__seg[data-kind="pending"] { background: var(--warn); }
.ruler__seg[data-kind="approved"] { background: var(--ok); }
.ruler__seg[data-kind="empty"] { background: var(--line); }
.follow[data-motion="1"] .ruler { transform-origin: right center; animation: ruler-fill 900ms var(--ease) both; }
.follow[data-motion="1"] .lane:nth-child(2) .ruler { animation-delay: 80ms; }
.follow[data-motion="1"] .lane:nth-child(3) .ruler { animation-delay: 160ms; }
.follow[data-motion="1"] .lane:nth-child(4) .ruler { animation-delay: 240ms; }
@keyframes ruler-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0 4px; list-style: none; font-size: 12.5px; color: var(--muted); }
.legend li, .chip { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .chip__dot { width: 9px; height: 9px; border-radius: 2px; background: var(--line-strong); }
:is(.legend i, .chip__dot)[data-kind="none"] { background: var(--light); }
:is(.legend i, .chip__dot)[data-kind="returned"] { background: var(--bad); }
:is(.legend i, .chip__dot)[data-kind="pending"] { background: var(--warn); }
:is(.legend i, .chip__dot)[data-kind="approved"] { background: var(--ok); }

.follow__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; }
.follow__tools .chips { margin: 0; }
.follow__q { width: min(380px, 100%); }
.follow__sum { margin: 12px 0 6px; font-size: 13px; color: var(--muted); }

.ledger { margin: 0; padding: 0; list-style: none; }
.entry { position: relative; border-top: 1px solid var(--line); }
.entry::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--line-strong); transition: inset-block var(--fast); }
.entry[data-kind="none"]::before { background: var(--light); }
.entry[data-kind="returned"]::before { background: var(--bad); }
.entry[data-kind="pending"]::before { background: var(--warn); }
.entry[data-kind="approved"]::before { background: var(--ok); }
.entry[data-open="1"] { border-radius: var(--r-md); background: var(--surface-2); border-top-color: transparent; }
.entry[data-open="1"] + .entry { border-top-color: transparent; }
.entry[data-open="1"]::before { inset-block: 14px; }
.entry__main {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) minmax(9rem, 14rem) auto; gap: 6px 18px; align-items: center;
  width: 100%; padding: 13px 18px 13px 12px; border: 0; background: transparent; color: inherit; text-align: start; border-radius: var(--r-md);
  transition: background var(--fast);
}
.entry__main:hover { background-color: var(--light-soft); }
.entry__num { font-size: 14px; color: var(--text-2); font-family: var(--mono); justify-self: start; }
.entry__text { display: grid; gap: 2px; min-width: 0; }
.entry__title { font-weight: 600; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry__ins { font-size: 13.5px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry__ins[data-empty="1"] { color: var(--muted); }
.entry[data-open="1"] .entry__ins { -webkit-line-clamp: unset; display: none; }
.entry__meta { display: grid; gap: 1px; font-size: 13px; color: var(--text-2); min-width: 0; }
.entry__meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { justify-self: end; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; border: 1px solid transparent; }
.pill[data-kind="none"] { border: 1px dashed var(--light); color: var(--text); }
.pill[data-kind="returned"] { background: var(--bad-soft); color: var(--bad); }
.pill[data-kind="pending"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-kind="approved"] { background: var(--ok-soft); color: var(--ok); }
.entry__more { padding: 2px 18px 18px; animation: rise 260ms var(--ease) both; }
.entry__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 4px 0 14px; padding-inline-start: calc(8.5rem + 18px); font-size: 14px; }
.entry__facts div { display: contents; }
.entry__facts dt { color: var(--muted); }
.entry__facts dd { margin: 0; white-space: pre-line; }
.entry__jumps { display: flex; flex-wrap: wrap; gap: 8px; padding-inline-start: calc(8.5rem + 18px); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--sm .icon { width: 16px; height: 16px; }
.ledger__more { display: flex; justify-content: center; padding-top: 14px; }
.ledger__more:empty { display: none; }
/* سحب التقرير: لوحة الاختيار، ثم ورقة لا تظهر إلا عند الطباعة. */
.report-pick { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 6px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); animation: rise 260ms var(--ease) both; }
.report-pick[hidden] { display: none; }
.report-pick__h { font-size: 13px; color: var(--muted); }
.report-pick .chips { margin: 0 0 4px; }
.report-pick__count { font-weight: 600; }
.report-pick__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet { display: none; }
@media print {
  body:has(.sheet[data-on="1"]) #app { display: none !important; }
  .sheet[data-on="1"] { display: block; color: #000; font-size: 9.5pt; line-height: 1.55; }
  .sheet__head { display: flex; justify-content: space-between; gap: 18pt; align-items: flex-start; padding-bottom: 8pt; margin-bottom: 10pt; border-bottom: 1.5pt solid #0e1d49; }
  .sheet__head h1 { font-size: 17pt; color: #0e1d49; }
  .sheet__head dl { display: grid; gap: 1pt; margin: 0; font-size: 8.5pt; }
  .sheet__head dl div { display: flex; gap: 6pt; }
  .sheet__head dt { color: #555; }
  .sheet__head dd { margin: 0; }
  .sheet table { width: 100%; border-collapse: collapse; }
  .sheet th, .sheet td { padding: 2.5pt 5pt; border: 0.6pt solid #b9c0cc; text-align: right; vertical-align: top; white-space: pre-line; }
  .sheet thead th { background: #eef1f6; font-weight: 700; }
  .sheet__sum { width: auto !important; margin-bottom: 12pt; }
  .sheet__sum td { text-align: center; min-width: 44pt; }
  .sheet__part { margin-top: 12pt; }
  .sheet__part h2 { font-size: 12.5pt; color: #0e1d49; break-after: avoid; }
  .sheet__said { margin: 2pt 0 5pt; color: #333; break-after: avoid; }
  .sheet__table tr { break-inside: avoid; }
  .sheet__table td:nth-child(1) { width: 18pt; text-align: center; }
  .sheet__table td:nth-child(2) { width: 70pt; }
  .sheet__table td.num { white-space: nowrap; }
  .sheet__table td:last-child { width: 82pt; }
  .sheet__table td:nth-child(5):not(.num) { width: 118pt; }
  .sheet__group th { background: #fff; border-inline: 0; padding-top: 7pt; color: #0e1d49; font-size: 9.5pt; break-after: avoid; }
  .sheet__total th, .sheet__total td { font-weight: 700; border-top: 1.2pt solid #0e1d49; }
  .sheet__table tr[data-kind="none"] td:last-child { font-weight: 700; }
  .sheet__foot { margin-top: 14pt; padding-top: 6pt; border-top: 0.6pt solid #b9c0cc; font-size: 8pt; color: #555; }
}
.follow__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding-bottom: 8px; }
.follow__foot .btn { color: var(--text-2); }
.follow__foot .btn:hover { color: var(--text); }

@media (max-width: 1100px) { .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .follow__head { grid-template-columns: 1fr; }
  .follow__acts { justify-content: flex-start; }
  .entry__main { grid-template-columns: minmax(0, 1fr) auto; }
  .entry__text { grid-column: 1 / -1; grid-row: 2; }
  .entry__meta { grid-column: 1 / -1; grid-row: 3; }
  .entry__facts, .entry__jumps { padding-inline-start: 0; }
}
@media (max-width: 520px) { .lanes { grid-template-columns: 1fr; } .lane__count { font-size: 26px; } }

/* ---------- طبقة الحركة، الإصدار 0.5.1 ----------
   لغة واحدة للنظام والبوت: ضوء الختم يدور على حافة ما يعمل الآن، وضوء يتبع المؤشر، والجديد يدخل متتابعًا.
   أفكار من Magic UI (Border Beam، Animated List) و Aceternity (Spotlight) و React Bits (Shiny Text)، مكتوبة بلا مكتبة. */
@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* شعاع الحافة: البطاقة التي فيها عمل جارٍ، والممر المختار في المتابعة. */
:is(.card:has([aria-busy="true"]), .lane[aria-selected="true"])::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--beam), transparent 0 70%, var(--light) 84%, transparent 97%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam 2.6s linear infinite;
}
.card:has([aria-busy="true"]) { position: relative; }
.lane[aria-selected="true"]::after { animation-duration: 7s; opacity: 0.7; }
@keyframes beam { to { --beam: 360deg; } }

/* ضوء يتبع المؤشر: طبقة صورة فوق لون الخلفية، فلا يمس حدود العنصر ولا أشباهه. */
:is(.card:not(.spot), .lane):hover { background-image: radial-gradient(460px circle at var(--mx, 50%) var(--my, 0%), var(--light-soft), transparent 62%); }
:is(.entry__main, .memo-slip, .tx-row, .station__b):hover { background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--light-soft), transparent 70%); }

/* النص اللامع: سطر الحالة وهو يحكي ما يفعله البوت الآن. */
.card:has([aria-busy="true"]) [role="status"]:not(:empty) {
  background: linear-gradient(90deg, var(--muted) 0 38%, var(--text) 50%, var(--muted) 62% 100%) 0 0 / 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 1.8s linear infinite;
}
@keyframes shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }

/* الدخول المتتابع: motion.js يرقّم الدفعة الجديدة في --k. */
.enter { animation: enter 460ms var(--ease) both; animation-delay: calc(var(--k, 0) * 28ms); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  :is(.card:has([aria-busy="true"]), .lane[aria-selected="true"])::after, .card:has([aria-busy="true"]) [role="status"]:not(:empty) { animation: none !important; }
  .card:has([aria-busy="true"]) [role="status"]:not(:empty) { color: var(--text); background: none; }
}

/* ---------- طبقة الصقل، الإصدار 0.4.2 ----------
   مظهر فقط: لا عنصر جديد، ولا تغيير في البنية أو الأيقونات أو الألوان الأساسية. حذف هذه الطبقة يعيد المظهر السابق. */
/* القوائم المنسدلة وخانات النص الطويل كانت تظهر بخط النظام لا بخط الواجهة. */
select, textarea { font: inherit; color: inherit; }
.input::placeholder { color: var(--muted); opacity: 0.85; }
::selection { background: var(--light); color: var(--bg); }
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* عمق هادئ للبطاقات: حافة ضوء رفيعة في الداكن، وظل خفيف في الفاتح. */
.card { box-shadow: inset 0 1px 0 var(--glass-line); }
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(26, 38, 70, 0.05), 0 10px 28px rgba(26, 38, 70, 0.05); }
/* الجداول: رأس مفصول بخط أوضح، وأول صف بلا خط مكرر فوقه. */
.events th { padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); font-size: 13px; }
.events tbody tr:first-child td { border-top: 0; }
/* عنوان الصفحة يتبدل بنعومة مع الانتقال، كالبطاقات تحته. */
.top__h { animation: rise var(--slow) var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
@media (max-width: 520px) {
  .otp__box { width: 42px; margin-left: -21px; }
  .otp__box:nth-child(1) { --row: -125px; } .otp__box:nth-child(2) { --row: -75px; } .otp__box:nth-child(3) { --row: -25px; }
  .otp__box:nth-child(4) { --row: 25px; } .otp__box:nth-child(5) { --row: 75px; } .otp__box:nth-child(6) { --row: 125px; }
  .auth__card { padding: 28px 18px 22px; }
}
.entry__progress { margin-top: 10px; padding-inline-start: calc(8.5rem + 18px); }
.entry__progress:empty { display: none; }
@media (max-width: 860px) { .entry__progress { padding-inline-start: 0; } }
/* نوع المعاملة في المذكرة: اسم النوع ثم العبارة التي بُني عليها. */
.memo-type { display: grid; gap: 2px; margin-bottom: 8px; }
.memo-type__label { justify-self: start; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--text); }
.memo__filter { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; margin-top: 4px; }
.memo__filter > .hint { padding-top: 7px; }
.memo__filter .chips { margin-bottom: 4px; }
@media print { .memo-type__label { border-color: #9aa3b3; } }

/* ---------- الاطلاع على مرفقات المعاملة: نافذة فوق الصفحة ---------- */
.viewer-open { overflow: hidden; }
.viewer-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(4, 6, 10, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 160ms ease both; }
.viewer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(1100px, 100%); height: 100%; border: 1px solid var(--glass-line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; animation: rise 260ms var(--ease) both; }
.viewer__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.viewer__title { display: grid; gap: 2px; min-width: 0; }
.viewer__title h2 { font-size: 17px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__acts { display: flex; gap: 8px; flex: none; }
.viewer__frame { width: 100%; height: 100%; border: 0; background: #525659; }
@media (max-width: 720px) { .viewer-backdrop { padding: 0; } .viewer { border-radius: 0; } .viewer__head { flex-direction: column; } }
@media print { .viewer-backdrop { display: none; } }

/* زر الاطلاع في ورقة المذكرة، وسطر حالته. */
.memo-view { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.memo-view .hint:empty { display: none; }
/* ما بقي في «جديد» بلا جمع، داخل زر الجمع نفسه: الضغطة تجمع هذا العدد لا غيره. */
.memo__left { min-width: 1.7em; padding: 0 6px; border-radius: 999px; background: var(--line); font-size: 12px; font-weight: 600; line-height: 1.6; text-align: center; }
.memo__left[hidden] { display: none; }

/* ---------- لوحة متابعة المعاملات: ختم يقظ المضيء، يومية وأسبوعية ---------- */
.board-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(4, 6, 10, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 160ms ease both; }
.board { width: min(860px, 100%); max-height: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); animation: rise 260ms var(--ease) both; }
.board__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px 18px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.board__tabs { display: flex; gap: 4px; }
.board__tab { padding: 8px 20px 9px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.board__tab[aria-selected="true"] { border-color: var(--line); background: var(--bg); color: var(--text); margin-bottom: -1px; }
.board__acts { display: flex; gap: 8px; padding-bottom: 8px; }
.board__body { padding: 20px 22px 18px; background: var(--bg); }
.board__head { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 22px; align-items: center; }
.board__seal { display: block; width: 148px; height: 148px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
div.board__seal { cursor: default; }
.board__seal:focus-visible { outline: 2px solid var(--light); outline-offset: 4px; }
.seal { display: block; width: 100%; height: 100%; overflow: visible; }
.seal__disc { fill: var(--ink); }
.seal__rim { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 2.4; }
.seal__inner { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; }
.seal__ticks line { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.2; }
.seal[data-lit="1"] .seal__rim, .seal[data-lit="1"] .seal__ticks line { stroke: var(--warn); }
.seal__light { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 93; transform-origin: 60px 60px; animation: turn 7s linear infinite; opacity: 0.9; }
.seal[data-lit="1"] .seal__light { stroke: #ffd98a; }
.seal__n { fill: #fff; font: 600 30px var(--font, inherit); text-anchor: middle; }
.seal__l { fill: rgba(255, 255, 255, 0.86); font: 500 11.5px var(--font, inherit); text-anchor: middle; }
.board__date { margin: 0; font-size: 19px; font-weight: 600; }
.board__greg { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.board__line { margin: 10px 0 0; font-size: 15.5px; line-height: 1.75; }
.board__why { margin: 6px 0 0; font-size: 13px; color: var(--warn); }
.board__sec { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.board__sec h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.board__stage { display: grid; grid-template-columns: 140px 56px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.board__stage:hover, .board__need:hover { background: rgba(255, 255, 255, 0.035); }
.board__n { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board__ticks { display: flex; gap: 1px; align-items: center; height: 16px; }
.board__ticks i { flex: 1 1 0; max-width: 3px; height: 12px; background: var(--line); }
.board__ticks i[data-on="1"] { background: var(--text); }
.board__note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.board__tally { display: flex; gap: 3px; align-items: flex-end; height: 104px; padding-bottom: 2px; border-bottom: 1px solid var(--text-2); }
.board__tally span { flex: 1; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; }
.board__tally i { display: block; width: 74%; height: 2px; background: var(--text); }
.board__tally i[data-old="1"] { background: var(--warn); }
.board__ruler { display: flex; justify-content: space-between; margin-top: 3px; font-size: 12px; color: var(--muted); }
.board__link { padding: 0; border: 0; background: none; color: var(--warn); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.board__link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.board__needs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 28px; }
.board__need { display: flex; align-items: baseline; gap: 6px; padding: 4px 2px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
.board__need b { font-weight: 400; white-space: nowrap; }
.board__need em { flex: 1; border-bottom: 1px dotted var(--muted); transform: translateY(-4px); }
.board__need span { font-size: 16px; font-weight: 600; }
.board__src { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.board__say--week { margin-bottom: 12px; }
.board__week { width: 100%; border-collapse: collapse; font-size: 14px; }
.board__week th, .board__week td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; font-weight: 400; }
.board__week thead th { color: var(--muted); font-size: 13px; }
.board__week tbody th { font-weight: 500; }
.board__week td[data-stale="1"] { color: var(--warn); }
.board__sign { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .board-backdrop { padding: 0; }
  .board { border-radius: 0; max-height: 100vh; }
  .board__head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .board__stage { grid-template-columns: 110px 44px minmax(0, 1fr); }
  .board__needs { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .board-backdrop, .board { animation: none; } }
/* فرز اللوحة فوق قائمة المتابعة، يبقى ظاهرًا حتى يُلغى. */
.follow__focus { display: flex; align-items: center; gap: 10px; }
.follow__focus:empty { display: none; }
.follow__focus { margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.follow__focus-l { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.follow__focus .num { font-weight: 600; }
@media print {
  .board-backdrop { display: none; }
  .board--paper { border: 0; max-height: none; overflow: visible; color: #0e1d49; background: #fff; animation: none; }
  .board--paper .board__view { color: #0e1d49; }
  .board--paper .board__sec, .board--paper .board__stage, .board--paper .board__week th, .board--paper .board__week td { border-color: #c9d0e0; }
  .board--paper .board__ticks i { background: #c9d0e0; }
  .board--paper .board__ticks i[data-on="1"], .board--paper .board__tally i { background: #0e1d49; }
  .board--paper .board__tally i[data-old="1"], .board--paper .board__week td[data-stale="1"], .board--paper .board__why, .board--paper .board__link { color: #8a5a00; background-color: transparent; }
  .board--paper .board__tally i[data-old="1"] { background: #b77d12; }
  .board--paper .board__tally { border-color: #0e1d49; }
  .board--paper .board__greg, .board--paper .board__note, .board--paper .board__src, .board--paper .board__ruler, .board--paper .board__sign, .board--paper .board__week thead th { color: #4a5675; }
  .board--paper .seal__light { display: none; }
}
