:root {
  --navy: #1b4f8f;
  --navy-dark: #123866;
  --magenta: #e5267a;
  --yellow: #ffe100;
  --cyan: #29a9e1;
  --green: #2ea44f;
  --red: #d93b3b;
  --orange: #f08c00;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1c2433;
  --muted: #6b7486;
  --line: #e3e7ef;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 40, 80, .08), 0 4px 14px rgba(20, 40, 80, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); text-decoration: none; }

/* ---------- Shell ---------- */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 84px; position: relative; }
.shell.wide { max-width: 1180px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
}
.topbar img.logo { height: 34px; }
.topbar .title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar .back { background: none; border: 0; font-size: 22px; padding: 4px 8px; cursor: pointer; color: var(--navy); }
.role-pill {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}

.cmyk-bar { height: 4px; background: linear-gradient(90deg, var(--cyan) 0 25%, var(--magenta) 25% 50%, var(--yellow) 50% 75%, #222 75%); }

.page { padding: 16px; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 10px; font-size: 12px; color: var(--muted);
}
.bottomnav a .ic { font-size: 21px; line-height: 1; position: relative; }
.bottomnav a.active { color: var(--navy); font-weight: 700; }

/* ---------- Cards & lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 8px; font-weight: 700; }
.section-title a { font-weight: 500; font-size: 14px; }

.hello { background: linear-gradient(135deg, var(--navy), var(--navy-dark)); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.hello h2 { margin: 0 0 4px; font-size: 21px; }
.hello p { margin: 0; opacity: .85; }
.hello .dots { position: absolute; left: -18px; top: -18px; width: 110px; height: 110px; opacity: .9; }
.hello .dots span { position: absolute; width: 56px; height: 56px; border-radius: 50%; mix-blend-mode: screen; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; color: var(--navy); }
.stat .lbl { font-size: 12px; color: var(--muted); }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a, .quick button {
  background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text);
}
.quick .ic { font-size: 24px; }

.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--bg); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: left; font-size: 13px; color: var(--muted); white-space: nowrap; }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 17px;
}
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-lead { background: #e8f4fc; color: #1673a8; }
.b-work { background: #fff5d6; color: #8a6a00; }
.b-quote { background: #fde8f1; color: #b5195c; }
.b-active { background: #e3f6e8; color: #1d7a37; }
.b-lost { background: #eceef2; color: #6b7486; }
.b-pending { background: #fff1e0; color: #b25f00; }
.b-ok { background: #e3f6e8; color: #1d7a37; }
.b-no { background: #fde7e7; color: #b42323; }

/* ---------- Chips / search ---------- */
.search { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 14px; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--bg); color: var(--navy); border: 1px solid var(--line); }
.btn.magenta { background: var(--magenta); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

.fab {
  position: fixed; bottom: 86px; z-index: 25;
  left: max(16px, calc(50% - 224px));
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--magenta); color: #fff; font-size: 28px; box-shadow: 0 6px 18px rgba(229, 38, 122, .4); cursor: pointer;
}

/* ---------- Customer page ---------- */
.cust-head { text-align: center; padding: 18px 16px 6px; }
.cust-head .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 18px; margin: 0 auto 8px; }
.cust-head h2 { margin: 0; font-size: 21px; }
.cust-head .sub { color: var(--muted); margin: 2px 0 8px; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 14px; }
.actions a, .actions button {
  background: var(--card); border: 0; border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; cursor: pointer; color: var(--text);
}
.actions .ic { font-size: 20px; }

.checkin-btn {
  width: 100%; border: 0; border-radius: 16px; padding: 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--green), #23863f); color: #fff;
  font-size: 18px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 18px rgba(46, 164, 79, .35); margin-bottom: 14px;
}

.info-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.info-grid .k { color: var(--muted); }

.timeline { position: relative; padding-right: 22px; }
.timeline::before { content: ''; position: absolute; right: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before {
  content: ''; position: absolute; right: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--cyan);
}
.tl-item.visit::before { border-color: var(--green); }
.tl-item.quote::before { border-color: var(--magenta); }
.tl-item .when { font-size: 12px; color: var(--muted); }
.tl-item .what { font-weight: 700; }
.tl-item .txt { font-size: 14px; margin-top: 2px; }
.geo-ok { color: var(--green); font-size: 12px; font-weight: 500; }
.geo-far { color: var(--orange); font-size: 12px; font-weight: 500; }

/* ---------- Forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px;
}
.field textarea { min-height: 80px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.field input:disabled { background: var(--bg); color: var(--muted); }

/* ---------- Quote builder ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.prod {
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; text-align: center;
}
.prod .ic { font-size: 24px; }
.prod.on { border-color: var(--magenta); background: #fff5f9; }
.line-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .main { flex: 1; }
.line-item .t { font-weight: 700; }
.line-item .s { font-size: 13px; color: var(--muted); }
.line-item .p { font-weight: 700; white-space: nowrap; }
.line-item .x { background: none; border: 0; color: var(--red); cursor: pointer; font-size: 18px; padding: 0 4px; }
.totals { font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 19px; font-weight: 800; color: var(--navy); border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; }
.calc-price { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.calc-price b { font-size: 18px; color: var(--navy); }
.warn { background: #fff4e5; color: #8a4b00; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }

/* ---------- Quote document (PDF look) ---------- */
.qdoc { background: #fff; border-radius: 6px; box-shadow: var(--shadow); padding: 22px 20px; font-size: 13px; }
.qdoc .qhead { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 12px; gap: 10px; }
.qdoc .qhead img { height: 48px; }
.qdoc .qhead .meta { text-align: left; font-size: 12px; color: var(--muted); }
.qdoc .qhead .meta b { display: block; color: var(--text); font-size: 15px; }
.qdoc table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.qdoc th { background: var(--navy); color: #fff; font-weight: 500; padding: 7px 6px; text-align: right; font-size: 12px; }
.qdoc td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qdoc td.num, .qdoc th.num { text-align: left; white-space: nowrap; }
.qdoc .foot { margin-top: 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.qdoc .cmyk-bar { margin: -22px -20px 16px; border-radius: 6px 6px 0 0; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 25, 45, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal {
  background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s;
}
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -6px auto 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

.geo-status { text-align: center; padding: 14px 6px; }
.geo-status .big { font-size: 46px; }
.geo-status .t { font-weight: 800; font-size: 18px; margin: 6px 0 2px; }
.geo-status .s { color: var(--muted); font-size: 14px; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c2433; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; max-width: 420px; margin: 0 auto; }
.login img { width: 100%; max-width: 320px; margin-bottom: 10px; }
.login .role-card {
  width: 100%; background: var(--card); border: 2px solid transparent; border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: right;
}
.login .role-card:hover { border-color: var(--cyan); }
.login .role-card .ic { font-size: 34px; }
.login .role-card b { display: block; font-size: 17px; }
.login .role-card span { color: var(--muted); font-size: 13px; }
.login .note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 10px; }

/* ---------- Manager ---------- */
.m-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; border-top: 4px solid var(--cyan); }
.kpi:nth-child(2) { border-top-color: var(--magenta); }
.kpi:nth-child(3) { border-top-color: var(--yellow); }
.kpi:nth-child(4) { border-top-color: var(--navy); }
.kpi .num { font-size: 26px; font-weight: 800; }
.kpi .lbl { color: var(--muted); font-size: 13px; }
.map { height: 340px; border-radius: var(--radius); overflow: hidden; z-index: 1; }
.leaflet-container { font-family: inherit; }
.vpin {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.vpin.far { background: var(--orange); }
.map.mini { height: 200px; }
.cpin {
  width: 26px; height: 26px; background: var(--magenta); border: 3px solid #fff;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.nav-btn { border: 0; background: var(--bg); border-radius: 10px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; flex-shrink: 0; }
.btn.waze { background: #33ccff; color: #0b2a3a; }
.btn.danger { color: var(--red); margin-top: 4px; }
.day-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mnav { display: flex; gap: 6px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.mnav a { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.mnav a.active { background: var(--navy); color: #fff; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.bar-row .lbl { width: 90px; flex-shrink: 0; }
.bar-row .bar { flex: 1; height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; border-radius: 6px; }
.bar-row .v { width: 34px; text-align: left; font-weight: 700; }

@media (min-width: 900px) {
  .shell.wide { padding-bottom: 20px; }
  .m-grid { grid-template-columns: 1.4fr 1fr; }
  .m-grid .full { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .map { height: 420px; }
}

@media print {
  body { background: #fff; }
  .topbar, .bottomnav, .no-print, .fab, .cmyk-bar.top { display: none !important; }
  .shell { padding: 0; max-width: none; }
  .page { padding: 0; }
  .qdoc { box-shadow: none; }
}

/* ---------- בקשות, לו"ז ותוצאות מפגש ---------- */
.nav-badge {
  position: absolute; top: -6px; left: -10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border-radius: 12px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.prod-radio input { display: none; }
.prod-radio .prod { height: 100%; }
.prod-radio input:checked + .prod { border-color: var(--magenta); background: #fff5f9; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.pick input { display: none; }
.pick span { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.pick input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; direction: ltr; gap: 2px; }
.rate input { display: none; }
.rate label { font-size: 30px; color: #d6dae3; cursor: pointer; line-height: 1; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: #f5b400; }
.stars { color: #f5b400; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.outcome { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.note-box { margin-top: 12px; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 14px; white-space: pre-wrap; }
.progress { display: flex; height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.progress span { background: var(--green); transition: width .3s; }
.progress span.skip { background: #c9ced8; }
.plan-list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.plan-item { display: flex; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border-bottom: 0; }
.plan-item .main { flex: 1; min-width: 0; }
.plan-item .t { font-weight: 700; }
.plan-item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.plan-item.done { background: #f3fbf5; }
.plan-item.skipped { opacity: .65; }
.plan-check { width: 30px; flex-shrink: 0; font-size: 22px; text-align: center; }
.plan-check .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--navy); color: var(--navy); font-weight: 800; font-size: 14px; }
.plan-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.next-stop { margin-top: 12px; border: 2px solid var(--green); border-radius: 12px; padding: 10px 12px; }
.next-stop .s { font-size: 13px; color: var(--muted); }
.vpin.todo { background: #fff; color: var(--navy); border-color: var(--navy); }

/* ---------- מנהל: תצוגת מחשב ---------- */
.mgr { display: flex; min-height: 100vh; background: var(--bg); }
.side {
  width: 236px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; z-index: 40;
  background: linear-gradient(180deg, #164274, #0e2c52); color: #fff;
  display: flex; flex-direction: column; padding: 16px 12px;
}
.side-logo { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 18px; }
.side-logo img { width: 100%; display: block; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #c7d5ea; font-weight: 500; }
.side nav a .ic { font-size: 18px; width: 22px; text-align: center; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a.active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.side-badge { margin-right: auto; background: var(--magenta); color: #fff; border-radius: 9px; min-width: 20px; height: 20px; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.side-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; }
.side-user:hover { background: rgba(255, 255, 255, .14); }
.side-user .avatar { width: 36px; height: 36px; font-size: 15px; }
.side-user span { display: block; font-size: 12px; opacity: .75; }
.mgr-main { flex: 1; min-width: 0; }
.mgr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 28px 4px; }
.mgr-head h1 { margin: 0; font-size: 24px; }
.mgr-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.mgr-content { padding: 16px 28px 32px; max-width: 1320px; }
/* עמודי פירוט (לקוח, הצעה...) בתוך המסגרת */
.mgr-sub .cmyk-bar.top, .mgr-sub .role-pill, .mgr-sub .bottomnav { display: none !important; }
.mgr-sub .topbar { background: transparent; border: 0; padding: 20px 24px 0; position: static; }
.mgr-sub .topbar .title { font-size: 22px; font-weight: 800; }
.mgr-sub .shell { max-width: 880px; margin: 0; padding: 0 8px 32px; min-height: 0; background: transparent; }
.mgr .fab { left: 28px; bottom: 28px; }
.mgr .modal-bg, .modal-bg { align-items: flex-end; }
@media (min-width: 900px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: 18px; max-width: 520px; }
  .modal .grip { display: none; }
  .mgr .kpi .num { font-size: 30px; }
}
@media (max-width: 899px) {
  .mgr { flex-direction: column; }
  .side { width: auto; height: auto; flex-direction: row; align-items: center; padding: 8px; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .side-logo { display: none; }
  .side nav { flex-direction: row; gap: 4px; }
  .side nav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .side-user { margin: 0; padding: 6px; flex-shrink: 0; }
  .side-user div { display: none; }
  .mgr-head { padding: 16px 16px 0; }
  .mgr-head h1 { font-size: 20px; }
  .mgr-content { padding: 12px 16px 28px; }
  .mgr-sub .topbar { padding: 12px 12px 0; }
}

/* ---------- טבלאות ---------- */
.tbl-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: #f5f8fd; }
.tbl tr.urgent td { background: #fff6f9; }
.tbl .muted { color: var(--muted); }
.tbl .s { font-size: 12px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who .avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }

/* ---------- עובד: חוויית אפליקציה בטלפון ---------- */
.bottomnav a { position: relative; }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--magenta); }
.bottomnav a.active .ic { transform: translateY(-1px); }
.topbar { padding-top: max(10px, env(safe-area-inset-top)); }
button, a, .row, .chip { touch-action: manipulation; }
@media (max-width: 600px) {
  /* מונע זום אוטומטי באייפון בלחיצה על שדה */
  input, select, textarea, .search { font-size: 16px !important; }
}
@media (display-mode: standalone) {
  .cmyk-bar.top { height: 3px; }
}
.install-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #fff, #f2f7ff); border: 1px solid #d9e6f7; }
.install-card img { width: 46px; height: 46px; border-radius: 12px; }
@media (min-width: 700px) {
  /* עובד שפותח במחשב – רואה את האפליקציה במסגרת של טלפון */
  body:not(.is-manager) { background: linear-gradient(135deg, #e9eef7, #f6f0f4); }
  body:not(.is-manager) .shell:not(.wide) { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(20, 40, 80, .08); }
}
.topbar .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .role-pill { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }

/* ---------- צ'ק ליסט יומי ---------- */
.ck { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--navy); color: var(--navy); font-weight: 800; font-size: 14px; background: #fff; }
.ck.ok { background: var(--green); border-color: var(--green); color: #fff; font-size: 17px; }
.ck.no { background: #fde7e7; border-color: var(--red); color: var(--red); font-size: 15px; }
.plan-item.next { background: #f1f8ff; box-shadow: inset -4px 0 0 var(--cyan); }
.plan-item.skipped { opacity: 1; background: #fff8f8; }
.plan-item.skipped .t a { color: var(--muted); }
.here { display: inline-block; background: var(--cyan); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; }
.st { font-size: 13px; font-weight: 700; margin-top: 6px; }
.st.ok { color: var(--green); }
.st.no { color: var(--red); }
.st.wait { color: var(--muted); font-weight: 500; }
.ck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ck-actions .btn { padding: 11px 8px; }
.danger-btn { color: var(--red) !important; border-color: #f3c9c9 !important; background: #fff !important; }
.link-btn { background: none; border: 0; color: var(--navy); font-size: 13px; padding: 4px 2px; cursor: pointer; font-weight: 500; }
.skip-form { margin-top: 10px; background: #fff; border: 1px solid #f3c9c9; border-radius: 12px; padding: 10px; }
.skip-note { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-top: 8px; }

/* ---------- אייקונים במפה ---------- */
.cust-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); display: grid; place-items: center; }
.cust-pin span { transform: rotate(45deg); color: #fff; font-weight: 800; font-size: 14px; font-family: Heebo, sans-serif; }
.me-pin { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.me-pin .av { position: relative; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-family: Heebo, sans-serif; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.me-pin .pulse { position: absolute; inset: 0; border-radius: 50%; background: var(--c); opacity: .25; }
.me-pin.fresh .pulse { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.8); opacity: 0; } }
.leaflet-tooltip.me-tip { font-family: Heebo, sans-serif; font-weight: 700; font-size: 12px; direction: rtl; padding: 3px 8px; border-radius: 999px; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.map-pop { font-family: Heebo, sans-serif; font-size: 13px; line-height: 1.6; min-width: 170px; }
.map-pop .s { color: var(--muted); font-size: 12px; }
.pop-actions { display: flex; gap: 12px; margin-top: 6px; }
.pop-actions a { font-weight: 700; }
.map.big { height: calc(100vh - 290px); min-height: 360px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 5px; vertical-align: middle; }
.map-legend i.me { background: #fff; border: 3px solid var(--navy); width: 12px; height: 12px; }
.vpin.far { background: var(--orange); }
.comm-card { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #effaf2, #fff); border: 1px solid #cdebd6; cursor: pointer; }
.comm-card b { display: block; font-size: 22px; color: var(--green); text-align: left; }
.comm-card span { font-size: 12px; color: var(--muted); }
.m-grid > * { min-width: 0; }
.card h3 { flex-wrap: wrap; gap: 6px; }
.mgr-main { overflow-x: hidden; }

/* ---------- אנשי קשר ---------- */
.contact { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.contact:last-of-type { border-bottom: 0; }
.contact .main { flex: 1; min-width: 0; cursor: pointer; }
.contact .t { font-weight: 700; font-size: 14px; }
.contact .s, .s { font-size: 13px; color: var(--muted); }
.contact.root .t::before { content: '🤝 '; }
.contact .chain { color: var(--cyan); font-weight: 800; font-size: 18px; }

/* ---------- קבצי עיצוב ---------- */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.file { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.file img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--bg); }
.file .ficon { height: 110px; display: grid; place-items: center; font-size: 42px; background: var(--bg); }
.file .fname { font-size: 12px; padding: 6px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .factions { font-size: 12px; padding: 2px 8px 8px; }
.seg { display: flex; }
.seg button { flex: 1; }

/* ---------- מנהל בטלפון: כותרת עליונה ותפריט תחתון ---------- */
.mgr-mtop, .mgr-bottom { display: none !important; }
@media (max-width: 899px) {
  .side { display: none; }
  .mgr-mtop {
    display: flex !important; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line);
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  }
  .mgr-mtop img { height: 34px; }
  .mgr-bottom { display: grid !important; grid-template-columns: repeat(5, 1fr); }
  .mgr-main { padding-bottom: 84px; }
  .mgr .fab { bottom: 86px; left: 16px; }
  .mgr-sub .topbar { padding: 8px 8px 0; }
}

/* ---------- דוח ביקור ---------- */
.vr-sec { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.vr-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.vr-sec select, .vr-input, .vr-person input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; }
.vr-person { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.vr-person input:first-child { grid-column: 1 / -1; }
.ref-row { background: #fff; border: 1px dashed var(--cyan); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.pick input[type=checkbox] { display: none; }
.pick input[type=checkbox]:checked + span { background: var(--magenta); color: #fff; border-color: var(--magenta); }

/* ---------- כדאי לטפל היום ---------- */
.row.opp { align-items: flex-start; cursor: default; }
.opp-ic { font-size: 24px; line-height: 1.2; }
.opp .main { cursor: pointer; }
.opp-actions { display: flex; gap: 4px; flex-shrink: 0; }
.opp-actions .nav-btn { width: 34px; height: 34px; font-size: 16px; display: grid; place-items: center; }
.quick { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a, .quick button { padding: 12px 4px; font-size: 12px; }

/* ---------- שרשרת האנשים ---------- */
.chain-box { display: flex; flex-direction: column; }
.chain-step { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 2px solid #d9e6f7; border-radius: 14px; padding: 10px; }
.chain-step.view { align-items: center; }
.chain-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; }
.chain-body { flex: 1; min-width: 0; }
.chain-label { font-weight: 700; font-size: 13px; color: var(--navy); margin-bottom: 6px; }
.chain-body select, .chain-fields input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; margin-bottom: 6px; }
.chain-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; }
.chain-fields .ch-name { grid-column: 1 / -1; }
.chain-arrow { text-align: center; color: var(--magenta); font-weight: 800; font-size: 13px; padding: 6px 0; }
.chain-add { margin-top: 10px; border: 2px dashed var(--magenta); background: #fff5f9; color: var(--magenta); border-radius: 12px; padding: 11px; font-weight: 800; cursor: pointer; }
.chain-del { color: var(--red) !important; padding: 0; }
.chain-note { padding: 4px 42px 0 0; }

/* מחיקת הצעות */
.q-check { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; }
.tbl tr.sel td { background: #fff1f3; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff1f3; border: 1px solid #f5c2cb; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.bulk-bar b { margin-left: auto; }

/* כפתור סגירה בכל חלון קופץ – נשאר למעלה גם כשגוללים טופס ארוך */
.modal-x { position: sticky; top: 0; float: left; z-index: 3; width: 36px; height: 36px; margin: -6px -4px 0 0; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink, #1d2939); font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.modal-x:hover { background: var(--line); }
