/* ================================================
   BOMBEROS ISLA DE MAIPO - THEME (DEPURADO)
   - Sin duplicados ni parches contradictorios
   - Tablas globales limpias (sin borde verde)
   - DataTables consistente (toolbar + botones + scroll)
   ================================================ */

:root {
    /* Colores Institucionales */
    --primary-color: #1b7340;
    --secondary-color: #0d5c31;
    --accent-color: #c62828;
    --success-color: #2e7d45;
    --warning-color: #f57c00;
    --danger-color: #c62828;
    --info-color: #0288d1;
    --dark-color: #1a1a1a;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --text-muted: #64748b;
    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --navbar-height: 70px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Tablas */
    --table-head-bg: rgba(27, 115, 64, 0.50); /* Verde institucional 50% */
    --table-head-text: #ffffff;
    --table-row-hover: rgba(27, 115, 64, 0.06);
    --table-row-border: rgba(15, 23, 42, 0.08);
    /* Contornos suaves neutrales */
    --ui-border: rgba(15, 23, 42, 0.12);
    --ui-border-strong: rgba(15, 23, 42, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #2c3e50;
    background-color: #f0f2f5;
    line-height: 1.6;
}

/* Evitar scroll horizontal GLOBAL (se habilita solo en main.page-content) */
html, body {
    overflow-x: hidden;
}

/* ================================================
   WRAPPER & LAYOUT
   ================================================ */

.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.wrapper.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ================================================
   SIDEBAR (APOLLO - CLARO)
   ================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #ffffff !important;
    color: #1f2937;
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 12px 35px rgba(15, 23, 42, .06);
}

    /* Sidebar scrollbar */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(15, 23, 42, .15);
        border-radius: 3px;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(15, 23, 42, .25);
        }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

.sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(15, 23, 42, .08) !important;
    padding: 20px 16px !important;
    min-height: 85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .12);
    border: 1px solid rgba(15, 23, 42, .08);
    padding: 8px;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
}

.brand-title {
    color: #0f172a !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px;
    margin: 0;
}

.brand-subtitle {
    color: rgba(15, 23, 42, .65) !important;
    font-size: 11.5px !important;
    font-weight: 500;
    line-height: 1.4;
}

/* Toggle */
.sidebar-toggle {
    margin-top: 14px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #f8fafc;
    color: #334155;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .sidebar-toggle:hover {
        background: #eef2f7;
        transform: scale(1.05);
        box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
    }

/* Menú */
.sidebar-menu {
    padding: 16px 12px 20px 12px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 2px 0;
}

.menu-link {
    color: #0f172a !important;
    background: transparent !important;
    border-radius: 14px !important;
    padding: 11px 12px !important;
    margin: 4px 0 !important;
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    border-left: none !important;
    position: relative;
}

    .menu-link:hover {
        background: #f1f5f9 !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
        transform: translateY(-1px);
    }

.menu-item.active > .menu-link {
    background: #e8f5e9 !important;
    box-shadow: 0 4px 16px rgba(27, 115, 64, .15);
    color: #0f172a !important;
    font-weight: 700;
}

.menu-link i {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex: 0 0 38px;
    font-size: 18px;
    transition: all 0.2s ease;
}

.menu-item.active > .menu-link i {
    background: #c8e6c9;
    color: var(--primary-color);
}

.menu-arrow {
    margin-left: auto;
    opacity: .50;
}

    .menu-arrow i {
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        border-radius: 0 !important;
        font-size: 14px;
        transition: transform .15s ease;
    }

.menu-item.open > .menu-link .menu-arrow i {
    transform: rotate(90deg);
}

/* Submenú */
.submenu {
    display: none;
    margin: 4px 0 8px 0;
    padding: 0 0 0 20px;
    border-left: 2px solid rgba(15, 23, 42, .12);
    list-style: none;
}

.menu-item.open > .submenu {
    display: block;
}

.submenu .menu-link {
    padding: 9px 12px !important;
    margin: 3px 0 !important;
    font-weight: 500;
    font-size: 13px;
}

/* Empty state */
.menu-empty-state {
    padding: 40px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #f1f5f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .empty-state-icon i {
        font-size: 28px;
        color: #64748b;
    }

.empty-state-text p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    font-weight: 600;
}

/* Colapsado */
.wrapper.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.wrapper.sidebar-collapsed .brand-text,
.wrapper.sidebar-collapsed .menu-text,
.wrapper.sidebar-collapsed .menu-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.wrapper.sidebar-collapsed .submenu {
    display: none !important;
}

.wrapper.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 11px 8px !important;
}

/* Responsive sidebar */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .wrapper.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-toggle {
        display: none !important;
    }
}

/* ================================================
   NAVBAR TOP
   ================================================ */

.navbar-top {
    background: #fff;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(15, 23, 42, .08) !important;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 24px;
}

    .sidebar-toggle-btn:hover {
        background: #e8f5e9;
        transform: scale(1.05);
    }

.search-box {
    display: flex;
    align-items: center;
    background: var(--light-color);
    padding: 10px 16px;
    border-radius: 8px;
    gap: 10px;
    width: 320px;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

    .search-box:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(27, 115, 64, 0.1);
    }

    .search-box i {
        color: #78909c;
        font-size: 16px;
    }

    .search-box input {
        border: none;
        background: none;
        outline: none;
        width: 100%;
        font-size: 14px;
        color: var(--dark-color);
    }

        .search-box input::placeholder {
            color: #94a3b8;
        }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}

    .icon-btn:hover {
        background: #e8f5e9;
        transform: scale(1.05);
    }

    .icon-btn i {
        font-size: 20px;
    }

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

    .user-dropdown:hover {
        background: #e8f5e9;
    }

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid #e8f5e9;
    box-shadow: 0 2px 8px rgba(27, 115, 64, 0.2);
}

.user-name {
    font-weight: 500;
    color: var(--dark-color);
    font-size: 14px;
}

/* Navbar responsive */
@media (max-width: 768px) {
    .navbar-top {
        padding: 0 15px;
    }

    .search-box {
        display: none;
    }

    .user-name {
        display: none;
    }
}

/* ================================================
   PAGE CONTENT & FOOTER
   ================================================ */

.page-content {
    flex: 1;
    padding: 30px;
    /* Scroll horizontal SOLO aquí */
    overflow-x: auto;
    overflow-y: visible;
}

/* Footer sin línea verde */
.footer {
    background: #fff;
    padding: 20px 30px;
    border-top: 1px solid rgba(15, 23, 42, .08) !important;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #546e7a;
}

.footer-links a {
    color: #546e7a;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    margin-left: 20px;
}

    .footer-links a:hover {
        color: var(--primary-color);
    }

/* ================================================
   COMPONENTES DE PÁGINA (Breadcrumb + Divider)
   ================================================ */

.sc-page-card {
    border-radius: 12px;
}

.sc-page-body {
    background: #ffffff;
}

/* Barra horizontal SOLO en el index (usa <hr class="sc-page-divider">) */
.sc-page-divider {
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, .12);
    opacity: 1;
}

/* Breadcrumb */
.sc-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.sc-breadcrumb .breadcrumb-item a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

    .sc-breadcrumb .breadcrumb-item a:hover {
        text-decoration: underline;
    }

.sc-breadcrumb .breadcrumb-item.active {
    color: rgba(15, 23, 42, .55);
    font-weight: 600;
}

/* ================================================
   TABLAS (GLOBAL) - Bootstrap + HTML
   - Sin borde verde exterior
   - Sin separadores verticales
   - Head verde 50% compacto y uniforme
   - Hover visible
   ================================================ */

/* Reset general: evita que algún estilo previo deje “marcos” */
table,
.table,
.table-responsive,
.table-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Responsivo genérico (si usas wrappers propios) */
.sc-table-responsive,
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Head (todas las tablas) */
table thead th,
.table thead th,
table.dataTable thead th,
table.dataTable thead td {
    background: var(--table-head-bg) !important;
    color: var(--table-head-text) !important;
    border: none !important;
    padding: 8px 12px !important; /* altura “justa” */
    line-height: 1.1 !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    vertical-align: middle !important;
    white-space: nowrap;
}

/* Asegurar que no haya “doble tono” por wrappers */
table.dataTable thead,
table.dataTable thead tr {
    background: var(--table-head-bg) !important;
}

/* Body */
table tbody td,
.table tbody td,
table.dataTable tbody td {
    padding: 12px 12px !important;
    vertical-align: middle !important;
    /* SOLO separación horizontal suave */
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--table-row-border) !important;
    font-size: 14px;
    color: #2c3e50;
    white-space: nowrap; /* clave para que aparezca scroll horizontal cuando corresponda */
}

/* Hover fila (restaurado) */
table tbody tr:hover,
.table tbody tr:hover,
table.dataTable tbody tr:hover {
    background: var(--table-row-hover) !important;
}

/* Última fila sin borde inferior fuerte */
table tbody tr:last-child td,
.table tbody tr:last-child td,
table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}

/* ================================================
   DATATABLES (GLOBAL) - Toolbar + Botones + Scroll
   ================================================ */

.dataTables_wrapper {
    width: 100%;
    /* Permite que la barra horizontal aparezca dentro de main.page-content si corresponde */
    overflow: visible;
}

/* Contenedor superior (si tu JS lo arma como .dt-apollo-top / .dt-apollo-left / .dt-apollo-right) */
.dt-apollo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin: 8px 0 10px 0;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 0 !important; /* cuadrado */
    box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.dt-apollo-left,
.dt-apollo-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search */
.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: rgba(15,23,42,.75);
}

.dataTables_filter input {
    border: 1px solid rgba(15,23,42,.14);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
    min-width: 220px;
    background: #fff;
}

    .dataTables_filter input:focus {
        border-color: rgba(27,115,64,.35);
        box-shadow: 0 0 0 4px rgba(27,115,64,.10);
    }

/* Length */
.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: rgba(15,23,42,.75);
}

.dataTables_length select {
    border: 1px solid rgba(15,23,42,.14);
    border-radius: 8px;
    padding: 6px 32px 6px 12px;
    height: 38px;
    outline: none;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

    .dataTables_length select:focus {
        border-color: rgba(27,115,64,.35);
        box-shadow: 0 0 0 4px rgba(27,115,64,.10);
    }

/* Buttons: cuadrados tipo Excel */
.dt-buttons {
    display: inline-flex !important;
    gap: 8px;
    align-items: center;
}

    .dt-buttons .btn,
    .dt-buttons button,
    .dt-buttons a {
        display: inline-flex !important;
        align-items: center;
        gap: .4rem;
        height: 38px;
        padding: 0 14px;
        border-radius: 8px !important; /* cuadrado */
        font-weight: 700;
        font-size: 13px;
        background: #ffffff;
        border: 1px solid rgba(15,23,42,.18);
        color: rgba(15,23,42,.78);
        transition: transform .10s ease, box-shadow .12s ease, background .12s ease;
    }

        .dt-buttons .btn:hover,
        .dt-buttons button:hover,
        .dt-buttons a:hover {
            background: rgba(15,23,42,.03);
            transform: translateY(-1px);
            box-shadow: 0 6px 14px rgba(0,0,0,.10);
        }

    /* Si quieres mantener tu semántica por tipo */
    .dt-buttons .buttons-excel {
        border-color: rgba(25,135,84,.45);
        color: #198754;
    }

    .dt-buttons .buttons-pdf {
        border-color: rgba(220,53,69,.45);
        color: #dc3545;
    }

    .dt-buttons .buttons-copy {
        border-color: rgba(15,23,42,.18);
        color: rgba(15,23,42,.70);
    }

/* Scroll horizontal DataTables
   - Si usas scrollX (DataTables crea .dataTables_scrollBody) se asegura la barra.
   - Si NO usas scrollX, el nowrap hará que el <table> exceda y main.page-content mostrará la barra. */
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Asegura que DataTables no “aplane” el ancho cuando hay muchas columnas */
table.dataTable {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

    /* Mantener thead visible */
    table.dataTable thead {
        display: table-header-group !important;
    }

/* ================================================
   DATATABLES (BOTTOM) - Info + Pagination limpia
   - Sin bordes / sin pill / sin fondo
   ================================================ */

.dt-apollo-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 0;
}

.dataTables_info {
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

/* Quitar cualquier “marco” que algún estilo previo deje en paginación */
.pagination-container,
.table-pagination,
.dataTables_wrapper .dataTables_paginate {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* Paginación DataTables (paginate_button) sin formato */
.dataTables_paginate {
    display: flex;
    gap: 8px;
    align-items: center;
}

    /* Botones */
    .dataTables_paginate .paginate_button {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 .35rem !important;
        min-width: auto !important;
        height: auto !important;
        line-height: normal !important;
        color: rgba(15,23,42,.75) !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        cursor: pointer;
    }

        /* Hover */
        .dataTables_paginate .paginate_button:hover {
            background: transparent !important;
            color: rgba(15,23,42,.95) !important;
            text-decoration: underline;
        }

        /* Actual (sin verde) */
        .dataTables_paginate .paginate_button.current {
            background: transparent !important;
            border: none !important;
            color: rgba(15,23,42,.95) !important;
            font-weight: 800 !important;
            text-decoration: underline;
        }

        /* Disabled */
        .dataTables_paginate .paginate_button.disabled {
            opacity: .45 !important;
            cursor: not-allowed !important;
            text-decoration: none !important;
        }

/* ================================================
   BADGES (Estado)
   ================================================ */

.badge-status,
td .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

    .badge-success,
    .badge-status.activo {
        background: #e8f5e9;
        color: var(--primary-color);
        border: 1px solid #81c784;
    }

    .badge-secondary,
    .badge-status.baja {
        background: #f5f5f5;
        color: #757575;
        border: 1px solid #bdbdbd;
    }

    .badge-danger,
    .badge-status.inactivo {
        background: #ffebee;
        color: #c62828;
        border: 1px solid #ef5350;
    }

/* ================================================
   BOTONES DE ACCIÓN EN TABLA
   ================================================ */

.btn-action,
.dt-actions .btn,
table .btn-sm {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

    .btn-action:hover,
    .dt-actions .btn:hover,
    table .btn-sm:hover {
        transform: scale(1.06);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1199px) {
    :root {
        --sidebar-width: 260px;
    }

    .search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 15px;
    }

    .dt-apollo-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .dt-apollo-left,
    .dt-apollo-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .dataTables_filter input {
        min-width: 100%;
    }

    .dt-apollo-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .dataTables_paginate {
        justify-content: center;
        flex-wrap: wrap;
    }
}
/* ================================
   DATATABLES - TOPBAR SIN BORDE
   ================================ */
.dt-apollo-top {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    margin: 8px 0 10px 0 !important;
}

/* Alinear elementos del topbar:
   left: length (Mostrar)
   right: search + buttons */
.dt-apollo-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dt-apollo-search {
    display: flex;
    align-items: center;
}

/* ================================
   HOVER FILAS (FORZADO)
   ================================ */
table.dataTable tbody tr:hover,
.table tbody tr:hover,
table tbody tr:hover {
    background: rgba(27,115,64,.10) !important;
}

    table.dataTable tbody tr:hover > *,
    .table tbody tr:hover > *,
    table tbody tr:hover > * {
        background: rgba(27,115,64,.10) !important;
    }

/* ================================
   SCROLL HORIZONTAL REAL
   - La barra debe aparecer en el contenedor del DataTable
   ================================ */
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* CLAVE: permitir que la tabla exceda ancho */
.dataTables_scrollBody table.dataTable {
    width: max-content !important;
    min-width: 100% !important;
}

/* Evita quiebres (gatilla overflow) */
table.dataTable th,
table.dataTable td {
    white-space: nowrap;
}
/* =======================================================================
   FIX GLOBAL - DataTables scrollX visible + “responsive real” por scroll
   (Pegar al FINAL del bomberos-theme.css)
   ======================================================================= */

/* 1) Tu wrapper Apollo NO puede ocultar overflow, porque mata la barra */
.dt-apollo-table {
    overflow: visible !important; /* antes: hidden */
    border-radius: 12px;
}

/* 2) Cuando DataTables usa scrollX, crea estos contenedores.
      Aquí forzamos que el scroll horizontal sea visible */
.dataTables_wrapper .dataTables_scroll {
    overflow: visible !important;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: hidden !important; /* evita doble scrollbar vertical */
    -webkit-overflow-scrolling: touch;
}

/* 3) Evita que el head quede “partido” visualmente y asegura uniformidad */
.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollHeadInner {
    width: 100% !important;
}

.dataTables_wrapper table.dataTable {
    width: 100% !important;
    margin: 0 !important;
}

/* 4) Hover visible (si algo lo estaba anulando en overrides previos) */
table.dataTable tbody tr:hover,
.table tbody tr:hover {
    background: rgba(15,23,42,.045) !important;
}

/* 5) Si quieres que el scroll esté acotado al main.page-content, esto ayuda.
      Nota: sólo se verá si REALMENTE hay overflow horizontal. */
main.page-content {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
/* =========================================================
   DATATABLES – RESPONSIVE REAL POR SCROLL HORIZONTAL
   (bloque final; no afecta componentes fuera de DataTables)
   ========================================================= */

/* 1) El contenedor que contiene la barra horizontal DEBE poder scrollear */
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* 2) Evitar que DataTables “aplane” la tabla y la haga caber a la fuerza
      (esto es lo que hoy te está impidiendo ver la barra) */
.dataTables_wrapper table.dataTable {
    table-layout: auto !important;
}

    /* 3) Regla clave: el contenido NO debe hacer wrap, para que el ancho real exceda
      cuando corresponda (pantalla chica / muchas columnas) */
    .dataTables_wrapper table.dataTable th,
    .dataTables_wrapper table.dataTable td {
        white-space: nowrap !important;
    }

/* 4) Forzar que, cuando el contenido sea ancho, el table pueda crecer
      y el scrollX se active. */
.dataTables_wrapper .dataTables_scrollBody table.dataTable {
    width: max-content !important;
    min-width: 100% !important;
}

/* 5) Si tu wrapper Apollo aún limita overflow, neutralízalo sin tocar layout general */
.dt-apollo-table {
    overflow: visible !important;
}
/* =========================================================
   FIX FINAL: Scroll horizontal REAL en DataTables (sin romper diseño)
   ========================================================= */

/* (A) En layouts flex, esto es clave para permitir overflow de hijos */
.main-content,
.page-content {
    min-width: 0; /* permite que el contenido pueda desbordar horizontalmente */
}

/* (B) La barra horizontal debe existir en el contenedor scroll de DataTables */
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

    /* (C) CLAVE: NO forzar width:100% en el TABLE dentro del scrollBody
   -> debe poder crecer (max-content) para que exista overflow-x */
    .dataTables_wrapper .dataTables_scrollBody table.dataTable {
        width: max-content !important;
        min-width: 100% !important;
    }

/* (D) Encabezado alineado con el body (cuando scrollX está activo) */
.dataTables_wrapper .dataTables_scrollHeadInner,
.dataTables_wrapper .dataTables_scrollHeadInner table {
    width: max-content !important;
    min-width: 100% !important;
}

/* (E) Evita que el contenido haga wrap (gatilla overflow-x) */
.dataTables_wrapper table.dataTable th,
.dataTables_wrapper table.dataTable td {
    white-space: nowrap !important;
}
/* ============================
   MENU TREE TABLE (Index Menú)
   ============================ */
.menu-tree-table .menu-icon-preview {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
}

.menu-tree-table .menu-title-cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: calc(var(--lvl) * 18px);
}

.menu-tree-table .menu-node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(15,23,42,.25);
    display: inline-block;
    flex: 0 0 10px;
}

    .menu-tree-table .menu-node-dot.is-parent {
        background: rgba(27,115,64,.65);
    }

.menu-tree-table .menu-tree-guides {
    position: absolute;
    left: calc(var(--lvl) * 18px - 10px);
    top: -14px;
    bottom: -14px;
    width: 10px;
    border-left: 2px solid rgba(15,23,42,.10);
    pointer-events: none;
}

.menu-tree-table .menu-url {
    background: rgba(15,23,42,.03);
    border: 1px solid rgba(15,23,42,.10);
    padding: 2px 6px;
    border-radius: 8px;
    display: inline-block;
}
/* Tree controls */
.menu-tree-table .menu-toggle {
    padding: 2px 6px;
    line-height: 1;
    border-radius: 8px;
}

.menu-tree-table .menu-toggle-spacer {
    width: 34px; /* misma huella que el botón */
    display: inline-block;
}

.menu-tree-table tr.is-collapsed > td .menu-toggle i {
    transform: rotate(-90deg);
    display: inline-block;
}

/* Ocultamiento de ramas */
.menu-tree-table tr.is-hidden {
    display: none !important;
}

.menu-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(15,23,42,.15);
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    user-select: none;
    font-weight: 700;
    line-height: 1;
}

.sortable-chosen .menu-drag-handle {
    cursor: grabbing;
}

/* =============================================================
   DASHBOARDPACK-LIKE MENU (para _MenuPartial.cshtml)
   - Replica el look&feel base de .menu-sidebar-container (DashboardPack.css)
   - Mantiene la fuente/clases de íconos existentes (FontAwesome/Bootstrap Icons)
   ============================================================= */

:root {
    /* Acento Dashpack */
    --menu-accent: #6770d2;
    --menu-accent-2: #667eea; /* opcional para gradientes */
    --menu-accent-3: #764ba2; /* opcional para gradientes */
}

/* Limita los overrides al menú Apollo para no afectar otras listas */
.sidebar-menu.apollo-menu .menu-list {
    padding: 0;
}

.sidebar-menu.apollo-menu .menu-item {
    margin: 0; /* el espacio lo maneja el link */
}

/* Estilo tipo "pill" como DashboardPack (.menu-sidebar-container li a) */
.sidebar-menu.apollo-menu .menu-link {
    border-radius: 50px !important;
    padding: .5rem 1.25rem !important;
    margin: .3rem .25rem !important;
    background: transparent !important;
    box-shadow: none;
    transform: none;
    color: #1f2937 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .75rem;
}

    /* Hover/active: fondo acento + texto blanco (DashboardPack hover/current) */
    .sidebar-menu.apollo-menu .menu-link:hover,
    .sidebar-menu.apollo-menu .menu-item.active > .menu-link {
        background: var(--menu-accent) !important;
        color: #fff !important;
        box-shadow: 0 .46875rem 2.1875rem rgba(13, 16, 45, .10);
    }

    /* Iconos: mantener font actual; estilizar para calzar con DashboardPack */
    .sidebar-menu.apollo-menu .menu-link > i {
        width: 22px;
        min-width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        line-height: 1;
        border-radius: 0; /* sin caja */
        background: transparent; /* sin fondo */
        color: inherit; /* hereda del link */
        opacity: .85;
        transition: opacity .15s ease;
    }

    .sidebar-menu.apollo-menu .menu-link:hover > i,
    .sidebar-menu.apollo-menu .menu-item.active > .menu-link > i {
        opacity: 1;
    }

/* Texto del menú (si existe .menu-text en el HTML que viene de Html.Action) */
.sidebar-menu.apollo-menu .menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flecha: mantener bi-chevron-right; alinear y heredar color */
.sidebar-menu.apollo-menu .menu-arrow {
    margin-left: auto;
    opacity: .75;
}

    .sidebar-menu.apollo-menu .menu-arrow i {
        color: inherit;
        font-size: 14px;
    }

.sidebar-menu.apollo-menu .menu-item.open > .menu-link .menu-arrow i {
    transform: rotate(90deg);
}

/* Submenú: mismo estilo pill + indent suave (sin borde izquierdo duro) */
.sidebar-menu.apollo-menu .submenu {
    display: none;
    list-style: none;
    margin: .2rem 0 .6rem 0;
    padding: 0;
}

.sidebar-menu.apollo-menu .menu-item.open > .submenu {
    display: block;
}

.sidebar-menu.apollo-menu .submenu .menu-link {
    font-size: 13px;
    font-weight: 500;
    padding: .45rem 1.25rem .45rem 2.1rem !important; /* indent */
    margin: .25rem .25rem !important;
    border-radius: 50px !important;
}

    /* El ícono en submenú (si viene) se mantiene, pero más discreto */
    .sidebar-menu.apollo-menu .submenu .menu-link > i {
        font-size: 14px;
        opacity: .80;
    }

/* Al colapsar sidebar: centrar ícono y ocultar texto/flecha como ya estaba */
.wrapper.sidebar-collapsed .sidebar-menu.apollo-menu .menu-link {
    justify-content: center;
    padding: .55rem .5rem !important;
}

    .wrapper.sidebar-collapsed .sidebar-menu.apollo-menu .menu-link > i {
        width: 24px;
        min-width: 24px;
    }

/* (Opcional) realce sutil en hover con gradiente Dashpack en pantallas grandes */
@media (min-width: 992px) {
    .sidebar-menu.apollo-menu .menu-link:hover {
        background-image: linear-gradient(135deg, var(--menu-accent-2) 0, var(--menu-accent-3) 100%) !important;
    }

    .sidebar-menu.apollo-menu .menu-item.active > .menu-link {
        background-image: linear-gradient(135deg, var(--menu-accent-2) 0, var(--menu-accent-3) 100%) !important;
    }
}
