/* ==========================================================================
   בירנהאק זכויות — עיצוב
   כחול-לילה בסרגל, זהב לסימון בלבד, כחול לפעולה. אדום = באיחור / בפיגור, ענבר = בקרוב. צבע חדש — רק דרך המשתנים כאן.
   ========================================================================== */
:root {
  --paper: #f5f3ee;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #687080;
  --line: #e3e0d8;
  --line-2: #efede7;
  --brand: #1b2b4a;
  --brand-2: #26395f;
  --gold: #e6b450;
  --pri: #2457a6;
  --pri-h: #1c478a;
  --pri-bg: #e9f0fb;
  --ok: #17734c;
  --ok-bg: #e6f4ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #9a5a06;
  --warn-bg: #fcf1df;
  --vio: #6a3fb0;
  --vio-bg: #f1ebfa;
  --grey: #767c84;
  --grey-bg: #eeeeec;
  --wa: #128c4a;
  --r: 12px;
  --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 2px 8px rgba(20, 28, 45, .05);
  --font: "Segoe UI", "Rubik", "Assistant", "Arial Hebrew", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
body.has-modal { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pri); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.over { color: var(--bad); }

/* ---------------- כפתורים ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s; }
.btn:hover { border-color: #cdc9bd; background: #faf9f6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-h); border-color: var(--pri-h); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #f0c4bf; }
.btn.wa { color: var(--wa); border-color: #b8e0c8; }
.btn.sm { min-height: 32px; padding: 3px 10px; font-size: 13.5px; }
.btn.big { min-height: 46px; font-size: 16px; width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--pri); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: inherit; }
.x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.x:hover { background: var(--line-2); color: var(--ink); }
:focus-visible { outline: 3px solid rgba(36, 87, 166, .35); outline-offset: 1px; }

/* ---------------- סרגל עליון ---------------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 8px 20px; background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; white-space: nowrap; color: #fff; text-decoration: none; }
.brand img { border-radius: 8px; }
.brand b { color: var(--gold); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab { color: rgba(255, 255, 255, .78); padding: 8px 14px; border-radius: 9px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.tab:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tab.on { color: var(--brand); background: var(--gold); }
.cnt { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.who { display: flex; align-items: center; gap: 10px; }
.who .btn.new { background: var(--gold); color: var(--brand); border-color: var(--gold); }
.me { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; border-radius: 9px; padding: 6px 12px; cursor: pointer; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 1320px; margin: 0 auto; padding: 18px 20px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 2px 14px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 2px 0 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 10px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin: 0 2px 8px; }
.crumbs a { color: var(--muted); }

/* ---------------- מדדים ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); cursor: pointer; text-align: start; transition: border-color .15s, transform .1s; }
.kpi:not(.flat):hover { border-color: var(--pri); transform: translateY(-1px); }
.kpi.flat { cursor: default; }
.kpi b { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi.k-task.hot, .kpi.k-app.hot, .kpi.k-late.hot { background: var(--bad-bg); border-color: #f2c2bc; }
.kpi.k-task.hot b, .kpi.k-app.hot b, .kpi.k-late.hot b { color: var(--bad); }
.kpi.k-com.hot { background: var(--warn-bg); border-color: #efd5a8; }
.kpi.k-com.hot b { color: var(--warn); }
.kpi.k-money b { color: var(--ok); }
.kpi.k-ok b { color: var(--ok); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.page-head .pills { margin: 0; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 5px 13px; cursor: pointer; font-weight: 600; font-size: 14px; }
.pill:hover { border-color: #cdc9bd; }
.pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill.sm { padding: 3px 10px; font-size: 13px; }
.pill.ghost { color: var(--muted); }
.pill-sel { border-radius: 20px; min-height: 34px; padding: 3px 10px; font-size: 14px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.warn { background: var(--warn-bg); border: 1px solid #efd5a8; color: #6b3f04; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.warn-i { color: var(--warn); font-weight: 700; }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 10px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty b { color: var(--ink); font-size: 17px; }

/* ---------------- היום: קטעי התראות ---------------- */
.sec { margin: 0 0 12px; }
details.sec { padding: 10px 14px; }
.sec h2, .sec summary h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 8px; flex-wrap: wrap; }
.sec .n, .box .n { background: var(--line-2); border-radius: 10px; padding: 0 9px; font-size: 13px; color: var(--muted); font-weight: 700; }
details.sec summary { cursor: pointer; list-style: none; }
details.sec summary::-webkit-details-marker { display: none; }
details.sec summary h2 { margin: 0; }
details.sec summary h2::before { content: "◂"; font-size: 12px; color: var(--muted); transition: transform .15s; }
details.sec[open] summary h2::before { transform: rotate(-90deg); }
details.sec[open] summary { margin-bottom: 8px; }
.s-task h2, .s-app h2 { color: var(--bad); }
.s-com h2 { color: var(--warn); }
.s-money h2 { color: var(--ok); }
.als { list-style: none; margin: 0; padding: 0; }
.al { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "chk main side" "chk meta side"; gap: 0 10px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line-2);
  border-inline-start: 3px solid transparent; cursor: pointer; }
.al:first-child { border-top: 0; }
.al:hover { background: #faf9f6; }
.al.over { border-inline-start-color: var(--bad); }
.al.today { border-inline-start-color: var(--pri); }
.al .tchk { grid-area: chk; }
.al-main { grid-area: main; min-width: 0; }
.al-side { grid-area: side; text-align: end; }
.al-meta { grid-area: meta; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.when { font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.when.over { color: var(--bad); }
.when.soon { color: var(--warn); }
.when.money { color: var(--ok); font-size: 15px; }

/* ---------------- תגיות ---------------- */
.st, .rs, .fs, .grp { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st-lead, .st-docs { background: var(--vio-bg); color: var(--vio); }
.st-filed, .st-committee { background: var(--pri-bg); color: var(--pri); }
.st-decision, .st-appeal { background: var(--warn-bg); color: var(--warn); }
.st-won { background: var(--ok-bg); color: var(--ok); }
.st-paid { background: var(--ok); color: #fff; }
.st-closed { background: var(--grey-bg); color: var(--grey); }
.st-lost { background: var(--grey-bg); color: var(--bad); }
.rs-approved { background: var(--ok-bg); color: var(--ok); }
.rs-partial { background: var(--warn-bg); color: var(--warn); }
.rs-rejected { background: var(--bad-bg); color: var(--bad); }
.fs-open { background: var(--pri-bg); color: var(--pri); }
.fs-late { background: var(--bad); color: #fff; }
.fs-paid { background: var(--ok-bg); color: var(--ok); }
.fs-over { background: var(--warn-bg); color: var(--warn); }
.fs-wait, .fs-none, .fs-nofee { background: var(--grey-bg); color: var(--grey); }
.grp { font-size: 13px; vertical-align: middle; }
.grp-adult { background: var(--pri-bg); color: var(--pri); }
.grp-child { background: var(--vio-bg); color: var(--vio); }

/* ---------------- סינון וטבלאות ---------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters .pills { margin: 0; }
input, select, textarea { border: 1px solid #d6d2c6; border-radius: 9px; padding: 7px 10px; background: #fff; min-height: 38px; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); outline: none; box-shadow: 0 0 0 3px rgba(36, 87, 166, .15); }
.dt { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.listbar { margin: 0 2px 8px; font-size: 13.5px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
thead th { background: #faf9f6; font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr[data-go] { cursor: pointer; }
tbody tr[data-go]:hover td { background: #faf9f6; }
td .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.num-c { font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.phone { font-weight: 700; text-decoration: none; direction: ltr; unicode-bidi: isolate; color: var(--ink); }
.phone:hover { color: var(--pri); text-decoration: underline; }
table.mini th, table.mini td { padding: 6px 8px; font-size: 13.5px; }
table.rt td.nm { white-space: nowrap; }
tr.off td { color: var(--muted); }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 7px; }
.bar i { display: block; height: 100%; width: 0; background: var(--pri); border-radius: 4px; }
.barcol { width: 30%; }
.rep-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rep-two > .box { margin-bottom: 0; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.cv { font-size: 10.5px; color: var(--muted); height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cb { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.cb i { display: block; width: 100%; height: 0; background: var(--pri); border-radius: 4px 4px 0 0; min-height: 1px; }
.cl { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------------- דף לקוח / תיק ---------------- */
.head-card { padding: 16px 18px; margin-bottom: 14px; }
.hc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hc-top h1 { margin: 0; font-size: 24px; }
.hc-sub { color: var(--muted); margin-top: 2px; }
.hc-sub a { color: var(--ink); }
.hc-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.hc-acts .btn.pri span { direction: ltr; unicode-bidi: isolate; }
.dt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin-top: 12px; }
.dt-i { display: flex; flex-direction: column; min-width: 0; }
.dt-i span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dt-i b { font-weight: 600; overflow-wrap: anywhere; }
.note-box { white-space: pre-wrap; background: #fbfaf6; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.sec > h2 { margin-top: 6px; }
.kcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; text-decoration: none; color: var(--ink); border-inline-start: 4px solid var(--line); }
.kcard:hover { border-color: var(--pri); }
.kc-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.kc-top b { font-size: 16px; }
.kc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kc-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.miss { color: var(--warn); font-weight: 700; }
.st-b-lead, .st-b-docs { border-inline-start-color: var(--vio); }
.st-b-filed, .st-b-committee { border-inline-start-color: var(--pri); }
.st-b-decision, .st-b-appeal { border-inline-start-color: var(--warn); }
.st-b-won, .st-b-paid { border-inline-start-color: var(--ok); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.box { padding: 14px 16px; margin-bottom: 14px; }
.box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; flex-wrap: wrap; }
.box h3 small { color: var(--muted); font-weight: 600; font-size: 13px; }
.box h4 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 14px 0 0; padding: 0; }
.steps li button, .steps li span { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.steps li span { cursor: default; }
.steps li.done button, .steps li.done span { background: var(--line-2); color: var(--ink); }
.steps li.done button::before, .steps li.done span::before { content: "✓ "; color: var(--ok); }
.steps li.on button, .steps li.on span { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li button:hover { border-color: var(--pri); }
.fee .plan-name { font-weight: 700; margin: 0 0 2px; }
.fee .terms { margin: 0 0 8px; }
.fee-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.fee-nums > div { background: #fbfaf6; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.fee-nums span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fee-nums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.fee-nums .due b { color: var(--pri); }
.fee-nums .over b { color: var(--warn); }
.fee-nums .late { background: var(--bad-bg); border-color: #f2c2bc; }
.fee-nums .late b { color: var(--bad); }
.fee-nums .est b { color: var(--muted); }
.calc { font-variant-numeric: tabular-nums; }
.collect-line { margin: 6px 0; font-size: 14px; }
.sched summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); margin: 8px 0 4px; }
tr.sc-paid td { color: var(--ok); }
tr.sc-late td { color: var(--bad); font-weight: 700; }
tr.sc-part td { color: var(--warn); }
.fee-prev { min-height: 1.5em; margin: 10px 0 0; font-size: 14.5px; }
.hist { list-style: none; margin: 8px 0 0; padding: 0; max-height: 420px; overflow-y: auto; border-inline-start: 2px solid var(--line); }
.hist li { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; position: relative; }
.hist li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--pri); }
.h-who { font-size: 12.5px; color: var(--muted); }
.h-t { white-space: pre-wrap; }
.h-c { font-size: 13px; }
.note-f { display: flex; gap: 8px; align-items: flex-end; }
.note-f textarea { flex: 1; resize: vertical; }

/* ---------------- מסמכים ---------------- */
.docs-sec.drag { outline: 3px dashed var(--pri); outline-offset: -6px; background: var(--pri-bg); }
.req { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.req li { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.req li.ok { background: var(--ok-bg); color: var(--ok); }
.req li.no { background: var(--warn-bg); color: var(--warn); }
.docs { list-style: none; margin: 0; padding: 0; }
.docs li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "open act" "meta act"; gap: 0 8px; padding: 7px 0; border-top: 1px solid var(--line-2); }
.docs li:first-child { border-top: 0; }
.doc-open { grid-area: open; display: flex; gap: 8px; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; text-align: start; min-width: 0; }
.doc-open:hover .dn b { color: var(--pri); text-decoration: underline; }
.di { font-size: 20px; }
.dn { display: flex; flex-direction: column; min-width: 0; }
.dn small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.dm { grid-area: meta; font-size: 12.5px; padding-inline-start: 28px; }
.da { grid-area: act; align-self: center; }
.up-files { margin: 0; padding-inline-start: 18px; font-size: 13.5px; }
.doc-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.doc-img { text-align: center; background: #f2f1ec; border-radius: 10px; padding: 8px; }
.doc-img img { max-width: 100%; max-height: 72vh; }

/* ---------------- משימות ---------------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.tasks li:first-child { border-top: 0; }
.tasks li.done .t-title { text-decoration: line-through; color: var(--muted); }
.tasks li.over .when { color: var(--bad); }
.t-main { flex: 1; min-width: 0; }
.t-title { background: none; border: 0; padding: 0; font-weight: 700; text-align: start; cursor: pointer; color: var(--ink); }
button.t-title:hover { color: var(--pri); text-decoration: underline; }
.t-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.t-note { color: var(--muted); white-space: pre-wrap; flex-basis: 100%; }
.tchk { position: relative; display: inline-flex; cursor: pointer; padding-top: 2px; }
.tchk input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.tchk span { width: 22px; height: 22px; border: 2px solid #c2bdb0; border-radius: 6px; background: #fff; display: inline-block; }
.tchk input:checked + span { background: var(--ok); border-color: var(--ok); }
.tchk input:checked + span::after { content: "✓"; color: #fff; display: block; text-align: center; line-height: 18px; font-weight: 800; }
.tchk input:focus-visible + span { outline: 3px solid rgba(36, 87, 166, .35); }
.tchk input:disabled + span { opacity: .5; }
.s-over h2 { color: var(--bad); }
.s-today h2 { color: var(--pri); }
.s-none h2 { color: var(--muted); }

/* ---------------- חלונות ---------------- */
.ov { position: fixed; inset: 0; z-index: 50; background: rgba(15, 24, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .15s ease-out; }
.modal { width: 100%; max-width: 560px; background: var(--card); border-radius: 16px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: rise .18s ease-out; }
.modal.wide { max-width: 820px; }
.modal.xwide { max-width: 1100px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: .6; } }
.m-head { position: relative; padding-inline-end: 34px; margin-bottom: 12px; }
.m-head h3 { margin: 0; font-size: 20px; }
.m-sub { color: var(--muted); font-size: 13.5px; }
.m-head .x { position: absolute; top: -4px; inset-inline-end: -8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 700; color: #3a4252; margin-bottom: 6px; }
.f em { color: var(--bad); font-style: normal; }
.f small { font-weight: 400; }
.f.wide, .grid > .wide, .grid > fieldset.wide { grid-column: 1 / -1; }
.f input, .f select, .f textarea { font-weight: 400; font-size: 15px; color: var(--ink); }
.lbl { display: block; }
.qd { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; background: #fff; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid rgba(36, 87, 166, .35); }
.chk { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer; font-weight: 600; }
.chk input { min-height: 0; width: 18px; height: 18px; accent-color: var(--pri); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 6px; margin: 6px 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.m-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
table.fp input { min-height: 34px; padding: 4px 8px; width: 100%; }
.perms { padding: 8px 12px 10px; }
.perms .tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; font-size: 13.5px; }
.perm-t { width: 100%; }
.perm-t th { font-weight: 700; font-size: 14px; color: var(--ink); padding: 7px 0; width: 40%; vertical-align: middle; background: none; white-space: normal; }
.perm-t th small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.perm-t td { padding: 7px 0; vertical-align: middle; }
.perm-t tr + tr th, .perm-t tr + tr td { border-top: 1px solid var(--line-2); }
.seg.pm span { padding: 4px 12px; font-size: 13.5px; }
td.perm-sum { font-size: 13px; color: var(--muted); max-width: 340px; }

/* ---------------- הגדרות ---------------- */
.lists ul { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; max-height: 320px; overflow-y: auto; }
.lists li { display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-bottom: 1px solid var(--line-2); }
.lists li:last-child { border-bottom: 0; }
.lists li span { flex: 1; font-weight: 600; }
.lists h4 { margin: 0 0 6px; }
.lists .row input { flex: 1; }
.mv { background: none; border: 0; color: #b0ab9e; cursor: pointer; font-size: 11px; padding: 4px; }
.mv:hover { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pchk { cursor: pointer; position: relative; }
.pchk input { position: absolute; opacity: 0; pointer-events: none; }
.pchk span { display: inline-block; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; }
.pchk input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pchk input:checked + span::before { content: "✓ "; color: var(--gold); }
.pchk input:focus-visible + span { outline: 3px solid rgba(36, 87, 166, .35); }
table.plans td { padding: 5px 4px; vertical-align: middle; }
table.plans input, table.plans select { min-height: 34px; padding: 4px 6px; font-size: 13.5px; }
table.plans td:first-child input { min-width: 210px; }
.n-in { width: 78px; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 14px 0 6px; }

/* ---------------- הודעה קופצת ---------------- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 80; background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-weight: 600; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; white-space: pre-line; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--bad); }

/* ---------------- כניסה ---------------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 80% -10%, #2f4a7a 0%, transparent 60%), var(--brand); }
.login-box { width: 100%; max-width: 380px; padding: 28px 26px; text-align: center; }
.login-box img { border-radius: 14px; }
.login-box h1 { margin: 10px 0 2px; font-size: 25px; font-weight: 600; }
.login-box h1 b { color: var(--brand); font-weight: 800; }
.login-box > p { margin: 0 0 18px; }
.login-box .f { text-align: start; }
.err { color: var(--bad); font-weight: 600; min-height: 1.5em; margin: 10px 0 0; }

/* ---------------- מסך בינוני / טלפון ---------------- */
@media (max-width: 1000px) {
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .who .btn.new { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tab { padding: 6px 11px; }
  main { padding: 12px 12px 80px; }
  .page-head h1 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 9px 11px; }
  .kpi b { font-size: 21px; }
  .grid, .grid3 { grid-template-columns: 1fr; }
  .rep-two { grid-template-columns: 1fr; }
  .filters > select { flex: 1 1 45%; }
  /* טבלאות → כרטיסים */
  table.clients thead, table.cases thead, table.money thead, table.pays thead, table.users thead { display: none; }
  table.clients tr, table.cases tr, table.money tr, table.pays tr, table.users tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.clients td, table.cases td, table.money td, table.pays td, table.users td { border: 0; padding: 2px 0; }
  table.clients td::before, table.cases td::before, table.money td::before, table.pays td::before, table.users td::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
  table.clients td.nm, table.cases td.nm, table.money td.nm, table.pays td.nm, table.users td.nm { grid-column: 1 / -1; }
  table.clients td.nm::before, table.cases td.nm::before, table.money td.nm::before, table.pays td.nm::before, table.users td.nm::before { display: none; }
  table.pays tfoot tr { display: table-row; }
  .ov { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.xwide { max-width: none; border-radius: 16px 16px 0 0; max-height: 94vh; overflow-y: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .al { grid-template-columns: auto 1fr; grid-template-areas: "chk main" "chk side" "chk meta"; }
  .al-side { text-align: start; }
  .hc-top h1 { font-size: 21px; }
  .steps li button, .steps li span { padding: 3px 9px; font-size: 12.5px; }
  .doc-frame { height: 60vh; }
}
@media (max-width: 560px) {
  .perm-t th, .perm-t td { display: block; width: auto; }
  .perm-t td { border-top: 0 !important; padding-top: 0; }
}

/* ---------------- הדפסה ---------------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .top, .filters, .rep-bar, #toast, .page-head .btn, .hc-acts, .save-bar { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .kpi { box-shadow: none; }
}
