@import url("/fonts/fonts.css");

/* ===========================================================================
   פלטת "מרכזייה" — לוח מרכזנית של מוסד: פאנל אמייל ירוק-בקבוק, נורות מצב,
   פרזול פליז וגיליון תורנות על נייר שמנת. הצבע נגזר מהעולם של המוצר (טלפוניה)
   ולא מתבנית SaaS כללית.
   הטוקנים בשמות ה"כחולים" נשמרו כשמות תאימות וממופים לפלטה החדשה — כך כל
   הכללים הקיימים בקובץ מקבלים את הזהות החדשה בלי לשנות מאות שורות.
   =========================================================================== */
:root {
  --ink: #17211c;            /* דיו — טקסט ראשי */
  --ink-2: #4d5c53;          /* דיו דהוי — טקסט משני */
  --panel: #1e332a;          /* פאנל אמייל ירוק-בקבוק — תפריט הצד */
  --panel-2: #16261e;
  --paper: #fcfbf7;          /* נייר — משטח כרטיסים ופופאפים */
  --paper-2: #f2efe6;
  --ground: #e7e4d9;         /* רקע העמוד — פשתן */
  --line: #d5d0c0;
  --line-strong: #b6ae9a;
  --brass: #9a6f24;          /* פליז — פעולה ראשית, מיקוד, כותרות מקטע */
  --brass-lite: #c9a15a;
  --brass-soft: #f3e8ce;
  --lamp: #2e7a50;           /* נורה דולקת — זמין */
  --lamp-soft: #dcece2;
  --lamp-line: #b7d3c1;
  --oxblood: #8e352f;        /* חסום / מושהה */
  --oxblood-soft: #f7e1de;
  --oxblood-line: #e2bab5;
  --amber: #9c6a10;          /* אזהרה / זמני */
  --amber-soft: #f7eacb;
  --amber-line: #ddc899;

  /* צבע הטקסט על כפתור מלא (פליז/אוקסבלד). במצב לילה הפליז בהיר — הטקסט מתהפך לכהה.
     חשוב: לא לצבוע לפי הסלקטור button, כי גם פריטי הניווט והכרטיסים הם button. */
  --btn-fg: #fff;

  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(23, 33, 28, .07);
  --shadow-lift: 0 3px 12px rgba(23, 33, 28, .12);
  --shadow-modal: 0 12px 44px rgba(23, 33, 28, .28);

  --font-body: "Assistant", "Segoe UI", system-ui, sans-serif;
  --font-display: "Frank Ruhl Libre", "Segoe UI", Georgia, serif;
  --font-data: "IBM Plex Mono", "Consolas", ui-monospace, monospace;

}

/* שמות התאימות מוגדרים על body ולא על :root — מצב הלילה מחליף את הטוקנים על body,
   ו-var() נפתר לפי האלמנט שבו הוא נכתב. הגדרה ב-:root הייתה ננעלת על ערכי היום. */
body {
  --cyan: var(--brass-lite);
  --blue: var(--brass);
  --blue-deep: var(--panel);
  --blue-ink: var(--ink);
  --bg-1: var(--ground);
  --bg-2: var(--ground);
  --surface: var(--paper);
  --surface-soft: var(--paper-2);
  --muted: var(--ink-2);
  --ok: var(--lamp);
  --bad: var(--oxblood);
  --warn: var(--amber);
}

body.dark {
  --ink: #e9e6db;
  --ink-2: #9aa79c;
  --panel: #14211a;
  --panel-2: #0e1813;
  --paper: #1a221d;
  --paper-2: #212b24;
  --ground: #111814;
  --line: #2d3a32;
  --line-strong: #435146;
  --brass: #cfa257;
  --brass-lite: #e0bd83;
  --brass-soft: #33291a;
  --lamp: #4f9e70;
  --lamp-soft: #17291f;
  --lamp-line: #2f5540;
  --oxblood: #cf7c74;
  --oxblood-soft: #2b1917;
  --oxblood-line: #55302c;
  --amber: #d6a75a;
  --amber-soft: #2a2113;
  --amber-line: #4d3f22;
  --btn-fg: #17211c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 3px 12px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 44px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

/* כותרות בסריפט עברי — הפנים המוסדיות של המערכת */
h1, h2, h3, .modal-head h3, .card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
}

/* מספרים, שעות ומשכים בגופן מכשירים — קריאים בטור וברוחב אחיד */
.mono, [dir="ltr"], .stat-num, .cc-num, .cc-timer, .metric-value, .num-digits,
.pad-digit, .fixed-num, .chip b, .strip-day, .strip-hours {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

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: 14px;
  top: 12px;
  z-index: 90;
  border-radius: var(--radius);
  padding: .35rem .7rem;
  font-size: .82rem;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.theme-toggle:hover { background: var(--paper-2); color: var(--brass); border-color: var(--brass); }

button, input, select, textarea { font: inherit; }

/* כפתורים: לוחית שטוחה, בלי מדרג צבע ובלי הרמה — כמו מקש על לוח פיקוד */
button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  color: var(--btn-fg);
  background: var(--brass);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  box-shadow: none;
}
button:hover { background: #85601d; transform: none; }
button:active { background: #6f4f16; }
body.dark button:hover { background: #dfb672; }
button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }

button.ghost,
button.subtle {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line-strong);
  box-shadow: none;
}
button.ghost:hover,
button.subtle:hover { background: var(--paper-2); border-color: var(--brass); color: var(--brass); }
button.danger { background: var(--oxblood); color: var(--btn-fg); }
button.danger:hover { background: #772b26; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .5rem .7rem;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(154, 111, 36, .16);
}
input[type="time"], input[type="date"], input[type="datetime-local"], input[type="number"] {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

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: 24px 16px;
  background: var(--panel);
  border-inline-start: 3px solid var(--brass);
  color: #eae7dc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(234, 231, 220, .16);
}
.brand .logo {
  width: 42px; height: 42px; border-radius: 3px;
  background: #f6f3ea; padding: 4px; flex: 0 0 42px;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 28, .2);
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { font-size: 1.06rem; line-height: 1.25; color: #f6f3ea; }
.brand small { color: #a7b4a9; font-weight: 400; font-size: .76rem; }

/* פריטי הניווט כתוויות חרוטות; הפעיל הוא לוחית נייר עם סימן פליז */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 3px;
  color: #d3ddd5; cursor: pointer; font-weight: 600; font-size: .95rem;
  background: transparent; border: 0; border-inline-start: 3px solid transparent;
  width: 100%; text-align: right; box-shadow: none;
}
.nav-item:hover { background: rgba(234, 231, 220, .09); transform: none; color: #f6f3ea; }
.nav-item.active {
  background: #f6f3ea; color: var(--panel);
  border-inline-start-color: var(--brass);
}
body.dark .nav-item.active { background: #f6f3ea; color: var(--panel-2); }
.nav-item .ico { font-size: 1rem; opacity: .85; }

.sidebar .spacer { flex: 1; }
.userbox {
  font-size: .8rem; color: #a7b4a9;
  border-top: 1px solid rgba(234, 231, 220, .16); padding-top: 14px; margin-top: 10px;
}
.userbox #timeInfo { font-family: var(--font-data); font-size: .76rem; line-height: 1.5; }

.content { padding: 28px 34px 60px; }
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.page-head h2 { font-size: 1.7rem; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* תג מצב = נורת סימון על הלוח */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .2rem .5rem; border-radius: 3px; font-size: .8rem; font-weight: 600;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.ok { color: #1f5c3c; background: var(--lamp-soft); border-color: var(--lamp-line); }
.badge.off { color: #7b2c26; background: var(--oxblood-soft); border-color: var(--oxblood-line); }
.badge.warn { color: #7d5409; background: var(--amber-soft); border-color: var(--amber-line); }
body.dark .badge.ok { color: #8fd0ab; }
body.dark .badge.off { color: #e5a49d; }
body.dark .badge.warn { color: #e2bd7c; }

/* ===== כרטיסי נציגים/תורים ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
  display: flex; flex-direction: column; gap: 8px;
  text-align: right; font: inherit; color: inherit;
}
.card:hover { border-color: var(--brass); box-shadow: var(--shadow-lift); transform: none; }
.card:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
/* הסמל כלוחית ממוספרת — אות ראשונה בגופן מכשירים על רקע פליז דהוי */
.card .avatar {
  width: 34px; height: 34px; border-radius: 3px;
  background: var(--brass-soft); border: 1px solid var(--line);
  color: var(--brass); display: grid; place-items: center;
  font-family: var(--font-data); font-weight: 600; font-size: 1rem;
}
.card h3 { font-size: 1.05rem; line-height: 1.3; }
.card .pins { display: flex; flex-wrap: wrap; gap: 5px; }
.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; }

/* ===== מספרים: רשימה ===== */
.num-list { display: flex; flex-direction: column; gap: 8px; }
.num-row { cursor: pointer; align-items: center; transition: box-shadow .15s, transform .05s; }
.num-row:hover { box-shadow: inset 0 0 0 1.5px var(--blue), 0 6px 16px rgba(37,99,235,.12); }
.num-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.num-title { font-size: 1.05rem; font-weight: 800; color: var(--blue-ink); }
.num-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; }
.num-digits { direction: ltr; color: var(--muted); font-variant-numeric: tabular-nums; }
.num-arrow { color: var(--muted); }
.num-badges { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.dest-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px;
  color: var(--blue-deep); font-weight: 600;
}
.dest-chip.big { font-size: .95rem; padding: 5px 12px; }

/* ===== מספרים: עורך ===== */
.num-head { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.num-head .grow { flex: 1; margin-bottom: 0; }
.num-head-fixed { flex: 0 0 auto; }
.fixed-num {
  direction: ltr; font-weight: 800; font-size: 1.1rem; color: var(--blue-deep);
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px; text-align: center;
}
.dirty-dot { font-size: .78rem; color: var(--warn); font-weight: 700; margin-inline-start: 8px; }

.acc { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.acc > summary {
  cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 700; color: var(--blue-deep);
  background: var(--surface-soft); -webkit-user-select: none; user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 14px; }
.link-btn { background: none; border: 0; color: var(--blue); cursor: pointer; font-weight: 700; padding: 6px 0; }

/* ===== פירורי לחם ===== */
.route-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; font-size: .85rem; }
.crumb {
  cursor: pointer; border: 0; background: var(--surface-soft); color: var(--blue-deep);
  border-radius: 999px; padding: 4px 11px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
}
.crumb.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: none; }
.crumb-sep { color: var(--muted); }

/* ===== עץ ניתוב ===== */
.route-tree { display: flex; flex-direction: column; gap: 8px; }
.route-section-label { font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
.route-line {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--surface);
}
.route-line.is-active { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.route-cond { font-size: .85rem; color: var(--muted); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.route-dest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.active-tag { color: var(--blue); font-weight: 700; font-size: .78rem; }
.mini-btn {
  cursor: pointer; border: 0; border-radius: 9px; padding: 4px 10px; font-size: .8rem; font-weight: 700;
  background: var(--cyan); color: #06283d;
}
.mini-btn.ghost { background: var(--surface-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.mini-btn:hover { filter: brightness(1.07); }
.chain-children { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.chain-children:empty { display: none; }
.inline-child {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; padding: 7px 10px; border-inline-start: 3px solid var(--blue);
  background: var(--surface-soft); border-radius: 0 10px 10px 0;
}
.change-dest {
  width: 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 8px; padding: 9px; background: var(--surface-soft); border-radius: 10px;
}
.change-dest select, .change-dest input { padding: 6px 8px; }

/* ===== לוח ספרות (נתב) ===== */
.node-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad-key {
  cursor: pointer; text-align: start; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px;
}
.pad-key:hover:not(:disabled) { border-color: var(--blue); box-shadow: 0 4px 12px rgba(37,99,235,.14); }
.pad-key:disabled { opacity: .55; cursor: default; }
.pad-key.empty { background: var(--surface-soft); }
.pad-digit { font-size: 1.3rem; font-weight: 800; color: var(--blue-deep); }
.pad-dest { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-note { margin-top: 10px; font-size: .85rem; color: var(--blue-ink); }

/* ===== טאבים של קוד ===== */
.route-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; max-height: 130px; overflow-y: auto; }
.rtab {
  cursor: pointer; border: 0; border-radius: 999px; padding: 5px 12px; font-size: .82rem; font-weight: 700;
  background: var(--surface-soft); color: var(--blue-deep); box-shadow: inset 0 0 0 1px var(--line);
}
.rtab.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: none; }

/* ===== עיצוב מודרני: ניהול יעדי ניתוב (rx-*) ===== */
.rx-search {
  width: 100%; margin-bottom: 14px; padding: 12px 16px; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--blue-ink);
}
.rx-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.rx-list { display: flex; flex-direction: column; gap: 10px; }
.rx-qrow {
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  transition: box-shadow .15s, transform .05s, border-color .15s;
}
.rx-qrow:hover { border-color: var(--blue); box-shadow: 0 10px 26px rgba(37,99,235,.14); transform: translateY(-1px); }
.rx-qrow-title { font-size: 1.1rem; font-weight: 800; color: var(--blue-ink); }
.rx-qrow-sub { font-size: .85rem; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* כותרת הישות (hero) */
.rx-hero {
  border-radius: 18px; padding: 18px 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.10));
  border: 1px solid var(--line);
}
.rx-hero-title { font-size: 1.4rem; font-weight: 800; color: var(--blue-deep); display: flex; align-items: center; gap: 10px; }
.rx-hero-sub { margin-top: 4px; color: var(--muted); font-size: .9rem; }

/* פאנל מקטע */
.rx-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 4px 4px 8px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(15,39,71,.05);
}
.rx-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.rx-ico {
  flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(14,165,233,.12));
  border: 1px solid var(--line); border-radius: 14px;
}
.rx-panel-title { font-size: 1.05rem; font-weight: 800; color: var(--blue-deep); }
.rx-panel-sub { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.rx-panel-body { padding: 6px 16px 12px; }

.rx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rx-field { display: grid; gap: 6px; margin-bottom: 14px; }
.rx-field > label { font-size: .85rem; font-weight: 700; color: var(--blue-ink); }
.rx-field input, .rx-field select {
  padding: 11px 13px; font-size: .95rem; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--blue-ink); width: 100%;
}
.rx-field input:focus, .rx-field select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* בקרת מקטעים (segmented) מודרנית */
.rx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-soft); border-radius: 12px; border: 1px solid var(--line); }
.rx-seg-btn {
  cursor: pointer; border: 0; background: transparent; color: var(--blue-deep);
  padding: 7px 14px; border-radius: 9px; font-size: .85rem; font-weight: 700;
}
.rx-seg-btn.on { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }

/* יעד + שינוי יעד */
.rx-dest-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rx-dest-edit { width: 100%; }
.rx-dest-edit:empty { display: none; }

/* חברי תור */
.rx-members { display: flex; flex-direction: column; gap: 8px; }
.rx-member {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
}
.rx-member-meta { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* מתקדם */
.rx-adv { border: 1px dashed var(--line); border-radius: 16px; overflow: hidden; }
.rx-adv > summary {
  cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 800; color: var(--blue-deep);
  background: var(--surface-soft); -webkit-user-select: none; user-select: none;
}
.rx-adv > summary::-webkit-details-marker { display: none; }
.rx-adv-body { padding: 14px 16px; }


/* ===========================================================================
   שכבת הזהות החדשה — נכתבת בסוף הקובץ כדי לגבור על כללים מוקדמים שקידדו
   מדרגי-צבע, כפתורי-גלולה והרמות בריחוף. כאן גם הרכיבים החדשים.
   =========================================================================== */

/* ---- כותרת מקטע: תווית פליז עם קו מפריד, כמו טופס מודפס ---- */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; color: var(--brass);
  margin: 22px 0 10px;
}
.section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ---- נורות מצב ---- */
.dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: none; }
.dot-ok {
  background: var(--lamp);
  box-shadow: 0 0 0 2px rgba(46, 122, 80, .16), 0 0 5px rgba(46, 122, 80, .6);
}
.dot-bad { background: var(--oxblood); box-shadow: 0 0 0 2px rgba(142, 53, 47, .14); }
.dot-warn { background: var(--amber); box-shadow: 0 0 0 2px rgba(156, 106, 16, .14); }
.dot-idle { background: var(--line-strong); }

/* ---- שבבי מידע ---- */
.chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: .12rem .45rem; border-radius: 3px; font-size: .78rem; font-weight: 600;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
}
.chip b { font-weight: 600; font-size: .76rem; }
.chip.muted { color: var(--ink-2); font-weight: 500; background: transparent; border-style: dashed; }
.chip.off { background: var(--oxblood-soft); color: #7b2c26; border-color: var(--oxblood-line); }
.chip.pin { cursor: pointer; background: var(--brass-soft); border-color: var(--line-strong); }
.chip-prio {
  font-family: var(--font-data); color: var(--brass);
  padding-inline-start: 5px; margin-inline-start: 1px; border-inline-start: 1px solid var(--line);
}

/* ---- פופאפים בשכבות ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(22, 38, 30, .5);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(600px, 100%);
  max-height: none; overflow: visible;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 20px 22px 22px;
  animation: modalRise .13s ease-out;
}
.modal.wide { width: min(760px, 100%); }
@keyframes modalRise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 1.35rem; }
.modal .x {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-strong); box-shadow: none;
  padding: .25rem .6rem; font-size: .82rem; font-weight: 600;
}
.modal .x:hover { background: var(--paper-2); color: var(--oxblood); border-color: var(--oxblood); }
.modal-actions {
  display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.muted-note { color: var(--ink-2); font-size: .84rem; line-height: 1.6; margin: 5px 0; }
.head-badges { align-items: center; gap: 7px; }
.list-row {
  border-radius: var(--radius); border-color: var(--line);
  background: var(--paper-2); padding: 7px 10px; margin-bottom: 5px;
}
.empty { color: var(--ink-2); padding: 22px; font-size: .9rem; }

/* ---- סרגל הרשימה: חיפוש + מונה + מקרא ---- */
.list-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 460px;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 0 10px;
}
.search-field:focus-within { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(154, 111, 36, .16); }
.search-field .search-ico { color: var(--brass); font-size: 1.15rem; line-height: 1; }
.search-field input {
  border: 0; background: transparent; padding: .5rem 0; flex: 1; min-width: 0;
}
.search-field input:focus { box-shadow: none; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.list-count {
  font-family: var(--font-data); font-size: .8rem; color: var(--ink-2);
  white-space: nowrap;
}

/* ---- כרטיס נציג ---- */
.agent-card { position: relative; }
.card-note {
  font-size: .78rem; color: var(--oxblood); font-weight: 600; line-height: 1.4;
}
.manage-row { margin-top: 18px; }
.add-card {
  border: 1px dashed var(--line-strong); background: transparent;
  color: var(--ink-2); align-items: center; justify-content: center;
  font-weight: 600; min-height: 74px; font-size: .92rem; text-align: center;
}
.add-card:hover { border-color: var(--brass); color: var(--brass); border-style: solid; box-shadow: none; }
.danger-card:hover { border-color: var(--oxblood); color: var(--oxblood); }

/* ---- הסבר המצב ובאנר ההשהיה ---- */
.status-why {
  font-size: .84rem; color: var(--ink-2); line-height: 1.6;
  margin: 8px 0 0; padding-inline-start: 10px;
  border-inline-start: 2px solid var(--line);
}
.hold-banner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin-top: 12px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--oxblood-line); background: var(--oxblood-soft);
  border-inline-start: 3px solid var(--oxblood);
  font-size: .88rem;
}
.hold-banner b { color: #7b2c26; }
.hold-banner span { font-family: var(--font-data); font-size: .82rem; color: #7b2c26; }
.hold-banner.is-force {
  border-color: var(--amber-line); background: var(--amber-soft); border-inline-start-color: var(--amber);
}
.hold-banner.is-force b, .hold-banner.is-force span { color: #7d5409; }
body.dark .hold-banner b, body.dark .hold-banner span { color: #e5a49d; }
body.dark .hold-banner.is-force b, body.dark .hold-banner.is-force span { color: #e2bd7c; }

/* ---- מקרא המצבים ---- */
.legend { display: flex; flex-direction: column; gap: 1px; }
.legend-row {
  display: grid; grid-template-columns: 24px 130px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 4px; border-top: 1px solid var(--line); font-size: .86rem;
}
.legend-row:first-child { border-top: 0; }
.legend-order { font-family: var(--font-data); color: var(--brass); font-size: .8rem; }
.legend-label { font-weight: 700; }
.legend-why { color: var(--ink-2); line-height: 1.5; }
@media (max-width: 640px) {
  .legend-row { grid-template-columns: 24px 1fr; }
  .legend-why { grid-column: 2; }
}

/* ---- לוח השבוע: גיליון תורנות על ציר 24 שעות (רכיב החתימה) ---- */
.week-strip {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 10px 12px 8px;
}
.strip-hours {
  position: relative; height: 14px; margin-inline-start: 52px;
  font-size: .68rem; color: var(--ink-2); direction: ltr;
}
.strip-hours span { position: absolute; transform: translateX(-50%); }
.strip-row { display: flex; align-items: center; gap: 8px; height: 20px; }
.strip-day {
  flex: 0 0 44px; font-size: .72rem; color: var(--ink-2); text-align: start;
  white-space: nowrap; overflow: hidden;
}
.strip-row.today .strip-day { color: var(--brass); font-weight: 600; }
.strip-track {
  position: relative; flex: 1; height: 12px; direction: ltr;
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  background-image: repeating-linear-gradient(
    to right, transparent 0, transparent calc(25% - 1px),
    var(--line) calc(25% - 1px), var(--line) 25%);
}
.strip-row.today .strip-track { border-color: var(--line-strong); }
.strip-track .bar { position: absolute; top: 0; bottom: 0; border-radius: 1px; }
.bar-answer { background: var(--lamp); }
.bar-backup { background: var(--brass-lite); }
/* שעות חסימה: קווקוו אלכסוני — "מחוק" ולא "מלא" */
.bar-blocked {
  background: repeating-linear-gradient(
    45deg, var(--oxblood) 0 3px, transparent 3px 6px);
  border-top: 1px solid var(--oxblood); border-bottom: 1px solid var(--oxblood);
}
.strip-now {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--brass); border-radius: 1px;
}
.strip-key {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 9px; padding-top: 8px;
  border-top: 1px solid var(--line); font-size: .74rem; color: var(--ink-2);
}
.strip-key span { display: inline-flex; align-items: center; gap: 5px; }
.key-swatch {
  width: 14px; height: 8px; border-radius: 1px; display: inline-block; flex: 0 0 14px;
}
.key-swatch.key-now { width: 2px; flex: 0 0 2px; height: 12px; background: var(--brass); }

/* ---- מסגרת הגדרה + מתג עם חיווי ---- */
.setting {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 12px 14px;
}
.setting-inner { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.setting-sub {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); padding: 11px 12px; margin: 12px 0;
}
.switch-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin-bottom: 0; font-weight: 400; position: relative;
}
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  flex: 0 0 38px; width: 38px; height: 20px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line-strong);
  position: relative; transition: background .16s ease, border-color .16s ease;
}
.switch-knob {
  position: absolute; top: 2px; inset-inline-start: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--line-strong); transition: transform .16s ease, background .16s ease;
}
.switch-row input:checked + .switch-track { background: var(--lamp); border-color: var(--lamp); }
.switch-row input:checked + .switch-track .switch-knob {
  background: #fff; transform: translateX(-18px);
}
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--brass); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.switch-text b { font-size: .92rem; font-weight: 700; }
.switch-state { font-size: .76rem; color: var(--ink-2); }
.switch-row input:checked ~ .switch-text .switch-state { color: var(--lamp); font-weight: 600; }

/* ---- קבוצת בחירה (רדיו) ---- */
.radio-set { display: flex; flex-direction: column; gap: 6px; }
.radio-row {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); font-size: .88rem; line-height: 1.5;
}
.radio-row:hover { border-color: var(--line-strong); }
.radio-row input { width: auto; margin: 3px 0 0; accent-color: var(--brass); flex: 0 0 auto; }
.radio-row.on { border-color: var(--brass); background: var(--brass-soft); }
.radio-row b { font-weight: 700; }

/* ---- שעות מענה לפי תור ---- */
.schedule-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 12px; margin-bottom: 10px;
}
.schedule-head { margin-bottom: 9px; align-items: flex-start; }
.schedule-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.schedule-head .group-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  color: var(--ink); margin-left: 0;
}
.prio-field { display: inline-flex; align-items: center; gap: 6px; }
.prio-field > span { font-size: .76rem; color: var(--ink-2); font-weight: 600; }
.prio-field select {
  width: auto; padding: .2rem .4rem; font-size: .82rem;
  font-family: var(--font-data); background: var(--paper);
}
.slot-row span:first-child { font-weight: 500; font-size: .88rem; }
.add-slot-btn { width: 100%; margin-top: 8px; }

/* ---- שבב יום נבחר ---- */
.day-chip {
  background: var(--paper); color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 3px; padding: .28rem .6rem; font-size: .8rem; box-shadow: none;
}
.day-chip:hover { border-color: var(--brass); color: var(--brass); background: var(--paper); }
.day-chip.on {
  background: var(--brass); color: var(--btn-fg); border-color: var(--brass); box-shadow: none;
}

/* ---- כפתורי אייקון ---- */
.icon-btn {
  width: 28px; height: 28px; border-radius: 3px; font-size: .85rem;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--line);
  box-shadow: none;
}
.icon-btn:hover { transform: none; background: var(--paper-2); color: var(--brass); border-color: var(--brass); }
.icon-btn.danger { color: var(--oxblood); background: var(--paper); border-color: var(--line); box-shadow: none; }
.icon-btn.danger:hover { background: var(--oxblood-soft); border-color: var(--oxblood); }

/* ---- באנר שגיאה ---- */
.error-banner {
  background: var(--oxblood-soft); color: #7b2c26; border: 1px solid var(--oxblood);
  border-inline-start-width: 3px;
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
  font-weight: 600; font-size: .88rem; box-shadow: none; animation: none;
}
body.dark .error-banner { background: var(--oxblood-soft); color: #e5a49d; }

/* ---- הודעת Toast ---- */
.toast {
  bottom: 20px; border-radius: var(--radius); padding: 10px 16px;
  background: var(--panel); color: #f6f3ea; border-inline-start: 3px solid var(--brass);
  box-shadow: var(--shadow-modal); font-size: .9rem; font-weight: 600;
}

/* ---- בקרות מקטעים / טאבים: לוחיות במקום גלולות עם מדרג ---- */
.seg {
  border-radius: var(--radius); padding: 2px; gap: 2px;
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: none;
}
.seg-btn {
  background: transparent; color: var(--ink-2); border-radius: 3px;
  padding: .34rem .7rem; font-size: .82rem; box-shadow: none; border: 0;
}
.seg-btn:hover { background: var(--paper); color: var(--brass); }
.seg-btn.on { background: var(--brass); color: var(--btn-fg); box-shadow: none; }

.tab {
  background: var(--paper); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none;
}
.tab.on { background: var(--brass); color: var(--btn-fg); border-color: var(--brass); box-shadow: none; }

.crumb, .rtab {
  border-radius: 3px; box-shadow: none;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
}
.crumb.on, .rtab.on {
  background: var(--brass); color: var(--btn-fg); border-color: var(--brass); box-shadow: none;
}
.mini-btn { background: var(--brass); color: var(--btn-fg); border: 1px solid var(--brass); border-radius: 3px; }
.mini-btn.ghost { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); box-shadow: none; }
.rx-seg { border-radius: var(--radius); background: var(--paper-2); }
.rx-seg-btn { border-radius: 3px; color: var(--ink-2); }
.rx-seg-btn.on { background: var(--brass); color: var(--btn-fg); box-shadow: none; }

/* ---- בחירה מרובה ---- */
.ms-toggle {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: none; padding: .5rem .7rem; font-weight: 500;
}
.ms.has-sel .ms-toggle { border-color: var(--brass); color: var(--brass); font-weight: 600; box-shadow: none; }
.ms-panel {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-modal); padding: 4px;
}
.ms-opt { border-radius: 3px; padding: 6px 8px; font-size: .86rem; color: var(--ink); }
.ms-opt:hover { background: var(--paper-2); }
.ms-opt input { accent-color: var(--brass); }
.ms-all { border-radius: 3px 3px 0 0; }

/* ---- קוביות מדדים בלוח הבקרה ---- */
.stat-card {
  border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow);
  background: var(--paper); border: 1px solid var(--line);
}
.stat-card::before { width: 3px; background: var(--brass); }
.stat-card.green::before { background: var(--lamp); }
.stat-card.blue::before { background: var(--brass); }
.stat-card.red::before { background: var(--oxblood); }
.stat-card.orange::before { background: var(--amber); }
.stat-num { font-size: 1.9rem; font-weight: 600; color: var(--ink); }
.stat-label { color: var(--ink-2); font-size: .82rem; }
.stat-ico { font-size: 1.1rem; opacity: .75; }
.stat-card.stat-clickable:hover {
  transform: none; border-color: var(--brass); box-shadow: var(--shadow-lift);
}
.stat-card.stat-clickable::after { color: var(--brass); opacity: .6; }

/* ---- קוביות שיחה חיה ---- */
.call-card {
  border-radius: var(--radius-lg); border: 1px solid var(--line); border-top-width: 3px;
  border-top-color: var(--brass); box-shadow: var(--shadow);
}
.call-card:hover { transform: none; border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.call-card.type-incoming { border-top-color: var(--lamp); }
.call-card.type-outgoing { border-top-color: var(--oxblood); }
.call-card.type-internal { border-top-color: var(--brass); }
.call-card.type-routing { border-top-color: var(--amber); }
.cc-type { color: var(--ink); font-family: var(--font-display); }
.cc-timer { border-radius: 3px; background: var(--paper-2); border-color: var(--line); }
.cc-flow { border-radius: var(--radius); border-inline-start-color: var(--brass); }
.cc-num { font-weight: 600; color: var(--ink); }
.cc-box-dest .cc-num { color: var(--brass); }
.call-card.type-incoming .cc-box-dest .cc-num,
.call-card.type-routing .cc-box-dest .cc-num { color: var(--lamp); }
.call-card.type-outgoing .cc-box-dest .cc-num { color: var(--oxblood); }

/* ---- טבלת נתונים ---- */
.table-wrap { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.data-table { font-size: .87rem; }
.data-table th, .data-table td { padding: 8px 11px; }
.data-table thead th {
  background: var(--paper-2); color: var(--brass); font-size: .78rem;
  letter-spacing: .04em; border-bottom: 1px solid var(--line-strong);
}
.data-table tbody tr:hover { background: var(--paper-2); }

/* ---- כרטיסי דוח ---- */
.agent-report-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.agent-report-card h3 { color: var(--ink); }
.metric-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-title { color: var(--ink-2); }
.metric-value { font-weight: 600; color: var(--ink); }
body.dark .metric-box { background: var(--paper-2); }
.email-preview-box, .email-preview, .email-extra { border-radius: var(--radius); background: var(--paper-2); }
body.dark .email-extra { background: var(--paper-2); }

/* ---- מדריך שיחה חוזרת / מספרים ---- */
.cb-guide-btn, .cb-settings-btn { border-radius: var(--radius); box-shadow: none; padding: .5rem 1rem; }
.cb-guide-btn { background: var(--brass); color: var(--btn-fg); }
.cb-guide-btn:hover { background: #85601d; filter: none; }
.cb-settings-btn { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); }
.cb-url { background: var(--panel-2); border-radius: var(--radius); }
.cb-url-text { font-family: var(--font-data); color: var(--brass-lite); }
.cb-copy { background: var(--brass); color: var(--btn-fg); border-radius: 3px; }
.cb-ep, .rx-panel, .rx-qrow, .acc, .route-line, .pad-key, .num-row {
  border-radius: var(--radius); box-shadow: none;
}
.rx-qrow:hover, .route-line:hover, .pad-key:hover:not(:disabled), .num-row:hover {
  transform: none; border-color: var(--brass); box-shadow: none;
}
.rx-hero {
  border-radius: var(--radius-lg); background: var(--brass-soft); border: 1px solid var(--line);
}
.rx-hero-title, .rx-panel-title, .rx-qrow-title, .num-title, .pad-digit { color: var(--ink); }
.rx-ico, .cb-ep-icon { background: var(--brass-soft); border-radius: 3px; border-color: var(--line); }
.rx-search, .rx-field input, .rx-field select { border-radius: var(--radius); border-width: 1px; }
.rx-search:focus, .rx-field input:focus, .rx-field select:focus {
  border-color: var(--brass); box-shadow: 0 0 0 3px rgba(154, 111, 36, .16);
}
.dest-chip {
  border-radius: 3px; background: var(--paper-2); border-color: var(--line); color: var(--ink);
}
.fixed-num { border-radius: var(--radius); background: var(--paper-2); color: var(--ink); }
.cb-waiting-pill {
  border-radius: var(--radius); background: var(--amber-soft); color: #7d5409;
  border: 1px solid var(--amber-line); font-size: .86rem;
}
.cb-waiting-pill:hover { background: var(--amber-soft); border-color: var(--amber); }
body.dark .cb-waiting-pill { background: var(--amber-soft); color: #e2bd7c; border-color: var(--amber-line); }
.link-btn { color: var(--brass); }
.active-tag, .cb-ep-phase { color: var(--brass); background: transparent; }
.inline-child, .change-dest { border-radius: var(--radius); background: var(--paper-2); }
.inline-child { border-inline-start-color: var(--brass); }

/* ---- אנטנת "חי": שומרים על הפעימה, מרגיעים את הצבע ---- */
.live-banner-txt { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .modal { animation: none; }
}

@media (max-width: 820px) {
  .content { padding: 20px 16px 48px; }
  .sidebar { border-inline-start: 0; border-bottom: 3px solid var(--brass); }
  .list-toolbar { gap: 8px; }
  .search-field { max-width: none; }
  .strip-day { flex-basis: 34px; font-size: .66rem; }
  .strip-hours { margin-inline-start: 42px; }
}

/* התגים והשבבים בכרטיס מתכווצים לרוחב התוכן (פריט flex לא נמתח) */
.card > .badge, .card > .pins, .card > .card-note { align-self: flex-start; }
.card > .pins { max-width: 100%; }

/* ---- סמלי SVG בקו אחיד (מחליפים אמוג'י) ---- */
.ic {
  width: 17px; height: 17px; flex: 0 0 17px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic rect, .ic circle { fill: none; }
.nav-item .ic { opacity: .8; }
.nav-item.active .ic { opacity: 1; stroke: var(--brass); stroke-width: 1.8; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle .ic { width: 14px; height: 14px; flex-basis: 14px; }

/* סמלים בתוך כפתורים וכרטיסי תפריט */
button .ic { vertical-align: -2px; margin-inline-end: 5px; }
.icon-btn .ic, .ms-caret .ic, .search-ico .ic { margin: 0; vertical-align: 0; }
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn .ic { width: 15px; height: 15px; flex-basis: 15px; }
.ms-caret { display: inline-flex; opacity: .55; }
.ms-caret .ic { width: 13px; height: 13px; flex-basis: 13px; }
.ms.open .ms-caret { transform: rotate(180deg); }
.search-field .search-ico { display: inline-flex; }
.search-field .search-ico .ic { width: 15px; height: 15px; flex-basis: 15px; }
.card .avatar .ic { width: 17px; height: 17px; flex-basis: 17px; margin: 0; }
.stat-ico .ic { width: 18px; height: 18px; flex-basis: 18px; margin: 0; color: var(--brass); }
.ultra-mark { color: var(--brass); }

/* ציר השעות הוא LTR בתוך עמוד RTL — הריווח חייב להיות פיזי (ימין), אחרת
   inline-start מתהפך ומזיז את התוויות ביחס למסילה. */
.strip-hours { margin-inline-start: 0; margin-right: 52px; margin-left: 0; }
@media (max-width: 820px) { .strip-hours { margin-right: 42px; } }

/* גודל בסיס לסמל הנציג גם מחוץ לכרטיס (כותרת הפופאפ, שורות רשימה) */
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 3px;
  background: var(--brass-soft); border: 1px solid var(--line); color: var(--brass);
  display: grid; place-items: center;
  font-family: var(--font-data); font-weight: 600; font-size: 1rem;
}
.head-badges .avatar { width: 44px; height: 44px; flex-basis: 44px; }

/* מתג מצב התצוגה עבר לתפריט הצד — אין עוד כפתור צף שמתנגש בפעולות העמוד */
.theme-toggle { position: static; }
#themeToggle.nav-item { font-weight: 500; font-size: .88rem; color: #a7b4a9; }
#themeToggle.nav-item:hover { color: #f6f3ea; }

/* ---- קוביות מדדים (KPI) ----
   נייר אחיד עם קו-גוון עליון; הצבע נמצא במספר עצמו ולא ברקע. שלושה גוונים בלבד:
   ירוק=נענו, אוקסבלד=לא נענו, פליז=כל השאר. */
.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 6px 0 16px;
}
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--brass);
  border-radius: var(--radius); padding: 11px 12px; text-align: center;
}
.kpi-title { font-size: .76rem; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.kpi-value {
  font-family: var(--font-data); font-variant-numeric: tabular-nums;
  font-size: 1.6rem; font-weight: 600; color: var(--brass); direction: ltr; line-height: 1.15;
}
.kpi-sub { font-size: .7rem; color: var(--ink-2); margin-top: 3px; }
.kpi.good { border-top-color: var(--lamp); }
.kpi.good .kpi-value { color: var(--lamp); }
.kpi.bad { border-top-color: var(--oxblood); }
.kpi.bad .kpi-value { color: var(--oxblood); }
.kpi.plain { border-top-color: var(--line-strong); }
.kpi.plain .kpi-value { color: var(--ink); }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }

/* ---- שדות קלט במצב לילה ---- */
body.dark input, body.dark select, body.dark textarea {
  background: var(--paper-2); color: var(--ink); border-color: var(--line-strong);
}
body.dark .search-field, body.dark .ms-toggle { background: var(--paper-2); }
body.dark .search-field input { background: transparent; }

/* ---- תיקוני טבלה ופופאפ ארוך ---- */
/* תגים וכפתורים לא נשברים באמצע מילה בתוך תא צר */
.badge, .chip { white-space: nowrap; }
.data-table td button, .data-table td .badge { white-space: nowrap; }
.data-table td:first-child { white-space: nowrap; }

/* היסטוריית השיחות גוללת בתוך עצמה, כדי שסרגל הסינון יישאר נעוץ מעל הטבלה */
.modal.history-modal { max-height: 88vh; overflow: auto; }
.history-modal .report-toolbar {
  top: 0; background: var(--paper); padding: 8px 0 10px; margin-top: 0;
  border-bottom: 1px solid var(--line);
}
.history-modal .table-wrap { max-height: none; overflow: visible; }
