:root {
  /* Luxury neutral palette - sophisticated & modern */
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --bg-hover: #f1f3f4;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --error: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --btn-on-accent: #fff;
  /* Chat luxury theme - refined */
  --chat-bg: #fafbfc;
  --chat-sidebar: #f3f4f6;
  --chat-sidebar-header: linear-gradient(165deg, #1e3a5f 0%, #0f172a 100%);
  --chat-accent: #3b82f6;
  --chat-accent-soft: rgba(59, 130, 246, 0.1);
  --chat-text: #1f2937;
  --chat-text-muted: #6b7280;
  --chat-border: rgba(59, 130, 246, 0.15);
  --chat-shadow: 0 1px 3px rgba(0,0,0,0.06);
  --chat-shadow-soft: 0 4px 12px rgba(0,0,0,0.08);
  /* Tasks - elegant accents */
  --task-accent: #1e40af;
  --task-accent-hover: #1e3a8a;
  --task-gold: #b45309;
  --task-gold-soft: rgba(180, 83, 9, 0.12);
  --task-overdue: #dc2626;
  --task-today: #ea580c;
  /* Settings - premium feel */
  --settings-card: #ffffff;
  --settings-border: #e5e7eb;
  --settings-accent: #3b82f6;
}

/* ממשק צפוף יותר בברירת מחדל (~14px במקום 16px) — כל ה־rem יורדים ביחד */
html {
  font-size: 87.5%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

/* Login */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #d4ebe6 100%);
}

.login-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.logo {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-dot {
  color: var(--accent);
}

.tagline {
  color: var(--text-muted);
  margin: 0.5rem 0 2rem;
  font-size: 0.95rem;
}

#login-form input {
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
#login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

#login-form button {
  width: 100%;
  padding: 0.9rem;
  margin-top: 0.5rem;
  background: var(--accent);
  color: var(--btn-on-accent);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#login-form button:hover {
  background: var(--accent-dim);
}

.error-msg {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Dashboard */
#dashboard-screen {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 100;
  gap: 0.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-history-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-inline-start: 0.15rem;
}
.header-history-btn {
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-history-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent-soft);
}
.header-history-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.header-center-cluster {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  direction: rtl;
}
.header-search-block {
  position: relative;
  flex: 0 1 20rem;
  max-width: 26rem;
  min-width: 8rem;
}
.global-search-input {
  width: 100%;
  padding: 0.38rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--bg);
}
.global-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--chat-shadow-soft);
  z-index: 250;
}
.global-search-dropdown.hidden {
  display: none !important;
}
.global-search-section {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.global-search-section:last-child {
  border-bottom: none;
}
.global-search-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem;
}
.global-search-row {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.42rem 0.65rem;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text);
}
.global-search-row:hover {
  background: var(--bg-hover);
}
.global-search-row small {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-top: 0.12rem;
}

.header-recent-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(38vw, 480px);
  border: none;
  box-shadow: none;
  background: transparent;
  outline: none;
}
.header-recent-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0.25rem 0 0.35rem;
  padding-inline-start: 0.1rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-height: 3.65rem;
}
.header-recent-strip::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.header-recent-strip:focus,
.header-recent-strip:focus-visible {
  outline: none;
}

@keyframes header-recent-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.header-recent-card {
  position: relative;
  flex: 0 0 auto;
  width: 7.85rem;
  min-width: 7.85rem;
  min-height: 3.35rem;
  padding: 0.5rem 0.55rem;
  margin: 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: right;
  font: inherit;
  color: var(--text);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 248, 250, 0.96) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 6px rgba(15, 35, 40, 0.07),
    0 12px 26px rgba(15, 35, 40, 0.09);
  border: none;
  outline: none;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease,
    filter 0.25s ease;
  animation: header-recent-card-enter 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--recent-i, 0) * 0.055s);
}
.header-recent-card:not(:first-child) {
  margin-inline-start: -2.55rem;
}
.header-recent-card:hover {
  transform: translateY(-5px) scale(1.04);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 4px 12px rgba(0, 120, 95, 0.12),
    0 18px 40px rgba(15, 35, 40, 0.16);
  z-index: 80 !important;
  filter: saturate(1.05);
}
.header-recent-card:active {
  transform: translateY(-2px) scale(1.01);
  transition-duration: 0.12s;
}
.header-recent-card:focus {
  outline: none;
}
.header-recent-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 85 !important;
}

.header-recent-card-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  font-size: 0.74rem;
  line-height: 1.42;
  font-weight: 500;
  text-align: right;
}
.header-recent-card-type {
  font-weight: 700;
  font-size: 0.66rem;
  color: var(--accent, #0d9488);
  letter-spacing: 0.02em;
}
.header-recent-card-sep {
  margin: 0 0.12rem;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.75;
}
.header-recent-card-label {
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .header-recent-card {
    animation: none;
  }
  .header-recent-card:hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  .header-recent-card {
    width: 6.6rem;
    min-width: 6.6rem;
    min-height: 3.05rem;
    padding: 0.42rem 0.45rem;
  }
  .header-recent-card:not(:first-child) {
    margin-inline-start: -2.05rem;
  }
  .header-recent-card-text {
    font-size: 0.68rem;
    line-height: 1.38;
  }
}

.header-recent-empty {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.35rem 0.35rem;
  white-space: nowrap;
}

.header .logo-area .logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-agency-logo {
  height: 28px;
  width: auto;
  max-width: 86px;
  object-fit: contain;
  border-radius: 5px;
  cursor: pointer;
  vertical-align: middle;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.header-agency-logo:hover {
  opacity: 0.88;
  transform: scale(1.03);
}

/* תצוגת לוגו סוכנות בגודל מלא */
.agency-logo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.agency-logo-lightbox.hidden {
  display: none !important;
}
.agency-logo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
}
.agency-logo-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.agency-logo-lightbox-content .agency-logo-lightbox-close {
  pointer-events: auto;
}
.agency-logo-lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #fff;
  padding: 0.5rem;
  pointer-events: none;
}
.agency-logo-lightbox-close {
  position: absolute;
  top: -0.35rem;
  inset-inline-end: -0.35rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 2;
}
.agency-logo-lightbox-close:hover {
  background: var(--bg-hover);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.notifications-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.whatsapp-pending-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 22px;
  padding: 0 0.35rem 0 0.15rem;
  border-radius: 999px;
  background: #128c7e;
  color: #fff;
  font-weight: 600;
  font-size: 0.72rem;
  cursor: pointer;
  vertical-align: middle;
}
.whatsapp-pending-wrap:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}
.whatsapp-pending-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.98;
}
.whatsapp-pending-count {
  min-width: 1em;
  padding: 0 0.15rem 0 0;
  line-height: 1.2;
  text-align: center;
}
.whatsapp-bot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.whatsapp-bot-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-width: 120px;
}
.whatsapp-bot-stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--accent);
}
.whatsapp-bot-card {
  margin-bottom: 1rem;
}
.wa-bot-inbox-cta {
  border-inline-end: 4px solid #128c7e;
}
.wa-textarea {
  width: 100%;
  margin: 0.35rem 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
}
.wa-textarea.wa-json {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
/* —— ווצאפ בתוך המערכת (מעטפת דמוית אפליקציה) —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#whatsapp-page.page-content {
  padding-inline: 0.35rem;
}
.wa-page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.25rem;
  padding-inline: 0.15rem;
}
.wa-page-heading h1 {
  margin: 0;
  flex: 1 1 auto;
}
.wa-page-hint {
  flex: 1 1 220px;
  margin: 0;
}
.wa-heading-settings-btn {
  align-self: center;
}
.wa-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(200px, 232px);
  gap: 0 0.75rem;
  min-height: min(76vh, 780px);
  max-height: calc(100vh - 200px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 1rem 0.85rem 1.1rem;
}
@media (max-width: 1100px) {
  .wa-shell {
    grid-template-columns: 1fr;
    gap: 0.5rem 0;
    max-height: none;
    min-height: auto;
  }
  .wa-sidebar {
    max-height: 42vh;
    border-inline-end: none;
    border-bottom: 1px solid var(--border);
  }
  .wa-crm-column {
    border-inline-start: none;
    border-top: 1px solid var(--border);
    max-height: none;
  }
  .wa-chat-panel {
    min-height: 45vh;
  }
}
.wa-sidebar {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid rgba(0, 0, 0, 0.06);
  background: #d1d7db;
  min-height: 0;
}
.wa-sidebar-toolbar-wrap {
  flex-shrink: 0;
  padding: 0.65rem 0.65rem 0.5rem;
  position: relative;
  z-index: 4;
}
.wa-sidebar-toolbar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wa-inbox-toolbar-card {
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.6rem 0.65rem;
  box-shadow: 0 1px 3px rgba(11, 20, 26, 0.12);
  border: 1px solid rgba(11, 20, 26, 0.08);
}
.wa-inbox-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.wa-inbox-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111b21;
  letter-spacing: -0.02em;
}
.wa-inbox-icon-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.wa-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #54656f;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.wa-icon-btn:hover {
  background: rgba(11, 20, 26, 0.06);
  color: #111b21;
}
.wa-icon-btn:focus-visible {
  outline: 2px solid #00a884;
  outline-offset: 2px;
}
.wa-icon-svg {
  flex-shrink: 0;
}
.wa-archive-toggle-btn[aria-expanded='true'] {
  background: rgba(11, 20, 26, 0.08);
  color: #111b21;
}
.wa-archive-toggle-btn.wa-archive-toggle-on {
  background: rgba(0, 168, 132, 0.14);
  color: #017561;
}
.wa-sidebar.wa-sidebar-archive-active .wa-inbox-toolbar-card {
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.35);
}
.wa-inbox-search-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}
.wa-inbox-search-input {
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.55rem;
  padding-inline-start: 2rem;
  padding-inline-end: 2.15rem;
  font-size: 0.88rem;
  border-radius: 10px;
  border: 1px solid #e9edef;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238696a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='M12 12l3.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 17px 17px;
  background-position: left 0.42rem center;
  color: #111b21;
  box-sizing: border-box;
}
.wa-inbox-search-input::placeholder {
  color: #8696a0;
  font-size: 0.82rem;
}
.wa-inbox-search-input:focus {
  outline: none;
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.18);
}
.wa-inbox-search-clear {
  position: absolute;
  inset-inline-start: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.06);
  color: #54656f;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-inbox-search-clear:hover {
  background: rgba(11, 20, 26, 0.12);
  color: #111b21;
}
.wa-inbox-filter-select {
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid #e9edef;
  background: #f8f9fa;
  color: #111b21;
  cursor: pointer;
}
.wa-inbox-filter-select:focus {
  outline: none;
  border-color: #00a884;
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}
.wa-inbox-filter-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.wa-archive-panel {
  position: absolute;
  inset-inline: 0.65rem;
  top: calc(100% + 4px);
  z-index: 20;
  animation: wa-archive-pop 0.18s ease-out;
}
@keyframes wa-archive-pop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.wa-archive-panel.hidden {
  display: none !important;
  animation: none;
}
.wa-inbox-archive-block {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(11, 20, 26, 0.1);
  box-shadow: 0 8px 28px rgba(11, 20, 26, 0.18);
}
.wa-archive-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #667781;
  margin-bottom: 0.25rem;
}
.wa-archive-hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #54656f;
}
.wa-archive-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.wa-chip-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #e9edef;
  background: #f8f9fa;
  color: #111b21;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.wa-chip-btn:hover {
  background: #e8f7f3;
  border-color: #00a884;
}
.wa-archive-range-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.wa-archive-date-input {
  flex: 1 1 108px;
  min-width: 0;
  padding: 0.4rem 0.45rem;
  font-size: 0.82rem;
  border-radius: 8px;
  border: 1px solid #e9edef;
  background: #fff;
}
.wa-archive-apply-full {
  flex: 1 1 100%;
  margin-top: 0.15rem;
}
.wa-archive-dash {
  font-size: 0.78rem;
  color: #667781;
}
.wa-archive-clear {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  padding: 0;
}
.wa-chat-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.35rem 0.55rem 0.65rem;
  background: #d1d7db;
}
.wa-chat-list-loading {
  margin: 1rem;
}
.wa-chat-list .wa-inbox-empty-msg,
.wa-chat-list .wa-chat-list-loading,
.wa-chat-list > .error-msg {
  margin: 0.5rem 0.15rem 0.35rem;
  padding: 1rem 0.85rem;
  text-align: center;
  border-radius: 12px;
  background: #fff;
  border: 1px dashed rgba(11, 20, 26, 0.12);
  color: #54656f;
  font-size: 0.88rem;
  line-height: 1.45;
}
.wa-chat-list > .error-msg {
  border-style: solid;
  border-color: rgba(220, 53, 69, 0.35);
  color: #842029;
}
.wa-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #e4ddd5;
  position: relative;
}
.wa-chat-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  color: var(--text-muted);
  padding: 2rem;
}
.wa-chat-placeholder-inner {
  text-align: center;
  max-width: 300px;
}
.wa-chat-placeholder-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.45;
}
.wa-chat-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.wa-chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: #075e54;
  color: #fff;
}
.wa-chat-header-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.wa-chat-header-titles {
  min-width: 0;
  flex: 1;
}
.wa-title-as-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: underline;
  text-align: start;
  padding: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-title-as-btn:hover {
  opacity: 0.92;
}
.wa-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.wa-chat-header-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-chat-header-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-chat-header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.wa-chat-header-tools .btn-sm {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}
.wa-closed-banner {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  background: linear-gradient(90deg, #fff8e6 0%, #fff3cc 100%);
  color: #5c4a00;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
}
.wa-external-app-link {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  white-space: nowrap;
}
.wa-external-app-link:hover {
  color: #fff;
}
.wa-external-app-link.hidden {
  display: none;
}
.wa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.5rem;
  background-color: #e5ddd5;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.02) 0,
    rgba(0, 0, 0, 0.02) 2px,
    transparent 2px,
    transparent 10px
  );
  min-height: 200px;
}
.wa-msg-row {
  display: flex;
  margin-bottom: 0.35rem;
  width: 100%;
}
.wa-msg-row-in {
  justify-content: flex-start;
}
.wa-msg-row-out {
  justify-content: flex-end;
}
.wa-msg-row-system {
  justify-content: center;
}
.wa-system-banner {
  max-width: 92%;
  margin: 0.25rem 0 0.5rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 168, 132, 0.38);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.wa-system-banner-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #1e2628;
}
.wa-system-banner-time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #667781;
}
.wa-transfer-open-btn {
  width: 100%;
  margin-top: 0.35rem;
}
.wa-transfer-hint {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* הפניה לפקיד — חלון צף מעל כל המערכת (לא בתוך עמוד הווצאפ) */
.wa-transfer-float {
  position: fixed;
  inset: 0;
  z-index: 10070;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 2rem;
  box-sizing: border-box;
}
.wa-transfer-float-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 28, 32, 0.42);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  cursor: pointer;
}
.wa-transfer-float-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.35rem 1.35rem 1.15rem;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 251, 248, 0.97) 100%);
  border: 1px solid rgba(0, 168, 132, 0.22);
  box-shadow:
    0 4px 6px rgba(0, 80, 60, 0.04),
    0 22px 50px rgba(0, 40, 35, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  animation: wa-transfer-float-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes wa-transfer-float-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.wa-transfer-float-accent {
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #00a884 0%, #25d366 45%, #128c7e 100%);
  opacity: 0.92;
}
.wa-transfer-float-x {
  position: absolute;
  top: 0.65rem;
  inset-inline-start: 0.65rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.wa-transfer-float-x:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}
.wa-transfer-float-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8f8f1 0%, #d4f0e6 100%);
  color: #128c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.65rem;
  box-shadow: 0 2px 8px rgba(0, 140, 110, 0.12);
}
.wa-transfer-float-title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.02em;
}
.wa-transfer-float-context {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(0, 120, 95, 0.06);
  border: 1px solid rgba(0, 168, 132, 0.12);
}
.wa-transfer-float-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wa-transfer-float-dl-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  font-size: 0.86rem;
}
.wa-transfer-float-dl-row dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}
.wa-transfer-float-dl-row dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}
.wa-transfer-float-mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.wa-transfer-float-lead {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}
.wa-transfer-float-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.wa-transfer-float-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 168, 132, 0.28);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: 0 1px 2px rgba(0, 60, 45, 0.05);
}
.wa-transfer-float-select:focus {
  outline: none;
  border-color: #00a884;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.18);
}
.wa-transfer-float-actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.6rem;
  margin-top: 0.15rem;
}
.wa-transfer-float-btn {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.wa-transfer-float-btn:active {
  transform: scale(0.98);
}
.wa-transfer-float-btn-ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.wa-transfer-float-btn-ghost:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
}
.wa-transfer-float-btn-primary {
  background: linear-gradient(165deg, #00a884 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 140, 110, 0.35);
}
.wa-transfer-float-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 140, 110, 0.42);
  filter: brightness(1.03);
}
.wa-link-client-card {
  max-width: 460px;
}
.wa-link-client-lead {
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.wa-link-client-label {
  display: block;
  margin: 0.5rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.wa-link-client-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 0.65rem;
}
.wa-link-client-result-row {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.45rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text);
}
.wa-link-client-result-row:last-child {
  border-bottom: none;
}
.wa-link-client-result-row:hover,
.wa-link-client-result-row.wa-link-active {
  background: var(--accent-soft, rgba(37, 99, 235, 0.08));
}
.wa-link-client-result-row small {
  opacity: 0.75;
  font-weight: 400;
}
.wa-link-client-card .wa-accent-btn {
  background: #374151;
  color: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
}
.wa-link-client-card .wa-accent-btn:hover {
  background: #1f2937;
  filter: none;
}
.wa-crm-field--client {
  min-height: auto;
}
.wa-crm-client-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}
@media (max-width: 480px) {
  .wa-transfer-float {
    padding: 3.5rem 0.65rem 1rem;
    align-items: stretch;
  }
  .wa-transfer-float-card {
    max-width: none;
    border-radius: 18px;
  }
  .wa-transfer-float-dl-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .wa-transfer-float-dl-row dt {
    font-size: 0.78rem;
  }
}

.wa-bubble {
  max-width: min(78%, 420px);
  border-radius: 8px;
  padding: 0.35rem 0.55rem 0.25rem;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.wa-bubble-in {
  background: #fff;
  border-radius: 0 8px 8px 8px;
}
.wa-bubble-out {
  background: #dcf8c6;
  border-radius: 8px 0 8px 8px;
}
.wa-bubble-text {
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
  color: #111b21;
}
.wa-bubble-attachments {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.wa-att-link {
  font-size: 0.82rem;
  color: #054d7a;
  text-decoration: underline;
  word-break: break-all;
}
.wa-compose-input-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}
.wa-compose-attach-icons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding: 0.15rem 0;
}
.wa-compose-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #c8d0d4;
  border-radius: 8px;
  background: #fff;
  color: #3b4a54;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wa-compose-icon-btn:hover {
  background: #eef3f6;
  border-color: #475569;
  color: #334155;
}
.wa-compose-icon-btn:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}
.wa-compose-icon-svg {
  display: block;
}
.wa-compose-icon-btn-client {
  color: #546e7a;
}
#whatsapp-page .wa-accent-btn {
  background: #374151;
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
#whatsapp-page .wa-accent-btn:hover {
  background: #1f2937;
  color: #fff;
}
#whatsapp-page .wa-compose-send.wa-accent-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
}
#whatsapp-page .wa-crm-save-btn.wa-accent-btn {
  padding: 0.55rem 1rem;
  border-radius: 10px;
}
.wa-bubble-meta {
  text-align: end;
  margin-top: 0.15rem;
  line-height: 1;
}
.wa-bubble-time {
  font-size: 0.68rem;
  color: #667781;
}
.wa-msg-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #667781;
  font-size: 0.9rem;
}
.wa-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
  align-items: center;
}
.wa-header-links-empty {
  font-size: 0.72rem;
  opacity: 0.88;
  font-weight: 400;
  line-height: 1.3;
}
.wa-header-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.wa-header-chip:hover {
  background: rgba(255, 255, 255, 0.24);
}
.wa-compose-bar {
  flex-shrink: 0;
  background: #f0f2f5;
  border-top: 1px solid #d1d7db;
  padding: 0.5rem 0.65rem 0.45rem;
}
.wa-quick-reply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.wa-qr-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d1d7db;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  color: #075e54;
}
.wa-qr-chip:hover {
  background: #e7fdf3;
}
.wa-compose-input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  max-height: 8rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
  align-self: stretch;
}
.wa-compose-send {
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wa-compose-footnote {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: #667781;
}
.wa-crm-column {
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid rgba(0, 0, 0, 0.06);
  background: #e8ecef;
  min-height: 0;
  overflow-y: auto;
}
.wa-crm-column-empty {
  padding: 1.5rem 1rem;
  color: #667781;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}
.wa-crm-column-form {
  margin: 0.45rem;
  padding: 0.65rem 0.7rem 0.75rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(11, 20, 26, 0.08);
  box-shadow: 0 1px 3px rgba(11, 20, 26, 0.08);
}
.wa-crm-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.wa-crm-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.28rem;
  min-height: 4.6rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(11, 20, 26, 0.1);
  border-radius: 10px;
  background: #f8fafb;
  box-sizing: border-box;
}
.wa-crm-field--notes {
  min-height: 7.5rem;
}
.wa-crm-field label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.wa-crm-field .search-input,
.wa-crm-field select.search-input {
  width: 100%;
  margin: 0;
}
.wa-crm-notes-ta {
  margin: 0;
  flex: 1;
  min-height: 4rem;
  resize: vertical;
}
.wa-crm-save-btn {
  width: 100%;
  margin-top: 0.55rem;
}
.wa-crm-column-form .wa-transfer-open-btn {
  margin-top: 0.35rem;
}
.wa-crm-column-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}
.wa-return-bubble {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* שיחה נכנסת — רצועה תחתונה (WebRTC / AMI / דמה) */
.pbx-incoming-float {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  z-index: 2510;
  width: min(440px, calc(100vw - 1.25rem));
  filter: drop-shadow(0 -4px 28px rgba(0, 0, 0, 0.35));
}
.pbx-incoming-float.hidden {
  display: none;
}
.pbx-incoming-float-card {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 55%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.pbx-incoming-float-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1rem 0.65rem;
}
.pbx-incoming-float-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ecfdf5;
  background: radial-gradient(circle at 30% 25%, #34d399 0%, #059669 45%, #047857 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.45);
}
.pbx-incoming-float-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: right;
}
.pbx-incoming-float-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.72);
}
.pbx-incoming-float-from {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  color: #f8fafc;
  line-height: 1.25;
  word-break: break-all;
}
.pbx-incoming-float-sub {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.88);
}
.pbx-incoming-float-sub.hidden {
  display: none;
}
.pbx-incoming-float-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.85rem;
  border-top: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(15, 23, 42, 0.55);
}
.pbx-incoming-float-btn {
  flex: 1;
  min-height: 2.65rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.pbx-incoming-float-btn:active {
  transform: scale(0.97);
}
.pbx-incoming-float-btn-glyph {
  font-size: 0.95rem;
  opacity: 0.95;
}
.pbx-incoming-float-btn--decline {
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.pbx-incoming-float-btn--decline:hover {
  filter: brightness(1.08);
}
.pbx-incoming-float-btn--pickup {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #f0fdf4;
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow: 0 2px 10px rgba(21, 128, 61, 0.45);
}
.pbx-incoming-float-btn--pickup:hover {
  filter: brightness(1.06);
}
.pbx-incoming-float-btn--ghost {
  flex: 0 0 auto;
  min-width: 4.5rem;
  background: rgba(51, 65, 85, 0.65);
  color: #e2e8f0;
  border: 1px solid rgba(100, 116, 139, 0.5);
}
.pbx-incoming-float-btn--ghost:hover {
  background: rgba(71, 85, 105, 0.75);
}
.pbx-incoming-float-forward,
.pbx-webrtc-incoming-forward {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0 0.85rem 0.55rem;
}
.pbx-incoming-float-forward-input {
  background: rgba(15, 23, 42, 0.65) !important;
  border-color: rgba(71, 85, 105, 0.85) !important;
  color: #f1f5f9 !important;
}
.pbx-incoming-float-forward-submit {
  border: none;
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(51, 65, 85, 0.9);
  color: #e2e8f0;
}
.pbx-incoming-float-forward-submit:hover {
  background: rgba(71, 85, 105, 0.95);
}
.pbx-forward-label {
  font-size: 0.8rem;
  color: rgba(203, 213, 225, 0.85);
}

/* שיחת דמה מחוברת — סרגל תחתון */
.pbx-demo-connected-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2509;
  width: min(440px, calc(100vw - 1.25rem));
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
}
.pbx-demo-connected-bar.hidden {
  display: none;
}
.pbx-demo-connected-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pbx-demo-pulse 1.4s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pbx-demo-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}
.pbx-demo-connected-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  text-align: right;
}
.pbx-demo-connected-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(148, 163, 184, 0.95);
}
.pbx-demo-connected-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-all;
}
.pbx-demo-connected-timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: #a7f3d0;
  flex-shrink: 0;
}
.pbx-demo-connected-hangup {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  background: rgba(127, 29, 29, 0.65);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
  position: relative;
  z-index: 1;
}
.pbx-demo-connected-hangup:hover {
  filter: brightness(1.08);
}
.pbx-demo-outgoing-bar {
  border-color: rgba(96, 165, 250, 0.45);
}
.pbx-demo-outgoing-bar .pbx-demo-connected-pulse {
  background: #60a5fa;
  box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.55);
  animation: pbx-demo-pulse-out 1.4s ease-out infinite;
}
@keyframes pbx-demo-pulse-out {
  0% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(96, 165, 250, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
  }
}
.pbx-absent-callee-float {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pbx-absent-callee-float.hidden {
  display: none;
}
.pbx-absent-callee-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.pbx-absent-callee-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(90vh, 520px);
  padding: 1.1rem 1.15rem;
  padding-top: calc(1.1rem + 3px);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% -10%, rgba(99, 102, 241, 0.22) 0%, transparent 52%),
    radial-gradient(100% 80% at -5% 110%, rgba(14, 165, 233, 0.14) 0%, transparent 48%),
    linear-gradient(168deg, rgba(51, 65, 85, 0.55) 0%, rgba(30, 41, 59, 0.98) 38%, rgba(15, 23, 42, 1) 72%, rgba(49, 46, 129, 0.22) 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  display: flex;
  flex-direction: column;
}
.pbx-absent-callee-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(129, 140, 248, 0.9) 0%,
    rgba(56, 189, 248, 0.85) 45%,
    rgba(52, 211, 153, 0.55) 100%
  );
  pointer-events: none;
}
.pbx-absent-callee-line1 {
  margin: 0 0 0.5rem;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
  flex: 0 0 auto;
}
.pbx-absent-callee-line2 {
  margin: 0 0 0.85rem;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.94);
  line-height: 1.45;
  flex: 1 1 auto;
  min-height: 0;
}
.pbx-absent-callee-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}
.pbx-absent-callee-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(51, 65, 85, 0.96);
  color: #f1f5f9;
  box-shadow: none;
}
.pbx-absent-callee-btn:hover {
  background: rgba(71, 85, 105, 0.98);
  border-color: rgba(148, 163, 184, 0.5);
  color: #fff;
}
.pbx-absent-callee-btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.65);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .pbx-absent-callee-actions {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .pbx-absent-callee-btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 2.2rem;
  }
}
.pbx-forward-ext-input {
  max-width: 7rem;
  min-width: 5rem;
}
.pbx-ringtone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.pbx-ringtone-select {
  max-width: 14rem;
}
.pbx-advanced-routing-textarea {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  width: 100%;
  margin-top: 0.35rem;
}
.pbx-advanced-routing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.pbx-presence-preview-wrap {
  margin-top: 1rem;
}
.pbx-presence-preview-wrap.hidden {
  display: none;
}
.wa-compose-settings-box {
  max-width: none;
}

/* חלון הגדרות כתיבה — רחב, ממורכז, מרווח מהמסך */
#wa-compose-settings-modal.modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 3.5vw, 2.25rem);
  border: none;
  border-radius: 0;
  background: rgba(22, 36, 38, 0.48);
  box-sizing: border-box;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}
#wa-compose-settings-modal.modal:not(.hidden) {
  display: flex !important;
}
#wa-compose-settings-modal .save-email-modal-content.wa-compose-settings-box {
  width: min(92vw, 760px);
  max-width: none;
  max-height: min(86vh, 700px);
  overflow-y: auto;
  margin: auto;
  flex-shrink: 0;
}
#wa-compose-settings-modal .save-email-modal-title::before {
  content: '✏️';
}
#wa-compose-settings-modal.modal .form-hint {
  margin-bottom: 0.85rem;
}
#wa-compose-settings-modal.modal textarea.wa-textarea {
  margin-bottom: 0.65rem;
}
.wa-modal-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.wa-modal-h4 {
  margin: 0.5rem 0;
  font-size: 1rem;
}
.wa-qr-manage-list {
  margin: 0.5rem 0;
  font-size: 0.88rem;
}
.wa-qr-manage-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.wa-qr-add-row {
  margin-top: 0.5rem;
}
.wa-chat-list .whatsapp-inbox-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(11, 20, 26, 0.06);
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.06);
  flex-wrap: nowrap;
  justify-content: flex-start;
  transition: box-shadow 0.15s ease, transform 0.12s ease, border-color 0.15s;
}
.wa-chat-list .whatsapp-inbox-row:hover {
  box-shadow: 0 3px 10px rgba(11, 20, 26, 0.1);
  border-color: rgba(0, 168, 132, 0.25);
}
.wa-chat-list .whatsapp-inbox-row.wa-row-active {
  background: #e8ffef;
  border-color: rgba(0, 168, 132, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}
.wa-list-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 55%, #075e54 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(7, 94, 84, 0.25);
}
.wa-list-body {
  flex: 1;
  min-width: 0;
}
.wa-list-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.wa-list-title-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}
.wa-list-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #111b21;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-list-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  margin-inline-start: 0.35rem;
  vertical-align: middle;
}
.wa-list-badge-closed {
  background: rgba(100, 100, 100, 0.12);
  color: #3d4f57;
}
.wa-list-snippet {
  font-size: 0.8rem;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
}
.wa-list-side {
  flex-shrink: 0;
  align-self: flex-start;
  max-width: 76px;
}
.wa-list-assignee {
  font-size: 0.72rem;
  color: #8696a0;
  display: block;
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-hours-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.wa-hours-table th, .wa-hours-table td { border: 1px solid var(--border); padding: 0.35rem 0.5rem; }
.wa-menu-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}
.wa-menu-row-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.wa-menu-row-extra {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.wa-m-extra {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}
.wa-m-secondary {
  max-width: 100%;
}
.wa-multi { min-height: 120px; }
.wa-weekday-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.35rem 0 0.75rem; }
.wa-weekday-chips label { font-size: 0.85rem; }
.wa-handler-rules-table { width: 100%; font-size: 0.88rem; border-collapse: collapse; margin-bottom: 1rem; }
.wa-handler-rules-table th, .wa-handler-rules-table td { border: 1px solid var(--border); padding: 0.35rem; vertical-align: top; }
.wa-lookup-pre { background: var(--bg); padding: 0.75rem; border-radius: 6px; font-size: 0.8rem; overflow: auto; max-height: 200px; }
.wa-meta-checklist { margin: 0.5rem 0 0 1.25rem; line-height: 1.5; }
.wa-advanced-json { margin-top: 0.75rem; }
.whatsapp-msgs-title { margin: 1rem 0 0.35rem; font-size: 1rem; }
.bell-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.3rem;
}
.bell-btn .nav-badge {
  position: absolute;
  top: -2px;
  left: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
}
.notifications-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--chat-shadow-soft);
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
}
.notifications-dropdown .notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.notifications-dropdown .notif-item .notif-content,
.notifications-dropdown .notif-item .notif-meta { flex: 1; min-width: 0; }
.notifications-dropdown .notif-mark-read-btn {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.7;
}
.notifications-dropdown .notif-mark-read-btn:hover {
  opacity: 1;
  background: var(--chat-accent-soft);
}
.notifications-dropdown .notif-item:last-child {
  border-bottom: none;
}
.notifications-dropdown .notif-item.unread {
  background: var(--chat-accent-soft);
  cursor: pointer;
}
.notifications-dropdown .notif-item.read {
  background: var(--bg-hover);
  opacity: 0.6;
  cursor: default;
}
.notif-reminder-actions { display: inline-flex; gap: 0.35rem; margin-right: 0.5rem; }
.notif-reminder-close, .notif-reminder-nag {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  cursor: pointer;
}
.notif-reminder-close:hover { background: var(--bg-hover); }
.notif-reminder-nag:hover { background: var(--accent-soft); }

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#logout-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}
#logout-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.sidebar {
  width: 13.25rem;
  min-width: 13.25rem;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 0.5rem 0;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  color: var(--accent);
  background: var(--bg-hover);
}
.nav-badge {
  display: inline-block;
  min-width: 1.2em;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 10px;
  background: #c53030;
  color: white;
  margin-right: 0.4rem;
}
.attendance-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  margin-inline-end: 0.4rem;
  vertical-align: middle;
}
.attendance-status-dot.hidden {
  display: none;
}

@keyframes notif-blink {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}
.notif-blink {
  display: inline-block;
  animation: notif-blink 0.5s ease 3;
}

.notif-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}
.notif-filter-select {
  flex: 1;
  min-width: 100px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 0.9rem;
}
.notif-mark-all-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 0.85rem;
  cursor: pointer;
}
.notif-mark-all-btn:hover { background: var(--chat-accent-soft); }
.notif-list { max-height: 320px; overflow-y: auto; }

.content {
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.page-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.chat-page .content {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.page-content.chat-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.content h1 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.page-placeholder {
  color: var(--text-muted);
  padding: 2rem 0;
}

/* Chat layout – refined, elegant */
.chat-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.conversations-sidebar {
  width: 17rem;
  min-width: 17rem;
  flex-shrink: 0;
  min-height: 0;
  background: var(--chat-sidebar);
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 12px rgba(0,0,0,0.03);
}
.sidebar-toolbar {
  flex-shrink: 0;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--chat-sidebar-header);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-search {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 0.88rem;
  font-weight: 400;
}
.sidebar-search::placeholder { color: rgba(255,255,255,0.6); }
.sidebar-search:focus {
  outline: none;
  background: rgba(255,255,255,0.18);
}
.chat-layout .btn-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 1.2rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.chat-layout .btn-icon:hover {
  background: rgba(255,255,255,0.3);
}
.conversations-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem 0;
}
.conversations-list .no-items {
  padding: 2rem 1.5rem;
  color: var(--chat-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}
.conversation-row {
  padding: 0.85rem 1.2rem;
  margin: 0 0.5rem 0.15rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.conversation-row:hover {
  background: rgba(90, 154, 142, 0.08);
}
.conversation-row.unread {
  background: rgba(197, 48, 48, 0.08);
  border-right: 3px solid #c53030;
  font-weight: 600;
}
.conversation-row.active {
  background: rgba(90, 154, 142, 0.25);
  color: var(--chat-text);
  border-right: 3px solid var(--chat-accent);
  box-shadow: var(--chat-shadow);
}
.conversation-row.active .conv-meta { color: var(--chat-text-muted); }
.conversation-row .conv-subject {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}
.conversations-sidebar .conversation-row { color: var(--chat-text); }
.conversation-row .conv-meta {
  font-size: 0.78rem;
  color: var(--chat-text-muted);
  font-weight: 400;
}
.chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
}
.chat-header {
  flex-shrink: 0;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--chat-border);
  background: white;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.chat-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chat-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.chat-subject-display {
  font-size: 1rem;
  font-weight: 500;
  color: var(--chat-text);
  letter-spacing: 0.01em;
}
.chat-sub-subject-display {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--chat-text-muted);
}
.chat-sub-subject-display:not(:empty)::before {
  content: ' · ';
  color: var(--chat-border);
  margin-left: 0.25rem;
}
.chat-subject-edit-wrap {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.chat-subject-edit, .chat-sub-subject-edit {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--chat-border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--chat-bg);
  color: var(--chat-text);
  min-width: 120px;
}
.chat-subject-edit { flex: 1; min-width: 140px; }
.chat-subject-edit:focus, .chat-sub-subject-edit:focus {
  outline: none;
  border-color: var(--chat-accent);
}
.chat-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.chat-empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chat-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  padding: 2rem;
  margin: 0;
}
.chat-participants-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.participants-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.7rem;
  background: var(--chat-accent-soft);
  color: var(--chat-accent);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}
.participant-chip .chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.85;
}
.participant-chip .chip-remove:hover { opacity: 1; }
.participant-add-select {
  padding: 0.35rem 0.65rem;
  border: 1px dashed var(--chat-border);
  border-radius: 8px;
  background: transparent;
  font-size: 0.88rem;
  color: var(--chat-text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.participant-add-select:hover, .participant-add-select:focus {
  outline: none;
  border-color: var(--chat-accent);
  color: var(--chat-accent);
}
.chat-context-bar, .chat-actions-bar {
  margin-top: 0.75rem;
  font-size: 0.83rem;
  color: var(--chat-text-muted);
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--chat-bg);
}
.chat-messages:has(.msg) .chat-empty-state { display: none; }
.msg {
  max-width: 72%;
  padding: 0.7rem 1.1rem;
  border-radius: 14px;
  font-size: 0.93rem;
  line-height: 1.45;
  box-shadow: var(--chat-shadow);
}
.msg-mine {
  align-self: flex-end;
  background: linear-gradient(145deg, #5a9a8e 0%, #4a867a 100%);
  color: white;
  border-bottom-left-radius: 6px;
}
.msg-other {
  align-self: flex-start;
  background: white;
  border: 1px solid var(--chat-border);
  border-bottom-right-radius: 6px;
}
.msg-system {
  align-self: center;
  background: rgba(90, 154, 142, 0.08);
  color: var(--chat-text-muted);
  font-size: 0.83rem;
  font-weight: 400;
  max-width: 85%;
  border: none;
  box-shadow: none;
}
.msg-system .msg-sender { display: none; }
.msg-sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  opacity: 0.9;
  letter-spacing: 0.02em;
}
.msg-other .msg-sender { color: var(--chat-accent); }
.msg-time {
  display: block;
  font-size: 0.68rem;
  margin-top: 0.3rem;
  opacity: 0.75;
  letter-spacing: 0.01em;
}
.msg-read { margin-right: 0.35rem; }
.chat-input-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--chat-border);
  background: white;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.03);
}
.chat-input-bar input {
  flex: 1;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--chat-bg);
  color: var(--chat-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input-bar input:focus {
  outline: none;
  border-color: var(--chat-accent);
  box-shadow: 0 0 0 2px var(--chat-accent-soft);
}
.chat-input-bar input::placeholder {
  color: var(--chat-text-muted);
}
.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #5a9a8e 0%, #4a867a 100%);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(90, 154, 142, 0.3);
}
.btn-send:hover {
  transform: scale(1.03);
  box-shadow: 0 3px 10px rgba(90, 154, 142, 0.35);
}
.btn-send:disabled {
  background: var(--chat-border);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.83rem;
  border-radius: 8px;
  border: 1px solid var(--chat-border);
  background: var(--chat-bg);
  color: var(--chat-text);
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
}
.btn-sm:hover {
  background: var(--chat-accent-soft);
  border-color: var(--chat-accent);
  color: var(--chat-accent);
}
.conv-ended-txt {
  font-size: 0.78rem;
  color: var(--chat-text-muted);
}

.btn-primary {
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: var(--btn-on-accent);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-secondary {
  padding: 0.6rem 1.2rem;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border, rgba(0,0,0,0.15));
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--accent, #6366f1);
}

#users-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 220px);
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child {
  border-bottom: none;
}
.user-row:hover {
  background: var(--bg-hover);
}

.user-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.user-info-cell strong {
  font-size: 1rem;
}
.user-info-cell span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}
.role-manager { background: rgba(0,168,138,0.2); color: var(--accent); }
.role-clerk { background: rgba(139,148,158,0.2); color: var(--text-muted); }

.user-actions {
  display: flex;
  gap: 0.5rem;
}
.user-actions button {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  transition: all 0.2s;
}
.user-actions button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.user-actions button.delete:hover {
  border-color: var(--error);
  color: var(--error);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-stack-top { z-index: 1100; }

.modal {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  max-width: 400px;
}

.modal h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.modal input, .modal select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.modal-actions button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.modal-actions button[type="button"] {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.modal-actions button[type="submit"] {
  background: var(--accent);
  color: var(--btn-on-accent);
  border: none;
}
.modal-actions button:hover {
  opacity: 0.9;
}

/* Policy modal – wide form */
.policy-modal-wide.modal {
  max-width: 520px;
}

/* בקשת חתימה — מודאל רחב ושורות חותמים אופקיות */
.signature-req-modal-inner.modal {
  max-width: min(1120px, 96vw);
  width: 100%;
}
.sig-modal-signers-hint {
  font-size: 0.78rem;
}
#sig-modal-signers.sig-modal-signers-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sig-signer-row {
  display: grid;
  grid-template-columns: 3rem minmax(5.5rem, 0.55fr) minmax(5rem, 0.55fr) minmax(6rem, 0.65fr) minmax(7rem, 0.75fr) minmax(6.5rem, 0.85fr) minmax(8rem, 0.55fr) minmax(5rem, 0.45fr);
  gap: 0.35rem 0.45rem;
  align-items: center;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 0.78rem;
}
.sig-signer-row .sig-s-order {
  width: 100%;
  max-width: 3.25rem;
  text-align: center;
  font-weight: 600;
}
.sig-signer-row .sig-s-compact {
  font-size: 0.78rem !important;
  padding: 0.28rem 0.35rem !important;
  min-height: 1.85rem;
}
.sig-signer-row .sig-ch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  align-items: center;
  justify-content: flex-start;
}
.sig-signer-row .sig-ch {
  cursor: pointer;
  user-select: none;
  opacity: 0.45;
  font-size: 0.74rem;
  white-space: nowrap;
  padding: 0.1rem 0.15rem;
  border-radius: 4px;
}
.sig-signer-row .sig-ch-on {
  opacity: 1;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.signature-req-modal-inner.modal.modal-scroll {
  padding-bottom: 0.75rem;
}
.signature-req-modal-inner .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: var(--bg);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.06);
}

/* מודאל שליחה חוזרת — פריסת 3 שורות קומפקטיות + כפתורי ערוצים ברורים */
.sig-resend-modal-inner.modal {
  max-width: min(480px, 94vw);
  width: 100%;
  padding-top: 1rem;
}
.sig-resend-intro {
  margin-bottom: 0.55rem !important;
  font-size: 0.78rem !important;
}
.sig-resend-signer-sheet {
  padding: 0.55rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.sig-resend-row {
  margin-bottom: 0.48rem;
}
.sig-resend-row:last-child {
  margin-bottom: 0;
}
.sig-resend-row--contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.62rem;
  align-items: end;
}
.sig-resend-duo-cell {
  min-width: 0;
}
.sig-resend-micro-lbl {
  display: block;
  font-weight: 600;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.sig-resend-lbl-inline {
  margin-bottom: 0;
}
.sig-resend-compact-input.search-input,
.sig-resend-compact-select.search-input {
  width: 100%;
  font-size: 0.82rem !important;
  padding: 0.3rem 0.42rem !important;
  min-height: 1.92rem;
}
.sig-resend-row--channels,
.sig-resend-row--security {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.42rem 0.55rem;
}
.sig-resend-row--channels .sig-resend-lbl-inline,
.sig-resend-row--security .sig-resend-lbl-inline {
  flex: 0 0 auto;
  min-width: 5.85rem;
  text-align: right;
}
.sig-resend-channel-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}
.sig-resend-ch-btn {
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.26rem 0.62rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.sig-resend-ch-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.sig-resend-ch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sig-resend-ch-btn--on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dim);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}
.sig-resend-row--security .sig-resend-compact-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.sig-resend-row-pw {
  margin-top: 0.08rem;
  padding-top: 0.42rem;
  border-top: 1px dashed var(--border);
}
.sig-resend-pw-single.search-input {
  width: 100%;
}
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
}
.signature-req-table {
  table-layout: fixed;
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
  border-style: hidden; /* ההיקף מתעגל דרך ה-wrapper; הגבולות הפנימיים מתחתיו */
}
.signature-req-table th,
.signature-req-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--border);
}
.signature-req-table thead th {
  background: linear-gradient(180deg, #fafbfd 0%, var(--bg-hover) 100%);
  color: var(--text);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  border-bottom-width: 2px;
  white-space: nowrap;
}
.signature-req-table tbody tr:nth-child(even) {
  background: rgba(249, 250, 251, 0.65);
}
.signature-req-table tbody tr:hover {
  background: var(--bg-hover);
}
.signature-req-table tbody td {
  background: inherit;
}
.signature-req-table .sig-req-col-title {
  width: 26%;
}
.signature-req-table .sig-req-col-client {
  width: 12%;
}
.signature-req-table .sig-req-col-signers-merge {
  width: 42%;
}
.signature-req-table .sig-req-col-actions {
  width: 20%;
  white-space: normal;
}
.signature-req-table .sig-req-col-actions .btn-sm {
  display: inline-block;
  margin: 2px 0;
  vertical-align: middle;
}
.sig-req-req-banner {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.sig-req-req-banner--muted {
  color: var(--text-muted);
}
.sig-req-signers-cell-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sig-req-signer-line {
  font-size: 0.89rem;
  line-height: 1.38;
}
.sig-req-signer-name {
  font-weight: 600;
  color: var(--text);
}
.sig-req-signer-sep {
  margin: 0 0.35rem;
  color: var(--text-muted);
  font-weight: 400;
}
.sig-req-signer-st {
  font-weight: 600;
}
.sig-req-signer-line.is-signed .sig-req-signer-st {
  color: var(--success);
}
.sig-req-signer-line.is-pending .sig-req-signer-st {
  color: var(--warning);
}
.sig-req-act-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.42rem;
}
.sig-req-col-actions > .sig-cancel {
  display: inline-block;
  margin-top: 0.2rem;
}
@media (max-width: 900px) {
  .sig-signer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
  }
  .sig-signer-row .sig-s-order {
    flex: 0 0 3rem;
    max-width: 3.25rem;
    text-align: center;
  }
  .sig-signer-row .sig-s-role {
    flex: 1 1 40%;
    min-width: 6rem;
  }
  .sig-signer-row .sig-s-name {
    flex: 1 1 100%;
  }
  .sig-signer-row .sig-s-phone,
  .sig-signer-row .sig-s-email {
    flex: 1 1 45%;
    min-width: 8rem;
  }
  .sig-signer-row .sig-ch-row {
    flex: 1 1 100%;
  }
  .sig-signer-row .sig-s-identity {
    flex: 1 1 55%;
    min-width: 10rem;
  }
  .sig-signer-row .sig-s-pw {
    flex: 1 1 40%;
    min-width: 6rem;
  }
}
.policy-form-block .form-row {
  margin-bottom: 0.75rem;
}
.policy-form-block .form-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.policy-form-block .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.policy-form-block .form-row-group {
  margin-bottom: 0.75rem;
}
.policy-form-block .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
/* Styled dropdown – not the ugly default */
.input-select-wrap {
  position: relative;
  width: 100%;
}
.input-select {
  width: 100%;
  padding: 0.65rem 2rem 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
}
.input-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-select-styled .input-select {
  padding: 0.75rem 2rem 0.75rem 1rem;
  border-radius: 10px;
  border-color: var(--border);
}

.insurance-years-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.policy-couple-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 0.5rem;
}

.policy-detail-row {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.policy-detail-row strong {
  display: inline-block;
  min-width: 8rem;
  color: var(--text-muted);
}
.policy-smoker-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.policy-detail-btn {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  margin-left: auto;
}
.policy-type-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Policy modal – בחירה קטגוריה → סוג → כרטיסי פוליסה */
.policy-modal-select.modal {
  max-width: 720px;
}
.policy-select-step .policy-select-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}
.policy-select-cell {
  flex: 1;
  min-width: 140px;
}
.policy-select-cell label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.policy-types-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1 1 100%;
}
.policy-type-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.policy-type-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.coverage-section {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: 10px;
}
.coverage-section h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.coverage-row-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.coverage-total-row {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
}
.policy-subtype-wrap {
  flex: 1 1 100%;
  margin-top: 0.5rem;
}
.policy-subtype-wrap .policy-types-cards { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.link-back {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  padding: 0;
}
.link-back:hover { text-decoration: underline; }
.policy-profile-info-bar .policy-copy-item {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.policy-profile-info-bar .policy-copy-item:hover {
  background: var(--bg-hover);
}
.policy-profile-info-bar .policy-edit-btn {
  margin-right: auto;
}

/* תיקיית פוליסה */
#policy-profile-page {
  padding: 0 1rem 1rem;
}
.policy-profile-header {
  margin-bottom: 0.5rem;
}
.policy-profile-header .btn-back {
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}
.policy-profile-kind-heading {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted, #555);
  background: var(--bg-muted, rgba(0, 0, 0, 0.04));
  border-radius: 8px;
  border: 1px solid var(--border);
}
.policy-profile-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.policy-profile-main-col {
  flex: 1;
  min-width: min(100%, 12rem);
}
.policy-profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}
.policy-profile-meta-row > span {
  color: var(--text-muted);
}
.policy-profile-holders {
  font-size: 0.76rem;
  line-height: 1.35;
}
.policy-crm-assignee-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  max-width: 100%;
}
.policy-crm-assignee-inline .policy-crm-assignee-select {
  min-width: 7.5rem;
  max-width: 12rem;
  font-size: 0.75rem;
  padding: 0.15rem 0.32rem;
  min-height: 1.75rem;
}
.policy-crm-assignee-hint {
  display: inline;
  margin: 0 !important;
  font-size: 0.7rem !important;
  line-height: 1.25;
  white-space: normal;
}
.policy-profile-info-bar .policy-edit-btn {
  margin-inline-start: auto;
  flex-shrink: 0;
  align-self: flex-start;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}
.client-crm-assignee-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.client-crm-assignee-select {
  max-width: 18rem;
  min-width: 11rem;
}
.client-crm-assignee-hint {
  margin: 0;
}
.policy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.policy-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.policy-tab:hover { color: var(--text); }
.policy-tab.active {
  color: var(--accent);
  font-weight: 500;
  border-bottom-color: var(--accent);
}
#policy-tab-content {
  min-height: 200px;
}

/*
 * תיק פוליסה: אל תגלול את כל #policy-profile-page (כך רשימת מסמכים + תצוגה מקדימה נעות יחד).
 * הגלילה נשארת בתוך #policy-tab-content; בטאב מסמכים / מסמכים ערוכים נסגרת גם שם כדי שתיגלל רק הרשימה.
 */
#policy-profile-page.page-content {
  overflow: hidden;
}
#policy-profile-page.page-content #policy-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-documents-tab) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-documents-tab) > .policy-documents-tab {
  flex: 1 1 auto;
  min-height: 0;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-act-edited-panel) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-act-edited-panel) > .policy-actions-tab--v2 {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-act-edited-panel) > .policy-actions-tab--v2 > .policy-act-subtabs-section {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-act-edited-panel) .policy-act-subtabs {
  flex-shrink: 0;
}
#policy-profile-page.page-content #policy-tab-content:has(.policy-act-edited-panel) #policy-act-single-mount {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.management-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.85rem;
  direction: rtl;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.management-subtab {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.management-subtab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.management-subtab.active {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.policy-doc-linkages-mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}
.pdl-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
}
.pdl-row-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.pdl-row-toolbar .pdl-label {
  flex: 1;
  min-width: 180px;
}
.pdl-scope-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.pdl-scope-title,
.pdl-actions-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pdl-scope-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.pdl-types-box {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  margin-bottom: 0.65rem;
  max-height: 200px;
  overflow-y: auto;
}
.pdl-type-cat {
  margin-bottom: 0.45rem;
}
.pdl-type-cat-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.pdl-type-opt {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-inline-end: 0.65rem;
  margin-bottom: 0.2rem;
  font-size: 0.84rem;
  cursor: pointer;
}
.pdl-actions-block {
  margin-top: 0.35rem;
}
.pdl-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.45rem 0;
}
.pdl-action-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.pdl-action-line .pdl-act-label {
  flex: 1;
  min-width: 140px;
}
.pdl-action-line .pdl-act-kind {
  flex: 1.15;
  min-width: min(100%, 220px);
  font-size: 0.86rem;
}
.pdl-act-url-wrap {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.pdl-act-url-wrap .pdl-act-url {
  flex: 2;
  min-width: 180px;
}
.pdl-act-tab {
  font-size: 0.82rem;
  white-space: nowrap;
}
.policy-docs-ctx-row--extra {
  border-inline-start: 3px solid rgba(13, 148, 136, 0.45);
}
/* מסמכי פוליסה: עמודת פעולות משמאל (מבנה LTR), תוכן RTL */
.policy-docs-shell {
  direction: ltr;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
}
/* טאב מסמכי פוליסה + מסמכים ערוכים: גובה מוגבל כדי שגלילת הרשימה לא תזיז את תצוגה המקדימה */
.policy-documents-tab.policy-docs-shell,
.policy-act-edited-shell.policy-docs-shell {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, calc(100vh - 96px));
}
.policy-documents-tab .policy-docs-body,
.policy-act-edited-shell .policy-docs-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.policy-docs-shell-header {
  direction: rtl;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(13, 148, 136, 0.07), transparent);
  flex-shrink: 0;
}
.policy-docs-shell-header h3 { margin: 0 0 0.35rem; }
.policy-docs-body {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 520px;
}
.policy-docs-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  direction: rtl;
  flex-shrink: 0;
}
.policy-docs-master-select-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.87rem;
  color: var(--text);
  margin: 0;
  user-select: none;
  justify-self: start;
}
.policy-docs-master-select-label input {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.policy-docs-toolbar-center {
  justify-self: center;
}
.policy-docs-add-files-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(13, 148, 136, 0.35);
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.14), rgba(13, 148, 136, 0.06));
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}
.policy-docs-add-files-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.22), rgba(13, 148, 136, 0.1));
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.18);
  transform: translateY(-1px);
}
.policy-docs-add-files-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.policy-docs-add-files-icon {
  display: block;
}
.policy-docs-toolbar-menu-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
}
.policy-docs-actions-anchor {
  position: relative;
  flex-shrink: 0;
}
.policy-docs-actions-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.policy-docs-actions-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.policy-docs-actions-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.policy-docs-ctx-menu {
  width: min(92vw, 280px);
  max-width: 280px;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  direction: rtl;
}
.policy-docs-ctx-menu.hidden {
  display: none !important;
}
.policy-docs-ctx-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.policy-docs-ctx-heading {
  padding: 0.42rem 0.65rem 0.12rem;
  margin-top: 0.08rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  user-select: none;
  pointer-events: none;
}
.policy-docs-ctx-section--actions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 0.2rem;
}
.policy-docs-ctx-sep {
  margin: 0.2rem 0;
  border: none;
  border-top: 1px solid var(--border);
}
.policy-docs-ctx-row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.87rem;
  text-align: right;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.1s;
}
.policy-docs-ctx-row:hover:not(:disabled) {
  background: rgba(13, 148, 136, 0.09);
}
.policy-docs-ctx-row:active:not(:disabled) {
  background: rgba(13, 148, 136, 0.14);
}
.policy-docs-ctx-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.policy-docs-ctx-row.is-active {
  background: rgba(13, 148, 136, 0.11);
  font-weight: 500;
}
.policy-docs-ctx-row--danger:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.07);
  color: #b91c1c;
}
.policy-docs-ctx-row:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.policy-docs-ctx-panel {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.policy-docs-ctx-panel.hidden {
  display: none !important;
}
.policy-docs-ctx-input {
  width: 100%;
  font-size: 0.82rem;
}
.policy-docs-ctx-fullbtn {
  width: 100%;
  justify-content: center;
}
.policy-docs-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.policy-docs-main {
  direction: rtl;
  display: grid;
  grid-template-columns: minmax(340px, 1.58fr) minmax(180px, 0.62fr);
  align-items: stretch;
  align-content: start;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}
.policy-documents-tab .policy-docs-main,
.policy-act-edited-shell .policy-docs-main {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}
@media (max-width: 960px) {
  .policy-docs-main {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
  }
}
.policy-docs-list-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
  border-bottom: none;
  border-inline-end: 1px solid var(--border);
}
#policy-docs-list-wrap,
#policy-act-edited-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 960px) {
  .policy-docs-list-section {
    border-inline-end: none;
    border-bottom: 1px solid var(--border);
    max-height: min(52vh, 420px);
  }
}
.policy-docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.policy-docs-table th,
.policy-docs-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.55rem;
  text-align: right;
  vertical-align: middle;
}
.policy-docs-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.policy-docs-table tr.policy-doc-table-row { cursor: pointer; }
.policy-docs-table tr.policy-doc-table-row:hover { background: rgba(13, 148, 136, 0.05); }
.policy-docs-table tr.policy-doc-table-row.is-selected { background: rgba(13, 148, 136, 0.14); }
.policy-docs-table .policy-doc-name-cell { font-weight: 500; max-width: 200px; word-break: break-word; }
.policy-docs-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.policy-doc-linkage-cell {
  vertical-align: middle;
  min-width: 7.25rem;
  max-width: 11rem;
}
.policy-doc-linkage-select {
  width: 100%;
  max-width: 10.5rem;
  font-size: 0.8rem;
  padding: 0.28rem 0.35rem;
  box-sizing: border-box;
}
.policy-doc-notes-cell {
  min-width: 8rem;
  max-width: 13rem;
  vertical-align: top;
}
.policy-doc-notes {
  width: 100%;
  min-height: 2.35rem;
  max-height: 4.6rem;
  resize: vertical;
  font-size: 0.81rem;
  line-height: 1.35;
  box-sizing: border-box;
}
.policy-doc-th-linkage { width: 1%; white-space: nowrap; }
.policy-doc-th-notes { min-width: 7.5rem; }
.policy-docs-preview-section {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
@media (max-width: 960px) {
  .policy-docs-preview-section {
    position: relative;
    max-height: none;
    overflow-y: visible;
  }
}
.policy-docs-preview-caption {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.policy-docs-preview {
  flex: 1;
  min-height: 160px;
  background: var(--bg-secondary);
  overflow: auto;
}
.policy-docs-preview .policy-pdf-canvas-scroll {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.policy-docs-preview iframe.policy-doc-preview-frame--html {
  width: 100%;
  max-width: 100%;
  min-height: 260px;
  height: min(120vh, 2200px);
  border: none;
  display: block;
  background: #fff;
}
.policy-docs-preview iframe.policy-doc-preview-frame--pdf {
  width: 100%;
  max-width: 100%;
  height: min(92vh, 1600px);
  border: none;
  display: block;
  background: #fff;
}
.policy-docs-preview img.policy-doc-preview-img,
.policy-docs-preview video.policy-doc-preview-video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #fff;
}
@media (max-width: 960px) {
  .policy-docs-preview iframe.policy-doc-preview-frame--pdf {
    height: min(85vh, 1400px);
  }
}

.policy-doc-preview-host {
  position: relative;
  width: 100%;
  min-height: min(85vh, 1200px);
}
.policy-doc-preview-host iframe.policy-doc-preview-frame--pdf {
  width: 100%;
  height: min(92vh, 1600px);
  border: none;
  display: block;
  background: #fff;
}
.policy-doc-field-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.policy-doc-field-overlay-layer--interactive {
  pointer-events: auto;
}
.policy-doc-overlay-field {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1px 4px;
  overflow: hidden;
}
.policy-doc-overlay-field-inner {
  font-size: clamp(7.5px, 0.88vw, 11px);
  line-height: 1.12;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  max-height: 100%;
  direction: rtl;
  color: var(--text);
  font-weight: 600;
}
.policy-doc-overlay-field-inner--editing {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, var(--border));
  outline-offset: 1px;
  white-space: normal;
  overflow: visible;
  max-height: none;
  background: color-mix(in srgb, #fff 88%, var(--accent));
  border-radius: 3px;
  cursor: text;
}
.policy-doc-overlay-field--sidebar-focus {
  border-style: solid;
  border-width: 2px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  z-index: 3;
}
/** אזור חתימה בתצוגת מסמך (לא ניתן לעריכה כטקסט) */
.policy-doc-overlay-signature {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  overflow: hidden;
  pointer-events: none;
  border: 2px solid rgba(99, 102, 241, 0.85);
  background: rgba(99, 102, 241, 0.12);
  border-radius: 4px;
  z-index: 2;
}
.policy-doc-overlay-signature--unassigned {
  border-color: rgba(110, 110, 110, 0.95);
  background: rgba(128, 128, 128, 0.28);
}
.policy-doc-overlay-signature-inner {
  font-size: clamp(7px, 0.82vw, 10px);
  line-height: 1.1;
  text-align: center;
  direction: rtl;
  font-weight: 700;
  color: var(--text, #111);
  word-break: break-word;
  max-height: 100%;
  overflow: hidden;
}
.policy-doc-field-overlay-layer--interactive .policy-doc-overlay-signature {
  pointer-events: none;
}
.policy-wf-fill-field-row--sidebar-active {
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 38%, var(--border));
  padding: 0.35rem 0.5rem;
  margin-inline: -0.35rem;
}
.policy-wf-fill-field-row--flash {
  animation: policy-wf-field-flash 0.65s ease-out;
}
@keyframes policy-wf-field-flash {
  from {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
  }
  to {
    background: transparent;
  }
}
.policy-wf-kbd {
  display: inline-block;
  font-size: 0.72em;
  font-family: inherit;
  font-weight: 600;
  padding: 0.06em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  vertical-align: baseline;
}
.policy-actions-tab--v2 .policy-act-section--workflow-split {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.policy-act-section h4 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.policy-act-binder-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}
.policy-act-binder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.65rem;
}
.policy-act-binder-master {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.policy-act-binder-card {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.policy-act-binder-cb-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
  cursor: pointer;
}
.policy-act-binder-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.policy-act-binder-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.policy-act-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.policy-act-tasks-head--toolbar-only {
  justify-content: flex-end;
}
.policy-act-tasks-heading {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.policy-actions-new-task-icon {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, box-shadow 0.15s;
}
.policy-actions-new-task-icon:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-secondary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.policy-act-panel-tasks .policy-act-tasks-section {
  margin-top: 0;
}

.wf-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}
.policy-actions-tab .label-like {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.binder-overlay-modal-inner .binder-overlay-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.binder-overlay-stage {
  position: relative;
  width: 100%;
  height: min(70vh, 900px);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #444;
}
.binder-overlay-modal--fullscreen {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.binder-overlay-modal-inner--fullscreen {
  width: 100%;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.binder-overlay-toolbar--fullscreen {
  flex-shrink: 0;
}
.binder-overlay-editor-layout {
  overflow: hidden;
}
.binder-overlay-toolbar--editor-top {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.binder-overlay-editor-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.binder-overlay-editor-top-hint {
  margin: 0;
  flex: 1 1 220px;
  max-width: min(100%, 52rem);
  line-height: 1.45;
}
.binder-of-draw-actions--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex-shrink: 0;
}
.binder-overlay-editor-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  padding: 0.65rem 1rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
}
.binder-overlay-fields-panel {
  flex: 0 0 clamp(280px, 34vw, 400px);
  max-width: min(400px, 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.85rem;
  background: var(--bg-card);
  box-sizing: border-box;
}
.binder-overlay-editor-pdf-section {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.25rem 0;
}
.binder-overlay-editor-pdf-section .binder-of-pdf-host {
  width: 100%;
  display: flex;
  justify-content: center;
}
.binder-overlay-fields-heading {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: start;
  flex-shrink: 0;
}
.binder-overlay-regions-heading {
  margin: 0.65rem 0 0.35rem;
  font-weight: 600;
  flex-shrink: 0;
}
.binder-of-field-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  box-sizing: border-box;
}
.binder-of-field-option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.32rem 0.4rem;
  border-radius: 8px;
  line-height: 1.35;
  font-size: 0.9rem;
}
.binder-of-field-option:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.binder-of-field-option input {
  margin-top: 0.18rem;
  flex-shrink: 0;
}
.binder-overlay-editor-layout .binder-of-list {
  flex: 0 1 auto;
  max-height: min(28vh, 220px);
  overflow-y: auto;
  margin: 0;
  padding-inline-start: 1.15rem;
}
@media (max-width: 900px) {
  .binder-overlay-editor-body {
    flex-direction: column;
    overflow-y: auto;
    align-items: stretch;
  }
  .binder-overlay-fields-panel {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    max-height: min(42vh, 360px);
    order: 2;
  }
  .binder-overlay-editor-pdf-section {
    flex: 1 1 auto;
    min-height: min(48vh, 420px);
    order: 1;
  }
  .binder-overlay-editor-layout .binder-of-list {
    max-height: min(22vh, 180px);
  }
}
.binder-overlay-stage--fullscreen {
  flex: 1;
  min-height: 0;
  height: auto;
}

.policy-wf-pdf-fill-inner {
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  box-sizing: border-box;
}
.policy-wf-pdf-fill-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.policy-wf-pdf-fill-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
  flex: 1;
  min-width: min(100%, 320px);
}
.policy-wf-fill-add-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}
.policy-wf-fill-add-doc-btn {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  min-width: 2.35rem;
}
.policy-wf-fill-add-doc-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  z-index: 80;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.policy-wf-fill-add-doc-menu.hidden {
  display: none;
}
.policy-wf-fill-add-doc-item {
  border: none;
  background: transparent;
  text-align: right;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
}
.policy-wf-fill-add-doc-item:hover {
  background: var(--bg-secondary, rgba(0, 0, 0, 0.06));
}
.policy-wf-fill-head-act.policy-wf-fill-footer-btn {
  flex: 0 1 auto;
  min-width: 0;
  min-height: auto;
  padding: 0.38rem 0.55rem;
  font-size: 0.74rem;
}
.policy-wf-doc-protection-modes {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: 0.38rem;
}
.policy-wf-doc-protection-mode-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  cursor: pointer;
}
.policy-wf-pdf-fill-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}
.policy-wf-pdf-fill-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: row;
}
.policy-wf-pdf-fill-pages-nav {
  flex: 0 0 min(156px, 19vw);
  min-width: 0;
  overflow: auto;
  background: var(--bg-card);
  border-inline-end: 1px solid var(--border);
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.policy-wf-fill-chain-nav.hidden {
  display: none;
}
.policy-wf-fill-chain-nav-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, var(--text));
  margin: 0;
}
.policy-wf-fill-chain-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.policy-wf-fill-pages-nav-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.policy-wf-fill-merge-reorder-toggle.is-active {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 1px var(--accent, #2563eb);
  background: var(--bg-card);
}
.policy-wf-filename-prompt-dialog .policy-wf-filename-prompt-input {
  width: 100%;
  margin-top: 0.35rem;
  box-sizing: border-box;
}
.policy-wf-filename-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.policy-wf-doc-protection-block {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.12));
}
.policy-wf-doc-protection-label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
}
.policy-wf-doc-protection-block .input-elegant {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.2rem;
}
.agency-employers-toolbar {
  margin-top: 0.65rem;
  margin-bottom: 0.5rem;
}
.agency-employers-search-input {
  width: 100%;
  max-width: 36rem;
  box-sizing: border-box;
}
#agency-employers-panel .agency-employers-table-wrap {
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.agency-employers-table-wrap {
  overflow-x: auto;
}
.agency-employers-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.agency-employers-table thead th {
  background: var(--bg-secondary);
  font-weight: 600;
  text-align: right;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--border);
}
.agency-employers-table tbody td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: right;
  word-break: break-word;
}
.agency-employers-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}
.agency-employers-table tbody tr:hover {
  background: rgba(13, 148, 136, 0.06);
}
.agency-employers-actions-col,
.agency-employers-actions-cell {
  white-space: nowrap;
}
.agency-employers-linked-col,
.agency-employers-count-cell {
  text-align: center;
  white-space: nowrap;
}
.agency-employers-clients-btn-cell {
  white-space: nowrap;
}
.agency-employer-client-open-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent, #2563eb);
  cursor: pointer;
  text-decoration: underline;
  text-align: right;
}
.agency-employer-client-open-btn:hover {
  opacity: 0.85;
}
/* טאב מעסיק בתיק לקוח — פריסה דומה לשיוך מסמכים */
.employer-assign-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .employer-assign-shell {
    grid-template-columns: 1fr;
  }
}
.employer-assign-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.employer-assign-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}
.client-employer-tab .agency-employers-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}
.employer-pick-scroll {
  max-height: min(320px, 42vh);
  overflow: auto;
  border-radius: 8px;
}
.employer-pick-scroll .agency-employers-table {
  min-width: 720px;
}
.employer-pick-row {
  cursor: pointer;
}
.employer-pick-row:hover {
  background: rgba(13, 148, 136, 0.07);
}
.employer-pick-row.is-selected {
  background: rgba(13, 148, 136, 0.15);
  outline: 2px solid rgba(13, 148, 136, 0.35);
  outline-offset: -2px;
}
.employer-pick-empty-cell {
  text-align: center;
  color: var(--text-muted, #64748b);
  padding: 1rem !important;
}
.employer-modal-clients-table {
  min-width: 320px;
}
.employer-assign-side .employer-side-title {
  margin-top: 0;
}
.employer-assign-side label {
  display: block;
}
.employer-side-seq label {
  width: 100%;
}
.employer-side-seq input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
}
.employer-side-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.employer-side-actions .btn-primary,
.employer-side-actions .btn-secondary {
  width: 100%;
}
.client-employer-tab .settings-card + .settings-card {
  margin-top: 1rem;
}
.client-employer-picker-modal-inner {
  max-width: min(96vw, 920px);
  width: 100%;
}
.client-employer-picker-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0.5rem 0 0.65rem;
}
.client-employer-tab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.client-employer-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.client-employer-assigned-wrap .agency-employers-table {
  min-width: 800px;
}
.client-employer-status-col,
.client-employer-seq-col {
  text-align: center;
  white-space: nowrap;
}
.client-employer-status-cell {
  font-size: 0.82rem;
}
.client-employer-menu-col {
  width: 2.75rem;
  text-align: center;
}
.client-employer-seq-input {
  width: 4.25rem;
  min-width: 0;
  box-sizing: border-box;
}
.client-employer-actions-wrap {
  position: relative;
  vertical-align: middle;
  overflow: visible;
}
.client-employer-row-menu {
  min-width: 13rem;
  max-height: min(280px, 55vh);
  overflow-y: auto;
}
.policy-wf-fill-chain-nav-btns {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.policy-wf-fill-chain-file-btn {
  display: block;
  width: 100%;
  text-align: right;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: inherit;
  cursor: pointer;
  line-height: 1.25;
}
.policy-wf-fill-chain-file-btn:hover {
  border-color: var(--accent, #2563eb);
}
.policy-wf-fill-chain-file-btn.is-active {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 1px var(--accent, #2563eb);
  background: var(--bg-card);
}
.policy-wf-fill-pages-nav-heading {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-muted, var(--text));
}
.policy-wf-fill-merge-drag-hint {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.72rem;
}
.policy-wf-fill-pages-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.policy-wf-merge-plan-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  text-align: right;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: inherit;
  cursor: pointer;
  line-height: 1.25;
  user-select: none;
}
.policy-wf-merge-plan-row--reorder {
  cursor: grab;
}
.policy-wf-merge-plan-row--reorder:active {
  cursor: grabbing;
}
.policy-wf-merge-plan-row:hover {
  border-color: var(--accent, #2563eb);
}
.policy-wf-merge-drag-hint {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 0.85rem;
}
.policy-wf-merge-plan-label {
  flex: 1;
  min-width: 0;
}
.policy-wf-fill-chain-file-btn[draggable='true'] {
  cursor: grab;
}
.policy-wf-fill-chain-file-btn[draggable='true']:active {
  cursor: grabbing;
}
.policy-wf-fill-page-nav-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: inherit;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.policy-wf-fill-page-nav-btn:hover {
  border-color: var(--accent, #2563eb);
}
.policy-pdf-canvas-scroll--multipage {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.policy-wf-pdf-fill-preview {
  flex: 1.25;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
}
.policy-wf-fill-zoom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.policy-wf-zoom-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 12rem;
}
.policy-wf-zoom-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted, var(--text));
  flex: 1;
}
.policy-wf-zoom-label input[type='range'] {
  flex: 1;
  min-width: 4rem;
}
.policy-wf-zoom-pct {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}
.policy-wf-fill-pdf-host {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.policy-wf-fill-pdf-host .policy-pdf-canvas-scroll {
  max-height: none;
  overflow: visible;
}
.policy-wf-pdf-fill-sidebar {
  flex: 0 0 min(360px, 40vw);
  padding: 1rem;
  overflow: auto;
  background: var(--bg-card);
}
.policy-wf-fill-sidebar-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.policy-wf-fill-sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.policy-wf-fill-search {
  width: 100%;
  box-sizing: border-box;
}
.policy-wf-fill-undo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.policy-wf-fill-undo-row .policy-wf-toast-btn {
  flex: 1 1 auto;
  justify-content: center;
}
.policy-wf-fill-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 1.65rem;
  max-height: min(20vh, 8rem);
  resize: vertical;
  line-height: 1.3;
  padding: 0.28rem 0.42rem;
}
.policy-wf-fill-field-row--chain-inactive {
  opacity: 0.42;
}
.policy-wf-merge-doc-block-handle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.35rem;
  margin: 0.15rem 0 0.25rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px dashed var(--border, rgba(0, 0, 0, 0.2));
  background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
  cursor: grab;
}
.policy-wf-merge-doc-block-handle:active {
  cursor: grabbing;
}
.policy-wf-merge-doc-block-handle-label {
  flex: 1;
  min-width: 0;
}
.policy-wf-fill-field-row--hidden {
  display: none !important;
}
.policy-wf-fill-field-row {
  margin-bottom: 0.38rem;
}
.policy-wf-fill-label {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  margin-bottom: 0.22rem;
  color: var(--text);
}
.policy-wf-pdf-fill-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  align-items: stretch;
}
.policy-wf-fill-footer-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.15rem;
  font-weight: 600;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  line-height: 1.15;
  box-sizing: border-box;
}
.policy-wf-fill-footer-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.policy-wf-fill-footer-btn--sig .policy-wf-etrog-badge {
  flex-shrink: 0;
}
.policy-wf-fill-footer-btn-txt {
  text-align: center;
}

.policy-wf-toast-btn {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.policy-wf-toast-btn:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}
.policy-wf-toast-btn--muted {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
}
.policy-wf-toast-btn--compact {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
}
.policy-wf-toast-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.policy-wf-etrog-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  background: #22c55e;
  color: #052e16;
  letter-spacing: -0.02em;
}

.policy-wf-deviation-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.policy-wf-deviation-dialog {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  max-width: 26rem;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}
.policy-wf-deviation-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.policy-wf-deviation-msg {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted, var(--text));
  line-height: 1.45;
}
.policy-wf-deviation-keys {
  margin: 0 0 1rem;
  padding-inline-start: 1.1rem;
  font-size: 0.86rem;
}
.policy-wf-deviation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.policy-wf-close-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
/*
 * מילוי PDF פעולות: חובה position:fixed — לא להגדיר כאן position:relative על המעטפת,
 * זה דורס את .modal-overlay והמודאל נדחף לזרימת body ("בהמשך העמוד").
 */
.policy-wf-fill-shell.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  isolation: isolate;
}
.policy-act-subtabs-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}
.policy-actions-tab--v2 .policy-act-subtabs-section.policy-act-section {
  margin-top: 0;
}
.policy-act-single-mount {
  min-height: 180px;
}
.policy-act-single-mount:has(.policy-act-edited-panel) {
  display: flex;
  flex-direction: column;
  min-height: min(400px, 70vh);
  max-height: min(92vh, calc(100vh - 160px));
}
.policy-act-single-mount:has(.policy-act-edited-panel) .policy-act-edited-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.policy-act-single-mount:has(.policy-act-edited-panel) .policy-act-edited-shell {
  flex: 1 1 auto;
  min-height: 0;
}
.policy-act-subtabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.policy-act-subtab {
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.policy-act-subtab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.policy-act-subpanel-heading {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.policy-act-history-heading {
  margin-top: 1.35rem;
}

.policy-act-run-binder-pick {
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
}
.policy-act-run-binder-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.policy-act-run-binder-hint {
  margin: 0.45rem 0 0;
}
.policy-act-auto-doc-hint {
  margin: 0 0 0.75rem;
}
.policy-act-run-warn {
  margin-bottom: 0.65rem;
}
.policy-act-wf-banner {
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}
.policy-act-binder-warn {
  color: var(--error, #b91c1c);
}
.policy-act-shared-binder-select {
  width: 100%;
  max-width: 28rem;
}
.policy-wf-template-name-cell {
  vertical-align: top;
}
.policy-wf-template-run-link {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: start;
}
.policy-wf-template-run-link:hover:not(:disabled) {
  color: color-mix(in srgb, var(--accent) 88%, #000);
}
.policy-wf-template-run-link:disabled {
  opacity: 0.55;
  cursor: wait;
}
.policy-wf-template-hands {
  margin-top: 0.25rem;
  line-height: 1.35;
}

.compose-to-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.compose-to-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.compose-to-chips--visible {
  margin-bottom: 0.1rem;
}
.compose-to-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  max-width: 100%;
}
.compose-to-chip--readonly {
  cursor: default;
}

.policy-wf-email-preset-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.35rem 0;
}
.policy-wf-email-preset-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.binder-of-rect {
  border: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.binder-overlay-toolbar--draw {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
}
.binder-of-draw-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.binder-of-field-label {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.binder-of-field-select {
  min-width: 12rem;
}
.binder-of-draw-hint {
  margin: 0;
  max-width: 28rem;
}
.binder-of-draw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.binder-of-toolbar-btn {
  min-width: 7.75rem;
  min-height: 2.45rem;
}

@media (max-width: 900px) {
  .policy-wf-pdf-fill-body {
    flex-direction: column;
  }
  .policy-wf-pdf-fill-sidebar {
    flex: none;
    max-height: 42vh;
    border-inline-end: none;
    border-top: 1px solid var(--border);
  }
  .policy-wf-pdf-fill-head-actions {
    justify-content: flex-start;
  }
  .policy-wf-fill-head-act.policy-wf-fill-footer-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: calc(50% - 0.25rem);
  }
  .policy-wf-email-preset-row {
    grid-template-columns: 1fr;
  }
}
.policy-wf-binder-company-row {
  margin-bottom: 0.75rem;
}
.policy-wf-binder-company-row select {
  min-width: 14rem;
}
.policy-wf-binder-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(100%, 280px);
}
.policy-wf-binder-field-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}
.policy-wf-binder-field-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.policy-wf-binder-company-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.policy-wf-binder-upload--styled {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--border) 85%, var(--accent));
  background: color-mix(in srgb, var(--bg-card) 94%, var(--bg-secondary));
}
.policy-wf-binder-upload-heading {
  font-weight: 600;
  font-size: 0.9rem;
}
.policy-wf-binder-upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}
.policy-wf-binder-file-pick {
  cursor: pointer;
  flex-shrink: 0;
}
.policy-wf-binder-file-name {
  flex: 1 1 140px;
  min-width: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}
.policy-act-templates-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.binder-of-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}
.binder-of-draw {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 2;
}
.binder-of-rect {
  position: absolute;
  border: 2px solid rgba(255, 193, 7, 0.95);
  background: rgba(255, 235, 59, 0.12);
  pointer-events: none;
  box-sizing: border-box;
}
.binder-of-rect--signature {
  pointer-events: auto;
  border-color: rgba(99, 102, 241, 0.95);
  background: rgba(99, 102, 241, 0.14);
  cursor: default;
}
.binder-of-rect--signature.binder-of-rect--unassigned {
  background: rgba(128, 128, 128, 0.38);
  border-color: rgba(110, 110, 110, 0.9);
}
.binder-of-sig-pencil {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  z-index: 3;
}
.binder-of-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-end: 1rem;
}
.pdf-overlay-editor-anchor {
  position: relative;
}
.binder-of-sig-popover {
  position: absolute;
  z-index: 30;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #111);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  min-width: 220px;
  max-width: min(320px, 94vw);
}
.binder-of-sig-popover-title {
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}
.binder-of-sig-role-checks {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  max-height: 220px;
  overflow: auto;
}
.binder-of-sig-role-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.sig-zone-row .sig-zone-pencil {
  min-width: 2rem;
}
.sig-zone-row.sig-zone-row--unassigned {
  background: rgba(128, 128, 128, 0.18);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px dashed rgba(128, 128, 128, 0.45);
}
.binder-of-list {
  margin: 0.5rem 0 0;
  padding-inline-start: 1.2rem;
  max-height: 6rem;
  overflow: auto;
}
.binder-of-list-sig-pencil {
  margin-inline-start: 0.25rem;
  vertical-align: middle;
}

.policy-wf-type-overlay .policy-wf-tpl-list table {
  width: 100%;
}

/* תבניות פעולות לפי סוג פוליסה — חלון רוחבי עם עמודות */
.policy-wf-type-overlay--actions {
  padding: 1rem;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
.policy-wf-type-modal.policy-wf-type-modal--actions.modal {
  max-width: min(1140px, calc(100vw - 2rem));
  width: min(1140px, calc(100vw - 2rem));
  max-height: min(920px, calc(100vh - 2rem));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  box-sizing: border-box;
}
.policy-wf-type-modal-head {
  flex-shrink: 0;
}
.policy-wf-type-modal-head h3 {
  margin: 0 0 0.35rem;
}
.policy-wf-type-modal-head .form-hint {
  margin: 0;
}
.policy-wf-type-modal-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.15fr);
  gap: 1.25rem;
  min-height: 0;
  flex: 1;
  margin-top: 0.65rem;
}
.policy-wf-type-modal-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.policy-wf-type-modal-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}
.policy-wf-type-modal-col--list .policy-wf-tpl-list {
  flex: 1;
  min-height: 10rem;
  max-height: min(62vh, 560px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: var(--bg-secondary);
}
.policy-wf-type-modal-col--list .policy-wf-tpl-list .premium-evolution-table {
  font-size: 0.92rem;
}
.policy-wf-type-modal-col--form {
  overflow-y: auto;
  max-height: min(74vh, 640px);
  padding-inline-start: 0.35rem;
}
.policy-wf-type-modal-actions {
  margin-top: 1rem;
  flex-wrap: wrap;
}
.policy-wf-tpl-presets-section--in-modal .policy-wf-type-modal-subtitle:first-child {
  margin-top: 0;
}
@media (max-width: 840px) {
  .policy-wf-type-modal-body {
    grid-template-columns: 1fr;
  }
  .policy-wf-type-modal-col--list .policy-wf-tpl-list {
    max-height: 260px;
  }
  .policy-wf-type-modal-col--form {
    max-height: none;
    overflow-y: visible;
  }
}

/* קלסר לפי סוג פוליסה — כמעט מסך מלא, רשת כרטיסים */
.policy-wf-binder-overlay {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  z-index: 120;
}
.policy-wf-binder-modal.policy-wf-binder-modal--fullscreen.modal {
  max-width: none;
  width: 100%;
  height: 100vh;
  max-height: none;
  margin: 0;
  border-radius: 0;
  padding: 1rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}
.policy-wf-binder-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
  margin-bottom: 0.65rem;
}
.policy-wf-binder-head-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}
.policy-wf-binder-close-btn {
  flex-shrink: 0;
}
.policy-wf-binder-toolbar-panel {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
}
.policy-wf-binder-toolbar-panel .policy-wf-binder-company-row {
  margin-bottom: 0;
  flex: 1 1 240px;
}
.policy-wf-binder-toolbar-panel .policy-wf-binder-upload {
  margin-bottom: 0;
}
.policy-wf-binder-list--main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}
.policy-wf-binder-thumb-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: 0 0 0.65rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.policy-wf-binder-thumb-link:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}
.policy-wf-binder-thumb-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
}
.policy-wf-binder-thumb-link--static {
  cursor: default;
  pointer-events: none;
}
.policy-wf-binder-thumb-host {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg) 100%);
}
.policy-wf-binder-thumb-skel {
  font-size: 0.82rem;
  color: var(--text-muted);
  animation: policy-wf-binder-thumb-pulse 1.1s ease-in-out infinite;
}
@keyframes policy-wf-binder-thumb-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}
.policy-wf-binder-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: middle;
  background: #eceff1;
}
.policy-wf-binder-thumb-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
}
.policy-wf-binder-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 5rem;
}
.policy-wf-binder-thumb-fallback-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
}
.policy-wf-binder-thumb-fallback--pdf .policy-wf-binder-thumb-fallback-label {
  color: #b71c1c;
  border-color: rgba(183, 28, 28, 0.35);
  background: rgba(183, 28, 28, 0.06);
}
.policy-wf-binder-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-content: start;
}
.policy-wf-binder-card {
  padding: 1.05rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 14rem;
}
.policy-wf-binder-card strong {
  font-size: 1.02rem;
  line-height: 1.4;
  word-break: break-word;
}
.policy-wf-binder-card .policy-wf-binder-card-actions {
  margin-top: auto;
  padding-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.policy-wf-binder-upload {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.management-inline-back {
  margin: 0 1rem 0.75rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}
.management-inline-back:hover {
  text-decoration: underline;
}

.email-templates-settings-card .settings-card-body > .form-hint { margin-bottom: 1rem; }
.email-template-block { margin-bottom: 1.35rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.email-template-block:last-child { border-bottom: none; }
.et-placeholders { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 0.65rem; line-height: 1.5; }
.et-placeholders code { font-size: 0.78rem; padding: 0.1rem 0.25rem; background: var(--bg-secondary); border-radius: 4px; }
.policy-premium-tab .premium-ai-status-ok {
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(46, 125, 50, 0.35);
  background: rgba(46, 125, 50, 0.06);
}
.policy-premium-tab .premium-ai-status-warn {
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.06);
}
.policy-premium-tab .policy-premium-local-banner {
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(25, 118, 210, 0.35);
  background: rgba(25, 118, 210, 0.06);
}
.policy-premium-multi-schedules:not(.hidden) {
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--bg-secondary);
}
.policy-premium-main-title { margin-bottom: 0.35rem; }
.premium-inner-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 1rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.premium-inner-tab {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.premium-inner-tab:hover { color: var(--text); background: var(--bg-card); }
.premium-inner-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.premium-premium-section.hidden { display: none !important; }
.premium-section-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.premium-section-title--first { margin-top: 0; }
.premium-overview-banner {
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.premium-overview-cards { display: grid; gap: 0.75rem; }
.premium-overview-cards--single { grid-template-columns: 1fr; max-width: 420px; }
.premium-overview-cards--multi { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.premium-overview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
}
.premium-overview-card-head {
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 1rem;
}
.premium-overview-card-prem { margin-bottom: 0.35rem; }
.premium-overview-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
}
.policy-card-proposal-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(156, 39, 176, 0.12);
  color: #7b1fa2;
  margin-bottom: 0.25rem;
}
.policy-binder-tab h3 { margin-bottom: 0.35rem; }
.policy-binder-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.policy-binder-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}
.policy-binder-card-main { min-width: 0; }
.policy-binder-name { display: block; word-break: break-word; }
.policy-actions-toolbar { margin: 0.65rem 0 1rem; }
.premium-evolution-table-wrap { overflow-x: auto; margin: 1rem 0; }
.premium-evolution-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.premium-evolution-table th,
.premium-evolution-table td { border: 1px solid var(--border); padding: 0.35rem 0.4rem; text-align: right; }
.premium-evolution-table th { background: var(--bg-secondary); font-weight: 600; }
.premium-evolution-table input.input-elegant {
  width: 100%;
  min-width: 3rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.35rem;
}
.premium-pdf-preview-dialog.modal-wide { max-width: 920px; }
.premium-pdf-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  max-height: 62vh;
  overflow: auto;
  margin: 1rem 0;
  padding: 0.25rem;
}
.premium-pdf-preview-cell {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
}
.premium-pdf-preview-label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem;
  cursor: pointer;
  margin: 0;
  font-size: 0.82rem;
}
.premium-pdf-preview-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
}
.premium-pdf-preview-thumb-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.premium-pdf-table-overlay {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border: 2px solid rgba(0, 168, 204, 0.95);
  background: rgba(64, 206, 227, 0.28);
  pointer-events: none;
  border-radius: 4px;
}
.premium-pdf-preview-pnum { text-align: center; font-weight: 600; color: var(--text-muted); }
.activity-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  align-items: center;
}
.activity-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item-row .activity-wf-meta {
  flex-basis: 100%;
  margin-top: -0.15rem;
}
.policy-notes-thread {
  max-height: 400px;
  overflow-y: auto;
  margin: 1rem 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}
.policy-note-bubble {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-secondary);
}
.policy-note-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
#policy-comm-list .policy-comm-row {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  cursor: default;
}
#policy-comm-list .policy-comm-row.is-open { background: rgba(13, 148, 136, 0.06); }
#policy-comm-list .policy-mail-row[data-comm-type="email"],
#policy-comm-list .policy-mail-row[data-comm-type="shared_email"] { cursor: pointer; }
#policy-comm-list .policy-comm-pbx-line {
  align-items: flex-start;
}
#policy-comm-list .policy-comm-pbx-doc {
  flex: 1;
  min-width: 0;
}
.activity-item-row--pbx-call {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item-row--pbx-call .pbx-history-row-line {
  width: 100%;
}
.activity-pbx-doc {
  flex: 1;
  min-width: 0;
}
.activity-item-row--pbx-call .activity-pbx-doc .activity-type,
.activity-item-row--pbx-call .activity-pbx-doc .activity-title {
  margin-inline-end: 0.35rem;
}
.activity-item .activity-body--pbx {
  flex: 1;
  min-width: 0;
}
.activity-item .activity-body--pbx .pbx-history-row-line {
  width: 100%;
  align-items: flex-start;
}
/* גריד פוליסות – ריבועים לרוחב ולאורך */
.policies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.policies-grid-empty { grid-column: 1 / -1; }
.policy-card {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.policy-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.policy-card-elementary {
  border-color: #0d9488;
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.06) 0%, var(--bg-card) 40%);
}
.policy-card-private {
  border-color: #7c3aed;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, var(--bg-card) 40%);
}
.policy-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.policy-card-client {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.policy-card-type {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.policy-card-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.policy-card-number {
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 0.25rem;
}
.policy-card-partners {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.policy-card-lien-icon {
  margin-right: 0.25rem;
  opacity: 0.9;
}
.link-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}
.link-button:hover { color: var(--accent-dim); }
.policy-profile-holders .policy-holder-row { margin-bottom: 0.12rem; }
.policy-profile-holders .policy-holder-row:last-child { margin-bottom: 0; }
.policies-tab-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.policies-tab-header h3 { margin: 0; }
.btn-add-policy-fixed {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--btn-on-accent);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-add-policy-fixed:hover {
  filter: brightness(1.08);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}
.holder-name-hint { font-weight: normal; color: var(--text-muted); font-size: 0.9rem; }
.policy-holder-block { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.policy-holder-block:first-of-type { border-top: none; padding-top: 0; margin-top: 0.5rem; }
.holder-occupation-section { margin-top: 0.75rem; }
.holder-smoker-row { margin-top: 0.5rem; }
/* טאב שיעבוד – עיצוב משופר */
.policy-lien-tab {
  max-width: 36rem;
  padding: 1rem 0;
}
.policy-lien-tab h3 {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  color: var(--text);
}
.policy-lien-tab .lien-detail-row {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.policy-lien-tab .lien-copy-section {
  margin-top: 1.25rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, var(--bg-card) 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.policy-lien-tab .lien-copy-section h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text);
}
.policy-lien-tab .form-row input {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
}
.policy-lien-tab #lien-save-copy-btn {
  margin-top: 0.75rem;
}
.policy-lien-tab .no-items {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}
.lien-detail-row { margin-bottom: 0.5rem; }
.lien-copy-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.lien-copy-section h4 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.policy-card-actions {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-hover);
}
.policy-card-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
}
.policy-card-btn:hover { background: var(--border); }
.policy-open-folder {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.policy-open-folder:hover { color: var(--accent); }
.activity-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item .activity-type { color: var(--text-muted); margin-left: 0.5rem; }
.activity-item .activity-date { color: var(--text-muted); font-size: 0.9rem; }

.team-intro {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

#team-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.contact-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.contact-role {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.contact-line {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}
.contact-line a {
  color: var(--accent);
  text-decoration: none;
}
.contact-line a:hover {
  text-decoration: underline;
}

.no-contacts {
  color: var(--text-muted);
  padding: 2rem;
}

.user-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.2rem;
}

.badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.hidden-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  background: rgba(197, 48, 48, 0.15);
  color: var(--error);
}

.modal-wide {
  max-width: 420px;
}
.modal-email-like {
  max-width: 540px;
}

.recipient-combo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  min-height: 42px;
}
.recipient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  font-size: 0.85rem;
}
.recipient-chip .chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
  opacity: 0.9;
}
.recipient-chip .chip-remove:hover { opacity: 1; }
.recipient-select {
  flex: 1;
  min-width: 140px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  outline: none;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}
.form-row input {
  flex: 1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox-label input {
  width: auto;
  margin: 0;
}

/* Page navigation */
.page-content.hidden {
  display: none !important;
}

/* Clients */
#clients-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 220px);
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.client-row:last-child {
  border-bottom: none;
}
.client-row {
  cursor: pointer;
}
.client-row:hover {
  background: var(--bg-hover);
}
.client-row .user-actions button {
  cursor: pointer;
}

.clients-toolbar {
  margin-bottom: 1.25rem;
}
.clients-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.clients-search-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
  min-width: 280px;
  max-width: 520px;
}
.clients-search-input {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--text);
}
.clients-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.clients-select {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  min-width: 110px;
}
.clients-status-select { min-width: 115px; }
.clients-search-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.clients-search-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.clients-toolbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.clients-export-import {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.clients-export-group {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.clients-format-select {
  padding: 0.5rem 0.75rem;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  min-width: 75px;
}
.clients-export-btn {
  padding: 0.5rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.clients-action-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.clients-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.clients-template-btn { text-decoration: none; }
.clients-import-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.clients-import-input { display: none; }
.clients-import-update {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.clients-add-btn {
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.clients-add-btn:hover {
  background: var(--accent-hover, #4338ca);
}
.client-tags-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.5rem;
}
.client-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}
.client-tag-badge.tag-vip {
  background: rgba(180, 83, 9, 0.15);
  color: #b45309;
}
.client-tag-badge.tag-unwanted {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
.client-tag-badge.tag-custom {
  background: var(--accent-soft);
  color: var(--accent);
}
.client-tag-badge.tag-active {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.client-tag-badge.tag-inactive {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}
.client-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}
.client-tag-remove:hover {
  opacity: 1;
}
.client-profile-tags-cell .client-profile-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.client-profile-tags .client-tag-add {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
}
.client-tags-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.client-tags-add-row input {
  flex: 1;
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.client-tags-list {
  list-style: none;
  margin-top: 1rem;
}
.client-tags-list .client-tag-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.client-tags-list .client-tag-item:last-child {
  border-bottom: none;
}
.client-tags-list .client-tag-name {
  flex: 1;
}
.tag-system-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Activity timeline */
.activity-timeline-tab h3 {
  margin-bottom: 1rem;
}
.activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.activity-date-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.activity-date-label input[type="date"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.activity-policy-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  min-width: 160px;
}
.activity-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: flex-start;
}
.activity-item:hover {
  background: var(--bg-hover);
}
.activity-item .activity-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.activity-item .activity-body {
  flex: 1;
  min-width: 0;
}
.activity-item .activity-body strong {
  display: block;
  margin-bottom: 0.2rem;
}
.activity-item .activity-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.activity-item.no-activity {
  cursor: default;
}
.clients-search-form button {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.clients-search-form button:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.search-input {
  flex: 1;
  max-width: 400px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

/* Client profile */
.client-profile-header {
  margin-bottom: 0.65rem;
}

/* שורה עליונה: עריכה | כותרת (שם + ת״ז) | חזרה — אותו גובה, הכותרת במרכז בין הכפתורים */
.client-profile-toolbar-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  flex-wrap: nowrap;
  margin-bottom: 0.35rem;
  direction: ltr;
}

.client-profile-toolbar-row .btn-back {
  margin: 0;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.client-profile-toolbar-row .client-profile-edit-toggle {
  flex-shrink: 0;
}

.client-profile-edit-toggle.client-profile-edit-icon-only {
  min-width: 2.35rem;
  padding: 0.4rem 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-profile-edit-pencil-icon {
  display: block;
}

.client-payments-tab-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 100%;
}

/* סיכום עליון — ממורכז לרוחב הטאב */
.client-monthly-pay-hero {
  text-align: center;
  width: 100%;
  padding: 1.25rem 1rem 1rem;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.12));
  background: var(--surface-elevated, rgba(255, 255, 255, 0.72));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.client-monthly-pay-hero-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
}

.client-monthly-pay-hero-sub {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.client-monthly-pay-hero-total {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #0f172a);
  font-variant-numeric: tabular-nums;
}

.client-monthly-pay-hero-asof {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

/* כרטיס פירוט */
.client-payments-detail-card {
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.12));
  background: var(--card-bg, #fff);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.client-payments-section-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 600;
}

.client-monthly-pay-table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.08));
}

.client-monthly-pay-detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.client-monthly-pay-detail-table thead th {
  text-align: start;
  padding: 0.65rem 0.75rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted, #475569);
  background: var(--table-head-bg, rgba(241, 245, 249, 0.95));
  border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.1));
}

.client-monthly-pay-detail-table tbody td {
  padding: 0.7rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07));
}

.client-monthly-pay-detail-table tbody tr:last-child td {
  border-bottom: none;
}

.client-monthly-pay-detail-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.65);
}

.client-monthly-pay-detail-table tbody tr:hover td {
  background: rgba(13, 148, 136, 0.06);
}

.client-monthly-pay-cell-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

.client-monthly-pay-cell-policy {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.client-monthly-pay-cell-details {
  max-width: 14rem;
  word-break: break-word;
}

.client-monthly-pay-empty {
  text-align: center;
  padding: 1.5rem 1rem !important;
  color: var(--text-muted, #64748b);
  border-bottom: none !important;
}

/* כפתורי אמצעי תשלום (+ והצגת שמורים) */
.client-pm-toolbar-strip {
  align-self: flex-start;
}

.client-pm-toolbar-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.45rem;
  direction: ltr;
}

.client-pm-add-btn,
.client-pm-saved-list-btn {
  padding: 0.4rem 0.55rem;
  line-height: 0;
}

.client-pm-add-btn svg,
.client-pm-saved-list-btn svg {
  display: block;
}

.client-pm-saved-title {
  margin-top: 0;
}

.client-pm-saved-hint {
  margin: 0 0 0.85rem;
}

#client-pm-saved-list-modal .client-pm-modal-title-row + .client-pm-saved-hint {
  margin-top: -0.35rem;
}

.client-pm-saved-list-inner.modal-wide {
  max-width: min(92vw, 720px);
}

.client-pm-saved-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.08));
}

.client-pm-saved-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.client-pm-saved-table thead th {
  text-align: start;
  padding: 0.55rem 0.65rem;
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--text-muted, #475569);
  background: rgba(241, 245, 249, 0.95);
  border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.1));
}

.client-pm-saved-table tbody td {
  padding: 0.6rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.06));
}

.client-pm-saved-table tbody tr:last-child td {
  border-bottom: none;
}

.client-pm-saved-actions-col {
  width: 1%;
  white-space: nowrap;
}

.client-pm-saved-actions {
  white-space: nowrap;
}

.client-pm-saved-actions .btn-sm + .btn-sm {
  margin-inline-start: 0.35rem;
}

.client-pm-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.client-pm-modal-title-row h3 {
  margin: 0;
}

.client-pm-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.client-docs-combined-tab .client-docs-dual-preview-wrap {
  align-items: stretch;
}

.client-docs-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.client-profile-toolbar-row .client-profile-top-banner {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

#client-profile-title-centered {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.client-profile-banner-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.75rem;
}

.client-profile-banner-name,
.client-profile-banner-id {
  font-size: inherit;
  font-weight: inherit;
}

.client-profile-banner-sep {
  opacity: 0.45;
  font-weight: 400;
}

  margin: 0 0 0.35rem;
  text-align: center;
}

#client-profile-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  max-height: min(38vh, 520px);
  overflow-y: auto;
  margin-bottom: 0.35rem;
}

.client-profile-header .client-tabs {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.profile-grid--client-summary {
  gap: 0.65rem 1.25rem;
}

.profile-grid--editing .profile-inline-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-edit-phone-email-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.profile-edit-phone-email-block .phone-email-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.profile-edit-phone-email-block .value {
  flex: 1;
  min-width: 8rem;
}

.profile-edit-phone-email-block .label {
  flex: 0 1 8rem;
  min-width: 5rem;
}

.profile-inline-add-btn {
  margin-top: 0.35rem;
}

.client-assignee-inline-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.client-assignee-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-hover);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.client-assignee-open-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.client-assignee-open-btn-inner {
  font-size: 1.35rem;
  font-weight: 700;
  opacity: 0.85;
}

/**
 * תפריטים נפתחים מעל התוכן (לא דוחפים את הפריסה)
 */
.overlay-dropdown {
  position: fixed;
  z-index: 12000;
  min-width: 13rem;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 0.35rem 0;
  direction: rtl;
}

.overlay-dropdown-item {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.5rem 0.9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.overlay-dropdown-item:hover {
  background: var(--bg-hover);
}

.client-contacts-tab .client-contacts-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
}

.client-contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.client-contacts-table th,
.client-contacts-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: right;
}

.client-contacts-table th {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.client-contacts-table .input-elegant {
  width: 100%;
  min-width: 6rem;
  box-sizing: border-box;
}

.contact-entry-checkbox-cell label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  cursor: pointer;
}

.client-contacts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.client-life-tab-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.client-life-tab-head h3 {
  margin: 0;
}

.client-life-tab .client-life-readonly-grid,
.client-life-tab .client-life-edit-grid {
  margin-bottom: 0.5rem;
}

.client-mail-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.client-mail-heading-row h3 {
  margin: 0;
}

.client-mail-wa-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-hover);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.client-mail-wa-shortcut:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem 2rem;
  width: 100%;
}

#clients-page #client-profile-page {
  max-width: min(1180px, 100%);
  margin-inline: auto;
  width: 100%;
}

.profile-main {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-main h2 {
  margin: 0;
  font-size: 1.4rem;
}

.profile-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-cell-wide {
  grid-column: span 2;
}

.profile-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-link {
  color: var(--accent);
  text-decoration: none;
}

.profile-link:hover {
  text-decoration: underline;
}

.profile-phone-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-phone-btn:hover {
  color: var(--accent-hover, var(--accent));
}
.profile-phone-sep {
  user-select: none;
  color: var(--text-muted);
}

.profile-phone-inline-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  vertical-align: baseline;
}

button.profile-phone-open-menu {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: inherit;
}

button.profile-phone-open-menu:hover {
  color: var(--accent-hover, var(--accent));
}

button.profile-copy-field {
  display: inline;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: copy;
  text-align: inherit;
  vertical-align: baseline;
  overflow-wrap: anywhere;
}

button.profile-copy-field:hover {
  opacity: 0.9;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.client-profile-banner-heading button.profile-copy-field {
  font-size: inherit;
  font-weight: inherit;
  color: var(--accent);
  cursor: copy;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.profile-copy-field--email {
  color: var(--accent);
  cursor: copy;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.profile-copy-field--email:hover {
  color: var(--accent-hover, var(--accent));
}

button.profile-email-open-menu {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.profile-email-open-menu:hover {
  color: var(--accent-hover, var(--accent));
}

.client-tag-badge .client-tag-name-btn {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.client-phone-ctx-menu {
  position: fixed;
  z-index: 12100;
  min-width: 11.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 0.3rem 0;
  direction: rtl;
}
.client-phone-ctx-menu.hidden {
  display: none;
}
.client-phone-ctx-item {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.5rem 0.9rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}
.client-phone-ctx-item:hover:not(:disabled) {
  background: var(--bg-hover, rgba(0, 0, 0, 0.06));
}
.client-phone-ctx-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.client-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}
.client-tab:hover, .client-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,168,138,0.1);
}
.activity-timeline-tab h3 { margin: 0 0 1rem; }
.activity-filters { margin-bottom: 1rem; }
.activity-filters select { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font: inherit; }
.activity-timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); cursor: pointer; transition: background 0.15s; }
.activity-item:hover { background: var(--bg-hover); }
.activity-icon { font-size: 1.25rem; flex-shrink: 0; }
.activity-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.activity-title { font-weight: 500; }
.activity-meta { font-size: 0.85rem; color: var(--text-muted); }
.activity-policy-badge { font-size: 0.8rem; background: var(--bg-hover); padding: 0.15rem 0.4rem; border-radius: 4px; margin-right: 0.25rem; }
#client-tab-content {
  min-height: 200px;
  max-height: calc(100vh - 260px);
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  overflow-y: auto;
  overflow-x: hidden;
}
#client-tab-content .loading { color: var(--text-muted); margin: 1rem 0; }

.client-beneficiaries-tab {
  max-width: 100%;
}
.client-beneficiaries-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--text);
}
.client-beneficiaries-disposition {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
}
.ben-disposition-label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
}
.ben-disposition-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.client-beneficiaries-alt-msg {
  margin-bottom: 1rem;
}
.client-beneficiaries-hint {
  margin: 0 0 0.65rem;
  line-height: 1.45;
}
.client-beneficiaries-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}
.client-beneficiaries-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.client-beneficiaries-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.client-beneficiaries-table th,
.client-beneficiaries-table td {
  padding: 0.35rem 0.45rem;
  white-space: nowrap;
  vertical-align: middle;
}
.client-beneficiaries-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.client-beneficiaries-table .ben-cell-child {
  min-width: 9rem;
  max-width: 14rem;
  white-space: normal;
}
.client-beneficiaries-table .ben-child-hint {
  display: block;
  max-width: 12rem;
  line-height: 1.3;
}
.client-beneficiaries-table .ben-inp-house {
  max-width: 4rem;
}
.client-beneficiaries-table .ben-inp-pct {
  max-width: 5rem;
}
.client-beneficiaries-table .input-elegant {
  font-size: 0.8rem;
  padding: 0.28rem 0.35rem;
}
.client-beneficiaries-save-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.family-tab { max-width: 560px; }
.family-section { margin-bottom: 1.5rem; }
.family-section h3 { font-size: 0.95rem; color: var(--text); margin-bottom: 0.75rem; }
.family-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.family-member-link {
  color: var(--accent);
  text-decoration: none;
  flex: 1;
}
.family-member-link:hover { text-decoration: underline; }
.family-meta { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.family-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
.family-remove-btn:hover { color: var(--error); }
.family-add-partner, .family-members-list { margin-bottom: 0.75rem; }
.add-partner-btn, .add-family-btn { margin-top: 0.5rem; }

.policies-tab { max-width: 560px; }
.policies-tab h3 { font-size: 0.95rem; color: var(--text); margin-bottom: 0.75rem; }
.policies-list { margin-bottom: 0.75rem; }
.policy-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.policy-block { margin-bottom: 0.75rem; }
.policy-number { font-weight: 500; flex: 1; }
.policy-date { font-size: 0.85rem; color: var(--text-muted); }
.policy-conv-btn, .policy-toggle-convs {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0 0.4rem;
  font-size: 1rem;
}
.policy-conv-btn:hover, .policy-toggle-convs:hover { opacity: 0.8; }
.policy-convs-list {
  margin-top: 0.5rem;
  margin-right: 2rem;
  padding: 0.5rem 1rem;
  background: var(--bg-soft);
  border-radius: 6px;
  border-right: 3px solid var(--primary);
}
.policy-convs-list.hidden { display: none; }
.policy-conv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  cursor: pointer;
  border-radius: 4px;
}
.policy-conv-row:hover { background: rgba(0,0,0,0.04); }
.policy-conv-row .conv-subj { flex: 1; }
.policy-conv-row .conv-meta { font-size: 0.8rem; color: var(--text-muted); }
.policy-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
.policy-remove-btn:hover { color: var(--error); }
.policies-tab .no-items { color: var(--text-muted); margin: 1rem 0; }

/* Client modal */
.modal-scroll {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide.client-modal {
  max-width: 520px;
}

.form-row-inline {
  align-items: center;
}
.form-row-inline select {
  flex: 0 0 140px;
}
.form-row-inline input {
  flex: 1;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.form-section {
  margin: 1.5rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.form-section h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.input-with-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.input-with-label label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.age-display {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
  padding: 0.5rem 0;
}

.phone-email-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.phone-email-row input {
  margin-bottom: 0;
}
.phone-email-row input.value {
  flex: 1;
}
.phone-email-row input.label {
  flex: 0 0 100px;
}
.phone-email-row button.remove {
  flex: 0 0 auto;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.phone-email-row button.remove:hover {
  color: var(--error);
  border-color: var(--error);
}

.btn-add-item {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.btn-add-item:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Attendance */
.attendance-layout {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.attendance-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 140px;
}
.attendance-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Work Timer */
.work-timer-container {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  color: white;
  width: 100%;
  max-width: 920px;
  margin-bottom: 1rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.3);
}
.work-timer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.work-timer-main-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
}
.work-timer-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}
.timer-icon {
  font-size: 1.2rem;
}
.timer-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}
.work-timer-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  direction: ltr;
  unicode-bidi: isolate;
}
.timer-digit {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  min-width: 60px;
  text-align: center;
}
.timer-sep {
  font-size: 2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}
.work-timer-progress {
  margin-bottom: 0.75rem;
}
.progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #fbbf24 75%, #ef4444 100%);
  border-radius: 10px;
  transition: width 1s ease;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}
.work-timer-progress-labels {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  direction: ltr;
  unicode-bidi: isolate;
  width: 100%;
}
.work-timer-status {
  text-align: center;
  font-size: 0.85rem;
  color: #34d399;
  font-weight: 500;
}
.work-timer-status.overtime {
  color: #fbbf24;
}

.work-timer-day-wrap {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 1rem 0 0;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.work-timer-day-title {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 600;
}
.work-timer-day-table-scroll {
  max-height: 260px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}
.work-timer-day-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.work-timer-day-table th,
.work-timer-day-table td {
  padding: 0.4rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.work-timer-day-table th {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 1;
}
.work-timer-day-table tbody tr:last-child td {
  border-bottom: none;
}
.work-timer-day-table tfoot td {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
  color: #34d399;
  font-weight: 600;
}
.work-timer-day-table .work-timer-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

@media (max-width: 720px) {
  .work-timer-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .work-timer-left-col {
    align-items: center;
  }
  .work-timer-day-wrap {
    border-right: none;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 100%;
  }
}

.attendance-clock-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.attendance-feedback {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}
.attendance-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--chat-shadow);
}
.attendance-scope-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.attendance-scope-wrap label { font-size: 0.9rem; color: var(--text-muted); }
.attendance-scope-wrap select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }

.attendance-range-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.attendance-range-picker label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.attendance-range-picker input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font: inherit;
}
.attendance-format-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.attendance-format-picker label { font-size: 0.9rem; color: var(--text-muted); }
.attendance-format-picker select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.attendance-hours-chart {
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--chat-shadow);
  max-height: 400px;
  overflow-y: auto;
}
.attendance-hours-chart.hidden { display: none; }
.hours-chart-bars { display: flex; flex-direction: column; gap: 0.75rem; }
.hours-chart-bar {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}
.chart-label { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-track {
  height: 24px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  min-width: 4px;
  transition: width 0.3s ease;
}
.chart-value { font-weight: 600; text-align: left; }
.btn-attendance {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}
.btn-attendance.btn-in {
  background: var(--accent);
  color: var(--btn-on-accent);
}
.btn-attendance.btn-in:hover {
  background: var(--accent-dim);
}
.btn-attendance.btn-out {
  background: #6b7c9a;
  color: #fff;
}
.btn-attendance.btn-out:hover {
  background: #5a6b89;
}
.btn-attendance:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #9ca3af !important;
}
.btn-attendance.btn-out:disabled {
  background: #9ca3af !important;
}
.attendance-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--chat-shadow);
}
.attendance-table th,
.attendance-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  white-space: nowrap;
}
.attendance-table th {
  background: var(--chat-sidebar-header);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.attendance-table tbody tr:hover {
  background: var(--chat-accent-soft);
}

/* Presence indicator */
.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: presence-pulse 2s infinite;
}
@keyframes presence-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.presence-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
  border-radius: 6px;
  margin-right: 0.25rem;
}
.user-row.present .user-info-cell,
.contact-card.present .contact-name {
  position: relative;
}
.contact-card.clickable {
  cursor: pointer;
}
.contact-card.clickable:hover {
  background: var(--chat-accent-soft);
}

/* File modal tabs */
.file-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.file-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
}
.file-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.file-tab.active {
  background: var(--accent);
  color: var(--btn-on-accent);
  border-color: var(--accent);
}
.file-section.hidden {
  display: none !important;
}

/* Employee profile */
.employee-profile-header {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.employee-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.employee-tab {
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.employee-tab:hover {
  color: var(--accent);
}
.employee-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}
.schedule-table th,
.schedule-table td {
  padding: 0.6rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.employee-conv-row {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.employee-conv-row:hover {
  background: var(--chat-accent-soft);
}
.schedule-table input[type="time"] {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.employment-terms-form {
  max-width: 480px;
}
.employment-terms-form .input-with-label {
  margin-bottom: 1rem;
}
.employment-terms-form .input-with-label input[type="number"],
.employment-terms-form .input-with-label textarea {
  width: 100%;
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.employment-terms-form .input-with-label textarea {
  max-width: 280px;
  min-height: 80px;
  resize: vertical;
}
.employment-terms-view p {
  margin-bottom: 1rem;
}
.employment-terms-form #employment-save-btn,
.schedule-view #schedule-save-btn {
  margin-top: 0.5rem;
}
.emp-terms-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.emp-terms-row .input-with-label input {
  width: 100px;
}
.bonuses-section {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.bonuses-section h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.bonuses-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.bonuses-list {
  margin-bottom: 0.75rem;
}
.bonus-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.bonus-row:last-of-type {
  border-bottom: none;
}
.bonus-text {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
}
.bonus-amount {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.add-bonus-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.bonus-input-condition {
  width: 180px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.bonus-input-amount {
  width: 90px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.salary-summary {
  max-width: 420px;
}
.salary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.salary-table td, .salary-table th {
  padding: 0.5rem;
  text-align: right;
  border: 1px solid var(--border);
}
.salary-table th {
  background: var(--chat-sidebar-header);
  color: #fff;
}
.salary-edit {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.salary-edit input {
  max-width: 120px;
}

/* Tardiness Report */
.tardiness-report {
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  border: 1px solid #f59e0b;
}
.tardiness-report h4 {
  margin: 0 0 0.75rem 0;
  color: #92400e;
  font-size: 1rem;
}
.tardiness-report.tardiness-none {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
}
.tardiness-report.tardiness-none h4 {
  color: #065f46;
}
.no-tardiness {
  color: #065f46;
  font-weight: 500;
  margin: 0;
}
.tardiness-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.tardiness-count {
  color: #dc2626;
  font-weight: 600;
}
.tardiness-total {
  color: #92400e;
}
.tardiness-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.85rem;
}
.tardiness-table th,
.tardiness-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid #fcd34d;
}
.tardiness-table thead th {
  background: #f59e0b;
  color: white;
  font-weight: 500;
}
.tardiness-table tbody tr:last-child td {
  border-bottom: none;
}
.tardiness-table tbody tr:hover {
  background: #fef9c3;
}
.tardiness-minutes {
  color: #dc2626;
  font-weight: 500;
}

.notif-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.manager-edit-mark {
  color: var(--accent);
  font-weight: bold;
  margin-right: 2px;
}
.emp-attendance-add {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.emp-attendance-add h4 {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Tasks */
.tasks-page-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem 0;
}
.tasks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  align-items: flex-end;
  justify-content: space-between;
}
.tasks-toolbar-search { flex: 1; min-width: 220px; max-width: 420px; }
.tasks-search-input { width: 100%; }
.tasks-filters-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tasks-filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.tasks-filter-select, .tasks-filter-date {
  min-width: 120px;
}
.tasks-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tasks-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.tasks-view-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tasks-view-btn {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.tasks-view-btn:hover { background: var(--bg-hover); }
.tasks-view-btn.active {
  background: var(--task-accent);
  color: #fff;
  border-color: var(--task-accent);
}
.tasks-tabs {
  display: flex;
  gap: 0.35rem;
}
.tasks-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.tasks-tab:hover { background: var(--bg-hover); }
.tasks-tab.active {
  background: var(--task-accent);
  color: #fff;
  border-color: var(--task-accent);
}
.tasks-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--task-accent);
  border-color: var(--task-accent);
}
.tasks-add-btn:hover { background: var(--task-accent-hover); border-color: var(--task-accent-hover); }
.tasks-count-wrap {
  margin-bottom: 1rem;
}
.tasks-count {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.tasks-count strong { color: var(--text); }
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 260px);
}
.task-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.task-row:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.task-row.task-today { border: 2px solid #ea580c; background: rgba(234, 88, 12, 0.06); }
.task-row.task-overdue { border: 2px solid #dc2626; background: rgba(220, 38, 38, 0.06); }
.task-row.task-done { opacity: 0.85; }
.task-row.task-continuation::before { content: 'המשך '; color: var(--text-muted); font-size: 0.85em; }
.task-row.task-corrected { border-top: 1px dashed var(--accent); }
.task-main { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.task-subject { font-weight: 500; font-size: 1.05rem; }
.task-status-badge { font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: 999px; }
.task-status-badge.status-pending { background: var(--task-gold-soft); color: var(--task-gold); }
.task-status-badge.status-in_progress { background: rgba(13, 148, 136, 0.12); color: var(--task-today); }
.task-status-badge.status-done { background: rgba(26, 95, 90, 0.12); color: var(--task-accent); }
.task-meta { font-size: 0.9rem; color: var(--text-muted); }
.task-continuation-parent {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.task-continuation-parent-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.task-continuation-parent-content {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.task-continuation-parent-row {
  margin-bottom: 0.25rem;
}
.task-continuation-parent-row:last-child { margin-bottom: 0; }
.task-modal-inner.task-modal-content {
  max-width: min(90vw, 680px);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.task-form-horizontal .task-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.task-form-horizontal .form-row { margin-bottom: 0; }
.task-form-horizontal .form-row.form-row-inline { grid-column: span 1; }
.task-form-horizontal .form-row:first-child { grid-column: 1 / -1; }
.task-form-horizontal .task-assignees-row { grid-column: 1 / -1; }
.task-form-horizontal .form-row label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.task-assignees-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.task-assignees-chips-wrap .participant-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.task-add-assignee-select { max-width: 220px; padding: 0.4rem 0.6rem; font: inherit; border: 1px solid var(--border); border-radius: 8px; }
.task-status-btns { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
.task-status-btns .task-status-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.task-detail-row { margin-bottom: 0.5rem; }
.task-link-client, .task-link-policy,
.task-list-link-client, .task-list-link-policy {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.task-link-client:hover, .task-link-policy:hover,
.task-list-link-client:hover, .task-list-link-policy:hover {
  text-decoration: underline;
}

/* ================= MANAGEMENT PAGE ================= */
.management-header {
  margin-bottom: 2rem;
}
.management-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.management-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.manager-dashboard-wrap {
  margin-bottom: 2rem;
}
.manager-dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.manager-dashboard-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}
.manager-dashboard-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.manager-dash-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.manager-dash-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}
.manager-dash-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.manager-dashboard-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .manager-dashboard-tables { grid-template-columns: 1fr; }
}
.manager-dash-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.manager-dash-list {
  font-size: 0.9rem;
}
.manager-dash-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.manager-dash-row:last-child { border-bottom: none; }
.dash-name { font-weight: 500; }
.dash-present { color: var(--accent); font-size: 0.85em; }
.dash-absent { color: var(--text-muted); font-size: 0.85em; }
.dash-role { font-size: 0.85em; color: var(--text-muted); }
.dash-emails, .dash-tasks { font-size: 0.9em; }

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.report-filters select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.report-table-wrap {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.report-table th, .report-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.report-table th { font-weight: 600; color: var(--text); background: var(--bg-hover); }
.report-table tbody tr:hover { background: rgba(0,0,0,0.02); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.settings-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(37, 99, 235, 0.03), transparent);
}
.settings-card-icon {
  font-size: 2rem;
  line-height: 1;
}
.settings-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.settings-card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.settings-card-body {
  padding: 1rem 1.5rem;
}

.setting-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.setting-option:last-child {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #d1d5db;
  transition: 0.3s;
  border-radius: 26px;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.setting-label {
  flex: 1;
  min-width: 0;
}
.setting-title {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.setting-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.setting-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-right: auto;
}
.setting-input-group input[type="number"] {
  width: 80px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  text-align: center;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.setting-input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.settings-card-footer {
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,0.02);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Manager-only nav item styling */
.nav-item-manager {
  position: relative;
}
.nav-item-manager::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.nav-item-manager:hover::before,
.nav-item-manager.active::before {
  opacity: 1;
}

/* Toast notification */
.toast-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  z-index: 10000;
}
.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Companies list in settings */
.companies-list {
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
}
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 0.5rem;
}
.company-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.company-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.company-card-logo {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 0.75rem;
}
.company-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.company-card-logo .no-logo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 2rem;
  color: var(--text-muted);
}
.company-card-logo .btn-logo-upload {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.company-card:hover .btn-logo-upload {
  opacity: 1;
}
.company-card-body {
  flex: 1;
  margin-bottom: 0.75rem;
}
.company-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.company-card-url {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
}
.company-card-actions {
  display: flex;
  gap: 0.5rem;
}
.company-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.company-item:last-child { border-bottom: none; }
.company-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.company-name {
  font-weight: 500;
  color: var(--text);
}
.company-url {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.company-url:hover { text-decoration: underline; }
.company-actions {
  display: flex;
  gap: 0.5rem;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
.btn-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-icon-sm:hover { background: var(--bg-hover); }
.btn-icon-sm.btn-danger:hover { background: rgba(220, 38, 38, 0.1); color: var(--error); }
.add-company-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.add-company-row input {
  flex: 1;
  min-width: 150px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.add-company-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Permissions list */
.permissions-list {
  max-height: 350px;
  overflow-y: auto;
}
.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.permission-item:last-child { border-bottom: none; }
.permission-user {
  font-weight: 500;
  color: var(--text);
}
.permission-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.permission-toggle span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Page header */
.page-header {
  margin-bottom: 1.5rem;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Insurance credentials grid */
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.credential-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.credential-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.credential-card-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.credential-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.credential-card-header a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.credential-card-header a:hover { text-decoration: underline; }
.credential-card-body {
  padding: 1rem 1.25rem;
}
.credential-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.credential-field:last-child { border-bottom: none; }
.credential-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.credential-value {
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.credential-value.empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}
.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.btn-copy:hover { opacity: 1; }
.credential-card-footer {
  padding: 0.75rem 1.25rem;
  background: rgba(0,0,0,0.02);
  border-top: 1px solid var(--border);
}
.credential-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Agency Details Page - Premium Design */
.agency-details-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.agency-details-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  border-radius: 8px;
}
.agency-details-tab:hover { color: var(--text); background: var(--bg-hover); }
.agency-details-tab.active { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.agency-details-panel { padding-top: 0; }
.agency-contacts-header { margin-bottom: 1rem; }
.agency-contacts-header h2 { margin-bottom: 0.35rem; }
.agency-contacts-desc { color: var(--text-muted); font-size: 0.9rem; }
.agency-contacts-tags-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
#agency-contacts-tags-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.agency-contact-tag-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.agency-contact-tag-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.agency-contact-tag-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.agency-contact-tag-btn.tag-system { background: rgba(13, 148, 136, 0.08); border-color: rgba(13, 148, 136, 0.35); }
.agency-contact-tag-btn .tag-system-icon { font-size: 0.85em; opacity: 0.9; }
.agency-contact-tag-btn .tag-delete { margin-right: 0.25rem; opacity: 0.7; cursor: pointer; }
.agency-contact-tag-btn .tag-delete:hover { opacity: 1; color: var(--error); }
/* אנשי קשר – עמודה שמאלית קבועה לכפתורי הוספה */
.agency-contacts-layout { display: flex; gap: 1rem; align-items: flex-start; min-height: 200px; }
.agency-contacts-actions-col {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.agency-contacts-actions-col .btn-sm { width: 100%; justify-content: center; white-space: normal; text-align: center; }
.agency-contacts-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.agency-contacts-section { margin-bottom: 1rem; }
.agency-contacts-section-title { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text); font-weight: 600; }
.agency-contacts-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.agency-contact-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.agency-contact-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-color: rgba(13, 148, 136, 0.25); }
.agency-contact-card-body { flex: 1; min-width: 0; }
.agency-contact-card-body strong { font-size: 1rem; font-weight: 600; color: var(--text); display: block; margin-bottom: 0.15rem; }
.agency-contact-tag-hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.agency-contact-meta { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }
.agency-contact-meta a { color: var(--accent); text-decoration: none; }
.agency-contact-meta a:hover { text-decoration: underline; text-underline-offset: 2px; }
.agency-contact-notes { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.4; }
.agency-contact-card-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.agency-add-contact-btn { margin-top: 0; }
.agency-contacts-all-view { display: flex; flex-direction: column; gap: 0.75rem; }
.agency-contacts-search-wrap { flex-shrink: 0; }
.agency-contacts-search-wrap .input-text { width: 100%; max-width: 320px; border-radius: 10px; padding: 0.5rem 0.75rem; }
.agency-contacts-all-view .agency-contacts-list { margin-bottom: 0; }

/* משבצות בנק – לוגו למעלה, שם ומספר מתחת (בלי חפיפה) */
.agency-bank-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.agency-bank-tile {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-card);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.agency-bank-tile-logo {
  flex: 1 1 auto;
  min-height: 72px;
  background: #f0f2f4 center/contain no-repeat;
  background-color: #fff;
}
.agency-bank-tile-logo--empty {
  background-image: none;
  background: linear-gradient(145deg, #e8ecef 0%, #f5f7f9 100%);
  position: relative;
}
.agency-bank-tile-logo--empty::after {
  content: '🏦';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  opacity: 0.45;
}
.agency-bank-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.agency-bank-tile-content {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.45rem 0.5rem 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.agency-bank-tile-edit {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.92);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.agency-bank-tile-edit:hover { background: #fff; }
.agency-bank-tile-name {
  font-weight: 700;
  font-size: 0.88rem;
  display: block;
  line-height: 1.3;
  color: var(--text);
}
.agency-bank-tile-number {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
  display: block;
  color: var(--text-muted);
}
.agency-contact-logo-upload { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.agency-contact-logo-preview { max-width: 80px; max-height: 60px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); }
.agency-bank-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.agency-bank-detail-header h2 { margin: 0; flex: 1; }
.agency-bank-detail-actions { display: flex; align-items: center; gap: 0.35rem; }
.agency-bank-detail-inline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.agency-contacts-bank-actions { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.4rem; }
.agency-bank-back-wrap { order: 1; width: 100%; text-align: center; margin-bottom: 0.5rem; }
.agency-bank-detail-inline-header .btn-back-link {
  display: inline-block;
  padding: 0.4rem 1rem;
  color: var(--accent);
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}
.agency-bank-detail-inline-header .btn-back-link:hover { background: rgba(13, 148, 136, 0.12); border-color: var(--accent); text-decoration: none; }
.agency-bank-detail-inline-header .agency-bank-detail-title-inline { order: 2; flex: 1; font-size: 1.25rem; margin: 0; color: var(--text); font-weight: 600; }
.agency-bank-detail-inline-header #agency-bank-detail-edit-inline { order: 3; }
.agency-bank-detail-body-elegant {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
}
@media (max-width: 768px) {
  .agency-bank-detail-body-elegant {
    grid-template-columns: 1fr;
  }
}
.agency-bank-detail-branches-col,
.agency-bank-detail-links-col { min-width: 0; }
.agency-bank-section { margin-bottom: 1.5rem; }
.agency-bank-section h3 { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--text); font-weight: 600; }
.agency-bank-branches-search-wrap { margin-bottom: 0.75rem; }
.agency-bank-branches-search-wrap .input-search { width: 100%; max-width: 320px; }
.agency-bank-branch-card { position: relative; }
.agency-bank-branch-actions { margin-right: 0.5rem; white-space: nowrap; }
.agency-bank-branch-actions .btn-icon-sm { padding: 0.25rem 0.4rem; font-size: 0.9rem; vertical-align: middle; }
.agency-bank-loading { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; margin-bottom: 0.5rem; }
.agency-bank-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(13, 148, 136, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: agency-bank-spin 0.8s linear infinite;
}
.agency-bank-loading-text { font-size: 0.9rem; color: var(--text-muted); }
@keyframes agency-bank-spin { to { transform: rotate(360deg); } }
.agency-bank-skeleton .skeleton-line {
  display: block;
  height: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: agency-bank-skeleton-shine 1.2s ease-in-out infinite;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.agency-bank-skeleton .skeleton-line.short { width: 70%; }
.agency-bank-skeleton .skeleton-line:last-child { margin-bottom: 0; }
@keyframes agency-bank-skeleton-shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.agency-bank-card-wrap { max-width: 520px; }
.agency-bank-branch-card {
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.agency-bank-branch-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.agency-bank-branch-card.is-main {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, #fff 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.1);
}
.agency-bank-link-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.agency-bank-link-row a { color: var(--accent); }
.agency-bank-link-row:last-child { border-bottom: none; }

/* מודלים וטפסים אלגנטיים */
.modal-elegant { max-width: 440px; padding: 1.5rem; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.modal-elegant h2 { font-size: 1.15rem; margin-bottom: 1.25rem; font-weight: 600; color: var(--text); }
.form-group-elegant { margin-bottom: 1rem; }
.form-group-elegant label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text); margin-bottom: 0.35rem; }
.input-elegant {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-elegant:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15); }
.label-elegant { display: block; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; font-size: 0.9rem; }
.policy-type-checkboxes {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
}
.policy-type-checkboxes .policy-cat-row {
  margin-bottom: 0.35rem;
}
.policy-type-checkboxes .policy-cat-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  padding: 0.2rem 0;
}
.policy-type-checkboxes .policy-type-row {
  margin-right: 1.25rem;
  margin-bottom: 0.25rem;
}
.policy-type-checkboxes .policy-type-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.9rem;
}
.modal-hint { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.agency-set-main-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; cursor: pointer; }
.agency-set-main-row input[type="checkbox"] { width: 1.1em; height: 1.1em; accent-color: var(--accent); }
#agency-bank-set-main-list { max-height: 280px; overflow-y: auto; }
.policy-type-checkboxes input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  accent-color: var(--accent);
}
.form-row-elegant { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.modal-actions-elegant {
  display: flex;
  justify-content: stretch;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-actions-elegant .btn-elegant {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  padding: 0.6rem 0.75rem;
  text-align: center;
}
.btn-elegant {
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s, background 0.2s;
}
.btn-elegant:hover { transform: translateY(-1px); }
.btn-elegant.btn-primary { box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25); }
.btn-elegant.btn-primary:hover { box-shadow: 0 3px 10px rgba(13, 148, 136, 0.35); }
.btn-elegant.btn-secondary { border: 1px solid var(--border); background: #fff; color: var(--text); }
.btn-elegant.btn-secondary:hover { border-color: var(--accent); background: rgba(13, 148, 136, 0.06); color: var(--accent); }
.modal-lg { max-width: 560px; }

.agency-details-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}
.agency-info-section {
  margin-bottom: 2.5rem;
}
.agency-info-card {
  background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
  border: none;
  border-radius: 20px;
  padding: 2.5rem;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}
.agency-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #6366f1 50%, #8b5cf6 100%);
}
.agency-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.agency-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 16px;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.agency-logo-placeholder {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 500;
}
.agency-info-fields {
  flex: 1;
}
.agency-name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.agency-slogan {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.agency-contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}
.contact-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.contact-item a:hover { 
  text-decoration: underline; 
}
.contact-item .copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}
.contact-item .copy-btn:hover { opacity: 1; }

.agency-info-edit {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.form-grid input {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.form-grid input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Company bulletins - Modern card design */
.company-bulletins-section {
  margin-bottom: 2rem;
}
.company-bulletins-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.company-bulletins-section h2::before {
  content: '🏢';
}
.bulletins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.bulletin-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(255,255,255,0.95) 100%);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bulletin-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}
.bulletin-card.open {
  grid-column: 1 / -1;
  transform: none;
}
.bulletin-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(99, 102, 241, 0.03) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}
.bulletin-header:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}
.bulletin-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.bulletin-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.bulletin-no-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
  border-radius: 10px;
  font-size: 1.5rem;
}
.bulletin-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.bulletin-header .toggle-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.bulletin-card.open .toggle-icon {
  background: var(--accent);
  color: white;
}
.bulletin-body {
  display: none;
  padding: 1.5rem;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulletin-body.open {
  display: block;
}
.company-tables-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}
.company-tables-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.agent-numbers-section {
  margin-bottom: 1.5rem;
}
.agent-numbers-section h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.agent-number-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin: 0.25rem;
}
.agent-number-chip .category {
  font-size: 0.75rem;
  opacity: 0.7;
}
.agent-number-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.agent-number-row .agent-number-chip {
  flex: 0 0 auto;
}
.agent-domain-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}
.agent-active-badge {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
}
.btn-agent-active {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.contacts-table th,
.contacts-table td {
  padding: 0.6rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.contacts-table th {
  background: var(--bg);
  font-weight: 500;
  color: var(--text-muted);
}
.contacts-table td {
  color: var(--text);
}
.contacts-table .copy-cell {
  cursor: pointer;
  transition: background 0.2s;
}
.contacts-table .copy-cell:hover {
  background: var(--accent-soft);
}

/* Custom tables */
.custom-tables-section {
  margin-bottom: 2rem;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.section-header h2 {
  font-size: 1.25rem;
  color: var(--text);
}
.custom-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.custom-table-header {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.custom-table-header h4 {
  font-weight: 500;
}
.custom-table-body {
  padding: 1rem;
  overflow-x: auto;
}
.custom-table-wrapper {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}
.custom-table {
  width: 100%;
  min-width: 400px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.custom-table th,
.custom-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: right;
}
.custom-table th {
  background: var(--bg);
}
.custom-table input {
  width: 100%;
  padding: 0.3rem;
  border: none;
  background: transparent;
  font: inherit;
}
.custom-table input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Edit only elements */
.edit-only { display: none; }
.can-edit .edit-only { display: block; }
.can-edit .edit-only.btn-sm { display: inline-block; }

/* Modal subtitle */
.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* Form textarea */
.modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}
.modal textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Attendance Tabs */
.attendance-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}
.attendance-tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
}
.attendance-tab:hover { background: var(--bg-hover); }
.attendance-tab.active {
  background: var(--accent);
  color: white;
}
.attendance-tab-content.hidden { display: none; }

/* Duty Calendar */
.duty-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.duty-month-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}
.duty-month-picker .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}
.duty-month-picker .btn-icon:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.duty-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.duty-calendar-header-cell {
  background: var(--bg);
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.duty-calendar-cell {
  background: var(--bg-card);
  min-height: 100px;
  padding: 0.5rem;
  position: relative;
}
.duty-calendar-cell.other-month {
  background: var(--bg);
  opacity: 0.5;
}
.duty-calendar-cell.today {
  background: rgba(37, 99, 235, 0.05);
}
.duty-day-number {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.duty-calendar-cell.today .duty-day-number {
  color: var(--accent);
}
.duty-shift-item {
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: white;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.duty-shift-item:hover {
  transform: scale(1.02);
}
.duty-shift-item.morning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.duty-shift-item.evening { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.duty-shift-item.night { background: linear-gradient(135deg, #1f2937 0%, #374151 100%); }
.duty-add-cell-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 1rem;
  line-height: 1;
}
.duty-calendar-cell:hover .duty-add-cell-btn { opacity: 1; }

/* ===================== EMAIL APP ===================== */
/* ========================================
   EMAIL CLIENT - PREMIUM DESIGN
   ======================================== */

.email-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 140px);
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  overflow: visible;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.email-app.viewing-email {
  grid-template-columns: 240px 1fr;
}

.email-app.viewing-email .email-list {
  display: none;
}

.email-sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.email-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
  pointer-events: none;
}

.email-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.email-sidebar-header .email-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.email-sidebar-header h2 {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.btn-compose {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-compose::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-compose:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(99, 102, 241, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-compose:hover::before {
  opacity: 1;
}

.btn-compose span {
  position: relative;
  z-index: 1;
}

.email-folders {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.email-folder {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.email-folder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 12px;
}

.email-folder:hover {
  color: white;
}

.email-folder:hover::before {
  opacity: 1;
}

.email-folder.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.email-folder.active .folder-icon {
  transform: scale(1.1);
}

.folder-icon {
  font-size: 1.2rem;
  transition: transform 0.25s;
  position: relative;
  z-index: 1;
  width: 24px;
  text-align: center;
}

.folder-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.folder-count {
  background: rgba(99, 102, 241, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  min-width: 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.email-folder.active .folder-count {
  background: rgba(255, 255, 255, 0.2);
}

.email-labels-section {
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.email-labels-section h4 {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.label-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Email List Panel */
.email-list-panel {
  background: white;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.email-main {
  display: flex;
  flex-direction: column;
  background: white;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  overflow: visible;
  min-height: 0;
}

.email-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.email-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.email-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.email-toolbar .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.email-toolbar .btn-icon:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

.email-toolbar .search-input {
  flex: 1;
  min-width: 120px;
  max-width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.email-toolbar .search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

.email-list {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.email-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafbfc;
}
.email-pagination-bar.hidden {
  display: none;
}
.email-page-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.email-advanced-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  background: #f5f6f8;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.email-advanced-search label { font-size: 0.85rem; color: var(--text-muted); }
.email-advanced-search .search-input,
.email-advanced-search input[type="date"] { max-width: 140px; }

.email-item {
  display: grid;
  grid-template-columns: 40px 40px 200px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.email-app.viewing-email .email-item {
  grid-template-columns: 36px 36px 1fr auto;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
}

.email-item::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.email-item:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}

.email-item:hover::before {
  opacity: 1;
}

.email-item.selected {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.email-item.selected::before {
  opacity: 1;
}

.email-item.unread {
  background: white;
}

.email-item.unread::after {
  content: '';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.email-item.unread .email-sender,
.email-item.unread .email-subject {
  font-weight: 600;
  color: var(--text);
}

.email-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  cursor: pointer;
  accent-color: var(--accent);
}

.email-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.email-app.viewing-email .email-item-avatar {
  display: flex;
}

.email-sender-col {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.email-app.viewing-email .email-sender-col {
  display: none;
}

.email-item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.email-subject-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.email-subject-line .email-subject {
  flex-shrink: 0;
  max-width: 350px;
}

.email-preview-sep {
  color: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.email-subject-line .email-preview {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-indicator {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.email-app.viewing-email .email-subject-line {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.email-app.viewing-email .email-preview-sep {
  display: none;
}

.email-app.viewing-email .email-subject-line .email-subject {
  max-width: 100%;
}

.email-app.viewing-email .email-subject-line .email-preview {
  font-size: 0.8rem;
}

.email-sender {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-content {
  min-width: 0;
}

.email-subject {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.email-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.email-star {
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.email-item:hover .email-star {
  opacity: 1;
}

.email-star:hover {
  transform: scale(1.2);
}

.email-star.starred {
  color: #f59e0b;
  opacity: 1;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.email-date {
  white-space: nowrap;
  font-weight: 500;
}

/* Email View Panel - Premium Design */
.email-view {
  flex: 1;
  overflow: visible;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  display: none;
  flex-direction: column;
}

.email-view:not(.hidden) {
  display: flex;
}

.email-app.viewing-email .email-view {
  display: flex;
  width: 100%;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.email-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-back:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}

.email-view-actions {
  display: flex;
  gap: 0.5rem;
}

.email-view-actions .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.email-view-actions .btn-icon:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}

.email-view-actions .btn-secondary {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.email-view-actions .btn-secondary:hover {
  transform: translateY(-1px);
}

#email-view-content {
  padding: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: visible;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* סרגל פעולות מאוחד למעלה */
.email-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 1rem;
  flex-wrap: wrap;
}

.email-actions-right {
  flex-shrink: 0;
}

.email-actions-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.actions-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.15);
  margin: 0 0.25rem;
}

.quick-action-btn.back-btn {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.quick-action-btn.back-btn:hover {
  background: #1e293b;
}

.quick-action-btn.danger {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

.quick-action-btn.danger:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: #dc2626;
}

/* מבנה תוכן עם סרגל צד */
.email-content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
}

/* תוכן האימייל הראשי */
.email-main-content {
  min-width: 0;
  order: 1;
}

/* סרגל צד שמאלי */
.email-sidebar-info {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.email-sidebar-info .email-linked-info {
  margin-top: 0;
}

.btn-link-client,
.btn-create-task {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-link-client:hover,
.btn-create-task:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .email-content-layout {
    grid-template-columns: 1fr;
  }
  
  .email-sidebar-info {
    order: -1;
    position: static;
    max-height: none;
  }
}

.email-full-subject {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.email-full-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

.email-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.email-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.email-from-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.email-from-address {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.email-to-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.email-date-full {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.email-body {
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  font-size: 0.95rem;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  overflow-x: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.email-body img {
  max-width: 100%;
  height: auto;
}

.email-body table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

.email-attachments {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.email-attachments h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.email-attachments h4::before {
  content: '📎';
}

.attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s;
}

.attachment-item:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.04);
  transform: translateY(-1px);
}

.attachment-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.attachment-name {
  font-weight: 500;
  color: var(--text);
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.email-linked-info {
  margin-top: 2rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.email-linked-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.email-linked-info h4::before {
  content: '🔗';
}

.email-detected-id {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  color: var(--accent);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.email-client-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.email-client-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Email Quick Actions Strip */
.email-quick-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* Email Sort Select */
.email-sort-select {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
}

.email-sort-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Save email to client modal – elegant card */
#save-email-to-client-modal .modal-content {
  border: none;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
}

.save-email-modal-content {
  width: 440px;
  max-width: 95vw;
  padding: 1.75rem 2rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid rgba(0,0,0,0.06);
}

.save-email-modal-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.save-email-modal-title::before {
  content: '📎';
  font-size: 1.1rem;
}
.save-email-modal-title.assign-title::before { content: '📋'; }

.save-email-modal-hint {
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.save-email-modal-content .form-group {
  margin-bottom: 1.1rem;
}

.save-email-modal-content .form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary, #444);
}
.save-email-modal-content .form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.save-email-modal-content .form-group select:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.save-email-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.save-email-select:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.save-email-modal-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  gap: 0.75rem;
  display: flex;
  justify-content: flex-end;
}
.save-email-modal-content .form-actions .btn-secondary,
.form-actions .btn-secondary {
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  color: #334155;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.save-email-modal-content .form-actions .btn-secondary:hover,
.form-actions .btn-secondary:hover {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.25);
}

.email-settings-disconnect-wrap {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.btn-danger-outline {
  background: transparent;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-danger-outline:hover {
  background: rgba(185, 28, 28, 0.06);
  border-color: #b91c1c;
}

.email-settings-per-user-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Shared mailbox (תיבת דואר כללית) – distinct styling */
.nav-item-shared-mailbox {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
  border-right: 3px solid var(--accent, #6366f1);
}
.nav-item-shared-mailbox:hover { background: rgba(99, 102, 241, 0.12); }
.shared-mailbox-page {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.shared-mailbox-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
}
.shared-mailbox-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.35rem;
  color: #1e293b;
}
.shared-mailbox-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.shared-mailbox-layout {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 140px);
  min-height: 400px;
}
.shared-mailbox-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shared-mailbox-view-panel {
  flex: 1;
  min-width: 280px;
  border-left: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shared-mailbox-view-panel.hidden { display: none !important; }
.shared-mailbox-tabs {
  display: flex;
  gap: 0;
  padding: 0.75rem 1.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.shared-mailbox-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.shared-mailbox-tab:hover { color: #334155; }
.shared-mailbox-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.shared-mailbox-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.shared-mailbox-toolbar .search-input {
  flex: 1;
  max-width: 400px;
}
.shared-mailbox-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  margin: 0 1rem 1rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
}
.shared-mailbox-item {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  transition: background 0.15s;
  align-items: center;
}
.shared-mailbox-item:hover { background: rgba(99, 102, 241, 0.05); }
.shared-mailbox-item.unread { font-weight: 500; }
.shared-mailbox-sender { color: #475569; font-size: 0.9rem; }
.shared-mailbox-subject { color: #1e293b; }
.shared-mailbox-date { color: var(--text-muted); font-size: 0.85rem; }
.shared-mailbox-handled-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.shared-mailbox-handled-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.shared-mailbox-handled-badge.status-in_progress {
  background: #dbeafe;
  color: #1e40af;
}
.shared-mailbox-handled-badge.status-done {
  background: #dcfce7;
  color: #166534;
}
.shared-mailbox-handled-badge.status-handled {
  background: #e5e7eb;
  color: #374151;
}
.shared-mailbox-empty,
.shared-mailbox-no-access {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}
/* Shared email view – side panel (not modal) */
.shared-mailbox-view-panel {
  flex: 1;
  min-width: 320px;
  border-left: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shared-mailbox-view-panel.hidden { display: none !important; }
.shared-email-panel-header {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.shared-email-panel-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  transition: background 0.2s, color 0.2s;
}
.shared-email-panel-close:hover {
  background: rgba(0,0,0,0.1);
  color: #1e293b;
}
.shared-email-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.shared-email-panel-body .shared-mailbox-email-meta,
.shared-email-modal-body .shared-mailbox-email-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.shared-email-panel-body .shared-mailbox-email-meta p,
.shared-email-modal-body .shared-mailbox-email-meta p { margin: 0.2rem 0; }
.shared-email-panel-body .shared-email-subject,
.shared-email-modal-body .shared-email-subject {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: #1e293b;
}
.shared-email-panel-body .shared-mailbox-email-body,
.shared-email-modal-body .shared-mailbox-email-body {
  margin-top: 1rem;
  line-height: 1.6;
}
.shared-email-panel-actions,
.shared-email-modal-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}
.shared-action-btn {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: #fff;
  color: var(--accent, #6366f1);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.shared-action-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent);
}
.shared-action-btn.shared-action-save {
  border-color: rgba(34, 197, 94, 0.4);
  color: #16a34a;
}
.shared-action-btn.shared-action-save:hover {
  background: rgba(34, 197, 94, 0.08);
}
.shared-action-select {
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 0.9rem;
  background: #fff;
}

/* Settings landing */
.settings-landing {
  padding: 1.5rem 0;
}
.settings-landing h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}
.settings-landing-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.settings-card-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  padding: 1.25rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}
.settings-card-link .settings-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.settings-card-link .settings-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.settings-card-link .settings-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.settings-back-link {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.4rem 0;
  color: var(--accent);
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
}
.settings-back-link:hover {
  text-decoration: underline;
}

/* Compose Email Modal - Premium Design */
/* Gmail-style Compose Modal */
.compose-modal {
  width: 580px;
  max-width: 95vw;
  min-height: 450px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: fixed;
  bottom: 0;
  left: 80px;
  margin: 0;
  transform: none;
}

.compose-modal.maximized {
  width: 90vw;
  height: 90vh;
  max-width: 1000px;
  left: 50%;
  bottom: 50%;
  transform: translate(-50%, 50%);
  border-radius: 8px;
}

#compose-email-modal.modal {
  background: transparent;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0;
}

.compose-header {
  background: #404040;
  color: white;
  padding: 0 8px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

.compose-title {
  font-size: 14px;
  font-weight: 500;
  padding-right: 8px;
}

.compose-header-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.compose-header-actions button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.15s;
}

.compose-header-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.compose-close:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

#compose-email-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
}

.compose-recipients {
  border-bottom: 1px solid #e0e0e0;
}

.compose-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 42px;
  border-bottom: 1px solid #f0f0f0;
}

.compose-row:last-child {
  border-bottom: none;
}

.compose-label {
  width: 56px;
  font-size: 14px;
  color: #5f6368;
  flex-shrink: 0;
}

.compose-input {
  flex: 1;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  background: transparent;
  color: #202124;
  outline: none;
}

.compose-input::placeholder {
  color: #80868b;
}

.compose-input-wrap {
  flex: 1;
  position: relative;
}

#compose-client-email-select {
  display: none;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #202124;
  outline: none;
  cursor: pointer;
}

.compose-attachment-item--policy-doc {
  opacity: 0.95;
}

.compose-cc-toggle {
  font-size: 13px;
  color: #5f6368;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.compose-cc-toggle:hover {
  background: #f1f3f4;
  color: #202124;
}

.email-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.email-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.email-suggestion-item:hover,
.email-suggestion-item.selected {
  background: #f1f3f4;
}

.suggestion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: white;
  flex-shrink: 0;
}

.suggestion-avatar.user {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.suggestion-avatar.client {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-email {
  font-size: 12px;
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e8eaed;
  color: #5f6368;
}

.suggestion-type.user {
  background: #ede9fe;
  color: #7c3aed;
}

.suggestion-type.client {
  background: #d1fae5;
  color: #059669;
}

.compose-cc-row,
.compose-bcc-row {
  background: #fafafa;
}

.compose-body-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 150px;
}

.compose-body {
  flex: 1;
  border: none;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  color: #202124;
  outline: none;
  overflow-y: auto;
  min-height: 150px;
}

.compose-body:empty::before {
  content: attr(data-placeholder);
  color: #80868b;
  pointer-events: none;
}

.compose-body a {
  color: #1a73e8;
  text-decoration: underline;
}

/* Link Modal */
.link-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.link-modal {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.link-modal h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #202124;
}

.link-modal-field {
  margin-bottom: 1rem;
}

.link-modal-field label {
  display: block;
  font-size: 0.85rem;
  color: #5f6368;
  margin-bottom: 0.5rem;
}

.link-modal-field input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.link-modal-field input:focus {
  border-color: #1a73e8;
}

.link-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Emoji Picker */
.emoji-picker {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  width: 320px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 10000;
  position: fixed !important;
}

.emoji-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.emoji-item:hover {
  background: #f1f3f4;
}

.compose-attachments {
  padding: 8px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  max-height: 100px;
  overflow-y: auto;
}

#compose-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compose-attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dadce0;
  font-size: 13px;
  color: #3c4043;
}

.compose-attachment-item .remove-attachment {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
}

.compose-attachment-item .remove-attachment:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #202124;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.compose-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compose-footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.compose-send-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0b57d0;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.compose-send-btn:hover {
  background: #0842a0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.compose-send-btn:disabled {
  opacity: 0.85;
  cursor: wait;
}

.compose-send-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: compose-send-spin 0.6s linear infinite;
}

@keyframes compose-send-spin {
  to { transform: rotate(360deg); }
}

.send-arrow {
  font-size: 12px;
  margin-top: 1px;
}

.compose-format-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid #dadce0;
}

.compose-tool-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.compose-tool-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #202124;
}

.compose-tool-btn svg {
  width: 18px;
  height: 18px;
}

.compose-tool-sep {
  width: 1px;
  height: 20px;
  background: #dadce0;
  margin: 0 4px;
}

.compose-more-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.compose-more-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #202124;
}

/* Old classes - keep for backwards compatibility */
.compose-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-send {
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.compose-actions .btn-secondary {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
}

/* Email Empty State - Premium */
.email-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  height: 100%;
  min-height: 400px;
}

.email-empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.email-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.email-empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.email-empty-state.error {
  background: rgba(239, 68, 68, 0.05);
  border-radius: 16px;
  margin: 1rem;
}

.email-empty-state.error .email-empty-state-icon {
  color: #ef4444;
}

/* Email Item Enhancements */
.email-item.important {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.06) 0%, transparent 100%);
}

.email-item.important::before {
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
}

.important-badge {
  margin-left: 0.35rem;
}

/* Email Labels Display */
.email-labels-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.email-label {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Email Priority Indicators */
.email-priority-high {
  border-right: 3px solid #ef4444;
}

.email-priority-medium {
  border-right: 3px solid #f59e0b;
}

.email-priority-low {
  border-right: 3px solid #10b981;
}

/* Email Thread View */
.email-thread {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.email-thread h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.email-thread-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.email-thread-item:hover {
  background: #f1f5f9;
}

.email-thread-item .email-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.email-thread-content {
  flex: 1;
  min-width: 0;
}

.email-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.email-thread-from {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.email-thread-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.email-thread-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Email Animations */
.email-item {
  animation: slideIn 0.3s ease-out forwards;
  opacity: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.email-item:nth-child(1) { animation-delay: 0.02s; }
.email-item:nth-child(2) { animation-delay: 0.04s; }
.email-item:nth-child(3) { animation-delay: 0.06s; }
.email-item:nth-child(4) { animation-delay: 0.08s; }
.email-item:nth-child(5) { animation-delay: 0.1s; }
.email-item:nth-child(6) { animation-delay: 0.12s; }
.email-item:nth-child(7) { animation-delay: 0.14s; }
.email-item:nth-child(8) { animation-delay: 0.16s; }
.email-item:nth-child(9) { animation-delay: 0.18s; }
.email-item:nth-child(10) { animation-delay: 0.2s; }

/* Email Loading State */
.email-loading {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.email-skeleton {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Email Notification Badge */
.folder-count:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .email-app {
    grid-template-columns: 240px 1fr;
  }
  
  .email-view {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: white;
  }
}

@media (max-width: 768px) {
  .email-app {
    grid-template-columns: 1fr;
  }
  
  .email-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
  }
  
  .email-sidebar.open {
    transform: translateX(0);
  }
}

.quick-action-btn.primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  color: white;
}

.quick-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Email Settings */
.email-settings-header {
  margin-bottom: 2rem;
}

.email-settings-header h1 {
  margin-bottom: 0.5rem;
}

.email-settings-header p {
  color: var(--text-muted);
}

.email-settings-container {
  display: grid;
  gap: 1.5rem;
  max-width: 700px;
}

.form-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.help-text {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.help-text a {
  color: var(--accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.status-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-msg.success {
  background: #dcfce7;
  color: #166534;
}

.status-msg.error {
  background: #fee2e2;
  color: #dc2626;
}

/* Gmail Setup Guide */
.gmail-setup-guide {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 12px;
  border: 1px solid #bae6fd;
}

.gmail-setup-guide h4 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #0369a1;
}

.gmail-setup-guide ol {
  margin: 0;
  padding-right: 1.25rem;
  color: #334155;
}

.gmail-setup-guide li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.gmail-setup-guide ul {
  margin: 0.5rem 0;
  padding-right: 1rem;
}

.gmail-setup-guide ul li {
  margin-bottom: 0.25rem;
}

.gmail-setup-guide a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 500;
}

.gmail-setup-guide a:hover {
  text-decoration: underline;
}

.add-label-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.add-label-row input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.add-label-row input[type="color"] {
  width: 40px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.label-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.label-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.label-name {
  flex: 1;
}

.email-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.email-empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Insurance coverage check */
.insurance-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.insurance-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 8px;
}
.insurance-tab:hover { color: var(--text); background: var(--bg-hover); }
.insurance-tab.active { color: var(--accent); font-weight: 600; }
.insurance-tab-content.hidden { display: none; }
.add-coverage-link-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.add-coverage-link-row input { flex: 1; min-width: 120px; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; }
.coverage-links-list { margin-top: 1rem; }
.coverage-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.coverage-link-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.coverage-link-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.coverage-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: 0.3s;
}
.coverage-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  right: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.coverage-link-toggle input:checked + .coverage-toggle-slider {
  background: var(--accent);
}
.coverage-link-toggle input:checked + .coverage-toggle-slider::before {
  transform: translateX(-20px);
}
.coverage-link-item:has(.coverage-enabled-checkbox:not(:checked)) .coverage-link-name,
.coverage-link-item:has(.coverage-enabled-checkbox:not(:checked)) .coverage-link-url {
  opacity: 0.6;
}
.coverage-link-name { font-weight: 500; flex-shrink: 0; }
.coverage-link-url { flex: 1; font-size: 0.85rem; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-link-actions { display: flex; gap: 0.25rem; }

.claims-coverage-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--chat-shadow);
  max-width: 600px;
}
.claims-coverage-section h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.coverage-check-form { margin: 1rem 0; }
.coverage-check-form .form-row { margin-bottom: 1rem; }
.coverage-check-form label { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; color: var(--text-muted); }
.coverage-check-form input { width: 100%; max-width: 280px; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; }
.coverage-actions { margin-top: 1rem; }
.coverage-results { margin-top: 1.5rem; }
.coverage-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.coverage-result-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}
.coverage-result-card h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.coverage-result-card.yes { background: rgba(34, 197, 94, 0.1); border-color: #22c55e; }
.coverage-result-card.yes .coverage-status { color: #22c55e; font-weight: 600; }
.coverage-result-card.no { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; }
.coverage-result-card.no .coverage-status { color: #ef4444; font-weight: 600; }
.coverage-result-card.unknown { background: rgba(156, 163, 175, 0.1); }
.coverage-result-card.error .coverage-status { color: var(--text-muted); font-size: 0.85rem; }
.coverage-result-card .btn-view-site {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  background: var(--accent);
  color: var(--btn-on-accent);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.coverage-result-card .btn-view-site:hover,
.coverage-result-card .btn-view-newtab:hover { background: var(--accent-dim); }
.coverage-card-btns { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.75rem; }
.coverage-result-card .btn-view-newtab {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  background: var(--border);
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.coverage-result-card .btn-view-newtab:hover { background: var(--bg-hover); }
.coverage-playwright-hint {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(234, 179, 8, 0.15);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
}
.coverage-playwright-hint code {
  background: rgba(0,0,0,0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.coverage-view-modal-box {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  height: 85vh;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.coverage-view-close {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coverage-view-close:hover {
  background: rgba(0,0,0,0.7);
}
.coverage-view-content {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 2.5rem 1rem 1rem;
}
.coverage-view-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* בנק/סניף — רשימה נפתחת עם חיפוש */
.combo-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.combo-field .combo-search:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg-hover);
}
.combo-dropdown {
  position: absolute;
  z-index: 40;
  right: 0;
  left: 0;
  top: 100%;
  margin: 0.15rem 0 0;
  padding: 0.25rem 0;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--chat-shadow-soft);
}
.combo-dropdown li {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.combo-dropdown li:hover,
.combo-dropdown li:focus {
  background: var(--accent-soft);
}
.policy-documents-tab .policy-lien-send-wrap {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
#policy-send-mortgagee-email-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.policy-mail-tab .policy-mail-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  cursor: pointer;
  text-align: right;
}
.policy-mail-tab .policy-mail-row:hover {
  background: var(--bg-hover);
}
.policy-mail-tab .policy-mail-row.is-open {
  border-color: var(--accent);
}
.policy-mail-html-frame {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.5rem;
  background: #fff;
}
.text-muted {
  color: var(--text-muted);
  font-size: 0.92em;
}

/* טלפון / PBX */
.pbx-overview-wrap {
  margin-top: 1rem;
  max-width: 42rem;
}
.pbx-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  line-height: 1.65;
}
.pbx-overview-card p {
  margin: 0.4rem 0;
}
.pbx-overview-card--compact {
  margin-bottom: 0.75rem;
}
.pbx-mgmt-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.pbx-mgmt-table-wrap {
  margin-bottom: 0.5rem;
}
.pbx-recordings-files-toolbar {
  margin-bottom: 0.5rem;
}
.pbx-rec-file-path {
  font-size: 0.85em;
  word-break: break-all;
  max-width: 24rem;
}
.pbx-rec-path-hint {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  line-height: 1.25;
  max-width: 14rem;
  word-break: break-all;
}
.pbx-empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem !important;
}
.pbx-management-summary {
  margin-bottom: 0.5rem;
}
.pbx-demo-incoming-section {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}
.pbx-demo-incoming-section .pbx-mgmt-section-title {
  margin-top: 0;
}
.pbx-demo-badge-inline {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  vertical-align: middle;
}
.pbx-demo-incoming-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}
.pbx-demo-incoming-input {
  flex: 1 1 14rem;
  min-width: 12rem;
}
.pbx-demo-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(100, 149, 237, 0.22);
  color: var(--text);
  vertical-align: middle;
}
.pbx-live-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(52, 211, 153, 0.2);
  color: var(--text);
  vertical-align: middle;
}
.pbx-demo-incoming-status:empty {
  display: none;
}
.pbx-incoming-client-name {
  font-weight: 500;
  color: var(--text);
}
.pbx-ext-tile--ringing {
  animation: pbx-tile-ring 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(100, 149, 237, 0.4);
}
.pbx-ext-tile--dialing {
  animation: pbx-tile-ring 1.3s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.4);
}
.pbx-outgoing-internal-display {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.pbx-outgoing-internal-display.hidden {
  display: none;
}
@keyframes pbx-tile-ring {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}
.pbx-consent-block {
  margin-top: 1rem;
}
.pbx-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.pbx-trunk-form .pbx-form-control {
  min-width: 8rem;
}
.pbx-trunk-form .pbx-trunk-port {
  max-width: 5rem;
}
.pbx-form-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}
.pbx-form-control {
  min-width: 10rem;
}
.pbx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.pbx-toggle input {
  margin: 0;
}
.pbx-actions-cell {
  white-space: nowrap;
}
.pbx-consent-textarea {
  width: 100%;
  max-width: 48rem;
  margin-bottom: 0.5rem;
}
.pbx-consent-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pbx-recording-link {
  font-weight: 500;
}
/* נגן הקלטות — טאב טלפון, פרופיל לקוח, פוליסה (אותה הרשאה כמו GET .../recording) */
.pbx-recording-audio {
  display: block;
  width: 100%;
  max-width: 17rem;
  height: 2.25rem;
  margin: 0;
}
.pbx-history-row-line .pbx-hist-rec .pbx-recording-audio {
  max-width: 12rem;
}
.pbx-hist-rec .pbx-recording-audio {
  max-width: 100%;
}
/* תיק עובד — תיעוד שיחה כטקסט (בלי ניווט) */
.pbx-history-row-main--static {
  display: block;
  width: 100%;
  text-align: inherit;
  cursor: default;
  border: 1px solid var(--border-subtle, #e2e6ea);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: var(--surface-elevated, #fff);
}
.pbx-hist-filing-doc {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #444);
  line-height: 1.35;
}
.pbx-history-row-line .pbx-history-row-main--static {
  width: auto;
  flex: 1;
  min-width: 0;
}
/* תיק עובד — שלושה אזורים: קצה ימני (מטא), מרכז (הקלטה), קצה שמאלי (שלוחות) */
.pbx-history-row-line--employee-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 15rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1.25rem;
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-subtle, #e2e6ea);
  border-radius: 10px;
  background: var(--surface-elevated, #fff);
}
/* עמודה 1 ב-DOM = ב־RTL ימין — תוכן צמוד לקצה החיצוני */
.pbx-emp-call-col--meta {
  min-width: 0;
  justify-self: start;
  text-align: start;
  max-width: 100%;
}
/* עמודה 2 — רצועת שמע באמצע השורה */
.pbx-emp-call-col--audio {
  justify-self: center;
  width: 100%;
  max-width: 15rem;
}
/* עמודה 3 ב-DOM = ב־RTL שמאל — שלוחות צמודות לקצה החיצוני */
.pbx-emp-call-col--nums {
  justify-self: start;
  text-align: start;
}
.pbx-emp-call-col--nums .pbx-hist-num {
  font-size: 0.85rem;
  word-break: break-all;
  font-weight: 500;
}
.pbx-emp-call-col--audio-muted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  min-width: 0;
  text-align: center;
}
.pbx-recording-strip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--bg-hover, #f4f6f8);
  border: 1px solid var(--border, #e2e6ea);
  min-width: 0;
}
.pbx-recording-strip .pbx-recording-audio {
  max-width: 100%;
  width: 100%;
  height: 2.25rem;
}
.pbx-rec-download {
  align-self: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent, #2563eb);
  text-decoration: none;
}
.pbx-rec-download:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .pbx-history-row-line--employee-split {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.65rem;
  }
  .pbx-emp-call-col--meta {
    justify-self: stretch;
    text-align: start;
  }
  .pbx-emp-call-col--audio {
    justify-self: center;
    max-width: 100%;
  }
  .pbx-emp-call-col--nums {
    justify-self: stretch;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border-subtle, #e2e6ea);
  }
}
.report-table td .pbx-recording-audio {
  max-width: 14rem;
}
.activity-inline-audio {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 0.35rem;
}
.activity-inline-audio .pbx-recording-audio,
.policy-pbx-audio .pbx-recording-audio {
  max-width: 14rem;
}
.policy-pbx-audio {
  margin-top: 0.35rem;
}
.pbx-asterisk-gen-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* דשבורד ניהול מרכזייה */
.pbx-dashboard-page-heading {
  margin-bottom: 1rem;
}
.pbx-dashboard-settings-grid {
  margin-top: 0.5rem;
}

/* מדריך + מילון — ניהול מרכזייה */
.pbx-guide-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.pbx-guide-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-hover);
  padding: 0;
  overflow: hidden;
}
.pbx-guide-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.pbx-guide-details summary::-webkit-details-marker {
  display: none;
}
.pbx-guide-details summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.85em;
  opacity: 0.8;
}
.pbx-guide-details[open] summary::before {
  transform: rotate(-90deg);
}
.pbx-guide-inner {
  padding: 0 0.85rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
}
.pbx-guide-inner ol.pbx-guide-steps {
  margin: 0.35rem 0 0;
  padding-inline-start: 1.35rem;
}
.pbx-guide-inner li {
  margin-bottom: 0.45rem;
}
.pbx-glossary-grid {
  display: grid;
  gap: 0.5rem 1rem;
  margin: 0.35rem 0 0;
}
@media (min-width: 640px) {
  .pbx-glossary-grid {
    grid-template-columns: minmax(7rem, 10rem) 1fr;
  }
}
.pbx-glossary-term {
  font-weight: 600;
  color: var(--text);
}
.pbx-glossary-def {
  margin: 0;
}
.pbx-checklist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}
.pbx-checklist li {
  position: relative;
  padding-inline-start: 1.5rem;
  margin-bottom: 0.4rem;
}
.pbx-checklist li::before {
  content: "☐";
  position: absolute;
  inset-inline-start: 0;
  opacity: 0.65;
}

/* מוקד טלפון */
.pbx-phone-page {
  max-width: 1400px;
}
.pbx-phone-page-heading {
  margin-bottom: 1rem;
}
.pbx-workspace-status {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.pbx-ws-line .pbx-ws-ok {
  color: #16a34a;
}
.pbx-ws-line .pbx-ws-warn {
  color: #ca8a04;
}
.pbx-ws-line .pbx-ws-muted {
  opacity: 0.85;
}

.client-pbx-calls-tab .client-pbx-calls-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.pbx-webrtc-card {
  margin-bottom: 0.75rem;
}
.pbx-webrtc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.pbx-webrtc-incoming {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}
.pbx-webrtc-incoming.hidden {
  display: none;
}
.pbx-webrtc-incoming-label {
  font-weight: 600;
}
.pbx-webrtc-incoming-from {
  font-weight: 600;
  color: var(--text, inherit);
}
.pbx-webrtc-incoming-actions {
  display: flex;
  gap: 0.4rem;
  margin-inline-start: auto;
}
.pbx-webrtc-log {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin: 0.25rem 0 0;
  min-height: 1.2em;
  word-break: break-all;
}

.pbx-phone-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr minmax(240px, 320px);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .pbx-phone-layout {
    grid-template-columns: 1fr;
  }
}
.pbx-phone-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.pbx-phone-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}
.pbx-phone-panel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}
.pbx-phone-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}
.pbx-phone-history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pbx-phone-hist-tab {
  font: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
}
.pbx-phone-hist-tab--active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}
.pbx-phone-hist-tab-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pbx-history-manager-view-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pbx-history-view-as-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pbx-history-view-as {
  min-width: 11rem;
  max-width: 100%;
}
.pbx-hist-unid-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.pbx-ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.5rem;
}
.pbx-ext-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.65rem 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.pbx-ext-tile:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-card);
}
.pbx-ext-tile--idle {
  border-color: #22c55e44;
}
.pbx-ext-tile--busy {
  border-color: #f9731644;
  background: rgba(249, 115, 22, 0.08);
}
.pbx-ext-tile--off {
  opacity: 0.45;
  cursor: not-allowed;
}
.pbx-ext-num {
  font-size: 1.15rem;
  font-weight: 600;
}
.pbx-ext-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pbx-ext-pres {
  font-size: 0.72rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
}
.pbx-phone-card {
  margin-bottom: 1rem;
}
.pbx-phone-card:last-child {
  margin-bottom: 0;
}
.pbx-phone-card-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.pbx-incoming-display,
.pbx-active-display {
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
}
.pbx-incoming-placeholder,
.pbx-active-placeholder {
  color: var(--text-muted);
}
.pbx-my-ext {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}
.pbx-call-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.pbx-dial-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.pbx-dial-input {
  flex: 1;
  min-width: 12rem;
}
.pbx-dial-call-btn {
  white-space: nowrap;
}
.pbx-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  max-width: 220px;
}
.pbx-dial-extension-hints {
  margin-top: 0.5rem;
  margin-bottom: 0;
  max-width: 36rem;
}
.pbx-num-key {
  padding: 0.65rem;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font: inherit;
}
.pbx-num-key:hover {
  background: var(--bg-hover);
}
.pbx-phone-contacts-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.pbx-phone-contacts-search-row .pbx-phone-contacts-search {
  flex: 1;
  min-width: 0;
}
.pbx-phone-contacts-clear {
  flex-shrink: 0;
}
.pbx-phone-contacts-search {
  width: 100%;
  max-width: 100%;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.pbx-ivr-json-details {
  margin-top: 0.75rem;
}
.pbx-ivr-json-details summary {
  cursor: pointer;
  font-weight: 500;
}
.pbx-ivr-json-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.pbx-ivr-json-import-label {
  display: block;
  margin-top: 0.65rem;
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted, #666);
}
.pbx-ivr-json-import {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}
.pbx-ivr-json-preview {
  max-height: 240px;
  overflow: auto;
  padding: 0.65rem;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  white-space: pre-wrap;
  word-break: break-word;
}
.pbx-contact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pbx-contact-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
  font-size: 0.88rem;
  font: inherit;
}
.pbx-contact-chip:hover:not(:disabled) {
  border-color: var(--accent);
}
.pbx-contact-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pbx-history-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pbx-history-list--scroll {
  max-height: min(56vh, 560px);
}
.pbx-history-row-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}
/* שורה אחת: פרטי שיחה + נגן (ב־RTL הנגן משמאל) */
.pbx-history-row-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}
.pbx-history-row-line .pbx-history-row-main {
  flex: 1;
  min-width: 0;
  width: auto;
}
.pbx-history-row-line .pbx-hist-rec {
  flex-shrink: 0;
  margin-top: 0;
  align-self: center;
}
.pbx-history-row-line--unid .pbx-hist-unid-text {
  flex: 1;
  min-width: 0;
}
.pbx-history-row-main {
  text-align: inherit;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font: inherit;
}
.pbx-history-row-main:hover {
  border-color: var(--accent);
}
.pbx-hist-filing-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-inline-start: 0.35rem;
}
.pbx-hist-filing-btn {
  align-self: flex-start;
}
.pbx-filing-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.pbx-filing-box {
  max-width: 440px;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.pbx-filing-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.policy-claim-row-highlight {
  outline: 2px solid var(--accent);
  transition: outline 0.2s;
}
.pbx-history-row {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  font-size: 0.88rem;
}
.pbx-hist-meta {
  margin-bottom: 0.25rem;
}
.pbx-hist-time {
  font-weight: 500;
}
.pbx-hist-dir {
  color: var(--text-muted);
  margin-inline-start: 0.35rem;
}
.pbx-hist-num {
  font-size: 0.85rem;
  word-break: break-all;
}
.pbx-hist-peer {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.pbx-hist-client-wrap {
  margin-top: 0.25rem;
  font-size: 0.85rem;
}
.pbx-hist-rec {
  margin-top: 0;
}
