/* ===== גופן ===== */
@font-face { font-family: Heebo; src: url(/vendor/heebo/heebo-hebrew-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Heebo; src: url(/vendor/heebo/heebo-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

/* ===== צבעים ===== */
:root {
  --bg: #f5f3ee; --bg-2: #ece8df; --card: #ffffff; --card-2: #faf8f4;
  --text: #19212f; --text-2: #4a5468; --muted: #8790a3; --line: #e6e1d6; --line-2: #d8d1c2;
  --navy: #0f2240; --navy-2: #182f55; --navy-3: #22406f;
  --gold: #b48a3c; --gold-2: #c9a14e; --gold-soft: #f4ecdb;
  --green: #1d7f57; --green-soft: #e3f3ea; --red: #c0412f; --red-soft: #fbe8e4;
  --amber: #b97909; --amber-soft: #fbf0d9; --blue: #2a64a8; --blue-soft: #e5eef9; --violet: #6b4fa3; --violet-soft: #efe9f8;
  --shadow: 0 1px 2px rgba(15, 34, 64, .05), 0 4px 16px rgba(15, 34, 64, .06);
  --shadow-lg: 0 12px 48px rgba(15, 34, 64, .22);
  --radius: 14px; --radius-sm: 9px;
  --side-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --bg-2: #131c2b; --card: #151f30; --card-2: #19253a;
    --text: #e8ebf1; --text-2: #b4bccb; --muted: #7d879a; --line: #243149; --line-2: #2f3e59;
    --navy: #0a1322; --navy-2: #122038; --navy-3: #1b2f52; --gold-soft: #2c2616;
    --green-soft: #12301f; --red-soft: #3a1a15; --amber-soft: #33270e; --blue-soft: #142a45; --violet-soft: #251d38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --bg-2: #131c2b; --card: #151f30; --card-2: #19253a;
  --text: #e8ebf1; --text-2: #b4bccb; --muted: #7d879a; --line: #243149; --line-2: #2f3e59;
  --navy: #0a1322; --navy-2: #122038; --navy-3: #1b2f52; --gold-soft: #2c2616;
  --green-soft: #12301f; --red-soft: #3a1a15; --amber-soft: #33270e; --blue-soft: #142a45; --violet-soft: #251d38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ===== בסיס ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Heebo, -apple-system, 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ===== מבנה ===== */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d2e3; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(140deg, var(--gold-2), #8c6a2a); display: grid; place-items: center; color: #fff; flex: none; }
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 2; }
.brand b { display: block; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand span { font-size: 11.5px; color: #8ea0bf; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; color: #6e81a3; padding: 14px 12px 6px; letter-spacing: .04em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #c3cde0; font-weight: 500; text-decoration: none; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(201, 161, 78, .14); color: #fff; }
.nav a.on::before { content: ''; position: absolute; right: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px 0 0 3px; background: var(--gold-2); }
.nav a.on .ic { color: var(--gold-2); }
.nav .count { margin-inline-start: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.nav .count.soft { background: rgba(255, 255, 255, .12); color: #dfe6f3; }
.side-foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; gap: 6px; align-items: center; }
.side-foot button { background: none; border: 0; color: #8ea0bf; cursor: pointer; padding: 8px; border-radius: 8px; display: flex; }
.side-foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); padding: 0 40px 0 64px; font: inherit; color: var(--text); }
.search > .ic { position: absolute; right: 13px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; left: 10px; top: 9px; font: 11px Heebo; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--card-2); }
.search-results { position: absolute; top: 46px; right: 0; left: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: 6px; z-index: 50; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.sr-item:hover, .sr-item.sel { background: var(--bg); text-decoration: none; }
.sr-item .t { font-weight: 600; } .sr-item .s { font-size: 12px; color: var(--muted); }
.sr-type { font-size: 11px; color: var(--gold); min-width: 64px; }
.top-actions { display: flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.mode-pill { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px; background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); cursor: pointer; white-space: nowrap; }
.mode-pill.live { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }

/* ===== כותרת דף ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== כפתורים ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: 600 13.5px Heebo, sans-serif; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--card-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-3); }
:root[data-theme="dark"] .btn.primary, .dark-auto .btn.primary { background: var(--gold); border-color: var(--gold); }
.btn.gold { background: linear-gradient(140deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-text { color: var(--red); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.push { margin-inline-end: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }

/* ===== כרטיסים ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--gold); }
.card-head .more { font-size: 12.5px; font-weight: 600; }
.card-body { padding: 0 18px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }

/* ===== מדדים ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi .k-val { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); color: #fff; border-color: var(--navy); }
.kpi.hero .k-label { color: #b7c3da; } .kpi.hero .k-sub { color: #93a3c2; }
.kpi.hero::after { content: ''; position: absolute; left: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 161, 78, .35), transparent 70%); }
.kpi.alert .k-val { color: var(--red); }
.kpi a.stretched { position: absolute; inset: 0; }
.delta { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.delta.up { background: var(--green-soft); color: var(--green); } .delta.down { background: var(--red-soft); color: var(--red); }

/* ===== תגיות ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.violet { background: var(--violet-soft); color: var(--violet); } .badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.navy { background: var(--navy); color: #fff; }
.due { font-size: 12px; color: var(--text-2); white-space: nowrap; } .due.late { color: var(--red); font-weight: 600; } .due.today { color: var(--amber); font-weight: 700; }
.stars { color: var(--gold-2); letter-spacing: 1px; font-size: 13px; } .stars i { color: var(--line-2); font-style: normal; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); } .dot.blue { background: var(--blue); }

/* ===== רשימות ===== */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); cursor: pointer; color: inherit; text-decoration: none !important; }
.li:hover { background: var(--card-2); }
.li .main-t { font-weight: 600; } .li .sub { font-size: 12.5px; color: var(--muted); }
.li .grow { flex: 1; min-width: 0; } .li .grow > * { overflow: hidden; text-overflow: ellipsis; }
.li .end { text-align: left; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; }
.chk:hover { border-color: var(--green); color: var(--green); }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.chk .ic { width: 14px; height: 14px; stroke-width: 3; }
.done-row .main-t { text-decoration: line-through; color: var(--muted); }

/* ===== טבלאות ===== */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .n, .tbl th.n { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t-main { font-weight: 600; } .tbl .t-sub { font-size: 12px; color: var(--muted); }
.tbl tr.best td { background: color-mix(in srgb, var(--green-soft) 60%, transparent); }
.tbl img.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); display: block; }
.tbl tfoot td { font-weight: 700; padding: 11px 14px; border-top: 2px solid var(--line-2); }

/* ===== סינון ===== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .filter-input { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; font: inherit; color: var(--text); min-width: 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); font: 500 13px Heebo; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .c { font-size: 11px; opacity: .75; }
select.filter-input { padding-left: 28px; }

/* ===== טפסים ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.modal.wide .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { grid-column: 1 / -1; font-size: 12.5px; color: var(--gold); font-weight: 700; margin: 8px 0 -4px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-section:first-child { border: 0; padding-top: 0; margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field label b { color: var(--red); }
.field small { font-size: 11.5px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); }
.field input, .field select, .field textarea, .inp { height: 40px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card); padding: 0 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.field textarea, textarea.inp { height: auto; padding: 9px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 20%, transparent); }
.rating-input { display: flex; gap: 2px; height: 40px; align-items: center; }
.rating-input button { background: none; border: 0; font-size: 22px; color: var(--line-2); cursor: pointer; padding: 0 2px; }
.rating-input button.on { color: var(--gold-2); }
.img-input { display: flex; align-items: center; gap: 10px; }
.img-input .thumb { width: 54px; height: 54px; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); background: var(--card-2); }
.img-input .thumb img { width: 100%; height: 100%; object-fit: cover; }
.check { display: flex; align-items: center; gap: 8px; height: 40px; font-weight: 500 !important; }

/* ===== חלונות ===== */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 18, 32, .5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .15s; }
.modal { background: var(--card); border-radius: 18px; width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(940px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--card-2); border-radius: 0 0 18px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 11px; box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .2s; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ===== לשוניות ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: none; font: 600 13.5px Heebo; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--navy); border-color: var(--gold-2); }
:root[data-theme="dark"] .tab.on { color: #fff; }
.tab .c { font-size: 11px; background: var(--bg-2); border-radius: 10px; padding: 0 7px; color: var(--text-2); }

/* ===== פרטי רשומה ===== */
.detail-head { padding: 22px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .avatar { width: 56px; height: 56px; border-radius: 15px; font-size: 20px; }
.detail-head h1 { font-size: 23px; font-weight: 800; }
.detail-head .meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 13px; align-items: center; }
.detail-head .meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-head .meta .ic { width: 15px; height: 15px; color: var(--muted); }
.detail-head .grow { flex: 1; min-width: 240px; }
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; }
.prop .pl { font-size: 12px; color: var(--muted); } .prop .pv { font-weight: 600; margin-top: 1px; word-break: break-word; }
.note-box { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-line; color: var(--text-2); }

/* שלבי עסקה */
.stepper { display: flex; gap: 3px; padding: 0 22px 20px; overflow-x: auto; }
.step { flex: 1; min-width: 74px; text-align: center; font-size: 11px; color: var(--muted); cursor: pointer; background: none; border: 0; padding: 0; font-family: inherit; }
.step i { display: block; height: 6px; border-radius: 3px; background: var(--bg-2); margin-bottom: 6px; transition: background .2s; }
.step.done i { background: var(--gold-2); } .step.cur i { background: var(--navy); } .step.cur { color: var(--text); font-weight: 700; }
:root[data-theme="dark"] .step.cur i { background: #fff; }
.step:hover { color: var(--text); }

/* ציר זמן */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border: 0; }
.tl-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg-2); color: var(--text-2); }
.tl-ic.in { background: var(--blue-soft); color: var(--blue); } .tl-ic.out { background: var(--green-soft); color: var(--green); } .tl-ic.system { background: var(--gold-soft); color: var(--gold); }
.tl-body { flex: 1; min-width: 0; } .tl-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.tl-text { white-space: pre-line; margin-top: 3px; }
.tl img { max-width: 220px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); }

/* לוח עסקאות */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--bg-2); border-radius: 13px; padding: 10px; min-height: 140px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; font-weight: 700; font-size: 13px; }
.col-head .c { font-size: 12px; color: var(--muted); font-weight: 500; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; display: block; color: inherit; text-decoration: none !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pcard .code { font-size: 11px; color: var(--muted); direction: ltr; text-align: right; }
.pcard .t { font-weight: 700; margin: 2px 0 4px; }
.pcard .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); gap: 6px; }

/* דוח בוקר */
.morning-hero { background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; border-radius: 18px; padding: 26px 28px; margin-bottom: 20px; position: relative; overflow: hidden; }
.morning-hero::after { content: ''; position: absolute; left: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 161, 78, .35), transparent 70%); }
.morning-hero h1 { font-size: 26px; font-weight: 800; }
.morning-hero p { color: #b7c3da; margin: 6px 0 0; }
.m-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.m-stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 9px 14px; color: #fff; text-decoration: none !important; }
.m-stat b { font-size: 20px; display: block; line-height: 1.2; } .m-stat span { font-size: 12px; color: #b7c3da; }
.m-stat.hot b { color: #ffb4a6; }
.sec-count { background: var(--bg-2); color: var(--text-2); font-size: 12px; border-radius: 10px; padding: 1px 8px; font-weight: 600; }
.sec-count.hot { background: var(--red-soft); color: var(--red); }

/* עוזר */
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; padding: 12px 15px; border-radius: 15px; line-height: 1.55; }
.msg.me { align-self: flex-start; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-end; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .rows { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.msg .r { display: flex; justify-content: space-between; gap: 14px; padding: 6px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.msg .r b { font-weight: 600; }
.msg .src { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg .note { font-size: 12px; color: var(--text-2); margin-top: 8px; padding: 8px 10px; background: var(--gold-soft); border-radius: 8px; }
.chat-input { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 14px; background: var(--card); }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.suggest button { font: 500 12.5px Heebo; border: 1px solid var(--line); background: var(--card); color: var(--text-2); border-radius: 20px; padding: 5px 12px; cursor: pointer; }
.suggest button:hover { border-color: var(--gold-2); color: var(--text); }
.ai-mini { padding: 16px 18px; }
.ai-mini form { display: flex; gap: 8px; }
.ai-mini input { flex: 1; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: var(--card); }
.ai-answer { margin-top: 12px; }
.ai-answer .msg { max-width: 100%; }

/* עורך הצעת מחיר */
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.q-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.internal { border: 1.5px dashed var(--gold-2); background: color-mix(in srgb, var(--gold-soft) 55%, var(--card)); }
.internal .card-head h3 { color: var(--gold); }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.sum-row.total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }
.items-edit { width: 100%; border-collapse: separate; border-spacing: 0; }
.items-edit th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.items-edit td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items-edit .inp { height: 36px; font-size: 13.5px; padding: 0 8px; }
.items-edit textarea.inp { min-height: 36px; font-size: 12.5px; }
.items-edit .int { background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
.items-edit .it-img { width: 52px; height: 52px; border-radius: 9px; border: 1px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); background: var(--card-2); }
.items-edit .it-img img { width: 100%; height: 100%; object-fit: cover; }
.line-total { font-weight: 700; padding-top: 8px; white-space: nowrap; text-align: left; }
.margin-tag { font-size: 11px; margin-top: 3px; }
.legend-int { font-size: 12px; color: var(--gold); display: flex; align-items: center; gap: 6px; }
.legend-int i { width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--gold-soft) 80%, transparent); border: 1px dashed var(--gold-2); }

/* תיבת מידע */
.callout { display: flex; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--blue-soft); color: var(--text); margin-bottom: 16px; align-items: flex-start; }
.callout .ic { color: var(--blue); margin-top: 2px; }
.callout.warn { background: var(--amber-soft); } .callout.warn .ic { color: var(--amber); }
.callout.gold { background: var(--gold-soft); } .callout.gold .ic { color: var(--gold); }
.callout p { margin: 0; } .callout b { font-weight: 700; }

/* קבצים */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); position: relative; }
.file .prev { height: 110px; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.file .prev img, .file .prev video { width: 100%; height: 100%; object-fit: cover; }
.file .fi { padding: 8px 10px; font-size: 12.5px; }
.file .fi b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .del { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 8px; width: 28px; height: 28px; }
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--gold-2); color: var(--text); background: var(--gold-soft); }

/* ריק */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; stroke-width: 1.4; color: var(--line-2); }
.empty p { margin: 8px 0 12px; }

/* מסך כניסה */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 80% -10%, var(--navy-3), transparent), var(--navy); }
.login-card { width: min(400px, 100%); background: var(--card); border-radius: 20px; padding: 34px 30px; box-shadow: var(--shadow-lg); }
.login-card .brand-mark { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; } .login-card p { color: var(--text-2); margin: 6px 0 20px; }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; height: 44px; margin-top: 6px; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; }

.bar { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 4px; }
.chart-box { position: relative; height: 260px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.tpl pre { white-space: pre-wrap; font-family: inherit; margin: 8px 0 0; font-size: 13px; }
.int-flag { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--gold); font-weight: 600; }

/* ===== ניווט תחתון בטלפון ===== */
.bottom-nav { display: none; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .g-main, .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1560px) {
  .q-layout { grid-template-columns: 1fr; }
  .q-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
.items-edit td.c-name { min-width: 220px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; right: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(100%); transition: transform .22s ease; padding-top: max(18px, env(safe-area-inset-top)); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(10, 18, 32, .45); z-index: 80; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .search kbd { display: none; }
  .search input { padding-left: 12px; }
  .content { padding: 18px 16px 100px; }
  .g2, .g3, .g-main { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; } .kpi .k-val { font-size: 21px; }
  .form-grid, .modal.wide .form-grid { grid-template-columns: 1fr 1fr; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-foot { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 60; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 4px 0; text-decoration: none !important; position: relative; }
  .bottom-nav a.on { color: var(--navy); font-weight: 700; }
  :root[data-theme="dark"] .bottom-nav a.on { color: var(--gold-2); }
  .bottom-nav .ic { width: 22px; height: 22px; }
  .bottom-nav .count { position: absolute; top: 0; left: calc(50% - 20px); background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
  /* טבלאות הופכות לכרטיסים */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: left; }
  .tbl td::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 500; flex: none; text-align: right; }
  .tbl td:first-child::before { display: none; }
  .tbl td:first-child { text-align: right; justify-content: flex-start; }
  .tbl .hide-sm { display: none; }
  .tbl tfoot { display: block; }
  .detail-head { padding: 16px; }
  .stepper { padding: 0 16px 16px; }
  .msg { max-width: 92%; }
  .chat { height: calc(100vh - 230px); }
  .items-edit thead { display: none; }
  .items-edit tr { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .items-edit td { border: 0; padding: 0; }
  .items-edit td.c-name { grid-column: 2 / 4; }
  .items-edit td.c-full { grid-column: 1 / -1; }
  .items-edit td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); }
}
@media (max-width: 420px) {
  .form-grid, .modal.wide .form-grid { grid-template-columns: 1fr; }
  .mode-pill { font-size: 11px; padding: 4px 8px; }
}
@media print { .side, .topbar, .bottom-nav { display: none !important; } .shell { display: block; } }

/* ===== WhatsApp ===== */
.wa-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.wa-list { max-height: calc(100vh - 250px); overflow-y: auto; }
.wa-list .li.sel { background: var(--gold-soft); }
.wa-thread { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 480px; overflow: hidden; }
.wa-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wa-ai { display: flex; gap: 10px; padding: 10px 16px; background: var(--gold-soft); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.wa-ai .ic { color: var(--gold); margin-top: 2px; }
.wa-sugg { padding: 10px 16px; border-bottom: 1px solid var(--line); max-height: 40%; overflow-y: auto; background: var(--card-2); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: color-mix(in srgb, var(--bg) 70%, var(--card)); }
.bubble { max-width: 72%; padding: 8px 12px; border-radius: 12px; line-height: 1.5; white-space: pre-line; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.bubble.in { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-top-right-radius: 3px; }
.bubble.out { align-self: flex-end; background: #dcf3d9; color: #10301a; border-top-left-radius: 3px; }
:root[data-theme="dark"] .bubble.out { background: #1d4430; color: #e2f5e6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble.out { background: #1d4430; color: #e2f5e6; } }
.bubble img { max-width: 240px; border-radius: 9px; margin-top: 6px; display: block; }
.bubble .meta { font-size: 11px; opacity: .6; margin-top: 2px; text-align: left; }
.wa-day { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1px 10px; margin: 8px 0; }
.wa-foot { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sugg { padding: 14px 16px; margin-bottom: 10px; border-inline-start: 3px solid var(--gold-2); }
.evidence { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); font-size: 13px; font-style: italic; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row code { direction: ltr; unicode-bidi: isolate; background: var(--bg-2); padding: 6px 10px; border-radius: 8px; font-size: 12px; word-break: break-all; flex: 1; }
@media (max-width: 860px) {
  .wa-layout { grid-template-columns: 1fr; }
  .wa-list { max-height: 45vh; }
  .wa-thread { height: 75vh; }
  .bubble { max-width: 88%; }
}
