/* =========================================================
   panel.css  — Estilos comunes para CDR, Colas y Extensiones
   ========================================================= */

/* Tipografía / suavizado 
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*/

body {
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f1f5f9;
  /* si ya lo tienes */
  color: #0f172a;
}

/* -------------------- Layout base de paneles -------------------- */

.panel {
  background-color: #ffffff;
  border-radius: 0.75rem;
  /* ~ rounded-xl */
  border: 1px solid #e2e8f0;
  /* slate-200 */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  /* shadow-sm */
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  /* slate-100 */
  background-color: rgba(248, 250, 252, 0.8);
  /* slate-50 */
}

.panel-header-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  /* slate-500 */
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-body {
  padding: 1.5rem;
}

/* -------------------- Botones genéricos -------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  color: #f9fafb;
  background-color: #1f2937;
  /* slate-800 */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease;
}

.btn-primary:hover {
  background-color: #020617;
  /* slate-950 */
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.35);
  transform: translateY(-0.5px);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* Botón tipo chip (filtros, toggles…) */
.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  /* slate-200 */
  background-color: #f9fafb;
  /* slate-50 */
  font-size: 0.625rem;
  font-weight: 500;
  color: #475569;
  /* slate-600 */
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn-chip:hover {
  background-color: #f1f5f9;
  /* slate-100 */
  border-color: #cbd5e1;
  /* slate-300 */
  color: #0f172a;
  /* slate-900 */
}

/* Chips de estado tipo "Sistema activo", "AMI conectado" */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* -------------------- Scroll fino (colas, listados largos) -------------------- */

.slim-scroll {
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: #e2e8f0 transparent;
  /* Firefox */
}

.slim-scroll::-webkit-scrollbar {
  width: 4px;
}

.slim-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.slim-scroll::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  /* slate-300 */
  border-radius: 9999px;
}

.slim-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
  /* slate-400 */
}

/* -------------------- Animaciones (extensiones) -------------------- */

@keyframes flash-online {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    /* emerald-400 */
    transform: scale(1);
    border-color: #34d399;
  }

  50% {
    box-shadow: 0 0 25px 5px rgba(52, 211, 153, 0.4);
    transform: scale(1.05);
    border-color: #10b981;
    /* emerald-500 */
    z-index: 10;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    transform: scale(1);
  }
}

.just-connected {
  animation: flash-online 2s ease-out forwards;
}

@keyframes pulse-orange-border {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    /* orange-500 */
  }

  70% {
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

.in-call-anim {
  animation: pulse-orange-border 2s infinite;
  z-index: 5;
}

/* -------------------- DataTables (CDR) -------------------- */
/* Copiado de cdr.html para que tenga el mismo look en todas :contentReference[oaicite:1]{index=1} */

.dt-button {
  background-color: white !important;
  color: #475569 !important;
  /* slate-600 */
  border: 1px solid #e2e8f0 !important;
  /* slate-200 */
  border-radius: 0.5rem !important;
  padding: 0.4rem 0.8rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s !important;
}

.dt-button:hover {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* Menú de columnas */
div.dt-button-collection {
  width: 200px !important;
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

div.dt-button-collection button.dt-button {
  border: none !important;
  background: transparent !important;
  width: 100%;
  text-align: left;
  margin: 0 !important;
  padding: 0.5rem !important;
  color: #64748b !important;
}

div.dt-button-collection button.dt-button:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

div.dt-button-collection button.dt-button.dt-button-active {
  font-weight: bold !important;
  color: #2563eb !important;
  /* blue-600 */
  background-color: #eff6ff !important;
  /* blue-50 */
}

/* Paginación */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #334155 !important;
  /* slate-700 */
  color: white !important;
  border: 1px solid #334155 !important;
  border-radius: 0.375rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 0.375rem !important;
  border: 1px solid #e2e8f0 !important;
  background: white !important;
  margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Inputs y selects */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  color: #334155;
  background-color: #ffffff;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

/* Tabla */
table.dataTable.no-footer {
  border-bottom: 1px solid #e2e8f0 !important;
}

table.dataTable thead th {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 0.65rem !important;
  letter-spacing: 0.05em;
  padding: 12px 16px !important;
}

table.dataTable tbody td {
  padding: 10px 16px !important;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

/* -------------------- Drag & Drop Indicators -------------------- */

/* Indicador de drop arriba */
.drop-indicator-top {
  position: relative;
  transition: all 0.2s ease;
}

.drop-indicator-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  /* blue-600 to blue-400 */
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  z-index: 50;
  animation: pulse-drop-indicator 1s ease-in-out infinite;
}

/* Indicador de drop abajo */
.drop-indicator-bottom {
  position: relative;
  transition: all 0.2s ease;
}

.drop-indicator-bottom::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  /* blue-600 to blue-400 */
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  z-index: 50;
  animation: pulse-drop-indicator 1s ease-in-out infinite;
}

/* Indicador de drop izquierda (para vista grid) */
.drop-indicator-left {
  position: relative;
  transition: all 0.2s ease;
}

.drop-indicator-left::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
  /* blue-600 to blue-400 */
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  z-index: 50;
  animation: pulse-drop-indicator 1s ease-in-out infinite;
}

/* Indicador de drop derecha (para vista grid) */
.drop-indicator-right {
  position: relative;
  transition: all 0.2s ease;
}

.drop-indicator-right::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
  /* blue-600 to blue-400 */
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  z-index: 50;
  animation: pulse-drop-indicator 1s ease-in-out infinite;
}

/* Animación del indicador de drop */
@keyframes pulse-drop-indicator {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  }

  50% {
    opacity: 0.7;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.8);
  }
}

/* Transiciones suaves para las tarjetas */
[draggable="true"] {
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: grab;
}

[draggable="true"]:active {
  cursor: grabbing;
}

/* Efecto de escala durante el drag */
.scale-95 {
  transform: scale(0.95);
}

/* -------------------- Vista Grid - Mejoras -------------------- */

/* En vista grid, las tarjetas tienen mejor hover */
[data-queue-name] {
  transition: all 0.2s ease;
}

/* Mejorar el espaciado en vista grid */
.grid [data-queue-name] {
  min-height: 180px;
}

/* Hover más pronunciado en vista grid */
.grid [data-queue-name]:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

/* Altura fija para tarjetas en vista grid */
.grid [data-queue-name] {
  height: 380px;
  display: flex;
  flex-direction: column;
}

/* Contenedor de extensiones con scroll */
.grid [data-queue-name] .members-container {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.grid [data-queue-name] .members-container::-webkit-scrollbar {
  width: 4px;
}

.grid [data-queue-name] .members-container::-webkit-scrollbar-track {
  background: transparent;
}

.grid [data-queue-name] .members-container::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.grid [data-queue-name] .members-container::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Título en vista grid: permitir ajuste de texto */
.grid [data-queue-name] h2 {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}