:root {
  --brand: #a8322d; --brand-dark: #85231f; --brand-soft: #f7e7e4;
  --teal: #1f6f78; --teal-soft: #e3f1f2;
  --ink: #241f1c; --muted: #6b625c; --line: #e6ddd6; --bg: #faf7f4; --card: #fff;
  --ok: #2f7d4f; --ok-soft: #e4f3ea; --warn: #a2561a; --warn-soft: #fbefe2; --bad: #b3261e; --bad-soft: #fbe7e6;
  --pending: #8a6a00; --pending-soft: #fdf4d6;
  --r: 14px; --shadow: 0 1px 2px rgba(36,31,28,.06), 0 4px 16px rgba(36,31,28,.05);
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Assistant, "Noto Sans Arabic", system-ui, sans-serif; line-height: 1.55; -webkit-text-size-adjust: 100%; }
body.lang-ar { font-family: "Noto Sans Arabic", Assistant, system-ui, sans-serif; }
h1 { font-size: 1.45rem; margin: .2em 0 .5em; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: .2em 0 .6em; }
h3 { font-size: 1rem; margin: 1.1em 0 .4em; color: var(--teal); }
a { color: var(--teal); }
code { background: #f1ebe6; padding: 0 .3em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid #f0a33a; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; top: -40px; right: 8px; background: var(--ink); color: #fff; padding: 6px 10px; z-index: 99; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--bad); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.boot, .loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* ---------- טפסים וכפתורים ---------- */
label { display: block; font-weight: 600; margin: .7rem 0 .25rem; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .7rem; margin-top: .25rem; min-height: 46px;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0; accent-color: var(--brand); transform: scale(1.25); }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
textarea { resize: vertical; line-height: 1.5; }
input.num { width: 6.5rem; }
input.code, .code { letter-spacing: .15em; font-weight: 700; text-transform: uppercase; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .55rem 1.1rem;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.btn.big { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.4rem; }
.btn.small { min-height: 36px; padding: .3rem .75rem; font-size: .9rem; }
.link { background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer; padding: .25rem; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; align-items: center; } .row.gap { gap: .6rem; } .row.wrap, .wrap { flex-wrap: wrap; } .between { justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .8rem; align-items: end; }
.form small.wc { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; margin-top: .2rem; }
.form small.wc.ok { color: var(--ok); }
.duration { padding: .9rem 0 .4rem; } .duration b { font-size: 1.2rem; color: var(--teal); } .duration b.bad { color: var(--bad); }
details { margin: .8rem 0; } summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: .3rem 0; }

/* ---------- כרטיסים ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 0 0 1rem; }
.card.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.cards { list-style: none; padding: 0; margin: 0; }
.cards .card { margin-bottom: .7rem; }
.act-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.act-body { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); margin: .3rem 0; flex-wrap: wrap; }
.act.returned { box-shadow: inset 4px 0 0 var(--warn), var(--shadow); }
.note { background: var(--warn-soft); border-radius: 10px; padding: .55rem .75rem; color: #6b3a10; margin: .5rem 0; }
.link-card { display: block; text-decoration: none; font-weight: 700; color: var(--brand); }
ul.plain, ul.years { list-style: none; padding: 0; margin: 0; }
ul.plain li, ul.years li { padding: .4rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
ul.years li span:first-of-type { margin-inline-start: auto; }
ul.todo { padding-inline-start: 1.2rem; margin: .3rem 0 .8rem; } ul.todo li { margin: .25rem 0; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: #eee; color: #444; white-space: nowrap; }
.chip-draft, .chip-none { background: #efebe8; color: #5c534d; }
.chip-submitted, .chip-pending_verification { background: var(--teal-soft); color: var(--teal); }
.chip-pending_review { background: var(--pending-soft); color: var(--pending); }
.chip-returned { background: var(--warn-soft); color: var(--warn); }
.chip-approved { background: var(--ok-soft); color: var(--ok); }
.chip-rejected, .chip-invalid { background: var(--bad-soft); color: var(--bad); }
.flag { display: inline-block; font-size: .78rem; background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: .05rem .45rem; margin: .1rem 0; }
.badge { background: var(--brand); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; position: absolute; top: 4px; inset-inline-end: 22%; }

/* ---------- מסגרת תלמיד ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 50%; object-fit: cover; }
.top-actions { display: flex; gap: .2rem; align-items: center; font-size: .9rem; }
.page { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6.5rem; }
.tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; padding: .45rem .2rem .55rem; color: var(--muted);
  text-decoration: none; font-size: .78rem; font-weight: 600; }
.tabs a .ico { height: 24px; display: grid; place-items: center; }
.tabs a.on { color: var(--brand); }
.tabs a.on::before { content: ""; position: absolute; top: 0; inset-inline: 25%; height: 3px; background: var(--brand); border-radius: 0 0 3px 3px; }
.hero h1 { margin-bottom: .2rem; }
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bar { height: 16px; border-radius: 999px; background: #efe8e3; overflow: hidden; display: flex; margin: .9rem 0 .7rem; }
.bar-a { background: var(--ok); } .bar-p { background: repeating-linear-gradient(45deg, #e5c34f, #e5c34f 6px, #f0d77d 6px, #f0d77d 12px); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; text-align: center; }
.stats div { background: var(--bg); border-radius: 10px; padding: .5rem .2rem; }
.stats b { display: block; font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: .78rem; color: var(--muted); }
.stats.small b { font-size: 1.1rem; }
.fab-inline { width: 100%; margin-top: 1rem; }
.sticky-actions { position: sticky; bottom: 70px; background: #fff; padding: .7rem 0 .2rem; margin-top: .6rem; }
.split { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.lane { max-height: 75vh; overflow: auto; }
.lane-item { border-inline-start: 3px solid var(--teal-soft); padding: .3rem .7rem; margin: .5rem 0; }
.lane-item p { margin: .2rem 0; } .lane-item.annual { border-color: var(--brand-soft); }
.msg.new { box-shadow: inset 4px 0 0 var(--brand), var(--shadow); }
.linkbox { direction: ltr; font-size: .85rem; margin: .5rem 0 1rem; }

/* ---------- כניסה ודפים חיצוניים ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: 1.5rem 1rem 3rem; text-align: center; }
.auth .card { text-align: start; margin-top: 1rem; }
.auth .card .btn { width: 100%; margin-top: 1rem; }
.auth-logo { width: 220px; max-width: 70%; height: auto; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: .7rem; font-size: .92rem; }
.langs { margin-top: 1rem; font-size: .92rem; }
.public { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.pub-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.pub-head .langs { margin: 0; margin-inline-start: auto; }
.pub-logo { width: 110px; height: auto; }
.vlist { list-style: none; padding: 0; } .vlist li { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.seg { display: flex; gap: .6rem; margin: .4rem 0; } .seg label { flex: 1; margin: 0; border: 1.5px solid var(--line); border-radius: 10px; padding: .55rem; display: flex; gap: .5rem; align-items: center; justify-content: center; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; background: var(--bg); padding: .8rem 1rem; border-radius: 10px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 700; }
.letter { background: #fffdf9; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0; line-height: 1.75; }
.big-msg { font-size: 1.2rem; text-align: center; padding: 2rem 1rem; }

/* ---------- רכזת ---------- */
.top.coord { padding: .5rem 1.2rem; }
.yearpick { display: flex; gap: .4rem; align-items: center; margin: 0; font-weight: 600; } .yearpick select { width: auto; min-height: 38px; margin: 0; }
.coord-wrap { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 56px); background: linear-gradient(to left, #fff 210px, var(--line) 210px, var(--line) 211px, var(--bg) 211px); }
.side { padding: 1rem .6rem; display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 56px; height: calc(100vh - 56px); }
.side a { padding: .55rem .8rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side a.on { background: var(--brand-soft); color: var(--brand); }
.page.wide { max-width: 1240px; padding: 1.2rem 1.5rem 3rem; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.tile b { font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; } .tile span { color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.tile.hot { box-shadow: inset 0 -4px 0 var(--brand), var(--shadow); } .tile.hot b { color: var(--brand); }
.cardsrow { align-items: start; gap: 1rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: start; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .82rem; color: var(--muted); font-weight: 700; background: #fbf9f7; position: sticky; top: 0; }
.tbl th .link { color: var(--muted); text-decoration: none; font-weight: 700; padding: 0; }
.tbl tr.flagged { background: #fffaf3; }
.tbl input, .tbl select { min-height: 36px; padding: .3rem .5rem; margin: 0; }
.scroll { overflow-x: auto; }
.filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 180px; margin: 0; }
.form.compact { display: flex; flex-direction: column; gap: .3rem; min-width: 220px; }
.row.compact input { margin: 0; }
.program-box { background: var(--bg); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .4rem; min-width: 240px; }
.program-box.done { background: var(--ok-soft); }
.tabs-inline { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs-inline a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.tabs-inline a.on { color: var(--brand); border-color: var(--brand); }
.reading h3 { color: var(--brand); } .reading p { line-height: 1.8; }

/* ---------- חלון קופץ והודעות ---------- */
#modal-root.open { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal-back { position: absolute; inset: 0; background: rgba(36,31,28,.45); }
.modal { position: relative; background: #fff; border-radius: var(--r); padding: 1.3rem; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal.wide { width: min(860px, 100%); }
#toast { position: fixed; bottom: 84px; inset-inline: 1rem; margin: 0 auto; max-width: 520px; z-index: 60; background: var(--ink); color: #fff;
  border-radius: 12px; padding: .8rem 1rem; text-align: center; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; } #toast.err { background: var(--bad); }

/* ---------- טלפון ---------- */
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid3 label { margin-top: .5rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .top-actions .link { padding: .2rem .3rem; }
  .coord-wrap { grid-template-columns: 1fr; }
  .coord-wrap { background: var(--bg); }
  .side { background: #fff; position: static; height: auto; flex-direction: row; overflow-x: auto; border: 0; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; }
  .page.wide { padding: 1rem; }
}
@media (min-width: 900px) { .split { grid-template-columns: 340px 1fr; } }

/* ---------- הדפסה ---------- */
.print-only { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; padding: 0; }
  body { background: #fff; font-size: 12pt; }
  .tbl th { position: static; background: #f3f3f3; }
  .cert { padding: 1.5cm; }
  .cert-head { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid var(--brand); padding-bottom: .6rem; }
  .cert-head img { width: 140px; }
  .cert h1 { text-align: center; color: var(--brand); font-size: 22pt; margin-top: 1cm; }
  .cert h2 { text-align: center; font-weight: 400; }
  .cert-lead { font-size: 13pt; line-height: 1.9; margin: 1cm 0; }
  .cert-sign { display: flex; justify-content: space-between; margin-top: 2cm; }
  .cert-foot { margin-top: 1.5cm; font-size: 9pt; color: #666; }
}

/* מספרי טלפון ות"ז לא נשברים בין שורות */
[dir="ltr"] { white-space: nowrap; unicode-bidi: isolate; }
fieldset.fb { border: 0; background: var(--bg); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; }
fieldset.fb legend { font-weight: 700; color: var(--teal); padding: 0; float: right; width: 100%; margin-bottom: .3rem; }
q { quotes: "״" "״"; }

/* אזור הורים */
.parent-cta{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;border-inline-start:4px solid var(--accent,#a8322d)}
.parent-who{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.parent-details{border:1px dashed #d9cfc4;border-radius:10px;padding:10px 12px;margin:0 0 12px}
.parent-details legend{font-weight:700;padding:0 6px}
.parent-list{list-style:none;padding:0;margin:0 0 10px}
.parent-list li{border:1px solid #eadfd3;border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#fffdfa}
.check.big{display:flex;gap:10px;align-items:flex-start;font-size:1.05rem}
.check.big input{width:22px;height:22px;margin-top:3px}
.parent-btn{width:100%;font-size:1.25rem;padding:16px}
.letter-wrap summary{cursor:pointer;color:#555;margin:6px 0}
ul.plain{list-style:none;padding:0;margin:0}ul.plain li{padding:4px 0}
.inapp-consent{border:2px solid #e9c9a6;background:#fff8ef;border-radius:12px;padding:12px;margin:8px 0}
.inapp-consent .link{display:block;margin-top:8px;background:none;border:0;color:#1f6f78;text-decoration:underline;cursor:pointer}
.filters-live input[type=search]{width:100%;font-size:1.05rem;padding:10px 12px;margin-bottom:10px}
.class-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.class-tabs .tab{border:1px solid #d9cfc4;background:#fff;border-radius:999px;padding:6px 14px;cursor:pointer;font:inherit}
.class-tabs .tab.on{background:#a8322d;color:#fff;border-color:#a8322d}
.class-group h2{margin:0 0 8px}
.coord-box{background:#f3f7f8;border:1px solid #cfe0e3;border-radius:10px;padding:10px 12px;margin:10px 0;font-size:.95rem}
.big-code{font-size:2rem;font-weight:700;letter-spacing:4px;text-align:center;direction:ltr;font-family:Consolas,monospace;border:2px solid #1F3A5F;border-radius:8px;padding:8px}
.stage-tabs{align-items:center}
