* {
  box-sizing: border-box;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 86px;
  background: linear-gradient(180deg, #003a99 0%, #0052cc 55%, #0b2f6a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 6px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-item {
  border: none;
  background: transparent;
  color: inherit;
  padding: 10px 6px;
  margin: 4px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  border-radius: 14px;
  position: relative;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

#logout-btn-sidebar {
  display: none !important;
}

.sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.14);
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}

.sidebar-item.active::before {
  background: #36b37e;
  box-shadow: 0 0 12px rgba(54, 179, 126, 0.6);
}

.sidebar-item:hover {
  transform: translateY(-1px);
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.1);
}

.sidebar-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
}

.sidebar-item.active .sidebar-icon {
  background: rgba(54, 179, 126, 0.22);
  border-color: rgba(54, 179, 126, 0.55);
  box-shadow: 0 0 12px rgba(54, 179, 126, 0.35);
}

.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.9);
}

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

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: #0052cc;
  color: #fff;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-center {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.mobile-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.95);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.mobile-nav-backdrop {
  display: none;
}

.wa-conn-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  min-height: 28px;
}

.wa-conn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.25);
}

.wa-conn-indicator.online .wa-conn-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.wa-conn-indicator.loading .wa-conn-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.wa-conn-label {
  color: rgba(255, 255, 255, 0.92);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-device-scope {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 3px;
}

.chat-scope-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

.chat-scope-btn.active {
  background: rgba(255, 255, 255, 0.92);
  color: #0b3a86;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

@media (max-width: 640px) {
  .chat-device-scope {
    padding: 2px;
  }
  .chat-scope-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

.user-badge {
  max-width: 340px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.12);
}

.profile-menu {
  position: relative;
}

.profile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.profile-caret {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.profile-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 6px;
  z-index: 50;
}

.profile-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: rgba(2, 6, 23, 0.06);
}

.profile-menu-item.danger {
  color: #b42318;
}

.profile-menu-sep {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 6px 0;
}

.mobile-actions {
  display: none;
  position: relative;
}

.mobile-actions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.mobile-actions-btn svg {
  width: 22px;
  height: 22px;
  fill: rgba(255, 255, 255, 0.95);
}

.mobile-actions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 6px;
  z-index: 60;
}

.mobile-actions-dropdown.from-fab {
  position: fixed;
  right: 16px;
  bottom: 84px;
  top: auto;
  z-index: 90;
}

.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 95;
}

.mobile-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 52vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 40px rgba(2, 6, 23, 0.22);
  transform: translateY(110%);
  transition: transform 0.2s ease;
  z-index: 96;
  overflow: hidden;
}

.mobile-sheet.open {
  transform: translateY(0);
}

.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.96);
}

.mobile-sheet-title {
  font-weight: 900;
  color: #0f172a;
  font-size: 14px;
}

.mobile-sheet-close {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mobile-sheet-close svg {
  width: 18px;
  height: 18px;
  stroke: #0f172a;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.mobile-sheet-body {
  padding: 10px 12px 16px;
  overflow: auto;
  max-height: calc(52vh - 56px);
}

.mobile-sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  margin-bottom: 10px;
  font-weight: 800;
  color: #0f172a;
}

.mobile-sheet-item:last-child {
  margin-bottom: 0;
}

.mobile-sheet-item.danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.25);
}

.mobile-sheet-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot, #64748b);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
  flex: 0 0 auto;
}

.mobile-sheet-label {
  flex: 1 1 auto;
  text-align: left;
}

.mobile-sheet-check {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.mobile-fab {
  position: fixed;
  right: 16px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: none;
  background: #36b37e;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 36px rgba(9, 30, 66, 0.28);
  cursor: pointer;
  z-index: 85;
}

.mobile-fab svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.top-bar h1 {
  margin: 0;
  font-size: 18px;
}

.primary-btn {
  background-color: #36b37e;
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.primary-btn:hover {
  background-color: #2e9b6b;
}

.secondary-btn {
  background-color: #2684ff;
}

.secondary-btn:hover {
  background-color: #1c6fd1;
}

.danger-btn {
  background-color: #ef4444;
}

.danger-btn:hover {
  background-color: #dc2626;
}

.board-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board-tab {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.board-tab::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--board-group-color, #2684ff);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.board-tab.active {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(226, 239, 255, 0.96)
  );
  color: #0b2f6a;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 20px rgba(0, 82, 204, 0.2);
}

.board-tab.active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: var(--board-group-color, #2684ff);
}

.board-groups-modal {
  width: 740px;
  max-width: calc(100vw - 40px);
}

.columns-modal {
  width: 740px;
  max-width: calc(100vw - 40px);
}

.board-groups-modal .modal-body,
.columns-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.board-groups-create-row {
  display: grid;
  grid-template-columns: 1fr 56px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.board-groups-create-row .modal-text-input {
  flex: 1;
  width: 100%;
  margin: 0;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.board-groups-create-row input[type='color'] {
  width: 56px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  justify-self: end;
}

.board-groups-create-row .primary-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 900;
}

.board-groups-flags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.board-groups-flag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #374151;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
}

.board-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-group-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.board-group-row--board {
  grid-template-columns: 18px 1fr 56px auto;
  grid-template-areas: 'swatch name color actions';
  align-items: center;
}

.board-group-row--column {
  grid-template-columns: 18px 1fr 56px;
  grid-template-areas:
    'swatch name color'
    'flags flags actions';
  align-items: center;
}

.board-group-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  grid-area: swatch;
}

.board-group-name {
  grid-area: name;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  font-size: 14px;
  box-sizing: border-box;
  height: 44px;
}

.board-group-color {
  grid-area: color;
  width: 56px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  justify-self: end;
}

.board-group-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  grid-area: actions;
}

.board-group-flags {
  grid-area: flags;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.board-groups-modal .modal-hint,
.columns-modal .modal-hint {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  color: #334155;
}

@media (max-width: 720px) {
  .board-groups-modal,
  .columns-modal {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }

  .board-groups-create-row {
    grid-template-columns: 1fr 56px;
    grid-template-areas:
      'name name'
      'flags flags'
      'color add';
  }

  .board-groups-create-row .modal-text-input {
    grid-area: name;
  }

  .board-groups-create-row input[type='color'] {
    grid-area: color;
    justify-self: start;
  }

  .board-groups-create-row .primary-btn {
    grid-area: add;
    width: 100%;
  }

  .board-groups-create-row .board-groups-flags {
    grid-area: flags;
  }

  .board-group-row--board {
    grid-template-columns: 18px 1fr 56px;
    grid-template-areas:
      'swatch name color'
      'actions actions actions';
  }

  .board-group-row--column {
    grid-template-columns: 18px 1fr 56px;
    grid-template-areas:
      'swatch name color'
      'flags flags flags'
      'actions actions actions';
  }

  .board-group-row-actions {
    justify-content: stretch;
  }

  .board-group-row-actions .small-btn {
    flex: 1 1 auto;
  }
}

.layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

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

.board-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
}

#view-leads.layout {
  flex-direction: column;
}

#view-chat.layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 720px) {
  .board-layout {
    flex-direction: column;
  }

  .mobile-leads-switcher {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(6px);
    justify-content: flex-start;
  }

  .mobile-leads-switcher-btn {
    flex: 1 1 auto;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 900;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    width: 100%;
    justify-content: space-between;
  }

  .mobile-leads-switcher-btn::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tab-color, #64748b);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
    flex: 0 0 auto;
  }

  .mobile-leads-switcher-btn.active {
    background: #1d75e8;
    border-color: rgba(29, 117, 232, 0.65);
    color: #fff;
  }

  .mobile-leads-switcher-btn .mobile-dropdown-caret {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
  }

  .mobile-leads-switcher-btn .mobile-dropdown-caret svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .lead-pool {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .lead-pool-list {
    max-height: none;
  }

  .kanban {
    width: 100%;
  }

  .top-bar {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
      'nav brand actions'
      'tabs tabs tabs';
    align-items: center;
    gap: 10px;
  }

  .top-bar-left {
    display: contents;
  }

  .top-bar-right {
    grid-area: actions;
    justify-self: end;
  }

  .brand-center {
    grid-area: brand;
    justify-content: center;
    min-width: 0;
  }

  .brand-center h1 {
    font-size: 17px;
  }

  #mobile-nav-btn {
    grid-area: nav;
  }

  .board-tabs {
    grid-area: tabs;
    flex-basis: 100%;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .board-tabs::-webkit-scrollbar {
    display: none;
  }

  .board-tab {
    white-space: nowrap;
  }

  .board-tab {
    padding: 7px 12px;
    font-size: 12px;
  }

	#view-leads .leads-header {
	  display: grid !important;
	  grid-template-columns: 1fr auto auto auto auto !important;
	  grid-template-areas:
	    'filter newchat sync import label'
	    'search search search search search' !important;
	  gap: 10px !important;
	  align-items: center !important;
	}

  #view-leads .leads-search-input {
    grid-area: search !important;
    max-width: none !important;
    width: 100% !important;
  }

  #view-leads .leads-labels-btn {
    grid-area: label !important;
    white-space: nowrap !important;
  }

  #view-leads .leads-newchat-btn {
    grid-area: newchat !important;
  }

	#view-leads .leads-sync-btn {
	  grid-area: sync !important;
	}

	#view-leads .leads-import-btn {
	  grid-area: import !important;
	}

  #view-leads .mobile-leads-switcher {
    grid-area: filter !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .mobile-leads-switcher-btn {
    box-shadow: 0 10px 20px rgba(9, 30, 66, 0.18);
  }

  .mobile-switcher-selected {
    font-weight: 900;
    opacity: 0.9;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #add-board-group-btn,
  #add-column-btn,
  #open-bulk-send-modal-btn {
    display: none;
  }

  .profile-menu {
    display: none;
  }

  .mobile-actions {
    display: inline-flex;
  }

  .mobile-fab {
    display: grid;
  }

  #logout-btn-sidebar {
    display: none !important;
  }

  #user-badge {
    display: none !important;
  }

  .mobile-nav-btn {
    display: inline-flex;
  }

  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 65;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    transform: translateX(-110%);
    transition: transform 0.18s ease;
    z-index: 70;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  #view-chat.layout {
    flex-direction: column;
  }

  #view-chat .chat-list {
    width: 100%;
    max-width: none;
    border-right: none;
    border-radius: 0;
  }

  #view-chat .chat-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    max-width: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  body.mobile-chat-open #view-chat .chat-list {
    display: none;
  }

  body.mobile-chat-open #view-chat .chat-panel {
    display: flex;
  }

  body.mobile-chat-open .top-bar,
  body.mobile-chat-open .sidebar {
    display: none;
  }

  body.mobile-chat-open .mobile-nav-backdrop {
    display: none;
  }

  body.mobile-chat-open .app-main {
    flex: 1;
  }

  .chat-list-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .chat-list-actions::-webkit-scrollbar {
    display: none;
  }

  .chat-list-action-btn {
    flex: 0 0 auto;
  }

  .chat-list-action-btn.chat-action-whatsapp,
  .chat-list-action-btn.chat-action-popup {
    display: inline-flex !important;
  }
}

#view-lists.layout {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

#view-notes.layout {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.notes-title {
  font-weight: 800;
  font-size: 18px;
  color: #0f172a;
}

.notes-hint {
  color: #475569;
  font-size: 13px;
  margin-top: 2px;
}

.notes-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  min-height: 0;
}

.notes-sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 20px rgba(9, 30, 66, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  overflow: auto;
}

.notes-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.notes-item.active {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.18);
}

.notes-item-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 14px;
}

.notes-item-preview {
  color: #334155;
  font-size: 12.5px;
  margin-top: 6px;
  line-height: 1.35;
}

.notes-item-meta {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.notes-item-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.notes-main {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 20px rgba(9, 30, 66, 0.1);
  min-height: 0;
}

.notes-detail-row {
  margin-bottom: 10px;
}

.notes-title-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.notes-body-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 13.5px;
  resize: vertical;
  min-height: 220px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.notes-detail-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .notes-layout {
    grid-template-columns: 1fr;
  }
}

.lead-pool {
  width: 360px;
  min-width: 300px;
  max-width: 380px;
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 20px rgba(9, 30, 66, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.lead-pool-title {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.lead-pool-title-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  margin-right: 8px;
  vertical-align: -4px;
  background: rgba(29, 117, 232, 0.22);
  border: 1px solid rgba(29, 117, 232, 0.3);
  color: #1d75e8;
}

.lead-pool-title-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-pool-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.leads-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.leads-search-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  background: #eef3fb;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.leads-labels-btn {
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(0, 82, 204, 0.2);
}

.leads-newchat-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.leads-newchat-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leads-sync-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(54, 179, 126, 0.35);
  background: rgba(54, 179, 126, 0.16);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.leads-sync-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leads-import-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.leads-import-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leads-view-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.leads-view-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leads-view-toggle-btn.is-list {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.35);
}

.leads-list-view {
  width: 100%;
}

.leads-list-filters {
  display: flex;
  gap: 10px;
  padding: 6px 2px 10px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leads-list-filters::-webkit-scrollbar {
  height: 6px;
}

.leads-list-filter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.leads-list-filter-btn .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot, #94a3b8);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.leads-list-filter-btn.active {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.leads-list-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ui-preferences {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.ui-preferences-title {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 10px;
}

.ui-preferences-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ui-preferences-label {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.ui-preferences-select {
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
}

.kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
}

.kanban-mobile-tabs {
  display: none;
}

@media (max-width: 720px) {
  .kanban {
    flex-direction: column;
    overflow-x: hidden;
  }

  .kanban-mobile-tabs {
    display: none;
    gap: 8px;
    padding: 8px 2px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(6px);
  }

  .kanban-mobile-tabs::-webkit-scrollbar {
    display: none;
  }

  .kanban-mobile-tab {
    flex: 0 0 auto;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  }

  .kanban-mobile-tab::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tab-color, #2684ff);
    margin-right: 8px;
    vertical-align: -1px;
  }

  .kanban-column {
    max-width: none;
    width: 100%;
  }
}

.kanban-hidden-bar {
  min-width: 220px;
  max-width: 320px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  padding: 10px;
}

.kanban-hidden-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.kanban-hidden-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kanban-hidden-pill {
  border: 1px solid #d0d0d0;
  background: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.kanban-hidden-pill:hover {
  background: #f1f5f9;
}

.kanban-column {
  background-color: #eef2f7;
  border-radius: 12px;
  padding: 10px;
  min-width: 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  --column-color: #2684ff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.kanban-column.is-collapsed {
  min-width: 72px;
  max-width: 72px;
  padding: 10px 6px;
}

.kanban-column.is-collapsed .kanban-column-body {
  display: none;
}

.kanban-column.is-collapsed .kanban-column-header {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  padding: 8px 0;
}

.kanban-column.is-collapsed .kanban-column-header-main {
  align-items: center;
}

.kanban-column.is-collapsed .kanban-column-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  text-align: center;
}

.kanban-column.is-collapsed .kanban-column-actions {
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.kanban-column.has-color .kanban-column-header {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  box-shadow: inset 4px 0 0 var(--column-color);
}

.kanban-column-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kanban-column-title {
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-title-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: #0052cc;
}

.kanban-column-title-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kanban-column-actions .icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: rgba(15, 23, 42, 0.85);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kanban-column-actions .icon-btn:hover svg {
  stroke: rgba(15, 23, 42, 1);
}

.kanban-column-count {
  font-size: 13px;
  color: #475569;
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.kanban-column-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 16px;
  line-height: 1;
  border-radius: 8px;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.kanban-column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.kanban-column-body.drop-target {
  outline: 2px dashed #0052cc;
}

.kanban-column-header.is-draggable {
  cursor: grab;
}

.kanban-column-header.is-draggable:active {
  cursor: grabbing;
}

.kanban-column-header.drop-target {
  outline: 2px dashed #0ea5e9;
  outline-offset: 2px;
}

.kanban-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 16px rgba(9, 30, 66, 0.12);
  cursor: grab;
}

.kanban-card.has-label {
  --label-color: #4caf50;
}

.kanban-card.has-label.label-style-left {
  box-shadow: inset 4px 0 0 var(--label-color), 0 1px 1px rgba(9, 30, 66, 0.25);
}

.kanban-card.has-label.label-style-right {
  box-shadow: inset -4px 0 0 var(--label-color), 0 1px 1px rgba(9, 30, 66, 0.25);
}

.kanban-card.has-label.label-style-top {
  box-shadow: inset 0 4px 0 var(--label-color), 0 1px 1px rgba(9, 30, 66, 0.25);
}

.kanban-card.has-label.label-style-bottom {
  box-shadow: inset 0 -4px 0 var(--label-color), 0 1px 1px rgba(9, 30, 66, 0.25);
}

.kanban-card.has-label.label-style-arrow .kanban-card-title::before {
  content: '➤';
  color: var(--label-color);
  margin-right: 6px;
}

.kanban-card-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 0;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kanban-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.kanban-card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.kanban-card-time {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.kanban-card-assignee {
  --pill: #2563eb;
  max-width: 160px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.kanban-card-assignee::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--pill);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.worth-chip {
  --dot: #16a34a;
}

.kanban-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.kanban-card-avatar.is-empty {
  opacity: 0.4;
}

.kanban-card-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-subtitle {
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.kanban-card-phone {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-message {
  font-size: 14px;
  color: #1f2937;
}

.lead-note-preview {
  font-size: 12px;
  color: #92400e;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.kanban-card-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.kanban-card-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
  gap: 6px;
}

.kanban-card-actions .chat-list-action-btn {
  padding: 6px 9px;
  font-size: 14px;
  border-radius: 9px;
}

.chat-list-action-btn {
  --btn-bg: rgba(29, 117, 232, 0.18);
  --btn-border: rgba(29, 117, 232, 0.28);
  --btn-fg: #0b2f6a;
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-fg);
  font-weight: 700;
}

.chat-list-action-btn:hover {
  filter: brightness(0.96);
}

.chat-list-action-btn.has-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.chat-list-action-btn.has-svg-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--btn-fg);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-list-action-btn.chat-action-notes {
  --btn-bg: rgba(245, 158, 11, 0.22);
  --btn-border: rgba(245, 158, 11, 0.32);
  --btn-fg: #7a4b00;
}

.chat-list-action-btn.chat-action-schedule {
  --btn-bg: rgba(56, 189, 248, 0.22);
  --btn-border: rgba(56, 189, 248, 0.34);
  --btn-fg: #075985;
}

.chat-list-action-btn.chat-action-assign {
  --btn-bg: rgba(99, 102, 241, 0.2);
  --btn-border: rgba(99, 102, 241, 0.32);
  --btn-fg: #312e81;
}

.chat-list-action-btn.chat-action-contact {
  --btn-bg: rgba(244, 114, 182, 0.22);
  --btn-border: rgba(244, 114, 182, 0.34);
  --btn-fg: #831843;
}

.chat-list-action-btn.chat-action-contact.has-contact {
  --btn-bg: rgba(244, 114, 182, 0.3);
  --btn-border: rgba(244, 114, 182, 0.46);
}

.chat-list-action-btn.chat-action-label {
  --btn-bg: rgba(16, 185, 129, 0.2);
  --btn-border: rgba(16, 185, 129, 0.32);
  --btn-fg: #065f46;
}

.chat-list-action-btn.chat-action-google-info {
  --btn-bg: rgba(29, 117, 232, 0.22);
  --btn-border: rgba(29, 117, 232, 0.34);
  --btn-fg: #0b2f6a;
}

.chat-list-action-btn.chat-action-crm {
  --btn-bg: rgba(54, 179, 126, 0.22);
  --btn-border: rgba(54, 179, 126, 0.34);
  --btn-fg: #0f5132;
}

.chat-list-action-btn.chat-action-move {
  --btn-bg: rgba(148, 163, 184, 0.26);
  --btn-border: rgba(148, 163, 184, 0.42);
  --btn-fg: #0f172a;
}

.chat-list-action-btn.chat-action-money {
  --btn-bg: rgba(234, 179, 8, 0.22);
  --btn-border: rgba(234, 179, 8, 0.34);
  --btn-fg: #7a4b00;
}

/* Mobile: collapse lead action buttons under a chevron */
@media (max-width: 720px) {
  .kanban-card-actions .chat-action-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .kanban-card-actions .chat-action-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #0f172a;
    fill: none;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Lead pool: hide actions row unless expanded (toggle lives in header). */
  #lead-pool-list .chat-list-item .chat-list-actions {
    display: none;
  }

  #lead-pool-list .chat-list-item.actions-open .chat-list-actions {
    display: flex;
  }

  .kanban-card .kanban-card-actions .chat-list-action-btn:not(.chat-action-toggle) {
    display: none;
  }

  .kanban-card.actions-open .kanban-card-actions .chat-list-action-btn {
    display: inline-flex;
  }

  #lead-pool-list .chat-list-item.actions-open .chat-list-header-right .chat-action-toggle svg {
    transform: rotate(90deg);
  }

  .kanban-card.actions-open .chat-action-toggle svg {
    transform: rotate(90deg);
  }
}

/* Desktop: no "More actions" chevron needed */
@media (min-width: 721px) {
  .kanban-card-actions .chat-action-toggle,
  .chat-list-header-right .chat-action-toggle {
    display: none !important;
  }
}

.footer {
  padding: 8px 16px;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

#status-text.ok {
  color: #36b37e;
}

#status-text.error {
  color: #de350b;
}

.chat-panel {
  flex: 0 0 320px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.25);
  border: 1px solid #ddd;
}

.chat-panel.hidden {
  display: none;
}

.chat-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: #0f172a;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.api-doc-block {
  background: #0f172a;
  color: #e5e7eb;
  padding: 10px 12px;
  font-size: 12px;
  border-radius: 14px;
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.section-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #172b4d;
}

.api-keys-section {
  margin-bottom: 12px;
}

.api-keys-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-keys-create-row .modal-text-input {
  flex: 1;
}

.api-keys-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-key-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.api-key-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.api-key-name {
  font-size: 13px;
  font-weight: 700;
  color: #172b4d;
}

.api-key-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.api-key-value {
  display: inline-block;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;
}

.api-modal {
  width: 820px;
  max-width: calc(100vw - 24px);
}

.api-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.api-modal .api-keys-section,
.api-modal .api-docs-section {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.api-modal .api-keys-create-row {
  gap: 10px;
}

.api-modal .api-keys-create-row .modal-text-input {
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

.api-modal #api-key-create-btn {
  height: 44px;
  border-radius: 14px;
  font-weight: 900;
}

.api-modal .api-keys-list {
  margin-top: 12px;
}

.api-modal .modal-hint {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  color: #334155;
}

@media (max-width: 720px) {
  .api-modal .api-keys-create-row {
    flex-direction: column;
    align-items: stretch;
  }

  .api-key-row {
    flex-direction: column;
    align-items: stretch;
  }

  .api-key-actions {
    justify-content: flex-start;
  }

  .api-key-actions .small-btn {
    flex: 1 1 auto;
  }
}

.api-key-last-used {
  font-size: 11px;
  color: #6b7280;
}

.api-key-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-btn {
  border: 1px solid #d0d0d0;
  background: #f7f7f7;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.1;
}

.small-btn:hover {
  background: #efefef;
}

.small-btn.danger {
  border-color: #f3b1a2;
  background: #fff1ee;
  color: #b42318;
}

.small-btn.danger:hover {
  background: #ffe7e1;
}

.modal-field-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.modal-text-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.modal-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
}

.notes-modal {
  width: 720px;
  max-width: calc(100vw - 40px);
}

.notes-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  padding: 14px 14px;
  gap: 12px;
}

.notes-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: rgba(15, 23, 42, 0.06) 0px 10px 22px 0px;
}

.notes-create-row .primary-btn {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 12px;
  height: 44px;
}

.notes-create-row .modal-textarea {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.16);
  min-height: 86px;
  font-size: 14px;
  line-height: 1.35;
}

.notes-create-row .modal-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.notes-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 2px 2px;
}

.contact-modal {
  width: 720px;
  max-width: calc(100vw - 40px);
}

.contact-modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  padding: 14px;
  box-shadow: rgba(15, 23, 42, 0.06) 0px 10px 22px 0px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #0f172a;
  min-width: 0;
}

.contact-field span {
  font-weight: 800;
  color: #0f172a;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  box-sizing: border-box;
}

.contact-field textarea {
  resize: vertical;
  min-height: 90px;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.contact-field-wide {
  grid-column: 1 / -1;
}

.contact-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.note-item {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  box-shadow: rgba(15, 23, 42, 0.06) 0px 10px 22px 0px;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  color: #6b7280;
  font-size: 12px;
}

.note-actions {
  display: flex;
  gap: 6px;
}

.note-item .modal-textarea {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.35;
  min-height: 84px;
}

.note-item .modal-textarea:not([readonly]) {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.note-item .small-btn {
  border-radius: 999px;
  padding: 6px 10px;
}

@media (max-width: 720px) {
  .notes-modal {
    width: 100%;
    max-width: calc(100vw - 18px);
  }

  .notes-create-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .notes-create-row .primary-btn {
    width: 100%;
  }
}

.modal-hint {
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

.chat-popup-box {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 372px;
  max-height: 82vh;
  background-color: #fff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-shadow: rgba(15, 23, 42, 0.25) 0px 18px 48px 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #0b5ed7, #084298);
  color: #fff;
  gap: 10px;
}

.chat-popup-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-popup-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-popup-actions .modal-close-btn {
  text-decoration: none;
}

.chat-popup-header .modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 800;
}

.chat-popup-title-group .chat-device-label {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.chat-popup-header .modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.chat-popup-header .chat-title {
  color: #fff;
}

.chat-popup-header .chat-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

.chat-popup-box .chat-messages {
  padding: 12px;
  background:
    radial-gradient(circle at 12px 12px, rgba(15, 23, 42, 0.04), transparent 45%),
    radial-gradient(circle at 56px 48px, rgba(15, 23, 42, 0.035), transparent 40%),
    #f8fafc;
}

.chat-popup-box .chat-message {
  max-width: 86%;
  margin-bottom: 8px;
  padding: 10px 12px 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: rgba(15, 23, 42, 0.06) 0px 10px 22px 0px;
  position: relative;
  word-break: break-word;
}

.chat-popup-box .chat-message.from-me {
  margin-left: auto;
  background: linear-gradient(180deg, #e6f0ff, #dbeafe);
  border-color: rgba(37, 99, 235, 0.18);
  border-top-right-radius: 6px;
}

.chat-popup-box .chat-message.from-them {
  margin-right: auto;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  border-top-left-radius: 6px;
}

.chat-popup-box .chat-message-text {
  display: block;
  white-space: pre-wrap;
}

.chat-message-time {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
  text-align: right;
  line-height: 1.1;
}

.chat-popup-box .chat-image,
.chat-popup-box .chat-video {
  border-radius: 14px;
}

.chat-popup-box .chat-input {
  padding: 10px 10px;
  gap: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
}

.chat-popup-box .chat-input input {
  border-radius: 999px;
  padding: 10px 12px;
  border-color: rgba(15, 23, 42, 0.16);
}

.chat-popup-box .chat-input input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.chat-popup-box .chat-emoji-btn,
.chat-popup-box .chat-send-image-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-popup-box .chat-emoji-btn svg,
.chat-popup-box .chat-send-image-btn svg {
  width: 18px;
  height: 18px;
  stroke: #0f172a;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-popup-box .chat-send-btn {
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .chat-popup-box {
    left: 9px;
    right: 9px;
    bottom: 9px;
    width: auto;
    max-height: calc(100vh - 18px);
  }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #ddd;
  background-color: #f4f5f7;
}

.chat-header-main {
  display: flex;
  flex-direction: column;
}

.chat-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.chat-header-btn {
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  background-color: transparent;
  color: #555;
  text-decoration: none;
}

.chat-header-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.chat-header-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.chat-title {
  font-weight: 600;
  font-size: 14px;
}

.chat-subtitle {
  font-size: 11px;
  color: #555;
}

.chat-device-label {
  font-size: 11px;
  font-weight: 700;
  color: #0b2f6a;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-device-label::before {
  content: 'Device';
  font-weight: 800;
  color: #475569;
}

.chat-close-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  background-color: #f9fafc;
}

.chat-load-more {
  width: 100%;
  margin: 0 0 6px 0;
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: #eef1f7;
  color: #333;
  cursor: pointer;
}

.chat-load-more:hover {
  background-color: #dde3f0;
}

.chat-messages::-webkit-scrollbar,
.chat-list::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track {
  background-color: #e0e4ea;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb {
  background-color: #9fb3c8;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover {
  background-color: #7a8ea8;
}

.chat-message {
  max-width: 85%;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.chat-message.from-me {
  margin-left: auto;
  background-color: #e6f4ff;
  border: 1px solid #b3d4ff;
}

.chat-message.from-them {
  margin-right: auto;
  background-color: #ffffff;
  border: 1px solid #ddd;
}

.chat-message-meta {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #777;
  text-align: right;
}

.chat-image {
  max-width: 180px;
  max-height: 180px;
  display: block;
  border-radius: 4px;
  margin-bottom: 4px;
  object-fit: cover;
}

.chat-video {
  max-width: 220px;
  max-height: 180px;
  display: block;
  border-radius: 4px;
  margin-bottom: 4px;
}

.chat-audio {
  width: 220px;
  display: block;
  margin-bottom: 4px;
}

.chat-doc-link {
  font-size: 12px;
  color: #0052cc;
  text-decoration: underline;
  word-break: break-all;
  display: inline-block;
  margin-bottom: 4px;
}

.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 6px;
  gap: 6px;
  align-items: center;
}

.chat-input input {
  flex: 1;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.chat-input button {
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  background-color: #0052cc;
  color: #fff;
}

.chat-input button:hover {
  background-color: #0747a6;
}

.chat-media-btn {
  background-color: transparent;
  color: #555;
  padding: 4px 5px;
  font-size: 18px;
}

.chat-emoji-btn,
.chat-image-btn {
  background-color: transparent;
  color: #555;
  padding: 4px 6px;
  font-size: 18px;
}

.chat-emoji-btn:hover,
.chat-image-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.chat-send-btn {
  background-color: #0052cc;
  color: #fff;
  min-width: 38px;
}

.chat-send-btn:hover {
  background-color: #0747a6;
}

.emoji-picker {
  position: absolute;
  bottom: 60px;
  right: 24px;
  z-index: 20;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(9, 30, 66, 0.25);
  border: 1px solid #ddd;
  padding: 6px;
  max-width: 260px;
  max-height: 220px;
  overflow-y: auto;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-picker button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.2;
  padding: 2px;
}

.chat-media-menu {
  position: fixed;
  z-index: 80;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(9, 30, 66, 0.25);
  border: 1px solid #ddd;
  padding: 4px 0;
  min-width: 180px;
}

.chat-emoji-menu {
  position: fixed;
  z-index: 80;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(9, 30, 66, 0.25);
  border: 1px solid #ddd;
  padding: 6px;
  max-width: 260px;
  max-height: 220px;
  overflow-y: auto;
}

.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.chat-emoji-grid button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.2;
  padding: 2px;
}

.chat-media-menu button {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.chat-media-menu button:hover {
  background-color: rgba(9, 30, 66, 0.06);
}

.hidden {
  display: none !important;
}

.login-page {
  background: radial-gradient(circle at 20% 10%, #0b63ce, #071b3b 55%, #050a18);
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  padding: 22px 22px 18px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.login-subtitle {
  margin: 0 0 14px;
  color: #475569;
  font-size: 13px;
}

.login-error {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
}

.login-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  outline: none;
}

.login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-btn {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.login-btn:hover {
  background: #1d4ed8;
}

.login-btn.secondary {
  border-color: #0f172a;
  background: #0f172a;
}

.login-btn.secondary:hover {
  background: #0b1220;
}

.login-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 14px 0;
}

.bootstrap-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.chat-list {
  width: 340px;
  max-width: 360px;
  background-color: #f4f5f7;
  border-right: 1px solid #ddd;
  padding: 8px 8px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.chat-list-new {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.chat-list-new input {
  flex: 1;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 11px;
}

.chat-list-new button {
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  background-color: #0052cc;
  color: #fff;
}

.chat-list-new button:hover {
  background-color: #0747a6;
}

.chat-list-search {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-list-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  background: #f1f5f9;
}

.chat-show-hidden {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}

.chat-show-hidden input {
  width: 16px;
  height: 16px;
}

.chat-list-item.is-hidden {
  opacity: 0.55;
}

.chat-list-action-btn.chat-action-hide {
  --btn-bg: rgba(148, 163, 184, 0.26);
  --btn-border: rgba(148, 163, 184, 0.42);
  --btn-fg: #0f172a;
}

.chat-list-action-btn.chat-action-unhide {
  --btn-bg: rgba(16, 185, 129, 0.2);
  --btn-border: rgba(16, 185, 129, 0.32);
  --btn-fg: #065f46;
}

.chat-list-sync {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-list-sync button {
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  background-color: #36b37e;
  color: #fff;
}

.chat-list-sync button:hover {
  background-color: #2e9b6b;
}

.chat-list-sync-bottom {
  margin-bottom: 8px;
}

.chat-list-sync-bottom button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  background-color: #36b37e;
  color: #fff;
}

.chat-list-sync-bottom button:hover {
  background-color: #2e9b6b;
}

.chat-list-item {
  border: none;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  background-color: #fff;
  box-shadow: 0 8px 16px rgba(9, 30, 66, 0.12);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}

.chat-list-item.active {
  border: 1px solid #0052cc;
  box-shadow: 0 0 0 1px rgba(0, 82, 204, 0.2);
}

.chat-list-item.has-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background-color: var(--chat-label-color, #4caf50);
}

.chat-list-item.has-label.label-style-right::before {
  left: auto;
  right: 0;
}

.chat-list-item.has-label.label-style-top::before {
  left: 6px;
  right: 6px;
  top: 0;
  bottom: auto;
  width: auto;
  height: 4px;
}

.chat-list-item.has-label.label-style-bottom::before {
  left: 6px;
  right: 6px;
  top: auto;
  bottom: 0;
  width: auto;
  height: 4px;
}

.chat-list-item.has-label.label-style-arrow::before {
  display: none;
}

.chat-list-item.has-label.label-style-arrow .chat-list-title::before {
  content: '➤';
  color: var(--chat-label-color, #4caf50);
  margin-right: 6px;
}

.chat-list-title {
  font-size: 15px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.chat-list-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.lead-id-chip,
.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.14);
  color: #334155;
  font-weight: 900;
  white-space: nowrap;
  max-width: 100%;
}

.lead-id-chip {
  color: #475569;
}

.device-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}

.chat-list-subtitle {
  font-size: 13px;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.chat-list-notes {
  font-size: 12px;
  color: #92400e;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.chat-list-assigned {
  font-size: 12px;
  color: #0f172a;
  margin-top: 2px;
  opacity: 0.85;
}

.chat-list-meta {
  font-size: 12px;
  color: #64748b;
  margin-left: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 64px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #cfd8dc;
  flex-shrink: 0;
}

.chat-list-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
}

.chat-list-header-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.chat-list-header-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-list-header-right .chat-action-toggle {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
}

.chat-list-header-right .chat-action-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
}

.chat-list-action-btn {
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  cursor: pointer;
  background-color: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-fg);
  font-weight: 700;
}

.chat-list-action-btn:hover {
  filter: brightness(0.96);
}

.chat-list-action-btn.chat-action-notes {
  /* variables set earlier */
}

.chat-list-action-btn.chat-action-schedule {
  /* variables set earlier */
}

.chat-list-action-btn.chat-action-whatsapp {
  display: none !important;
}

.chat-list-action-btn.chat-action-popup {
  display: none !important;
}

.chat-list-action-btn.chat-action-money {
  /* variables set earlier */
}

/* Labels modal */
.labels-modal {
  max-width: 820px;
}

.label-manager-filter-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.label-manager-filter {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d5d9e0;
  font-size: 14px;
}

.label-manager-create {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 8px 10px;
  background: #fff;
}

.label-manager-create > summary {
  cursor: pointer;
  font-weight: 900;
  color: #0f172a;
  list-style: none;
  margin: 0;
  padding: 10px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-manager-create > summary::-webkit-details-marker {
  display: none;
}

.label-manager-create > summary::marker {
  content: '';
}

.label-manager-create > summary::after {
  content: '';
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  opacity: 0.9;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.label-manager-create[open] > summary::after {
  transform: rotate(180deg);
}

.label-picker-modal {
  width: 420px;
  max-width: calc(100vw - 40px);
}

.label-manager-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.label-manager-name-new,
.label-manager-keywords-new {
  width: 100%;
}

.label-manager-form input[type='text'] {
  flex: 1 1 220px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
}

.label-manager-form .label-crm-id {
  flex: 0 0 140px;
}

.label-manager-form .label-crm-tags {
  flex: 1 1 260px;
}

.label-manager-form input[type='color'] {
  width: 40px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
}

.label-manager-form select {
  flex: 0 0 160px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  background: #fff;
}

.label-manager-add {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.label-manager-add:hover {
  filter: brightness(0.97);
}

.label-manager-advanced {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.label-manager-advanced > summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f172a;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-manager-advanced > summary::-webkit-details-marker {
  display: none;
}

.label-manager-advanced > summary::after {
  content: '';
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  opacity: 0.75;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.label-manager-advanced[open] > summary::after {
  transform: rotate(180deg);
}

.label-manager-advanced-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.label-manager-advanced-fields input[type='text'] {
  width: 100%;
  min-width: 0;
}

.label-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  overflow: auto;
  padding-bottom: 6px;
}

.label-manager-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #eee;
  flex-wrap: wrap;
}

.label-manager-row-collapsible {
  padding: 0;
  border-radius: 16px;
  border-color: rgba(15, 23, 42, 0.1);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.label-manager-row-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  cursor: pointer;
  font-weight: 900;
  color: #0f172a;
  list-style: none;
  margin: 0;
  background: #f8fafc;
}

.label-manager-row-summary::-webkit-details-marker {
  display: none;
}

.label-manager-row-summary::marker {
  content: '';
}

  .label-manager-row-summary::after {
  content: '';
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  opacity: 0.75;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.label-manager-row-collapsible[open] .label-manager-row-summary::after {
  transform: rotate(180deg);
}

.label-manager-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.label-manager-row-body {
  padding: 12px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.label-manager-color {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.label-manager-name {
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 160px;
  flex: 1 1 180px;
}

.label-manager-row input[type='text'] {
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  flex: 1 1 240px;
  min-width: 240px;
}

.label-manager-row .label-crm-id {
  flex: 0 0 140px;
  min-width: 140px;
}

.label-manager-row .label-crm-tags {
  flex: 1 1 260px;
  min-width: 260px;
}

.label-manager-row input[type='color'] {
  width: 40px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
}

.label-manager-row select {
  padding: 4px 6px;
  font-size: 13px;
  flex: 0 0 160px;
}

.label-manager-save {
  border: 1px solid #d0d0d0;
  background: #f7f7f7;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.label-manager-save:hover {
  background: #efefef;
}

.label-manager-delete {
  border: 1px solid #f3b1a2;
  background: #fff1ee;
  color: #b42318;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.label-manager-empty {
  font-size: 13px;
  color: #555;
}

@media (max-width: 720px) {
  .labels-modal {
    min-width: auto;
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    height: calc(100vh - 18px);
    max-height: calc(100vh - 18px);
    border-radius: 18px;
  }

  .labels-modal .modal-body {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 12px 14px 12px;
    background: #f1f5f9;
  }

  .label-manager-filter-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    padding-bottom: 8px;
    margin: 0 2px;
  }

  .label-manager-create {
    margin-top: 8px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .label-manager-create > summary {
    padding: 12px 14px;
    border-radius: 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    letter-spacing: 0.2px;
    margin: 0 2px;
  }

  .label-manager-filter {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
  }

  .label-manager-form {
    display: grid;
    grid-template-columns: 1fr 56px;
    grid-template-areas:
      'name name'
      'style color'
      'keywords keywords'
      'advanced advanced'
      'add add';
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    margin: 10px 2px 0 2px;
  }

  .label-manager-name-new {
    grid-area: name;
  }

  .label-manager-style-select {
    grid-area: style;
  }

  .label-manager-color-input {
    grid-area: color;
    width: 56px;
    height: 44px;
    justify-self: end;
  }

  .label-manager-keywords-new {
    grid-area: keywords;
  }

  .label-manager-form .label-manager-advanced {
    grid-area: advanced;
  }

  .label-manager-add {
    grid-area: add;
  }

  .label-manager-form input[type='text'],
  .label-manager-form select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
    height: 44px;
  }

  .label-manager-form input[type='color'] {
    width: 56px;
    height: 44px;
  }

  .label-manager-add {
    width: 100%;
    padding: 12px 12px;
    font-size: 14px;
  }

  .label-manager-advanced-fields {
    grid-template-columns: 1fr;
  }

  .label-manager-row-collapsible {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    margin: 0 2px;
    display: block;
  }

  .label-manager-row-collapsible > summary {
    width: 100%;
  }

  .label-manager-row-collapsible > .label-manager-row-body {
    width: 100%;
  }

  .label-manager-row-body {
    padding: 12px 12px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .label-manager-row-body > * {
    min-width: 0;
  }

  .label-manager-row-body input[type='text'],
  .label-manager-row-body select {
    width: 100%;
    display: block;
    height: 44px;
    box-sizing: border-box;
    flex: 0 0 auto;
  }

  .label-manager-row-body .label-manager-name {
    flex: 0 0 auto;
  }

  .label-manager-style-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
  }

  .label-manager-style-row .label-manager-style-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .label-manager-style-row .label-manager-color-input {
    flex: 0 0 44px;
  }

  .label-manager-row-summary {
    padding: 12px 14px;
    border-radius: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    letter-spacing: 0.2px;
    position: relative;
    padding-right: 48px;
    width: 100%;
  }

  .label-manager-row-title {
    flex: 1 1 auto;
  }

  .label-manager-row-summary::after {
    position: absolute;
    right: 14px;
    top: 50%;
    margin-left: 0;
    transform: translateY(-50%) rotate(0deg);
  }

  .label-manager-row-collapsible[open] .label-manager-row-summary::after {
    transform: translateY(-50%) rotate(180deg);
  }

  .label-manager-name,
  .label-manager-row input[type='text'],
  .label-manager-row select {
    width: 100%;
    min-width: 0;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
    height: 44px;
  }

  .label-manager-row input[type='color'] {
    width: 44px;
    height: 44px;
  }

  .label-manager-row-body .label-manager-name {
    grid-area: name;
    grid-column: 1 / -1;
  }

  .label-manager-row-body .label-manager-style-select {
    grid-area: style;
    grid-column: 1 / 2;
  }

  .label-manager-row-body .label-manager-color-input {
    grid-area: color;
    justify-self: end;
    grid-column: 2 / 3;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .label-manager-advanced > summary {
    position: relative;
    padding-right: 44px;
  }

  .label-manager-advanced > summary::after {
    position: absolute;
    right: 12px;
    top: 50%;
    margin-left: 0;
    transform: translateY(-50%) rotate(0deg);
  }

  .label-manager-advanced[open] > summary::after {
    transform: translateY(-50%) rotate(180deg);
  }

  .label-manager-row-body .label-manager-keywords-edit {
    grid-area: keywords;
    grid-column: 1 / -1;
  }

  .label-manager-row-body .label-manager-advanced {
    grid-area: advanced;
    grid-column: 1 / -1;
  }

  .label-manager-row-body .label-manager-save {
    grid-area: save;
    grid-column: 1 / -1;
  }

  .label-manager-row-body .label-manager-delete {
    grid-area: delete;
    grid-column: 1 / -1;
  }

  .label-manager-save,
  .label-manager-delete {
    font-size: 14px;
    padding: 12px 12px;
    border-radius: 14px;
    width: 100%;
  }
}

.mobile-sheet-body .leads-search-input {
  width: 100%;
  margin: 0 0 10px 0;
  max-width: none;
}

/* Scheduler modal */
.schedule-modal {
  width: 560px;
  max-width: calc(100vw - 24px);
}

.schedule-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px 14px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  font-size: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: rgba(15, 23, 42, 0.06) 0px 10px 22px 0px;
}

.schedule-label {
  font-weight: 600;
  color: #0f172a;
}

.schedule-target-summary {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background-color: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  min-width: 0;
}

.schedule-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
}

.schedule-datetime {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
}

.schedule-textarea {
  width: 100%;
  resize: vertical;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
  min-height: 96px;
}

.schedule-template-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.schedule-template-picker .schedule-select {
  flex: 1;
}

.schedule-select:focus,
.schedule-datetime:focus,
.schedule-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.schedule-modal .modal-footer .primary-btn,
.schedule-modal .modal-footer .secondary-btn {
  border-radius: 12px;
  padding: 10px 14px;
}

@media (max-width: 720px) {
  .schedule-body {
    padding: 12px 12px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .schedule-template-picker {
    grid-template-columns: 1fr;
  }

  .schedule-template-picker .secondary-btn {
    width: 100%;
    border-radius: 12px;
  }
}

.alarm-modal {
  width: 560px;
  max-width: calc(100vw - 40px);
}

.alarm-message {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: pre-wrap;
}

.alarm-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.chat-list-empty {
  font-size: 12px;
  color: #555;
}

.chat-list-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.settings-panel {
  padding: 12px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.15);
}

.settings-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 12px 0;
}

.wa-settings {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  margin-bottom: 14px;
}

.wa-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-settings-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.wa-settings-actions {
  display: flex;
  gap: 8px;
}

.wa-device-select {
  min-width: 160px;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
}

.top-device-picker {
  display: none;
}

@media (min-width: 721px) {
  .top-device-picker {
    display: block;
  }
}

.wa-devices-modal {
  width: 720px;
  max-width: calc(100vw - 24px);
}

.wa-devices-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.wa-devices-add-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  font-size: 14px;
}

.wa-devices-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-device-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.wa-device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.wa-device-id {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.22);
  flex-shrink: 0;
}

.wa-device-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.wa-device-row input[type='text'] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  min-width: 0;
}

.wa-device-row input[type='color'].wa-device-color {
  width: 44px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
}

.wa-device-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wa-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.wa-device-row .wa-device-default {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.wa-device-row .small-btn {
  padding: 8px 10px;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .wa-devices-add-row {
    grid-template-columns: 1fr;
  }
  .wa-device-row {
    padding: 12px;
  }
  .wa-device-header {
    flex-direction: column;
    align-items: stretch;
  }
  .wa-device-meta {
    justify-content: space-between;
  }
  .wa-device-actions {
    justify-content: stretch;
  }
  .wa-device-actions .small-btn {
    flex: 1 1 auto;
  }
}

.wa-status-text {
  margin-top: 8px;
  font-size: 12px;
  color: #334155;
}

.wa-qr-img {
  margin-top: 10px;
  width: 220px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}

.wa-qr-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #475569;
}

.wa-sync-settings {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 10px;
}

.wa-sync-row {
  display: grid;
  gap: 6px;
}

.wa-sync-label {
  font-size: 12px;
  color: #475569;
}

.wa-sync-input {
  width: 260px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
}

.wa-sync-toggle {
  width: 44px;
  height: 24px;
  accent-color: #2563eb;
}

.wa-sync-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wa-sync-hint {
  font-size: 12px;
  color: #64748b;
}

.modal-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 10px 0;
}

.users-help {
  font-size: 12px;
  color: #475569;
  margin-bottom: 10px;
}

.users-add-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1.2fr 0.9fr auto;
  gap: 8px;
  align-items: center;
}

.users-add-boards {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.users-add-boards-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
}

.users-add-boards-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.users-board-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
}

.users-board-chip input[type='checkbox'] {
  margin: 0;
}

.users-board-chip::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.users-add-row input,
.users-add-row select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
}

.tenants-add-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1.2fr 0.9fr auto;
  gap: 8px;
  align-items: center;
}

.tenants-add-row input {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
}

.users-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.9fr 0.9fr 1.1fr 1.1fr 0.7fr 0.7fr 1.2fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.users-inbox-select {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
  background: #fff;
}

.users-inbox-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.users-boards {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
}

.users-boards-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  list-style: none;
}

.users-boards-summary::-webkit-details-marker {
  display: none;
}

.users-boards-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tenants-row {
  grid-template-columns: 1.3fr 0.8fr 0.7fr 0.9fr 1.2fr auto;
}

.users-row input,
.users-row select {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
  background: #fff;
}

.users-row .users-enabled {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}

.users-row .users-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.users-row .users-leads-count {
  justify-self: start;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(29, 117, 232, 0.14);
  border: 1px solid rgba(29, 117, 232, 0.22);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .users-add-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .tenants-add-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .users-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .users-row .users-actions {
    justify-content: flex-start;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  overscroll-behavior: contain;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

body.modal-open {
  padding-right: var(--scrollbar-compensation, 0px);
}

.modal-box {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(9, 30, 66, 0.35);
  min-width: 480px;
  max-width: 840px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

@media (max-width: 720px) {
  .modal-backdrop {
    padding: 9px;
  }

  .modal-box {
    min-width: 0;
    max-width: calc(100vw - 18px);
  }
}

.move-lead-modal {
  width: 520px;
  max-width: calc(100vw - 40px);
}

.template-send-modal {
  width: 720px;
  max-width: calc(100vw - 24px);
}

.move-lead-subtitle {
  font-size: 13px;
  color: #475569;
}

.move-lead-list {
  display: grid;
  gap: 8px;
}

.move-lead-item {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-left: 6px solid var(--move-color, #64748b);
  background: #fff;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.move-lead-item:hover {
  background: #f8fafc;
}

.modal-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.modal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .modal-grid-3 {
    grid-template-columns: 1fr;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-footer {
  padding: 10px 16px 14px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #ddd;
}

.google-info-modal {
  max-width: 720px;
}

.crm-modal {
  width: 760px;
  max-width: calc(100vw - 24px);
}

.crm-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.crm-modal .modal-checkbox-row {
  margin-bottom: 0;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.crm-modal .checkbox-label {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 8px 10px;
  border-radius: 999px;
}

.crm-modal .checkbox-label input[type='checkbox'] {
  accent-color: #2563eb;
}

.crm-modal .modal-field-label {
  margin-top: 10px;
}

.crm-modal .modal-text-input {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

.crm-modal .modal-grid-3 {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.crm-modal .section-title {
  margin-top: 16px;
}

.crm-modal .api-doc-block {
  max-height: 240px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #0b1220;
  color: #e2e8f0;
}

@media (max-width: 720px) {
  .crm-modal .modal-checkbox-row {
    padding: 12px 10px;
  }

  .crm-modal .checkbox-label {
    width: 100%;
    justify-content: flex-start;
  }

  .crm-modal .api-doc-block {
    max-height: 34vh;
  }
}

.webhook-modal {
  width: 760px;
  max-width: calc(100vw - 24px);
}

.webhook-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.webhook-modal .modal-field-label {
  margin-top: 8px;
}

.webhook-modal .modal-text-input {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

.webhook-modal .modal-hint {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  color: #334155;
}

.webhook-modal .section-title {
  margin-top: 14px;
}

.webhook-modal .api-doc-block {
  max-height: 280px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #0b1220;
  color: #e2e8f0;
}

@media (max-width: 720px) {
  .webhook-modal .api-doc-block {
    max-height: 34vh;
  }
}

.google-info-header {
  font-size: 13px;
  color: #555;
}

.google-info-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.google-info-result-item {
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}

.google-info-result-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a0dab;
  text-decoration: none;
}

.google-info-result-title:hover {
  text-decoration: underline;
}

.google-info-result-url {
  font-size: 11px;
  color: #006621;
  word-break: break-all;
}

.google-info-result-snippet {
  font-size: 12px;
  color: #444;
  margin-top: 2px;
}

.auto-section {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background-color: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.auto-section-summary {
  list-style: none;
  padding: 12px 12px;
  cursor: pointer;
  font-weight: 900;
  color: #0f172a;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.auto-section-summary::-webkit-details-marker {
  display: none;
}

.auto-section-summary::marker {
  content: '';
}

.auto-section-summary::after {
  content: 'v';
  float: right;
  opacity: 0.7;
}

.auto-section[open] > .auto-section-summary::after {
  content: '^';
}

.auto-section-body {
  padding: 12px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.auto-activation-summary {
  font-size: 12px;
  color: #555;
}

.auto-activation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.auto-activation-card {
  background-color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.auto-activation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-activation-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.auto-activation-card-title-icon {
  font-size: 16px;
}

.auto-activation-card-delete {
  border: none;
  background: #fff1f2;
  cursor: pointer;
  font-size: 14px;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 12px;
  padding: 6px 10px;
}

.auto-activation-card-body {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-activation-card-body textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
}

.auto-activation-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.auto-activation-keyword-pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  background-color: rgba(29, 117, 232, 0.12);
  color: #0b2f6a;
  border: 1px solid rgba(29, 117, 232, 0.22);
  font-weight: 800;
}

.auto-activation-keyword-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.auto-activation-keyword-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
}

.auto-activation-menu {
  position: fixed;
  background-color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.12);
  z-index: 60;
  padding: 4px 0;
  min-width: 220px;
}

.auto-activation-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.auto-activation-menu button:hover {
  background-color: #f4f5f7;
}

.auto-actions-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.auto-actions-empty {
  font-size: 12px;
  color: #555;
}

.auto-activation-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.auto-add-activation-btn {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 14px;
  font-weight: 900;
}

.auto-actions-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 10px;
  padding-bottom: 2px;
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0),
    rgba(248, 250, 252, 0.92) 32%,
    rgba(248, 250, 252, 1)
  );
}

.auto-add-action-btn {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 14px;
  font-weight: 900;
}

.auto-rules-body {
  font-size: 12px;
}

.auto-rules-note {
  margin: 0;
  color: #555;
}

.auto-rules-group {
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.auto-rules-group-title {
  font-weight: 900;
  margin-bottom: 8px;
  color: #0f172a;
}

.auto-rules-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.auto-rules-option input[type='radio'] {
  margin: 0;
}

.auto-action-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.auto-action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-action-card-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.auto-action-card-delete {
  border: none;
  background: #fff1f2;
  cursor: pointer;
  font-size: 14px;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 12px;
  padding: 6px 10px;
}

.auto-action-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auto-action-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
  box-sizing: border-box;
}

.auto-action-typing-row,
.auto-action-wait-row {
  display: grid;
  grid-template-columns: 1fr 92px auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

.auto-action-typing-row span:first-child,
.auto-action-wait-row span:first-child {
  font-weight: 800;
  color: #0f172a;
  font-size: 12px;
}

.auto-action-typing-row span:last-child,
.auto-action-wait-row span:last-child {
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

.auto-action-typing-seconds,
.auto-action-wait-seconds,
.auto-action-wait-random-seconds {
  width: 92px;
  height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  box-sizing: border-box;
}

.auto-action-card-body textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
  box-sizing: border-box;
}

.auto-action-media-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-action-media-row select {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
}

.auto-action-media-url {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  font-size: 13px;
}

.auto-action-media-picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #555;
}

.auto-action-menu {
  position: fixed;
  background-color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.12);
  z-index: 60;
  padding: 4px 0;
  min-width: 180px;
}

.auto-action-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.auto-action-menu button:hover {
  background-color: #f4f5f7;
}

.auto-action-move-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.auto-action-move-row select {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  font-size: 13px;
}

.auto-action-image-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-action-image-input {
  font-size: 12px;
}

.auto-action-image-preview {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}

.auto-action-single-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.auto-action-image-caption {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .auto-actions-container {
    max-height: 58vh;
  }

  .auto-action-typing-row,
  .auto-action-wait-row {
    grid-template-columns: 1fr 110px;
    grid-template-rows: auto auto;
  }

  .auto-action-typing-row span:first-child,
  .auto-action-wait-row span:first-child {
    grid-column: 1 / -1;
  }

  .auto-action-typing-row input,
  .auto-action-wait-row input {
    grid-column: 1;
  }

  .auto-action-typing-row span:last-child,
  .auto-action-wait-row span:last-child {
    grid-column: 2;
    justify-self: start;
  }

  .auto-action-move-row {
    grid-template-columns: 1fr;
  }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.auto-service-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-service-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #f9fafc;
}

.auto-service-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auto-service-name {
  font-weight: 600;
  font-size: 13px;
}

.auto-service-meta {
  font-size: 11px;
  color: #555;
}

.auto-service-preview {
  font-size: 11px;
  color: #333;
}

.auto-service-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.auto-service-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.auto-service-delete {
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  background-color: #de350b;
  color: #fff;
}

.auto-service-delete:hover {
  background-color: #b02a07;
}

.auto-service-empty {
  font-size: 12px;
  color: #555;
}

.auto-list-header {
  margin-bottom: 8px;
}

.auto-list-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.auto-service-list-modal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.auto-service-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  min-height: 0;
}

.auto-service-modal #auto-service-editor-view.modal-body {
  background: #f8fafc;
  overflow-y: auto;
}

.auto-service-modal #auto-service-editor-view .auto-actions-container {
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 72px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.auto-service-modal #auto-service-name-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

@media (max-width: 720px) {
  .auto-service-modal {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }

  .auto-service-modal .modal-footer .primary-btn,
  .auto-service-modal .modal-footer .secondary-btn,
  .auto-service-modal #auto-service-open-create-btn {
    width: 100%;
  }
}

.auto-service-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.auto-service-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-service-card-name {
  font-weight: 900;
  font-size: 14px;
  color: #0f172a;
}

.auto-service-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.auto-service-icon-btn {
  border: none;
  background: #f8fafc;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.auto-service-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #555;
}

.auto-service-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-footer-inline {
  padding: 10px 0 0 0;
  border-top: none;
  justify-content: center;
}

.bulk-send-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
}

.bulk-send-modal {
  width: 760px;
  max-width: calc(100vw - 24px);
}

.bulk-send-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.bulk-send-label {
  font-weight: 600;
  color: #0f172a;
}

.bulk-send-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  box-sizing: border-box;
}

.bulk-send-type {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bulk-send-type label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  color: #0f172a;
}

.bulk-send-type input[type='radio'] {
  margin: 0;
  accent-color: #2563eb;
}

.bulk-send-type input[type='radio']:checked + span {
  color: #0b2f6a;
}

.bulk-send-textarea {
  width: 100%;
  resize: vertical;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
  box-sizing: border-box;
  min-height: 92px;
}

.bulk-send-image-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bulk-send-image-input {
  font-size: 12px;
}

.bulk-send-image-preview {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}

.bulk-send-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-send-repeat-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

@media (max-width: 720px) {
  .bulk-send-repeat-grid {
    grid-template-columns: 1fr;
  }
}

.bulk-send-number {
  width: 78px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}

.bulk-send-hint {
  font-size: 13px;
  color: #334155;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
}

.bulk-send-section-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  margin-top: 6px;
  padding: 2px 2px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.bulk-send-template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bulk-send-template-preview {
  grid-column: 1 / -1;
  border: 1px solid #d0d7e2;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  white-space: pre-wrap;
  color: #172b4d;
  min-height: 64px;
}

.bulk-send-template-grid button {
  grid-column: 1 / -1;
  justify-self: flex-end;
}

.bulk-send-template-option {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  user-select: none;
}

.bulk-send-campaign-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
  user-select: none;
}

.bulk-campaigns-modal {
  width: 860px;
  max-width: calc(100vw - 24px);
}

.bulk-campaigns-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
  max-height: 70vh;
  overflow: auto;
}

.bulk-campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-campaign-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.bulk-campaign-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #0f172a;
}

.bulk-campaign-meta strong {
  font-size: 13px;
}

.bulk-campaign-sub {
  color: #475569;
}

.bulk-campaign-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bulk-campaign-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.bulk-campaign-banner.hidden {
  display: none;
}

.bulk-campaign-banner-title {
  font-weight: 800;
  font-size: 13px;
}

.bulk-campaign-banner-sub {
  font-size: 12px;
  color: #334155;
  margin-top: 2px;
}

.bulk-campaign-banner-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-campaign-banner-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .bulk-send-body {
    padding: 12px;
  }

  .bulk-send-template-grid {
    grid-template-columns: 1fr;
  }
}

.import-leads-modal {
  width: 720px;
  max-width: calc(100vw - 24px);
}

.import-leads-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
}

.import-leads-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.import-leads-label {
  font-weight: 700;
  color: #0f172a;
}

.import-leads-select,
.import-leads-file {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  box-sizing: border-box;
}

.import-leads-hint {
  font-size: 12px;
  color: #334155;
}

.import-leads-sample {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
}

.import-leads-sample-link {
  font-size: 12px;
  font-weight: 800;
  color: #1d75e8;
  text-decoration: none;
}

.import-leads-sample-link:hover {
  text-decoration: underline;
}

.import-leads-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .import-leads-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.templates-modal {
  width: 980px;
  max-width: calc(100vw - 24px);
}

.templates-body {
  display: flex;
  gap: 12px;
  min-height: 360px;
  max-height: 78vh;
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px;
  border-radius: 0 0 16px 16px;
}

.templates-sidebar {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.templates-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.templates-small-btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
  background: #f8fafc;
  color: #0f172a;
}

.templates-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  flex: 1;
  padding-right: 2px;
}

.templates-category-item {
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}

.templates-category-item.active {
  background: rgba(29, 117, 232, 0.12);
  border-color: rgba(29, 117, 232, 0.35);
}

.templates-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.templates-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.templates-selected-category {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
}

.templates-item {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.templates-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.templates-item-name {
  font-weight: 900;
  color: #0f172a;
}

.templates-item-preview {
  font-size: 12px;
  color: #334155;
  white-space: pre-line;
}

.templates-item-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.templates-item-btn {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  background-color: #f8fafc;
  font-weight: 800;
}

.templates-main-header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.templates-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  font-size: 14px;
  background: #fff;
}

.templates-search:focus {
  outline: none;
  border-color: rgba(29, 117, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(29, 117, 232, 0.18);
}

.templates-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.templates-category-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.templates-category-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.templates-category-count {
  font-size: 11px;
  color: #42526e;
  background: rgba(29, 117, 232, 0.12);
  border: 1px solid rgba(29, 117, 232, 0.25);
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 22px;
  text-align: center;
}

@media (max-width: 720px) {
  .templates-body {
    flex-direction: column;
    max-height: calc(100vh - 110px);
  }

  .templates-sidebar {
    width: 100%;
    overflow: visible;
  }

  .templates-category-list {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .templates-category-list::-webkit-scrollbar {
    display: none;
  }

  .templates-category-item {
    min-width: max-content;
    border-radius: 999px;
  }

  .templates-main-header {
    flex-direction: column;
    align-items: stretch;
  }

  #templates-add-template-btn {
    width: 100%;
  }
}

.templates-category-menu-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #42526e;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.templates-category-menu-btn:hover {
  background: rgba(9, 30, 66, 0.06);
}

.templates-category-menu {
  position: fixed;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(9, 30, 66, 0.25);
  border: 1px solid #d0d7e2;
  z-index: 80;
  padding: 4px 0;
  min-width: 160px;
}

.templates-category-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.templates-category-menu button:hover {
  background-color: #f4f5f7;
}

.lists-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.lists-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lists-title {
  font-size: 18px;
  font-weight: 700;
  color: #172b4d;
}

.lists-hint {
  font-size: 12px;
  color: #5e6c84;
}

.lists-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lists-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.lists-sidebar {
  width: 260px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.lists-sidebar .templates-category-list {
  gap: 6px;
}

.lists-sidebar .templates-category-item {
  background: #fff;
  border: 1px solid #e6e8ec;
}

.lists-sidebar .templates-category-item.active {
  border-color: #4c9aff;
  background: #e9f2ff;
}

.lists-sidebar .templates-category-item {
  border-radius: 12px;
}

.lists-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

@media (max-width: 720px) {
  #view-lists.layout {
    padding: 10px;
  }

  .lists-header {
    flex-direction: column;
    align-items: stretch;
  }

  .lists-header-right {
    justify-content: flex-start;
  }

  .lists-layout {
    flex-direction: column;
    gap: 10px;
  }

  .lists-sidebar {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    gap: 10px;
  }

  .lists-sidebar .templates-search {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    border-color: rgba(15, 23, 42, 0.14);
  }

  .lists-sidebar .templates-category-list {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px 2px;
    scrollbar-width: none;
  }

  .lists-sidebar .templates-category-list::-webkit-scrollbar {
    display: none;
  }

  .lists-sidebar .templates-category-item {
    min-width: max-content;
    padding: 10px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  }

  .lists-sidebar .templates-category-item.active {
    background: rgba(29, 117, 232, 0.12);
    border-color: rgba(29, 117, 232, 0.35);
  }

  .lists-main-header {
    padding: 10px 12px;
  }

  .templates-main-header-left {
    min-width: 0;
  }

  .lists-list {
    grid-template-columns: 1fr;
  }

  .list-card-actions button {
    flex: 1 1 auto;
  }
}

.lists-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.lists-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
  padding-bottom: 6px;
}

.list-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.list-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #172b4d;
}

.list-card-meta {
  font-size: 12px;
  color: #42526e;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.list-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.list-card-actions button {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 800;
}

.list-card-actions button.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.list-card-actions button:hover {
  background: #eef2ff;
}

.list-card-actions button.primary:hover {
  background: #1d4ed8;
}

.list-campaign-status-modal {
  width: 760px;
  max-width: calc(100vw - 24px);
}

.list-campaign-status-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

#list-campaign-status-body {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.list-contacts-modal {
  width: 980px;
  max-width: calc(100vw - 24px);
}

.list-contacts-modal .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.list-contacts-modal .lists-contacts-toolbar {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  margin-bottom: 12px;
}

.list-contacts-modal .lists-contacts-toolbar .templates-search {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  padding: 10px 12px;
  font-size: 14px;
}

.list-contacts-modal .lists-contacts-body {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  max-height: 65vh;
}

.list-contacts-modal .lists-contacts-table th {
  background: #f8fafc;
}

@media (max-width: 720px) {
  .list-contacts-modal {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }

  .list-campaign-status-modal {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }

  .list-contacts-modal .lists-contacts-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .list-contacts-modal #list-contacts-add-btn {
    width: 100%;
  }
}

.lists-contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.lists-contacts-body {
  overflow: auto;
  max-height: 60vh;
}

.lists-contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lists-contacts-table th,
.lists-contacts-table td {
  border-bottom: 1px solid #e6e8ec;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.lists-contacts-table th {
  position: sticky;
  top: 0;
  background: #f7f8fa;
  z-index: 1;
  font-weight: 700;
  color: #172b4d;
}

.lists-contacts-table input,
.lists-contacts-table textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  font-size: 12px;
}

.lists-contacts-table textarea {
  min-height: 44px;
  resize: vertical;
}

.lists-contacts-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lists-contacts-actions button {
  border: 1px solid #d0d7e2;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lists-contacts-actions button.primary {
  background: #0052cc;
  border-color: #0052cc;
  color: #fff;
}

.template-editor-modal {
  max-width: 720px;
}

.template-editor-modal-new {
  width: 860px;
  max-width: calc(100vw - 24px);
}

.template-editor-modal-new .modal-body {
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.template-editor-body {
  gap: 12px;
}

.template-editor-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-editor-modal-new .template-editor-row,
.template-editor-modal-new .template-editor-section {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.template-editor-modal-new .template-editor-label {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.template-editor-modal-new .modal-text-input,
.template-editor-modal-new select {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

.template-editor-media-file-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.template-editor-media-clear-btn {
  white-space: nowrap;
}

.template-editor-label {
  font-size: 12px;
  font-weight: 600;
  color: #222;
}

.template-editor-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-editor-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  font-size: 14px;
  resize: vertical;
}

.template-editor-modal-new .template-editor-hint {
  color: #334155;
}

.template-editor-modal-new .template-editor-step {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.template-action-card {
  cursor: grab;
}

.template-action-card.dragging {
  cursor: grabbing;
  opacity: 0.85;
}

@media (max-width: 720px) {
  .templates-body {
    padding: 10px;
  }

  .templates-sidebar {
    padding: 10px;
  }

  .template-editor-modal-new {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }
}

.template-editor-seq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-editor-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-editor-step {
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.template-editor-step-text-wrap,
.template-editor-step-media-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-editor-file-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.template-editor-file-row .template-editor-label {
  min-width: 90px;
}

.template-editor-timing-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.template-editor-timing-row .template-editor-label {
  min-width: 140px;
}

.template-editor-timing-row input {
  max-width: 110px;
}

.template-editor-media-picked,
.template-editor-step-picked {
  margin-top: -4px;
}

.template-editor-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.template-editor-step-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.template-editor-step-actions {
  display: flex;
  gap: 6px;
}

.template-editor-hint {
  font-size: 11px;
  color: #555;
}
