/* י.ע.מ. אחזקות – מערכת עיצוב
   גדלי טקסט: 34 / 28 / 22 / 17 / 15 / 13 · גובה פקדים: 44 / 36 · רדיוסים: 20 / 14 / גלולה */

:root {
  --navy: #050F40;
  --navy-2: #0D1A55;
  --green: #548313;
  --green-ink: #3F6A0E;
  --green-soft: #EEF5E4;
  --green-light: #A9D373;
  --ground: #F3F5F9;
  --card: #FFFFFF;
  --tint: #F7F8FB;
  --line: #E3E7EF;
  --line-2: #D5DBE7;
  --row: #EDF0F5;
  --ink: #0B1330;
  --muted: #5B6478;
  --on-navy: #C9D0E4;
  --navy-soft: #E9ECF6;
  --amber-soft: #FEF3E2; --amber: #9A4A06;
  --red-soft: #FDECEA;   --red: #B42318;

  --t-hero: 34px; --t-title: 28px; --t-section: 22px; --t-strong: 17px; --t-body: 15px; --t-small: 13px;
  --h-ctl: 44px; --h-ctl-sm: 36px;
  --r-card: 20px; --r-inner: 14px; --r-pill: 999px;
  --shadow-float: 0 6px 20px rgba(5, 15, 64, .10);
  --shadow-panel: 0 20px 60px rgba(5, 15, 64, .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: 'Assistant', 'Segoe UI', Arial, sans-serif; font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--navy); }
a:hover { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(84, 131, 19, .45); outline-offset: 2px; }

/* ---------- טיפוגרפיה ---------- */
.t-hero    { margin: 0; font-size: var(--t-hero); font-weight: 800; color: var(--navy); line-height: 1.15; }
.t-title   { margin: 0; font-size: var(--t-title); font-weight: 800; color: var(--navy); line-height: 1.15; }
.t-section { margin: 0; font-size: var(--t-section); font-weight: 800; color: var(--navy); line-height: 1.25; }
.t-strong  { font-size: var(--t-strong); font-weight: 800; }
.t-body    { font-size: var(--t-body); }
.t-small   { font-size: var(--t-small); }
.muted { color: var(--muted); }
.bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-ctl); padding: 0 22px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--card); color: var(--navy);
  font-size: var(--t-body); font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-ink); color: #fff; }
.btn-danger { color: var(--red); border-color: #F0C7C2; }
.btn-danger:hover { color: var(--red); border-color: var(--red); }
.btn-sm { height: var(--h-ctl-sm); padding: 0 16px; font-size: var(--t-small); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { flex: none; }
.icon-btn {
  width: var(--h-ctl); height: var(--h-ctl); border-radius: var(--r-pill); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--navy); cursor: pointer;
}
.icon-btn.sm { width: var(--h-ctl-sm); height: var(--h-ctl-sm); border-color: var(--line-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 700; cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--green); }

/* ---------- תגיות ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-small); font-weight: 700; padding: 3px 12px; border-radius: var(--r-pill); white-space: nowrap; }
.pill-navy  { background: var(--navy-soft); color: var(--navy); }
.pill-good  { background: var(--green-soft); color: var(--green-ink); }
.pill-warn  { background: var(--amber-soft); color: var(--amber); }
.pill-bad   { background: var(--red-soft); color: var(--red); }
.pill-gray  { background: var(--tint); color: var(--muted); border: 1px solid var(--line); }

/* ---------- טפסים ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: var(--t-small); font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  height: var(--h-ctl); padding: 0 16px; border-radius: var(--r-inner); border: 1px solid var(--line-2);
  background: var(--card); font-size: var(--t-body); color: var(--ink); width: 100%; min-width: 0;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(5, 15, 64, .08); }
.field .hint { font-size: var(--t-small); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--h-ctl-sm); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.search {
  display: flex; align-items: center; gap: 10px; height: var(--h-ctl); padding: 0 18px;
  border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line); min-width: 0;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: var(--t-body); }

/* ---------- הודעות ---------- */
.note { padding: 14px 18px; border-radius: var(--r-inner); font-size: var(--t-body); font-weight: 600; }
.note-good { background: var(--green-soft); color: var(--green-ink); }
.note-warn { background: var(--amber-soft); color: var(--amber); }
.note-bad  { background: var(--red-soft); color: var(--red); }

/* ---------- מסגרת האפליקציה ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 264px; flex: none; background: var(--navy); color: #fff;
  padding: 28px 18px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.sidebar .brand { display: block; width: 168px; align-self: center; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: var(--h-ctl); padding: 0 16px; border-radius: var(--r-pill);
  color: var(--on-navy); text-decoration: none; font-size: var(--t-body); font-weight: 600;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--green); color: #fff; font-weight: 700; }
.nav .nav-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 8px; }
.me-card {
  margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-card);
  background: rgba(255, 255, 255, .08); color: #fff; border: 0; text-align: right; cursor: pointer; width: 100%;
}
.me-card:hover { background: rgba(255, 255, 255, .12); }
.avatar {
  width: 40px; height: 40px; border-radius: var(--r-pill); flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff; font-size: var(--t-body); font-weight: 800;
}
.avatar.soft { background: var(--navy-soft); color: var(--navy); }
.me-card .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-card .who b { font-size: var(--t-body); }
.me-card .who span { font-size: var(--t-small); color: var(--on-navy); }

.main { flex: 1; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--t-body); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }

/* מובייל: כותרת עליונה ותפריט תחתון */
.topbar, .tabbar { display: none; }

/* ---------- כרטיסים ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.card.navy .t-section { color: #fff; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--line-2); color: inherit; }
.kpi .label { font-size: var(--t-body); font-weight: 600; color: var(--muted); }
.kpi .value { font-size: var(--t-hero); font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .pill { align-self: flex-start; }

.alert-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-inner); background: var(--tint); }
.alert-row .ico { flex: none; width: 44px; height: 44px; border-radius: var(--r-inner); display: flex; align-items: center; justify-content: center; }
.alert-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-row .txt b { font-size: var(--t-body); }
.alert-row .txt span { font-size: var(--t-small); color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 36px 16px; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; border-radius: var(--r-card); background: var(--green-soft); color: var(--green-ink); display: flex; align-items: center; justify-content: center; }
.empty b { color: var(--ink); font-size: var(--t-strong); }

/* ---------- טבלאות (הופכות לכרטיסים בטלפון) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-body); }
.table th { text-align: right; font-size: var(--t-small); font-weight: 700; color: var(--muted); padding: 0 10px 12px; white-space: nowrap; }
.table td { padding: 14px 10px; border-top: 1px solid var(--row); vertical-align: middle; }
.table td.end, .table th.end { text-align: left; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--tint); }
.table .row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cell-main { font-weight: 700; color: var(--ink); }
.cell-sub { display: block; font-size: var(--t-small); color: var(--muted); font-weight: 400; }
.dim td { opacity: .55; }

/* ---------- לשוניות גלולה ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: var(--h-ctl); padding: 0 22px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }

/* ---------- רשימות מנוהלות ---------- */
.list-items { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--row); }
.list-item:first-child { border-top: 0; }
.list-item .name { flex: 1; min-width: 0; font-weight: 600; }
.list-item.off .name { color: var(--muted); text-decoration: line-through; }
.add-row { display: flex; gap: 10px; }
.add-row input { flex: 1; min-width: 0; height: var(--h-ctl); padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--card); }

/* ---------- מטריצת הרשאות ---------- */
.perm-grid { display: flex; flex-direction: column; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--row); }
.perm-row:first-child { border-top: 0; }
.perm-row .label { font-weight: 700; }
.seg { display: inline-flex; background: var(--tint); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; flex: none; }
.seg button { height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 0; background: transparent; font-size: var(--t-small); font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- פאנל צד (במחשב) / מסך מלא (בטלפון) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 15, 64, .38); z-index: 50; display: flex; justify-content: flex-end; }
html[dir="rtl"] .overlay { justify-content: flex-end; }
.panel {
  width: min(560px, 100%); height: 100%; background: var(--ground); box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; margin-left: 0; margin-right: auto;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.panel-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-foot { display: flex; gap: 12px; padding: 16px 24px; background: var(--card); border-top: 1px solid var(--line); }
.panel-foot .btn-primary { flex: 1; }
.panel .section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.dialog-wrap { position: fixed; inset: 0; background: rgba(5, 15, 64, .38); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog { width: min(440px, 100%); background: var(--card); border-radius: var(--r-card); padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-panel); }
.dialog .btns { display: flex; gap: 12px; justify-content: flex-start; }

/* גיליון "עוד" בטלפון */
.sheet-wrap { position: fixed; inset: 0; background: rgba(5, 15, 64, .38); z-index: 55; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--card); border-radius: 28px 28px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; max-height: 85vh; overflow-y: auto; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); align-self: center; margin-bottom: 10px; }
.sheet a, .sheet button.sheet-link { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 8px; border-radius: var(--r-inner); text-decoration: none; color: var(--ink); font-weight: 700; background: none; border: 0; width: 100%; text-align: right; cursor: pointer; }
.sheet a:hover, .sheet button.sheet-link:hover { background: var(--tint); color: var(--ink); }
.sheet .s-ico { width: 40px; height: 40px; border-radius: var(--r-inner); background: var(--tint); display: flex; align-items: center; justify-content: center; color: var(--navy); }

/* ---------- לקוחות ---------- */
.avatar.navy { background: var(--navy); color: #fff; }
.avatar.xl { width: 64px; height: 64px; border-radius: var(--r-card); font-size: var(--t-section); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.tab.tab-soft { height: var(--h-ctl-sm); padding: 0 16px; font-size: var(--t-small); }
.tab.tab-soft.active { background: var(--green-soft); border-color: var(--green-soft); color: var(--green-ink); }

.file-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.fh-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.fh-titles { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fh-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fh-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.quick { display: none; }
#ftab { display: flex; flex-direction: column; gap: 20px; }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--tint); border-radius: var(--r-inner); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile span { font-size: var(--t-small); font-weight: 600; color: var(--muted); }
.tile b { font-size: var(--t-strong); font-weight: 800; color: var(--ink); }
.kpi-big { font-size: var(--t-hero); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.btn-ghost-navy { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.btn-ghost-navy:hover { background: rgba(255, 255, 255, .16); border-color: transparent; color: #fff; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--row); }
.kv:first-of-type { border-top: 0; }
.kv span { color: var(--muted); font-weight: 600; font-size: var(--t-small); }
.kv b { font-weight: 700; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.kv.col { flex-direction: column; gap: 4px; }
.pre { white-space: pre-wrap; margin: 0; }

.items { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px; border-radius: var(--r-inner); border: 1px solid var(--row); }
.item.off { opacity: .6; }
.item.compact { padding: 10px 0; border: 0; border-top: 1px solid var(--row); border-radius: 0; flex-wrap: nowrap; }
.items .item.compact:first-child { border-top: 0; }
.item-ico { flex: none; width: 44px; height: 44px; border-radius: var(--r-inner); display: flex; align-items: center; justify-content: center; background: var(--navy-soft); color: var(--navy); }
.item-ico.green { background: var(--green-soft); color: var(--green-ink); }
.item-ico.sm { width: 36px; height: 36px; }
.item-txt { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-txt b { font-size: var(--t-body); font-weight: 800; }
.item-txt span { font-size: var(--t-small); color: var(--muted); }
.item-meta { display: flex; flex-direction: column; gap: 2px; min-width: 100px; }
.item-meta.wide { min-width: 160px; }
.item-meta span { font-size: var(--t-small); color: var(--muted); }
.item-meta b { font-size: var(--t-body); font-weight: 700; }
.item-btns { display: flex; gap: 8px; flex: none; }
.item-extra { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-extra details { flex-basis: 100%; background: var(--tint); border-radius: var(--r-inner); padding: 10px 14px; }
.item-extra summary { cursor: pointer; font-weight: 700; font-size: var(--t-small); }
.item-extra ol { margin: 8px 0 0; padding-inline-start: 22px; }
.item-extra li { padding: 2px 0; }

.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; height: 38px; font-size: var(--t-body); }
.panel .section .t-strong { margin: 0; color: var(--navy); }

.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--row); }
.tl-row:first-child { border-top: 0; }
.tl-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 7px; }
.tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-changes { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: var(--t-small); color: var(--muted); background: var(--tint); border-radius: 10px; padding: 8px 12px; }

/* ---------- קבצים ורשימות חוזרות ---------- */
.file-chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-inner); background: var(--navy-soft); color: var(--navy); font-weight: 700; text-decoration: none; align-self: flex-start; max-width: 100%; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field input[type=file] { height: auto; padding: 10px 12px; }
.rep { display: flex; flex-direction: column; gap: 12px; }
.rep-row { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-inner); background: var(--tint); }
.rep-del { align-self: flex-start; font-size: var(--t-small); }

/* ---------- התראות ---------- */
.bell-link { margin-top: auto; display: flex; align-items: center; gap: 12px; height: var(--h-ctl); padding: 0 16px; border-radius: var(--r-pill); color: var(--on-navy); text-decoration: none; font-weight: 600; }
.bell-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.bell-link.active { background: var(--green); color: #fff; }
.sidebar .me-card { margin-top: 0; }
.badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: #E5484D; color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions .icon-btn { position: relative; }
.dot-badge { position: absolute; top: -2px; left: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: #E5484D; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--navy); }
.alert-row.notif.read { opacity: .55; }

/* ---------- הגדרות מערכת ---------- */
.auto-row { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--row); }
.auto-row:first-of-type { border-top: 0; }
.auto-txt { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.auto-txt > span { color: var(--muted); font-size: var(--t-small); }
.field.inline { flex-direction: row; align-items: center; gap: 10px; margin-top: 6px; }
.field.inline > span { flex: none; }
.field.inline input, .field.inline select { height: var(--h-ctl-sm); max-width: 200px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-2); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(84, 131, 19, .45); outline-offset: 2px; }
.code-row { display: flex; gap: 10px; align-items: center; background: var(--tint); border-radius: var(--r-inner); padding: 10px 12px; }
.code-row code { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }

/* ---------- סריקה ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 36px 20px; border: 2px dashed var(--line-2); border-radius: var(--r-card); background: var(--tint); cursor: pointer; position: relative; }
.dropzone:hover { border-color: var(--green); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-ico { width: 72px; height: 72px; border-radius: var(--r-card); background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.scan-preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--r-inner); background: var(--tint); }
.scan-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--green); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- טוסט ---------- */
.toasts { position: fixed; bottom: 24px; left: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.toast { background: var(--navy); color: #fff; padding: 14px 20px; border-radius: var(--r-pill); font-weight: 700; box-shadow: var(--shadow-float); max-width: 90vw; }
.toast.bad { background: var(--red); }

/* ---------- מסך כניסה ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; background: var(--navy); }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 28px; padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { width: min(640px, 100%); }
.auth-logo { width: 200px; align-self: center; margin-bottom: 6px; }
.auth-card .t-title { text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: -10px 0 4px; }
.install-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: var(--t-small); font-weight: 600; }

.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }

/* ================= טלפון וטאבלט ================= */
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .app { flex-direction: column; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  }
  .topbar .brand-mini { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; }
  .topbar .brand-mini img { height: 30px; width: auto; }
  .topbar .brand-mini b { font-size: var(--t-strong); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .icon-btn { background: rgba(255, 255, 255, .1); border: 0; color: #fff; }
  .main { padding: 20px 16px calc(104px + env(safe-area-inset-bottom)); gap: 18px; }
  .t-hero { font-size: var(--t-title); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line);
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; text-decoration: none;
    color: var(--muted); background: none; border: 0; cursor: pointer; font-size: var(--t-small); font-weight: 700;
  }
  .tabbar .tb-ico { display: flex; align-items: center; justify-content: center; width: 56px; height: 32px; border-radius: var(--r-pill); }
  .tabbar .active { color: var(--navy); font-weight: 800; }
  .tabbar .active .tb-ico { background: var(--green-soft); color: var(--green-ink); }
  .page-head .actions .btn-label { display: none; }
  .page-head .actions .btn { padding: 0 14px; }
}

@media (max-width: 759px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; gap: 6px; }
  .kpi .label { font-size: var(--t-small); }
  .kpi .value { font-size: var(--t-title); }
  .card { padding: 18px; gap: 12px; }
  .grid-2, .install-checks { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  .page-head .actions .search { flex: 1; }

  /* טבלה → כרטיסים */
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 10px; background: var(--card); }
  .table.cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; }
  .table.cards td::before { content: attr(data-label); font-size: var(--t-small); font-weight: 700; color: var(--muted); }
  .table.cards td.primary { display: block; padding-bottom: 8px; }
  .table.cards td.primary::before { display: none; }
  .table.cards td.blank { display: none; }
  .table.cards td.end { justify-content: space-between; text-align: right; }
  .table.cards td.actions-cell::before { display: none; }
  .table.cards td.actions-cell { padding-top: 10px; }
  .card .table.cards tr { background: var(--tint); border-color: transparent; }

  .file-head { background: var(--navy); border-color: var(--navy); color: #fff; padding: 20px; gap: 16px; }
  .file-head .t-hero { color: #fff; }
  .file-head .avatar.navy { background: rgba(255, 255, 255, .12); width: 52px; height: 52px; }
  .file-head .muted { color: var(--on-navy); }
  .file-head .pill-navy { background: rgba(255, 255, 255, .14); color: #fff; }
  .file-head .fh-actions { position: absolute; }
  .file-head { position: relative; }
  .file-head .fh-actions { top: 16px; left: 16px; gap: 8px; }
  .file-head .fh-actions .btn { width: 40px; height: 40px; padding: 0; background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
  .file-head .fh-actions .btn-label { display: none; }
  .file-head .fh-main { padding-left: 96px; align-items: flex-start; }
  .file-head .t-hero { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile b { font-size: var(--t-body); }
  .quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 10px; width: 100%; }
  .quick:empty { display: none; }
  .quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px; border-radius: var(--r-card); background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font-size: var(--t-small); font-weight: 700; }
  .item-meta, .item-meta.wide { min-width: 0; flex: 1 1 40%; }
  .filters .tab { height: 40px; padding: 0 14px; }
  .filters .tab.tab-soft { height: 34px; }
  .split-main, .split-side { flex-basis: 100%; }
  .perm-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 4px; }

  .overlay .panel { width: 100%; }
  .panel-head { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
  .panel-body { padding: 16px; }
  .panel-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .toasts { left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { border-radius: var(--r-inner); text-align: center; }
  .auth-card { padding: 28px 22px; }
}

@media print {
  .sidebar, .topbar, .tabbar, .page-head .actions { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
}
