/*
 * CallDrive Theme Layer
 * ---------------------
 * Capa de tokens de marca sobre Metronic 8.2.9 (style.bundle.css SIN modificar).
 * Fuente de verdad: html/Brandkit (styleguide_calldrive.png / color-palette_simple_calldrive.JPG).
 *
 * Paleta oficial:  #00C9F6 (cian) | #008CF8 (azul, primary) | #C209FA (magenta, acento/info) | #000000
 * Secundaria:      #040404 | #C680E4 (lavender) | #25A5F2 (dodger) | #645BE9 (royal)
 * Tipografia:      Roboto (Google Fonts). Gobold/Ethnocentric: sin archivos de fuente, pendiente.
 *
 * Este archivo debe cargarse DESPUES de style.bundle.css.
 * Documentacion: docs/DESIGN_SYSTEM.md
 */

/* ============================================================
   1. Variables de marca CallDrive
   ============================================================ */
:root {
  --cd-cyan: #00C9F6;
  --cd-blue: #008CF8;
  --cd-magenta: #C209FA;
  --cd-black: #040404;
  --cd-lavender: #C680E4;
  --cd-dodger: #25A5F2;
  --cd-royal: #645BE9;
  --cd-gradient: linear-gradient(90deg, #00C9F6 0%, #008CF8 45%, #C209FA 100%);
}

/* ============================================================
   2. Tokens Bootstrap + Metronic — modo claro
   ============================================================ */
:root,
[data-bs-theme=light] {
  /* Tipografia de marca */
  --bs-body-font-family: Roboto, Helvetica, "sans-serif";
  --bs-font-sans-serif: Roboto, Helvetica, "sans-serif";

  /* Primary: CallDrive Blue */
  --bs-primary: #008CF8;
  --bs-primary-rgb: 0, 140, 248;
  --bs-primary-active: #0072D4;
  --bs-primary-light: #E6F4FF;
  --bs-primary-inverse: #FFFFFF;
  --bs-primary-clarity: rgba(0, 140, 248, 0.2);
  --bs-text-primary: #008CF8;
  --bs-primary-text-emphasis: #003864;
  --bs-primary-bg-subtle: #CCE8FE;
  --bs-primary-border-subtle: #99D1FC;

  /* Links */
  --bs-link-color: #008CF8;
  --bs-link-color-rgb: 0, 140, 248;
  --bs-link-hover-color: #0072D4;
  --bs-link-hover-color-rgb: 0, 114, 212;

  /* Info: CallDrive Magenta (sustituye al morado #7239EA de Metronic) */
  --bs-info: #C209FA;
  --bs-info-rgb: 194, 9, 250;
  --bs-info-active: #A806D9;
  --bs-info-light: #F9EBFF;
  --bs-info-inverse: #FFFFFF;
  --bs-info-clarity: rgba(194, 9, 250, 0.2);
  --bs-text-info: #C209FA;

  /* Estados de componentes Metronic */
  --bs-component-active-bg: #008CF8;
  --bs-component-hover-color: #008CF8;
  --bs-component-checked-bg: #008CF8;

  /* Menus, ribbons y scrolltop */
  --bs-menu-link-color-hover: #008CF8;
  --bs-menu-link-color-show: #008CF8;
  --bs-menu-link-color-here: #008CF8;
  --bs-menu-link-color-active: #008CF8;
  --bs-ribbon-label-bg: #008CF8;
  --bs-scrolltop-bg-color: #008CF8;
  --bs-scrolltop-bg-color-hover: #0072D4;
}

/* ============================================================
   3. Tokens Bootstrap + Metronic — modo oscuro
   ============================================================ */
[data-bs-theme=dark] {
  --bs-body-font-family: Roboto, Helvetica, "sans-serif";
  --bs-font-sans-serif: Roboto, Helvetica, "sans-serif";

  --bs-primary: #008CF8;
  --bs-primary-rgb: 0, 140, 248;
  --bs-primary-active: #25A5F2;
  --bs-primary-light: #0B2438;
  --bs-primary-inverse: #FFFFFF;
  --bs-primary-clarity: rgba(0, 140, 248, 0.2);
  --bs-text-primary: #008CF8;
  --bs-primary-text-emphasis: #66BAFB;
  --bs-primary-bg-subtle: #001C32;
  --bs-primary-border-subtle: #005495;

  --bs-link-color: #008CF8;
  --bs-link-color-rgb: 0, 140, 248;
  --bs-link-hover-color: #25A5F2;
  --bs-link-hover-color-rgb: 37, 165, 242;

  --bs-info: #CE4DFF;
  --bs-info-rgb: 206, 77, 255;
  --bs-info-active: #D96FFF;
  --bs-info-light: #2A1233;
  --bs-info-inverse: #FFFFFF;
  --bs-info-clarity: rgba(206, 77, 255, 0.2);
  --bs-text-info: #CE4DFF;

  --bs-component-active-bg: #008CF8;
  --bs-component-hover-color: #008CF8;
  --bs-component-checked-bg: #008CF8;

  --bs-menu-link-color-hover: #008CF8;
  --bs-menu-link-color-show: #008CF8;
  --bs-menu-link-color-here: #008CF8;
  --bs-menu-link-color-active: #008CF8;
  --bs-ribbon-label-bg: #008CF8;
  --bs-scrolltop-bg-color: #008CF8;
  --bs-scrolltop-bg-color-hover: #25A5F2;
}

/* ============================================================
   4. Reglas del bundle con hex literal (no usan var())
   ============================================================ */

/* Checks, radios y switches */
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input[type=checkbox]:indeterminate {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check.form-check-solid .form-check-input[type=checkbox]:indeterminate {
  background-color: var(--bs-primary);
}

/* Range sliders (pseudo-elementos de vendor: reglas separadas) */
.form-range::-webkit-slider-thumb {
  background-color: var(--bs-primary);
}

.form-range::-moz-range-thumb {
  background-color: var(--bs-primary);
}

/* Botones Bootstrap (Metronic los repinta via .btn.btn-primary con var(),
   esto cubre usos con la clase suelta) */
.btn-primary {
  --bs-btn-color: #FFFFFF;
  --bs-btn-bg: #008CF8;
  --bs-btn-border-color: #008CF8;
  --bs-btn-hover-color: #FFFFFF;
  --bs-btn-hover-bg: #0072D4;
  --bs-btn-hover-border-color: #0072D4;
  --bs-btn-focus-shadow-rgb: 0, 140, 248;
  --bs-btn-active-color: #FFFFFF;
  --bs-btn-active-bg: #0072D4;
  --bs-btn-active-border-color: #0072D4;
  --bs-btn-disabled-color: #FFFFFF;
  --bs-btn-disabled-bg: #008CF8;
  --bs-btn-disabled-border-color: #008CF8;
}

.btn-outline-primary {
  --bs-btn-color: #008CF8;
  --bs-btn-border-color: #008CF8;
  --bs-btn-hover-color: #FFFFFF;
  --bs-btn-hover-bg: #008CF8;
  --bs-btn-hover-border-color: #008CF8;
  --bs-btn-focus-shadow-rgb: 0, 140, 248;
  --bs-btn-active-color: #FFFFFF;
  --bs-btn-active-bg: #008CF8;
  --bs-btn-active-border-color: #008CF8;
  --bs-btn-disabled-color: #008CF8;
  --bs-btn-disabled-border-color: #008CF8;
}

/* Nav pills y progreso */
.nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
}

.progress,
.progress-stacked {
  --bs-progress-bar-bg: var(--bs-primary);
}

/* Icono del acordeon (SVG con color embebido) */
.accordion {
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23008CF8'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

[data-bs-theme=dark] .accordion-button::after {
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23008CF8'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Separadores */
.separator.separator-content.border-primary::before,
.separator.separator-content.border-primary::after {
  border-color: var(--bs-primary) !important;
}

/* Landing (no usada por la app, cubierta por consistencia) */
.landing-header .menu .menu-link.active,
[data-kt-sticky-landing-header=on] .landing-header .menu .menu-link.active {
  color: var(--bs-primary);
}

/* ============================================================
   5. Tipografia: el bundle repinta body con "Inter" literal
   ============================================================ */
body {
  font-family: Roboto, Helvetica, "sans-serif";
}

/* ============================================================
   6. Sidebar oscuro: negro de marca + logo y tipografia del menu
   (el bundle usa #0D0E12 literal, no la variable)
   ============================================================ */
[data-kt-app-layout=dark-sidebar] .app-sidebar {
  --bs-app-sidebar-light-bg-color: var(--cd-black);
  background-color: var(--cd-black);
}

/* Logo: compacto y centrado en el sidebar */
.app-sidebar-logo {
  justify-content: center;
}

.app-sidebar-logo > a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.app-sidebar-logo .cd-sidebar-logo {
  height: 18px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.app-sidebar-logo .cd-sidebar-logo-mini {
  height: 16px;
  width: auto;
  object-fit: contain;
}

/* Menu: tipografia mas marcada (como el preview de tokens) */
#kt_app_sidebar_menu.menu,
#kt_app_sidebar_menu .menu-link {
  font-weight: 600;
}

#kt_app_sidebar_menu .menu-title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

#kt_app_sidebar_menu .menu-heading {
  font-weight: 700;
  letter-spacing: 0.04em;
}

#kt_app_sidebar_menu .menu-link.active .menu-title,
#kt_app_sidebar_menu .menu-item.here > .menu-link .menu-title {
  font-weight: 700;
}

/* ============================================================
   7. Utilidades de marca
   ============================================================ */
.cd-bg-gradient {
  background: var(--cd-gradient);
}

.cd-text-gradient {
  background: var(--cd-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   8. Look neumorfico oscuro (aplica solo en modo dark)
   Mismo idioma visual del login: negro de marca, superficies
   con relieve, inputs hundidos, acentos neon. Centralizado aqui
   para no tocar style.bundle.css.
   ============================================================ */
[data-bs-theme=dark] {
  --cd-app-bg: #040404;
  --cd-surface: #0c0d12;
  --cd-surface-2: #0a0b0f;
  --cd-border-soft: rgba(255, 255, 255, 0.06);

  /* Relieve neumorfico */
  --cd-shadow-out:
    14px 14px 38px rgba(0, 0, 0, 0.8),
    -8px -8px 24px rgba(255, 255, 255, 0.022);
  --cd-shadow-in:
    inset 5px 5px 12px rgba(0, 0, 0, 0.72),
    inset -3px -3px 8px rgba(255, 255, 255, 0.028);

  /* Superficies base de Metronic sobre el negro de marca */
  --bs-body-bg: #050609;
  --bs-app-bg-color: var(--cd-app-bg);
  --bs-app-blank-bg-color: var(--cd-app-bg);
  --bs-card-bg: var(--cd-surface);
  --bs-modal-bg: var(--cd-surface);
  --bs-drawer-bg: var(--cd-surface);
}

/* -- Fondo de la app con brillos de neon atenuados -------------- */
/* Glow en body (background-image), NO en ::before fixed + z-index en
   #kt_app_content_container: eso creaba un stacking context que atrapaba
   los .modal debajo del .modal-backdrop (z-index ~1050 en body). */
[data-bs-theme=dark] body {
  background-color: var(--cd-app-bg);
  background-image:
    radial-gradient(circle at 12% 12%, rgba(0, 201, 246, 0.06), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(194, 9, 250, 0.055), transparent 45%),
    radial-gradient(circle at 60% 95%, rgba(0, 140, 248, 0.05), transparent 50%);
  background-attachment: fixed;
}

[data-bs-theme=dark] .app-wrapper,
[data-bs-theme=dark] .app-main {
  background-color: transparent;
}

/* -- Header, toolbar y footer alineados al negro de marca ------ */
/* Nota: NO usar backdrop-filter en .app-header — crea containing block
   y desplaza los megamenus Metronic (position:fixed + Popper) a la derecha. */
[data-bs-theme=dark] .app-header,
[data-bs-theme=dark][data-kt-app-header-fixed=true] .app-header {
  background-color: rgba(6, 7, 11, 0.96);
  border-bottom: 1px solid var(--cd-border-soft);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-bs-theme=dark] .app-toolbar,
[data-bs-theme=dark] .app-footer {
  background-color: transparent;
}

/* -- Cards, modales y drawers: superficie con relieve ---------- */
[data-bs-theme=dark] .card,
[data-bs-theme=dark] .modal-content,
[data-bs-theme=dark] .drawer .card,
[data-bs-theme=dark] .menu-sub-dropdown {
  background-color: var(--cd-surface);
  border: 1px solid var(--cd-border-soft);
  border-radius: 18px;
  box-shadow: var(--cd-shadow-out);
}

/* Filo superior con gradiente solo en cards de pagina (no widgets chicos) */
[data-bs-theme=dark] .app-content .card {
  position: relative;
}

[data-bs-theme=dark] .app-content > .card::before,
[data-bs-theme=dark] #kt_app_content_container > .card::before,
[data-bs-theme=dark] #kt_app_content_container > .row > div > .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--cd-gradient);
  opacity: 0.7;
}

[data-bs-theme=dark] .card .card-header {
  border-bottom: 1px solid var(--cd-border-soft);
}

/* -- Inputs hundidos (inset neumorfico) ------------------------ */
[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select,
[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection {
  background-color: var(--cd-surface-2);
  border: 1px solid var(--cd-border-soft);
  border-radius: 12px;
  color: #E9EAED;
  box-shadow: var(--cd-shadow-in);
}

[data-bs-theme=dark] .form-control::placeholder {
  color: #5A5C66;
}

[data-bs-theme=dark] .form-control:focus,
[data-bs-theme=dark] .form-select:focus {
  background-color: var(--cd-surface-2);
  border-color: rgba(0, 140, 248, 0.55);
  box-shadow:
    var(--cd-shadow-in),
    0 0 0 3px rgba(0, 140, 248, 0.18);
  color: #FFFFFF;
}

/* Autofill oscuro para evitar el amarillo de Chrome */
[data-bs-theme=dark] .form-control:-webkit-autofill,
[data-bs-theme=dark] .form-control:-webkit-autofill:hover,
[data-bs-theme=dark] .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--cd-surface-2) inset;
  -webkit-text-fill-color: #E9EAED;
  caret-color: #E9EAED;
  transition: background-color 9999s ease-out;
}

/* -- Boton primary con el gradiente de marca ------------------- */
[data-bs-theme=dark] .btn.btn-primary {
  background: var(--cd-gradient);
  background-size: 150% 100%;
  background-position: 0% 0%;
  border: 0;
  box-shadow: 0 4px 20px rgba(0, 140, 248, 0.3);
  transition: background-position 0.35s ease, box-shadow 0.2s ease;
}

[data-bs-theme=dark] .btn.btn-primary:hover,
[data-bs-theme=dark] .btn.btn-primary:focus,
[data-bs-theme=dark] .btn.btn-primary:active {
  background-position: 100% 0%;
  box-shadow: 0 6px 26px rgba(194, 9, 250, 0.36);
}

/* -- Tablas: contenedor oscuro, filas legibles ---------------- */
[data-bs-theme=dark] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #C9CBD3;
  --bs-table-border-color: var(--cd-border-soft);
  --bs-table-hover-bg: rgba(0, 140, 248, 0.08);
  --bs-table-hover-color: #FFFFFF;
}

[data-bs-theme=dark] .table > thead th {
  color: #8A8D99;
  border-bottom-color: var(--cd-border-soft);
}

/* DataTables (cubre CSS residual del CDN si sigue cargando) */
[data-bs-theme=dark] .dataTables_wrapper,
[data-bs-theme=dark] .dataTables_wrapper .dataTables_length,
[data-bs-theme=dark] .dataTables_wrapper .dataTables_filter,
[data-bs-theme=dark] .dataTables_wrapper .dataTables_info,
[data-bs-theme=dark] .dataTables_wrapper .dataTables_paginate {
  color: #C9CBD3;
}

[data-bs-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #C9CBD3 !important;
}

[data-bs-theme=dark] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #FFFFFF !important;
}

[data-bs-theme=dark] table.dataTable tbody tr {
  background-color: transparent;
}

[data-bs-theme=dark] table.dataTable tbody tr:hover {
  background-color: rgba(0, 140, 248, 0.08);
}

/* -- SweetAlert2: refuerzo por si el override del bundle no gana */
[data-bs-theme=dark] .swal2-popup {
  background: var(--cd-surface);
  color: #C9CBD3;
  border: 1px solid var(--cd-border-soft);
  border-radius: 18px;
  box-shadow: var(--cd-shadow-out);
}

[data-bs-theme=dark] .swal2-title,
[data-bs-theme=dark] .swal2-html-container {
  color: #E9EAED;
}

/* -- Dropzone (list_uploader) --------------------------------- */
[data-bs-theme=dark] .dropzone,
[data-bs-theme=dark] .dz-clickable {
  background-color: var(--cd-surface-2);
  border: 1px dashed rgba(0, 140, 248, 0.4);
  border-radius: 14px;
}

/* ============================================================
   9. Select2 Multi-Select, Choices, Remove Button & Dropdown Styles
   Garantiza contraste óptimo, legibilidad clara y soporte completo
   para temas dark/light en select2-container--bootstrap5,
   select2-container--bootstrap-5 y select2-container--default.
   ============================================================ */

/* --- Multi-Select Selection Container --- */
.select2-container--bootstrap5 .select2-selection--multiple,
.select2-container--bootstrap-5 .select2-selection--multiple,
.select2-container--default .select2-selection--multiple {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  gap: 4px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection--multiple,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple,
[data-bs-theme=dark] .select2-container--default .select2-selection--multiple {
  background-color: #1b1c22 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

[data-bs-theme=light] .select2-container--bootstrap5 .select2-selection--multiple,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-selection--multiple,
[data-bs-theme=light] .select2-container--default .select2-selection--multiple {
  background-color: #FFFFFF !important;
  border: 1px solid #E1E3EA !important;
  color: #181C32 !important;
}

/* Focus and Open States */
.select2-container--bootstrap5.select2-container--focus .select2-selection--multiple,
.select2-container--bootstrap-5.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--bootstrap5.select2-container--open .select2-selection--multiple,
.select2-container--bootstrap-5.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: #008CF8 !important;
  box-shadow: 0 0 0 3px rgba(0, 140, 248, 0.25) !important;
}

/* Choice list container */
.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  list-style: none !important;
}

/* --- Selected Choice Badges / Pills --- */
.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
  padding: 4px 10px 4px 8px !important;
  margin: 2px 0 !important;
  border-radius: 6px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  width: auto !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
  background-color: rgba(0, 140, 248, 0.18) !important;
  border: 1px solid rgba(0, 140, 248, 0.5) !important;
  color: #FFFFFF !important;
}

[data-bs-theme=light] .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice,
[data-bs-theme=light] .select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
  background-color: var(--bs-primary-light, #E6F4FF) !important;
  border: 1px solid var(--bs-primary-border-subtle, #99D1FC) !important;
  color: var(--bs-primary-text-emphasis, #003864) !important;
}

.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__display,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__display,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__display {
  margin-left: 0 !important;
  padding: 0 !important;
  font-weight: 500 !important;
  color: inherit !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Remove "X" Button */
.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin-right: 6px !important;
  margin-left: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
  background: rgba(255, 255, 255, 0.2) !important;
  opacity: 0.9 !important;
}

[data-bs-theme=light] .select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove,
[data-bs-theme=light] .select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
  background: rgba(0, 0, 0, 0.08) !important;
  opacity: 0.75 !important;
}

.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove span,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove span,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove span {
  display: inline-block !important;
  font-size: 13px !important;
  line-height: 1 !important;
  font-weight: 700 !important;
  color: inherit !important;
  pointer-events: none !important;
  margin-top: -1px !important;
}

.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover {
  background: #ef4444 !important;
  opacity: 1 !important;
  color: #FFFFFF !important;
  transform: scale(1.15) !important;
}

.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover span,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover span,
.select2-container--default .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover span {
  color: #FFFFFF !important;
}

/* --- Inline Search Input Inside Multi-Select --- */
.select2-container--bootstrap5 .select2-selection--multiple .select2-search--inline,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline,
.select2-container--default .select2-selection--multiple .select2-search--inline {
  display: inline-flex !important;
  flex-grow: 1 !important;
  margin: 2px 0 !important;
  padding: 0 !important;
}

.select2-container--bootstrap5 .select2-selection--multiple .select2-search--inline .select2-search__field,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field,
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  min-width: 130px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 2px 6px !important;
}

[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection--multiple .select2-search--inline .select2-search__field,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field,
[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  color: #FFFFFF !important;
}

[data-bs-theme=light] .select2-container--bootstrap5 .select2-selection--multiple .select2-search--inline .select2-search__field,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field,
[data-bs-theme=light] .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  color: #181C32 !important;
}

[data-bs-theme=dark] .select2-container--bootstrap5 .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder,
[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

/* --- Dropdown Panel --- */
.select2-dropdown {
  border-radius: 8px !important;
  overflow: hidden !important;
  z-index: 10050 !important;
  margin-top: 4px !important;
}

[data-bs-theme=dark] .select2-dropdown {
  background-color: #1e1f27 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme=light] .select2-dropdown {
  background-color: #FFFFFF !important;
  border: 1px solid #E1E3EA !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Optgroup Headers (DNCs, Leads, Timezones, etc.) */
.select2-dropdown .select2-results__group,
.select2-container--bootstrap5 .select2-dropdown .select2-results__group,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__group,
.select2-container--default .select2-dropdown .select2-results__group {
  display: block !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 8px 14px !important;
  margin-top: 2px !important;
}

[data-bs-theme=dark] .select2-dropdown .select2-results__group,
[data-bs-theme=dark] .select2-container--bootstrap5 .select2-dropdown .select2-results__group,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-results__group,
[data-bs-theme=dark] .select2-container--default .select2-dropdown .select2-results__group {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #38BDF8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme=light] .select2-dropdown .select2-results__group,
[data-bs-theme=light] .select2-container--bootstrap5 .select2-dropdown .select2-results__group,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-dropdown .select2-results__group,
[data-bs-theme=light] .select2-container--default .select2-dropdown .select2-results__group {
  background-color: #F5F8FA !important;
  color: #008CF8 !important;
  border-top: 1px solid #EFF2F5 !important;
  border-bottom: 1px solid #EFF2F5 !important;
}

/* Dropdown Option Items */
.select2-dropdown .select2-results__option,
.select2-container--bootstrap5 .select2-dropdown .select2-results__option,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option,
.select2-container--default .select2-dropdown .select2-results__option {
  font-size: 0.925rem !important;
  font-weight: 400 !important;
  padding: 8px 16px !important;
  line-height: 1.45 !important;
  transition: background 0.12s ease, color 0.12s ease !important;
  cursor: pointer !important;
}

[data-bs-theme=dark] .select2-dropdown .select2-results__option,
[data-bs-theme=dark] .select2-container--bootstrap5 .select2-dropdown .select2-results__option,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-results__option,
[data-bs-theme=dark] .select2-container--default .select2-dropdown .select2-results__option {
  color: #E2E8F0 !important;
  background-color: transparent !important;
}

[data-bs-theme=light] .select2-dropdown .select2-results__option,
[data-bs-theme=light] .select2-container--bootstrap5 .select2-dropdown .select2-results__option,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-dropdown .select2-results__option,
[data-bs-theme=light] .select2-container--default .select2-dropdown .select2-results__option {
  color: #3F4254 !important;
  background-color: transparent !important;
}

/* Highlighting on hover or keyboard navigation - CRISP, HIGH CONTRAST & READABLE */
.select2-dropdown .select2-results__option.select2-results__option--highlighted,
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option.select2-results__option--highlighted,
.select2-container--default .select2-dropdown .select2-results__option.select2-results__option--highlighted {
  background-color: #008CF8 !important;
  color: #FFFFFF !important;
  font-weight: 500 !important;
}

/* Selected option in the dropdown list */
[data-bs-theme=dark] .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=dark] .select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=dark] .select2-container--default .select2-dropdown .select2-results__option.select2-results__option--selected {
  background-color: rgba(0, 140, 248, 0.15) !important;
  color: #38BDF8 !important;
  font-weight: 600 !important;
}

[data-bs-theme=light] .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=light] .select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=light] .select2-container--bootstrap-5 .select2-dropdown .select2-results__option.select2-results__option--selected,
[data-bs-theme=light] .select2-container--default .select2-dropdown .select2-results__option.select2-results__option--selected {
  background-color: #E6F4FF !important;
  color: #008CF8 !important;
  font-weight: 600 !important;
}

/* Selected option when highlighted */
.select2-dropdown .select2-results__option.select2-results__option--highlighted.select2-results__option--selected,
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--highlighted.select2-results__option--selected,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option.select2-results__option--highlighted.select2-results__option--selected,
.select2-container--default .select2-dropdown .select2-results__option.select2-results__option--highlighted.select2-results__option--selected {
  background-color: #0077D4 !important;
  color: #FFFFFF !important;
}

/* Results list scroll container - SINGLE root scroll container */
.select2-results > .select2-results__options {
  max-height: 380px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05) !important;
}

/* Nested option lists inside optgroups must NEVER scroll independently */
.select2-results__options--nested,
.select2-results__options .select2-results__options {
  max-height: none !important;
  overflow: visible !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
  height: auto !important;
}

/* Beautiful, highly visible custom scrollbar for dark mode */
.select2-results > .select2-results__options::-webkit-scrollbar {
  width: 9px !important;
}
.select2-results > .select2-results__options::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 4px !important;
  margin: 4px 0 !important;
}
.select2-results > .select2-results__options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
  min-height: 30px !important;
}
.select2-results > .select2-results__options::-webkit-scrollbar-thumb:hover {
  background: #008CF8 !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}


