@font-face { font-family: "Heebo"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/heebo-hebrew-400-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/heebo-hebrew-500-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/heebo-hebrew-600-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/heebo-hebrew-700-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/heebo-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/heebo-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Heebo"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/heebo-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --brand: #1f5f8b; --brand-2: #e8f1f8; --ok: #1e7b4f; --ok-bg: #e6f4ec; --warn: #a15c00; --warn-bg: #fff4e0;
  --bad: #b42318; --bad-bg: #fdecea; --radius: 10px;
  font-family: "Heebo", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
.num, td, .stat b, .v, .big { font-variant-numeric: tabular-nums; }
a { color: var(--brand); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1 { font-size: 25px; font-weight: 700; margin: 0 0 16px; letter-spacing: -.2px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--ink); font-weight: 600; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; }
.side { background: #16324a; color: #dfe9f2; padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { font-size: 20px; font-weight: 700; padding: 0 20px 14px; color: #fff; }
.side .logo small { display: block; font-size: 12px; font-weight: 400; color: #9fb6cb; }
.side select { margin: 0 16px 14px; width: calc(100% - 32px); background: #234a6a; color: #fff; border: 1px solid #2f5d82; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #dfe9f2; font-size: 15px; }
.side nav a:hover { background: #1f4463; text-decoration: none; }
.side nav a.active { background: #2a5a80; color: #fff; border-inline-start: 4px solid #7cc0f0; }
.side nav .sep { height: 1px; background: #2a4a66; margin: 10px 16px; }
.side .ngroup .nghead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 20px; background: none; border: 0; color: #dfe9f2; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: start; border-radius: 0; }
.side .ngroup .nghead:hover { background: #1f4463; }
.side .ngroup .ncaret { margin-inline-start: auto; font-weight: 400; color: #9fb6cb; transition: transform .15s; display: inline-block; }
.side .ngroup.open .ncaret { transform: rotate(-90deg); }
.side .ngroup .ngitems { display: none; }
.side .ngroup.open .ngitems { display: block; }
.side .ngroup .ngitems a { padding: 8px 20px 8px 20px; padding-inline-start: 46px; font-size: 14px; color: #c9d8e6; }
.side .ngroup .ngitems a span { display: none; }
.side .ngroup .ngitems a.active { color: #fff; }
.side .ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: inline-block; }
.side .nbottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 12px; }
.side .nbottom a { flex-direction: column; gap: 2px; padding: 8px 2px !important; font-size: 18px !important; border-radius: 8px; border-inline-start: 0 !important; cursor: pointer; text-align: center; }
.side .nbottom a small { font-size: 11.5px; color: #b8cbdc; }
.side .nbottom a.active small { color: #fff; }
.side .badge { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.main { padding: 24px 28px 60px; max-width: 1300px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layout { grid-template-columns: minmax(0, 1fr); } .side { position: static; height: auto; } }

.stat { font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 21px; color: var(--ink); margin-top: 4px; direction: ltr; text-align: right; }
.stat b.neg { color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }

button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
button:hover, .btn:hover { background: #f0f3f7; text-decoration: none; }
button.primary, .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover { background: #184d71; }
button.danger { color: var(--bad); border-color: #f1c4bf; }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.big { padding: 12px 20px; font-size: 16px; }
button:disabled { opacity: .5; cursor: default; }

input, select, textarea { font: inherit; border: 1px solid #cfd5de; border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc8ea; border-color: var(--brand); }
input[type=number], input.num { direction: ltr; text-align: right; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { font-size: 15px; color: var(--ink); }
label.chk { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6f9fc; }
tr.total td { font-weight: 700; background: #fafbfc; }
tr.group td { font-weight: 700; background: #f2f6fa; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--brand-2); color: var(--brand); }
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.alert.warn { background: var(--warn-bg); color: #6b3d00; }
.alert.bad { background: var(--bad-bg); color: #7a1a12; }
.alert.ok { background: var(--ok-bg); color: #13492f; }
.alert.info { background: var(--brand-2); color: #173f5c; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; border-radius: 8px 8px 0 0; color: var(--muted); }
.tabs a.active { background: #fff; border: 1px solid var(--line); border-bottom-color: #fff; color: var(--ink); margin-bottom: -1px; font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: min(820px, 100%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(1100px, 100%); }
.modal h2 { display: flex; justify-content: space-between; align-items: center; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 18px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; padding: 0 6px; color: var(--muted); }

#toast { position: fixed; bottom: 20px; left: 20px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; }
#toast div.err { background: var(--bad); }

.login { max-width: 380px; margin: 12vh auto; }
.login .card { padding: 28px; }
.big-num { font-size: 30px; font-weight: 700; direction: ltr; text-align: right; }
.vatbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vatbox .cell { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.vatbox .cell .l { font-size: 13px; color: var(--muted); }
.vatbox .cell .v { font-size: 20px; font-weight: 700; direction: ltr; text-align: right; margin-top: 4px; }
.vatbox .cell.main { background: var(--brand-2); border-color: #bcd7ec; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.lines td input { width: 100%; }
.hint { font-size: 12px; color: var(--muted); }
.company-card h2 a { color: var(--ink); }
.bank-chip { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
details summary { cursor: pointer; color: var(--brand); }

/* מסמך להדפסה */
.doc-print { background: #fff; padding: 36px 44px; border: 1px solid var(--line); border-radius: 8px; max-width: 800px; margin: 0 auto; }
.doc-print .hd { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.doc-print .title { font-size: 24px; font-weight: 700; }
.doc-print table td, .doc-print table th { border-bottom: 1px solid #ddd; }
.doc-print .tot { margin-top: 12px; width: 280px; margin-inline-start: auto; }
.doc-print .tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-print .tot .grand { font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); padding-top: 8px; }
@media print {
  .side, .no-print, #toast { display: none !important; }
  .layout { display: block; } .main { padding: 0; max-width: none; }
  .doc-print { border: 0; }
  body { background: #fff; }
  .modal-bg { position: static; background: none; padding: 0; } .modal { box-shadow: none; width: 100%; padding: 0; }
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.grid2 > .card h2 { margin-top: 0; }
span.ok, div.ok { color: var(--ok); font-weight: 600; }
.nowrap { white-space: nowrap; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.card.stat .big { font-size: 22px; font-weight: 700; margin: 4px 0; }
tr.neg-row td { background: #fff1f0; }
details summary { cursor: pointer; color: var(--muted); }

/* טלפון */
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; }
  .card { overflow-x: auto; } input[style*="width:300px"] { width: 100% !important; }
  .side { position: static; height: auto; padding: 10px 0 0; }
  .side .logo { padding: 0 14px 8px; font-size: 18px; }
  /* בטלפון: התפריט נפתח מכפתור ☰ ונסגר אחרי בחירה */
  .side .mnav { display: inline-flex !important; }
  .side nav { display: none; max-height: 75vh; overflow-y: auto; padding-bottom: 10px; }
  .side.mopen nav { display: block; }
  .side nav a { padding: 11px 16px; font-size: 15px; }
  .main { padding: 12px !important; }
  .modal { width: 96vw !important; max-width: 96vw !important; }
  .modal .mbody > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .form.c3, .form { grid-template-columns: 1fr !important; }
  .table-wrap, table { font-size: 13px; }
  .table-wrap { overflow-x: auto; }
  h1 { font-size: 20px; }
}
.mark { width: 44px; height: 44px; object-fit: contain; flex: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 52% 48%, #000 55%, rgba(0,0,0,.85) 72%, rgba(0,0,0,.35) 88%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 75% at 52% 48%, #000 55%, rgba(0,0,0,.85) 72%, rgba(0,0,0,.35) 88%, transparent 100%); }
.side .logo { display: flex; align-items: center; gap: 10px; }
.login-mark { width: 96px; height: 96px; display: block; margin: 0 auto 8px; }
.helpbar { position: relative; max-width: 640px; margin: 0 0 16px; }
.helpbar input { width: 100%; padding: 10px 14px; font-size: 15px; border-radius: 22px; border: 1px solid #c9d6e2; background: #fff; }
.helpres { position: absolute; top: 100%; right: 0; left: 0; z-index: 50; background: #fff; border: 1px solid #d5e0ea; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.12); margin-top: 4px; overflow: hidden; }
.helpres a { display: block; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #eef2f6; }
.helpres a:hover { background: #f2f7fb; }
.helptext ol { padding-inline-start: 22px; } .helptext p { margin: 6px 0; } .helptext li { margin: 4px 0; }
.helptoc { columns: 2; column-gap: 24px; } .helptoc a { display: block; padding: 3px 0; }
@media (max-width: 760px) { .helpbar { margin: 8px 12px 12px; } .helptoc { columns: 1; } }
.cdoc { border-top: 1px solid #eef2f6; padding: 8px 0; }

/* מתג קטעים (בחירה בין שתי תצוגות) */
.seg { display: inline-flex; background: #eef1f5; border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink, #1c2633); text-decoration: none; font-size: 14px; }
.seg a.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }

.side .mnav { display: none; margin-inline-start: auto; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font-size: 15px; align-items: center; gap: 6px; }
