/* העיצוב של האב טיפוס, ללא שינוי. תוספות הגרסה המנוהלת בסוף הקובץ. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Heebo', 'Segoe UI', 'Assistant', Arial, sans-serif;
  background: #EEF2F4;
  color: #1F323C;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: normal;
  word-spacing: 0.05em;
  padding-block-end: 5rem;
}

.mono, code { font-family: 'IBM Plex Mono', 'Fira Code', monospace; direction: ltr; unicode-bidi: isolate; }
.wrap { max-inline-size: 1400px; margin-inline: auto; padding-inline: 1.5rem; }

/* HEADER */
header.top {
  background: #2E5468;
  background-image: linear-gradient(115deg, #24445A 0%, #2E5468 45%, #3B6580 100%);
  color: #fff; padding-block-start: 2.75rem; border-block-end: 5px solid #A4CE2C;
}
.eyebrow { font-size: 0.8125rem; font-weight: 700; color: #A4CE2C; display: flex; align-items: center; gap: 0.625rem; margin-block-end: 0.875rem; }
.eyebrow::after { content: ""; flex: 1; block-size: 1px; background: rgba(164,206,44,.35); }
h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.25; margin-block-end: 0.5rem; }
.sub { font-size: 1.125rem; font-weight: 300; color: #CBDDE7; max-inline-size: 60ch; }

.kpis { display: flex; flex-wrap: wrap; margin-block-start: 2rem; border-block-start: 1px solid rgba(255,255,255,.15); }
.kpi { padding: 0.875rem 1.125rem; flex: 1 1 130px; min-inline-size: 125px; border-inline-start: 1px solid rgba(255,255,255,.12); }
.kpi:last-child { border-inline-start: none; }
.kpi span { display: block; font-size: 0.6875rem; font-weight: 700; color: #8FB4C6; margin-block-end: 0.1875rem; }
.kpi strong { font-size: 1.375rem; font-weight: 800; font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; display: block; }
.kpi strong.warn { color: #FFC658; }
.kpi strong.bad { color: #FF9A8E; }
.kpi strong.good { color: #C3E86A; }

/* NAV */
nav { background: #24445A; position: sticky; inset-block-start: 0; z-index: 40; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
nav .wrap { display: flex; gap: 0.25rem; overflow-x: auto; align-items: center; }
nav a { color: #B4CEDC; text-decoration: none; font-size: 0.875rem; font-weight: 500; padding: 0.8125rem 0.875rem; white-space: nowrap; border-block-end: 3px solid transparent; }
nav a:hover, nav a:focus-visible { color: #fff; border-block-end-color: #A4CE2C; background: rgba(255,255,255,.05); }

/* SECTIONS */
section { margin-block-start: 2.75rem; }
.sec-head { display: flex; align-items: baseline; gap: 0.875rem; margin-block-end: 0.375rem; }
.sec-num { font-family: 'IBM Plex Mono', monospace; font-size: 0.8125rem; font-weight: 600; color: #A4CE2C; background: #2E5468; padding: 0.25rem 0.5625rem; border-radius: 3px; }
h2 { font-size: 1.6875rem; font-weight: 800; color: #24445A; }
.lead { color: #55707E; font-size: 1.0625rem; max-inline-size: 75ch; margin-block-end: 1.375rem; font-weight: 300; }

.card { background: #fff; border-radius: 10px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(36,68,90,.10), 0 8px 24px rgba(36,68,90,.05); }
.callout { border-radius: 8px; padding: 1.125rem 1.25rem; margin-block-end: 0.875rem; border-inline-start: 5px solid; font-size: 0.9375rem; }
.callout strong { display: block; margin-block-end: 0.25rem; }
.c-warn { background: #FFF6E5; border-color: #E08A1E; color: #6B4708; }
.c-info { background: #EAF2F6; border-color: #437596; color: #234456; }
.c-good { background: #F2F8E3; border-color: #7FA31E; color: #435C0C; }
.c-bad  { background: #FDEDEB; border-color: #C0392B; color: #7C2119; }

/* CONTROLS */
.ctrl { background: #fff; border-radius: 10px; padding: 1.125rem 1.25rem; box-shadow: 0 1px 3px rgba(36,68,90,.1); margin-block-end: 1rem; }
.ctrl-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-size: 0.75rem; font-weight: 700; color: #55707E; }
.field select, .field input[type=text] {
  font-family: inherit; font-size: 0.875rem; padding: 0.4375rem 0.625rem;
  border: 1.5px solid #C3D3DB; border-radius: 6px; background: #fff; color: #22343E; min-inline-size: 10rem;
}
select:focus, input:focus { outline: 3px solid #A4CE2C; outline-offset: 1px; border-color: #437596; }
.grow { flex: 1 1 12rem; }
.grow input, .grow select { inline-size: 100%; }
.btn { font-family: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer; padding: 0.5625rem 1rem; border-radius: 6px; border: 1.5px solid transparent; }
.btn-p { background: #A4CE2C; color: #24445A; }
.btn-p:hover { background: #B7DE45; }
.btn-s { background: #fff; border-color: #C3D3DB; color: #3F5B69; }
.btn-s:hover { border-color: #437596; }
.btn:focus-visible { outline: 3px solid #24445A; outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.ctrl-foot { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; margin-block-start: 0.875rem; padding-block-start: 0.875rem; border-block-start: 1px dashed #DDE6EA; }
.cnt { font-size: 0.8125rem; font-weight: 700; color: #437596; margin-inline-end: auto; }
.msg { font-size: 0.8125rem; color: #7FA31E; font-weight: 600; }
.msg.err { color: #C0392B; }

/* MATRIX */
.grp { font-size: 0.9375rem; font-weight: 800; color: #fff; background: #437596; padding: 0.5rem 1rem; border-radius: 6px; margin-block: 1.25rem 0.5rem; }
.role {
  background: #fff; border-radius: 8px; padding: 0.875rem 1.125rem; margin-block-end: 0.5rem;
  display: grid; grid-template-columns: minmax(190px, 1.1fr) 108px 90px minmax(300px, 1.6fr) 118px;
  gap: 0.875rem; align-items: start;
  box-shadow: 0 1px 2px rgba(36,68,90,.09); border-inline-start: 4px solid #C3D3DB;
}
.role.crit { border-inline-start-color: #C0392B; }
.role.high { border-inline-start-color: #E08A1E; }
.role.med  { border-inline-start-color: #437596; }
.role.low  { border-inline-start-color: #9FB4BE; }
.role h3 { font-size: 1rem; font-weight: 700; color: #22343E; line-height: 1.4; }
.role .gtag { font-size: 0.6875rem; font-weight: 700; color: #8A99A2; display: block; margin-block-start: 0.125rem; }
.mhead { display: grid; grid-template-columns: minmax(190px, 1.1fr) 108px 90px minmax(300px, 1.6fr) 118px; gap: 0.875rem; padding-inline: 1.125rem; padding-block-end: 0.375rem; font-size: 0.75rem; font-weight: 800; color: #55707E; }

.sel-crit { inline-size: 100%; font-family: inherit; font-size: 0.75rem; font-weight: 800; padding: 0.375rem 0.375rem; border-radius: 4px; border: 1.5px solid transparent; cursor: pointer; }
.sel-crit.crit { background: #FDEDEB; color: #A93226; }
.sel-crit.high { background: #FFF3E0; color: #A2610D; }
.sel-crit.med  { background: #EAF2F6; color: #2E5468; }
.sel-crit.low  { background: #EFF2F4; color: #6B7A85; }

.num { inline-size: 100%; font-family: 'IBM Plex Mono', monospace; direction: ltr; font-size: 0.9375rem; font-weight: 600; text-align: center; padding: 0.4375rem 0.25rem; border: 1.5px solid #C3D3DB; border-radius: 6px; background: #FFFDF5; color: #22343E; }

.asg { display: flex; flex-direction: column; gap: 0.375rem; }
.asg-row { display: grid; grid-template-columns: 1fr 62px 92px 28px; gap: 0.3125rem; align-items: center; }
.asg-row select, .asg-row input { font-family: inherit; font-size: 0.8125rem; padding: 0.3125rem 0.375rem; border: 1.5px solid #DCE4E8; border-radius: 5px; background: #F8FAFB; inline-size: 100%; }
.asg-row input { font-family: 'IBM Plex Mono', monospace; direction: ltr; text-align: center; font-weight: 600; }
.asg-row .del { background: #fff; border: 1.5px solid #E8D2CF; color: #C0392B; border-radius: 5px; cursor: pointer; font-size: 0.875rem; font-weight: 700; padding: 0.25rem 0; line-height: 1; }
.asg-row .del:hover { background: #FDEDEB; }
.lv3 { border-color: #A4CE2C !important; background: #F6FBEA !important; }
.lv2 { border-color: #8FBFD6 !important; background: #F1F7FA !important; }
.lv1 { border-color: #EFC98A !important; background: #FFF9EF !important; }
.asg-row.planned { border-inline-start: 3px solid #E08A1E; padding-inline-start: 0.375rem; }
.p-new { background: #FFF3E0; color: #A2610D; }
.st-sel { font-family: inherit; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.375rem; border-radius: 4px; border: 1.5px solid #DCE4E8; background: #fff; inline-size: 100%; cursor: pointer; }
.st-sel.new { background: #FFF3E0; color: #A2610D; border-color: #EFC98A; }
.st-sel.cur { background: #F2F8E3; color: #4E7011; border-color: #C7DE8E; }
.sel-nw { font-family: inherit; font-size: 0.6875rem; font-weight: 700; padding: 0.1875rem 0.3125rem; border-radius: 4px; border: 1.5px solid #DCE4E8; background: #fff; cursor: pointer; margin-block-start: 0.3125rem; }
.sel-nw.nw1 { background: #FFF3E0; color: #A2610D; border-color: #EFC98A; }
.sel-nw.nw0 { background: #F2F8E3; color: #4E7011; border-color: #C7DE8E; }
.role h3 .pill { margin-inline-start: 0.375rem; vertical-align: middle; }
.planned-note { font-size: 0.6875rem; color: #A2610D; font-weight: 700; display: block; margin-block-start: 0.1875rem; }
.supn { color: #A2610D; }
.add { align-self: flex-start; background: #fff; border: 1.5px dashed #B7C7D0; color: #437596; border-radius: 6px; font-family: inherit; font-size: 0.75rem; font-weight: 700; padding: 0.3125rem 0.75rem; cursor: pointer; }
.add:hover { border-color: #437596; background: #F4F9FB; }
.empty-a { font-size: 0.8125rem; color: #B04A3E; font-weight: 600; }

.stat { text-align: center; }
.stat b { display: block; font-size: 0.75rem; font-weight: 800; padding: 0.3125rem 0.375rem; border-radius: 4px; }
.stat .fte { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; font-size: 0.8125rem; font-weight: 700; color: #3F5B69; display: block; margin-block-start: 0.25rem; }
.stat .gapn { font-size: 0.75rem; font-weight: 700; display: block; margin-block-start: 0.125rem; }
.k0 { background: #FDEDEB; color: #A93226; }
.k1 { background: #FFF3E0; color: #A2610D; }
.k2 { background: #F2F8E3; color: #4E7011; }
.neg { color: #C0392B; }
.pos { color: #4E7011; }

/* TABLES */
table { inline-size: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(36,68,90,.1); }
thead th { background: #2E5468; color: #fff; font-size: 0.8125rem; font-weight: 700; text-align: start; padding: 0.75rem 0.875rem; }
tbody td { padding: 0.6875rem 0.875rem; border-block-end: 1px solid #E7EDF0; font-size: 0.875rem; vertical-align: middle; }
tbody tr:last-child td { border-block-end: none; }
tbody tr:nth-child(even) { background: #F8FAFB; }
td.n { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; font-weight: 600; }
.pill { font-size: 0.6875rem; font-weight: 800; padding: 0.1875rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.p-over { background: #FDEDEB; color: #A93226; }
.p-ok { background: #F2F8E3; color: #4E7011; }
.p-free { background: #FFF3E0; color: #A2610D; }
.p-none { background: #EFF2F4; color: #6B7A85; }
.bar { block-size: 8px; background: #E3EAEE; border-radius: 20px; overflow: hidden; min-inline-size: 90px; }
.bar i { display: block; block-size: 100%; border-radius: 20px; }

.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.rec { background: #fff; border-radius: 9px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(36,68,90,.1); border-block-start: 4px solid #437596; }
.rec.urgent { border-block-start-color: #C0392B; }
.rec.soon { border-block-start-color: #E08A1E; }
.rec h4 { font-size: 1.0625rem; font-weight: 800; color: #24445A; margin-block-end: 0.5rem; }
.rec ul { list-style: none; }
.rec li { font-size: 0.875rem; padding-block: 0.4375rem; border-block-end: 1px dashed #E3EAEE; display: flex; gap: 0.5rem; }
.rec li:last-child { border-block-end: none; }
.rec li::before { content: "▸"; color: #A4CE2C; font-weight: 700; flex-shrink: 0; }
.rec li b { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; }

footer { margin-block-start: 3.375rem; background: #24445A; color: #A9C4D2; padding-block: 1.625rem; font-size: 0.8125rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
footer b { color: #fff; }

/* ==================================================================
   תוספות הגרסה המנוהלת: זהות משתמש, חיווי ריענון, הודעת טיוטה, יומן
   ================================================================== */

/* זהות המשתמש בסרגל הניווט */
.navspace { flex: 1; }
.whoami {
  display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  font-size: 0.75rem; font-weight: 700; color: #B4CEDC; padding-inline: 0.75rem;
}
.whoami .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: #A4CE2C; flex-shrink: 0; }
.whoami.stale .dot { background: #E08A1E; }
.whoami.down .dot { background: #C0392B; }
.whoami .mail { color: #fff; }
.whoami .sync { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; color: #8FB4C6; font-weight: 500; }
.whoami .devtag { background: #E08A1E; color: #3A2400; border-radius: 3px; padding: 0 0.3125rem; font-size: 0.6875rem; }

/* הודעת טיוטה שניתן לסגור */
.notice {
  position: relative; margin-block-start: 1.5rem;
  background: #FFF6E5; border-inline-start: 5px solid #E08A1E; color: #6B4708;
  border-radius: 8px; padding: 1.125rem 3rem 1.125rem 1.25rem; font-size: 0.9375rem;
  box-shadow: 0 1px 3px rgba(36,68,90,.1);
}
.notice strong { display: block; margin-block-end: 0.25rem; }
.notice ul { margin: 0.375rem 0 0; padding-inline-start: 1.25rem; }
.notice li { font-size: 0.875rem; }
.notice .x {
  position: absolute; inset-block-start: 0.625rem; inset-inline-start: 0.625rem;
  background: none; border: 1.5px solid #E0BE8E; color: #6B4708; border-radius: 5px;
  inline-size: 1.75rem; block-size: 1.75rem; font-size: 1rem; font-weight: 700;
  cursor: pointer; line-height: 1; font-family: inherit;
}
.notice .x:hover { background: #F7E6C8; }

/* מצבי טעינה וכתיבה */
.role.busy { opacity: .55; pointer-events: none; }
#matrix.loading, #people.loading { opacity: .5; }
.loadbox { background: #fff; border-radius: 8px; padding: 2rem; text-align: center; color: #55707E; font-weight: 600; box-shadow: 0 1px 3px rgba(36,68,90,.1); }
.errbox { background: #FDEDEB; border-inline-start: 5px solid #C0392B; color: #7C2119; border-radius: 8px; padding: 1.125rem 1.25rem; font-weight: 600; }

/* מסך כניסה */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: #24445A;
  background-image: linear-gradient(115deg, #1D3849 0%, #2E5468 55%, #3B6580 100%);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.gate-box {
  background: #fff; border-radius: 12px; padding: 2rem; inline-size: min(26rem, 100%);
  box-shadow: 0 10px 40px rgba(0,0,0,.3); border-block-start: 5px solid #A4CE2C;
  display: flex; flex-direction: column;
}
.gate-box h2 { font-size: 1.375rem; margin-block-end: 0.375rem; }
.gate-box p { font-size: 0.875rem; color: #55707E; margin-block-end: 1.25rem; line-height: 1.6; }
.gate-box label { font-size: 0.75rem; font-weight: 700; color: #55707E; margin-block-end: 0.25rem; }
.gate-box input {
  font-family: inherit; font-size: 0.9375rem; padding: 0.5625rem 0.75rem;
  border: 1.5px solid #C3D3DB; border-radius: 6px; margin-block-end: 1rem; inline-size: 100%;
}
.gate-box .btn { inline-size: 100%; padding-block: 0.6875rem; font-size: 0.9375rem; }
.gate-msg { font-size: 0.8125rem; font-weight: 600; color: #C0392B; min-block-size: 1.25rem; margin-block-start: 0.625rem; text-align: center; }

.navout {
  background: none; border: 1.5px solid rgba(255,255,255,.25); color: #B4CEDC;
  border-radius: 5px; font-family: inherit; font-size: 0.6875rem; font-weight: 700;
  padding: 0.125rem 0.5rem; cursor: pointer; margin-inline-start: 0.5rem;
}
.navout:hover { border-color: #A4CE2C; color: #fff; }

/* יומן שינויים */
.audit-act { font-size: 0.6875rem; font-weight: 800; padding: 0.1875rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.a-create { background: #F2F8E3; color: #4E7011; }
.a-update { background: #EAF2F6; color: #2E5468; }
.a-delete { background: #FDEDEB; color: #A93226; }
.audit-val { font-size: 0.8125rem; }
.audit-val .from { color: #8A99A2; text-decoration: line-through; }
.audit-val .to { font-weight: 700; color: #22343E; }
td.when { font-family: 'IBM Plex Mono', monospace; direction: ltr; unicode-bidi: isolate; font-size: 0.75rem; color: #55707E; white-space: nowrap; }
td.who { font-size: 0.8125rem; color: #3F5B69; direction: ltr; unicode-bidi: plaintext; }

@media (max-width: 1180px) {
  .mhead { display: none; }
  .role { grid-template-columns: 1fr 1fr; }
  .role > div:first-child { grid-column: 1 / -1; }
  .role .asg { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  h1 { font-size: 1.75rem; }
  .role { grid-template-columns: 1fr; }
  .asg-row { grid-template-columns: 1fr 54px 84px 26px; }
  thead { display: none; }
  tbody td { display: block; border-block-end: none; padding: 0.375rem 0.875rem; }
  tbody tr { display: block; border-block-end: 2px solid #E7EDF0; padding-block: 0.625rem; }
  .whoami { font-size: 0.6875rem; padding-inline: 0.5rem; }
  .whoami .sync { display: none; }
}
@media print {
  body { background: #fff; }
  nav, .ctrl, .add, .del, .notice { display: none; }
  section, .card, .role, table, .rec { break-inside: avoid; box-shadow: none; }
  header.top { background: #2E5468 !important; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
