:root {
  --navy: #1E3570; --navy-2: #2B4A94; --green: #51D9A0; --green-ink: #12805A; --green-bg: #E3F8EE;
  --bg: #F3F6FC; --surface: #FFFFFF; --ink: #141B2D; --ink-2: #3E4A63; --muted: #5E6A84;
  --line: #E1E6F0; --red: #D12F2F; --red-bg: #FDECEC; --amber: #9A5B00; --amber-bg: #FFF3DE;
  --blue-bg: #E9EEFA; --radius: 16px; --shadow: 0 1px 2px rgba(20,27,45,.06), 0 4px 14px rgba(20,27,45,.06);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Open Sans', Arial, sans-serif; font-size: 17px; line-height: 1.45; }
body { overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }

/* טעינה */
.boot { position: fixed; inset: 0; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 50; }
.boot-t { font-size: 26px; font-weight: 800; }
.boot-s { opacity: .8; font-size: 15px; text-align: center; padding: 0 24px; }
.boot .btn-google { margin-top: 18px; }

/* כותרת עליונה */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; padding: calc(10px + var(--safe-t)) 16px 12px; display: flex; align-items: center; gap: 12px; }
.topbar .logo { height: 28px; width: auto; display: block; }
.topbar .grow { flex: 1; }
.topbar .who { text-align: left; line-height: 1.25; }
.topbar .who b { display: block; font-size: 15px; }
.topbar .who span { font-size: 13px; opacity: .8; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: var(--navy); font-weight: 800; display: grid; place-items: center; border: 0; font-size: 16px; }

main.view { padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 90px); max-width: 720px; margin: 0 auto; }
.h1 { font-size: 22px; font-weight: 800; margin: 6px 4px 2px; }
.sub { color: var(--muted); font-size: 15px; margin: 0 4px 12px; }
.sec { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 20px 4px 10px; }
.sec .count { background: var(--line); color: var(--ink-2); border-radius: 20px; padding: 1px 10px; font-size: 13px; }

/* סרגל ניווט תחתון */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); box-shadow: 0 -4px 16px rgba(20,27,45,.05); }
.tabbar button { flex: 1; height: var(--nav-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12.5px; font-weight: 600; position: relative; }
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { color: var(--navy); }
.tabbar button.on::before { content: ''; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.tabbar .badge { position: absolute; top: 7px; margin-right: 26px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

/* כרטיסי סיכום */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); border: 0; text-align: right; }
.kpi .n { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.red .n { color: var(--red); } .kpi.green .n { color: var(--green-ink); } .kpi.amber .n { color: var(--amber); }
.kpi.on { outline: 2px solid var(--navy); }

/* כרטיס לקוח */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.card-main { padding: 14px 16px 10px; cursor: pointer; }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-name { font-size: 17.5px; font-weight: 700; flex: 1; min-width: 0; }
.card-meta { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.task { display: flex; align-items: center; gap: 8px; margin-top: 10px; background: var(--blue-bg); border-radius: 10px; padding: 8px 10px; font-size: 15px; }
.task svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--navy); }
.task b { font-weight: 700; }
.task .when { margin-right: auto; font-weight: 700; color: var(--navy); white-space: nowrap; font-size: 14px; }
.task.late { background: var(--red-bg); } .task.late .when, .task.late svg { color: var(--red); }
.task.today { background: var(--green-bg); } .task.today .when, .task.today svg { color: var(--green-ink); }
.task.none { background: var(--amber-bg); color: var(--amber); }
.task.none svg { color: var(--amber); }
.card-actions { display: flex; border-top: 1px solid var(--line); }
.card-actions > * { flex: 1; height: 48px; border: 0; background: none; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 15px; color: var(--navy); text-decoration: none; }
.card-actions > * + * { border-right: 1px solid var(--line); }
.card-actions svg { width: 20px; height: 20px; }
.card-actions .wa { color: #128C4A; }
.card-actions .done { color: var(--green-ink); }
.card-actions .disabled { color: #B7BFCF; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--blue-bg); color: var(--navy); white-space: nowrap; }
.pill.st-ראשוני { background: #FCE8F1; color: #A3255A; }
.pill.st-בתהליך { background: #E6EFFC; color: #1D5BB4; }
.pill.st-לא-כרגע---בהמשך { background: var(--amber-bg); color: var(--amber); }
.pill.st-פעיל { background: var(--green-bg); color: var(--green-ink); }
.pill.st-לא-מעוניין { background: #EEF0F4; color: #5E6A84; }
.pill.agent { background: #EEF0F4; color: var(--ink-2); }
.pill.noagent { background: var(--amber-bg); color: var(--amber); }
.pill.meet { background: #EFE9FC; color: #5B3AB5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* חיפוש וסינון */
.searchbar { position: relative; }
.searchbar input { width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 46px 0 14px; font-size: 16.5px; }
.searchbar input:focus { outline: none; border-color: var(--navy); }
.searchbar svg { position: absolute; right: 14px; top: 14px; width: 22px; height: 22px; color: var(--muted); }
.toolbar { display: flex; gap: 8px; margin: 10px 0 4px; }
.toolbar select { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 6px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 38px; border-radius: 19px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.group-h { font-size: 15px; font-weight: 800; color: var(--navy); margin: 18px 4px 8px; display: flex; justify-content: space-between; }

/* יומן */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex-shrink: 0; width: 58px; height: 70px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-2); }
.day b { font-size: 21px; color: var(--ink); }
.day small { font-size: 12.5px; font-weight: 600; }
.day.on { background: var(--navy); color: #fff; } .day.on b { color: #fff; }
.day .dot { width: 6px; height: 6px; border-radius: 3px; background: var(--green); margin-top: 3px; }
.slot { display: flex; gap: 12px; }
.slot .time { width: 52px; flex-shrink: 0; font-weight: 800; color: var(--navy); padding-top: 14px; text-align: center; font-size: 15px; }
.slot .card { flex: 1; }

/* דוחות */
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--ink-2); font-size: 15px; }
.seg button.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); }
.rep { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 12px; }
.rep h3 { margin: 0 0 12px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini > div { background: var(--bg); border-radius: 12px; padding: 10px 8px; text-align: center; }
.mini .n { font-size: 22px; font-weight: 800; color: var(--navy); }
.mini .l { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.mini .red .n { color: var(--red); } .mini .green .n { color: var(--green-ink); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 100px; margin: 18px 0 6px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar i { display: block; width: 100%; max-width: 30px; background: var(--navy); border-radius: 4px 4px 0 0; }
.bar.today i { background: var(--green-ink); }
.bar b { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 3px; }
.bar b.hide { visibility: hidden; }
.daylbl { display: flex; gap: 8px; } .daylbl span { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 14px 0 8px; }
.stack i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--ink-2); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; background: var(--c); vertical-align: -1px; }
.subtle { font-size: 13px; color: var(--muted); text-align: center; margin: 18px 8px; }

/* חלונות (sheets) */
.scrim { position: fixed; inset: 0; background: rgba(12,18,35,.45); z-index: 30; animation: fade .15s; }
.sheet { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: 94vh; background: var(--surface); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; max-width: 720px; margin: 0 auto; }
.sheet.full { top: 0; max-height: none; border-radius: 0; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 16px 12px; border-bottom: 1px solid var(--line); }
.sheet:not(.full) .sheet-h { padding-top: 16px; }
.sheet-h h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex-shrink: 0; }
.iconbtn svg { width: 22px; height: 22px; }
.sheet-b { overflow-y: auto; padding: 14px 16px 20px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-f { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* טפסים */
.field { margin-bottom: 14px; }
.field > label, .lbl { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 10px 12px; font-size: 16.5px; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 42px; border-radius: 21px; border: 1.5px solid var(--line); background: var(--surface); padding: 6px 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.opt.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line); font-weight: 600; }
.toggle input { width: 24px; height: 24px; accent-color: var(--green-ink); }
.box { background: var(--bg); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.box h4 { margin: 0 0 10px; font-size: 15.5px; color: var(--navy); display: flex; align-items: center; gap: 6px; }
.btn { height: 52px; border-radius: 14px; border: 0; padding: 0 18px; font-weight: 800; font-size: 16.5px; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; text-decoration: none; }
.btn.green { background: var(--green); color: var(--navy); }
.btn.ghost { background: var(--bg); color: var(--ink-2); flex: 0 0 auto; }
.btn.light { background: var(--blue-bg); color: var(--navy); }
.btn:disabled { opacity: .55; }
.btn svg { width: 20px; height: 20px; }
.btn-google { background: #fff; color: #1f1f1f; height: 52px; border-radius: 26px; border: 0; padding: 0 24px; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; font-size: 16px; }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.quick a, .quick button { height: 64px; border-radius: 14px; border: 0; background: var(--blue-bg); color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; font-weight: 700; text-decoration: none; }
.quick svg { width: 22px; height: 22px; }
.quick .wa { background: #E2F6EA; color: #128C4A; }
.quick .done { background: var(--green); color: var(--navy); }
.quick .disabled { opacity: .4; pointer-events: none; }
.hist { position: relative; padding-right: 18px; }
.hist::before { content: ''; position: absolute; right: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.hist-i { position: relative; padding: 0 0 14px; font-size: 15px; }
.hist-i::before { content: ''; position: absolute; right: -17px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--surface); }
.hist-i .t { font-size: 13px; color: var(--muted); font-weight: 600; }
.list-edit .li { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line); }
.list-edit .li span { flex: 1; }
.list-edit .li button { border: 0; background: none; color: var(--red); font-size: 22px; width: 40px; height: 40px; }
.addrow { display: flex; gap: 8px; margin-top: 8px; }
.addrow input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 12px; }
.addrow button { height: 46px; border-radius: 12px; border: 0; background: var(--navy); color: #fff; padding: 0 16px; font-weight: 700; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; font-size: 16px; }
.empty b { display: block; font-size: 40px; margin-bottom: 6px; }
.fab { position: fixed; z-index: 15; left: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--green); color: var(--navy); box-shadow: 0 6px 18px rgba(18,128,90,.35); display: grid; place-items: center; }
.fab svg { width: 30px; height: 30px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; background: var(--ink); color: #fff; border-radius: 24px; padding: 11px 20px; font-size: 15px; font-weight: 600; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.err { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.offline { background: var(--amber-bg); color: var(--amber); text-align: center; font-size: 13.5px; font-weight: 700; padding: 6px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(6, 1fr); } }

/* עוזר AI */
.aibtn { height: 38px; border-radius: 19px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 14px; padding: 0 12px; white-space: nowrap; }
.ai-body { background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.5; word-wrap: break-word; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul { margin: 4px 0; padding-right: 20px; } .ai-msg li { margin: 3px 0; }
.ai-msg.user { align-self: flex-start; background: var(--navy); color: #fff; border-bottom-right-radius: 6px; }
.ai-msg.assistant { align-self: flex-end; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.ai-msg.error { align-self: center; background: var(--red-bg); color: var(--red); font-size: 14px; font-weight: 600; }
.ai-msg.typing { display: flex; gap: 5px; padding: 14px 16px; }
.ai-msg.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.ai-msg.typing span:nth-child(2) { animation-delay: .2s; } .ai-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-hello { text-align: center; padding: 26px 10px 6px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ai-hello b { font-size: 18px; } .ai-hello span { color: var(--muted); font-size: 15px; }
.ai-orb { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--green)); display: grid; place-items: center; font-size: 30px; margin-bottom: 6px; }
.ai-sugs { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.ai-sugs button { text-align: right; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 10px 14px; font-size: 15.5px; font-weight: 600; color: var(--navy); }
.ai-input { align-items: flex-end; }
.ai-input textarea { flex: 1; min-height: 50px; max-height: 120px; border-radius: 16px; border: 1.5px solid var(--line); padding: 12px 14px; font-size: 16.5px; resize: none; }
.ai-input textarea:focus { outline: none; border-color: var(--navy); }
.ai-send { flex: 0 0 52px; width: 52px; padding: 0; font-size: 20px; transform: scaleX(-1); }
.ai-conv { width: 100%; text-align: right; background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.ai-conv small { color: var(--muted); }
@media (max-width: 420px) { .topbar .who { display: none; } }
.ai-mic { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--blue-bg); color: var(--navy); display: grid; place-items: center; }
.ai-mic.rec { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(209,47,47,.5); } 70% { box-shadow: 0 0 0 14px rgba(209,47,47,0); } 100% { box-shadow: 0 0 0 0 rgba(209,47,47,0); } }
.done-task { display: flex; gap: 12px; align-items: center; background: var(--green-bg); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; color: var(--green-ink); }
.done-task > svg { width: 30px; height: 30px; flex-shrink: 0; background: var(--green); color: var(--navy); border-radius: 50%; padding: 6px; }
.done-task div { display: flex; flex-direction: column; } .done-task b { font-size: 17px; color: var(--ink); } .done-task small { font-size: 13px; font-weight: 600; }
.done-task.none { background: var(--blue-bg); color: var(--navy); }
.quick a, .quick button { font-size: 12.5px; }
.quick .maps { background: #E8F0FE; color: #1A73E8; }
.card-addr { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; color: #1A73E8; text-decoration: none; font-weight: 600; }
.card-addr svg { width: 16px; height: 16px; flex-shrink: 0; }

.addr-wrap { position: relative; }
.addr-wrap > svg { position: absolute; right: 12px; top: 14px; width: 22px; height: 22px; color: #1A73E8; pointer-events: none; }
.field .addr-wrap input { padding-right: 42px; }
.addr-sug { background: var(--surface); border-radius: 12px; box-shadow: 0 8px 24px rgba(20,27,45,.16); margin-top: 6px; overflow: hidden; }
.addr-sug:empty { display: none; }
.addr-sug button { width: 100%; text-align: right; border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.addr-sug button:last-child { border-bottom: 0; }
.addr-sug button b { font-size: 15.5px; } .addr-sug button small { color: var(--muted); font-size: 13px; }
.addr-sug button:active { background: var(--blue-bg); }
.addr-err { padding: 11px 14px; color: var(--muted); font-size: 14px; }
.addr-sel { font-size: 13px; font-weight: 600; color: var(--amber); margin-top: 6px; }
.addr-sel.ok { color: var(--green-ink); }

/* חלקים נפתחים */
details.sec-box { padding: 0; }
details.sec-box > summary { list-style: none; cursor: pointer; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 54px; }
details.sec-box > summary::-webkit-details-marker { display: none; }
details.sec-box > summary h4 { margin: 0; }
details.sec-box > summary::after { content: ''; width: 10px; height: 10px; border-left: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy); transform: rotate(-45deg); transition: transform .2s; margin-left: 4px; flex-shrink: 0; }
details.sec-box[open] > summary::after { transform: rotate(135deg); }
details.sec-box > .sec-body { padding: 0 14px 14px; }
/* לידים */
.lead-actions { display: flex; flex-direction: column; gap: 8px; }
.lead-actions .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lead-actions .btn { width: 100%; }
.card.lead .card-main { cursor: default; }
.ls-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.ls-item input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green-ink); flex-shrink: 0; }
.ls-item div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ls-item small { color: var(--muted); font-size: 13px; }
.ls-item.dim { opacity: .55; }

/* דף הבית */
.hero { background: linear-gradient(140deg, #1E3570 0%, #2B4A94 62%, #2f7f8a 100%); color: #fff; border-radius: 22px; padding: 18px 18px 14px; margin: 4px 0 14px; box-shadow: 0 8px 24px rgba(30,53,112,.25); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: -40px; bottom: -60px; width: 170px; height: 170px; border-radius: 50%; background: rgba(81,217,160,.18); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-date { font-size: 13.5px; opacity: .8; font-weight: 600; }
.hero-hello { font-size: 23px; font-weight: 800; margin-top: 2px; }
.ring { --p: 0; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(#51D9A0 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); display: grid; place-items: center; }
.ring > div { width: 58px; height: 58px; border-radius: 50%; background: #23407f; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring b { font-size: 20px; } .ring small { font-size: 11px; opacity: .8; }
.hero-quote { margin: 14px 0 10px; font-size: 17px; font-weight: 700; line-height: 1.45; position: relative; z-index: 1; }
.hero-line { font-size: 14.5px; opacity: .92; position: relative; z-index: 1; }
.hero-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.hero-actions button { border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12.5px; font-weight: 700; }
.hero-actions button svg { width: 22px; height: 22px; }
.hero-actions button:active { background: rgba(255,255,255,.24); }

/* דף פתיחה */
#welcome { position: fixed; inset: 0; z-index: 70; background: linear-gradient(160deg, #142757 0%, #1E3570 45%, #2B4A94 75%, #2f8a7e 100%); color: #fff; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-t)) 22px calc(24px + var(--safe-b)); opacity: 0; transition: opacity .35s; overflow-y: auto; }
#welcome.show { opacity: 1; } #welcome.hide { opacity: 0; }
#welcome::before { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(81,217,160,.13); top: -90px; left: -110px; }
#welcome::after { content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.05); bottom: -70px; right: -80px; }
.wl-inner { position: relative; z-index: 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; transform: translateY(14px); transition: transform .45s ease-out; }
#welcome.show .wl-inner { transform: none; }
.wl-logo .logo { height: 34px; width: auto; }
.wl-date { font-size: 15px; opacity: .8; font-weight: 600; margin-top: 10px; }
.wl-hello { font-size: 34px; font-weight: 800; line-height: 1.2; }
.wl-quote { position: relative; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 22px; padding: 26px 20px 18px; font-size: 21px; font-weight: 700; line-height: 1.5; }
.wl-q { position: absolute; top: -14px; right: 18px; font-size: 64px; line-height: 1; color: #51D9A0; font-family: Georgia, serif; }
.wl-qlbl { margin-top: 12px; font-size: 13px; font-weight: 600; color: #8EEBC4; }
.wl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wl-stats div { background: rgba(255,255,255,.1); border-radius: 16px; padding: 12px 6px; text-align: center; }
.wl-stats b { display: block; font-size: 28px; font-weight: 800; }
.wl-stats span { font-size: 13px; opacity: .85; font-weight: 600; }
.wl-stats .red b { color: #FF9C9C; }
.wl-go { margin-top: 6px; height: 58px; border: 0; border-radius: 29px; background: #51D9A0; color: #1E3570; font-size: 19px; font-weight: 800; box-shadow: 0 8px 20px rgba(81,217,160,.35); }
.wl-go:active { transform: scale(.98); }

/* ===== ליטוש עיצוב ===== */
/* מסך כניסה */
.boot { background: linear-gradient(160deg, #142757 0%, #1E3570 50%, #2B4A94 80%, #2f8a7e 100%); }
.login-card { width: min(92vw, 400px); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px; }
.login-logo .logo { height: 40px; width: auto; }
.login-t { font-size: 28px; font-weight: 800; margin-top: 10px; color: #fff; }
.login-s { font-size: 16px; opacity: .85; color: #fff; }
.login-f { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.login-f li { background: rgba(255,255,255,.1); border-radius: 14px; padding: 11px 14px; font-size: 15.5px; font-weight: 600; color: #fff; text-align: right; }
.login-card .btn-google { width: 100%; justify-content: center; height: 56px; font-size: 17px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.login-n { font-size: 13px; opacity: .7; color: #fff; margin-top: 4px; }
.boot > img, .boot > .boot-t { display: none; }
.boot .boot-s { width: 100%; display: flex; justify-content: center; }
/* תגובה למגע וחידוד כללי */
.topbar { box-shadow: 0 2px 12px rgba(20,27,45,.18); }
.card { border: 1px solid rgba(225,230,240,.7); transition: transform .12s; }
.card-main:active { background: #FAFBFE; }
.kpi, .chip, .opt, .btn, .card-actions > *, .quick a, .quick button, .hero-actions button, .day { transition: transform .1s, background .15s; }
.kpi:active, .chip:active, .opt:active, .btn:active, .day:active { transform: scale(.97); }
.card-actions > *:active { background: var(--bg); }
.tabbar button.on { color: var(--navy); }
.tabbar button.on svg { background: var(--blue-bg); border-radius: 12px; padding: 3px 12px; box-sizing: content-box; width: 22px; height: 22px; }
.sec { letter-spacing: .1px; }
.sheet-h { box-shadow: 0 1px 0 var(--line); }
.empty b { font-size: 46px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* ניהול סטטוסים */
.st-row { gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.st-row .pill { font-size: 13.5px; }
.st-n { color: var(--muted); font-size: 12.5px; flex: 1; }
.st-closed { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.st-closed input { width: 18px; height: 18px; accent-color: var(--navy); }
.list-edit .li .st-btn { color: var(--navy); font-size: 15px; width: 34px; height: 34px; border-radius: 8px; background: var(--bg); }
.list-edit .li .st-btn:disabled { opacity: .3; }
.st-lock { width: 34px; text-align: center; opacity: .6; }

/* ===== מחשב / מסך רחב: תפריט צד, תוכן רחב וכרטיסים בשתי עמודות ===== */
@media (min-width: 1024px) {
  :root { --rail: 104px; --top-h: 52px; }
  .tabbar { top: var(--top-h); bottom: 0; right: 0; left: auto; width: var(--rail); flex-direction: column; justify-content: flex-start; padding: 14px 0 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .tabbar button { flex: 0 0 auto; height: 78px; font-size: 13px; }
  .tabbar button.on::before { top: 50%; right: 0; transform: translateY(-50%); width: 3px; height: 40px; border-radius: 3px 0 0 3px; }
  .tabbar .badge { top: 10px; }
  main.view { max-width: none; margin: 0 var(--rail) 0 0; padding: 24px max(28px, calc((100vw - var(--rail) - 1120px) / 2)) 48px;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  main.view > *:not(.card) { grid-column: 1 / -1; }
  .fab { bottom: 28px; left: 28px; }
  .toast { bottom: 28px; }
  .card-main:hover { background: var(--bg); }
}

/* ===== דוחות: לשוניות, טווח תאריכים, טבלאות ושורות ===== */
.rep-tabs { margin: 10px 0 6px; overflow-x: auto; scrollbar-width: none; }
.rep-tabs button { flex: 1 0 auto; padding: 0 10px; font-size: 14.5px; }
.range-row { display: flex; gap: 10px; margin: 6px 2px 4px; }
.range-row label { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.range-row input { flex: 1; min-width: 0; width: 100%; padding: 0 6px !important; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); }
.rtable-wrap { overflow-x: auto; margin: 0 -4px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rtable th { font-size: 12.5px; color: var(--muted); font-weight: 700; text-align: center; padding: 6px 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.rtable td { text-align: center; padding: 9px 6px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.rtable td.nm, .rtable th:first-child { text-align: right; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable .g, .rtable .a, .rtable .r { font-weight: 800; }
.rtable .g { color: var(--green-ink); } .rtable .a { color: var(--amber); } .rtable .r { color: var(--red); }
.rday { font-size: 14px; font-weight: 800; color: var(--navy); margin: 14px 0 4px; display: flex; gap: 8px; align-items: center; }
.rday:first-child { margin-top: 0; }
.rday span { background: var(--line); color: var(--ink-2); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.rrow { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.rrow:last-child { border-bottom: 0; }
.rrow .rt { flex: 0 0 56px; font-size: 13.5px; font-weight: 800; color: var(--ink-2); padding-top: 2px; }
.rrow .rt.late { color: var(--red); } .rrow .rt.ok { color: var(--green-ink); }
.rrow .rb { flex: 1; min-width: 0; font-size: 15px; }
.rrow .rx { color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.rrow small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.rlink { color: var(--navy); font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.pill.k { background: #EEF0F4; color: var(--ink-2); font-size: 11.5px; padding: 1px 8px; }
.ontime-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.ontime-hero .big { font-size: 40px; font-weight: 800; color: var(--navy); line-height: 1; }
.ontime-hero .big.green { color: var(--green-ink); } .ontime-hero .big.amber { color: var(--amber); } .ontime-hero .big.red { color: var(--red); }
.pbar { flex-basis: 100%; display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--line); }
.pbar .ok { background: var(--green); } .pbar .bad { background: #E5484D; }
.srow { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; }
.srow > span:first-child { flex: 0 0 auto; min-width: 110px; }
.srow .sbar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.srow .sbar i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.srow b { min-width: 34px; text-align: left; }
.srow small { color: var(--muted); min-width: 34px; }
.btn.exp { width: 100%; margin: 16px 0 6px; }
@media (min-width: 1024px) { main.view > .kpis { grid-template-columns: repeat(6, 1fr); } }
