/* ==========================================================================
   Estilos Globales
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    /* Fondo oscuro */
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animaciones globales */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Layout Principal
   ========================================================================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar (Menú Hamburguesa)
   ========================================================================== */
.sidebar {
    background-color: #2c2c2c;
    width: 250px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 60px;
}

.menu-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 2;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.sidebar-content {
    padding: 50px 15px 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
    visibility: visible;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    visibility: hidden;
}

.sidebar-title {
    font-size: 1.5rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 30px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
}

.menu-items {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    color: #cccccc;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    position: relative;
}

.menu-item:hover {
    background-color: #007bff;
    color: #ffffff;
    transform: translateX(5px);
}

.menu-item.active {
    background-color: #0056b3;
    color: #ffffff;
}

.menu-badge {
    background-color: #dc3545;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: auto;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.menu-badge:hover {
    transform: scale(1.1);
    background-color: #c82333;
}

.sidebar.collapsed .menu-badge {
    display: none;
}

/* ==========================================================================
   Área de Contenido
   ========================================================================== */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
}

.content-section {
    display: none;
    min-height: 100%;
    padding: 20px;
    border-radius: 10px;
}

.content-section.active {
    display: block;
    animation: slideIn 0.5s forwards;
}

/* Fondo unificado para todas las secciones */
#pendientes-totales,
#pendientes-filtrado,
#dashboard-rendimientos,
#aplicativos,
#pendientes-problemas {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    /* Gradiente naranja claro */
}

/* ==========================================================================
   Componentes Reutilizables
   ========================================================================== */
.card {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    padding: 20px;
    color: #333333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.no-data-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1a1a1a;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.card-title:hover {
    color: #007bff;
}

.card-content {
    text-align: center;
}

.card-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.card-number:hover {
    color: #0056b3;
    transform: scale(1.1);
}

.card-content p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #555555;
}

.button {
    background-color: #007bff;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.button:active {
    transform: scale(0.95);
}

.button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ==========================================================================
   Componentes Específicos: Métricas de Pedidos Pendientes
   ========================================================================== */
.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 25px;
}

.metrics-group {
    border: 1px solid #d5d5d5;
    border-radius: 12px;
    padding: 25px;
    background: linear-gradient(135deg, #fefefe, #f5f5f5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.metrics-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.metrics-group:not(:last-child) {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.metrics-group-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

.metrics-subgroup {
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.metrics-subgroup:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.metrics-subgroup h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: capitalize;
    padding-left: 10px;
    border-left: 4px solid #007bff;
}

.metrics-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.metric-card {
    flex: 1;
    min-width: 220px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f8f8f8);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.metric-card:hover {
    background: linear-gradient(135deg, #e3f2fd, #d0e6ff);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.metric-label {
    display: block;
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: capitalize;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.metric-value:hover {
    color: #0056b3;
    transform: scale(1.05);
}

.metric-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    display: none;
}

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

.metric-details-header p {
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    margin: 0;
}

.copy-ids-button {
    background-color: #28a745;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.copy-ids-button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

.copy-ids-button:active {
    transform: scale(0.95);
}

.metric-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.metric-details li {
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
    font-family: monospace;
    font-size: 0.9rem;
    color: #555;
}

.metric-details li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Componentes Específicos: Filtro de Fechas
   ========================================================================== */
.date-filter-container {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.date-filter-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.date-filter-type {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.date-filter-type select {
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    font-size: 0.9rem;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    width: 200px;
    text-align: center;
}

.date-filter-type select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
    transform: scale(1.02);
}

.date-filter-type select:hover {
    border-color: #007bff;
}

/* Filtro de Sucursal */
.sucursal-filter-container {
    margin-bottom: 20px;
    text-align: center;
}

.sucursal-filter-container select {
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    font-size: 0.9rem;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sucursal-filter-container select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.sucursal-header {
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.date-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
}

.single-date,
.range-date {
    display: none;
}

.single-date.active,
.range-date.active {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s forwards;
}

/* Estilo para los campos de Flatpickr */
.flatpickr-single,
.flatpickr-range {
    padding: 10px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    font-size: 0.9rem;
    background-color: #ffffff;
    color: #333333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 220px;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flatpickr-single:focus,
.flatpickr-range:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.flatpickr-calendar {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background-color: #007bff;
    border-color: #007bff;
    color: #ffffff;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background-color: #0056b3;
}

.flatpickr-day.today {
    border-color: #007bff;
    color: #007bff;
}

.flatpickr-day:hover {
    background-color: #e3f2fd;
}

.flatpickr-monthDropdown-months,
.flatpickr-year {
    color: #333333;
    font-weight: bold;
}

.flatpickr-monthDropdown-months:hover,
.flatpickr-year:hover {
    background-color: #e3f2fd;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: #007bff;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: #0056b3;
}

/* ==========================================================================
   Componentes Específicos: Dashboard Rendimientos
   ========================================================================== */
#rendimientos-data p {
    font-size: 1.1rem;
    margin: 10px 0;
}

#rendimientos-data span {
    font-weight: bold;
    color: #007bff;
    transition: color 0.3s ease;
}

#rendimientos-data span:hover {
    color: #0056b3;
}

/* ==========================================================================
   Componentes Específicos: Sección de Aplicativos
   ========================================================================== */
.aplicativos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.app-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.app-card h3 {
    font-size: 1.2rem;
    font-weight: bold;
}

.app-empaquetado {
    background-color: #ffcccb;
}

.app-empaquetado:hover {
    background-color: #ff9999;
}

.app-prioridades {
    background-color: #add8e6;
}

.app-prioridades:hover {
    background-color: #87ceeb;
}

.app-preasignacion {
    background-color: #c8e6c9;
}

.app-preasignacion:hover {
    background-color: #a5d6a7;
}

.app-presentacion {
    background-color: #fff9c4;
}

.app-presentacion:hover {
    background-color: #fff59d;
}

.app-tecnica {
    background-color: #b3e5fc;
}

.app-tecnica:hover {
    background-color: #81d4fa;
}

.app-ubicaciones {
    background-color: #d3d3d3;
}

.app-ubicaciones:hover {
    background-color: #b0b0b0;
}

.app-despacho {
    background-color: #d7ccc8;
}

.app-despacho:hover {
    background-color: #bcaaa4;
}

.app-presentacion-v2 {
    background-color: #e0e0e0;
}

.app-presentacion-v2:hover {
    background-color: #bdbdbd;
}

.app-procesado {
    background-color: #f5f5f5;
}

.app-procesado:hover {
    background-color: #d5d5d5;
}

/* ==========================================================================
   Estilos para la sección de Pedidos con Problemas
   ========================================================================== */

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #007bff #e46b6b;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.pendientes-problemas-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.pendientes-problemas-list li.pedido-item {
    position: relative;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.pendientes-problemas-list li.pedido-item:hover {
    background-color: #f5fbff;
    transform: translateY(-2px);
}

.top-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-grow: 1;
}

.left-column,
.right-column {
    width: 20%;
}

.center-column {
    width: 60%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start
}

.pedido-id {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

.pedido-carrier {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.pedido-datetime {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.pedido-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-size: 0.9rem;
    color: #555;
    min-height: 40px;
    padding: 10px 0;
}

.pedido-details div {
    margin-bottom: 5px;
    width: 100%;
}

.bandejas-container {
    margin-top: 5px;
    padding: 5px;
    background-color: #eeeeee;
    border: none;
    border-radius: 5px;
    max-height: 100px;
    overflow-y: auto;
}

.bandejas-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.bandejas-list li {
    font-size: 0.85rem;
    color: #555;
    padding: 2px 0;
}

/* Etiqueta de carrito */
.carrito-label {
    display: inline-block;
    background-color: #ff9800;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
    align-self: center;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.carrito-label:hover {
    background-color: #e68900;
}

.pedido-actions-horizontal {
    display: flex;
    gap: 10px;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.action-btn {
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    background-color: #e0e0e0;
    transform: scale(1.1);
}

.action-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.action-btn i {
    pointer-events: none;
}

.pedido-postpone-action {
    position: absolute;
    bottom: 10px;
    left: 10px;
}

.postpone-btn {
    background-color: #ffb347;
    color: #1a1a1a;
    font-weight: bold;
}

.postpone-btn:hover {
    background-color: #ffa726;
    color: #000000;
}

.postpone-btn i {
    color: inherit;
}

.action-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.operator-status {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.operator-status.pending {
    color: #c62828;
}

.operator-status.assigned {
    color: #2e7d32;
}

.operator-status.processing {
    color: #ff9800;
}

.pending-check-placeholder {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background-color: #ffffff;
    z-index: 5;
    border-radius: 10px;
}

#pendientes-problemas .pending-check-placeholder.blocked {
    background-color: rgba(255, 231, 186, 0.95);
    color: #a84300;
    text-align: center;
    padding: 20px;
}

#pendientes-problemas .pending-check-placeholder.blocked .section-check-spinner {
    display: none;
}

#pendientes-problemas .pending-check-placeholder.blocked p {
    color: #a84300;
}

#pendientes-problemas .card-content {
    position: relative;
    min-height: 200px;
}

.section-check-spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #ff9800;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pending-check-placeholder p {
    color: #333333;
    font-weight: 600;
}

.no-pedidos {
    text-align: center;
    font-size: 1rem;
    color: #666;
    padding: 20px;
}

.carrier-actions-dropdown {
    margin-top: 5px;
    padding: 6px;
    font-size: 0.85rem;
    width: 150px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.carrier-actions-dropdown:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.carrier-actions-dropdown option {
    background-color: #ffffff;
    color: #333333;
}

.assign-user-dropdown {
    margin-top: 8px;
    padding: 6px;
    font-size: 0.85rem;
    width: 250px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.assign-user-dropdown:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.assign-user-dropdown option {
    background-color: #ffffff;
    color: #333333;
}

.pendientes-problemas-list li.pedido-item.selected .assign-user-dropdown option {
    background-color: #ffffff;
    color: #333333;
}

.pendientes-problemas-list li.pedido-item.alerta-vencida {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.5);
    background-color: #fff1f0;
}

.pendientes-problemas-list li.pedido-item.requires-operator {
    border-color: #ff9800;
}

.pendientes-problemas-list li.pedido-item.processing {
    opacity: 0.5;
    position: relative;
}

.pendientes-problemas-list li.pedido-item.processing::after {
    content: 'Procesando...';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    color: #ff9800;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
}

/* Responsividad */
@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
        align-items: stretch;
    }

    .left-column,
    .center-column,
    .right-column {
        width: 100%;
        margin-bottom: 10px;
    }

    .center-column {
        text-align: left;
    }

    .pedido-actions-vertical {
        align-items: flex-start;
    }

    .pendientes-problemas-list li.pedido-item {
        min-height: auto;
    }

    .carrier-actions-dropdown {
        width: 100%;
        max-width: 200px;
    }

    .assign-user-dropdown {
        width: 100%;
        max-width: 200px;
    }
}

.observacion-container {
    position: relative;
    margin-top: 10px;
    width: 100%;
}

.observacion-textarea {
    width: 250px;
    height: 80px;
    padding: 6px;
    font-size: 0.85rem;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background-color: #f8f8f8;
    color: #333333;
    resize: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin: 0 auto;
}

.observacion-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.observacion-textarea:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.observacion-actions {
    position: absolute;
    top: 0;
    left: calc(50% + 125px + 10px);
    display: flex;
    flex-direction: column;
    gap: 5px;
}



/* ==========================================================================
   Media Queries para Responsividad
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .sidebar.collapsed {
        width: 50px;
    }

    .content-area {
        padding: 20px;
    }

    .content-section {
        padding: 15px;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-number {
        font-size: 2rem;
    }

    .date-inputs {
        flex-direction: column;
        align-items: center;
    }

    .flatpickr-single,
    .flatpickr-range,
    .date-filter-type select {
        width: 100%;
        max-width: 250px;
    }

    .metrics-cards {
        flex-direction: column;
    }

    .metric-card {
        min-width: 100%;
    }

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

/* ==========================================================================
   Estilos para Tablas de DataTables
   ========================================================================== */
.dataTables_wrapper {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #333;
}

.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dataTable thead {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #ffffff;
}

.dataTable thead th {
    padding: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.dataTable tbody tr {
    transition: background-color 0.3s ease;
}

.dataTable tbody tr:hover {
    background-color: #e3f2fd;
}

.dataTable tbody td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    color: #333;
}

.dataTables_info,
.dataTables_paginate {
    margin-top: 10px;
    color: #555;
}

.dataTables_paginate .paginate_button {
    background: #007bff;
    color: #ffffff !important;
    border-radius: 5px;
    padding: 5px 10px;
    margin: 0 2px;
    transition: background-color 0.3s ease;
}

.dataTables_paginate .paginate_button:hover {
    background: #0056b3;
}

.dataTables_paginate .paginate_button.current {
    background: #0056b3;
    font-weight: bold;
}

@media (max-width: 768px) {

    .dataTable thead th,
    .dataTable tbody td {
        padding: 8px;
        font-size: 0.85rem;
    }

    .dataTables_wrapper {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Overlay de Carga
   ========================================================================== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Fondo semitransparente */
    display: none;
    /* Oculto por defecto */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* Asegura que esté por encima de otros elementos */
    border-radius: 10px;
    /* Coincide con el border-radius de la sección */
}

.loading-overlay.active {
    display: flex;
    /* Visible cuando tiene la clase active */
}

/* Estilo del Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #e0e0e0;
    /* Borde gris claro */
    border-top: 6px solid #007bff;
    /* Borde superior azul (color principal del dashboard) */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animación de rotación para el spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.swal2-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.swal2-table th,
.swal2-table td {
    border: 1px solid #ddd;
    padding: 4px 8px;
    text-align: left;
}

.swal2-table th {
    background-color: #f2f2f2;
}

.swal2-thumb {
    width: 75px;
    height: 75px;
    object-fit: cover;
}

body.overdue-modal-open {
    overflow: hidden;
}

.overdue-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.overdue-modal-overlay.active {
    display: flex;
}

.overdue-modal-panel {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    background: #ffffff;
    color: #333333;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.overdue-modal-header h3 {
    margin-bottom: 5px;
    font-size: 1.5rem;
    color: #c62828;
}

.overdue-modal-header p {
    margin: 0;
    color: #555555;
    font-size: 0.95rem;
}

.overdue-modal-body {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
}

.overdue-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

#overdue-remaining-text {
    font-weight: 600;
    color: #c62828;
}

#overdue-dismiss-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.overdue-modal-overlay .pendientes-problemas-list {
    max-height: none;
}

.swal2-container {
    z-index: 6000 !important;
}
