:root {
  --brand: #1860D8;
  --brand-hover: #0C4FBA;
  --brand-ink: #0A2A6B;
  --brand-soft: #EAF3FE;
  --brand-mark: #CFE3FB;
  --accent: #138BA0;
  --ink: #0B1630;
  --ink-2: #2B3A57;
  --muted: #56637D;
  --line: #E0E8F4;
  --line-2: #C9D6EA;
  --bg: #F6F9FE;
  --card: #FFFFFF;
  --ok: #17803D;
  --ok-soft: #E7F6EC;
  --warn: #9A520C;
  --warn-soft: #FCF3E8;
  --bad: #AE3328;
  --bad-soft: #FDEFEE;
  --wa: #128C4A;
  --f-body: Assistant, "Arial Hebrew", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: Rubik, Assistant, "Arial Hebrew", system-ui, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(11, 22, 48, .05), 0 6px 20px rgba(11, 22, 48, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--f-body);
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: 0; margin: 0; color: var(--ink); }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- כפתורים ושדות ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 10px; padding: 7px 14px; font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wa:hover { filter: brightness(.95); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 14px; border-radius: 8px; }
.btn.big { width: 100%; padding: 13px 18px; font-size: 17px; border-radius: 12px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--brand-mark); outline-offset: 1px;
}

label { display: block; font-weight: 600; font-size: 15px; color: var(--ink-2); }
input, textarea, select {
  display: block; width: 100%; margin-top: 5px;
  border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  padding: 10px 12px; font-weight: 400; font-size: 16px;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; }
textarea { resize: vertical; }
.opt { color: var(--muted); font-weight: 400; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 8px 12px; margin: 0; font-size: 15px; }

/* ---------- מסך המעסיק ---------- */
.top {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.top-in {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}
.top img { height: 34px; width: auto; display: block; }
.top .product {
  font-family: var(--f-display); font-weight: 600; font-size: 17px; color: var(--brand-ink);
  border-inline-start: 1px solid var(--line-2); padding-inline-start: 14px;
}
.top .spacer { flex: 1; }
.who-am-i { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-align: end; min-width: 0; }
.who-am-i b { font-weight: 600; font-size: 15px; color: var(--ink); }
.who-am-i small { font-size: 13px; color: var(--muted); }
#pw form { margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.hello { margin-bottom: 18px; }
.hello h1 { font-size: 28px; }
.hello p { margin: 4px 0 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .n { font-family: var(--f-display); font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--brand-ink); }
.stat .l { color: var(--muted); font-size: 14px; margin-top: 2px; }
.stat.hi { background: var(--brand); border-color: var(--brand); }
.stat.hi .n, .stat.hi .l { color: #fff; }

.grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.col { display: grid; gap: 18px; min-width: 0; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); min-width: 0;
}
.panel-h {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-h h2 { font-size: 18px; }
.panel-h .sub { color: var(--muted); font-size: 14px; }
.panel-h .spacer { flex: 1; }
.panel-b { padding: 14px 18px; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* טבלת "מי הביא את מי" */
.board { width: 100%; border-collapse: collapse; }
.board th {
  text-align: start; font-weight: 600; font-size: 13px; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.board td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board .num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.board th.num { text-align: center; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 14px;
}
.who b { display: block; font-weight: 600; }
.who small { color: var(--muted); font-size: 13px; direction: ltr; unicode-bidi: isolate; }
.rank { color: var(--muted); font-size: 13px; width: 22px; }
.rank.top1 { color: var(--neta, #E08A2E); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.zero { color: var(--line-2); }
.hired-n { color: var(--ok); }

/* מועמדים */
.cand { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand b { font-weight: 600; }
.cand .meta { color: var(--muted); font-size: 14px; }
.cand .meta .via { color: var(--brand-ink); font-weight: 600; }
.cand .note { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.cand select { width: auto; margin: 0; padding: 5px 30px 5px 10px; font-size: 14px; font-weight: 600; border-radius: 99px; }
.st-new { background: var(--brand-soft); border-color: var(--brand-mark); color: var(--brand-ink); }
.st-interview { background: var(--warn-soft); border-color: #F1D9BC; color: var(--warn); }
.st-hired { background: var(--ok-soft); border-color: #BFE5CB; color: var(--ok); }
.st-rejected { background: #F1F3F7; border-color: var(--line-2); color: var(--muted); }

/* משרות */
.job { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job .t { flex: 1; min-width: 0; }
.job .t b { display: block; font-weight: 600; }
.job .t small { color: var(--muted); font-size: 13px; }
.job.closed .t b { color: var(--muted); text-decoration: line-through; }
.pill { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.pill.open { background: var(--ok-soft); color: var(--ok); }
.pill.closed { background: #F1F3F7; color: var(--muted); }

.add { display: grid; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: #FBFCFF; border-radius: 0 0 var(--r) var(--r); }
.add .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* חלון שליחה */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(11, 22, 48, .25); color: var(--ink);
}
dialog::backdrop { background: rgba(11, 22, 48, .45); }
.dlg-h { padding: 18px 20px 6px; }
.dlg-h h3 { font-size: 19px; }
.dlg-b { padding: 8px 20px 20px; display: grid; gap: 12px; }
.bubble {
  background: #E7FFDB; border-radius: 12px 12px 4px 12px; padding: 10px 12px;
  font-size: 15px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.chat-bg { background: #EFEAE2; border-radius: 12px; padding: 12px; }
.dlg-f { display: flex; gap: 8px; }
.dlg-f .btn { flex: 1; }

/* וואטסאפ אוטומטי */
.pill.demo { background: var(--warn-soft); color: var(--warn); }
.wa-set { display: grid; gap: 14px; }
.mode-note { margin: 0; font-size: 14px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; }
.inline { display: flex; gap: 8px; margin-top: 5px; }
.inline input { margin: 0; }
.toggles { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tg { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; font-weight: 400; cursor: pointer; background: #fff; }
.tg + .tg { border-top: 1px solid var(--line); }
.tg input[type=checkbox] { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--brand); }
.tg b { display: block; font-weight: 600; color: var(--ink); }
.tg small { display: block; color: var(--muted); font-size: 13px; }
.tg select { margin-top: 6px; width: auto; padding: 4px 28px 4px 10px; font-size: 14px; }
.fine-r { margin: 0; font-size: 13px; color: var(--muted); }
.optout { display: block; font-size: 12px; color: var(--bad); }

.msg { padding: 12px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.msg:last-child { border-bottom: 0; }
.msg-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.msg-h b { font-weight: 600; }
.msg-h .kind { color: var(--brand-ink); background: var(--brand-soft); border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.msg-h .spacer { flex: 1; }
.msg-h .t { color: var(--muted); font-size: 13px; }
.msg .chat-bg { padding: 10px; }
.msg .bubble { max-width: 420px; font-size: 14px; }
.bubble .foot { display: block; margin-top: 6px; color: #667781; font-size: 12px; }
.mst { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 8px; }
.mst-demo, .mst-queued { background: var(--warn-soft); color: var(--warn); }
.mst-sent, .mst-delivered { background: var(--brand-soft); color: var(--brand-ink); }
.mst-read { background: var(--ok-soft); color: var(--ok); }
.mst-failed { background: var(--bad-soft); color: var(--bad); }
.mst-skipped { background: #F1F3F7; color: var(--muted); }
.msg-err { font-size: 13px; color: var(--bad); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 16px 16px 48px; }
  .top-in { padding: 10px 16px; }
  /* בנייד: לוגו + כפתורים בשורה הראשונה, שם העסק והמשתמש בשורה שנייה */
  .top .product { display: none; }
  .top-in { flex-wrap: wrap; row-gap: 6px; }
  .who-am-i { order: 10; flex-basis: 100%; flex-direction: row; align-items: baseline; gap: 6px; text-align: start; }
  .who-am-i b, .who-am-i small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat.hi { grid-column: 1 / -1; }
  .hello h1 { font-size: 23px; }
  .add .row { grid-template-columns: 1fr; }
  /* הטבלה הופכת לכרטיסים */
  .board thead { display: none; }
  .board, .board tbody, .board tr, .board td { display: block; width: 100%; }
  .board tr { border-bottom: 1px solid var(--line); padding: 10px 6px; display: grid; grid-template-columns: repeat(4, 1fr); }
  .board tr:last-child { border-bottom: 0; }
  .board td { border: 0; padding: 4px 6px; }
  .board td.rank { display: none; }
  .board td.who-td { grid-column: 1 / -1; }
  .board td.num::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
  .board td.act { grid-column: 1 / -1; }
  .actions { justify-content: flex-start; }
}

/* ---------- הדף הציבורי (הקישור האישי) ---------- */
body.public {
  background:
    radial-gradient(600px 300px at 100% 0, var(--brand-soft), transparent 70%),
    radial-gradient(500px 300px at 0 100%, #E9F6F5, transparent 70%),
    #fff;
  min-height: 100vh;
}
.pub { max-width: 480px; margin: 0 auto; padding: 28px 16px 48px; }
.pub-logo { display: block; margin: 0 auto 22px; height: 40px; width: auto; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 22px; box-shadow: var(--shadow);
}
.card h1 { font-size: 26px; line-height: 1.25; }
.card h2 { font-size: 22px; }
.eyebrow {
  display: inline-block; margin: 0 0 10px; font-size: 14px; font-weight: 600;
  color: var(--brand-ink); background: var(--brand-soft); border-radius: 99px; padding: 4px 12px;
}
.loc { margin: 6px 0 0; color: var(--accent); font-weight: 600; }
.desc { margin: 12px 0 0; color: var(--ink-2); }
.card form { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.fine { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
#done { text-align: center; padding: 10px 0 4px; }
.ok-mark {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
}
.job-list { display: grid; gap: 10px; margin-top: 18px; }
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  text-decoration: none; color: var(--ink);
}
.job-row:hover { border-color: var(--brand); }
.job-row b { display: block; font-weight: 600; }
.job-row small { color: var(--muted); font-size: 14px; }
.job-row .arrow { color: var(--brand); font-weight: 700; }
