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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.dashboard-header p {
    color: #94a3b8;
    font-size: 1rem;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.queue-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.queue-card:nth-child(1) { animation-delay: 0.1s; }
.queue-card:nth-child(2) { animation-delay: 0.2s; }
.queue-card:nth-child(3) { animation-delay: 0.3s; }

.queue-card:hover {
    transform: translateY(-4px);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.queue-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.warning-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.queue-title-red {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f87171;
    flex: 1;
}
.queue-title-green {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4ade80;
    flex: 1;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.2s ease;
}

.metric-item:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.2);
}

.metric-label {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-icon {
    font-size: 1rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.metric-value.positive {
    color: #4ade80;
}

.metric-value.negative {
    color: #f87171;
}

.metric-value.currency {
    color: #60a5fa;
}

.calls-section {
    background: rgba(15, 23, 42, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 1.5rem;
}

.calls-section h3 {
    font-size: 1.125rem;
    color: #e2e8f0;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.calls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.call-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
}

.call-stat-icon {
    font-size: 1.5rem;
}

.call-stat-content {
    flex: 1;
}

.call-stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.call-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.queue-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.queue-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    flex: 1;
    min-width: 200px;
}

.distribution-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.distribution-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.distribution-btn:active {
    transform: translateY(0);
}

/* Added modal styles for distributions display */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.2);
    transform: scale(1.1);
}

.modal-search {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.7);
}

.search-input::placeholder {
    color: #64748b;
}

.modal-body {
    padding: 1.5rem 2rem;
    max-height: 50vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.distribution-table {
    width: 100%;
}

.distribution-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.distribution-item:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.3);
    transform: translateX(4px);
}

.distribution-icon {
    font-size: 1.5rem;
}

.distribution-info {
    flex: 1;
}

.distribution-name {
    font-size: 0.875rem;
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.distribution-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.distribution-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .queue-card {
        padding: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .calls-grid {
        grid-template-columns: 1fr;
    }

    .queue-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .queue-id {
        min-width: 100%;
    }

    .distribution-btn {
        width: 100%;
    }

    /* Added responsive styles for modal */
    .modal-overlay {
        padding: 1rem;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-search {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1rem 1.5rem;
    }

    .distribution-item {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }

    .distribution-id {
        grid-column: 1 / -1;
        font-size: 0.65rem;
        word-break: break-all;
    }
}

#chartdiv {
  width: 100%;
  height: 500px;
}






/* Estilos generales para el contenedor de la tabla y la tabla misma */
.tabla-elegante-contenedor {
    overflow-x: auto; /* Permite desplazamiento horizontal en pantallas pequeñas */
}

.tabla-elegante {
    width: 100%;
    border-collapse: collapse; /* Colapsa los bordes de la celda en un solo borde */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra sutil para un efecto "elevado" */
    border-radius: 8px; /* Bordes redondeados */
    overflow: hidden; /* Asegura que la sombra y los bordes redondeados se apliquen correctamente */
    background-color: #1e293b; /* Fondo blanco para la tabla */
    margin-bottom: 20px;
}

.pendiente{
    text-align: right;
    background-color: #ffd60055;
}
.activas{
    text-align: right;
    background-color: #3b82f6;
    color:#1e293b !important;
    font-weight: bolder;
}
.fallido{
    text-align: right;
    background-color: #ef444455;
}
.whatsapp{
    text-align: right;
    background-color: #4FCE5D55;
}
/* Estilos para el encabezado (<thead>) */
.tabla-elegante thead {
    background-color: #3b82f6; /* Color primario distintivo (verde esmeralda) */
    color: #1e293b; /* Texto blanco para el encabezado */
    text-align: left;
}

.tabla-elegante th {
    padding: 5px; /* Más padding para que el texto respire */
    font-weight: 600; /* Un poco más de peso para destacar los títulos */
    letter-spacing: 0.5px; /* Pequeño espaciado para mejor legibilidad */
    text-transform: uppercase; /* Mayúsculas para los títulos */
}

/* Estilos para el cuerpo de la tabla (<tbody>) */
.tabla-elegante td {
    padding: 3px;
    border-bottom: 1px solid #e0e0e0; /* Separadores de filas muy ligeros */
    color: #fff; /* Color de texto oscuro para alto contraste */
}

/* Estilo de fila al pasar el ratón (Hover) */
.tabla-elegante tbody tr:hover {
    background-color: #1e293b; /* Un ligero cambio de color al pasar el ratón */
    cursor: pointer; /* Indica que la fila es interactiva */
    transform: scale(1.01); /* Efecto zoom sutil */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Estilo para filas pares (Zebra-striping) para mejorar la legibilidad */
.tabla-elegante tbody tr:nth-child(even) {
    background-color: #1e293b; /* Fondo muy claro para las filas pares */
}

/* Estilo para la última fila para quitar el borde inferior si es necesario */
.tabla-elegante tbody tr:last-child td {
    border-bottom: none;
}

/* Estilos de alineación opcionales */
.tabla-elegante .columna-numero {
    text-align: right;
}

.tabla-elegante .columna-estado {
    text-align: center;
}

/* Estilo de ejemplo para un "badge" de estado */
.estado-activo {
    background-color: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
}

.estado-inactivo {
    background-color: #f44336;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
}

.centrado {
    text-align: center;
}
.derecha {
    text-align: right;
}
.circulo-con-borde-verde {
  width: 20px; /* Ancho */
  height: 20px; /* Alto */
  background-color: transparent; /* Color de fondo (transparente si se quiere ver a través) */
  border-radius: 50%; /* Hace que el elemento sea un círculo */
  background: #4ade80; /* Color de fondo verde */
}
.circulo-con-borde-rojo {
  width: 20px; /* Ancho */
  height: 20px; /* Alto */
  background-color: transparent; /* Color de fondo (transparente si se quiere ver a través) */
  border-radius: 50%; /* Hace que el elemento sea un círculo */
  background: #ef4444; /* Color de fondo rojo */
}