/* =========================================================
   منصة المتابعة
   الأنماط (الألوان والخطوط في theme.css)
   لغة التصميم: لوحة عمل هادئة. رمادي فاتح، حبر كحلي، ولمسة ذهبية
   من هوية الشركة في أعلى القائمة الجانبية.
   ========================================================= */

/* خط IBM Plex Sans Arabic — مستضاف مع الموقع (بدون اعتماد على خدمات خارجية) */
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

/* التمرير: الصفحة والقائمة الجانبية بلا شريط ظاهر (يعمل التمرير بالعجلة واللمس والأسهم)،
   فيبقى شكل الصفحة واحداً دائماً. المناطق الداخلية (الجداول والنوافذ) بشريط رفيع بلون الموقع */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 30%, transparent) transparent; }
html, .sidebar, #nav { scrollbar-width: none; }
html::-webkit-scrollbar, .sidebar::-webkit-scrollbar, #nav::-webkit-scrollbar { display: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 30%, transparent); border: 3px solid transparent; border-radius: 99px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 50%, transparent); background-clip: padding-box; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent); }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-sm); direction: ltr; unicode-bidi: embed; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r); }
[hidden] { display: none !important; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opt { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.narrow { max-width: 560px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.late-n { color: var(--red); }
.danger { color: var(--red) !important; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mt { margin-top: 22px; }

#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
#boot i { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الهوية: الشريط الذهبي أعلى القائمة ---------- */
.hazard { height: 3px; background: linear-gradient(90deg, var(--gold), transparent); }
.auth-logo { padding: 32px 48px 0; }
.auth-logo img { width: 200px; height: auto; max-width: 70%; display: block; }
.brand-logo { width: 150px; height: auto; display: block; }

/* ---------- الدخول ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) 6fr; }
.auth-brand { background: var(--side); color: var(--white); display: flex; flex-direction: column; }
.auth-brand-body { padding: 56px 48px; margin-block: auto; max-width: 520px; }
.auth-kicker { color: var(--amber); font-weight: 700; margin-bottom: 14px; font-size: 18px; }
.auth-brand h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.5; }
.auth-points { margin-top: 28px; display: grid; gap: 12px; color: var(--side-ink); }
.auth-points li { padding-inline-start: 18px; position: relative; }
.auth-points li::before { content: ""; position: absolute; inset-inline-start: 0; top: .78em; width: 8px; height: 3px; background: var(--amber); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(100%, 420px); display: grid; gap: 16px; }
.auth-card h2 { font-size: 22px; }
.notice { background: var(--green-t); color: var(--green); padding: 10px 12px; border-radius: var(--r); font-weight: 600; }
.form-error { background: var(--red-t); color: var(--red); padding: 8px 12px; border-radius: var(--r); font-weight: 600; }

/* ---------- عناصر النماذج ---------- */
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 14px; padding: 0; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
input[type="range"] { padding: 0; min-height: 28px; accent-color: var(--primary); }
input[type="color"] { width: 44px; min-height: 40px; padding: 3px; cursor: pointer; flex: none; }
input[type="date"], input[dir="ltr"] { text-align: start; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
::placeholder { color: var(--ink-3); opacity: .85; }
.inline-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.inline-form input, .inline-form textarea { flex: 1; }
.inline-form textarea { min-height: 64px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-ok { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-ok:hover { filter: brightness(.92); background: var(--green); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-danger:hover { filter: brightness(.92); background: var(--red); }
.btn-danger-o { color: var(--red); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.file-btn { cursor: pointer; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r);
  background: transparent; border: 0; cursor: pointer; color: inherit; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.big { font-size: 17px; font-weight: 700; color: var(--ink); text-decoration: none; text-align: start; }
.link-btn.big:hover { color: var(--accent); text-decoration: underline; }
.ic { flex: none; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.auth-card .seg { display: grid; grid-template-columns: 1fr 1fr; }
.seg-sm button { padding: 5px 12px; min-height: 34px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 14px; min-height: 36px; }
.pill input:checked + span { background: var(--accent-t); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pill input:focus-visible + span { box-shadow: var(--focus); }

.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; min-height: 42px; }

/* ---------- الهيكل ---------- */
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; max-width: 100vw; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 30;
}
.brand { padding: 20px 20px 14px; display: grid; gap: 4px; }
.brand strong { color: var(--white); font-size: 19px; }

/* القائمة وحدها تتمرّر، فيبقى أسفلها (اسمي ورتبتي وتسجيل الخروج) ظاهراً دائماً */
#nav { display: grid; align-content: start; gap: 2px; padding: 8px 10px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r);
  color: var(--side-ink); text-decoration: none; font-weight: 500; position: relative;
}
.nav-item:hover { background: var(--side-2); color: var(--white); }
.nav-item.on { background: var(--side-2); color: var(--white); font-weight: 700; }
.nav-item.on::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 4px; background: var(--amber); border-radius: 0 2px 2px 0; }
[dir="rtl"] .nav-item.on::before { border-radius: 2px 0 0 2px; }
.nav-item .count { margin-inline-start: auto; background: var(--amber); color: var(--navy); font-size: 12px; padding: 0 7px; border-radius: 99px; min-width: 22px; text-align: center; line-height: 22px; }
.side-foot { flex-shrink: 0; margin-top: auto; padding: 14px; display: grid; gap: 10px; border-top: 1px solid var(--side-2); }
.me { display: flex; gap: 10px; align-items: center; }
.me strong { display: block; color: var(--white); font-size: 14px; line-height: 1.4; }
.me small { color: var(--dk-muted); }
.me-btn { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 4px; margin: -4px; border-radius: var(--r); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.me-btn:hover { background: var(--side-2); }
.side-logout { color: var(--side-ink); border-color: var(--side-2); justify-content: flex-start; }
.side-logout:hover { background: var(--side-2); color: var(--white); border-color: var(--side-2); }
.live { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dk-muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--live-off); flex: none; }
.live.up i { background: var(--green-soft); box-shadow: 0 0 0 0 var(--live-pulse); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px var(--live-pulse-0); } 100% { box-shadow: 0 0 0 0 var(--live-pulse-0); } }

.main-col { min-width: 0; }
.topbar, .bottombar, .scrim { display: none; }
#view { outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.page > * { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 2px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card > h2, .rsec > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h2 small { font-weight: 400; font-size: 13px; }
.sub { margin: 18px 0 8px; font-size: 14px; color: var(--ink-2); }
.sect { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.count-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; font-size: 13px; line-height: 22px; font-weight: 600; color: var(--ink-2); }
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; width: fit-content; }

.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 36px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--surface); }
.empty strong { font-size: 16px; }
.empty p { color: var(--ink-3); max-width: 46ch; }

.callout { border-radius: var(--r); padding: 10px 14px; border-inline-start: 4px solid; }
.callout p { margin-top: 2px; }
.callout-amber { background: var(--amber-t); border-color: var(--st-pending_approval); color: var(--ink); }
.callout-red { background: var(--red-t); border-color: var(--red); }
.callout-green { background: var(--green-t); border-color: var(--green); }

/* ---------- شارات ووسوم ---------- */
.st-new { --stc: var(--st-new); }
.st-in_progress { --stc: var(--st-in_progress); }
.st-pending_approval { --stc: var(--st-pending_approval); }
.st-approved { --stc: var(--st-approved); }
.st-approved_done { --stc: var(--st-approved_done); }
.st-done { --stc: var(--st-done); }
.st-rejected { --stc: var(--st-rejected); }
.badge {
  display: inline-block; padding: 0 9px; line-height: 24px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--stc) 14%, var(--surface));
  color: color-mix(in srgb, var(--stc) 78%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--stc) 38%, transparent);
}
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.cat::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
.prio { font-size: 12.5px; font-weight: 700; padding: 0 8px; line-height: 22px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.prio-urgent { background: var(--red-t); color: var(--red); border-color: var(--red); }
.prio-high { background: var(--amber-t); color: var(--amber-d); border-color: var(--amber-d); }
.prio-low { color: var(--ink-3); }
.t-tags { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.due { font-size: 14px; white-space: nowrap; }
.due em { font-style: normal; font-weight: 700; }
.due.late { color: var(--red); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.chip-link { cursor: pointer; text-align: start; }
.chip-link:hover { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.avatar { width: var(--s, 28px); height: var(--s, 28px); border-radius: 50%; display: inline-grid; place-items: center; color: var(--white); font-size: calc(var(--s, 28px) * .38); font-weight: 700; flex: none; line-height: 1; letter-spacing: 0; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar + .avatar { margin-inline-start: -7px; }
.avatar-more { background: var(--ink-3); }
.person { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 8px; }

.bar { display: block; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; flex: 1; min-width: 40px; }
.bar > i { display: block; height: 100%; background: var(--st-in_progress); border-radius: 4px; transition: width .35s; }
.bar.ok > i { background: var(--st-approved); }
.prog-row { display: flex; align-items: center; gap: 10px; }

/* ---------- لوحة المتابعة: بطاقة الملخص ---------- */
.goal {
  background: var(--side); color: var(--white); border-radius: var(--r); padding: 26px 28px 22px; display: grid; gap: 22px;
  --st-new: var(--goal-new); --st-in_progress: var(--goal-progress); --st-pending_approval: var(--goal-pending); --st-approved: var(--green-soft); --st-approved_done: var(--green-soft); --st-done: var(--goal-done); --st-rejected: var(--red-soft);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--gold), var(--navy)) 4;
}
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.goal h1 { font-size: clamp(22px, 3vw, 30px); }

.goal .muted { color: var(--dk-muted); }
.goal a { color: var(--amber); }

.tracks { display: grid; gap: 18px; }
.track-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.track-head b { font-size: 20px; }

.line { display: flex; gap: 2px; height: 40px; }
.cell { flex: 1; min-width: 2px; border-radius: 2px; background: var(--stc, var(--glass-14)); }
.line.is-empty .cell { background: var(--glass-12); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; margin-top: 10px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 2px; background: var(--stc, var(--ink-3)); display: inline-block; flex: none; }
.legend-st { color: var(--side-ink); }


.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 14px 18px; display: grid; gap: 0; border-inline-start: 1px solid var(--line); line-height: 1.4; }
.kpi:first-child { border-inline-start: 0; }
.kpi b { font-size: 30px; line-height: 1.2; }
.kpi span { font-weight: 600; }
.kpi small { color: var(--ink-3); }
.kpi.bad b { color: var(--red); }
.kpi.warn b { color: var(--st-pending_approval); }

.rows li + li { border-top: 1px solid var(--line-2); }
.row-btn { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 4px; background: none; border: 0; text-align: start; cursor: pointer; border-radius: var(--r); }
.row-btn:hover { background: var(--surface-2); }
.rows .more { padding: 10px 4px; }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--green); font-weight: 600; }

.more-link { display: inline-block; margin-top: 12px; font-weight: 600; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: start; font-weight: 700; font-size: 13px; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }


/* ---------- المهام ---------- */
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr)) auto auto; gap: 10px; align-items: center; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.tcard-wrap { display: grid; }
.tcard { display: grid; align-content: start; gap: 10px; width: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tcard:hover { border-color: var(--accent); box-shadow: var(--shadow-1, 0 2px 10px rgba(0,0,0,.12)); }
.tcard.late { border-inline-start: 4px solid var(--red); }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-title { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.tc-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-2); font-size: 14px; }
.tc-lbl { color: var(--ink-3); font-weight: 600; min-width: 64px; }
.tc-who .who { display: inline-flex; align-items: center; gap: 6px; }
.tc-foot { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line-2); }
.t-prog { display: flex; align-items: center; gap: 8px; }
.t-prog small { color: var(--ink-3); min-width: 34px; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 10px; align-content: start; }
.bcol header { display: flex; align-items: center; gap: 8px; }
.bcol header b { margin-inline-start: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; font-size: 13px; line-height: 22px; }
.bdot { width: 10px; height: 10px; border-radius: 2px; background: var(--stc); }
.bcards { display: grid; gap: 8px; }
.bcard { display: grid; gap: 8px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; border-inline-start: 4px solid var(--stc); }
.bcard:hover { border-color: var(--ink-3); border-inline-start-color: var(--stc); }
.bcard.late { border-color: var(--red); }
.bmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bempty { padding: 6px 4px; }

/* ---------- النوافذ ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: center; padding: 20px; z-index: 60; opacity: 0; transition: opacity .15s; overflow-y: auto; }
.modal-backdrop.in { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-pop); transform: translateY(10px); transition: transform .15s; outline: none; border: 1px solid var(--line); }
.modal-backdrop.in .modal { transform: none; }
.modal-sm { max-width: 440px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; display: grid; gap: 8px; z-index: 80; width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--side); color: var(--white); padding: 11px 16px; border-radius: var(--r); display: flex; gap: 14px; justify-content: space-between; align-items: center; box-shadow: var(--shadow-pop); transform: translateY(12px); opacity: 0; transition: .22s; cursor: pointer; border-inline-start: 5px solid var(--green-soft); }
.toast.in { transform: none; opacity: 1; }
.toast a { color: var(--amber); font-weight: 700; white-space: nowrap; }
.toast-err { border-inline-start-color: var(--red-soft); }
.toast-info { border-inline-start-color: var(--amber); }

/* ---------- نافذة المهمة ---------- */
.td { display: grid; gap: 14px; }
.td-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
.td h3 { margin: 22px 0 8px; font-size: 15px; }
.td h3:first-child { margin-top: 0; }
.td h3 small { font-weight: 400; color: var(--ink-3); margin-inline-start: 6px; }
.td-side { border-inline-start: 1px solid var(--line-2); padding-inline-start: 22px; }
.td-side h3 { margin-top: 24px; }
.meta { display: grid; gap: 14px; }
.meta dt { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.meta dd { margin-top: 2px; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; }
.checklist label { display: flex; gap: 10px; align-items: center; cursor: pointer; flex: 1; min-height: 34px; }
.checklist li.done span { color: var(--ink-3); text-decoration: line-through; }
.comments { display: grid; gap: 14px; }
.comments li { display: flex; gap: 10px; }
.c-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.timeline { display: grid; gap: 12px; position: relative; }
.timeline li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: .55em; flex: none; }

.td .modal-foot { justify-content: space-between; }
.foot-left, .foot-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- سجل النشاط والمرفقات المصغّرة ---------- */
.entries, .actlist { padding: 0; }
.entry + .entry, .actlist li + li { border-top: 1px solid var(--line-2); }
.actlist li { display: flex; gap: 12px; padding: 12px 18px; align-items: flex-start; }

/* ---------- الاجتماعات ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mcard { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; color: var(--ink); }
.mcard:hover { border-color: var(--accent); }
.mcard strong { font-size: 17px; }
.mprog { display: grid; gap: 4px; }
.mprog small { color: var(--ink-3); }
.mfoot { display: flex; justify-content: space-between; align-items: center; }
.m-top { display: grid; gap: 14px; }
.m-att { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: center; }
.m-att strong { margin-inline-end: 10px; }
.m-sum { display: flex; gap: 14px; align-items: center; }
.m-sum .bar { max-width: 260px; }
.prev h2 small { margin-inline-start: 6px; }
.prev-list summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 8px; }
.points { display: grid; gap: 0; }
.point { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.point:first-child { border-top: 0; }
.pchk { margin-top: 5px; }
.pstate { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-3); display: inline-grid; place-items: center; margin-top: 5px; flex: none; color: var(--white); }
.pstate.done { background: var(--st-approved); border-color: var(--st-approved); }
.pbody.done { color: var(--ink-3); text-decoration: line-through; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 4px; }
.tag-carried { font-size: 12.5px; color: var(--amber-d); font-weight: 600; }
.p-actions { display: inline-flex; gap: 4px; align-items: center; }
.padd { display: grid; grid-template-columns: 110px minmax(0, 1fr) 170px 150px auto; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.notes { min-height: 110px; }
.carry { border-color: var(--amber-d); }

/* ---------- الاعتمادات ---------- */
.appr-list { display: grid; gap: 14px; }
.appr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 12px; border-inline-start: 5px solid var(--st-pending_approval); }
.appr header { display: flex; gap: 14px; align-items: flex-start; }
.appr footer { display: flex; gap: 10px; flex-wrap: wrap; }
.appr-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.appr-meta dt { font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* ---------- التقرير ---------- */
.weeknav { display: inline-flex; align-items: center; gap: 4px; }
.rhead { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rsec { display: grid; gap: 4px; }
.rlist { display: grid; gap: 8px; }
.rlist li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-2); }

.rmeet { margin-bottom: 12px; }
.report .rsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }

/* ---------- الفريق والإعدادات ---------- */
.team-tbl .inactive td { background: var(--amber-t); }
.team-tbl .acts { display: flex; flex-wrap: wrap; gap: 6px; min-width: 260px; }
.page-wide { max-width: none; }
.team-tbl td, .team-tbl th { padding-inline: 14px; }
/* على الجوال يصير كل حساب بطاقة بدل جدول يحتاج تمريراً أفقياً */
@media (max-width: 720px) {
  .team-tbl, .team-tbl tbody, .team-tbl tr, .team-tbl td { display: block; width: 100%; }
  .team-tbl thead { display: none; }
  .team-tbl tr { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
  .team-tbl td { padding: 0; border: 0; }
  .team-tbl .acts { min-width: 0; }
}
.table-wrap.flat { background: none; border: 0; box-shadow: none; padding: 0; }
.team-tbl .acts-cell { vertical-align: middle; }
.team-tbl select { min-height: 36px; }
.email { font-size: 13.5px; }
.roles dl { display: grid; gap: 12px; }
.roles dt { font-weight: 700; }
.catlist { display: grid; gap: 8px; margin: 12px 0; }
.catlist li { display: flex; gap: 10px; align-items: center; }

/* ---------- الرتب والحسابات والأقسام اليدوية ---------- */
.role-badge { display: inline-block; padding: 0 9px; line-height: 24px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.role-badge.r-admin { background: color-mix(in srgb, var(--c-purple) 14%, transparent); color: var(--c-purple); border-color: var(--c-purple); }
.role-badge.r-gm { background: var(--accent-t); color: var(--accent); border-color: var(--accent); }
.role-badge.r-hr { background: var(--amber-t); color: var(--amber-d); border-color: var(--amber-d); }
.role-badge.r-manager { background: var(--amber-t); color: var(--amber-d); border-color: var(--amber-d); }
.role-badge.r-dept_manager { background: var(--green-t); color: var(--green); border-color: var(--green); }
.role-badge.r-gov { background: var(--accent-t); color: var(--accent); border-color: var(--accent); }

/* ---------- المستجدات النظامية ---------- */
#nav a[href="#/regulatory"] .count { background: var(--red); color: var(--white); }
.reg-list { display: grid; gap: 12px; }
.reg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; }
.reg-card.is-new { border-inline-start: 4px solid var(--red); }
.reg-card.is-arch { opacity: .7; }
.reg-main { all: unset; box-sizing: border-box; display: grid; gap: 6px; padding: 14px 16px 8px; cursor: pointer; }
.reg-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.reg-rcp { border: 1px solid var(--line, rgba(128,128,128,.3)); border-radius: 10px; padding: 10px 12px; margin: 0; }
.reg-rcp legend { padding: 0 6px; font-weight: 600; }
.reg-rcp-tools { display: flex; gap: 6px; margin: 8px 0; }
.reg-rcp-list { max-height: 180px; overflow: auto; }
.reg-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.reg-kind, .reg-new, .reg-edited, .reg-imp { font-size: 12.5px; font-weight: 700; padding: 0 8px; line-height: 22px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.reg-new { background: var(--red); border-color: var(--red); color: var(--white); }
.reg-imp-important { background: var(--amber-t); border-color: var(--amber-d); color: var(--amber-d); }
.reg-imp-urgent { background: var(--red-t); border-color: var(--red); color: var(--red); }
.reg-title { font-size: 17px; }
.reg-preview { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.reg-foot { display: flex; gap: 10px; align-items: center; padding: 8px 16px 12px; flex-wrap: wrap; }
.reg-done { display: inline-flex; gap: 6px; align-items: center; color: var(--green); font-weight: 600; font-size: 14px; }
.reg-body { overflow-wrap: anywhere; line-height: 1.9; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.reg-action { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--amber-d); }
.reg-whos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reg-who { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; }
.cred { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 6px; font-size: 15px; }
.cred code { font-family: ui-monospace, Consolas, monospace; background: var(--surface); padding: 1px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); direction: ltr; unicode-bidi: plaintext; }

.past-tag { font-size: 12.5px; font-weight: 700; padding: 0 8px; line-height: 22px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pupdates { margin-top: 8px; display: grid; gap: 6px; }
.pupdates li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--r-sm); border-inline-start: 3px solid var(--accent); }
.pupdates .muted { white-space: nowrap; }
.field-hint { font-size: 13px; color: var(--ink-3); }
textarea.lines { min-height: 110px; }

/* ---------- الاستجابة ---------- */
@media (max-width: 1020px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters > input[type="search"] { grid-column: 1 / -1; }
  .padd { grid-template-columns: 1fr 1fr; }
  .padd input[name="body"] { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  .shell { display: block; }
  /* القائمة الجانبية مخفية بالتصغير (مو بالإزاحة خارج الشاشة) حتى لا يتسع عرض الصفحة في سفاري الآيفون */
  .sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 86vw); height: auto; transform: scaleX(0); transform-origin: 100% 50%; opacity: 0; visibility: hidden; transition: transform .18s, opacity .18s, visibility 0s .18s; box-shadow: none; }
  [dir="ltr"] .sidebar { transform-origin: 0 50%; }
  body.drawer-open .sidebar { transform: none; opacity: 1; visibility: visible; transition: transform .18s, opacity .18s, visibility 0s; box-shadow: var(--shadow-pop); }
  .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
  .scrim[hidden] { display: none !important; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--side); color: var(--white); position: sticky; top: 0; z-index: 20; min-height: 52px; }
  .topbar strong { flex: 1; }
  .live-mini { padding-inline: 10px; }
  .page { padding: 18px 16px 96px; gap: 16px; }
  h1 { font-size: 22px; }
  .bottombar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a, .bottombar button { display: grid; justify-items: center; gap: 0; padding: 7px 2px 6px; text-decoration: none; color: var(--ink-3); background: none; border: 0; font-size: 11.5px; line-height: 1.5; position: relative; cursor: pointer; }
  .bottombar .on { color: var(--accent); font-weight: 700; }
  .dot-badge { position: absolute; top: 6px; inset-inline-start: 56%; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
  .toasts { bottom: 76px; inset-inline: 12px; width: auto; }
  .goal { padding: 20px 18px 18px; }
  .td-grid { grid-template-columns: minmax(0, 1fr); }
  .td-side { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line-2); padding-top: 4px; }
  
  .tcards { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-width: none !important; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 94vh; }
  .modal-body { padding: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand-body { padding: 28px 22px 32px; }
  .auth-points { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .padd { grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  
  
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 26px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .kpi { border-inline-start: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .head-actions { width: 100%; }
  .head-actions .btn-primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   الإضافات: الصلاحيات، القرارات، الخطة، الإشعارات، الأرشيف، البحث
   ========================================================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.block { display: block; }
.link-btn.danger, .danger { color: var(--red); }

/* شريط علوي: بحث وإشعارات (يظهر على الشاشات الكبيرة أيضاً) */
@media (min-width: 881px) {
  .topbar { display: flex; align-items: center; gap: 12px; padding: 8px 32px; position: sticky; top: 0; z-index: 15; background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar > .icon-btn, .topbar > strong, .topbar > .live-mini { display: none; }
  .topbar #top-lang { margin-inline-start: auto; }
}
.topbar .icon-btn { color: inherit; }
@media (max-width: 880px) { .topbar .gsearch { flex: 1; max-width: none; } .topbar > strong { display: none; } }
.gsearch { position: relative; flex: 0 1 420px; }
.gsearch input { width: 100%; padding-inline-start: 38px; min-height: 40px; }
.gs-ic { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; pointer-events: none; }
.gs-pop { position: absolute; top: calc(100% + 6px); inset-inline: 0; min-width: min(460px, 92vw); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); max-height: 70vh; overflow: auto; z-index: 60; }
.gs-pop[hidden] { display: none; }
.gs-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line-2); }
.gs-row:hover, .gs-row:focus { background: var(--surface-2); }
.gs-row em { font-style: normal; font-size: 12px; font-weight: 600; background: var(--accent-t); color: var(--accent); border-radius: 99px; padding: 0 9px; flex: none; }
.gs-row strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.gs-row small { display: block; color: var(--ink-3); }
.gs-none { padding: 14px; color: var(--ink-3); }

/* الجرس والإشعارات */
.bell { position: relative; }
.bell-n { position: absolute; top: 2px; inset-inline-end: 2px; background: var(--red); color: var(--white); font-size: 11px; line-height: 17px; min-width: 17px; text-align: center; border-radius: 99px; padding: 0 4px; }
#notif-pop { position: fixed; z-index: 90; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; }
#notif-pop:focus { outline: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.np-tools { display: flex; align-items: center; gap: 6px; }
.np-body { overflow-y: auto; padding: 0 4px 4px; }
.notifs small { white-space: pre-line; }
.notifs { list-style: none; margin: 0; padding: 0; }
.notifs li { border-bottom: 1px solid var(--line-2); }
.notifs li.unread { background: var(--accent-t); }
.notifs button { display: flex; width: 100%; gap: 12px; padding: 12px 8px; background: none; border: 0; text-align: start; cursor: pointer; align-items: flex-start; color: inherit; font: inherit; }
.n-ic { color: var(--accent); display: grid; padding-top: 3px; }

/* @ للذكر */
.mention-pop { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 320px; overflow: auto; }
.mp-head { padding: 6px 10px 8px; font-size: 12px; color: var(--ink-3); }
.mp-head b { color: var(--ink-2); }
.mp-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.mp-item.on, .mp-item:hover { background: var(--accent-t); }
.mp-name { font-weight: 600; flex: 1; }
.mp-role { color: var(--ink-3); }
.mn-wrap { position: relative; }
.mn-mirror { position: absolute; inset: 0; overflow: hidden; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; color: transparent; box-sizing: border-box; margin: 0; }
.mn-mirror mark { background: var(--accent-t); color: transparent; border-radius: 4px; box-shadow: 0 0 0 2px var(--accent-t); }
.mn-input { position: relative; z-index: 1; display: block; width: 100%; background: transparent !important; }

/* مرفقات */
.att { display: grid; gap: 10px; margin-top: 14px; }
.att h3 { display: flex; align-items: center; gap: 6px; }
.att-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-thumb { margin: 0; width: 110px; }
.att-thumb button { padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); width: 110px; height: 86px; overflow: hidden; cursor: pointer; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.att-files li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.att-add { display: flex; gap: 8px; flex-wrap: wrap; }

/* ملاحظات خاصة */
.pnotes { margin-top: 16px; border: 1px dashed var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; background: var(--surface-2); }
.pnotes h3 { display: flex; gap: 6px; align-items: center; }
.pnotes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pnotes li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.pn-form { display: grid; gap: 6px; justify-items: start; }
.pn-form textarea { width: 100%; }

/* القرارات والطلبات */
.appr.req { border-inline-start-color: var(--accent); }
.appr .answer { background: var(--surface-2); border-radius: var(--r); padding: 8px 12px; }
.btn-ok { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-danger-o { border-color: var(--red); color: var(--red); background: transparent; }

/* صفحة اليوم */
.today-top { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
a.callout { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; background: var(--amber-t); border-color: var(--amber); }
a.callout small { display: block; color: var(--ink-3); }
.tday.bad { border-inline-start: 4px solid var(--red); }
.tday h2 .count, .count { background: var(--amber); color: var(--navy); font-size: 12px; padding: 0 7px; border-radius: 99px; min-width: 22px; text-align: center; line-height: 22px; display: inline-block; }
.ok-line { display: flex; gap: 8px; align-items: center; color: var(--green); font-weight: 600; }
.prio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prio-list li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.prio-list li.done .grow { text-decoration: line-through; color: var(--ink-3); }
.rd-ic { width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: var(--white); }
.rd-ic.ok { background: var(--green); border-color: var(--green); }

/* خطة الافتتاح */
.seg-wrap { flex-wrap: wrap; }

   

 

.arch-list, .dec-reg { list-style: none; margin: 0; padding: 0; }
.arch-list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.arch-list li:last-child { border-bottom: 0; }
.prog-row { display: flex; align-items: center; gap: 10px; } .prog-row .bar { flex: 1; }

  

.lvl { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 10px; flex: none; }

  

.checks { display: grid; gap: 4px; max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.chk { display: flex; gap: 8px; align-items: center; }
.late-n { color: var(--red); }
.tbl .grow { width: auto; }

/* الاجتماعات */
.carry-n { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 0 9px; background: var(--amber-t); color: var(--amber-d); }
.carry-n.c2 { background: var(--carry-bg); color: var(--carry-ink); } .carry-n.c3 { background: var(--red-t); color: var(--red); }
.prepare { border-inline-start: 4px solid var(--accent); display: grid; gap: 10px; }
.prep-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.prep-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 12px; font-size: 14px; }
.prep-chip.bad { background: var(--red-t); border-color: transparent; color: var(--red); }
.live-bar { border-inline-start: 4px solid var(--red); display: grid; gap: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.stale { border-inline-start: 4px solid var(--amber); }

/* الأرشيف والتكرار والصلاحيات */
.arch-list li { align-items: center; }
.perm-group { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px 10px; margin: 0; }
.perm-group legend { font-weight: 700; padding: 0 6px; }
.perm-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.perm-row:last-child { border-bottom: 0; }
.perm-row.custom { background: var(--amber-t); margin-inline: -8px; padding-inline: 8px; border-radius: 4px; }
.perm-tag { font-style: normal; font-size: 12px; font-weight: 700; color: var(--amber-d); }

.sec-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; display: grid; gap: 8px; justify-items: start; }
.mfa-qr { display: grid; gap: 6px; justify-items: center; margin: 12px 0; }
.mfa-qr img { background: var(--white); padding: 6px; border-radius: var(--r); }

/* وضع العرض */

.present { position: fixed; inset: 0; background: var(--side); color: var(--white); z-index: 80; display: grid; grid-template-rows: auto 1fr auto; padding: 24px 5vw; }
.present header, .present footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--dk-muted-3); }
.present footer { justify-content: center; }
.present article { align-self: center; max-width: 1100px; width: 100%; margin: 0 auto; display: grid; gap: 22px; }
.present h1 { font-size: clamp(28px, 5vw, 56px); }
.present .btn { color: var(--white); border-color: var(--glass-35); background: transparent; }
.present .btn[disabled] { opacity: .35; }

 

 
.present .lvl { font-size: 15px; }

@media (max-width: 700px) {
  .att-ba { grid-template-columns: 1fr; }
  
  
  
}

#view:focus-visible { box-shadow: none; outline: none; }

/* عارض الصور */
.vw { position: fixed; inset: 0; z-index: 120; background: var(--viewer-bg); display: flex; flex-direction: column; opacity: 0; transition: opacity .15s; outline: none; color: var(--white); }
.vw.in { opacity: 1; }
.vw-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--glass-06); flex-wrap: wrap; }
.vw-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 120px; }
.vw-tools { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.vw-zoom { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.vw-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--white); cursor: pointer; }
.vw-btn:hover { background: var(--glass-16); }
.vw-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.vw-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; }
.vw-stage.zoomed { cursor: grab; }
.vw-stage.zoomed:active { cursor: grabbing; }
.vw-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; will-change: transform; image-rendering: auto; -webkit-user-drag: none; }
.vw-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dk-soft); pointer-events: none; }
.vw-nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 64px; background: var(--viewer-nav); }
.vw-prev { left: 8px; }
.vw-next { right: 8px; }
@media (max-width: 720px) { .vw-nav { width: 40px; height: 56px; } }
.vw [hidden] { display: none !important; }

/* معاينة PDF داخل الموقع */
.modal-xl { max-width: 1180px; }
.pdf-modal .modal-body { padding: 0; }
.pdf-wrap { display: grid; grid-template-rows: auto 1fr; position: relative; }
.pdf-load { padding: 40px 20px; text-align: center; }
.pdf-bar { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.pdf-frame { width: 100%; height: 76vh; border: 0; display: block; background: var(--white); }
@media (max-width: 720px) { .pdf-frame { height: 70vh; } }

/* الذكر بـ @ */
.mention { display: inline-block; background: var(--accent-t); color: var(--accent); border-radius: 5px; padding: 0 6px; font-weight: 600; font-size: .95em; }
.mention.me { background: var(--amber-t); color: var(--amber-d); box-shadow: inset 0 0 0 1px var(--amber); }

/* سجل المهمة: صندوق بارتفاع ثابت وتمرير داخلي */
.tlog-box { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.tlog-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.tlog-body { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; }
.tlog-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pill.locked { cursor: not-allowed; }
.pill.locked > span { opacity: .75; }

/* أجندة الاجتماع: مجموعات ملوّنة ومفصولة */
.agenda .ag-group { margin-top: 22px; padding: 12px 14px 4px; border-radius: 10px; border: 1px solid var(--ag-c); border-inline-start-width: 5px; background: var(--ag-t); }
.agenda .ag-group:first-of-type { margin-top: 14px; }
.ag-g-proposed { --ag-c: var(--accent); --ag-t: var(--accent-t); }
.ag-g-accepted { --ag-c: var(--green); --ag-t: var(--green-t); }
.ag-g-deferred { --ag-c: var(--amber); --ag-t: var(--amber-t); }
.ag-g-rejected { --ag-c: var(--red); --ag-t: var(--red-t); }
.ag-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.ag-head small { margin-inline-start: auto; font-weight: 400; }
.ag-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ag-c); flex: none; }
.ag-g-rejected .ag-item strong { text-decoration: line-through; opacity: .75; }
.ag-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--ag-c) 30%, transparent); }
.ag-item:first-child { border-top: 0; }
.ag-item .p-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* قالب طباعة المحضر: مخفي على الشاشة */
#print-doc { display: none; }

/* الطلبات والمعوّقات كنقاش */
.thr-list { display: grid; gap: 14px; }
.thr { background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--stc, var(--ink-3)); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; }
.thr.closed { opacity: .82; }
.thr.wait-me { border-color: var(--amber); }
.thr-blocker { --stc: var(--red); }
.thr-request { --stc: var(--st-in_progress); }
.thr.closed { --stc: var(--green); }
.thr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thr-head .thr-follow { margin-inline-start: auto; padding: 2px 8px; font-size: 12px; }
.thr-head .thr-del { margin-inline-start: 0; }
.thr-type { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.thr-title { margin: 0; font-size: 16px; }
.thr-body { margin: 0; color: var(--ink-2); }
.thr-meta { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.thr-ask { margin: 0; }
.thr-replies { display: grid; gap: 10px; margin: 4px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.thr-r { display: flex; gap: 10px; align-items: flex-start; }
.thr-r.info { border-inline-start: 3px solid var(--amber); padding-inline-start: 8px; }
.thr-rh { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thr-r .pre { margin: 0; }
.thr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.thr-form { display: grid; gap: 8px; margin-top: 4px; }
.thr-form textarea { width: 100%; }
.thr-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.thr-sec { margin-top: 18px; }
.thr-sec h3 small { margin-inline-start: 6px; }
.thr-new { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.thr-sec .thr { padding: 12px 14px; }
.rq-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.rq-filters .field { margin: 0; }
.rq-filters select { min-width: 150px; }

.side-ver { text-align: center; color: var(--dk-faint); font-size: 11.5px; letter-spacing: .04em; }

/* الاجتماعات: الوقت، الحالة الجارية، اختيار المهام */
.compose-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.live-tag { font-size: 12.5px; font-weight: 700; padding: 0 8px; line-height: 22px; border-radius: var(--r-sm); background: var(--red); color: var(--white); white-space: nowrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tp-list { max-height: 38vh; overflow-y: auto; }
.tp-row[hidden] { display: none; }
.contents { display: contents; }
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.week-nav .field.inline { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.hol-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 10px; }
.hol-day { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: center; }
.hol-day.off { background: var(--amber-t); border-color: var(--amber); }
.hol-day.today { box-shadow: var(--focus); }
.hol-day em { font-style: normal; font-size: 12px; font-weight: 600; }
.hol-day input { accent-color: var(--amber); }
@media (max-width: 560px) { .hol-week { gap: 4px; } .hol-day { padding: 8px 2px; font-size: 12px; } }
.fp-person { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: var(--surface); }
.fp-person > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; list-style: none; }
.fp-person > summary::-webkit-details-marker { display: none; }
.fp-person[open] > summary { border-bottom: 1px solid var(--line-2); }

/* ===== تنسيق الكتابة (richtext.js) ===== */
.rt { overflow-wrap: anywhere; line-height: 1.7; }
.rt .rt-gap { height: .55em; }
.rt .rt-p { white-space: pre-wrap; }
.rt .rt-h1 { font-size: 1.2em; font-weight: 800; margin: .5em 0 .15em; color: var(--ink); }
.rt .rt-h2 { font-size: 1.05em; font-weight: 700; margin: .4em 0 .1em; color: var(--ink); }
.rt .rt-q { border-inline-start: 3px solid var(--accent); padding: 2px 10px; margin: .2em 0; color: var(--ink-3); background: var(--accent-t); border-radius: 0 6px 6px 0; }
.rt .rt-hr { border: 0; border-top: 1px solid var(--line); margin: .6em 0; }
.rt .rt-li { display: flex; gap: .5em; padding-inline-start: calc(var(--lv, 0) * 1.4em); }
.rt .rt-m { flex: none; min-width: 1.2em; color: var(--accent); font-weight: 700; }
.rt .rt-n { color: var(--ink-3); font-weight: 600; }
.rt .rt-c { white-space: pre-wrap; min-width: 0; }
.rt .rt-done .rt-m { color: var(--green); }
.rt .rt-done .rt-c { color: var(--ink-3); }
.rt-mark { background: var(--accent-t); color: inherit; padding: 0 3px; border-radius: 3px; box-shadow: 0 0 0 1px var(--accent-t); }
.rt-hidden { display: none !important; }
.rt-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: var(--surface); }
.thr-r .rt { margin: 0; }
.rt-bar { position: fixed; z-index: 400; display: none; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); max-width: calc(100vw - 12px); flex-wrap: wrap; }
.rt-btn { min-width: 30px; height: 28px; padding: 0 7px; border: 0; background: transparent; color: var(--ink); border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; }
.rt-btn:hover { background: var(--accent-t); }
.rt-btn.on { background: var(--accent); color: var(--white); }
.rt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.rt-tb-mk { background: var(--accent-t); padding: 0 4px; border-radius: 3px; }

/* عناوين تجميع نقاط الاجتماع */
.pgroup { margin-top: 14px; }
.pgroup:first-child { margin-top: 4px; }
.pgrp { display: flex; align-items: center; gap: 8px; }

/* الاجتماعات في الداشبورد */
.dm { border-top: 1px solid var(--line-2); padding: 8px 0; }
.dm:first-of-type { border-top: 0; }
.dm summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dm-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.dm-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 2px; }
.dm-pt { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dm-pt.done .grow { color: var(--ink-3); text-decoration: line-through; }
.dm-ck { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--green); }
.dm-grp { font-weight: 700; margin-top: 6px; color: var(--accent); }
.dm-next { margin-top: 10px; }

/* رقم المهمة */
.tno { display: inline-block; font-size: .78em; font-weight: 700; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-inline-end: 6px; vertical-align: 1px; font-variant-numeric: tabular-nums; }

/* العلامة المائية (الشاشة): مخفية، والركن في معاينة المرفقات */
#wm-layer { display: none; }
.wm-corner { position: absolute; inset-inline-end: 10px; bottom: 8px; font-size: 11px; color: #fff; opacity: .35; pointer-events: none; text-shadow: 0 0 3px rgba(0,0,0,.6); z-index: 5; }

/* ---- الإصدار 1.0: متابعة المدير، السجل، وعناصر جديدة ---- */
.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 14px; }
.glance-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.glance-item b { font-size: 26px; line-height: 1.1; }
.glance-item span { font-size: 13px; color: var(--ink-2); }
.glance-item.bad { border-color: var(--red); background: var(--red-t); }
.glance-item.bad b { color: var(--red); }
.glance-item.warn { border-color: var(--amber); background: var(--amber-t); }
.glance-item.warn b { color: var(--amber-d); }
.glance-item:hover { border-color: var(--accent); }
.fp-person { border: 1px solid var(--line); border-radius: var(--r); margin-top: 8px; background: var(--surface); }
.fp-person > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; cursor: pointer; list-style: none; }
.fp-person > summary::-webkit-details-marker { display: none; }
.fp-person[open] > summary { border-bottom: 1px solid var(--line-2); }
.fp-stats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.chip-bad { background: var(--red-t); border-color: var(--red); color: var(--red); }
.chip-warn { background: var(--amber-t); border-color: var(--amber); color: var(--amber-d); }
.st-noappr { background: var(--surface-2); color: var(--ink-2); border: 1px dashed var(--line); }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.check-row input { margin-top: 4px; }
.plain-list { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.9; }
.act-filters { margin-bottom: 14px; }
.filters.act-filters { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.filters.act-filters input[type=search] { grid-column: 1 / -1; }
.act-det .act-sentence { margin: 0 0 12px; font-size: 15px; }
.act-det h4 { margin: 16px 0 6px; font-size: 14px; color: var(--ink-2); }
.act-det .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; margin: 0; }
.act-det .meta dt { font-size: 12px; color: var(--ink-3); }
.act-det .meta dd { margin: 2px 0 0; }
.act-ch td, .act-ch th { vertical-align: top; }
@media (max-width: 720px) {
  .filters.act-filters { grid-template-columns: 1fr 1fr; }
  .filters.act-filters input[type=search] { grid-column: 1 / -1; }
}

/* ---- الإصدار 2.4: طلبات الملفات، الشروحات، تنبيه الإشعارات، وضع العرض ---- */
.fr-sec { margin-top: 16px; }
.fr-list { display: grid; gap: 10px; }
.fr-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px; }
.fr-card.rejected { border-color: var(--red); }
.fr-card.accepted { border-color: var(--green); }
.fr-card.cancelled { opacity: .7; }
.fr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fr-task { margin: 8px 0 0; font-weight: 600; }
.fr-files { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.fr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fr-card .callout { margin: 8px 0; }

.explain .ex-card { margin-bottom: 16px; }
.explain h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 18px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.ex-box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 12px 14px; }
.ex-box h3 { margin: 0 0 8px; font-size: 15px; color: var(--accent); }
.ex-steps { margin: 0; padding-inline-start: 22px; line-height: 1.9; }
.ex-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.ex-state { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.ex-state p { margin: 0 0 8px; }
.ex-state p:last-child { margin: 0; }
.ex-warn { color: var(--amber-d); font-weight: 600; }

#top-banner:empty { display: none; }
.nb { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 16px 0; padding: 12px 14px; border: 1px solid var(--amber); border-radius: var(--r); background: var(--amber-t); color: var(--ink); }
.nb-ic { color: var(--amber-d); display: flex; }
.nb-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.nb-text a { font-size: 13px; }
.nb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* وضع العرض: ألوان ثابتة داكنة في الوضعين لتُقرأ من بعيد */
body:has(.pres) { overflow: hidden; }
.pres { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; color: #eef2f7; outline: none;
  background: radial-gradient(1200px 700px at 85% -10%, #1f3d6b 0%, transparent 60%), linear-gradient(160deg, #0b1b36 0%, #0f2342 55%, #132c52 100%); }
.pres-bar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.pres-logo { height: 36px; width: auto; }
.pres-name { flex: 1; font-size: 15px; color: #b9c6d8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pres-tools { display: flex; gap: 8px; }
.pres-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
.pres-btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.pres-btn:disabled { opacity: .3; cursor: default; }
.pres-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 24px 6vw; overflow: auto; }
.ps { width: min(1180px, 100%); }
.ps h1 { margin: 0 0 8px; font-size: clamp(30px, 4.6vw, 58px); line-height: 1.25; font-weight: 700; }
.ps-subtitle { margin: 0 0 22px; font-size: clamp(16px, 1.8vw, 22px); color: #aebcd0; }
.ps-body { margin-top: 18px; }
.ps-cover { text-align: center; }
.ps-cover h1 { font-size: clamp(36px, 6vw, 76px); }
.ps-cover h1::after { content: ""; display: block; width: 120px; height: 4px; border-radius: 2px; background: #c9a24b; margin: 22px auto 0; }
.ps-when { margin: 26px 0 0; font-size: clamp(20px, 2.6vw, 32px); color: #d7e0ec; }
.ps-code-line, .ps-sub { margin: 12px 0 0; font-size: clamp(16px, 1.8vw, 22px); color: #aebcd0; }
.ps-code, .ps-code-line bdi { color: #e3c675; font-variant-numeric: tabular-nums; }
.ps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ps-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.ps-row.done { opacity: .75; }
.ps-row.late { border-color: #e5776c; }
.ps-mark { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; flex: none; color: #55d6a0; }
.ps-row.done .ps-mark { border-color: #55d6a0; }
.ps-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ps-main strong { font-size: clamp(18px, 2.2vw, 28px); font-weight: 600; line-height: 1.45; }
.ps-main small { font-size: clamp(13px, 1.4vw, 18px); color: #aebcd0; }
.ps-list.big .ps-main strong { font-size: clamp(20px, 2.6vw, 32px); }
.ps-chip { flex: none; padding: 4px 14px; border-radius: 999px; font-size: clamp(13px, 1.4vw, 17px); background: rgba(255,255,255,.12); color: #dfe7f1; }
.ps-chip.done { background: rgba(85,214,160,.2); color: #7ee6b9; }
.ps-chip.open { background: rgba(224,168,60,.2); color: #f0c46a; }
.ps-chip.late { background: rgba(229,119,108,.22); color: #ff9d92; }
.ps-more { margin: 14px 0 0; color: #aebcd0; font-size: 17px; }
.ps-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; }
.ps-stat { padding: 26px 20px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); text-align: center; }
.ps-stat b { display: block; font-size: clamp(44px, 6.4vw, 88px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ps-stat span { display: block; margin-top: 8px; font-size: clamp(15px, 1.8vw, 22px); color: #c4d0e0; }
.ps-stat.ok b { color: #55d6a0; }
.ps-stat.warn b { color: #f0c46a; }
.ps-stat.bad b { color: #ff8d80; }
.ps-thanks { margin: 34px 0 0; text-align: center; font-size: clamp(20px, 2.6vw, 34px); color: #e3c675; }
.ps-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ps-people li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: clamp(16px, 1.8vw, 22px); }
.ps-people li.here { border: 1px solid #55d6a0; }
.ps-av { width: 40px; height: 40px; border-radius: 50%; background: #2c4c7c; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.ps-agenda { margin: 0; padding-inline-start: 34px; display: grid; gap: 14px; font-size: clamp(20px, 2.4vw, 30px); }
.ps-agenda small { display: block; margin-top: 4px; font-size: .62em; color: #aebcd0; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: clamp(16px, 1.9vw, 24px); }
.ps-tbl th { text-align: start; font-weight: 500; color: #aebcd0; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.2); }
.ps-tbl td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ps-tbl td.bad { color: #ff8d80; font-weight: 700; }
.ps-tbl td.ok { color: #7ee6b9; }
.pres-foot { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 12px 0 18px; }
.pres-count { font-size: 16px; color: #b9c6d8; min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.pres-prog { height: 4px; background: rgba(255,255,255,.1); }
.pres-prog i { display: block; height: 100%; background: #c9a24b; transition: width .25s ease; }
@media (max-width: 720px) {
  .pres-bar { padding: 10px 14px; gap: 10px; }
  .pres-logo { height: 28px; }
  .pres-stage { padding: 16px; align-items: flex-start; }
  .ps-row { padding: 12px 14px; gap: 10px; }
  .ps-chip { padding: 3px 10px; }
}
@media print { .pres { display: none; } }
@media (max-width: 640px) {
  .ps-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ps-stat { padding: 16px 8px; }
  .ps-stat b { font-size: 38px; }
}

/* الإصدار 2.5: التنقل بين المنصتين */
.plat-sw { padding: 4px 10px 6px; }
.plat-btn {
  width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  background: var(--side-2); color: var(--white); border: 1px solid var(--side-2); border-radius: var(--r);
  font: inherit; text-align: start; cursor: pointer;
}
.plat-btn:hover { border-color: var(--gold); }
.plat-btn > svg:first-child { color: var(--gold); flex: none; }
.plat-btn > svg:last-child { margin-inline-start: auto; flex: none; transition: transform .2s; }
.plat-btn[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.plat-cur { display: grid; line-height: 1.3; }
.plat-cur small { font-size: 11.5px; color: var(--side-ink); }
.plat-cur strong { font-size: 15px; }
.plat-menu { margin-top: 6px; display: grid; gap: 2px; padding: 4px; border: 1px solid var(--side-2); border-radius: var(--r); }
.plat-row {
  min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r);
  color: var(--side-ink); text-decoration: none;
}
a.plat-row:hover { background: var(--side-2); color: var(--white); }
.plat-row.on { background: var(--side-2); color: var(--white); font-weight: 700; }
.plat-row.on svg { color: var(--gold); }
.plat-name { display: grid; line-height: 1.3; }
.plat-name small { font-size: 11.5px; color: var(--dk-faint); }
.plat-row > svg:last-child { margin-inline-start: auto; flex: none; }
@media (prefers-reduced-motion: reduce) { .plat-btn > svg:last-child { transition: none; } }

/* ---- زر اللغة (شريط علوي + شاشة الدخول) ---- */
.lang-btn { font-weight: 700; font-size: .8rem; letter-spacing: .02em; min-width: 40px; }
.lang-btn[lang="en"] { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.auth-main { position: relative; }
.auth-lang { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; }

/* ---------- شريط التحديث ---------- */
#db-bar { top: 56px; border-color: var(--red); }
#upd-bar, #db-bar { position: fixed; top: 10px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); z-index: 120; display: flex; gap: 12px; align-items: center; padding: 8px 8px 8px 16px; background: var(--navy); color: var(--white); border: 1px solid var(--amber); border-radius: 99px; box-shadow: var(--shadow-pop); font-weight: 600; }
.my-act { list-style: none; margin: 0; padding: 0; }
.my-act li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.my-act li.bad strong { color: var(--red); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.health-grid div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.health-grid b { display: block; font-size: 18px; }
