@import url("fonts/plex.css");

/* ================= نظام الألوان ================= */
:root {
  color-scheme: light;
  --page: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #f6f9f8;
  --surface-3: #edf2f0;
  --ink: #0d1d18;
  --ink-2: #41524c;
  --muted: #74837d;
  --line: #e2e9e6;
  --line-2: #d3ddd9;
  --brand: #0b6e58;
  --brand-2: #08594a;
  --brand-3: #14957a;
  --brand-soft: #e1f2ec;
  --brand-ink: #064636;
  --gold: #b0843a;
  --gold-soft: #f6eedf;
  --danger: #c2413b; --danger-soft: #fbebea;
  --ok: #128049;     --ok-soft: #e3f4e9;
  --warn: #a36800;   --warn-soft: #fcf1d9;
  --info: #2a6fd1;   --info-soft: #e7f0fd;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --b0: #256abf; --b1: #6da7ec; --b2: #898781; --b3: #ec835a; --b4: #d03b3b;
  --shadow-sm: 0 1px 2px rgba(13,29,24,.06);
  --shadow: 0 1px 2px rgba(13,29,24,.04), 0 10px 30px -12px rgba(13,29,24,.14);
  --shadow-lg: 0 30px 60px -20px rgba(6,40,32,.35);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --hero: linear-gradient(135deg, #053a2f 0%, #0a644f 48%, #12886c 100%);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M48 10l10 28 28 10-28 10-10 28-10-28-28-10 28-10z'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='9'/%3E%3C/g%3E%3C/svg%3E");
  --font: "IBM Plex Sans Arabic", "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b1210; --surface: #131c19; --surface-2: #18231f; --surface-3: #1e2b26;
    --ink: #edf3f1; --ink-2: #b6c3be; --muted: #82918b; --line: #26332e; --line-2: #2f3d38;
    --brand: #2eaa8b; --brand-2: #3cc29f; --brand-3: #49cfa9; --brand-soft: #15302a; --brand-ink: #b8eadb;
    --gold: #d8a651; --gold-soft: #33291a;
    --danger: #ec6b65; --danger-soft: #3a1c1b; --ok: #45c374; --ok-soft: #15301f;
    --warn: #e2a536; --warn-soft: #382c12; --info: #6aa3f0; --info-soft: #172840;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1210; --surface: #131c19; --surface-2: #18231f; --surface-3: #1e2b26;
  --ink: #edf3f1; --ink-2: #b6c3be; --muted: #82918b; --line: #26332e; --line-2: #2f3d38;
  --brand: #2eaa8b; --brand-2: #3cc29f; --brand-3: #49cfa9; --brand-soft: #15302a; --brand-ink: #b8eadb;
  --gold: #d8a651; --gold-soft: #33291a;
  --danger: #ec6b65; --danger-soft: #3a1c1b; --ok: #45c374; --ok-soft: #15301f;
  --warn: #e2a536; --warn-soft: #382c12; --info: #6aa3f0; --info-soft: #172840;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.5);
}

/* ================= الأساس ================= */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--page); color: var(--ink);
  line-height: 1.65; font-size: 15px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.35; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
:root[dir="rtl"] .dir-flip { transform: scaleX(-1); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.spacer { flex: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

/* ================= البطاقات ================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.grid > .card, .login-grid > .card { margin-top: 0; }
.card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-h h3 { margin: 0; }
.card-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.card-ic .ic { width: 20px; height: 20px; }

/* ================= الأزرار ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.btn.primary { background: linear-gradient(180deg, var(--brand-3), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(11,110,88,.7); }
.btn.primary:hover { background: var(--brand-2); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.3); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 13px 22px; font-size: 15.5px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { padding: 9px; }
.btn.icon.sm { padding: 6px; }
.divider { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }

/* مفتاح تشغيل/إيقاف */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--brand-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ================= الحقول ================= */
label.f { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
textarea.input { min-height: 100px; resize: vertical; line-height: 1.7; }
.field { position: relative; }
.field .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field .input { padding-inline-start: 44px; }
.field .input.big { padding-top: 14px; padding-bottom: 14px; font-size: 17px; font-weight: 600; letter-spacing: .5px; }

/* ================= الشارات والتنبيهات ================= */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin: 12px 0; }
.alert .ic { margin-top: 2px; }
.alert.bad { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ================= الجداول ================= */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-weight: 600; position: sticky; top: 0; white-space: nowrap; z-index: 1; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; text-align: center !important; white-space: nowrap; }

/* ================= المؤشرات ================= */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi .kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .kpi-ic .ic { width: 19px; height: 19px; }
.kpi .kpi-ic.gold { background: var(--gold-soft); color: var(--gold); }
.kpi .kpi-ic.info { background: var(--info-soft); color: var(--info); }
.kpi .kpi-ic.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 32px; font-weight: 700; line-height: 1.15; margin-top: 10px; letter-spacing: -.5px; }
.kpi .val small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.kpi .hint { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-3), var(--brand)); border-radius: 99px; transition: width .4s ease; }

.status-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; font-weight: 600; }
.status-banner .big { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.status-banner.open { background: var(--ok-soft); color: var(--ok); }
.status-banner.open .big { background: var(--ok); color: #fff; }
.status-banner.closed { background: var(--danger-soft); color: var(--danger); }
.status-banner.closed .big { background: var(--danger); color: #fff; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ================= نوافذ وتنبيهات عائمة ================= */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 11px 20px; border-radius: 12px; font-weight: 600; z-index: 100; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(5,20,16,.55); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; max-width: 980px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal .mb { padding: 18px; }
.busy-card { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= الهيدر (بوابة الموظفين) ================= */
.hero { background: var(--pattern), var(--hero); color: #fff; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 400px at 85% -10%, rgba(255,255,255,.12), transparent 60%); pointer-events: none; }
.hero-in { max-width: 1180px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
/* شعار المؤسسة: على لوحة بيضاء دائماً لأن ألوانه داكنة — يظهر كاملاً، وفي المساحات الضيقة الرمز وحده */
.logo { display: flex; flex: none; padding: 7px 12px; border-radius: 12px; background: #fff; }
.logo img { display: block; height: 44px; width: auto; }
.logo .logo-mark { display: none; }
.brand-org { font-size: 13px; opacity: .82; font-weight: 500; }
:root[dir="rtl"] .brand-org { display: none; } /* الاسم بالعربية مكتوب في الشعار نفسه */
.brand-title { font-size: 18px; font-weight: 700; }
.hero-body { max-width: 1180px; margin: 0 auto; padding: 26px 16px 96px; position: relative; z-index: 1; }
.hero-body h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.3px; }
.hero-status { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 14px 8px 16px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: 14px; font-weight: 600; backdrop-filter: blur(4px); }
.hero-status .live { width: 10px; height: 10px; border-radius: 50%; background: #5fe3a1; box-shadow: 0 0 0 0 rgba(95,227,161,.6); animation: pulse 2s infinite; flex: none; }
.hero-status.closed .live { background: #ff8a80; animation: none; }
.hero-status .sub { font-weight: 400; opacity: .85; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(95,227,161,0); } 100% { box-shadow: 0 0 0 0 rgba(95,227,161,0); } }
body[data-view="compact"] .hero-body { padding: 4px 16px 70px; }
body[data-view="compact"] .hero-body h1 { font-size: 22px; }
.overlap { margin-top: -72px; position: relative; z-index: 2; }

/* ================= الدخول: رسالة التقييم ثم نموذج الدخول ================= */
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 18px; align-items: start; }
.letter { padding: 34px 38px; }
.letter h2 { margin: 0 0 18px; font-size: 21px; color: var(--brand); }
.letter h2::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 12px; border-radius: 99px; background: var(--gold); }
.letter p { margin: 0 0 14px; color: var(--ink-2); font-size: 15.5px; line-height: 2; }
:root[dir="ltr"] .letter p { line-height: 1.8; }
.letter .bye { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.login-card { padding: 28px; position: sticky; top: 18px; }
.login-card h2 { font-size: 22px; }
.login-card .lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

/* ================= قائمة المهام ================= */
.profile { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.avatar.lg { width: 60px; height: 60px; border-radius: 18px; font-size: 24px; background: var(--hero); color: #fff; box-shadow: 0 10px 20px -10px rgba(6,58,47,.7); }
.profile .who { flex: 1; min-width: 200px; }
.profile .who h2 { margin: 0; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring .trk { stroke: var(--surface-3); }
.ring .val { stroke: var(--brand); transition: stroke-dashoffset .6s ease; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; font-weight: 700; font-size: 18px; }
.ring .lbl small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.group-h { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.group-h .count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-3); padding: 2px 9px; border-radius: 99px; }
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.task { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.task:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.task .info { flex: 1; min-width: 0; }
.task .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.done { background: linear-gradient(0deg, var(--ok-soft), var(--ok-soft)) padding-box; border-color: transparent; }
.task.done .avatar { background: var(--ok); color: #fff; }
/* خطوات التقييم المتتابعة */
.segbar { display: flex; gap: 5px; margin: 2px 0 10px; }
.segbar i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); transition: background .3s; }
.segbar i.done { background: var(--ok); }
.segbar i.cur { background: var(--brand); }
.stepper { list-style: none; margin: 0; padding: 0; }
.stp { display: flex; gap: 16px; align-items: center; padding: 16px 14px; margin: 0 -14px; border-radius: 16px; position: relative; }
.stp + .stp::before { content: ""; position: absolute; top: 0; inset-inline: 14px; border-top: 1px solid var(--line); }
.stp.cur { background: var(--brand-soft); }
.stp.cur::before, .stp.cur + .stp::before { display: none; }
.stp-n { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; background: var(--surface-3); color: var(--muted); }
.stp.done .stp-n { background: var(--ok); color: #fff; }
.stp.cur .stp-n { background: var(--brand); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); }
.stp-b { flex: 1; min-width: 0; }
.stp-k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stp.cur .stp-k { color: var(--brand); }
.stp-nm { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stp .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stp.lock .stp-b { opacity: .6; }
.stp-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.stp-lock .ic { width: 15px; height: 15px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big-ic { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty .big-ic .ic { width: 30px; height: 30px; }

/* ================= نموذج التقييم ================= */
.form-bar { position: sticky; top: 0; z-index: 10; margin: 0 -16px; padding: 12px 16px; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.form-bar .in { display: flex; align-items: center; gap: 14px; }
.form-bar .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.form-bar .bar { flex: 1; height: 10px; }
.form-bar b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.target-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.target-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.target-meta div { font-size: 14px; }
.target-meta span { display: block; font-size: 12px; color: var(--muted); }
.scale-legend { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.scale-legend .grad { flex: 1; min-width: 120px; max-width: 260px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #d9efe8); }
:root[dir="ltr"] .scale-legend .grad { background: linear-gradient(90deg, #d9efe8, var(--brand)); }
.comp { padding: 0; overflow: hidden; }
.comp-h { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.comp-h .n { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.comp-h h3 { margin: 0; font-size: 16px; flex: 1; }
.comp-h .pill { font-variant-numeric: tabular-nums; }
.comp-h .pill.full { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.q { padding: 16px 22px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center; transition: background .15s; }
.q:last-child { border-bottom: 0; }
.q .t { font-weight: 500; display: flex; gap: 10px; align-items: baseline; }
.q .t .qn { color: var(--muted); font-weight: 600; font-size: 13px; min-width: 22px; font-variant-numeric: tabular-nums; }
.q.missing { background: var(--danger-soft); }
.q.missing .t { color: var(--danger); }
.scale { display: flex; gap: 6px; }
.scale label { cursor: pointer; position: relative; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--surface); font-weight: 700; font-size: 15px; color: var(--ink-2); transition: all .12s;
}
.scale label:hover span { border-color: var(--brand); color: var(--brand); }
.scale input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.06); box-shadow: 0 6px 14px -6px rgba(11,110,88,.8); }
.scale input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-soft); }
.open-q { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.open-q:last-child { border-bottom: 0; }
.open-q .cnt { font-size: 12px; color: var(--muted); text-align: end; margin-top: 4px; }
.submit-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; padding: 18px 22px; }

/* ================= عبارة واحدة في كل مرة ================= */
.target-card { padding: 16px 22px; }
.qcard { max-width: 820px; margin-inline: auto; padding: 26px 28px; }
.card + form .qcard, .target-card + form { margin-top: 18px; }
.qc-prog { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.qc-prog .bar { flex: 1; height: 10px; }
.qc-prog b { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.qc { min-height: 300px; display: flex; flex-direction: column; }
.qc.in-next { animation: q-next .28s ease; }
.qc.in-prev { animation: q-prev .28s ease; }
@keyframes q-next { from { opacity: 0; transform: translateY(14px); } }
@keyframes q-prev { from { opacity: 0; transform: translateY(-14px); } }
.qc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qc-text { font-size: 22px; font-weight: 600; line-height: 1.7; margin: 22px 0 28px; flex: 1; }
.scale.big { gap: 12px; justify-content: center; }
.scale.big label { flex: 1; max-width: 120px; }
.scale.big span { width: 100%; height: 68px; border-radius: 16px; font-size: 24px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 10px; padding: 0 4px; }
.qc .open-q { padding: 0 0 16px; border: 0; }
.qc-nav { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ================= شاشة الشكر ================= */
.done-view { text-align: center; padding: 48px 24px; max-width: 560px; margin: 0 auto; }
.done-view .check { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 12px var(--ok-soft); animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
.done-view .check .ic { width: 44px; height: 44px; stroke-width: 2.4; }
.done-view h2 { font-size: 24px; margin: 0 0 8px; }
.done-view p { color: var(--ink-2); margin: 0 0 22px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 16px 28px; }

/* ================= تقرير PDF ================= */
.report { background: #fff; color: #0f1f1a; padding: 28px; font-size: 13px; }
.report h1 { font-size: 22px; margin: 0; }
.report h2 { font-size: 16px; margin: 20px 0 8px; color: #0b6e58; border-bottom: 2px solid #e1f2ec; padding-bottom: 4px; }
.report .tbl-wrap { background: #fff; }
.report .tbl th { background: #f2f6f4; color: #374641; position: static; }
.report .tbl td, .report .tbl th { border-bottom: 1px solid #e2e8e5; padding: 6px 8px; }
.report .tbl tbody tr:hover td { background: transparent; }
.report .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid #0b6e58; padding-bottom: 12px; }
.report .scorebox { text-align: center; border-radius: 12px; padding: 10px 18px; background: #e1f2ec; }
.report .scorebox .v { font-size: 30px; font-weight: 700; color: #0b6e58; }
.report .pb { page-break-before: always; }
.report .avoid { page-break-inside: avoid; }

/* ================= شاشات صغيرة ================= */
@media (max-width: 900px) {
  /* عمود واحد: نموذج الدخول أولاً حتى يظهر دون تمرير، والرسالة تحته */
  .login-grid { grid-template-columns: 1fr; }
  .login-card { position: static; order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .hero-in { gap: 8px; padding: 12px 14px; }
  .hero-in .brand { flex: 1; min-width: 0; gap: 10px; }
  .hero-in .brand > div { min-width: 0; }
  .hero-in .spacer { display: none; }
  .hero-in .btn.sm { padding: 6px 10px; }
  #logoutBtn span { display: none; }
  .hero-body { padding: 14px 16px 84px; }
  .hero-body h1 { font-size: 24px; }
  .brand-org { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root[dir="rtl"] .hero .brand-org { display: block; }
  .brand-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero .logo { padding: 4px; border-radius: 10px; }
  .hero .logo img { height: 30px; }
  .hero .logo-full { display: none; }
  .hero .logo-mark { display: block; }
  .letter p { font-size: 15px; line-height: 1.95; }
  /* داخل الخطوات والنموذج: هيدر مختصر حتى يظهر المحتوى مباشرة */
  body[data-view="compact"] .hero-body { padding: 0 16px 50px; }
  body[data-view="compact"] .hero-body > * { display: none; }
  body[data-view="compact"] .overlap { margin-top: -42px; }
  .target-card { padding: 12px 14px; }
  .target-head { gap: 10px; }
  .target-head .avatar { display: none; }
  .target-head h2 { font-size: 16px; }
  .profile { gap: 12px; }
  .avatar.lg { width: 48px; height: 48px; font-size: 20px; border-radius: 14px; }
  .ring, .ring svg { width: 64px; height: 64px; }
  .ring .lbl { font-size: 15px; }
  .card { padding: 18px; }
  .q { grid-template-columns: 1fr; padding: 14px 16px; }
  .comp-h { padding: 14px 16px; }
  .scale { justify-content: space-between; }
  .qcard { padding: 20px 16px; }
  .qc { min-height: 260px; }
  .qc-text { font-size: 18.5px; margin: 16px 0 22px; }
  .scale.big { gap: 8px; }
  .scale.big span { height: 58px; font-size: 21px; border-radius: 14px; }
  .scale label { flex: 1; }
  .scale span { width: 100%; height: 46px; }
  .kpi .val { font-size: 26px; }
  .tasks { grid-template-columns: 1fr; }
  .stp { flex-wrap: wrap; gap: 12px; }
  .stp-a { flex-basis: 100%; padding-inline-start: 58px; }
  .stp-a .btn { width: 100%; }
  .form-bar .nm { display: none; }
}
@media print {
  .no-print, .hero, .tabs { display: none !important; }
  body { background: #fff; }
}
