/* SOS Children's Villages Palestine — PMS
   Palette from brand sheet: main #009EE0, red #E74361, green #5fd47c, button #EC6981, provision #EFB828 */
:root {
  --maincolor: #009ee0;
  --mainColor: var(--maincolor);
  --mc: var(--maincolor);
  --red: #e74361;
  --btn: #ec6981;
  --provision: #efb828;
  --sub_menu_color: #feffff;
  --swiper-theme-color: #007aff;
  --redG: linear-gradient(101deg, red, darkred);
  --orangeG: linear-gradient(101deg, orange, darkorange);
  --modernG: linear-gradient(to left, #2f358a, #de244d);
  --blueG: linear-gradient(260deg, #1d5f99, #0be1e1);
  --greenG: linear-gradient(260deg, #4caf50, #0be118);
  --melonG: linear-gradient(260deg, #ea7165, #f75322);
  --torqG: radial-gradient(circle farthest-corner at 10% 20%, rgba(0,152,155,1) .1%, rgba(0,94,120,1) 94.2%);
  --redC: red;
  --orangeC: orange;
  --modernC: #de244d;
  --blueC: #0be1e1;
  --greenC: #4caf50;
  --melonC: #f75322;
  --torqC: rgba(0,152,155,1);
  --sos-blue: #009ee0;
  --sos-blue-deep: #00648f;
  --sos-sky: #e8f3f7;
  --ink: #183745;
  --ink-soft: #49616c;
  --line: #cbdce3;
  --paper: #feffff;
  --rose: #e74361;
  --rose-soft: #fdecef;
  --pink: #ec6981;
  --green: #5fd47c;
  --green-ink: #23653a;
  --amber: #efb828;
  --amber-ink: #765200;
  --grey: #8a9aa6;
  --radius-s: 4px;
  --radius-m: 8px;
  --font: "Segoe UI", "Segoe UI Web", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--sos-sky); line-height: 1.5; }
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.7; }
a { color: var(--sos-blue-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -40px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }

/* ── Header ───────────────────────────────────────── */
.top { background: var(--paper); border-bottom: 3px solid var(--sos-blue); }
.top-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--sos-blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--sos-blue); font-size: 1rem; }
.brand-text span { font-size: 0.78rem; color: var(--ink-soft); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--ink-soft); padding: 8px 12px; border-radius: var(--radius-s); font-size: 0.92rem; }
.nav a:hover { background: var(--sos-sky); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--sos-blue-deep); background: var(--sos-sky); font-weight: 600; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.who { font-size: 0.85rem; color: var(--ink-soft); text-align: end; line-height: 1.2; }
.who b { display: block; color: var(--ink); }

/* ── Layout ───────────────────────────────────────── */
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 1.2rem; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 1rem; margin: 0 0 8px; font-weight: 600; }
.lede { color: var(--ink-soft); margin: 0 0 24px; max-width: 70ch; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ── Cycle track (signature element) ──────────────── */
.cycle { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 20px 16px; margin-bottom: 24px; }
.cycle-year { font-size: 3rem; font-weight: 300; color: var(--sos-blue); line-height: 1; margin: 0 0 16px; }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: phase; }
.track li { position: relative; padding: 18px 12px 0 0; counter-increment: phase; }
html[dir="rtl"] .track li { padding: 18px 0 0 12px; }
.track li::before { content: ""; position: absolute; top: 5px; inset-inline: 0; height: 4px; background: var(--line); }
.track li::after { content: counter(phase); position: absolute; top: -4px; inset-inline-start: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); font-size: 0.72rem; display: grid; place-items: center; color: var(--ink-soft); font-weight: 600; }
.track li.done::before, .track li.now::before { background: var(--sos-blue); }
.track li.done::after { background: var(--sos-blue); border-color: var(--sos-blue); color: #fff; }
.track li.now::after { border-color: var(--sos-blue); color: var(--sos-blue-deep); box-shadow: 0 0 0 4px rgba(0, 158, 224, 0.18); }
.track b { display: block; font-size: 0.92rem; margin-top: 8px; }
.track span { font-size: 0.8rem; color: var(--ink-soft); }
@media (max-width: 640px) { .track { grid-template-columns: 1fr 1fr; row-gap: 18px; } .cycle-year { font-size: 2.2rem; } }

/* ── Buttons & inputs ─────────────────────────────── */
.btn { font: inherit; font-size: 0.92rem; border: 1px solid var(--sos-blue); background: var(--sos-blue); color: #fff; padding: 8px 16px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--sos-blue-deep); border-color: var(--sos-blue-deep); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--sos-blue-deep); }
.btn-ghost:hover { background: var(--sos-sky); color: var(--ink); }
.btn-warm { background: var(--pink); border-color: var(--pink); }
.btn-warm:hover { background: var(--rose); border-color: var(--rose); }
.btn-small { padding: 4px 10px; font-size: 0.82rem; }
.btn-ms { background: #fff; color: var(--ink); border-color: var(--line); display: inline-flex; gap: 10px; align-items: center; width: 100%; justify-content: center; }
.btn-ms:hover { background: var(--sos-sky); color: var(--ink); border-color: var(--line); }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.lang { font: inherit; font-size: 0.85rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--radius-s); padding: 6px 10px; cursor: pointer; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select {
  font: inherit; font-size: 0.95rem; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--sos-blue); outline: none; box-shadow: 0 0 0 3px rgba(0, 158, 224, 0.2); }
input[readonly], textarea[readonly] { background: #f6fafc; }
.otp { letter-spacing: 0.4em; font-size: 1.4rem !important; text-align: center; max-width: 220px; direction: ltr; }

/* ── Login ────────────────────────────────────────── */
.login-wrap { min-height: calc(100vh - 80px); display: grid; grid-template-columns: 1.1fr 1fr; max-width: 980px; margin: 0 auto; align-items: center; gap: 48px; padding: 40px 20px; }
.login-intro h1 { font-size: 2.4rem; font-weight: 300; color: var(--sos-blue); }
.login-intro p { color: var(--ink-soft); max-width: 42ch; }
.login-card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--sos-blue); border-radius: var(--radius-m); padding: 28px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 0.82rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.qr { display: block; margin: 12px auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
@media (max-width: 800px) { .login-wrap { grid-template-columns: 1fr; gap: 24px; } .login-intro h1 { font-size: 1.8rem; } }

/* ── Messages ─────────────────────────────────────── */
.msg { padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: 0.92rem; border-inline-start: 4px solid; }
.msg-error { background: var(--rose-soft); border-color: var(--rose); }
.msg-ok { background: #eafaf0; border-color: var(--green); }
.msg-warn { background: #fdf6e1; border-color: var(--amber); }
.msg-info { background: var(--sos-sky); border-color: var(--sos-blue); }
.toast { position: fixed; bottom: 20px; inset-inline-end: 20px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius-m); z-index: 50; max-width: 360px; font-size: 0.92rem; }

/* ── Status & rating chips ────────────────────────── */
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eef2f5; color: var(--ink-soft); white-space: nowrap; }
.status-draft, .status-returned, .status-not_started { background: #eef2f5; color: var(--ink-soft); }
.status-submitted, .status-coworker_submitted, .status-in_progress { background: #fdf6e1; color: var(--amber-ink); }
.status-agreed, .status-supervisor_signed, .status-midpoint_done { background: var(--sos-sky); color: var(--sos-blue-deep); }
.status-closed, .status-completed { background: #eafaf0; color: var(--green-ink); }
.status-returned { background: var(--rose-soft); color: #a3203a; }
.rate { font: inherit; font-size: 0.85rem; padding: 4px 6px; border-radius: var(--radius-s); border: 1px solid var(--line); min-width: 130px; }
.r-stopped { background: #eef2f5; }
.r-not_achieved { background: var(--rose-soft); border-color: var(--rose); }
.r-partially { background: #fdf6e1; border-color: var(--amber); }
.r-fully { background: #eafaf0; border-color: var(--green); }
.r-exceeded { background: var(--sos-sky); border-color: var(--sos-blue); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.d-stopped { background: var(--grey); } .d-not_achieved { background: var(--rose); } .d-partially { background: var(--amber); }
.d-fully { background: var(--green); } .d-exceeded { background: var(--sos-blue); }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: start; font-weight: 600; color: var(--ink-soft); font-size: 0.8rem; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td input, td textarea, td select { font-size: 0.88rem; }
td textarea { min-height: 56px; }
tr:last-child td { border-bottom: 0; }
.col-ref { width: 64px; } .col-date { width: 150px; } .col-who { width: 140px; } .col-rate { width: 150px; } .col-x { width: 40px; }
.iconbtn { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: var(--radius-s); }
.iconbtn:hover { background: var(--rose-soft); color: var(--rose); }

/* ── Stats ────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 300; color: var(--sos-blue-deep); }
.stat.alert b { color: var(--rose); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--sos-blue); }

/* ── PAT form ─────────────────────────────────────── */
.q { border-top: 1px solid var(--line); padding: 16px 0; }
.q:first-of-type { border-top: 0; }
.q-title { font-weight: 600; margin-bottom: 4px; }
.q-hint { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 8px; }
.levels { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin: 6px 0 10px; }
.levels label { padding: 6px 14px; cursor: pointer; font-size: 0.88rem; border-inline-end: 1px solid var(--line); }
.levels label:last-child { border-inline-end: 0; }
.levels input { position: absolute; opacity: 0; }
.levels label:has(input:checked) { background: var(--sos-blue); color: #fff; }
.levels label:has(input:focus-visible) { outline: 3px solid var(--amber); }
.levels.disabled label { cursor: default; }
.tag-req { color: var(--rose); font-size: 0.78rem; font-weight: 600; margin-inline-start: 6px; }

/* ── LEAD ─────────────────────────────────────────── */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.lead { background: var(--paper); border: 1px solid var(--line); border-inline-start: 4px solid var(--rose); border-radius: var(--radius-m); padding: 16px; }
.lead p { margin: 0 0 8px; font-size: 0.9rem; }
.lead ul { margin: 0; padding-inline-start: 18px; font-size: 0.86rem; color: var(--ink-soft); }
.lead em { font-size: 0.86rem; color: var(--ink-soft); }

/* ── Sticky action bar ────────────────────────────── */
.actions { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 20px; margin: 0 -20px -20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-radius: 0 0 var(--radius-m) var(--radius-m); }

.idle { position: fixed; inset: 0; background: rgba(18, 50, 74, 0.55); display: grid; place-items: center; z-index: 60; }
.idle .panel { max-width: 420px; }

@media print {
  .top, .actions, .nav, .btn, .lang, .iconbtn, .toast { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
  @page { size: A4; margin: 14mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Review fixes ─────────────────────────────────── */
main:focus, main:focus-visible { outline: none; }
a.btn { display: inline-block; text-decoration: none; }
.grid-2 { margin-bottom: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.meta-row { margin-bottom: 16px; }
td.col-what { min-width: 280px; }
td.col-ind { min-width: 200px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand img { height: 48px; }
.rate { min-width: 165px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 0 auto; width: auto; min-width: 180px; }

/* ── Mid-point & compliance dashboard ──────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 126px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sos-blue);
  border-radius: var(--radius-m);
  padding: 14px 16px;
}
.metric-card.metric-good { border-top-color: var(--green-ink); }
.metric-card.metric-alert { border-top-color: var(--rose); }
.metric-label { color: var(--ink-soft); font-size: 0.86rem; font-weight: 600; }
.metric-card strong { font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-card.metric-alert strong { color: #a3203a; }
.metric-detail { color: var(--ink-soft); font-size: 0.78rem; margin-top: auto; }
button.metric-card { width: 100%; font: inherit; color: inherit; text-align: start; cursor: pointer; }
button.metric-card:hover { border-color: var(--sos-blue-deep); box-shadow: 0 4px 16px rgba(18, 50, 74, 0.1); }
button.metric-card[aria-pressed="true"] { border-color: var(--sos-blue-deep); background: #f5fbfe; }
.metric-hint { color: var(--sos-blue-deep); font-size: 0.78rem; font-weight: 600; }
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.dashboard-charts .panel { min-width: 0; }
.progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  margin: 14px 0 5px;
}
.progress-heading strong, .progress-heading > span:last-child { font-variant-numeric: tabular-nums; }
.progress-track, .stacked-track {
  display: flex;
  height: 11px;
  background: #e8eff3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill { display: block; height: 100%; background: var(--sos-blue-deep); }
.stacked-track { height: 24px; margin: 20px 0 16px; }
.segment { display: block; height: 100%; }
.segment-complete, .legend-dot.segment-complete { background: #227eac; }
.segment-inprogress, .legend-dot.segment-inprogress { background: #6e9eae; }
.segment-pending, .legend-dot.segment-pending { background: #efb828; }
.segment-overdue, .legend-dot.segment-overdue { background: #c93e5c; }
.segment-unscheduled, .legend-dot.segment-unscheduled { background: #a8b9c2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.82rem; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.attention-panel { border-inline-start: 4px solid var(--amber); }
.attention-panel .panel-head p { margin: 4px 0 0; max-width: 65ch; }
.attention-list { display: grid; gap: 0; }
.attention-row {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.attention-row > div { flex: 1 1 280px; }
.attention-row > div > div { margin-top: 2px; }
.followup-state {
  display: inline-block;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--ink);
  padding: 3px 9px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
}
.followup-overdue { background: var(--rose-soft); color: #9b203b; }
.followup-due_soon { background: #fdf3dc; color: var(--amber-ink); }
.followup-complete { background: #eafaf0; color: var(--green-ink); }
.reminder-cell { display: inline-flex; align-items: center; gap: 8px; }
.reminder-status-label { color: var(--ink-soft); font-size: 0.82rem; white-space: nowrap; }
.reminder-icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 36px; height: 36px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--paper);
  color: var(--sos-blue-deep); cursor: pointer;
}
.reminder-icon-button:hover { background: var(--sos-sky); }
.reminder-icon-button:focus-visible { outline: 3px solid var(--sos-blue); outline-offset: 2px; }
.reminder-icon-button svg { display: block; width: 19px; height: 19px; }
.reminder-dialog {
  width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  overflow-y: auto; margin: auto; padding: 24px; border: 1px solid var(--line);
  border-radius: var(--radius-m); background: var(--paper); color: var(--ink);
  box-shadow: 0 20px 60px rgba(12, 37, 54, .22);
}
.reminder-dialog::backdrop { background: rgba(12, 37, 54, .56); }
.reminder-dialog h2 { margin-bottom: 14px; }
.reminder-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reminder-form-grid input, .reminder-form-grid select { min-width: 0; width: 100%; }
.reminder-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.table-wrap table.tracker-table { min-width: 1120px; table-layout: auto; }
.tracker-table td:first-child { min-width: 145px; }
.tracker-table td:last-child { white-space: nowrap; }
/* HR training needs: retain readable columns while letting the table wrapper scroll. */
.training-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}
.training-metrics .metric-card { min-width: 0; }
.training-metrics .metric-label { line-height: 1.45; }
.training-metrics strong { font-variant-numeric: tabular-nums; }

.table-wrap:has(> .training-summary-table),
.table-wrap:has(> .training-staff-table) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table.training-summary-table,
.table-wrap table.training-staff-table {
  width: 100%;
  table-layout: fixed;
  line-height: 1.5;
}
.table-wrap table.training-summary-table { min-width: 580px; }
.table-wrap table.training-staff-table { min-width: 1400px; }
.training-summary-table th,
.training-summary-table td,
.training-staff-table th,
.training-staff-table td {
  padding: 12px 10px;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.training-summary-table th,
.training-staff-table th {
  vertical-align: bottom;
  line-height: 1.4;
}
.training-summary-table th:first-child { width: 48%; }
.training-summary-table th:nth-child(2) { width: 16%; }
.training-summary-table th:last-child { width: 36%; }
.training-summary-table td:nth-child(2) {
  color: var(--sos-blue-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.training-staff-table th:first-child { width: 15%; }
.training-staff-table th:nth-child(2) { width: 9%; }
.training-staff-table th:nth-child(3) { width: 11%; }
.training-staff-table th:nth-child(4) { width: 22%; }
.training-staff-table th:nth-child(5) { width: 10%; }
.training-staff-table th:nth-child(6) { width: 17%; }
.training-staff-table th:nth-child(7) { width: 16%; }
.training-staff-table td:first-child strong { display: block; line-height: 1.4; }
.training-staff-table td:first-child .muted { margin-top: 3px; }
.training-summary-table td.training-response,
.training-staff-table td.training-response {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.training-actions { white-space: normal; }
.training-actions a { display: block; width: fit-content; margin-bottom: 10px; }
.training-actions .btn { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.training-detail-row[hidden] { display: none; }
.training-detail-row > td { padding: 18px; background: var(--sos-sky); }
.training-summary-table details summary {
  width: fit-content;
  color: var(--sos-blue-deep);
  font-weight: 600;
  cursor: pointer;
}
.training-summary-table details summary:hover,
.training-actions a:hover { text-decoration: underline; }
@media (max-width: 1200px) {
  .table-wrap:has(> .training-staff-table) { overflow-x: visible; }
  .table-wrap table.training-staff-table { display: block; min-width: 0; }
  .training-staff-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .training-staff-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 14px;
  }
  .training-staff-table tbody > tr {
    display: block;
    min-width: 0;
    padding: 12px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
  }
  .training-staff-table tbody > tr.training-detail-row {
    grid-column: 1 / -1;
    padding: 0;
  }
  .training-staff-table tbody > tr.training-detail-row[hidden] { display: none; }
  .training-staff-table tbody > tr > td {
    display: block;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .training-staff-table tbody > tr > td:last-child { border-bottom: 0; }
  .training-staff-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.4;
  }
  .training-staff-table .training-actions a { display: inline-block; margin: 0 12px 8px 0; }
  .training-staff-table .training-detail-row > td { padding: 18px; }
}
.training-summary-table details summary:focus-visible,
.training-actions a:focus-visible,
.training-actions button:focus-visible,
.panel:has(.training-staff-table) input[type="search"]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.training-summary-table details p {
  max-width: 38ch;
  margin: 9px 0 2px;
  color: var(--ink-soft);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.panel:has(.training-staff-table) input[type="search"] {
  display: block;
  width: min(100%, 420px);
  min-height: 44px;
  margin: 4px 0 18px;
}
html[dir="rtl"] .training-summary-table th,
html[dir="rtl"] .training-summary-table td,
html[dir="rtl"] .training-staff-table th,
html[dir="rtl"] .training-staff-table td { text-align: start; }
@media (max-width: 600px) {
  .training-metrics { margin-block: 14px 18px; }
  .training-summary-table th, .training-summary-table td,
  .training-staff-table th, .training-staff-table td { padding: 10px 8px; }
  .panel:has(.training-staff-table) input[type="search"] { width: 100%; }
}
@media print {
  .table-wrap table.training-summary-table,
  .table-wrap table.training-staff-table { min-width: 0; table-layout: fixed; }
}
@media (max-width: 520px) { .reminder-form-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .dashboard-charts { grid-template-columns: 1fr; gap: 0; }
  .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
}
.insight-metric { color: inherit; text-decoration: none; }
.insight-metric:hover { border-color: var(--sos-blue-deep); box-shadow: 0 4px 16px rgba(18, 50, 74, 0.1); }
.workflow-inbox-list { display: grid; gap: 8px; padding-inline-start: 20px; }
.workflow-inbox-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.workflow-item { border-top: 1px solid var(--line); padding: 16px 0; }
.workflow-item > :last-child { margin-bottom: 0; }
.workflow-form { margin-block: 14px; border-inline-start: 3px solid var(--sos-blue); }
.workflow-form h3 { margin-bottom: 14px; }
.workflow-evidence { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.workflow-evidence h4 { margin: 0 0 8px; font-size: .92rem; }
.workflow-evidence ul { padding-inline-start: 20px; }
.workflow-evidence a { overflow-wrap: anywhere; }
.staff-workflow-page .panel { min-width: 0; }
.staff-workflow-page .panel-head { align-items: center; }
.staff-workflow-page .status { flex: none; }
.participation-panel { margin-block: 16px; }
.participation-panel table { min-width: 760px; }
.participation-panel input, .participation-panel select { min-width: 140px; }
.participation-panel td:last-child { min-width: 160px; }
.comparison-panel { border-inline-start: 4px solid var(--sos-blue); }
@media (max-width: 600px) {
  .workflow-form { padding: 14px; }
  .workflow-inbox-list li { align-items: flex-start; }
}
/* Expired drafts remain only in memory and are visually obscured until reauthentication. */
.session-lock { backdrop-filter: blur(18px); background: rgba(13,37,54,.97); z-index: 9999; }

/* ── Responsive left navigation and fluid screens ────────────────── */
:root { --sidebar-width: 248px; --page-pad: clamp(16px, 2.2vw, 36px); }
[hidden] { display: none !important; }
body { overflow-wrap: anywhere; }
img { max-width: 100%; }
main, .panel, .cycle, .grid-2 > *, .lead-grid > *, .stats > *,
.metrics-grid > *, .dashboard-charts > *, .row > *, .filters > * { min-width: 0; }
main { width: 100%; padding-inline: var(--page-pad); }
body.signed-in main { max-width: none; width: auto; margin: 0 0 0 var(--sidebar-width); }
.top { margin-left: var(--sidebar-width); }
.top-inner { max-width: none; min-height: 76px; padding: 12px var(--page-pad); gap: 16px; }
.top-title { flex: 1; font-weight: 600; min-width: 0; }
.top-tools { flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
.who { max-width: 250px; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-width);
  z-index: 40; background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.sidebar-head { display: flex; align-items: center; gap: 8px; padding-bottom: 24px; }
.brand { min-width: 0; flex: 1; }
.brand-mark { flex-shrink: 0; }
.brand img { max-width: 48px; object-fit: contain; }
.brand-text { min-width: 0; gap: 4px; }
.brand-text strong { font-size: 0.94rem; }
.brand-text span { line-height: 1.4; }
.nav { flex: 0 0 auto; flex-direction: column; gap: 6px; }
.nav a { min-height: 44px; display: flex; align-items: center; border-inline-start: 3px solid transparent; }
.nav a[aria-current="page"] { border-inline-start-color: var(--sos-blue); }
.menu-toggle, .menu-close { display: none; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(18, 50, 74, 0.5); z-index: 35; }
.skip { z-index: 70; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.lead-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.metrics-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); }
h1 { font-size: clamp(1.4rem, 2vw, 1.9rem); }
.table-wrap { width: 100%; max-width: 100%; overscroll-behavior-x: contain; }
.table-wrap table { min-width: 600px; }
td.col-ref { min-width: 80px; }
td.col-date { min-width: 160px; }
td.col-who { min-width: 150px; }
input, textarea, select { min-width: 0; max-width: 100%; }
.filters input, .filters select { min-width: 0; max-width: 100%; }
.btn, .lang, .iconbtn { min-height: 44px; }
.iconbtn { min-width: 44px; }
.btn { white-space: normal; }
.levels { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.levels label { flex: 1 1 auto; min-height: 44px; text-align: center; }
.levels label:has(input:focus-visible) { outline-offset: -3px; }
.toast { max-width: min(360px, calc(100vw - 32px)); }
.idle { padding: 16px; overflow-y: auto; }
.idle .panel { width: 100%; }
.qr { height: auto; }
.actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5; }

@media (max-width: 1023px) {
  body.signed-in main, .top { margin-left: 0; }
  .menu-toggle, .menu-close { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .sidebar { width: min(300px, calc(100vw - 32px)); box-shadow: 8px 0 32px rgba(18, 50, 74, 0.16); }
  .sidebar-head { align-items: flex-start; }
  body.menu-open { overflow: hidden; }
  .top-inner { direction: ltr; }
  html[dir="rtl"] .top-title, html[dir="rtl"] .top-tools { direction: rtl; }
}
@media (max-width: 600px) {
  .top-inner { gap: 10px; }
  .top-title { font-size: 0.9rem; }
  .top-tools { width: 100%; gap: 8px; }
  .who { flex: 1; max-width: none; text-align: start; }
  .panel, .cycle { padding: 16px; }
  .actions { margin: 0 -16px -16px; padding-inline: 16px; }
  .actions .btn { flex: 1 1 130px; }
  .actions .spacer { display: none; }
  .actions > .small { flex-basis: 100%; }
  .filters input, .filters select { width: 100%; flex: 1 1 100%; }
  .login-wrap { padding: 16px 0; gap: 20px; min-height: auto; }
  .login-card { padding: 20px; min-width: 0; }
  input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select,
  td input, td textarea, td select { font-size: 1rem; }
}
@media print {
  .sidebar, .nav-backdrop, .menu-toggle { display: none !important; }
  body.signed-in main { margin: 0; width: 100%; padding: 0; }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0; table-layout: fixed; }
  td.col-ref, td.col-date, td.col-who, td.col-what, td.col-ind { min-width: 0; }
  th { white-space: normal; }
}

/* The paper IWDP is rendered from saved plan data, not the on-screen editor. */
.iwdp-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .iwdp-page > :not(.iwdp-print) { display: none !important; }
  .iwdp-print { display: block; color: #111; font-family: Arial, sans-serif; font-size: 9pt; line-height: 1.3; }
  html[lang="ar"] .iwdp-print { font-family: Tahoma, Arial, sans-serif; }
  .iwdp-print h1 { font-size: 16pt; margin: 0 0 10pt; }
  .iwdp-print h2 { font-size: 11pt; margin: 0 0 5pt; }
  .iwdp-print h3 { font-size: 9pt; margin: 6pt 0 3pt; }
  .iwdp-print-header, .iwdp-print-section { margin-bottom: 10pt; break-inside: avoid-page; }
  .iwdp-print-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #555; }
  .iwdp-print-info { display: flex; gap: 8pt; padding: 5pt; border: 1px solid #888; min-width: 0; }
  .iwdp-print-info strong { flex: 0 0 32%; }
  .iwdp-print-info span { white-space: pre-wrap; overflow-wrap: anywhere; }
  .iwdp-print table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .iwdp-print th, .iwdp-print td { border: 1px solid #555; padding: 4pt; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; text-align: start; }
  .iwdp-print thead { display: table-header-group; }
  .iwdp-print tr { break-inside: avoid; }
  .iwdp-print th:first-child, .iwdp-print td:first-child { width: 7%; }
  .iwdp-print th:nth-child(2), .iwdp-print td:nth-child(2) { width: 35%; }
  .iwdp-print-prose { white-space: pre-wrap; margin: 0; border: 1px solid #555; min-height: 28pt; padding: 6pt; }
  .iwdp-print-signature-grid { display: grid; grid-template-columns: 2fr 1fr 2fr 1fr; }
  .iwdp-print-signatures .iwdp-print-info { min-height: 35pt; }
  .iwdp-print-legend th:first-child, .iwdp-print-legend td:first-child { width: 16%; }
  .iwdp-print-legend th:nth-child(2), .iwdp-print-legend td:nth-child(2) { width: 42%; }
}

/* ── Performance years & live history reports ──────────────────── */
.cycles-page { max-width: 1120px; margin-inline: auto; padding-bottom: 38px; }
.cycles-eyebrow { display: block; color: var(--sos-blue-deep); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.cycles-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 12px 0 28px; padding: 8px 0 24px; border-bottom: 1px solid var(--line); }
.cycles-header h1 { font-size: clamp(2rem, 3.7vw, 3.2rem); letter-spacing: -.04em; font-weight: 650; margin: 6px 0 8px; }
.cycles-header .lede { margin: 0; max-width: 61ch; }
.cycles-total { display: flex; align-items: baseline; gap: 9px; flex: none; color: var(--ink-soft); font-size: .83rem; }
.cycles-total strong { color: var(--sos-blue-deep); font-size: 2.4rem; line-height: 1; font-weight: 550; font-variant-numeric: tabular-nums; }
.cycles-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 230px); gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; }
.cycles-toolbar label { display: grid; align-content: start; gap: 5px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.cycles-toolbar input, .cycles-toolbar select, .cycles-create input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink); padding: 8px 11px; font: inherit; font-size: .94rem; }
.cycles-toolbar input:focus-visible, .cycles-toolbar select:focus-visible, .cycles-create input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.cycles-count { color: var(--ink-soft); font-size: .83rem; margin: 16px 2px 10px; font-variant-numeric: tabular-nums; }
.cycles-list { display: grid; gap: 10px; }
.cycles-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 26px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-inline-start: 4px solid var(--sos-blue); border-radius: var(--radius-m); padding: 18px 20px; }
.cycles-item-main { display: flex; gap: clamp(16px, 3vw, 40px); align-items: center; min-width: 0; }
.cycles-item-year { flex: none; min-width: 95px; }
.cycles-item-year h2 { margin: 0; font-size: clamp(1.8rem, 2.8vw, 2.35rem); line-height: 1.15; letter-spacing: -.05em; font-weight: 550; font-variant-numeric: tabular-nums; }
.cycles-item-info { min-width: 0; }
.cycles-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.cycles-badge { display: inline-flex; align-items: center; border-radius: 99px; background: #eef2f5; color: var(--ink-soft); font-size: .74rem; font-weight: 700; padding: 3px 9px; }
.cycles-badge-active { background: #e6f7ec; color: var(--green-ink); }
.cycles-badge-frozen { background: #fff2d5; color: var(--amber-ink); }
.cycles-dates { display: flex; flex-wrap: wrap; gap: 5px 22px; margin: 0; }
.cycles-dates div { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.cycles-dates dt { color: var(--ink-soft); font-size: .8rem; }
.cycles-dates dd { margin: 0; font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.cycles-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 330px; }
.cycles-actions .btn { font-size: .8rem; min-height: 38px; padding: 6px 10px; }
.cycles-item-feedback { grid-column: 1 / -1; }
.cycles-item-feedback:empty { display: none; }
.cycles-item-feedback .msg { margin: 2px 0 0; }
.cycles-empty { padding: 44px 24px; border: 1px dashed #a7c6d8; border-radius: var(--radius-m); text-align: center; background: #f7fbfd; }
.cycles-empty h2 { color: var(--sos-blue-deep); margin-bottom: 5px; }
.cycles-empty p { color: var(--ink-soft); margin: 0; }
.cycles-report { margin: 24px 0 30px; padding: clamp(18px, 2.5vw, 28px); border: 1px solid #a9d4e8; border-top: 4px solid var(--sos-blue); border-radius: var(--radius-m); background: var(--paper); }
.cycles-report-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.cycles-report-head h2 { font-size: 1.45rem; margin: 4px 0 0; }
.cycles-report-note { max-width: 80ch; color: var(--ink-soft); font-size: .86rem; line-height: 1.6; margin: 0 0 18px; }
.cycles-report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.cycles-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 13px 15px; background: #f4f9fc; border-radius: var(--radius-s); border: 1px solid var(--line); border-top: 3px solid var(--sos-blue); }
.cycles-stat-good { border-top-color: var(--green-ink); }
.cycles-stat-alert { border-top-color: var(--rose); }
.cycles-stat > span { color: var(--ink-soft); font-size: .77rem; font-weight: 650; }
.cycles-stat strong { font-size: 1.6rem; line-height: 1.1; font-weight: 650; font-variant-numeric: tabular-nums; }
.cycles-stat small { color: var(--ink-soft); font-size: .72rem; }
.cycles-report-detail { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 22px; }
.cycles-report-detail h3 { margin-bottom: 14px; }
.cycles-location { margin: 0 0 16px; }
.cycles-location-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .83rem; }
.cycles-location-heading span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cycles-skeleton { height: 54px; margin-top: 10px; border-radius: var(--radius-s); background: #e9f2f7; animation: cycles-shimmer 1.5s ease-in-out infinite alternate; }
@keyframes cycles-shimmer { from { opacity: .48; } to { opacity: 1; } }
.cycles-create { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin-top: 30px; border-top: 3px solid var(--sos-blue); }
.cycles-create > div:first-child { flex: 1 1 240px; }
.cycles-create h2 { margin: 4px 0; }
.cycles-create p { margin: 0; }
.cycles-create label { font-size: .82rem; font-weight: 700; }
.cycles-create input { width: 130px; }
.cycles-create > div:last-child { flex-basis: 100%; }
.cycles-create > div:last-child:empty { display: none; }
html[dir="rtl"] .cycles-eyebrow { letter-spacing: 0; }
@media (max-width: 900px) {
  .cycles-item { grid-template-columns: 1fr; }
  .cycles-actions { max-width: none; justify-content: flex-start; }
  .cycles-report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cycles-header { align-items: flex-start; gap: 12px; }
  .cycles-total { flex-direction: column; align-items: end; gap: 0; text-align: end; }
  .cycles-total strong { font-size: 1.8rem; }
  .cycles-toolbar { grid-template-columns: 1fr; }
  .cycles-item { padding: 16px; }
  .cycles-item-main { align-items: flex-start; gap: 16px; }
  .cycles-item-year { min-width: 74px; }
  .cycles-dates { display: grid; }
  .cycles-actions .btn { flex: 1 1 120px; }
  .cycles-report-stats { gap: 7px; }
  .cycles-stat { padding: 11px; }
  .cycles-create input { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .cycles-skeleton { animation: none; } }

/* ── Cycle drilldown, report details and annual record ─────────────── */
.insight-metric { text-align: start; }
.insight-action { cursor: pointer; }
.insight-action:hover { border-color: var(--sos-blue-deep); box-shadow: 0 4px 16px rgba(18, 50, 74, 0.1); }
.report-drilldown { scroll-margin-top: 18px; }
.report-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.report-chart { min-width: 0; }
.report-chart h3 { margin-bottom: 14px; }
.report-chart .progress-heading { align-items: start; }
.report-chart .progress-heading > span { overflow-wrap: anywhere; }
.report-chart .progress-heading strong { text-align: end; }
.report-followups { border-top: 3px solid var(--amber); }
.jd-followup-list, .structured-training-list { display: grid; gap: 12px; }
.jd-followup-item, .structured-training-item { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fbfdff; }
.jd-followup-item h3, .structured-training-item h4 { margin: 0; }
.jd-followup-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.jd-followup-form .field { margin: 0; }
.jd-followup-form textarea { min-height: 90px; }
.jd-followup-form > button, .jd-followup-form > div { align-self: end; }
.jd-followup-editor { margin-top: 12px; }
.my-actions-list { display: grid; gap: 12px; }
.my-action-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fbfdff; }
.my-action-item .panel-head { margin: 0; }
.my-action-item h3 { margin: 0; font-size: 1rem; }
.my-action-item p { margin: 4px 0 0; }
.due-state { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 20px; background: #eef3f6; color: var(--ink-soft); font-size: .82rem; white-space: nowrap; }
.due-overdue { background: var(--rose-soft); color: #9a2840; }
.due-today { background: #fff5d9; color: var(--amber-ink); }
.due-upcoming { background: #e9f6ed; color: var(--green-ink); }
.due-complete { background: #e9f6ed; color: var(--green-ink); }
.my-team-actions { margin-top: 22px; }
.my-team-actions h3 { margin-bottom: 12px; }
.my-team-actions .table-wrap { margin-block: 10px; }
.objective-evidence-cell { min-width: 235px; max-width: 340px; }
.objective-evidence { display: grid; gap: 8px; min-width: 0; }
.objective-evidence-list { margin: 0; padding-inline-start: 20px; }
.objective-evidence-list li { margin-block: 4px; overflow-wrap: anywhere; }
.objective-evidence-list p { margin: 3px 0 0; }
.objective-evidence-form { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.objective-evidence-form .field { margin: 0; }
.objective-evidence-form textarea { min-height: 60px; }
.objective-evidence-form input, .objective-evidence-form textarea { min-width: 0; width: 100%; }
.annual-record { max-width: 1180px; margin: 0 auto; }
.annual-record-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 8px 0 18px; }
.annual-record-header .muted { margin: 7px 0 0; }
.annual-section { break-inside: avoid; }
.annual-table { min-width: 880px; }
.annual-table td { vertical-align: top; }
.annual-preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.annual-answer-list { display: grid; gap: 8px; }
.annual-answer-list section { padding: 10px 0; border-top: 1px solid var(--line); }
.annual-answer-list h3 { margin: 0 0 5px; }
.annual-answer-list p { margin: 0; }
.structured-training-control { display: grid; gap: 8px; }
.structured-training-panel { width: 100%; max-width: 760px; min-width: 0; padding-top: 8px; }
.structured-training-item p { margin: 8px 0 0; }
.structured-training-form { margin: 12px 0; padding: 14px; }
.structured-training-form .field { margin-bottom: 10px; }
.structured-training-form textarea { min-height: 75px; }

@media (max-width: 720px) {
  .report-chart-grid { grid-template-columns: 1fr; }
  .jd-followup-form { grid-template-columns: 1fr; }
  .my-action-item { grid-template-columns: 1fr; align-items: start; }
  .my-action-item .due-state { justify-self: start; }
  .objective-evidence-cell { min-width: 200px; }
  .annual-record-header { flex-direction: column; }
  .structured-training-panel { min-width: 0; }
}
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #111 !important; }
  .top, .skip, .annual-print-button, .footer, .nav, .top-tools { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  .annual-record { max-width: none; }
  .annual-record h1 { font-size: 20pt; }
  .annual-record h2 { font-size: 14pt; }
  .annual-record .panel { border: 0; border-top: 1px solid #777; border-radius: 0; padding: 10px 0; margin: 0; box-shadow: none; }
  .annual-record .table-wrap { overflow: visible; }
  .annual-table { min-width: 0; width: 100%; font-size: 8.5pt; }
  .annual-table th, .annual-table td { padding: 5px; }
  .annual-record-header, .annual-section, .annual-answer-list section { break-inside: avoid; }
  .annual-record a { color: #111; text-decoration: none; }
}

/* Quiet institutional shell: a stable physical-left rail around readable documents. */
:root { --sidebar-width: 264px; --page-pad: clamp(16px, 2.5vw, 42px); }
body { background: #edf4f5; }
body.signed-in { min-height: 100dvh; }
.top { position: sticky; top: 0; z-index: 25; background: var(--sub_menu_color); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 68px; }
.top-title { font-size: .88rem; color: var(--ink-soft); font-weight: 600; }
.top-title strong { color: var(--ink); font-size: 1rem; }
.who { border-inline-start: 1px solid var(--line); padding-inline-start: 14px; }
.sidebar { background: #f8fbfb; border-right: 1px solid #c5d9e1; box-shadow: 3px 0 18px rgba(28,69,88,.035); }
.sidebar-head { border-bottom: 1px solid var(--line); margin-bottom: 17px; padding-bottom: 18px; }
.brand-text strong { color: var(--sos-blue-deep); }
.nav { gap: 2px; }
.nav-group { margin: 14px 0 5px; padding-inline: 12px; color: var(--ink-soft); font-size: .68rem; font-weight: 750; letter-spacing: .105em; text-transform: uppercase; }
.nav a { gap: 12px; padding: 9px 12px; font-size: .89rem; font-weight: 550; border-radius: 7px; border-inline-start: 3px solid transparent; color: var(--ink); }
.nav a[aria-current="page"] { background: #dff1f7; border-inline-start-color: var(--maincolor); color: #00577e; font-weight: 750; }
.nav-icon { width: 20px; height: 20px; flex: none; display: inline-grid; place-items: center; color: var(--sos-blue-deep); }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { min-width: 0; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-collapse { display: flex; align-items: center; width: 100%; gap: 12px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: start; font: inherit; cursor: pointer; }
.sidebar-collapse:hover, .nav a:hover { background: #e6f2f6; }
.sidebar-collapse .nav-icon { font-size: 1.3rem; line-height: 1; }
body.sidebar-compact { --sidebar-width: 76px; }
body.sidebar-compact .sidebar { padding-inline: 12px; }
body.sidebar-compact .sidebar-head { justify-content: center; }
body.sidebar-compact .brand { flex: none; }
body.sidebar-compact .brand-text, body.sidebar-compact .nav-label, body.sidebar-compact .nav-group, body.sidebar-compact .sidebar-collapse-label { display: none; }
body.sidebar-compact .brand img { max-width: 40px; }
body.sidebar-compact .nav a, body.sidebar-compact .sidebar-collapse { justify-content: center; padding-inline: 8px; position: relative; }
.nav-tooltip { position: fixed; z-index: 90; pointer-events: none; max-width: calc(100vw - 16px); padding: 8px 11px; border-radius: 5px; background: var(--ink); color: var(--paper); box-shadow: 0 4px 12px rgba(24,55,69,.18); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
main { padding-block: 30px 80px; }
body.signed-in main > div { max-width: 1500px; margin-inline: auto; }
body.signed-in main > div.iwdp-page, body.signed-in main > div.pat-page { max-width: 1520px; }
.panel, .cycle, .stat, .metric-card, .lead, .login-card { box-shadow: 0 2px 12px rgba(22,68,86,.035); }
.panel { border-radius: 10px; }
h1, h2, h3 { letter-spacing: -.018em; }
h1 { color: #103e54; font-weight: 680; }
h2 { color: #194657; }
.lede { line-height: 1.7; }
.btn { background: var(--sos-blue-deep); border-color: var(--sos-blue-deep); color: var(--paper); min-height: 44px; line-height: 1.25; }
.btn:hover { background: #004e72; border-color: #004e72; }
.btn-ghost { background: transparent; color: var(--sos-blue-deep); border-color: #aacbd8; }
.btn-warm { background: #a32646; border-color: #a32646; color: var(--paper); border-inline-start: 4px solid var(--btn); }
.btn-warm:hover { background: #82203b; border-color: #82203b; }
.lang, .iconbtn, .reminder-icon-button { min-width: 44px; min-height: 44px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], input[type="number"], input[type="time"], textarea, select {
  min-height: 44px; font-size: 1rem; border-color: #b7cbd4; background: var(--paper);
}
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible { outline: 3px solid var(--amber-ink); outline-offset: 2px; box-shadow: none; }
label.field > span { color: #244c5d; }
input:is([type="email"],[type="date"],[type="time"]), .otp { direction: ltr; unicode-bidi: isolate; }
textarea, td, th, .msg, .status, .who { overflow-wrap: anywhere; }
td, th { text-align: start; }
.status { white-space: normal; line-height: 1.35; padding-block: 5px; }
.status-agreed, .status-supervisor_signed, .status-midpoint_done { color: #005b82; }
.cycle-year { color: var(--sos-blue-deep); font-variant-numeric: tabular-nums; }
.track li.done::after { background: var(--sos-blue-deep); border-color: var(--sos-blue-deep); }
.levels { overflow: visible; }
.levels label:has(input:checked) { background: #00648f; color: var(--paper); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-color: #9bb6c2 transparent; }
.table-wrap:focus-visible { outline: 3px solid var(--amber-ink); outline-offset: 2px; }
.table-wrap table { width: 100%; }
.q { min-width: 0; }
.actions { background: #f8fbfb; box-shadow: 0 -5px 16px rgba(28,69,88,.04); }
.toast { bottom: max(20px, env(safe-area-inset-bottom)); }
.idle { padding: 20px; }
.idle .panel { padding: clamp(20px, 4vw, 32px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.loading-state { display: grid; gap: 12px; max-width: 850px; padding-block: 16px; }
.loading-state span { height: 19px; border-radius: 4px; background: #dceaf0; }
.loading-state span:first-child { width: 38%; height: 28px; }
.loading-state span:nth-child(2) { width: 85%; }
.loading-state span:nth-child(3) { width: 68%; }
.error-state { max-width: 620px; }
.pat-print { display: none; }
.pat-print-button { margin: 0 0 18px; }
@media (max-width: 1023px) {
  body.sidebar-compact { --sidebar-width: 264px; }
  body.sidebar-compact .sidebar { padding-inline: 16px; overflow-x: hidden; }
  body.sidebar-compact .brand-text, body.sidebar-compact .nav-label, body.sidebar-compact .nav-group { display: revert; }
  body.sidebar-compact .nav a { justify-content: start; }
  .sidebar-foot { display: none; }
  .top { margin-left: 0; }
  .sidebar { width: min(320px, calc(100vw - 24px)); }
  .top-inner { direction: ltr; }
}
@media (max-width: 680px) {
  main { padding-block: 20px 54px; }
  .top-inner { gap: 8px; }
  .top-title { flex: 1; }
  .top-tools { width: 100%; justify-content: space-between; }
  .who { border: 0; padding: 0; max-width: 55%; }
  .panel, .cycle { padding: 16px; }
  .panel-head { align-items: start; }
  .table-wrap:has(> table.iwdp-edit-table) { overflow: visible; }
  table.iwdp-edit-table { display: block; min-width: 0; }
  .iwdp-edit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .iwdp-edit-table tbody { display: grid; gap: 12px; }
  .iwdp-edit-table tr { display: grid; gap: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f9fcfc; }
  .iwdp-edit-table td { display: block; min-width: 0; width: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .iwdp-edit-table td:last-child { border-bottom: 0; }
  .iwdp-edit-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: .8rem; font-weight: 650; }
  .iwdp-edit-table td input, .iwdp-edit-table td textarea, .iwdp-edit-table td select { width: 100%; min-width: 0; }
  .actions { position: static; margin-top: 18px; }
  .levels { width: 100%; }
  .levels label { min-width: min(100%, 105px); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-intro h1 { font-size: 1.8rem; }
  .reminder-dialog { max-height: calc(100dvh - 24px); }
}
@media print {
  .sidebar, .nav-backdrop, .top, .skip, .sidebar-foot, .toast, .idle, .ai-drafting-panel, .actions, .annual-print-button { display: none !important; }
  body.signed-in main { margin: 0; padding: 0; width: 100%; }
  body { background: #fff; }
  .panel, .cycle { box-shadow: none; break-inside: auto; }
  .pat-page textarea { border: 0; padding: 0; resize: none; overflow: visible; height: auto; min-height: 0; white-space: pre-wrap; }
  .pat-page .q { break-inside: avoid-page; }
  .pat-page .levels label { border: 0; }
  .pat-page .levels label:not(:has(input:checked)) { display: none; }
  .pat-page .levels label:has(input:checked) { color: #111; background: transparent; font-weight: bold; }
  .pat-page .levels input { display: none; }
  .pat-page > :not(.pat-print) { display: none !important; }
  .pat-page .pat-print { display: block; font-size: 10pt; line-height: 1.5; }
  .pat-print > section { padding: 7pt 0; border-top: 1px solid #777; break-inside: auto; }
  .pat-print-answer { break-inside: avoid-page; padding-block: 3pt; }
  .pat-print-stamp { font-weight: 700; }
  .pat-print-warning { border: 1px solid #777; padding: 5pt; }
  .pat-print-signatures { border-top: 1px solid #777; margin-top: 12pt !important; }
  .pat-print h1 { font-size: 17pt; }
  .pat-print h2 { font-size: 11pt; margin: 0 0 3pt; color: #111; }
  .pat-print p { margin: 2pt 0 7pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  .iwdp-print { display: block; }
}
@page { size: A4 portrait; margin: 14mm; }
@page iwdp-landscape { size: A4 landscape; margin: 12mm; }
@media print { .iwdp-print { page: iwdp-landscape; } }

/* HR/OD overview — an aggregate briefing, distinct from the staff tracker. */
.hr-overview { --hr-navy: #183f53; --hr-blue: #087da8; --hr-pale: #f2f8fa; --hr-rule: #d4e3e8; max-width: 1440px; margin-inline: auto; }
.hr-overview * { min-width: 0; }
.hr-overview-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 4px 0 24px; border-bottom: 1px solid var(--hr-rule); }
.hr-overview .hr-eyebrow { color: var(--sos-blue-deep); font-size: .75rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 7px; }
.hr-overview h1 { font-size: clamp(1.85rem, 3.2vw, 2.85rem); font-weight: 650; letter-spacing: -.035em; color: var(--hr-navy); line-height: 1.15; margin: 0; }
.hr-overview .hr-subtitle { color: var(--ink-soft); margin: 10px 0 0; max-width: 65ch; font-size: .94rem; }
.hr-cycle-stamp { display: flex; align-items: center; gap: 13px; padding: 10px 15px; background: #e0eff4; border: 1px solid #bfd8e2; border-radius: var(--radius-m); color: var(--hr-navy); }
.hr-cycle-stamp span { font-size: .76rem; color: var(--ink-soft); font-weight: 600; }
.hr-cycle-stamp strong { font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hr-meta { display: flex; flex-wrap: wrap; gap: 5px 22px; margin: 14px 0 24px; color: var(--ink-soft); font-size: .83rem; }
.hr-meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--sos-blue); border-radius: 50%; vertical-align: middle; margin-inline-end: 12px; }
.hr-lead { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: 16px; margin-bottom: 16px; }
.hr-overview .hr-hero { background: var(--hr-navy); color: #f5fafb; border-color: var(--hr-navy); padding: clamp(22px, 3vw, 36px); min-height: 238px; margin: 0; display: flex; flex-direction: column; justify-content: space-between; }
.hr-hero .hr-eyebrow { color: #8dd9f1; }
.hr-hero-main { display: flex; align-items: baseline; gap: 17px; flex-wrap: wrap; margin: 15px 0 8px; }
.hr-hero-value { font-size: clamp(3.6rem, 7vw, 6.5rem); line-height: .95; font-weight: 350; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.hr-hero-copy { color: #d0e3e8; font-size: .92rem; max-width: 26ch; }
.hr-hero .hr-track { background: #476a78; }
.hr-hero .hr-fill { background: #87d6ed; }
.hr-hero-foot { margin: 14px 0 0; color: #d0e3e8; font-size: .83rem; }
.hr-overview .hr-attention { margin: 0; padding: clamp(20px, 2.5vw, 30px); border-inline-start: 4px solid var(--rose); display: flex; flex-direction: column; }
.hr-attention h2 { color: var(--hr-navy); font-size: 1.1rem; margin: 0 0 8px; }
.hr-attention .hr-attention-count { display: block; font-size: clamp(2.8rem, 5vw, 4.3rem); line-height: 1; color: #ad3049; font-weight: 400; font-variant-numeric: tabular-nums; margin: 8px 0; }
.hr-attention p { color: var(--ink-soft); margin: 0; font-size: .88rem; }
.hr-attention-split { border-top: 1px solid var(--hr-rule); margin-top: auto; padding-top: 15px; display: flex; gap: 14px; flex-wrap: wrap; }
.hr-attention-split span { flex: 1; font-size: .79rem; color: var(--ink-soft); }
.hr-attention-split strong { display: block; font-size: 1.28rem; color: var(--hr-navy); font-variant-numeric: tabular-nums; }
.hr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.hr-kpi { background: var(--paper); border: 1px solid var(--hr-rule); border-radius: var(--radius-m); padding: 17px 19px; }
.hr-kpi span { color: var(--ink-soft); font-size: .81rem; font-weight: 600; display: block; }
.hr-kpi strong { display: block; font-size: 2rem; font-weight: 450; color: var(--hr-navy); line-height: 1.3; font-variant-numeric: tabular-nums; margin: 5px 0; }
.hr-kpi small { color: var(--ink-soft); font-size: .76rem; }
.hr-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.hr-panels .panel { padding: clamp(20px, 2.5vw, 28px); margin-bottom: 0; }
.hr-overview h2 { color: var(--hr-navy); }
.hr-chart-note { color: var(--ink-soft); font-size: .82rem; margin: -5px 0 19px; }
.hr-chart-row { margin: 0 0 19px; }
.hr-chart-label { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; margin-bottom: 8px; }
.hr-chart-label strong { color: var(--hr-navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hr-track { height: 10px; background: #e4edf0; overflow: hidden; border-radius: 20px; }
.hr-fill { display: block; height: 100%; background: var(--hr-blue); }
.hr-chart-row:last-child { margin-bottom: 0; }
.hr-distribution { display: flex; overflow: hidden; border-radius: 5px; height: 32px; background: #e4edf0; margin: 25px 0 21px; }
.hr-distribution > span { display: block; height: 100%; }
.hr-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; }
.hr-legend > div { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--hr-rule); padding: 10px 0; font-size: .81rem; }
.hr-legend dt { color: var(--ink-soft); flex: 1; }
.hr-legend dd { margin: 0; font-weight: 700; color: var(--hr-navy); font-variant-numeric: tabular-nums; }
.hr-legend i { flex: none; width: 9px; height: 9px; border-radius: 2px; }
.hr-overview .hr-note { margin: 18px 0 0; padding: 20px 24px; background: var(--hr-pale); border: 1px solid var(--hr-rule); border-radius: var(--radius-m); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.hr-note h2 { font-size: 1rem; margin: 0 0 4px; }
.hr-note p { color: var(--ink-soft); font-size: .83rem; margin: 0; max-width: 66ch; }
.hr-links { display: flex; gap: 8px; flex-wrap: wrap; }
.hr-links a { text-decoration: none; color: var(--sos-blue-deep); border: 1px solid #a8cbd9; background: var(--paper); border-radius: var(--radius-s); padding: 9px 13px; font-size: .83rem; font-weight: 650; }
.hr-links a:hover { background: #dceef4; }
.hr-empty { margin-top: 24px; border-inline-start: 4px solid var(--sos-blue); padding: 28px; }
.hr-empty p { color: var(--ink-soft); max-width: 60ch; }
html[dir="rtl"] .hr-overview .hr-eyebrow { letter-spacing: 0; text-transform: none; }
@media (max-width: 900px) { .hr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hr-lead, .hr-panels { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .hr-overview-header { align-items: start; gap: 15px; }
  .hr-meta { display: grid; gap: 3px; }
  .hr-meta span + span::before { display: none; }
  .hr-kpis { gap: 8px; }
  .hr-kpi { padding: 14px; }
  .hr-kpi strong { font-size: 1.7rem; }
  .hr-legend { grid-template-columns: 1fr; }
  .hr-overview .hr-note { padding: 17px; }
  .hr-links, .hr-links a { width: 100%; }
  .hr-links a { text-align: center; }
}
