:root {
  --cyan: #22d3ee;
  --blue: #2563eb;
  --blue-deep: #1e3a8a;
  --blue-ink: #0f2747;
  --bg-1: #eaf6ff;
  --bg-2: #d7ecff;
  --surface: #ffffff;
  --surface-soft: #f3f9ff;
  --line: #cfe4fb;
  --muted: #5b7aa3;
  --ok: #0ea5e9;
  --bad: #e11d48;
  --warn: #d97706;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(37, 99, 235, .16);
}

body.dark {
  --cyan: #22d3ee;
  --blue: #1d4ed8;
  --blue-deep: #0b1c3f;
  --blue-ink: #dbeafe;
  --bg-1: #071226;
  --bg-2: #0d1f3f;
  --surface: #0f1b35;
  --surface-soft: #132448;
  --line: #1e3a66;
  --muted: #a4bee3;
  --shadow: 0 18px 50px rgba(2, 6, 23, .55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Noto Sans Hebrew", system-ui, sans-serif;
  color: var(--blue-ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(34, 211, 238, .25), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(37, 99, 235, .18), transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

body.dark .nav-item.active {
  background: #dbeafe;
  color: #0b1c3f;
}

body.dark input,
body.dark select,
body.dark textarea {
  background: #0b1730;
  color: #dbeafe;
}

body.dark .card,
body.dark .modal,
body.dark .login-card {
  color: var(--blue-ink);
}

body.dark .google-btn {
  background: #0b1730;
  color: #e2e8f0;
}

.theme-toggle {
  position: fixed;
  left: 16px;
  top: 14px;
  z-index: 90;
  border-radius: 999px;
  padding: .52rem .9rem;
  font-size: .9rem;
  background: rgba(255, 255, 255, .92);
  color: var(--blue-deep);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 8px 20px rgba(15, 39, 71, .22);
}

body.dark .theme-toggle {
  background: rgba(15, 27, 53, .95);
  color: #dbeafe;
  box-shadow: inset 0 0 0 1.5px #25477c, 0 8px 20px rgba(2, 6, 23, .45);
}

button, input, select, textarea { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  padding: .7rem 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  cursor: pointer;
  font-weight: 600;
  transition: transform .08s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.ghost {
  color: var(--blue);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
button.danger { background: linear-gradient(135deg, #fb7185, var(--bad)); }
button.subtle {
  color: var(--blue-deep);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  background: #fff;
  color: var(--blue-ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

h1, h2, h3, h4, p { margin: 0; }

/* ===== פריסת מסך עם תפריט צד ===== */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 26px 18px;
  background: linear-gradient(180deg, var(--blue-deep), var(--blue));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: #fff; padding: 5px;
  display: grid; place-items: center; color: var(--blue-deep); font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(15, 39, 71, .18);
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { font-size: 1.15rem; }
.brand small { color: #cfe4fb; font-weight: 400; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  color: #e8f3ff; cursor: pointer; font-weight: 600;
  background: transparent; border: 0; width: 100%; text-align: right;
  box-shadow: none;
}
.nav-item:hover { background: rgba(255,255,255,.12); transform: none; }
.nav-item.active { background: #fff; color: var(--blue-deep); }
.nav-item .ico { font-size: 1.15rem; }

.sidebar .spacer { flex: 1; }
.userbox { font-size: .85rem; color: #d7ecff; border-top: 1px solid rgba(255,255,255,.2); padding-top: 14px; }

.content { padding: 30px 36px 60px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h2 { font-size: 1.8rem; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .35rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-soft); color: var(--blue-deep); border: 1px solid var(--line);
}
.badge.ok { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.badge.off { color: #9f1239; background: #ffe4e6; border-color: #fecdd3; }
.badge.warn { color: #92400e; background: #fef3c7; border-color: #fde68a; }

/* ===== כרטיסי נציגים/תורים ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 22px 60px rgba(37, 99, 235, .22); }
.card .avatar {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem;
}
.card h3 { font-size: 1.1rem; }
.card .pins { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* בורר תמונת נציג */
.photo-picker { display: flex; align-items: center; gap: 12px; }
.photo-picker .avatar { flex: 0 0 auto; }
.photo-picker input[type=file] { flex: 1; font-size: .85rem; }

.add-card {
  border: 2px dashed var(--blue);
  background: rgba(255,255,255,.6);
  color: var(--blue-deep);
  align-items: center; justify-content: center;
  font-weight: 700; min-height: 120px; font-size: 1rem;
}

/* ===== מודלים (פופאפ ממורכז) ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 39, 71, .45);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(560px, 100%);
  max-height: 88vh; overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(15, 39, 71, .35);
  padding: 24px;
  animation: pop .15s ease;
}
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 1.3rem; }
.modal .x { background: var(--surface-soft); color: var(--blue-deep); box-shadow: inset 0 0 0 1.5px var(--line); padding: .4rem .7rem; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.switch-row { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.switch-row input { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.modal-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 18px; }
.section-title { font-size: .95rem; color: var(--blue-deep); font-weight: 700; margin: 18px 0 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .3rem .6rem; border-radius: 999px; font-size: .82rem;
  background: #e0f2fe; color: #075985; border: 1px solid #bae6fd;
}
.chip.off { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.chip.pin { cursor: pointer; background: linear-gradient(135deg, #cffafe, #dbeafe); }
.chip .rm { cursor: pointer; font-weight: 800; opacity: .6; }
.chip .rm:hover { opacity: 1; }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px;
  background: var(--surface-soft);
}
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input[type=checkbox] { width: 18px; height: 18px; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.empty.small { padding: 12px; font-size: .85rem; }

/* ===== טאבים (שיחות) ===== */
.tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  background: var(--surface); color: var(--blue-deep);
  box-shadow: inset 0 0 0 1.5px var(--line);
  display: inline-flex; align-items: center; gap: 8px;
}
.tab.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,.25); }

/* "חי" — אנטנת תקשורת המשדרת גלים לכל הכיוונים, גדולה ולצד הכותרת */
.live-banner {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 10px;
}
.live-banner .live-antenna { flex: 0 0 auto; line-height: 0; }
.live-banner .live-antenna svg { width: 50px; height: 50px; display: block; }
.live-banner-txt {
  font-size: 1.05rem; font-weight: 800; color: var(--blue-ink);
}
.live-antenna .la-rings circle {
  transform-box: fill-box; transform-origin: center; opacity: 0;
  animation: laBroadcast 2.4s ease-out infinite;
}
.live-antenna .la-rings circle:nth-child(2) { animation-delay: .8s; }
.live-antenna .la-rings circle:nth-child(3) { animation-delay: 1.6s; }
.live-antenna .la-tip { animation: laTip 1.4s ease-in-out infinite; }
@keyframes laBroadcast {
  0%   { transform: scale(.25); opacity: 0; }
  25%  { opacity: .85; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes laTip {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .live-antenna .la-rings circle, .live-antenna .la-tip { animation: none; opacity: .9; }
}

/* ===== כרטיסי מדדים (לוח בקרה) ===== */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}
.stat-card.green::before { background: linear-gradient(180deg, #34d399, #10b981); }
.stat-card.blue::before { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.stat-card.red::before { background: linear-gradient(180deg, #fb7185, #e11d48); }
.stat-card.orange::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.stat-ico { font-size: 1.4rem; }
.stat-num { font-size: 2.1rem; font-weight: 800; color: var(--blue-deep); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .86rem; font-weight: 600; }
.stat-card.stat-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .2s ease; }
.stat-card.stat-clickable:hover { transform: translateY(-3px); box-shadow: 0 22px 60px rgba(37, 99, 235, .22); }
.stat-card.stat-clickable::after {
  content: '↗'; position: absolute; top: 12px; inset-inline-end: 14px;
  color: var(--muted); font-size: .9rem; opacity: .5;
}

/* כפתור "ממתינים לשיחה חוזרת" בראש היסטוריית השיחות — פותח את הפופאפ */
.cb-waiting-pill {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 10px;
  background: #fef3c7; color: #92400e; border: 1.5px solid #fde68a;
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.cb-waiting-pill:hover { background: #fde68a; }
body.dark .cb-waiting-pill { background: #2a1d05; color: #fcd34d; border-color: #854d0e; }

/* שורת נציג זמין (מודאל "נציגים שעונים כעת") */
.avail-row { cursor: pointer; gap: 12px; flex-wrap: wrap; }
.avail-row:hover { background: var(--surface-soft); }
.avail-name { display: inline-flex; align-items: center; gap: 8px; }
.avail-name .avatar { width: 34px; height: 34px; font-size: .9rem; }
.avail-queues { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ===== קוביות שיחות פעילות (לייב) — סגנון מבוסס KESHER-1 ===== */
.call-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}
.call-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  border-top: 5px solid var(--blue); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.call-card:hover { transform: translateY(-4px); box-shadow: 0 22px 55px rgba(37, 99, 235, .22); }
.call-card.type-incoming { border-top-color: #10b981; }
.call-card.type-outgoing { border-top-color: var(--bad); }
.call-card.type-internal { border-top-color: var(--blue); }
.call-card.type-routing  { border-top-color: var(--warn); }

.cc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.cc-type { color: var(--blue-deep); font-size: .9rem; }
.cc-timer {
  font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.cc-flow {
  font-size: .85rem; color: var(--blue-ink); line-height: 1.5;
  background: var(--surface-soft); border-inline-start: 4px solid var(--cyan);
  padding: 10px 12px; border-radius: 10px; word-break: break-word;
}
.cc-flow b { color: var(--blue-deep); }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-box { flex: 1; text-align: center; min-width: 0; }
.cc-num { font-size: 1.25rem; font-weight: 800; color: var(--blue-deep); overflow-wrap: anywhere; }
.cc-box-dest .cc-num { color: var(--blue); }
.call-card.type-incoming .cc-box-dest .cc-num,
.call-card.type-routing  .cc-box-dest .cc-num { color: #10b981; }
.call-card.type-outgoing .cc-box-dest .cc-num { color: var(--bad); }
.cc-tiny { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.cc-label { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.cc-arrow { font-size: 1.3rem; color: var(--muted); flex: 0 0 auto; }

/* ===== טבלת נתונים (שיחות) ===== */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: 12px 14px; text-align: right; white-space: nowrap; }
.data-table thead th {
  position: sticky; top: 0; background: var(--surface-soft); color: var(--blue-deep);
  font-weight: 700; border-bottom: 2px solid var(--line);
}
.data-table tbody tr { border-bottom: 1px solid var(--line); transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table tbody tr:last-child { border-bottom: 0; }
.rec-player { height: 34px; max-width: 220px; vertical-align: middle; }
/* נגן ההקלטה בשורה נפרדת ברוחב מלא — נראה במלואו ולא מרחיב את רוחב הטבלה */
.data-table tr.rec-row td { padding: 8px 14px; background: var(--surface-soft); white-space: normal; }
.data-table tr.rec-row .rec-player { width: 100%; max-width: 100%; height: 38px; }

/* ===== עימוד היסטוריית שיחות (דף קודם/הבא + כמות בדף) ===== */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin: 8px 2px;
}
.pager-size { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.pager-size select { width: auto; padding: .3rem .5rem; }
.pager-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager-info { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pager button[disabled] { opacity: .45; cursor: default; }
.data-table tfoot th { background: var(--surface-soft); border-top: 2px solid var(--line); padding: 12px 14px; }

/* ===== סרגל דוחות ===== */
.report-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-soft); padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg-btn { background: transparent; color: var(--blue-deep); box-shadow: none; padding: .5rem .9rem; font-size: .85rem; }
.seg-btn.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.range-fields { display: flex; align-items: center; gap: 8px; }
.range-fields input { width: auto; }
.rep-agent { width: auto; min-width: 160px; }

/* ===== בחירה מרובה (תפריט תיבות-סימון) ===== */
.ms { position: relative; display: inline-block; }
.ms-toggle {
  width: auto; min-width: 180px; max-width: 240px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; color: var(--blue-ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
  border-radius: var(--radius); padding: .7rem .9rem; font-weight: 500;
}
body.dark .ms-toggle { background: var(--surface); }
.ms-toggle:hover { transform: none; }
.ms.has-sel .ms-toggle { box-shadow: inset 0 0 0 2px var(--blue); color: var(--blue-deep); font-weight: 600; }
.ms-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-caret { transition: transform .15s ease; opacity: .6; }
.ms.open .ms-caret { transform: rotate(180deg); }
.ms-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0;
  width: max(240px, 100%); max-height: 320px; overflow: auto;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 18px 50px rgba(15, 39, 71, .28);
  padding: 6px;
}
.ms-opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border-radius: 12px; font-size: .9rem; color: var(--blue-ink);
}
.ms-opt:hover { background: var(--surface-soft); }
.ms-opt input { width: auto; margin: 0; accent-color: var(--blue); }
.ms-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-all { font-weight: 700; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; margin-bottom: 4px; }
.ms-empty { padding: 12px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ===== חלון היסטוריית שיחות — מתאים לגודל החלון ===== */
.modal.history-modal { width: min(1280px, 96vw); max-width: 96vw; }
.history-modal .report-toolbar {
  position: sticky; top: -24px; z-index: 5;
  background: var(--surface); padding: 6px 0 10px; margin-top: -6px;
}
.history-modal .table-wrap { max-height: 64vh; overflow: auto; }
/* התאמת רוחב העמודות לחלון: גלישת טקסט ופאדינג מצומצם כדי שכל העמודות ייכנסו יחד */
.history-modal .data-table { table-layout: auto; }
.history-modal .data-table th, .history-modal .data-table td {
  white-space: normal; word-break: break-word; padding: 9px 10px;
}
.hist-count { font-size: .85rem; color: var(--muted); margin: 4px 2px 10px; font-weight: 600; }

/* ===== כרטיסי דוח נציג (כל מדד בריבוע) ===== */
.agent-report-card {
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px;
}
.agent-report-card h3 { color: var(--blue-deep); margin-bottom: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric-box {
  background: #eaf6ff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; text-align: center;
}
.metric-title { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.metric-value { font-size: 1.5rem; font-weight: 800; color: var(--blue-deep); direction: ltr; }
body.dark .metric-box { background: #0d1f3f; }
@media (max-width: 600px) { .metric-grid { grid-template-columns: 1fr 1fr; } }

/* תצוגה מקדימה של מייל */
.email-preview-box, .email-preview {
  max-height: 320px; overflow: auto;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface-soft);
}
.email-extra {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 12px; line-height: 1.7; white-space: pre-wrap; color: var(--blue-ink);
}
body.dark .email-extra { background: #0b1730; }
.muted-note { color: var(--muted); font-size: .82rem; margin: 6px 0; }
.head-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ===== נקודת מצב צבעונית בתגים ===== */
.dot {
  width: 8px; height: 8px; border-radius: 999px; display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}
.dot-ok { background: #10b981; }
.dot-bad { background: #ef4444; }
.dot-warn { background: #f59e0b; }
.dot-idle { background: #94a3b8; }

/* ===== כפתורי אייקון קטנים (עיפרון / מחיקה) ===== */
.icon-btn {
  padding: 0; width: 34px; height: 34px; border-radius: 12px;
  display: inline-grid; place-items: center; font-size: .95rem;
  color: var(--blue-deep); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-soft); }
.icon-btn.danger { color: var(--bad); background: var(--surface); box-shadow: inset 0 0 0 1.5px #fecdd3; }
.icon-btn.danger:hover { background: #fff1f2; }
.row-actions { display: inline-flex; gap: 6px; }
.slot-row span:first-child { font-weight: 600; }

/* ===== קיבוץ שעות מענה לפי תור (דרישה 2) ===== */
.schedule-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-soft); padding: 14px; margin-bottom: 12px;
}
.schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.schedule-head .group-title { font-weight: 700; color: var(--blue-deep); margin-left: 8px; }
.slot-list { margin-bottom: 10px; }
.add-slot-form { margin-bottom: 8px; }
.add-slot-btn { width: 100%; }

/* בחירת ימים מרובה */
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip {
  background: var(--surface); color: var(--blue-deep); padding: .45rem .7rem; font-size: .82rem;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.day-chip.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.25); }

/* ===== באנר שגיאה חמורה (דרישה 6) ===== */
.error-banner {
  background: #fff1f2; color: #9f1239; border: 1.5px solid #fb7185;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  font-weight: 600; font-size: .9rem; line-height: 1.5;
  box-shadow: 0 6px 18px rgba(225, 29, 72, .18);
  animation: shake .4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
body.dark .icon-btn { background: #0b1730; color: #dbeafe; }
body.dark .icon-btn.danger { background: #2a0d14; color: #fda4af; box-shadow: inset 0 0 0 1.5px #7f1d2e; }
body.dark .error-banner { background: #2a0d14; color: #fecdd3; border-color: #be123c; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--blue-deep); color: #fff; padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--shadow); z-index: 80; display: none;
}
.toast.show { display: block; }

@media (max-width: 820px) {
  .theme-toggle {
    left: 10px;
    top: 10px;
    padding: .45rem .75rem;
    font-size: .82rem;
  }

  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidebar .spacer { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cb-steps { grid-template-columns: 1fr; }
  .cb-url { flex-wrap: wrap; }
}

/* ===== מדריך הקמה — שיחה חוזרת ===== */
.cb-toolbar { margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.cb-guide-btn {
  cursor: pointer; border: 0; border-radius: 999px;
  padding: .7rem 1.3rem; font-size: 1rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 26px rgba(37, 99, 235, .28);
}
.cb-guide-btn:hover { filter: brightness(1.06); }
.cb-settings-btn {
  cursor: pointer; border: 0; border-radius: 999px;
  padding: .7rem 1.2rem; font-size: 1rem; font-weight: 700;
  color: var(--blue-deep); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.cb-settings-btn:hover { background: var(--surface-soft); }
.cb-guide-body { padding: 2px; }
.cb-intro { margin: 0 0 16px; color: var(--muted); line-height: 1.7; font-size: .95rem; }
.cb-intro b { color: var(--blue-ink); }

.cb-base {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 18px;
  background: var(--surface-soft); border: 1px dashed var(--line); border-radius: var(--radius);
}
.cb-base-label { font-weight: 700; color: var(--blue-deep); font-size: .9rem; }

.cb-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cb-ep {
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.cb-ep-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.cb-ep-icon {
  font-size: 1.25rem; line-height: 1.6rem;
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.cb-ep-title { font-weight: 700; color: var(--blue-ink); display: flex; align-items: center; gap: 8px; }
.cb-ep-phase {
  font-size: .72rem; font-weight: 700; color: var(--blue);
  background: rgba(37, 99, 235, .12); border-radius: 999px; padding: 1px 9px;
}
.cb-ep-when { font-size: .85rem; color: var(--muted); margin-top: 2px; }

.cb-url {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue-ink); border-radius: 12px; padding: 8px 8px 8px 12px;
  margin-bottom: 8px;
}
body.dark .cb-url { background: #060e22; }
.cb-url-text {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-family: "Consolas", "Menlo", monospace; font-size: .86rem;
  color: #aee9ff; direction: ltr; text-align: left; padding: 2px 0;
}
.cb-copy {
  flex: 0 0 auto; cursor: pointer; border: 0; border-radius: 9px;
  padding: 7px 12px; font-size: .82rem; font-weight: 700;
  background: var(--cyan); color: #06283d; white-space: nowrap;
}
.cb-copy:hover { filter: brightness(1.07); }
.cb-ep-hint { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }

.cb-io { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cb-io td { padding: 5px 6px; border-top: 1px solid var(--line); vertical-align: top; color: var(--blue-ink); }
.cb-io tr:first-child td { border-top: 0; }
.cb-io-label { font-weight: 700; color: var(--muted); white-space: nowrap; width: 1%; }

.cb-legend {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted); line-height: 2;
}
.cb-legend-title { font-weight: 700; color: var(--blue-deep); margin-inline-end: 6px; }
