/* ===================================================================
   Tracking OT - Estilos basados en guía "Control de Asistencia"
   Tema oscuro con acento cian (#74f5ff)
   =================================================================== */

/* -------------------------------------------------------------------
   1. Variables CSS / Paleta de colores
   ------------------------------------------------------------------- */
:root {
    --bs-body-font-family: Tahoma, 'Segoe UI', sans-serif;
    --bs-body-color: #e0e3e5;
    --primary-color: #000814;
    --secondary-color: #74f5ff;
    --secondary-hover: #00f1fe;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.18);
    --input-border-focus: #74f5ff;
    --modal-bg: #004D61;
    --footer-bg: rgba(0, 5, 14, 0.6);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-placeholder: rgba(255, 255, 255, 0.45);
    --text-on-accent: #0a0e17;
}

/* -------------------------------------------------------------------
   2. Reset / Base
   ------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 1rem;
    scroll-behavior: smooth;
}

body {
    font-family: var(--bs-body-font-family);
    color: var(--bs-body-color);
    min-height: 100vh;
    background: linear-gradient(to bottom right, #000814, #001a3a, #00246b);
    position: relative;
    overflow-x: hidden;
}

/* Imagen de fondo estática */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../img/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.12;
    pointer-events: none;
    z-index: -2;
}

/* Overlay estático sutil */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(116,245,255,0.10) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0,77,97,0.18) 0%, transparent 45%);
    pointer-events: none;
    z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
    body, body::after, body::before { animation: none !important; }
    #bg-particles { display: none !important; }
}

/* Canvas partículas */
#bg-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}
}

/* Tipografía */
h1, h2, h3, h4, h5, h6,
.navbar-brand {
    font-family: var(--bs-body-font-family);
}

h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

/* Material Symbols Outlined */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 1.25rem;
    line-height: 1;
    vertical-align: middle;
}

.text-secondary-fixed {
    color: var(--secondary-color) !important;
}

/* -------------------------------------------------------------------
   3. Botones personalizados
   ------------------------------------------------------------------- */
.btn-primary-custom {
    background-color: var(--secondary-color);
    color: var(--text-on-accent);
    font-weight: 600;
    border: none;
    border-radius: 50rem;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}
.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: var(--secondary-hover);
    color: var(--text-on-accent);
    transform: scale(1.04);
    box-shadow: 0 0.5rem 1rem rgba(116, 245, 255, 0.3);
}

.btn-outline-custom {
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-outline-custom:hover,
.btn-outline-custom:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Botones ghost para toolbars */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}
.btn-ghost.active,
.btn-ghost:active {
    color: var(--secondary-color);
    background: rgba(116, 245, 255, 0.15);
}

/* Tamaños */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------
   4. Glass Cards (Tarjetas de vidrio)
   ------------------------------------------------------------------- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    transition: all 0.3s ease;
}
.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

.glass-card.dashboard-card {
    background: rgba(255, 255, 255, 0.1);
}
.glass-card.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------------
   5. Animaciones
   ------------------------------------------------------------------- */
@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(116, 245, 255, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(116, 245, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(116, 245, 255, 0); }
}

.pulse-border {
    animation: pulse-glow 2s infinite;
}

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

.fade-slide-up {
    animation: fadeSlideUp 0.6s ease-out forwards;
}

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

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.reveal-zoom { transform: scale(0.9); }
.reveal-d-1 { transition-delay: 0.1s; }
.reveal-d-2 { transition-delay: 0.2s; }
.reveal-d-3 { transition-delay: 0.3s; }

/* -------------------------------------------------------------------
   6. Formularios
   ------------------------------------------------------------------- */
.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 0.25rem rgba(116, 245, 255, 0.25);
    outline: none;
}
.form-control::placeholder {
    color: var(--text-placeholder);
}
.form-select option {
    background-color: var(--modal-bg);
    color: #fff;
}
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}
.form-text {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.form-label {
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.375rem;
}

/* Input group */
.input-group-text {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-right: none;
    color: var(--bs-body-color);
}
.input-group .form-control {
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
}
.input-group-text:focus-within {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 0.25rem rgba(116, 245, 255, 0.25);
}

/* -------------------------------------------------------------------
   7. Tablas / DataTables
   ------------------------------------------------------------------- */
/* Tablas base */
.table-custom {
    --bs-table-bg: rgba(255, 255, 255, 0.02);
    --bs-table-color: #fff;
}

/* Fila seleccionada en DataTables */
table.dataTable tbody tr.selected {
    background-color: rgba(116, 245, 255, 0.15) !important;
}
table.dataTable tbody tr.selected td {
    background-color: rgba(116, 245, 255, 0.15) !important;
}
table.dataTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Paginación DataTables en cyan */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: rgba(116, 245, 255, 0.2) !important;
    border-color: rgba(116, 245, 255, 0.3) !important;
    color: #74f5ff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(116, 245, 255, 0.1) !important;
    border-color: rgba(116, 245, 255, 0.2) !important;
    color: #74f5ff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Selector de cantidad de filas en cyan */
.dataTables_wrapper .dataTables_length select {
    background-color: rgba(116, 245, 255, 0.1) !important;
    border-color: rgba(116, 245, 255, 0.3) !important;
    color: #74f5ff !important;
}
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #74f5ff !important;
    box-shadow: 0 0 0 0.2rem rgba(116, 245, 255, 0.25) !important;
}
.dataTables_wrapper .dataTables_length select option {
    background-color: #1a2a40 !important;
    color: #74f5ff !important;
}

/* DataTables overrides */
.dt-container {
    color: #fff !important;
}
.dt-container .dt-layout-row {
    padding: 0.5rem 0 !important;
    gap: 0.5rem;
}
.dt-container .dt-layout-cell {
    padding: 0.25rem 0 !important;
}
.dt-container .dt-search,
.dataTables_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 1rem !important;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
}
.dt-container .dt-search input,
.dataTables_filter input {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: #fff !important;
    border-radius: 0.5rem !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.85rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 300px;
    margin-left: 0.5rem;
}
.dt-container .dt-search input::placeholder,
.dataTables_filter input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}
.dt-container .dt-search input:focus,
.dataTables_filter input:focus {
    border-color: var(--input-border-focus) !important;
    box-shadow: 0 0 0 0.2rem rgba(116, 245, 255, 0.25) !important;
    outline: none !important;
}
.dt-container .dt-length {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dt-container .dt-length label {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
    white-space: nowrap;
}
.dt-container .dt-length select {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: #fff !important;
    border-radius: 0.5rem !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    transition: border-color 0.2s;
}
.dt-container .dt-length select:focus {
    border-color: var(--input-border-focus) !important;
    outline: none !important;
}
.dt-container .dt-length select option {
    background-color: #00122e !important;
    color: #fff !important;
}
.dt-container .dt-info {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    padding: 0.5rem 0 !important;
}
.dt-container .dt-paging {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0 !important;
}
.dt-container .dt-paging-button {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: #fff !important;
    border-radius: 0.375rem !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
    cursor: pointer;
    transition: all 0.2s;
}
.dt-container .dt-paging-button:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--secondary-color) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}
.dt-container .dt-paging-button.current {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--text-on-accent) !important;
    font-weight: 600;
}
.dt-container .dt-paging-button.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}
.dt-container table thead th {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    color: var(--text-muted) !important;
    white-space: nowrap;
}
.dt-container table tbody td {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    vertical-align: middle;
    white-space: nowrap;
}
.dt-container table tbody tr:hover {
    background-color: rgba(116, 245, 255, 0.05) !important;
}
.dt-container .dt-empty {
    color: var(--text-muted) !important;
    padding: 2rem !important;
    text-align: center;
}
.dt-container .dt-processing {
    background-color: rgba(0, 8, 20, 0.8) !important;
    color: var(--secondary-color) !important;
}

/* -------------------------------------------------------------------
   8. Paginación Bootstrap
   ------------------------------------------------------------------- */
.pagination {
    --bs-pagination-bg: rgba(255, 255, 255, 0.05);
    --bs-pagination-border-color: rgba(255, 255, 255, 0.18);
    --bs-pagination-color: #fff;
    --bs-pagination-hover-bg: rgba(255, 255, 255, 0.12);
    --bs-pagination-hover-color: var(--secondary-color);
    --bs-pagination-active-bg: var(--secondary-color);
    --bs-pagination-active-border-color: var(--secondary-color);
    --bs-pagination-active-color: var(--text-on-accent);
}

.page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.2s ease;
}
.page-item.active .page-link {
    font-weight: 600;
}

/* -------------------------------------------------------------------
   9. Navbar
   ------------------------------------------------------------------- */
.navbar-custom {
    background: rgba(0, 8, 20, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.navbar-custom .navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
}
.navbar-custom .nav-link {
    color: var(--bs-body-color) !important;
    font-weight: 400;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link:focus {
    color: var(--secondary-color) !important;
    background: rgba(255, 255, 255, 0.1);
}
.navbar-custom .nav-link.active {
    color: var(--secondary-color) !important;
    background: rgba(116, 245, 255, 0.15);
}
.navbar-custom .dropdown-menu {
    background: var(--modal-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
}
.navbar-custom .dropdown-item {
    color: #fff;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 400;
}
.navbar-custom .dropdown-item .material-symbols-outlined {
    font-size: 1.1rem;
}
.navbar-custom .nav-link {
    font-size: 0.85rem;
}
.navbar-custom .nav-link .material-symbols-outlined {
    font-size: 1.1rem;
}
.navbar-custom .dropdown-item:hover {
    background: rgba(116, 245, 255, 0.15);
    color: var(--secondary-color);
}
.navbar-custom .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------------------
   10. Sidebar
   ------------------------------------------------------------------- */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    height: calc(100vh - 56px);
    position: fixed;
    top: 56px;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar .nav-link {
    color: #fff;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}
.sidebar .nav-link .material-symbols-outlined {
    font-size: 1.3rem;
}
.sidebar .nav-link:hover {
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.08);
}
.sidebar .nav-link.active {
    color: var(--secondary-color);
    background: rgba(116, 245, 255, 0.15);
}
.sidebar .nav-section {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

/* Mobile offcanvas */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        border-right: none;
        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.5);
    }
    .sidebar.show {
        left: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
    body.sidebar-open {
        overflow: hidden;
    }
    .sidebar-toggler {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 1060;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
    }
}

/* -------------------------------------------------------------------
   11. Footer
   ------------------------------------------------------------------- */
footer {
    background-color: var(--footer-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------
   12. Badges / Estados
   ------------------------------------------------------------------- */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 50rem;
}

/* Badges para actividades (usando códigos) */
.badge-actividad-001 { background-color: #6c757d !important; }
.badge-actividad-002 { background-color: #0dcaf0 !important; color: #0a0e17 !important; }
.badge-actividad-003 { background-color: #0d6efd !important; }
.badge-actividad-004 { background-color: #0d6efd !important; opacity: 0.7; }
.badge-actividad-005 { background-color: #ffc107 !important; color: #0a0e17 !important; }
.badge-actividad-006 { background-color: #ffc107 !important; color: #0a0e17 !important; opacity: 0.7; }
.badge-actividad-007 { background-color: #0dcaf0 !important; color: #0a0e17 !important; }
.badge-actividad-008 { background-color: #198754 !important; }
.badge-actividad-009 { background-color: #fd7e14 !important; color: #0a0e17 !important; }
.badge-actividad-010 { background-color: #6c757d !important; }
.badge-actividad-011 { background-color: #dc3545 !important; }
.badge-actividad-012 { background-color: #6610f2 !important; }

/* Estados asistencia (para compatibilidad) */
.bg-asistencia-asistio { background-color: #198754 !important; }
.bg-asistencia-falta { background-color: #dc3545 !important; }
.bg-asistencia-tardanza { background-color: #ffc107 !important; color: #0a0e17 !important; }
.bg-asistencia-justificado { background-color: #0dcaf0 !important; color: #0a0e17 !important; }

/* -------------------------------------------------------------------
   13. Modales
   ------------------------------------------------------------------- */
.modal-content {
    background: var(--modal-bg);
    background-image: url('../img/fondo.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    color: #fff;
    position: relative;
}
.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 77, 97, 0.85);
    border-radius: inherit;
    z-index: 0;
}
.modal-content > * {
    position: relative;
    z-index: 1;
}
.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}
.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.modal-title {
    font-weight: 600;
    color: #fff;
}
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* -------------------------------------------------------------------
   14. Offcanvas
   ------------------------------------------------------------------- */
.offcanvas {
    background: var(--modal-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------------------
   15. Alertas
   ------------------------------------------------------------------- */
.alert {
    border: none;
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
}
.alert-success {
    background: rgba(25, 135, 84, 0.2);
    color: #87e89f;
    border: 1px solid rgba(25, 135, 84, 0.3);
}
.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #f5a5a5;
    border: 1px solid rgba(220, 53, 69, 0.3);
}
.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffda6a;
    border: 1px solid rgba(255, 193, 7, 0.3);
}
.alert-info {
    background: rgba(13, 202, 240, 0.2);
    color: #7df4ff;
    border: 1px solid rgba(13, 202, 240, 0.3);
}

/* -------------------------------------------------------------------
   16. Cards / Contenedores internos
   ------------------------------------------------------------------- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: none;
    transition: all 0.3s ease;
}
.card:hover {
    border-color: var(--glass-border-hover);
}
.card-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 600;
}
.card-body {
    padding: 1.25rem;
}

/* -------------------------------------------------------------------
   17. Utilidades de layout
   ------------------------------------------------------------------- */
.min-vh-100 {
    min-height: 100vh;
}
.main-content {
    padding-top: 56px;
    width: 90%;
    margin: 0 auto;
    flex: none;
}
.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* -------------------------------------------------------------------
   18. Utilidades de texto
   ------------------------------------------------------------------- */
.text-white-50 { color: var(--text-muted) !important; }
.text-secondary-fixed { color: var(--secondary-color) !important; }
.fs-3 { font-size: 1.5rem !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.small { font-size: 0.8rem !important; }

/* -------------------------------------------------------------------
   19. Mapa (Leaflet)
   ------------------------------------------------------------------- */
.leaflet-container {
    font-family: var(--bs-body-font-family);
    background: var(--glass-bg);
}
.leaflet-popup-content-wrapper {
    background: var(--modal-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.4);
}
.leaflet-popup-content {
    margin: 0.75rem 1rem;
    color: #fff;
    line-height: 1.6;
}
.leaflet-popup-tip {
    background: var(--modal-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Marker cluster custom */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: var(--secondary-color) !important;
    border: 2px solid #fff !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: var(--secondary-color) !important;
    color: var(--text-on-accent) !important;
    border-radius: 50%;
}

/* -------------------------------------------------------------------
   20. SweetAlert2 overrides (via JS config principalmente)
   ------------------------------------------------------------------- */
.swal2-popup {
    background: var(--modal-bg) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 1rem !important;
}
.swal2-title {
    color: #fff !important;
    font-family: var(--bs-body-font-family) !important;
}
.swal2-html-container {
    color: var(--bs-body-color) !important;
}
.swal2-confirm {
    background: var(--secondary-color) !important;
    color: var(--text-on-accent) !important;
    border: none !important;
    border-radius: 50rem !important;
    font-weight: 600 !important;
}
.swal2-cancel {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 50rem !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
    border-color: var(--secondary-color) !important;
}
.swal2-icon.swal2-success [class^=swal2-success-line] {
    background-color: var(--secondary-color) !important;
}
.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
    background-color: #dc3545 !important;
}
.swal2-icon.swal2-warning {
    border-color: #ffc107 !important;
    color: #ffc107 !important;
}

/* -------------------------------------------------------------------
   21. Scrollbar
   ------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(116, 245, 255, 0.5);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* -------------------------------------------------------------------
   22. Focus visible
   ------------------------------------------------------------------- */
*:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------
   23. Print
   ------------------------------------------------------------------- */
@media print {
    .navbar, .sidebar, .btn, .modal, .offcanvas, .no-print {
        display: none !important;
    }
    .card, .glass-card {
        border: 1px solid #dee2e6 !important;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    .main-content {
        padding-top: 0;
        margin-left: 0;
        width: 100%;
    }
}

/* -------------------------------------------------------------------
   24. Responsive
   ------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .card-body, .glass-card .card-body {
        padding: 1rem;
    }
    .table-responsive {
        font-size: 0.75rem;
    }
    .btn-group-sm > .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    .badge {
        font-size: 0.65rem;
    }
    .modal-dialog {
        margin: 0.5rem;
    }
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* -------------------------------------------------------------------
   25. Utilidades extra
   ------------------------------------------------------------------- */
.shadow-soft {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1) !important;
}
.shadow-medium {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2) !important;
}
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.border-glass {
    border-color: var(--glass-border) !important;
}
.bg-glass {
    background: var(--glass-bg) !important;
}

/* Leaflet tooltip labels */
.map-label {
    background: rgba(0, 8, 20, 0.85);
    color: #fff;
    border: 1px solid rgba(116, 245, 255, 0.5);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.map-label::before {
    border-top-color: rgba(0, 8, 20, 0.85);
}

/* ============================================================
   DataTables - Forzar estilos de filas (máxima especificidad)
   ============================================================ */
#tablaOT tbody td,
#tablaRutaOT tbody td,
.table-custom tbody td,
table.dataTable tbody td,
table.dataTable tbody tr td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    font-size: 0.75rem !important;
    font-weight: 300 !important;
    padding: 0.3rem 0.6rem !important;
    line-height: 1.3 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    vertical-align: middle !important;
}
.modal-backdrop {
    --bs-backdrop-opacity: 0.15 !important;
    background-color: rgba(0, 0, 0, 0.15) !important;
}
table.dataTable thead th,
table.dataTable thead tr th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-size: 0.68rem !important;
    font-weight: 400 !important;
    padding: 0.35rem 0.6rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ============================================================
   Fichas de resumen del dashboard
   ============================================================ */
.ficha-resumen {
    min-width: 90px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
}
.ficha-resumen:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateY(-1px);
}