/* ============================================================
   ESTILOS PERSONALIZADOS - SISTEMA PERMISOS PARA CIRCULAR
   Versión unificada y organizada
   ============================================================ */

/* ============================================================
   1. VARIABLES Y COLORES INSTITUCIONALES
   ============================================================ */

/* Colores CDMX */
.tx-cdmx-color1 {
    color: #9f2241 !important;
}

.tx-cdmx-color2 {
    color: #bc955c !important;
}

/* ============================================================
   2. LAYOUT Y ESTRUCTURA GENERAL
   ============================================================ */

/* Evitar overflow horizontal global */
body {
    overflow-x: hidden;
}

/* Border-radius en móvil para section-wrapper */
.br-section-wrapper {
    border-radius: 15px;
}

/* Pageheader pegado al header */
.br-pageheader {
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Mainpanel pegado al header */
.br-mainpanel {
    margin-top: 40px !important;
}

/* ============================================================
   3. HEADER PERSONALIZADO CDMX
   ============================================================ */

.br-header {
    background-color: #bc955c !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.br-header::before {
    background-color: #fff !important;
}

/* Iconos y enlaces del header */
.br-header-right a {
    color: #9f2241 !important;
}

.br-header-right a:hover,
.br-header-right a:focus {
    color: #fff !important;
}

/* Texto del header */
.br-header .logged-name {
    color: #fff !important;
}

/* Botón hamburguesa (navicon) */
.br-header .navicon-left a,
.br-header .navicon-left a i {
    color: #fff !important;
}

.br-header .navicon-left a:hover,
.br-header .navicon-left a:hover i {
    color: #fff !important;
}

/* ============================================================
   4. LOGIN
   ============================================================ */

.login-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.login-input {
    border-radius: 15px !important;
}

.login-responsive {
    width: 100%;
    max-width: 300px !important;
}

/* Sombra oscura en el fondo del login */
.bg-body-image {
    position: relative;
}

.bg-body-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.bg-body-image > form {
    position: relative;
    z-index: 1;
}

/* ============================================================
   5. FORMULARIOS
   ============================================================ */

/* Input estilo CDMX */
.form-cdmx-control {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25;
    color: #000 !important;
    background-color: #fff;
    background-image: none;
    background-clip: padding-box;
    border: 2px solid #9f2241;
    border-radius: 20px;
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

.form-cdmx-control::placeholder {
    color: #000 !important;
    opacity: 1;
}

.form-cdmx-control:focus {
    border-color: #bc955c !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
    outline: none;
}

/* Layout de formulario con borde */
.form-layout-1 {
    border: 2px solid #ced4da;
    border-radius: 15px;
    padding: 15px;
}

/* Footer del formulario */
.form-layout-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Select2 responsive */
.select2-container {
    width: 100% !important;
}

/* ============================================================
   6. BOTONES GENERALES
   ============================================================ */

/* Botón principal CDMX */
.btn-cdmx {
    padding: 0.5rem 4.8rem;
    border-radius: 15px;
    font-weight: 600;
    background-color: #9f2241;
    color: antiquewhite;
}

/* Botón secundario CDMX */
.btn-cdmx2 {
    padding: 0.5rem 4.8rem;
    border-radius: 15px;
    font-weight: 600;
    background-color: #bc955c;
    color: rgb(5, 5, 5);
}

/* Botón Nuevo Registro */
.btn-nuevo-registro {
    padding: 10px 25px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #235B4E 0%, #10312B 100%);
    color: white;
}

.btn-nuevo-registro:hover {
    background: linear-gradient(135deg, #10312B 0%, #235B4E 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 91, 78, 0.4);
    color: white;
}

.btn-nuevo-registro i {
    font-size: 16px;
}

/* Botones Eliminar Usuario */
#btneliminar,
#btnverinfo {
    white-space: nowrap;
}

/* ============================================================
   7. EFECTOS DE TEXTO
   ============================================================ */

.tx-outline {
    text-shadow: 
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.tx-outline-white {
    text-shadow: 
        -1px -1px 0 #fff,
         1px -1px 0 #fff,
        -1px  1px 0 #fff,
         1px  1px 0 #fff;
}

.tx-outline-thick {
    text-shadow: 
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000;
}

.tx-glow {
    text-shadow: 0 0 10px #9f2241, 0 0 20px #9f2241;
}

/* ============================================================
   8. DATATABLES - ESTILOS BASE
   ============================================================ */

/* Tabla general */
.datatable-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
}

/* Header de la tabla */
.datatable-custom thead tr {
    background-color: #6d1a36;
    color: #ffffff;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.datatable-custom thead th {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 15px 12px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    white-space: normal;
    word-break: break-word;
}

/* Iconos de ordenamiento */
.datatable-custom thead th.sorting::before,
.datatable-custom thead th.sorting::after {
    opacity: 0.3;
}

.datatable-custom thead th.sorting_asc::after,
.datatable-custom thead th.sorting_desc::before {
    opacity: 1;
    color: #ffd700;
}

/* Filas del body */
.datatable-custom tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.datatable-custom tbody tr:nth-of-type(odd) {
    background-color: #fffef5 !important;
}

.datatable-custom tbody tr:nth-of-type(even) {
    background-color: #fffde7 !important;
}

.datatable-custom tbody tr:hover {
    background-color: #f4d4dc !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(109, 26, 54, 0.2);
    cursor: pointer;
}

.datatable-custom tbody td {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 15px;
    padding: 12px 10px;
    vertical-align: middle;
    color: #333333;
    white-space: normal;
    word-break: break-word;
}

.datatable-custom tbody tr:last-of-type {
    border-bottom: 3px solid #6d1a36;
}

/* Centrar última columna (acciones) */
.datatable-custom td:last-child {
    text-align: center;
    white-space: nowrap;
}

/* ============================================================
   9. DATATABLES - BOTONES DE ACCIÓN
   ============================================================ */

.btn-action {
    padding: 6px 12px;
    margin: 0 3px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-action i {
    font-size: 1em;
}

/* Botón Ver/PDF (Guinda) */
.btn-action.btn-view {
    background: linear-gradient(135deg, #611232 0%, #9a2150 100%);
    color: white;
}

.btn-action.btn-view:hover {
    background: linear-gradient(135deg, #9a2150 0%, #611232 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 26, 54, 0.4);
}

/* Botón Editar (Verde) */
.btn-action.btn-edit {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-action.btn-edit:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

/* Botón Eliminar (Rojo) */
.btn-action.btn-delete {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-action.btn-delete:hover {
    background: linear-gradient(135deg, #f45c43 0%, #eb3349 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 51, 73, 0.4);
}

/* Botón Info (Azul) */
.btn-action.btn-info-custom {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
}

.btn-action.btn-info-custom:hover {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.4);
}

/* ============================================================
   10. DATATABLES - CONTROLES (Paginación, Búsqueda, etc.)
   ============================================================ */

/* Contenedor DataTables */
.dataTables_wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* Layout flex */
.dataTables_wrapper > .d-flex {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* Paginación */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 14px !important;
    margin: 0 3px !important;
    border-radius: 6px !important;
    border: 1px solid #dee2e6 !important;
    background: white !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #611232 0%, #9a2150 100%) !important;
    color: white !important;
    border-color: #611232 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(109, 26, 54, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #611232 0%, #9a2150 100%) !important;
    color: white !important;
    border-color: #611232 !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 8px;
}

/* Búsqueda */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    margin-left: 8px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #611232;
    outline: none;
    box-shadow: 0 0 8px rgba(109, 26, 54, 0.3);
}

.dataTables_wrapper .dataTables_filter {
    margin: 0;
}

.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
}

/* Select de registros */
.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 12px;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: #611232;
    outline: none;
    box-shadow: 0 0 8px rgba(109, 26, 54, 0.3);
}

/* Info de registros */
.dataTables_wrapper .dataTables_info {
    padding-top: 12px;
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

/* Botones de exportación */
.dt-buttons {
    margin-bottom: 15px;
}

.dataTables_wrapper .dt-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0 !important;
}

.dt-buttons .dt-button {
    background: linear-gradient(135deg, #611232 0%, #9a2150 100%) !important;
    border: none !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    margin-right: 8px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.dt-buttons .dt-button:hover {
    background: linear-gradient(135deg, #9a2150 0%, #611232 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 26, 54, 0.4) !important;
}

/* Loading state */
.dataTables_processing {
    background: linear-gradient(135deg, #611232 0%, #9a2150 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 20px !important;
    font-weight: 600 !important;
}

/* Search container */
.dataTables_wrapper .dt-search {
    display: flex;
    align-items: center;
}

/* ============================================================
   11. DATATABLES - PATRONES DE HEADER
   ============================================================ */

/* D1: Puntos */
.dt-pattern-d1 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239a2150' fill-opacity='0.4'%3E%3Ccircle cx='3' cy='3' r='2'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* D2: Diagonal */
.dt-pattern-d2 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239a2150' fill-opacity='0.3'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* D3: Líneas finas */
.dt-pattern-d3 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239a2150' fill-opacity='0.4'%3E%3Cpath d='M5 0h1L0 5v1zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* D4: Cuadros */
.dt-pattern-d4 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239a2150' fill-opacity='0.25'%3E%3Crect x='0' y='0' width='20' height='20'/%3E%3Crect x='20' y='20' width='20' height='20'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* D5: Rombos */
.dt-pattern-d5 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0L16 8L8 16L0 8z' fill='%239a2150' fill-opacity='0.25'/%3E%3C/svg%3E") !important;
}

/* D6: Ondas */
.dt-pattern-d6 thead tr {
    background-color: #611232 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.184 20c.357-.13.72-.264 1.088-.402l1.768-.661C33.64 15.347 39.647 14 50 14c10.271 0 15.362 1.222 24.629 4.928.955.383 1.869.74 2.75 1.072h6.225c-2.51-.73-5.139-1.691-8.233-2.928C65.888 13.278 60.562 12 50 12c-10.626 0-16.855 1.397-26.66 5.063l-1.767.662c-2.475.923-4.66 1.674-6.724 2.275h6.335zm0-20C13.258 2.892 8.077 4 0 4V2c5.744 0 9.951-.574 14.85-2h6.334zM77.38 0C85.239 2.966 90.502 4 100 4V2c-6.842 0-11.386-.542-16.396-2h-6.225zM0 14c8.44 0 13.718-1.21 22.272-4.402l1.768-.661C33.64 5.347 39.647 4 50 4c10.271 0 15.362 1.222 24.629 4.928C84.112 12.722 89.438 14 100 14v-2c-10.271 0-15.362-1.222-24.629-4.928C65.888 3.278 60.562 2 50 2 39.374 2 33.145 3.397 23.34 7.063l-1.767.662C13.223 10.84 8.163 12 0 12v2z' fill='%239a2150' fill-opacity='0.2'/%3E%3C/svg%3E") !important;
}

/* ============================================================
   12. BADGES DE ROLES
   ============================================================ */

.badge-rol {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-superadmin {
    background: linear-gradient(135deg, #9f2241 0%, #6d1a36 100%);
    color: white;
}

.badge-admin {
    background: linear-gradient(135deg, #235B4E 0%, #10312B 100%);
    color: white;
}

.badge-usuario {
    background: linear-gradient(135deg, #bc955c 0%, #8a6d3b 100%);
    color: white;
}

/* ============================================================
   13. VISTA ELIMINAR USUARIO - Específico
   ============================================================ */

#row-eliminar-usuario {
    margin-bottom: 10px !important;
}

#row-eliminar-usuario .col-lg-6,
#row-eliminar-usuario .col-lg-3 {
    margin-bottom: 5px !important;
}

/* ============================================================
   14. RESPONSIVE - DESKTOP PEQUEÑO (max-width: 1200px)
   ============================================================ */

@media screen and (max-width: 1200px) {
    /* Ajustar DataTables para desktop pequeño */
    .datatable-custom {
        font-size: 0.88em;
    }
}

/* ============================================================
   15. RESPONSIVE - TABLET (max-width: 992px)
   ============================================================ */

@media screen and (max-width: 992px) {
    /* Formulario Eliminar Usuario */
    .form-layout-1 .col-lg-6 {
        margin-bottom: 15px;
    }

    .form-layout-1 .col-lg-3 {
        margin-bottom: 10px;
    }
}

/* ============================================================
   16. RESPONSIVE - TABLET PEQUEÑA (max-width: 768px)
   ============================================================ */

@media screen and (max-width: 768px) {
    /* DataTables general */
    .datatable-custom {
        font-size: 0.85em;
    }

    .btn-action {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 6px 10px !important;
    }

    /* Quitar hover en móvil */
    .datatable-custom tbody tr:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Toolbar y controles DataTables */
    #toolbar-usuarios {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }

    .btn-nuevo-registro {
        width: 100%;
        justify-content: center;
    }

    /* ========================================
       TABLA MIS PERMISOS (#permisos_data)
       Prioridad: Folio + Botones (Recibo/Permiso)
       Ocultar: Expedición, Vigencia
       ======================================== */
    #permisos_data th:nth-child(4),
    #permisos_data td:nth-child(4),
    #permisos_data th:nth-child(5),
    #permisos_data td:nth-child(5) {
        display: none !important;
    }

    /* Hacer botones más visibles en tablet */
    #permisos_data .btn-action {
        min-width: 70px;
        font-size: 0.75em;
    }

    /* ========================================
       TABLA USUARIOS ELIMINADOS (#tabla_eliminados)
       Prioridad: ID, Nombre, Acciones
       Ocultar: Rol, Folios, Fecha
       ======================================== */
    #tabla_eliminados th:nth-child(4),
    #tabla_eliminados td:nth-child(4),
    #tabla_eliminados th:nth-child(5),
    #tabla_eliminados td:nth-child(5),
    #tabla_eliminados th:nth-child(6),
    #tabla_eliminados td:nth-child(6) {
        display: none !important;
    }

    /* ========================================
       TABLA CREAR USUARIOS (#usuarios_data)
       Prioridad: ID, Nombre, Acciones
       Ocultar: Teléfono, Rol
       ======================================== */
    #usuarios_data th:nth-child(4),
    #usuarios_data td:nth-child(4),
    #usuarios_data th:nth-child(5),
    #usuarios_data td:nth-child(5) {
        display: none !important;
    }

    /* ========================================
       TABLA INICIO (#inicio_permisos_data)
       Se maneja específicamente más abajo
       ======================================== */
}

/* ============================================================
   17. RESPONSIVE - MÓVIL (max-width: 576px)
   ============================================================ */

@media screen and (max-width: 576px) {
    /* Login responsive */
    .login-responsive {
        max-width: 350px !important;
    }

    /* Botones generales */
    .btn-cdmx,
    .btn-cdmx2,
    .btn-nuevo-registro {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 14px;
        white-space: normal;
        text-align: center;
    }

    /* Botones Eliminar Usuario */
    #btneliminar,
    #btnverinfo {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* Panel información */
    #info_usuario .card-body p {
        font-size: 13px;
        margin-bottom: 8px;
    }

    #info_usuario .card-body {
        padding: 15px;
    }

    /* Footer formulario */
    .form-layout-footer {
        flex-direction: column;
        gap: 15px;
    }

    .form-layout-footer .btn {
        width: 100%;
    }

    /* DataTables controles */
    .dataTables_wrapper > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_filter {
        justify-content: center;
        width: 100%;
    }

    /* Búsqueda DataTables full width */
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .dataTables_wrapper {
        overflow-x: auto;
    }

    table.datatable-custom {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Compactar tabla */
    .datatable-custom thead th,
    .datatable-custom tbody td {
        padding: 10px 6px !important;
    }

    /* ========================================
       MÓVIL: Botones MIS PERMISOS más grandes
       ======================================== */
    #permisos_data .btn-action {
        min-width: 60px !important;
        padding: 8px 10px !important;
        font-size: 0.8em !important;
        display: inline-flex !important;
        gap: 4px !important;
    }

    /* Mostrar texto en botones de descarga */
    #permisos_data .btn-action .btn-text {
        display: inline !important;
    }

    /* Columna de acciones más ancha */
    #permisos_data td:last-child,
    #permisos_data th:last-child {
        min-width: 140px !important;
    }
}

/* ============================================================
   18. RESPONSIVE - MÓVIL PEQUEÑO (max-width: 480px)
   ============================================================ */

@media screen and (max-width: 480px) {
    /* Botones de acción - Solo iconos */
    .btn-action {
        padding: 6px !important;
        min-width: 34px !important;
        margin: 0 1px !important;
        gap: 0 !important;
        justify-content: center;
    }

    .btn-action .btn-text {
        display: none !important;
    }

    .btn-action i {
        font-size: 1.1em !important;
        margin: 0 !important;
    }

    /* Celdas compactas */
    .datatable-custom td,
    .datatable-custom th {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }

    /* Tabla Usuarios Eliminados - Ocultar también Correo */
    #tabla_eliminados th:nth-child(3),
    #tabla_eliminados td:nth-child(3) {
        display: none !important;
    }

    /* Tabla Crear Usuarios - Ocultar también Correo */
    #usuarios_data th:nth-child(3),
    #usuarios_data td:nth-child(3) {
        display: none !important;
    }

    /* ========================================
       TABLA FOLIOS (#tabla_folios)
       Ocultar: Asignados, Utilizados, Fecha, Asignó
       Mantener: ID, Usuario, Disponibles, Ver
       ======================================== */
    #tabla_folios th:nth-child(3),
    #tabla_folios td:nth-child(3),
    #tabla_folios th:nth-child(4),
    #tabla_folios td:nth-child(4),
    #tabla_folios th:nth-child(6),
    #tabla_folios td:nth-child(6),
    #tabla_folios th:nth-child(7),
    #tabla_folios td:nth-child(7) {
        display: none !important;
    }

    /* ========================================
       TABLA INICIO (#inicio_permisos_data)
       Ocultar: Marca, Expedición, Vigencia
       Mantener: Folio, Estado
       ======================================== */
    #inicio_permisos_data th:nth-child(2),
    #inicio_permisos_data td:nth-child(2),
    #inicio_permisos_data th:nth-child(3),
    #inicio_permisos_data td:nth-child(3),
    #inicio_permisos_data th:nth-child(4),
    #inicio_permisos_data td:nth-child(4) {
        display: none !important;
    }
}

/* ============================================================
   19. RESPONSIVE - MÓVIL MUY PEQUEÑO (max-width: 370px)
   ============================================================ */

@media screen and (max-width: 370px) {
    /* Toolbar usuarios - separar botón de búsqueda */
    #toolbar-usuarios {
        margin-bottom: 15px;
    }

    .btn-nuevo-registro {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    /* Búsqueda más compacta */
    .dataTables_wrapper .dataTables_filter input {
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Tablas ultra compactas */
    .datatable-custom {
        font-size: 0.75em;
    }

    .datatable-custom td,
    .datatable-custom th {
        padding: 5px 3px !important;
        font-size: 10px !important;
    }

    /* Botones de acción más pequeños */
    .btn-action {
        padding: 5px !important;
        min-width: 30px !important;
    }

    .btn-action i {
        font-size: 1em !important;
    }

    /* Paginación compacta */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 5px 8px !important;
        font-size: 11px !important;
        margin: 0 2px !important;
    }

    /* Info de registros más pequeña */
    .dataTables_wrapper .dataTables_info {
        font-size: 11px;
    }

    /* Botones principales más pequeños */
    .btn-cdmx,
    .btn-cdmx2 {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }
}

/* ============================================================
   20. RESPONSIVE - LOGIN BREAKPOINTS
   ============================================================ */

@media (min-width: 300px) {
    .login-responsive {
        max-width: 300px !important;
    }
}

@media (min-width: 350px) {
    .login-responsive {
        max-width: 350px !important;
    }
}

@media (min-width: 400px) {
    .login-responsive {
        max-width: 380px !important;
    }
}

@media (min-width: 576px) {
    .login-responsive {
        max-width: 650px !important;
    }
}


/* ============================================================
   21. MEJORAS RESPONSIVE ADICIONALES - DATATABLE SCROLL
   ============================================================ */

/* Para pantallas entre 800px y 576px - scroll horizontal suave */
@media screen and (min-width: 577px) and (max-width: 800px) {
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.datatable-custom {
        min-width: 600px;
    }

    /* Compactar un poco más */
    .datatable-custom {
        font-size: 0.82em;
    }

    .datatable-custom thead th,
    .datatable-custom tbody td {
        padding: 10px 8px;
    }
}

/* Asegurar que el wrapper de card no cause overflow */
.card-body {
    overflow-x: hidden;
}

.br-pagebody {
    overflow-x: hidden;
}