/* ---------- גופנים (נטענים מהשרת עצמו) ---------- */
@font-face { font-family: Assistant; font-weight: 400; font-display: swap; src: url(/fonts/assistant-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Assistant; font-weight: 400; font-display: swap; src: url(/fonts/assistant-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Assistant; font-weight: 600; font-display: swap; src: url(/fonts/assistant-hebrew-600-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Assistant; font-weight: 600; font-display: swap; src: url(/fonts/assistant-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Assistant; font-weight: 700; font-display: swap; src: url(/fonts/assistant-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Assistant; font-weight: 700; font-display: swap; src: url(/fonts/assistant-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Frank; font-weight: 500; font-display: swap; src: url(/fonts/frank-ruhl-libre-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Frank; font-weight: 500; font-display: swap; src: url(/fonts/frank-ruhl-libre-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Frank; font-weight: 700; font-display: swap; src: url(/fonts/frank-ruhl-libre-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Frank; font-weight: 700; font-display: swap; src: url(/fonts/frank-ruhl-libre-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

/* ---------- ערכות צבע ---------- */
:root, [data-theme="light"] {
  --page: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #18233a;
  --muted: #5e6b82;
  --line: #dde2ea;
  --cloth: #1c2b4a;
  --cloth-ink: #e8ecf5;
  --cloth-muted: #9aa8c4;
  --gilt: #c8a248;
  --gilt-soft: rgba(200, 162, 72, .16);
  --primary: #1c2b4a;
  --primary-ink: #ffffff;
  --bad: #b4321f;
  --bad-soft: #fbe9e5;
  --good: #23683f;
  --good-soft: #e3f2ea;
  --warn: #fcefc7;
  --warn-line: #e2b93b;
  --focus: #3e6fd8;
  --shadow: 0 1px 2px rgba(24, 35, 58, .06), 0 8px 24px rgba(24, 35, 58, .06);
  color-scheme: light;
}
[data-theme="dark"] {
  --page: #0f1726;
  --surface: #172238;
  --surface-2: #1b2841;
  --ink: #e7ecf4;
  --muted: #93a0b8;
  --line: #26334d;
  --cloth: #0b1220;
  --cloth-ink: #e7ecf4;
  --cloth-muted: #7f8ca6;
  --gilt: #d4b263;
  --gilt-soft: rgba(212, 178, 99, .14);
  --primary: #d4b263;
  --primary-ink: #141c2c;
  --bad: #ef7a66;
  --bad-soft: rgba(239, 122, 102, .14);
  --good: #6cc59a;
  --good-soft: rgba(108, 197, 154, .14);
  --warn: rgba(226, 185, 59, .2);
  --warn-line: #c9a23a;
  --focus: #8fb0ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- בסיס ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 16px/1.6 Assistant, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: inherit; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- מבנה: תפריט צד + תוכן ---------- */
.shell { display: flex; min-height: 100vh; }

aside {
  width: 248px; flex: 0 0 248px;
  background: var(--cloth); color: var(--cloth-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
aside[hidden] { display: none; }
/* רצועות זהב - כמו בכריכת ספר */
.spine-band { height: 10px; margin: 0 18px; border-top: 1.5px solid var(--gilt); border-bottom: 1.5px solid var(--gilt); opacity: .9; }
.spine-band:first-child { margin-top: 22px; }
.spine-band:last-child { margin-bottom: 22px; }

.brand { padding: 22px 24px 18px; }
.brand-name { font-family: Frank, serif; font-weight: 700; font-size: 25px; color: var(--gilt); line-height: 1.2; }
.brand-sub { font-size: 13px; color: var(--cloth-muted); margin-top: 4px; }

nav { flex: 1; padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  color: var(--cloth-ink); text-decoration: none; font-weight: 600; font-size: 15px;
  position: relative;
}
nav a svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .75; }
nav a:hover { background: rgba(255, 255, 255, .06); }
nav a.active { background: var(--gilt-soft); color: #e2c06a; }
nav a.active svg { opacity: 1; }
nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--gilt); }
nav .count { margin-inline-start: auto; background: var(--gilt); color: #1c2b4a; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 8px; line-height: 20px; }

.side-foot { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.side-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; color: var(--cloth-muted); font: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 14px; border-radius: 8px; cursor: pointer; text-align: start;
}
.side-btn svg { width: 18px; height: 18px; }
.side-btn:hover { background: rgba(255, 255, 255, .06); color: var(--cloth-ink); }

main { flex: 1; min-width: 0; padding: 40px 48px 64px; max-width: 1240px; }

/* ---------- כותרת עמוד ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
h1 { font-family: Frank, serif; font-weight: 700; font-size: 34px; line-height: 1.15; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }

/* ---------- משטחים ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 20px 24px 0; }

/* פס מספרים בעמוד הראשי - שורה אחת, לא כרטיסים */
.strip { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.strip a { flex: 1; padding: 18px 22px; text-decoration: none; border-inline-start: 1px solid var(--line); }
.strip a:first-child { border-inline-start: 0; }
.strip a:hover { background: var(--surface-2); }
.strip .n { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.strip .l { color: var(--muted); font-size: 14px; margin-top: 2px; }
.strip a.hot .n { color: var(--bad); }

.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }

/* ---------- התראות ---------- */
.alert-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.alert-item:first-of-type { border-top: 0; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); margin-top: 8px; flex: 0 0 9px; }
.alert-body { flex: 1; }
.alert-actions { display: flex; gap: 6px; }
.empty { padding: 28px 0 10px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- טפסים וכפתורים ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
input, select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .15s;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input.uncertain, select.uncertain { background: var(--warn); border-color: var(--warn-line); }
input[type=file] { padding: 18px; border: 1.5px dashed var(--line); background: var(--surface-2); cursor: pointer; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: var(--primary-ink); border: 1px solid transparent;
  border-radius: 8px; padding: 10px 20px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: filter .15s;
}
button:hover { filter: brightness(1.12); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { filter: none; background: var(--surface-2); }
button.ghost { background: none; color: var(--muted); padding: 6px 10px; font-weight: 600; font-size: 14px; }
button.ghost:hover { color: var(--ink); background: var(--surface-2); filter: none; }
button.danger { background: var(--bad); color: #fff; }
button:disabled { opacity: .5; cursor: default; }

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
.row > button { flex: 0 0 auto; }
.actions { display: flex; gap: 10px; margin-top: 24px; }
.error { color: var(--bad); margin-top: 10px; min-height: 1.4em; font-weight: 600; }

/* ---------- טבלאות ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td { font-size: 15px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.total td { font-weight: 700; background: var(--surface-2); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.review { background: var(--warn); color: var(--ink); border-color: var(--warn-line); }
.badge.approved { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.failed, .badge.rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.low { color: var(--bad); font-weight: 700; }
.ok { color: var(--good); font-weight: 700; }

/* ---------- מסך אישור טופס ---------- */
.review-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.review-layout .preview { position: sticky; top: 24px; }
.review-layout iframe, .review-layout img { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #fff; display: block; }
.hint { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--warn); border: 1px solid var(--warn-line); border-radius: 8px; font-size: 14px; margin-bottom: 8px; }
.student-block { border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 18px; margin: 16px 0; background: var(--surface-2); }
.student-head { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.student-head h3 { margin: 0; font-size: 16px; }

/* ---------- כרטיס תלמיד ---------- */
.facts { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 10px; }
.facts div { color: var(--muted); font-size: 14px; }
.facts b { display: block; color: var(--ink); font-size: 18px; }

/* ---------- התחברות ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.login-side { background: var(--cloth); color: var(--cloth-ink); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side .brand-name { font-size: 44px; }
.login-side p { color: var(--cloth-muted); max-width: 34ch; font-size: 17px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form form { width: 100%; max-width: 380px; }
.login-form h1 { margin-bottom: 8px; }
.login-form button[type=submit] { width: 100%; margin-top: 24px; padding: 12px; }
main.bare { padding: 0; max-width: none; }

/* ---------- הודעה קופצת ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--page); padding: 12px 22px; border-radius: 10px; z-index: 10;
  font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

pre { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 8px; font-size: 14px; }

/* ---------- מובייל ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  aside { width: 100%; flex: none; height: auto; position: static; }
  .spine-band { display: none; }
  .brand { padding: 16px 20px 8px; }
  nav { flex-direction: row; flex-wrap: wrap; padding: 4px 10px 8px; }
  nav a { padding: 8px 10px; }
  nav a.active::before { display: none; }
  .side-foot { flex-direction: row; padding: 0 10px 10px; }
  main { padding: 24px 18px 48px; }
  .dash, .review-layout { grid-template-columns: 1fr; }
  .review-layout .preview { position: static; }
  .strip { flex-wrap: wrap; }
  .strip a { flex: 1 1 45%; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 32px; }
  h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.empty.pad { padding: 26px 24px; }
.search-row input { max-width: 420px; font-size: 16px; padding: 12px 14px; }
.page-head .actions { margin-top: 0; }
button, .btn { white-space: nowrap; }
/* הסבר מתחת לשדה צהוב */
.unsure-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 5px; padding: 5px 10px; font-size: 13px; font-weight: 600; color: #7a5a00;
  background: var(--warn); border: 1px solid var(--warn-line); border-radius: 6px; }
[data-theme="dark"] .unsure-note { color: #f1d27a; }
.link-btn { background: none; border: 0; padding: 2px 4px; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.link-btn:hover { filter: none; opacity: .8; }
.hint { justify-content: space-between; flex-wrap: wrap; }
.hint .hint-text { flex: 1; min-width: 220px; }
.ok-hint { background: var(--good-soft); border-color: transparent; color: var(--good); font-weight: 600; }
.done-btn { white-space: nowrap; }
@media (max-width: 900px) { .alert-item { flex-wrap: wrap; } .alert-actions { width: 100%; } }
/* התראות בכרטיס תלמיד */
.alert-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.alert-link:hover { text-decoration-color: var(--ink); }
.alert-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-top: 14px; background: var(--surface-2); }
.alert-card.open { border-inline-start: 4px solid var(--bad); }
.alert-card.done { border-inline-start: 4px solid var(--good); opacity: .92; }
.alert-card-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.alert-msg { font-size: 16px; font-weight: 600; margin: 8px 0 2px; }
.alert-card .actions { margin-top: 12px; }
.status-pill { font-weight: 700; font-size: 13px; padding: 1px 10px; border-radius: 999px; }
.status-pill.open { background: var(--bad-soft); color: var(--bad); }
.status-pill.done { background: var(--good-soft); color: var(--good); }
textarea { width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.strip a[href] { cursor: pointer; }
/* פעולות רגישות */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.danger-zone h2 { color: var(--bad); }
.danger-zone[hidden] { display: none; }
.admin-confirm { margin-top: 16px; padding: 4px 14px 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; }
input:disabled { opacity: .6; cursor: not-allowed; }
/* מה חסר */
.missing-list { list-style: none; margin: 0; padding: 0; }
.missing-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.missing-item:first-child { border-top: 0; }
.sev-badge { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-top: 2px; }
.sev-badge.sev-high { background: var(--bad-soft); color: var(--bad); }
.sev-badge.sev-medium { background: var(--warn); color: var(--ink); }
.sev-badge.sev-low { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.missing-body { flex: 1; }
.missing-title { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.missing-title:hover { text-decoration-color: var(--ink); }
.missing-names { color: var(--muted); font-size: 14px; margin-top: 2px; }
.missing-ok p { color: var(--good); font-weight: 600; margin: 0; }

/* ===================== נגישות ===================== */
/* דילוג לתוכן */
.skip-link { position: absolute; top: -100px; right: 16px; z-index: 100; background: var(--ink); color: var(--page);
  padding: 10px 18px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
h1:focus { outline: none; }
/* מיקוד גלוי גם על רקע התפריט הכהה */
aside :focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
tr.clickable:focus-visible td { background: var(--surface-2); }
tr.clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* כפתור ותפריט הנגישות */
.a11y-btn { position: fixed; top: 50%; left: 16px; transform: translateY(-50%); z-index: 50;
  width: 60px; height: 60px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #0b57d0; color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px #0b57d0, 0 6px 18px rgba(0,0,0,.3); }
.a11y-btn:hover { filter: brightness(1.12); }
.a11y-btn svg { width: 34px; height: 34px; }
.a11y-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.a11y-panel { position: fixed; top: 50%; left: 88px; transform: translateY(-50%); z-index: 51; width: 290px; max-width: calc(100vw - 104px);
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; padding: 16px; box-shadow: 0 12px 36px rgba(0,0,0,.3); }
.a11y-panel[hidden] { display: none; }
@media (max-width: 600px) {
  .a11y-btn { top: auto; bottom: 16px; transform: none; width: 52px; height: 52px; }
  .a11y-panel { top: auto; bottom: 80px; left: 16px; transform: none; max-width: calc(100vw - 32px); }
}
.a11y-panel h2 { font-size: 18px; margin: 0 0 12px; }
.a11y-label { font-weight: 700; display: block; margin-bottom: 6px; }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.a11y-row button { min-width: 64px; }
.a11y-row output { font-weight: 700; }
.a11y-toggle { display: flex; width: 100%; justify-content: flex-start; margin-bottom: 8px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.a11y-toggle[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.a11y-toggle[aria-pressed="true"]::before { content: "✓ "; }
.a11y-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }

/* גודל טקסט (מגדיל את כל המסך באופן יחסי) */
html.a11y-font-1 body { zoom: 1.12; }
html.a11y-font-2 body { zoom: 1.25; }
html.a11y-font-3 body { zoom: 1.4; }
/* הדגשת קישורים */
html.a11y-links a { text-decoration: underline !important; text-decoration-thickness: 2px !important; }
html.a11y-links a:not(.skip-link):not(.side-btn) { color: #0b57d0 !important; }
html.a11y-links nav a { color: inherit !important; }
/* גופן קריא */
html.a11y-readable body, html.a11y-readable h1, html.a11y-readable .brand-name, html.a11y-readable input,
html.a11y-readable button, html.a11y-readable select, html.a11y-readable textarea { font-family: Arial, "Segoe UI", sans-serif !important; letter-spacing: .02em; word-spacing: .08em; }
html.a11y-readable body { line-height: 1.8; }
/* עצירת אנימציות */
html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* ניגודיות גבוהה */
html.a11y-contrast {
  --page: #ffffff; --surface: #ffffff; --surface-2: #ffffff; --ink: #000000; --muted: #000000; --line: #000000;
  --cloth: #000000; --cloth-ink: #ffffff; --cloth-muted: #ffffff; --gilt: #ffd400; --gilt-soft: #333300;
  --primary: #000000; --primary-ink: #ffffff; --bad: #b00000; --bad-soft: #ffffff; --good: #005a00; --good-soft: #ffffff;
  --warn: #ffff66; --warn-line: #000000; --focus: #c000c0; --shadow: none; color-scheme: light;
}
html.a11y-contrast .panel, html.a11y-contrast .strip, html.a11y-contrast input, html.a11y-contrast select,
html.a11y-contrast textarea, html.a11y-contrast button.secondary, html.a11y-contrast .badge { border: 2px solid #000 !important; }
html.a11y-contrast a { text-decoration: underline; }
html.a11y-contrast .muted, html.a11y-contrast th { color: #000 !important; }

/* הצהרת נגישות */
.statement { max-width: 75ch; }
.statement h2 { margin-top: 26px; }
.statement li { margin-bottom: 6px; }
.statement-public { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
/* מסך הבית לפי קטגוריות */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cat-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; box-shadow: var(--shadow); border-top: 4px solid var(--cloth); }
.cat-box.urgent { border-top-color: var(--bad); }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-title { display: flex; align-items: center; gap: 10px; }
.cat-title svg { width: 22px; height: 22px; color: var(--muted); }
.cat-title h2 { margin: 0; font-size: 20px; }
.cat-link { font-size: 14px; font-weight: 600; color: var(--muted); }
.cat-number { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.cat-number .n { font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cat-number .l { color: var(--muted); }
.cat-missing, .cat-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cat-missing h3, .cat-section h3 { font-size: 15px; margin: 0 0 4px; color: var(--muted); }
.cat-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cat-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.cat-list li:first-child { border-top: 0; }
.alert-row { display: flex; gap: 10px; align-items: flex-start; }
.alert-row .alert-body a { color: var(--ink); }
.cat-ok { color: var(--good); font-weight: 600; margin: 14px 0 0; }
.cat-box .actions { margin-top: 14px; }
.urgent-banner { background: var(--bad-soft); color: var(--bad); border: 1px solid currentColor; border-radius: 10px; padding: 10px 16px; font-weight: 700; margin: 0 0 18px; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: 1fr; } }
/* שורות "מה חסר": בלי קו תחתון, כל השורה לחיצה */
.missing-list li { border-top: 1px solid var(--line); }
.missing-list li:first-child { border-top: 0; }
.missing-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 10px; margin: 0 -10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; }
.missing-row:hover { background: var(--surface-2); }
.missing-row:hover .row-arrow { transform: translateX(-3px); }
.missing-row .missing-body { display: flex; flex-direction: column; flex: 1; }
.missing-row .missing-title { font-weight: 700; text-decoration: none; }
.missing-row .missing-names { color: var(--muted); font-size: 14px; margin-top: 2px; }
.row-arrow { font-size: 22px; line-height: 1; color: var(--muted); align-self: center; transition: transform .15s; }
/* מה חסר - ריבוע לכל קטגוריה */
.section-title { font-size: 20px; margin: 8px 0 14px; }
.miss-section { margin-bottom: 30px; }
.miss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.miss-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); border-top: 4px solid var(--line); }
.miss-card.sev-high { border-top-color: var(--bad); }
.miss-card.sev-medium { border-top-color: var(--warn-line); }
.miss-card.sev-low { border-top-color: var(--muted); }
.miss-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.miss-head h3 { margin: 0; font-size: 17px; }
.miss-count { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 4px; color: var(--ink); text-decoration: none; }
.miss-count .n { font-size: 30px; font-weight: 700; line-height: 1; }
.sev-high .miss-count .n { color: var(--bad); }
.miss-count .l { color: var(--muted); font-size: 14px; }
.miss-people { list-style: none; margin: 8px 0 0; padding: 0; }
.miss-people li { border-top: 1px solid var(--line); }
.miss-people a { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px; margin: 0 -6px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; }
.miss-people a:hover { background: var(--surface-2); }
.miss-more { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.all-ok { background: var(--good-soft); padding: 12px 16px; border-radius: 10px; margin-bottom: 24px; }
.cat-title h3 { margin: 0; font-size: 19px; }
tr.highlight td { background: var(--warn); }

/* כפתור נגישות - קטן, בימין למטה */
.a11y-btn::after { content: "נגישות"; position: absolute; right: 58px; top: 50%; transform: translateY(-50%);
  background: #0b57d0; color: #fff; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s; }
.a11y-btn:hover::after, .a11y-btn:focus-visible::after { opacity: 1; }
/* השלמה ועריכה */
.btn, .missing-btn { text-decoration: none; }
.missing-btn { display: inline-block; background: var(--bad-soft); color: var(--bad); border: 1px solid currentColor; padding: 3px 10px; font-size: 13px; font-weight: 700; border-radius: 6px; }
.missing-btn:hover { filter: none; background: var(--bad); color: #fff; }
button.small, .btn.small { padding: 5px 12px; font-size: 14px; }
.editor { border-top: 4px solid var(--cloth); }
.editor h3 { font-size: 16px; margin: 22px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }

/* מיקום סופי של כפתור הנגישות: ימין למטה (ליד התפריט כשהוא מוצג) */
.a11y-btn { top: auto; left: auto; bottom: 18px; right: 18px; transform: none; width: 48px; height: 48px; border-width: 2px; }
.a11y-btn svg { width: 28px; height: 28px; }
.a11y-panel { top: auto; left: auto; bottom: 76px; right: 18px; transform: none; max-width: calc(100vw - 36px); }
@media (min-width: 901px) {
  body.has-sidebar .a11y-btn { right: 266px; }
  body.has-sidebar .a11y-panel { right: 266px; }
}
main { padding-bottom: 90px; }

/* השדה החסר שעליו לחצו - מודגש כדי שיהיה ברור איפה למלא */
.field-focus { outline: 3px solid var(--warn-line, #d4a72c); outline-offset: 6px; border-radius: 6px; animation: fieldPulse 1.2s ease-out 2; }
@keyframes fieldPulse { from { outline-offset: 14px; } to { outline-offset: 6px; } }
html.a11y-nomotion .field-focus { animation: none; }
@media (prefers-reduced-motion: reduce) { .field-focus { animation: none; } }

/* ---- כניסה ---- */
.org-name { margin: 4px 0 0; font-size: 14px; color: var(--good); font-weight: 700; min-height: 1.2em; }
.org-name.bad { color: var(--bad); }
.check-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.check-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.check-row label { margin: 0; font-weight: 500; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.passkey-btn { width: 100%; }
.passkey-btn svg, .offer > svg { width: 22px; height: 22px; }

/* הצעה להפעלת כניסה מהירה */
.offer { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--primary); border-radius: 10px; padding: 14px 18px; margin-bottom: 22px; }
.offer > svg { flex: none; width: 34px; height: 34px; color: var(--primary); }
.offer > div:first-of-type { flex: 1; }
.offer p { margin: 2px 0 0; }
@media (max-width: 640px) { .offer { flex-wrap: wrap; } }

.plain-list { list-style: none; padding: 0; margin: 8px 0 12px; }
.plain-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.code-box { width: 100%; font: 12px/1.5 ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; resize: vertical; }
.steps { padding-inline-start: 22px; line-height: 1.9; }
.steps li { margin-bottom: 4px; }

.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.copy-row code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; word-break: break-all; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- תיבת הודעות ---- */
.inbox .msg { border-bottom: 1px solid var(--line); }
.inbox .msg:last-child { border-bottom: 0; }
.inbox summary { display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; list-style: none; }
.inbox summary::-webkit-details-marker { display: none; }
.inbox summary:hover { background: var(--bg); }
.msg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: transparent; }
.msg.unread .msg-dot { background: var(--primary); }
.msg.unread .msg-subject { font-weight: 800; }
.msg-subject { flex: 1; }
.msg-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.msg-body { padding: 0 41px 16px 20px; }
.pre { white-space: pre-line; margin: 0 0 8px; }

.inline-edit { border: 1px solid transparent; background: transparent; padding: 6px 8px; font-weight: 700; min-width: 140px; border-radius: 6px; }
.inline-edit:hover, .inline-edit:focus { border-color: var(--line); background: var(--surface); }
.inline-edit.saved { border-color: var(--good); }
.alt-setup { margin-top: 16px; }
.alt-setup summary { cursor: pointer; color: var(--muted); }
