:root {
  /* צבעי כפר המכביה, מתוך kmc-hotel.co.il: נייבי המותג, בז' הרקעים, צהוב הזהב */
  --navy: #293070; --gold: #f9b72a; --gold-soft: #fdf1d6; --beige: #f2eee3;
  --bg: #f7f5ef; --card: #fff; --ink: #1b1f3b; --muted: #6b6e85; --line: #e6e1d3;
  --accent: var(--navy); --accent-ink: #fff; --accent-soft: #eceef7;
  --danger: #b42318; --wa: #1fa855; --radius: 8px;
  --shadow: 0 1px 2px rgba(27,31,59,.05), 0 1px 3px rgba(27,31,59,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'IBM Plex Sans Hebrew', Assistant, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #cfd4dc; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { padding: 12px 16px; font-size: 16px; width: 100%; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.icon-btn { border: 0; background: transparent; font-size: 22px; padding: 6px 10px; cursor: pointer; border-radius: 8px; }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; }

/* כניסה */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); width: min(380px, 100%); padding: 28px; border-radius: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 15px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }

/* כותרת */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; max-width: 980px; margin: 0 auto; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.menu { position: absolute; top: 58px; left: 16px; background: var(--card); border-radius: 12px; box-shadow: 0 8px 24px rgba(16,24,40,.14); display: grid; min-width: 200px; overflow: hidden; z-index: 6; }
.menu button { border: 0; background: none; text-align: right; padding: 12px 16px; cursor: pointer; }
.menu button:hover { background: var(--bg); }

.tabs { display: flex; gap: 4px; padding: 0 16px; max-width: 980px; margin: 0 auto; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500; color: var(--muted); }
.tabs button.active { color: var(--ink); border-color: var(--accent); }
.tabs b { background: var(--line); color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.tabs button.active b { background: var(--accent); color: #fff; }

.filters { max-width: 980px; margin: 0 auto; padding: 12px 16px 4px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.filters select { width: auto; }
.chips { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* רשימה */
.list { max-width: 980px; margin: 0 auto; padding: 8px 16px 80px; display: grid; gap: 8px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; cursor: pointer; border-inline-start: 4px solid transparent; }
.card.unread { border-inline-start-color: var(--accent); }
.card .name { font-weight: 600; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.card .snippet { grid-column: 1 / -1; color: #344054; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 6px 10px; white-space: pre-line; max-height: 4.5em; overflow: hidden; }
.card .acts { display: flex; gap: 6px; align-items: start; }
.card .acts .btn { padding: 6px 10px; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 600; color: #fff; }
.due { color: var(--danger); font-weight: 600; }
.src { font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0 6px; font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* כרטיס ליד */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-bg { position: absolute; inset: 0; background: rgba(16,24,40,.35); }
.drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(520px, 100%); background: var(--bg); overflow-y: auto; padding: 0 0 40px; box-shadow: 0 0 40px rgba(0,0,0,.2); }
.d-head { position: sticky; top: 0; background: var(--card); padding: 14px 16px; border-bottom: 1px solid var(--line); z-index: 2; }
.d-head .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.d-head h2 { margin: 0; font-size: 20px; }
.d-head .phone { color: var(--muted); direction: ltr; text-align: right; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.d-actions .btn { padding: 11px; font-size: 15px; }
.sec { background: var(--card); margin: 10px 12px 0; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.sec h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.status-grid button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 6px; cursor: pointer; font-weight: 500; }
.status-grid button.on { color: #fff; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.quick .chip { font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv { display: grid; grid-template-columns: minmax(70px, 38%) 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; line-height: 1.35; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.quote { background: var(--bg); border-radius: 10px; padding: 10px; white-space: pre-line; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 14px; }
.timeline .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 13px; }
.timeline small { color: var(--muted); display: block; font-size: 12px; }
.note-box { display: grid; gap: 8px; }

dialog { border: 0; border-radius: 16px; padding: 20px; width: min(460px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(16,24,40,.4); }
dialog h3 { margin: 0 0 12px; }
.modal-form { display: grid; gap: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 4px; }
.tpl { display: grid; gap: 8px; }
.tpl button { text-align: right; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.tpl button:hover { border-color: var(--wa); }
.tpl small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; white-space: pre-line; }

.settings h4 { margin: 18px 0 8px; }
.users { display: grid; gap: 6px; }
.users .u { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-size: 14px; flex-wrap: wrap; }
.log { font-size: 12px; font-family: ui-monospace, monospace; max-height: 180px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 8px; direction: ltr; text-align: left; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 600px) {
  .tabs button { font-size: 14px; white-space: nowrap; padding: 10px 2px; }
  .top .btn.primary { padding: 7px 10px; }
  .card { grid-template-columns: 1fr; }
  .card .acts { order: 3; }
  .card .acts .btn { flex: 1; }
  .grid2 { grid-template-columns: 1fr; }
}

.group { margin: 10px 2px 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.group b { background: var(--line); color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.group.late { color: var(--danger); }
.group.late b { background: var(--danger); color: #fff; }
.tabs b.alert { background: var(--danger); color: #fff; }

.bell b { background: var(--line); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.bell.hot { border-color: var(--danger); color: var(--danger); animation: pulse 1.6s ease-in-out infinite; }
.bell.hot b { background: var(--danger); color: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(180,35,24,.15); } }
@media (prefers-reduced-motion: reduce) { .bell.hot { animation: none; } }
.task-tag { margin: 0 0 4px; color: var(--danger); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.task-opts { display: grid; gap: 6px; }
.task-opts .btn { text-align: right; padding: 11px 14px; white-space: normal; }
.warn { background: #fef3f2; color: var(--danger); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 8px; }
.warn-chip { border-color: #fda29b; color: var(--danger); }
.chip.on { background: var(--ink); color: #fff; }

.fb-conn { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.fb-conn p { margin: 0 0 6px; }

/* תגובות */
.c-bar { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; margin: 2px 2px 4px; }
.card.comment { cursor: default; }
.card.comment.done { opacity: .62; }
.card .post-label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.steps { padding-inline-start: 20px; line-height: 1.7; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; }
@media (max-width: 480px) { .tabs { padding: 0 8px; gap: 0; } .tabs button { padding: 10px 4px; font-size: 14px; } }

/* סיכום למנהל */
.dash { max-width: 980px; margin: 0 auto 6px; padding: 0 16px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-toggle { border: 0; background: none; font-weight: 700; font-size: 16px; cursor: pointer; padding: 4px 0; }
.dash-toggle span { display: inline-block; transition: transform .15s; color: var(--muted); }
.dash.closed .dash-toggle span { transform: rotate(90deg); }
.dash.closed #dash-body, .dash.closed .dash-custom, .dash.closed .seg { display: none; }
.seg { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 5px 11px; font-size: 13px; cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dash-custom { display: flex; gap: 8px; margin-bottom: 8px; }
.dash-custom label { flex: 1; }
.dash-custom input { padding: 7px 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi strong { white-space: nowrap; font-size: 24px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; color: var(--muted); font-size: 13px; margin-inline-start: 4px; }
.kpi.bad strong { color: var(--danger); }
.kpi.good strong { color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin-top: 8px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.panel h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 116px; height: 116px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut::after { content: attr(data-total); width: 70px; height: 70px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--muted); min-width: 36px; text-align: left; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: right; color: var(--muted); font-weight: 500; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 6px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: left; }
.bar { height: 6px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.dash-now { color: var(--muted); font-size: 13px; margin: 8px 2px 0; display: flex; gap: 14px; flex-wrap: wrap; }
.dash-now b { color: var(--ink); }
.dash-now b.alert { color: var(--danger); }
.dash-empty { color: var(--muted); font-size: 13px; margin: 0; }
@media (max-width: 600px) { .kpi strong { font-size: 20px; } .seg button { padding: 5px 8px; } .kpi:last-child { grid-column: 1 / -1; } }

/* הורדת סיכום */
.dash-dl { padding: 5px 12px; font-size: 13px; }
.dash.closed .dash-dl { display: none; }
.exp-presets { justify-self: start; flex-wrap: wrap; }
.exp-what { margin: 0; }
.btn:disabled { opacity: .6; cursor: default; }

/* ---------- כפר המכביה ---------- */
.btn { border-radius: 6px; }
.btn.primary { background: var(--navy); border-color: var(--navy); }
.btn.primary:hover { background: #1f2558; }
.brand-mark { background: var(--navy); color: var(--gold); border-radius: 6px; font-family: Assistant, sans-serif; font-weight: 800; letter-spacing: -.5px; }
.brand strong { font-family: Assistant, sans-serif; font-weight: 800; letter-spacing: .2px; }
.login { background: linear-gradient(180deg, var(--navy) 0 38%, var(--bg) 38%); }
.login-card { border-top: 4px solid var(--gold); border-radius: 10px; }
.top { background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; padding: 10px 10px; }
.tabs button.active { border-color: var(--gold); color: var(--navy); font-weight: 600; }
.tabs button.active b { background: var(--navy); }
.card.unread { border-inline-start-color: var(--gold); }
.card .co { font-weight: 500; font-size: 13px; color: var(--navy); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; }
.card .ev { grid-column: 1; font-size: 13px; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amt { font-weight: 600; font-size: 12px; background: var(--gold-soft); color: #7a5300; border-radius: 4px; padding: 0 6px; }
.amt.won { background: #e3f4ea; color: #1f6b3f; }
.co-line { color: var(--navy); font-weight: 600; font-size: 14px; }
.d-actions { flex-wrap: wrap; }
.status-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .status-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi.good strong { color: #1f6b3f; }
.chip.on { background: var(--navy); border-color: var(--navy); }
.c-bar span { font-weight: 600; color: var(--navy); }
