:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --ink: #1b2333;
  --muted: #667085;
  --line: #e4e8ef;
  --brand: #0f3b5f;
  --brand-2: #1c5d8c;
  --accent: #0e9f6e;
  --accent-soft: #e3f6ee;
  --warn: #c27803;
  --warn-soft: #fdf4e3;
  --bad: #c8312b;
  --bad-soft: #fdecea;
  --info-soft: #e8f1fa;
  --input: #ffffff;
  --brand-ink: var(--brand);
  --highlight: #f5f9ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
a { color: var(--brand-2); }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 18px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #2bd49a, #0e9f6e);
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.brand-name { font-weight: 800; font-size: 20px; }
.brand-sub { font-size: 12px; opacity: .7; }
#nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
#nav a {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 2px;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500;
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active { background: rgba(255,255,255,.16); color: #fff; }
#nav .ico { width: 22px; text-align: center; }
.sidebar-foot { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot label { font-size: 13px; opacity: .85; display: flex; flex-direction: column; gap: 6px; }
.sidebar-foot select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.sidebar-foot option { color: var(--ink); }

main { flex: 1; padding: 28px 32px 60px; max-width: 1200px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 16px; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; min-width: 0;
}
.card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }

.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 2px; direction: ltr; text-align: right; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.kpi.hero .label, .kpi.hero .sub { color: rgba(255,255,255,.8); }
.pos { color: var(--accent); }
.neg { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: left; direction: ltr; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: none; }
.table-wrap { overflow-x: auto; }

form.inline { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink);
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); width: 100%;
}
input[type=checkbox] { width: auto; }
/* באייפון שדות תאריך/חודש מקבלים רוחב משלהם ובורחים מהטור — מכריחים אותם להתיישר כמו שאר השדות */
input[type=date], input[type=month], input[type=time] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; min-height: 38px; text-align: start;
}
input[type=date]::-webkit-date-and-time-value, input[type=month]::-webkit-date-and-time-value { text-align: start; }
/* תיבת סימון בתוך טופס בשורה — באותו גובה ומראה של שדה, כדי שלא "תרחף" ליד השדות */
form.inline label.check {
  min-height: 38px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--input);
}
@media (max-width: 600px) {
  form.inline label.check, form.inline > button { grid-column: 1 / -1; }
  form.inline > button { min-height: 44px; }
}
input:focus, select:focus { outline: 2px solid #b6d4ee; border-color: var(--brand-2); }
input.small { width: 100px; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  background: var(--brand); color: #fff;
}
button:hover { filter: brightness(1.1); }
button.secondary { background: var(--panel); color: var(--brand-ink); border-color: var(--line); }
button.ghost { background: transparent; color: var(--muted); padding: 4px 8px; }
button.ghost:hover { color: var(--bad); }
button.ok { background: var(--accent); }
button.small { padding: 5px 10px; font-size: 13px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }
.badge.overdue { background: var(--bad-soft); color: var(--bad); }
.badge.unknown { background: #eef0f4; color: var(--muted); }

.alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; }
.alert.bad { background: var(--bad-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.info { background: var(--info-soft); }
.alert.good { background: var(--accent-soft); }
.alert .ico { flex-shrink: 0; }

.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.big-num { font-size: 32px; font-weight: 800; direction: ltr; display: inline-block; }

.steps .step { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 12px; }
.steps .step.minus .v { color: var(--bad); }
.steps .step.result { font-weight: 800; border-bottom: 2px solid var(--ink); }
.steps .v { direction: ltr; white-space: nowrap; }
.steps .why { font-size: 12.5px; color: var(--muted); }

.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; }

.envelope { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.envelope div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.envelope b { display: block; font-size: 20px; direction: ltr; }

.welcome { background: linear-gradient(135deg, #0f3b5f, #1c5d8c); color: #fff; }
.welcome p { opacity: .9; }

details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.toast {
  position: fixed; bottom: 24px; left: 24px; background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 10px; opacity: 0; transform: translateY(10px);
  transition: .25s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; transform: none; }
input[type=range] { padding: 0; }

/* ---------- מצב כהה ---------- */
:root[data-theme="dark"] {
  --bg: #11151c;
  --panel: #1a2029;
  --input: #141920;
  --ink: #e6e9ef;
  --muted: #98a2b3;
  --line: #2b3340;
  --brand-ink: #8cc4f0;
  --highlight: #1f2a38;
  --accent: #34c48f;
  --accent-soft: #15342a;
  --warn: #f0b44a;
  --warn-soft: #3a2e15;
  --bad: #f2716b;
  --bad-soft: #3d1c1b;
  --info-soft: #172a3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
:root[data-theme="dark"] .sidebar { background: #0b0f14; }
:root[data-theme="dark"] .badge.unknown { background: #252c36; }
:root[data-theme="dark"] input[type=date] { color-scheme: dark; }
:root[data-theme="dark"] .chart text { fill: var(--muted); }

/* ---------- רקע ועיצוב זכוכית ---------- */
:root { --panel-rgb: 255, 255, 255; --glass-alpha: .55; --glass-blur: 14px; }
:root[data-theme="dark"] { --panel-rgb: 22, 28, 37; }

html.has-bg body {
  background: var(--bg-image) center / cover fixed no-repeat, var(--bg);
}
html.has-bg .card,
html.has-bg .page-head {
  background: rgba(var(--panel-rgb), var(--glass-alpha));
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 8px 32px rgba(15, 30, 60, .18);
}
:root[data-theme="dark"].has-bg .sidebar { background: rgba(11, 15, 20, .72); }
:root[data-theme="dark"].has-bg .card,
:root[data-theme="dark"].has-bg .page-head { border-color: rgba(255, 255, 255, .12); }
html.has-bg .page-head { padding: 14px 20px; border-radius: var(--radius); }
html.has-bg .card.kpi.hero,
html.has-bg .card.welcome {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, transparent), color-mix(in srgb, var(--brand-2) 80%, transparent));
}
html.has-bg .sidebar {
  background: color-mix(in srgb, var(--brand) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-left: 1px solid rgba(255, 255, 255, .15);
}
html.has-bg input, html.has-bg select, html.has-bg textarea,
html.has-bg button.secondary, html.has-bg .preset, html.has-bg .envelope div {
  background: rgba(var(--panel-rgb), .6);
}
html.has-bg .module { background: rgba(var(--panel-rgb), .35); }
html.has-bg .module.on, html.has-bg .preset.active { background: rgba(var(--panel-rgb), .75); }
html.has-bg th, html.has-bg td { border-bottom-color: rgba(120, 130, 150, .25); }

.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented button {
  flex: 1; min-width: 180px; padding: 12px; background: var(--panel); color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; font-size: 15px;
}
.segmented button.active { border-color: var(--brand-2); background: var(--highlight); color: var(--brand-ink); }
.unpaid-fields { display: contents; }
/* השלמת ערים */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: 100%; right: 0; left: 0; z-index: 20; margin-top: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden;
}
.ac-wrap > .ac-list { top: auto; }
.ac-item { display: flex; justify-content: space-between; padding: 9px 12px; cursor: pointer; color: var(--ink); font-size: 15px; }
.ac-item.on, .ac-item:hover { background: var(--highlight); }
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; background: var(--bg); color: var(--ink);
}
button.chip { cursor: pointer; margin: 0 0 4px 4px; }
.chip.zone-north { background: #e3f6ee; color: #0b6b4a; border-color: #b7e6d2; }
.chip.zone-center { background: #e6f0fb; color: #1c5d8c; border-color: #bcd5ef; }
.chip.zone-south { background: #fdf0e2; color: #a35a0c; border-color: #f3d3ad; }
.chip.zone-none { background: #f1f2f4; color: var(--muted); }
:root[data-theme="dark"] .chip.zone-north { background: #15342a; color: #6fe0b1; border-color: #1f4d3d; }
:root[data-theme="dark"] .chip.zone-center { background: #172a3d; color: #8cc4f0; border-color: #23415f; }
:root[data-theme="dark"] .chip.zone-south { background: #3a2a15; color: #f0b46a; border-color: #5a4020; }
.chip-x { background: none; border: none; padding: 0 2px; color: inherit; opacity: .6; font-size: 11px; cursor: pointer; }
.chip-x:hover { opacity: 1; filter: none; }
.zone-text-north { color: #0e9f6e; } .zone-text-center { color: #1c5d8c; } .zone-text-south { color: #c27803; }
.city-pick summary { margin-top: 6px; color: var(--muted); }
.city-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.city-zones b { display: block; margin-bottom: 4px; color: var(--ink); }
@media (max-width: 700px) { .city-zones { grid-template-columns: 1fr; } }

/* חלון יום עבודה */
.day-job { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: rgba(var(--panel-rgb), .35); }
.day-job > .row { margin-bottom: 8px; }
.day-job > .row b.pos { font-size: 18px; direction: ltr; }
.day-worker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.day-worker select, .day-worker > input { width: auto; min-width: 140px; }
.inline-f { flex-direction: row; align-items: center; gap: 6px; }
.small-seg button { min-width: 0; flex: 0 0 auto; padding: 6px 12px; font-size: 14px; }
.day-sum { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 14px 0 10px; }
.day-sum .row { padding: 3px 0; }
.day-sum span.pos, .day-sum span.neg, .day-sum b { direction: ltr; }
.day-net { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px !important; font-size: 18px; }

.wd-preview { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.wd-preview .big-num { font-size: 26px; margin-right: 8px; }
.install-btn { width: 100%; margin-bottom: 10px; background: linear-gradient(135deg, #2bd49a, #0e9f6e); color: #fff; border: 0; border-radius: 10px; padding: 9px; font-weight: 700; }

/* מסך פתיחה — צוות A.B.M */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(ellipse at 70% 20%, #1c5d8c 0%, #0f3b5f 45%, #08213a 100%);
  color: #fff; transition: opacity .6s ease, visibility .6s;
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.splash-logo {
  width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2bd49a, #0e9f6e); font-size: 52px; font-weight: 800;
  box-shadow: 0 18px 50px rgba(14, 159, 110, .45); animation: splash-pop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}
.splash-name { font-size: 44px; font-weight: 800; margin-top: 14px; animation: splash-up .6s .15s both; }
.splash-sub { opacity: .75; font-size: 16px; animation: splash-up .6s .25s both; }
.splash-bar { width: 220px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin: 26px 0 18px; }
.splash-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #2bd49a, #8ef0c8); animation: splash-load 1.5s .2s ease-in-out forwards; }
.splash-credit { font-size: 14px; letter-spacing: .5px; opacity: 0; animation: splash-up .6s .5s forwards; }
.splash-credit b { color: #8ef0c8; font-size: 17px; letter-spacing: 2px; }
@keyframes splash-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: .85; } }
@keyframes splash-load { to { width: 100%; } }
.credit { font-size: 11.5px; opacity: .55; text-align: center; margin-top: 10px; letter-spacing: .5px; }
.auth-credit { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.auth-credit b { color: var(--brand-ink); letter-spacing: 1.5px; }

/* מסך צר (טלפון): טבלאות נגללות לצד בתוך הכרטיס, בלי למתוח את כל הדף */
@media (max-width: 520px) {
  main table { display: block; overflow-x: auto; max-width: 100%; }
}

/* חלון הצגת מסמך */
#doc-viewer { position: fixed; inset: 0; z-index: 60; background: rgba(10, 20, 35, .55); display: grid; place-items: center; padding: 16px; }
.doc-box { width: min(860px, 100%); height: min(92vh, 1100px); background: var(--panel); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.doc-bar { padding: 10px 14px; border-bottom: 1px solid var(--line); }
#doc-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* שורות חשבונית */
.inv-line { display: grid; grid-template-columns: minmax(0, 3fr) 80px 130px 100px 28px; gap: 8px; align-items: center; margin-bottom: 6px; }
.inv-line.head { margin-bottom: 2px; }
.inv-line b.num { text-align: left; direction: ltr; }
@media (max-width: 600px) { .inv-line { grid-template-columns: 1fr 60px 90px; } .inv-line b.num, .inv-line > :last-child { display: none; } }

/* שלושת הגופים */
.bodies .kpi { border-top: 4px solid var(--line); }
.bodies .body-tax { border-top-color: #1c5d8c; }
.bodies .body-bl { border-top-color: #0e9f6e; }
.bodies .body-vat { border-top-color: #c27803; }
.bodies .kpi .sub { margin-top: 3px; }
.pct-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* טבלת מס לפי רמות רווח */
table.levels tr.me td { background: var(--accent-soft); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
table.levels tr.me td:first-child { border-right: 2px solid var(--accent); border-radius: 0 8px 8px 0; }
table.levels tr.me td:last-child { border-left: 2px solid var(--accent); border-radius: 8px 0 0 8px; }
.me-tag { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 700; margin-left: 4px; }

/* כניסה והרשמה */
.match { font-size: 12px; font-weight: 600; margin-right: 6px; }
#auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: min(420px, 100%); }
.recovery-code {
  font-size: 26px; font-weight: 800; letter-spacing: 3px; text-align: center; direction: ltr; font-family: Consolas, monospace;
  background: var(--warn-soft); border: 2px dashed var(--warn); border-radius: 12px; padding: 14px; user-select: all;
}
.user-box { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.08); }
.user-av { width: 32px; height: 32px; border-radius: 50%; background: #2bd49a; color: #08392a; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.user-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 12.5px; }
.user-txt span { opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .ghost { color: rgba(255,255,255,.8); font-size: 18px; }
.user-box .ghost:hover { color: #fff; }
#lock { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 20, 35, .45); }
.lock-box { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.lock-box input { font-size: 24px; text-align: center; letter-spacing: 6px; }
.complex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.complex-grid .pct-in { width: 58px; padding: 4px 6px; margin-right: auto; }
.quote-result { position: sticky; top: 16px; align-self: start; }
.quote-price { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 2px solid var(--ink); margin-top: 6px; }
.quote-price b { font-size: 30px; font-weight: 800; color: var(--accent); direction: ltr; }
form.grid h3 { margin: 6px 0 0; }

.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.fleet-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right;
  background: rgba(var(--panel-rgb), var(--glass-alpha)); color: var(--ink); font-weight: 400;
  border: 2px solid var(--line); border-top: 5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  backdrop-filter: blur(var(--glass-blur));
}
.fleet-item b { font-size: 16px; }
.fleet-item.ok { border-top-color: var(--accent); }
.fleet-item.soon { border-top-color: var(--warn); }
.fleet-item.overdue { border-top-color: var(--bad); }
.fleet-item.active { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-2); }
.fleet-item.sold { opacity: .55; }
.fleet-ico { font-size: 24px; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card.service { display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--line); }
.card.service.ok { border-top-color: var(--accent); }
.card.service.soon { border-top-color: var(--warn); }
.card.service.overdue { border-top-color: var(--bad); }
.service-main { font-size: 17px; min-height: 48px; }
.service-main b { font-size: 22px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar i.soon { background: var(--warn); }
.bar i.overdue { background: var(--bad); }
.km-card input { font-size: 22px; font-weight: 700; direction: ltr; text-align: right; }

.quick-sum { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: end; margin-top: 14px; }
.quick-sum .op { font-size: 30px; font-weight: 800; color: var(--muted); padding-bottom: 6px; }
.quick-sum .big input { font-size: 22px; font-weight: 700; padding: 10px 12px; direction: ltr; text-align: right; }
.quick-sum .big b { font-size: 28px; font-weight: 800; direction: ltr; text-align: right; display: block; padding: 6px 0; }
.quick-sum .big b small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
@media (max-width: 700px) { .quick-sum { grid-template-columns: 1fr; } .quick-sum .op { display: none; } }
details.card > summary { font-size: 15px; }

.pay-freq { display: grid; gap: 10px; }
.pay-freq > div { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; align-items: center; }
.pay-freq > div > .muted { grid-column: 1; grid-row: 2; margin-top: -6px; }
.pay-freq > div > .segmented { grid-column: 2; grid-row: 1 / span 2; }
.segmented button:disabled { cursor: default; opacity: 1; }
@media (max-width: 600px) { .pay-freq > div { grid-template-columns: 1fr; } .pay-freq > div > .segmented { grid-column: 1; grid-row: auto; } }
.save-badge { background: var(--accent-soft); color: var(--accent); padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 13px; }
.save-badge.bad { background: var(--bad-soft); color: var(--bad); }

.partner-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 70px 28px;
  gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line);
}
.partner-row.head { padding-bottom: 2px; }
.partner-row.total { border-bottom: none; border-top: 2px solid var(--ink); }
.partner-row .badge { margin-top: 3px; }

.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bg-option {
  height: 84px; border-radius: 12px; border: 3px solid var(--line); padding: 0;
  background: var(--bg) center / cover; position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center;
}
.bg-option span {
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 12.5px; font-weight: 600;
  width: 100%; padding: 3px 0; text-align: center;
}
.bg-option.active { border-color: var(--accent); }
.bg-option.upload { border-style: dashed; }

.logo.custom { background: #fff; padding: 3px; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.logo-preview {
  width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #2bd49a, #0e9f6e); color: #fff; font-size: 34px; font-weight: 800;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
label.btn { display: inline-block; }

/* ---------- התאמה אישית: מקצועות, תוספים, צבעים ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.preset {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px;
  background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; font-weight: 600;
}
.preset.active { border-color: var(--brand-2); background: var(--highlight); }
.preset-ico { font-size: 30px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.module {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; transition: .15s;
}
.module.on { border-color: var(--brand-2); background: var(--highlight); }
.module.blocked { opacity: .5; cursor: not-allowed; }
.module-ico { font-size: 26px; }
.module-body { flex: 1; display: flex; flex-direction: column; }

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; }
.switch i::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { right: 21px; }

.widget-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 3px solid transparent; }
.swatch.active { border-color: var(--ink); }

@media (max-width: 900px) {
  .two, .three { grid-template-columns: 1fr; }
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  #nav { display: flex; overflow-x: auto; padding: 0 8px 8px; }
  #nav a { white-space: nowrap; }
  .brand { padding: 12px 16px; }
  .sidebar-foot { padding: 8px 16px 12px; }
  main { padding: 18px 16px 60px; }
  .envelope { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, button, form { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; border: 1px solid var(--line); }
}

/* ---------- החלפת שפה ---------- */
.lang-btn {
  /* absolute ולא fixed — נשאר למעלה בדף ולא מכסה תוכן בגלילה (בטלפון) */
  position: absolute; top: 10px; inset-inline-end: 14px; z-index: 60;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: pointer;
}
.lang-btn:hover { border-color: var(--accent); }
@media print { .lang-btn { display: none; } }
/* באנגלית (משמאל לימין) — מה שהיה מיושר ידנית לצד אחד מתהפך */
[dir="ltr"] .kpi .value { text-align: left; }
[dir="ltr"] th, [dir="ltr"] td { text-align: left; }
[dir="ltr"] td.num, [dir="ltr"] th.num, [dir="ltr"] .inv-line b.num { text-align: right; }
[dir="ltr"] .fleet-item { text-align: left; }

/* ---------- מנוי: פס ניסיון, בחירת מנוי ---------- */
.trial-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px;
  background: #fff4d6; color: #7a4d00; border: 1px solid #f2d48a;
  padding-inline-end: 120px; /* מקום לכפתור השפה שמעל */
}
.trial-bar span:nth-child(2) { flex: 1; }
.trial-bar button { padding: 6px 12px; }
#paywall {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 20, 35, .55); backdrop-filter: blur(6px); overflow: auto;
}
.paywall-box { width: min(620px, 100%); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.plan.featured { border: 2px solid var(--accent); }
.plan-name { font-weight: 700; }
.plan-name .badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; margin-inline-start: 6px; }
.plan-price { font-size: 28px; font-weight: 800; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan button { margin-top: 6px; }
:root[data-theme="dark"] .trial-bar { background: #3a2c08; color: #ffd98a; border-color: #6b5214; }

/* ---------- פס "יש גרסה חדשה" ---------- */
#update-bar {
  /* למטה ולא למעלה — כדי לא להסתיר כפתורים וטפסים בראש המסך */
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px; width: min(560px, calc(100vw - 24px));
  padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
#update-bar .update-txt { flex: 1; display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
#update-bar .update-txt span { color: var(--muted); font-size: 12.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#update-bar button { padding: 7px 12px; white-space: nowrap; }
@media print { #update-bar { display: none; } }

/* סמל התוכנה (תמונה) במקום ₪ */
.logo.app, .splash-logo.app { background: none; padding: 0; overflow: hidden; box-shadow: none; }
.logo.app img, .splash-logo.app img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 900px) { .sidebar .brand { padding-inline-end: 110px; } }

/* חלונות שאלה ואישור של התוכנה עצמה (במקום confirm/prompt/alert של הדפדפן, שנחסמים בחלק מהדפדפנים) */
#dlg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 20, 35, .55); backdrop-filter: blur(4px); }
.dlg-box { width: min(440px, 100%); }
.dlg-msg { white-space: pre-line; margin: 0; line-height: 1.6; }
.dlg-box input { width: 100%; }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
