/* أذكى X — نظام التصميم. كل الألوان والخطوط هنا في :root */

/* DIN Next Arabic خط تجاري: ضع ملفاته المرخّصة في athka-x-site/fonts/ بهذه الأسماء (انظر README).
   إن كان مثبتاً على الجهاز يُستخدم مباشرة، وإلا يُستخدم IBM Plex Sans Arabic بديلاً. */
@font-face { font-family: 'DIN Next Arabic'; font-weight: 400; font-display: swap;
  src: local('DIN Next LT Arabic'), local('DINNextLTArabic-Regular'), url('fonts/DINNextLTArabic-Regular.woff2') format('woff2'); }
@font-face { font-family: 'DIN Next Arabic'; font-weight: 500; font-display: swap;
  src: local('DIN Next LT Arabic Medium'), local('DINNextLTArabic-Medium'), url('fonts/DINNextLTArabic-Medium.woff2') format('woff2'); }
@font-face { font-family: 'DIN Next Arabic'; font-weight: 700; font-display: swap;
  src: local('DIN Next LT Arabic Bold'), local('DINNextLTArabic-Bold'), url('fonts/DINNextLTArabic-Bold.woff2') format('woff2'); }

:root {
  --font: 'DIN Next Arabic', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-num: var(--font);

  --brand: #4A1D8C;
  --brand-deep: #2A0E5C;
  --brand-soft: #F1ECFB;
  --brand-line: #B9A5E6;
  --bg: #F6F4FA;
  --surface: #FFFFFF;
  --line: #E7E3EF;
  --ink: #1F1A2E;
  --muted: #7A7490;
  --muted-2: #5A5470;
  --danger: #B42318;
  --win: #215D03;        /* الأخضر الغامق لقوس نسبة الإنجاز */
  --hero-start: #5B2BA6; /* تدرّج مربع المتابعة التنفيذية: الفاتح عند العنوان (يميناً) والغامق عند الشعار (يساراً) */
  --hero-end: #240B52;
  --hero-line: #6D28D9;  /* خط الهوية أسفل المربع */
  --hero-sheen: rgba(255, 255, 255, .14); /* لمعة خفيفة عند طرف العنوان */
  --on-dark-soft: #E4D9F8;
  --topbar-h: 64px;
  /* سلّم الخطوط الموحّد (نسبة ≈1.25): استخدم هذه المتغيرات فقط */
  --fs-micro: 10px;    /* الحواشي التوضيحية أسفل الجداول فقط */
  --fs-caption: 11px;  /* ملاحظات، شارات، بيانات ثانوية */
  --fs-body: 13px;     /* النص الأساسي، عناصر القوائم، الحقول */
  --fs-title: 17px;    /* عناوين البطاقات وأسماء النطاقات */
  --fs-heading: 22px;  /* عناوين الصفحات ونِسب الإنجاز */
  --fs-display: 28px;  /* أرقام المؤشرات */
  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --shadow-hover: 0 6px 18px rgba(42, 14, 92, .08);
  --backdrop: rgba(31, 16, 60, .45);

  --todo: #A7A3B5;   --todo-soft: #EEEDF2;   --todo-ink: #4B4660;   --todo-tint: #F8F7FB;   --todo-line: #E2E0E9;
  --prog: #275FBF;   --prog-soft: #E2EAF8;   --prog-ink: #1B4488;   --prog-tint: #F3F6FC;   --prog-line: #C9D8F1;   /* قيد التنفيذ: أزرق */
  --review: #E0A030; --review-soft: #FDF0D8; --review-ink: #8A5A00; --review-tint: #FFFAF0; --review-line: #F3DDB0;
  --ready: #7B5CD6;  --ready-soft: #ECE6FA;  --ready-ink: #4A2FA0;  --ready-tint: #F7F4FD;  --ready-line: #DCD2F5;
  --done: #2E9E5B;   --done-soft: #DFF3E6;   --done-ink: #1C6B3C;   --done-tint: #F2FAF5;   --done-line: #CDE7D5;

  --nodata-bg: #FCEBEB; --nodata-fg: #8C1D1D;
  --attn-bg: #FDF1E1;   --attn-fg: #9A5B00;
  --ok-bg: #E3F4E9;     --ok-fg: #1C6B3C;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(42, 14, 92, .06), 0 4px 16px rgba(42, 14, 92, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: var(--fs-body); color: var(--ink); background: var(--bg); line-height: 1.6;
  cursor: default; -webkit-user-select: none; user-select: none; caret-color: transparent;
}
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; caret-color: auto; }
input[type="text"], input[type="date"], textarea { cursor: text; }
a, button, select, [role="link"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--font); line-height: 1.35; }
h2 { font-size: var(--fs-title); font-weight: 700; }
h3 { font-size: var(--fs-body); font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.overflow-hidden { overflow: hidden; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  height: var(--topbar-h); padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--muted-2); white-space: nowrap; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.on-exec #dataDate { display: none; }
.topbar .exec-only { display: none; }
.on-exec .topbar .exec-only { display: inline-flex; }
.topbar .board-only { display: none; }
.on-board .topbar .board-only { display: inline-flex; }
.on-exec .topbar-add { display: none; }
/* وضع الاجتماع: بلا شريط علوي، والمتابعة التنفيذية تملأ الشاشة كاملة */
.meeting { --topbar-h: 0px; }
.meeting .topbar { display: none; }
.meeting-exit {
  position: fixed; bottom: 10px; inset-inline-end: 12px; z-index: 40; display: none; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted-2);
  font-size: var(--fs-caption); font-weight: 600; opacity: .35; transition: opacity .2s;
}
.meeting-exit:hover, .meeting-exit:focus-visible { opacity: 1; }
.meeting .meeting-exit { display: inline-flex; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; color: var(--muted); }
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync:empty { display: none; }
.sync-online { color: var(--done-ink); }
.sync-local { color: var(--attn-fg); }
.sync-error { color: var(--danger); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-line); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-ghost { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-caption); }
.icon-btn { padding: 0; width: 40px; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-quiet-danger { color: var(--danger); }
.btn-quiet-danger:hover { border-color: var(--danger); background: var(--nodata-bg); }
.chip-neutral { background: var(--bg); color: var(--muted-2); }
.chip-dashed { background: var(--surface); border: 1.5px dashed var(--danger); color: var(--danger); }
.page-title { font-size: var(--fs-heading); font-weight: 700; color: var(--brand-deep); margin-bottom: 4px; }

/* ---------- التخطيط ---------- */
.app { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px;
  background: var(--brand); color: #fff;
}
.card-head h2, .card-head h3 { color: #fff; }
.card-body { padding: 10px 16px; }
.kicker { display: block; font-size: var(--fs-caption); color: var(--on-dark-soft); margin-top: 2px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-on-dark { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .24); border-color: #fff; }
.badge-white { background: #fff; color: var(--brand); border-radius: 999px; padding: 4px 12px; font-size: var(--fs-caption); font-weight: 700; white-space: nowrap; }

/* ---------- عناصر صغيرة ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-caption); color: var(--muted-2); }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.dashed { border: 1.5px dashed #E0A3A3; background: #FFF8F8; border-radius: 10px; color: var(--muted-2); }

.bar { display: flex; flex: 1; min-width: 60px; height: 10px; border-radius: 999px; overflow: hidden; background: #EEEBF3; }
.bar > span { display: block; height: 100%; }
.bar.dashed { border-radius: 999px; }
.bar-thin { height: 6px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: var(--fs-caption);
}
.avatar.unassigned { background: var(--nodata-bg); color: var(--danger); border: 1px dashed #E0A3A3; }
.scope-num {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-family: var(--font-num); font-weight: 700;
}

.exp { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.exp.set { background: var(--brand-soft); color: var(--brand); }
.exp.none { border: 1px dashed #E0A3A3; color: var(--danger); background: #FFF8F8; }
.exp.late { background: var(--nodata-bg); color: var(--danger); }
.exp.done { background: var(--done-soft); color: var(--done-ink); }

/* ---------- المتابعة التنفيذية ---------- */
.hero {
  display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-radius: 18px; color: #fff;
  background:
    radial-gradient(ellipse 55% 140% at 100% 0%, var(--hero-sheen), transparent 70%),
    linear-gradient(to left, var(--hero-start), var(--hero-end));
  border-bottom: 3px solid var(--hero-line);
}
.hero h1 { font-size: var(--fs-heading); font-weight: 700; line-height: 1.3; }
.hero-meta { font-size: var(--fs-body); color: var(--on-dark-soft); margin-top: 6px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: #fff; stroke-width: 9; }
.ring-arc { fill: none; stroke: var(--win); stroke-width: 9; }
.ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-title); font-weight: 700; color: #fff; }

.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; text-align: start;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.kpi:hover { border-color: var(--brand-line); }
.kpi .label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-caption); font-weight: 600; color: var(--muted-2); }
.kpi .value { font-family: var(--font-num); font-size: var(--fs-display); font-weight: 700; line-height: 1.2; }
.kpi .note { font-size: var(--fs-caption); color: var(--muted); min-height: 16px; }

.exec-top { display: grid; grid-template-columns: minmax(360px, 36%) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.exec-top .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.exec-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.exec-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.exec-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.exec-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
/* فريق العمل بجانب الجدول: قائمة عمودية واضحة، بطاقة لكل عضو */
.exec-side .exec-team .team-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.owners-box { display: flex; flex-direction: column; gap: 10px; }
.inline-add { border-top: 0; padding-top: 0; }
/* فريق العمل أفقياً: بطاقة لكل عضو */
.exec-team .team-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-content: start; }
.table-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 6px; }
.table-foot .footnote { margin: 0; }
.foot-line { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; margin: 0; font-size: var(--fs-micro); line-height: 1.5; color: var(--muted); }
.hh-item { display: inline-flex; align-items: center; gap: 4px; }
.hh-item .dot { width: 6px; height: 6px; }
.hh-item b { color: var(--muted-2); font-weight: 700; }
.hh-head { padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.hh-head b { color: var(--ink); }
.scope-rows { display: flex; flex-direction: column; }
.scope-row .dist { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; min-width: 0; }
.scope-row .dist .bar { flex: none; width: 100%; max-width: 280px; height: 14px; }
.dist-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 12px; font-size: var(--fs-caption); font-weight: 500; color: var(--muted-2); line-height: 1.4; }
.dist-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dist-item .dot { width: 7px; height: 7px; }
.dist-item b { color: var(--ink); font-weight: 700; }
.dist-empty { font-size: var(--fs-caption); color: var(--muted); }
.scope-row .pct { font-size: var(--fs-title); font-weight: 700; color: var(--ink); }
.scope-row .cov { font-size: var(--fs-body); font-weight: 700; color: var(--muted-2); }
.scope-row .pill { font-size: var(--fs-caption); padding: 4px 10px; justify-content: center; }
.row-head > :nth-child(n+2) { text-align: center; }
.scope-row > :nth-child(3), .scope-row > :nth-child(4) { justify-self: center; text-align: center; }
.hs-cell { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
.hs-cell.hs-start { align-items: flex-start; }
.hs-reason { font-size: var(--fs-caption); font-weight: 600; line-height: 1.35; text-align: center; opacity: .85; }
.hs-start .hs-reason { text-align: start; padding-inline-start: 4px; }
.pill-wrap { white-space: normal; line-height: 1.45; border-radius: 12px; padding: 5px 12px; }
.pill-wrap .dot { align-self: flex-start; margin-top: 6px; }
.pill-wrap b { font-weight: 700; }
.hs-focus { padding-inline-start: 6px; font-size: var(--fs-caption); line-height: 1.35; color: var(--muted-2); }
.hs-focus b { color: var(--ink); }
.scope-row .bar { height: 10px; }
.scope-row .scope-num { width: 30px; height: 30px; font-size: 13px; }
.footnote { font-size: var(--fs-caption); }
.team-body { display: flex; flex-direction: column; gap: 8px; }
.person-pct { font-size: var(--fs-title); font-weight: 700; }
.person .bar { flex: none; }
.exec-team .person { gap: 6px; padding: 8px 12px; }
.exec-team .avatar { width: 28px; height: 28px; font-size: 12px; }
.row-head, .scope-row {
  display: grid; grid-template-columns: minmax(260px, 2.8fr) minmax(190px, 1fr) 72px 60px 130px; gap: 14px; align-items: center;
}
.row-head { padding: 6px 12px; font-size: var(--fs-caption); font-weight: 700; color: var(--muted-2); }
.scope-row {
  width: 100%; padding: 8px 12px; text-align: start; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0;
}
.scope-row:hover { background: var(--bg); }
.scope-row .name { font-size: var(--fs-title); font-weight: 700; line-height: 1.35; }
.scope-row .sub { font-size: var(--fs-caption); color: var(--muted-2); line-height: 1.5; }

.person { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.person-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.person-stats span { padding: 2px 8px; border-radius: 6px; font-size: var(--fs-caption); }

.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.panel { display: flex; flex-direction: column; padding: 10px 16px; border-top-width: 3px; }
.panel-support { border-top-color: var(--review); } .panel-support h2 { color: var(--attn-fg); }
.panel-risk { border-top-color: var(--danger); }     .panel-risk h2 { color: var(--danger); }
.panel-win { border-top-color: var(--done); }        .panel-win h2 { color: var(--done-ink); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 4px; }
.panel-head h2 { font-size: var(--fs-title); font-weight: 700; }
.panel-count { min-width: 28px; padding: 2px 10px; border-radius: 999px; background: var(--bg); text-align: center; font-weight: 700; }
.panel-list { display: flex; flex-direction: column; }
.panel-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.panel-item .title { font-weight: 600; }
.panel-item .note { font-size: var(--fs-caption); color: var(--muted); }

/* ---------- النافذة المنبثقة ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--backdrop);
}
.modal {
  display: flex; flex-direction: column; width: 100%; max-width: 1100px; max-height: 92vh; overflow: hidden;
  background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(31, 16, 60, .3);
}
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
.modal-foot .btn { min-height: 44px; text-align: start; }
small { font-size: var(--fs-caption); }
.modal-sm { max-width: 440px; }
.modal-md { max-width: 640px; }
.modal-close { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.comp-editor { display: flex; flex-direction: column; gap: 10px; }
.comp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; padding-inline-start: 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-weight: 600; }
.comp-chip button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted-2); }
.comp-chip button:hover { background: var(--nodata-bg); color: var(--danger); }
.modal .field input { width: 100%; }
.team-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; }
.team-count { font-size: var(--fs-caption); white-space: nowrap; }
.team-add { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.team-row input, .team-add input {
  width: 100%; min-height: 40px; padding: 0 12px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--bg); border-radius: 10px; }
.stat .k { font-size: var(--fs-caption); color: var(--muted); }
.stat .v { font-family: var(--font-num); font-size: var(--fs-heading); font-weight: 700; }
.mini-board { display: grid; gap: 10px; }
.mini-col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; min-width: 0; }
.mini-col .head { display: flex; align-items: center; justify-content: space-between; }
/* تفاصيل المهمة للعرض فقط */
.task-detail { display: flex; flex-direction: column; gap: 14px; }
.td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.td-title { font-size: var(--fs-title); font-weight: 700; line-height: 1.4; }
.td-progress { display: flex; align-items: center; gap: 14px; }
.td-pct { font-size: var(--fs-heading); font-weight: 700; min-width: 3.5ch; }
.td-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.td-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; background: var(--bg); border-radius: 10px; min-width: 0; }
.td-item .k { font-size: var(--fs-caption); color: var(--muted); }
.td-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-section h3 { font-size: var(--fs-caption); font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.td-section p { margin: 0; line-height: 1.7; }
.td-flag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; }
.td-support { background: var(--attn-bg); color: var(--attn-fg); }
.td-risk { background: var(--nodata-bg); color: var(--ink); }
.td-history { display: flex; flex-direction: column; }
.td-update { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.td-update-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.td-update p { margin: 0; }

/* ---------- البطاقات ---------- */
.tcard {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.tcard:hover { border-color: var(--brand-line); }
.tcard .title { font-weight: 700; line-height: 1.45; }
.tcard > span { flex-wrap: wrap; row-gap: 4px; }
.tcard .muted { white-space: nowrap; }
.footbar { display: block; height: 4px; margin: 0 -10px; background: var(--bg); }
.footbar > span { display: block; height: 100%; }

/* ---------- لوحة الأعمال (كانبان) ---------- */
.app-wide { max-width: none; }
.board-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.board-title { display: flex; align-items: baseline; gap: 12px; }
.board-title h1 { font-size: var(--fs-heading); font-weight: 700; color: var(--brand-deep); }
.board-controls { display: flex; gap: 10px; align-items: center; }
.board-flags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.select {
  min-height: 40px; padding: 0 12px; padding-inline-end: 32px; font: inherit; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.people-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0; padding-inline: 5px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-weight: 600;
}
.person-chip .avatar { width: 28px; height: 28px; font-size: 12px; }
.person-chip .count { font-size: var(--fs-caption); color: var(--muted); }
.person-chip { height: auto; min-height: 44px; padding-block: 4px; }
.chip-lines { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: start; }
.chip-last { font-size: var(--fs-caption); font-weight: 500; color: var(--muted); }
.chip-last.is-stale { color: var(--danger); }
.person-chip[aria-pressed="true"] .chip-last { color: var(--brand-line); }
.person-chip[aria-pressed="true"] .chip-last.is-stale { color: var(--nodata-bg); }
.person-summary {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 10px; color: var(--ink);
}
.del-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.del-list { display: flex; flex-direction: column; }
.del-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.del-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.del-text .muted { font-size: var(--fs-caption); }
.del-time { font-size: var(--fs-caption); white-space: nowrap; }
.del-restored { background: var(--done-soft); color: var(--done-ink); }
.ps-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.person-summary.is-stale { background: var(--nodata-bg); border-color: var(--danger); }
.person-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.person-chip[aria-pressed="true"] .count { color: var(--brand-line); }
.person-chip[aria-pressed="true"] .avatar { background: var(--surface); }

/* على سطح المكتب تتسع الأعمدة الخمسة للشاشة دون تمرير أفقي؛ التمرير الأفقي للجوال فقط */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { display: flex; flex-direction: column; min-width: 0; background: var(--tint); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); }
.kcol-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.kcol-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-body); font-weight: 700; }
.kcol-count { min-width: 28px; padding: 1px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-align: center; font-weight: 700; font-size: var(--fs-caption); }
.kcol-body { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; min-height: 120px; }
.kcol-empty { margin: 0; padding: 28px 10px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 10px; }

.kcard { position: relative; gap: 8px; padding: 12px 12px 0; cursor: pointer; }
.kcard.is-preview { cursor: default; }
.kcard-top { display: flex; align-items: center; gap: 8px; }
.kcard-scope { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: var(--fs-caption); font-weight: 600; color: var(--muted-2); line-height: 1.4; }
.kcard-scope b { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 11px; }
.kcard-pct { font-weight: 700; }
.kcard-actions {
  position: absolute; top: 8px; inset-inline-end: 8px; display: flex; gap: 2px; padding: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; opacity: 0; transition: opacity .15s;
}
.kcard:hover .kcard-actions, .kcard:focus-within .kcard-actions { opacity: 1; }
.icon-mini { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); }
.icon-mini:hover { background: var(--brand-soft); color: var(--brand); }
.icon-mini.danger:hover { background: var(--nodata-bg); color: var(--danger); }
.kcard .title { font-size: var(--fs-body); }
.kcard-tags { display: flex; gap: 6px; flex-wrap: wrap; }
/* الشارات داخل البطاقات تلتف لسطر ثانٍ بدل أن تخرج عن البطاقة */
.tcard .chip, .tcard .exp { white-space: normal; max-width: 100%; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 0 10px; border-top: 1px solid var(--line); }
.kcard-people { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kcard-people .names { font-size: var(--fs-caption); font-weight: 600; color: var(--muted-2); line-height: 1.4; }
.kcard-people .unassigned-text { color: var(--danger); }
.avatars { display: inline-flex; flex: none; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar + .avatar { margin-inline-start: -7px; }
.avatar.more { width: 22px; height: 22px; font-size: 10px; background: var(--bg); color: var(--muted-2); }
@media (hover: none) { .kcard-actions { opacity: 1; } }

/* ---------- النماذج ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.update-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field > .legend { display: block; font-size: var(--fs-body); font-weight: 700; color: var(--ink); }
.req { color: var(--danger); }
.field input, .field textarea {
  width: 100%; min-height: 44px; padding: 0 12px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.field textarea { padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
.range { accent-color: var(--brand); min-height: auto !important; border: none !important; padding: 0 !important; }
.support-box { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.support-box.on { border-color: var(--review-line); background: var(--review-tint); }
.risk-box.on { border-color: var(--danger); background: var(--nodata-bg); }
.risk-box .field { margin-bottom: 0; }
.opt-add { border-style: dashed; color: var(--brand); justify-content: center; }
.opt-add:hover { background: var(--brand-soft); }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; text-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-weight: 600;
}
.opt:hover { border-color: var(--brand-line); }
.opt.gap { border: 1.5px dashed var(--danger); }
.opt[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt[aria-pressed="true"] .scope-num, .opt[aria-pressed="true"] .avatar { background: #fff; }
.status-grid .opt { justify-content: center; text-align: center; }

.switch {
  position: relative; flex: none; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: #D9D6E2;
}
.switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"] i { inset-inline-start: 23px; }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks > div { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checks i {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #D9D6E2; font-style: normal; font-size: var(--fs-caption);
}
.checks .on { color: var(--ink); }
.checks .on i { background: var(--done); border-color: var(--done); color: #fff; }

.readonly { background: var(--todo-tint); }
.diff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.strike { text-decoration: line-through; color: var(--muted); }

/* ---------- تنبيه ---------- */
.toast {
  position: fixed; bottom: 20px; inset-inline: 16px; z-index: 60; max-width: 520px; margin: 0 auto; padding: 12px 16px;
  background: var(--brand-deep); color: #fff; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- المتابعة التنفيذية: التصميم المعتمد (ترويسة عريضة، عمود جانبي، جدول النطاقات) ---------- */
.hero-wide { justify-content: space-between; padding: 18px 28px; }
.hero-wide h1 { font-size: var(--fs-display); line-height: 1.25; }
/* شعار AthkaX (athkax-wordmark.png: أبيض مع علامة بنفسجية، خلفية شفافة). الأبعاد ثابتة حتى لا يتغير القياس بعد تحميل الصورة */
.wordmark { flex: none; display: block; width: 190px; height: 44px; }

.exec-layout { display: grid; grid-template-columns: minmax(300px, 35%) minmax(0, 1fr); gap: 14px; align-items: start; }
.exec-maincol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.exec-aside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.side-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.side-card h2 { font-size: var(--fs-title); }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-head .muted { display: block; font-size: var(--fs-caption); }
.overall {
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 22px; padding: 20px 22px;
  border-top: 3px solid var(--brand); background: linear-gradient(to left, var(--brand-soft), var(--surface) 65%);
}
.overall .ring { width: 124px; height: 124px; }
.overall .ring-value { font-size: var(--fs-display); }
.overall h2 { font-size: var(--fs-heading); color: var(--brand-deep); line-height: 1.3; }
.ov-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.ov-help { margin-top: -6px; font-size: var(--fs-body); line-height: 1.4; color: var(--muted); }
.ov-stats { flex: none; display: flex; flex-direction: column; gap: 8px; min-width: 170px; margin-inline-start: auto; padding-inline-start: 18px; border-inline-start: 1px solid var(--line); align-self: stretch; justify-content: center; }
.ov-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ov-stat .num { text-align: end; }
.ov-stat .num { min-width: 2ch; font-size: var(--fs-display); font-weight: 700; line-height: 1.2; color: var(--brand-deep); }
.ov-stat span:not(.num) { white-space: nowrap; font-size: var(--fs-body); font-weight: 600; color: var(--muted-2); }
.ring-brand .ring-track { stroke: var(--brand-soft); }
.ring-brand .ring-arc { stroke: var(--brand); }
.ring-brand .ring-value { color: var(--brand-deep); }
.mr-chip { flex: none; display: inline-flex; align-items: flex-start; gap: 6px; padding: 4px 6px 3px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: var(--fs-caption); white-space: nowrap; }
.mr-wrap { position: relative; display: inline-flex; }
.mr-pick { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font: inherit; font-weight: 700; }
.mr-pick:hover, .mr-pick:focus-visible { background: var(--brand-line); outline: none; }
.mr-hidden { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.mr-arrow { color: var(--muted); line-height: 24px; }
.mr-col { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mr-label { font-size: var(--fs-caption); line-height: 1.2; color: var(--muted); font-weight: 500; }
.mr-mid { padding-inline: 2px; }
.mr-days { color: var(--brand-deep); font-weight: 700; white-space: nowrap; }
.mr-today { display: inline-flex; align-items: center; min-height: 24px; padding: 0 4px; color: var(--muted-2); font-weight: 600; }
.mstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mstat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; text-align: center; background: var(--surface); font: inherit; color: inherit; }
.mstat:hover, .mstat:focus-visible { border-color: var(--brand-line); background: var(--brand-soft); outline: none; }
.mm-tabs { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.mstat b { font-size: var(--fs-title); color: var(--ink); }
.mstat span { font-size: var(--fs-caption); color: var(--muted); line-height: 1.35; }
.sc-meeting { border-top: 3px solid var(--muted-2); }
.sc-win { border-top: 3px solid var(--done); } .sc-win h2 { color: var(--done-ink); }
.sc-ready { border-top: 3px solid var(--ready); } .sc-ready h2 { color: var(--ready-ink); }
.sc-decision { border-top: 3px solid var(--review); }
.sc-grid { display: grid; gap: 8px; }
.sc-grid-win { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.sc-grid-ready { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sc-grid-decision { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.mini-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; width: 100%; padding: 8px 10px; text-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; line-height: 1.45;
}
.mini-card:hover { border-color: var(--brand-line); }
.mini-card b { font-size: var(--fs-caption); }
.mini-card .chip { max-width: 100%; white-space: normal; }
.mini-card .muted { font-size: var(--fs-caption); }
.sc-ready .mini-card { border-inline-start: 3px solid var(--ready); }
.mini-foot { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.dc-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--review); border-radius: 10px; font-size: var(--fs-caption); font-weight: 600; line-height: 1.5; }
.dc-item:hover { border-color: var(--brand-line); border-inline-start-color: var(--review); }
.dc-item .dot { flex: none; }

.exec-table { overflow: hidden; border-top: 3px solid var(--brand); }
.et-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; background: linear-gradient(to left, var(--brand-soft), var(--surface) 65%); }
.et-head h2 { font-size: var(--fs-heading); color: var(--brand-deep); line-height: 1.3; }
.et-sub { display: block; font-size: var(--fs-body); }
.health-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.et-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 18px; border-block: 1px solid var(--line); }
.flow-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-label { font-size: var(--fs-caption); font-weight: 600; color: var(--muted-2); }
.flow-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
.flow-chip:hover { border-color: var(--brand-line); }
.flow-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.flow-count { font-weight: 700; }
.et-hint { font-size: var(--fs-caption); }

/* ---------- المتابعة التنفيذية بملء الشاشة ----------
   app.js (fitExec) يضبط عرض .exec-canvas وارتفاعها وzoom لتظهر كل البيانات دون تمرير. */
.exec-canvas { position: relative; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1200px) and (min-height: 600px) {
  .app-fit { display: block; max-width: none; height: calc(100dvh - var(--topbar-h)); padding: 14px 20px; overflow: hidden; }
  .app-fit .exec-canvas { gap: 14px; }
  .app-fit .exec-grid { flex: 1 1 auto; align-items: stretch; }
  .app-fit .exec-layout { flex: 1 1 auto; align-items: stretch; }
  .app-fit .exec-maincol > .exec-table { flex: 1 1 auto; display: flex; flex-direction: column; }
  .app-fit .exec-aside > .side-card:last-child { flex: 1 1 auto; }
  .app-fit .exec-main { min-height: 0; }
  .app-fit .exec-main > .card, .app-fit .exec-side > .card, .app-fit .exec-bottom > .card { display: flex; flex-direction: column; }
  .app-fit .exec-side > .card { flex: 1 1 auto; }
  .app-fit .exec-side .team-body { align-content: stretch; }
  .app-fit .exec-main > .exec-table { flex: 1 1 auto; }
  .app-fit .exec-team .team-body { display: grid; }
  .app-fit .card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
  .app-fit .scope-rows, .app-fit .team-body { flex: 1 1 auto; }
  .app-fit .scope-row { flex: 1 1 auto; }
  .app-fit .person { justify-content: center; }
}

/* ---------- حركة الدخول (هادئة، مرة واحدة عند فتح الصفحة) ----------
   التأخير بالمللي ثانية في --d على العنصر نفسه؛ الأشرطة ترث --d من صفها لتتزامن مع رقمها.
   fill-mode: backwards حتى تعود العناصر لأنماطها الطبيعية بعد الحركة (فلا تتعارض مع حركة المرور بالمؤشر). */
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes modal-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.is-booting .topbar { animation: drop .45s var(--ease-out) backwards; }
.anim-in .hero { animation: drop .45s var(--ease-out) backwards; }
.anim-in .kpi { animation: rise .45s var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 1ms); }
.anim-in .exec-table, .anim-in .exec-team, .anim-in .panel, .anim-in .side-card { animation: rise .5s var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 1ms); }
/* الأشرطة تمتد من بداية السطر (اليمين في RTL)، مع رقمها في الوقت نفسه ولمدة ثانية */
.anim-in .bar > span { transform-origin: right center; animation: grow 1s var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 1ms); }
/* لا تبدأ حركة القسم قبل دخوله الشاشة */
.anim-in .reveal:not(.is-visible), .anim-in .reveal:not(.is-visible) *,
.anim-board .reveal:not(.is-visible), .anim-board .reveal:not(.is-visible) * { animation-play-state: paused; }
.hero-meta .num { display: inline-block; min-width: 3ch; text-align: center; }

.anim-board .board-toolbar { animation: drop .45s var(--ease-out) backwards; }
.anim-board .kcol { animation: rise .45s var(--ease-out) backwards; animation-delay: calc(120ms + var(--i, 0) * 90ms); }
/* نسب إنجاز البطاقات تمتد مع أرقامها */
.anim-board .footbar > span { transform-origin: right center; animation: grow 1s var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 1ms); }

.overlay.is-entering { animation: fade .2s ease-out backwards; }
.overlay.is-entering .modal { animation: modal-in .22s var(--ease-out) backwards; }

/* ---------- حركة التفاعل ---------- */
.btn, .opt, .person-chip, .icon-mini, .nav a, .scope-row, .select, .comp-chip button, .switch {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.kpi, .kcard, .mini-col .tcard { transition: transform .2s var(--ease-out), box-shadow .2s ease, border-color .15s ease; }
.kpi:hover, .kcard:hover, .mini-col .tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kcard.is-preview:hover { transform: none; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kpi:hover, .kcard:hover, .mini-col .tcard:hover { transform: none; }
}

/* ---------- التجاوب ---------- */
@media (max-width: 1199px) {
  .kpis, .exec-top .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .exec-top { grid-template-columns: minmax(0, 1fr); }
  .exec-layout { grid-template-columns: minmax(0, 1fr); }
  .board-toolbar { grid-template-columns: minmax(0, 1fr); }
  .board-flags { justify-content: flex-start; }
  .exec-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .update-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .update-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(5, minmax(260px, 82vw)); overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .team-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .team-count { display: none; }
  .panels, .exec-bottom, .update-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-board { grid-template-columns: minmax(0, 1fr) !important; }
  .row-head { display: none; }
  .mstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wordmark { width: 138px; height: 32px; }
  .scope-row { grid-template-columns: minmax(0, 1fr) auto; }
  .scope-row > :nth-child(2) { grid-column: 1 / -1; order: 5; }
  .scope-row > :nth-child(4) { display: none; }
}
@media (max-width: 700px) {
  .topbar { gap: 12px; padding: 0 16px; height: auto; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .hide-sm { display: none; }
  .topbar-actions { flex: 1 1 160px; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
  .on-exec #meetingBtn { display: none; }
  .app { padding: 16px; }
  .kpis, .exec-top .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-controls { flex-wrap: wrap; }
  .hero { padding: 16px; }
  .hero h1 { font-size: var(--fs-title); }
  .status-grid, .opt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-grid { grid-template-columns: minmax(0, 1fr); }
  .overlay { padding: 8px; }
  .modal-body, .modal-foot { padding-inline: 14px; }
  /* المتابعة التنفيذية على الجوال */
  .hero-wide { gap: 12px; }
  .wordmark { width: 104px; height: 24px; }
  .overall { flex-wrap: wrap; gap: 14px; }
  .ov-text { flex: 1 1 0; }
  .overall .ring { width: 104px; height: 104px; }
  .ov-stats { flex-direction: row; width: 100%; min-width: 0; margin: 0; padding: 12px 0 0; border-inline-start: 0; border-top: 1px solid var(--line); }
  .ov-stat { flex: 1 1 0; }
  .et-head { flex-direction: column; gap: 10px; }
  .health-chips { justify-content: flex-start; }
  .et-hint { display: none; }
  .del-row { grid-template-columns: auto minmax(0, 1fr); }
  .del-time { grid-column: 2; }
  .del-row > :last-child { grid-column: 2; justify-self: start; }
}

/* ---------- تصدير PDF (طباعة المتابعة التنفيذية) ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, #modal-root, .toast, .meeting-exit { display: none !important; }
  .app, .app-fit { height: auto !important; overflow: visible !important; padding: 0 !important; max-width: none; }
  .exec-canvas { zoom: 1 !important; width: auto !important; height: auto !important; }
  .card, .scope-row, .mini-card { break-inside: avoid; box-shadow: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
