/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .main-sidebar {
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .brand-link {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .user-panel {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-sidebar .nav-item .nav-link {
    color: #e0e0e0;
}

body.dark-mode .nav-sidebar .nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-sidebar .nav-item .nav-link.active {
    background: linear-gradient(90deg, #007bff, #0056b3);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.2);
}

body.dark-mode .content-wrapper {
    background-color: #121212;
}

body.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.3);
}

body.dark-mode .card-header,
body.dark-mode .content-wrapper .card .card-header,
body.dark-mode .content-wrapper .card-header {
    background-color: #172238 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #e0e0e0 !important;
}

body.dark-mode .card-header .card-title,
body.dark-mode .content-wrapper .card .card-header .card-title {
    color: #f8fafc !important;
}

body.dark-mode .card-footer {
    background-color: #252525;
    border-top-color: #333;
}

body.dark-mode .main-footer {
    background: linear-gradient(to right, #1a1a1a, #1e1e1e);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #aaa;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.3);
}

body.dark-mode .main-footer strong {
    color: #e0e0e0;
}

body.dark-mode .main-footer a {
    color: #4da3ff;
}

body.dark-mode .main-footer a:hover {
    color: #77b7ff;
}

body.dark-mode .main-footer .version {
    background-color: #252525;
    color: #aaa;
}

/* Estilos mejorados para tablas */
body.dark-mode .table {
    color: #e0e0e0;
}

body.dark-mode .table td,
body.dark-mode .table th {
    border-color: #333;
    color: #e0e0e0;
}

/* Cabecera de tabla */
body.dark-mode .table thead th {
    background-color: #252525;
    color: #e0e0e0;
    border-color: #333;
}

/* Filas alternadas de la tabla */
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: #1a1a1a;
}

body.dark-mode .table-striped tbody tr:nth-of-type(even) {
    background-color: #222;
}

/* Hover en filas de tabla */
body.dark-mode .table-hover tbody tr:hover {
    background-color: #2a2a2a;
    color: #ffffff;
}

/* Estilos para DataTables */
body.dark-mode .dataTables_wrapper .dataTables_length select,
body.dark-mode .dataTables_wrapper .dataTables_filter input {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e0e0e0 !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #333 !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(to bottom, #007bff, #0056b3) !important;
    color: #ffffff !important;
    border-color: #0056b3 !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(to bottom, #0069d9, #0043a0) !important;
}

/* Formularios */
body.dark-mode .form-control {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .form-control:focus {
    background-color: #2a2a2a;
    border-color: #0069d9;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

body.dark-mode .form-control::placeholder {
    color: #999;
}

body.dark-mode .form-select {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .input-group-text {
    background-color: #252525;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

/* Botones */
body.dark-mode .btn-default {
    background-color: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .btn-default:hover {
    background-color: #3a3a3a;
    border-color: #444;
    color: #ffffff;
}

body.dark-mode .btn-outline-info {
    color: #4da3ff;
    border-color: #4da3ff;
}

body.dark-mode .btn-outline-info:hover {
    background-color: #4da3ff;
    color: #121212;
}

/* Modales */
body.dark-mode .modal-content {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode .modal-header {
    border-bottom-color: #333;
    background: linear-gradient(135deg, #1a1a1a, #252525);
}

body.dark-mode .modal-footer {
    border-top-color: #333;
    background-color: #1a1a1a;
}

body.dark-mode .modal-title {
    color: #e0e0e0;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdown */
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #2a2a2a;
    color: #ffffff;
}

body.dark-mode .dropdown-divider {
    border-top-color: #333;
}

/* Dark Mode Toggle Button Styles */
.dark-mode-toggle .btn {
    transition: all 0.3s ease;
}

.dark-mode-toggle .btn i {
    margin-right: 5px;
}

body.dark-mode .dark-mode-toggle .btn {
    background-color: #2a2a2a;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .dark-mode-toggle .btn:hover {
    background-color: #3a3a3a;
    color: #ffffff;
}

/* Dashboard */
body.dark-mode .info-box {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .info-box-content {
    color: #e0e0e0;
}

body.dark-mode .info-box-text {
    color: #ccc;
}

body.dark-mode .info-box-number {
    color: #ffffff;
}

body.dark-mode .info-box-progress {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .chart-container {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .chart-title {
    color: #e0e0e0;
    border-bottom-color: #333;
}

body.dark-mode .chart-legend-item {
    color: #ccc;
}

/* Estilos para el Calendario del Turnero */
body.dark-mode .calendar {
    background-color: #1e1e1e;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .calendar header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

body.dark-mode .calendar .days li {
    color: #e0e0e0;
}

body.dark-mode .calendar .days li:not(.active):not(.today):not(.other-month) {
    color: #e0e0e0;
}

body.dark-mode .calendar .days li.other-month {
    color: #666;
}

body.dark-mode .calendar .days li.today {
    color: #ffffff;
    background-color: rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

body.dark-mode .calendar .days li.active {
    color: #ffffff;
    background-color: #007bff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.5);
}

body.dark-mode .calendar .days li:hover:not(.active):not(.today):not(.other-month) {
    background-color: #2a2a2a;
    color: #ffffff;
    border-radius: 50%;
}

body.dark-mode .calendar .weeks li {
    color: #aaa;
    font-weight: 500;
}

body.dark-mode .calendar .current-date {
    color: #ffffff;
    font-weight: 600;
}

body.dark-mode .calendar .icons span {
    color: #e0e0e0;
    background-color: #2a2a2a;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

body.dark-mode .calendar .icons span:hover {
    background-color: #3a3a3a;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Alertas y notificaciones */
body.dark-mode .alert {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

body.dark-mode .alert-primary {
    background-color: rgba(0, 123, 255, 0.15);
    color: #7bb9ff;
}

body.dark-mode .alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #8eda9f;
}

body.dark-mode .alert-info {
    background-color: rgba(23, 162, 184, 0.15);
    color: #82d7e8;
}

body.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffe083;
}

body.dark-mode .alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    color: #f09da6;
}

/* Scrollbar personalizado */
body.dark-mode::-webkit-scrollbar {
    width: 10px;
}

body.dark-mode::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

body.dark-mode::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ==========================================================================
   DATATABLES & TABLAS GENERALES - CONTRASTE GLOBAL MODO OSCURO
   Elimina fondos claros residuales de CDNs (DataTables, AdminLTE, Bootstrap)
   y garantiza contraste perfecto texto/fondo en todas las vistas del sistema.
   ========================================================================== */
body.dark-mode table,
body.dark-mode table.dataTable,
body.dark-mode table.table {
    background-color: transparent !important;
    color: #e0e0e0 !important;
}

body.dark-mode table thead,
body.dark-mode table.dataTable thead,
body.dark-mode table thead tr,
body.dark-mode table.dataTable thead tr {
    background-color: #172238 !important;
}

body.dark-mode table thead th,
body.dark-mode table.dataTable thead th,
body.dark-mode table.dataTable thead td,
body.dark-mode .table thead.table-light th,
body.dark-mode .table thead.bg-light th,
body.dark-mode .table thead.bg-info th {
    background-color: #172238 !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Forzar fondos oscuros/transparentes en todas las filas */
body.dark-mode table tbody,
body.dark-mode table.dataTable tbody,
body.dark-mode table tbody tr,
body.dark-mode table.dataTable tbody tr,
body.dark-mode table.dataTable.display tbody tr,
body.dark-mode table.dataTable.stripe tbody tr {
    background-color: transparent !important;
    color: #e0e0e0 !important;
}

/* Filas impares y pares DataTables */
body.dark-mode table tbody tr:nth-of-type(odd),
body.dark-mode table.dataTable tbody tr:nth-of-type(odd),
body.dark-mode table.dataTable.display tbody tr:nth-of-type(odd),
body.dark-mode table.dataTable.stripe tbody tr:nth-of-type(odd),
body.dark-mode table.dataTable tbody tr.odd,
body.dark-mode table.dataTable.display tbody tr.odd,
body.dark-mode table.dataTable.stripe tbody tr.odd {
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #e0e0e0 !important;
}

body.dark-mode table tbody tr:nth-of-type(even),
body.dark-mode table.dataTable tbody tr:nth-of-type(even),
body.dark-mode table.dataTable.display tbody tr:nth-of-type(even),
body.dark-mode table.dataTable.stripe tbody tr:nth-of-type(even),
body.dark-mode table.dataTable tbody tr.even,
body.dark-mode table.dataTable.display tbody tr.even,
body.dark-mode table.dataTable.stripe tbody tr.even {
    background-color: transparent !important;
    color: #e0e0e0 !important;
}

/* Celdas TD individuales (neutraliza FixedColumns y DataTables order-column) */
body.dark-mode table tbody td,
body.dark-mode table.dataTable tbody td,
body.dark-mode table.dataTable tbody tr td,
body.dark-mode table.dataTable tbody tr.odd td,
body.dark-mode table.dataTable tbody tr.even td,
body.dark-mode table.dataTable.display tbody tr.odd td,
body.dark-mode table.dataTable.display tbody tr.even td,
body.dark-mode table.dataTable tbody tr td.sorting_1,
body.dark-mode table.dataTable tbody tr td.sorting_2,
body.dark-mode table.dataTable tbody tr td.sorting_3,
body.dark-mode table.dataTable.display tbody tr.odd > .sorting_1,
body.dark-mode table.dataTable.display tbody tr.even > .sorting_1,
body.dark-mode table.dataTable.order-column.stripe tbody tr.odd > .sorting_1,
body.dark-mode table.dataTable.order-column.stripe tbody tr.even > .sorting_1 {
    background-color: transparent !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Hover en filas */
body.dark-mode table tbody tr:hover,
body.dark-mode table.dataTable tbody tr:hover,
body.dark-mode table.dataTable.display tbody tr:hover,
body.dark-mode table.dataTable.hover tbody tr:hover,
body.dark-mode table.table-hover tbody tr:hover,
body.dark-mode table tbody tr:hover > td,
body.dark-mode table.dataTable tbody tr:hover > td,
body.dark-mode table.dataTable.display tbody tr:hover > td {
    background-color: rgba(56, 189, 248, 0.08) !important;
    color: #ffffff !important;
}

/* Fila seleccionada */
body.dark-mode table tbody tr.selected,
body.dark-mode table tbody tr.selected td,
body.dark-mode table.dataTable tbody tr.selected,
body.dark-mode table.dataTable tbody tr.selected td,
body.dark-mode table.dataTable.display tbody tr.selected,
body.dark-mode table.dataTable.display tbody tr.selected td,
body.dark-mode table.dataTable tbody tr.selected > td,
body.dark-mode table.dataTable tbody tr.selected > .sorting_1 {
    background-color: rgba(37, 99, 235, 0.28) !important;
    color: #ffffff !important;
}

/* Celdas fijas (FixedColumns) */
body.dark-mode .DTFC_LeftHeadWrapper th,
body.dark-mode .DTFC_RightHeadWrapper th,
body.dark-mode .DTFC_LeftBodyWrapper td,
body.dark-mode .DTFC_RightBodyWrapper td {
    background-color: #131c2e !important;
    color: #e0e0e0 !important;
}

/* Paginación y Controles DataTables */
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_length label,
body.dark-mode .dataTables_wrapper .dataTables_filter label {
    color: #94a3b8 !important;
}

/* Botones de acción en tablas para Dark Mode */
body.dark-mode .btn-action-icon.btn-outline-primary {
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
}
body.dark-mode .btn-action-icon.btn-outline-primary:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}
body.dark-mode .btn-action-icon.btn-outline-danger {
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.4) !important;
}
body.dark-mode .btn-action-icon.btn-outline-danger:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}
body.dark-mode .btn-action-icon.btn-outline-success {
    color: #4ade80 !important;
    border-color: rgba(74, 222, 128, 0.4) !important;
}
body.dark-mode .btn-action-icon.btn-outline-success:hover {
    background-color: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}
body.dark-mode .btn-action-icon.btn-outline-warning {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
}
body.dark-mode .btn-action-icon.btn-outline-warning:hover {
    background-color: #d97706 !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
}
 