:root {
  --bg: #F4F2EF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F6;
  --ink: #0B2230;
  --ink-2: #344650;
  --muted: #6C7880;
  --line: #E4E0DB;
  --line-2: #EFECE8;
  --accent: #052838;
  --accent-hover: #0D3A4F;
  --brand-sand: #D7D3CF;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7EDF0;
  --danger: #D9352B;
  --danger-soft: #FDECEA;
  --warn: #B86A00;
  --warn-soft: #FFF4E0;
  --ok: #16834A;
  --ok-soft: #E6F6EC;
  --side-bg: #052838;
  --side-ink: #C5D1D7;
  --side-muted: #7F98A4;
  --side-active: #10394D;
  --radius: 12px;
  --radius-sm: 8px;
  --pad: 60px;
  --shadow: 0 1px 2px rgba(5,40,56,.04), 0 1px 3px rgba(5,40,56,.06);
  --shadow-lg: 0 12px 40px rgba(5,40,56,.18);
  --font: 'Google Sans', 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.ic { width: 18px; height: 18px; flex: none; fill: currentColor; display: inline-block; vertical-align: middle; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }

/* ===== מבנה כללי ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.logo { width: 48px; height: 48px; border-radius: 50%; flex: none; display: block; }
.brand .logo { box-shadow: 0 0 0 1.5px rgba(215,211,207,.35); }
.logo-lg { width: 76px; height: 76px; align-self: flex-start; box-shadow: 0 0 0 1px rgba(215,211,207,.18); }
.logo-form { width: 56px; height: 56px; align-self: flex-start; display: none; }
.logo-sm { width: 30px; height: 30px; }
.brand small { color: var(--side-muted); font-size: 12px; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; color: var(--side-muted); padding: 16px 12px 6px; letter-spacing: .04em; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: #0A3044; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset -3px 0 0 var(--brand-sand); }
.nav a .ic { opacity: .85; }
.nav .count { margin-inline-start: auto; background: #1A4A60; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.nav .count.red { background: var(--danger); }
.side-foot { margin-top: auto; border-top: 1px solid #143E52; padding-top: 14px; display: flex; align-items: center; gap: 10px; padding-inline: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-sand); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.avatar.alt { background: #8B5CF6; }
.side-foot .who { line-height: 1.25; }
.side-foot .who b { color: #fff; font-weight: 500; display: block; }
.side-foot .who span { color: var(--side-muted); font-size: 12px; }
.side-foot .icon-btn { margin-inline-start: auto; color: var(--side-muted); background: none; border: 0; }
.side-foot .icon-btn:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px var(--pad); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 22px; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 40px; width: 300px; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; flex: 1; color: var(--ink); }
.content { padding: 32px var(--pad) 60px; flex: 1; }
.mobile-head, .bottom-nav { display: none; }

/* ===== כפתורים ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #D3CEC8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn.wa { color: #128C4A; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.plain { border-color: transparent; background: none; }
.dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

/* ===== רכיבים ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .meta { color: var(--muted); font-size: 13px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.plain::before { display: none; }
.st-blue { background: #E8F0FF; color: #2350D6; }
.st-amber { background: #FFF3DC; color: #A35F00; }
.st-violet { background: #F1EBFF; color: #6B3FD6; }
.st-teal { background: #E0F6F3; color: #0F7A6C; }
.st-indigo { background: #E9EAFF; color: #3F45C9; }
.st-orange { background: #FFEBDD; color: #C25510; }
.st-green { background: #E3F5EA; color: #13804A; }
.st-gray { background: #EEF0F3; color: #5C6270; }
.st-slate { background: #E8EDF3; color: #42566E; }

.src { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.src .ic { width: 15px; height: 15px; color: var(--muted); }
.muted { color: var(--muted); }
.red { color: var(--danger); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== היום שלי ===== */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.hello h2 { font-size: 26px; }
.hello p { margin: 4px 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi .k-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.kpi b { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .k-note { font-size: 12px; color: var(--muted); }
.kpi.alert .k-ic { background: var(--danger-soft); color: var(--danger); }
.kpi.today .k-ic { background: var(--accent-soft); color: var(--accent); }
.kpi.fresh .k-ic { background: var(--warn-soft); color: var(--warn); }
.kpi.money .k-ic { background: var(--ok-soft); color: var(--ok); }
.today-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.today-grid > *, .lead-grid > *, .rep-grid > *, .set-grid > * { min-width: 0; }

.task { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--surface-2); }
.task .when { width: 70px; flex: none; font-weight: 600; font-size: 13px; }
.task .when small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.task .who b { font-weight: 600; }
.task .who .org { color: var(--muted); }
.task .what { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.task .acts { display: flex; gap: 6px; flex: none; }
.task.overdue .when { color: var(--danger); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

.fresh-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: flex-start; }
.fresh-item:last-child { border-bottom: 0; }
.fresh-item:hover { background: var(--surface-2); }
.src-badge { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.timer { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.timer.late { background: var(--danger-soft); color: var(--danger); }

/* ===== טבלת לידים ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button .n { opacity: .6; margin-inline-start: 4px; font-size: 12px; }
.select { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 12px; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12px; padding: 12px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.grid td { padding: 12px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: var(--surface-2); }
.name-cell b { display: block; font-weight: 600; }
.name-cell span { color: var(--muted); font-size: 12px; }
table.grid td { white-space: nowrap; }
.next-cell { max-width: 200px; }
.next-cell .ellipsis { max-width: 200px; }
.table-wrap { overflow-x: auto; }
.next-cell .due { font-size: 12px; color: var(--muted); }
.next-cell .due.late { color: var(--danger); font-weight: 600; }
.lead-cards { display: none; }

/* ===== לוח שלבים ===== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #EBE8E4; border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .15s; }
.col.over { background: #DFE7EB; outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; }
.col-head b { font-weight: 600; }
.col-head .n { color: var(--muted); font-size: 12px; }
.col-head .sum { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard b { font-weight: 600; display: block; }
.kcard .org { color: var(--muted); font-size: 12px; }
.kcard .k-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; font-size: 12px; }
.kcard .k-next { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.kcard .k-next.late { color: var(--danger); }

/* ===== כרטיס ליד ===== */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.crumbs a:hover { color: var(--ink); }
.lead-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.lead-avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 600; flex: none; }
.lead-head h2 { font-size: 24px; }
.lead-head .lh-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.lead-head .lh-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lead-head .lh-meta .ic { width: 15px; height: 15px; }
.lead-actions { display: flex; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.stepper { display: flex; gap: 4px; margin-bottom: 22px; overflow-x: auto; }
.stepper button { flex: 1; min-width: 110px; border: 0; padding: 10px 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); border-radius: 8px; position: relative; }
.stepper button.done { background: var(--accent-soft); border-color: #CBD8DE; color: var(--accent); }
.stepper button.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper button:hover:not(.cur) { border-color: var(--accent); }
.lead-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; align-items: start; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.field div { font-weight: 500; }
.field.full { grid-column: 1 / -1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.next-box { border: 1.5px solid var(--accent); background: linear-gradient(180deg, #EEF3F5, #fff); }
.next-box.late { border-color: var(--danger); background: linear-gradient(180deg, #FFF5F4, #fff); }
.next-box .nb-title { font-size: 17px; font-weight: 600; margin: 4px 0; }
.next-box .nb-due { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.next-box.late .nb-due { color: var(--danger); font-weight: 600; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.quick button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.composer { display: flex; flex-direction: column; gap: 10px; }
.composer textarea { width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: 0; }
.composer textarea:focus { border-color: var(--accent); }
.timeline { position: relative; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; position: relative; }
.tl-item::before { content: ''; position: absolute; top: 40px; bottom: -12px; inset-inline-start: 15px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; z-index: 1; }
.tl-ic .ic { width: 15px; height: 15px; }
.tl-item .tl-text { color: var(--ink); }
.tl-item .tl-meta { color: var(--muted); font-size: 12px; }

/* ===== יומן ===== */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-head h3 { font-size: 18px; min-width: 150px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 10px; font-size: 12px; color: var(--muted); font-weight: 500; }
.cal .day { background: var(--surface); min-height: 118px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal .day.other { background: var(--surface-2); color: #B5B0AA; }
.cal .day .dn { font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.is-today .dn { background: var(--accent); color: #fff; }
.cal .ev { font-size: 11.5px; padding: 3px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.late { background: var(--danger-soft); color: var(--danger); }
.cal .ev.done { background: var(--line-2); color: var(--muted); }
.agenda { display: none; }

/* ===== דוחות ===== */
.rep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 60px; align-items: center; gap: 12px; }
.bar-row .track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar-row .val { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .f-row { display: flex; align-items: center; gap: 12px; }
.funnel .f-bar { height: 34px; background: var(--accent); border-radius: 8px; color: #fff; display: flex; align-items: center; padding: 0 12px; font-weight: 600; font-size: 13px; min-width: 40px; }
.funnel .f-label { width: 130px; color: var(--ink-2); flex: none; }

/* ===== הגדרות ===== */
.set-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav button { text-align: start; border: 0; background: none; padding: 10px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.set-nav button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.conn { display: flex; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); align-items: center; }
.conn:last-child { border-bottom: 0; }
.conn .src-badge { width: 44px; height: 44px; }
.on-chip { background: var(--ok-soft); color: var(--ok); }
.off-chip { background: var(--line-2); color: var(--muted); }

/* ===== מודלים ===== */
.overlay { position: fixed; inset: 0; background: rgba(5,40,56,.45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 24px 6px; }
.modal-head h3 { font-size: 18px; }
.modal-head .icon-btn { margin-inline-start: auto; }
.modal-sub { padding: 0 24px; color: var(--muted); }
.modal-body { padding: 18px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 16px 24px 20px; border-top: 1px solid var(--line-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inp { display: flex; flex-direction: column; gap: 5px; }
.inp label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.inp label i { color: var(--danger); font-style: normal; }
.inp input, .inp select, .inp textarea { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); outline: 0; width: 100%; }
.inp textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.inp input:focus, .inp select:focus, .inp textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.choice button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.hint { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; }

.popover { position: absolute; top: 46px; inset-inline-end: 0; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.popover .p-item { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.popover .p-item:hover { background: var(--surface-2); }
.popover .p-item:last-child { border-bottom: 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 200; display: flex; gap: 10px; align-items: center; animation: up .2s; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ===== מסך כניסה ===== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--side-bg); color: #fff; padding: var(--pad); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side h2 { font-size: 40px; line-height: 1.15; max-width: 460px; font-weight: 600; }
.login-side p { color: var(--side-ink); max-width: 420px; }
.login-side .stripes { position: absolute; inset-inline-end: -80px; bottom: -80px; width: 420px; height: 420px; border-radius: 50%; background: repeating-linear-gradient(135deg, #0A3044 0 18px, #062C3D 18px 36px); }
.login-form { display: grid; place-items: center; padding: var(--pad); background: var(--surface); }
.login-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 28px; }
.pw { position: relative; }
.pw .icon-btn { position: absolute; right: 4px; top: 3px; }
.pw input { padding-right: 44px; }
.login-side > *:not(.stripes) { position: relative; z-index: 1; }

/* ===== נייד ===== */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .today-grid, .lead-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --pad: 16px; }
  body { font-size: 15px; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .topbar { display: none; }
  .mobile-head { display: flex; align-items: center; gap: 10px; padding: 12px var(--pad); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mobile-head h1 { font-size: 18px; flex: 1; }
  .login-form .logo-form { display: block; }
  .content { padding: 18px var(--pad) 100px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 6px 0; border: 0; background: none; position: relative; }
  .bottom-nav .active { color: var(--accent); }
  .bottom-nav .ic { width: 22px; height: 22px; }
  .bottom-nav .fab { width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; margin: -18px auto 0; box-shadow: 0 6px 18px rgba(5,40,56,.35); }
  .bottom-nav .fab .ic { width: 22px; height: 22px; }
  .bottom-nav .badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; font-weight: 600; }
  .hello { flex-direction: column; align-items: stretch; margin-bottom: 18px; }
  .hello h2 { font-size: 22px; }
  .kpis { gap: 10px; margin-bottom: 18px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 24px; }
  .task { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
  .task .when { width: auto; order: -1; }
  .task .who { flex-basis: calc(100% - 90px); }
  .task .acts { width: 100%; }
  .task .acts .btn { flex: 1; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  table.grid { display: none; }
  .lead-cards { display: flex; flex-direction: column; }
  .lc { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
  .lc:last-child { border-bottom: 0; }
  .search { width: 100%; }
  .toolbar .select { flex: 1; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .lead-head { gap: 12px; }
  .lead-avatar { width: 46px; height: 46px; font-size: 17px; border-radius: 13px; }
  .lead-head { flex-wrap: nowrap; }
  .lead-head > div:nth-child(2) { flex: 1; min-width: 0; }
  .lead-head h2 { font-size: 20px; }
  .stepper { scrollbar-width: none; }
  .lead-actions { display: none; }
  .mobile-actions { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px; position: fixed; bottom: 0; inset-inline: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); z-index: 45; }
  .mobile-actions a, .mobile-actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 8px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
  .mobile-actions .call { background: var(--accent); color: #fff; border-color: var(--accent); }
  .mobile-actions .ic { width: 20px; height: 20px; }
  .lead-page .content-pad { padding-bottom: 90px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .cal, .cal-head { display: none; }
  .agenda { display: flex; flex-direction: column; gap: 16px; }
  .rep-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 90px 1fr 46px; }
  .funnel .f-label { width: 100px; font-size: 13px; }
  .set-grid { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; overflow-x: auto; }
  .set-nav button { white-space: nowrap; }
  .overlay { place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .form-row { grid-template-columns: 1fr; }
  .popover { position: fixed; top: 60px; inset-inline: 12px; width: auto; }
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .toast { bottom: 90px; width: calc(100% - 32px); }
}
.mobile-actions { display: none; }
