.offcanvas-wide {
    width: 100%;
}

@media (min-width: 768px) {
    .offcanvas-wide {
        width: 700px;
    }
}

.offcanvas-body {
    overflow: visible !important;
}

td.wrap-text {
    white-space: normal !important;
    word-break: break-word;
}

.salto-linea div {
    display: block;
    margin-bottom: 4px;
    white-space: pre-line;
    word-break: break-word;
    /* Fuerza salto en palabras largas */
}

/* Ajuste general de columnas con contenido largo */
#table_objeespe td:nth-child(3),
#table_objeespe td:nth-child(4),
#table_objeespe td:nth-child(5) {
    max-width: 350px;
    min-width: 250px;
    white-space: normal !important;
    word-break: break-word;
    vertical-align: middle;
}

/* Aumentar el ancho de cabecera también */
#table_objeespe th:nth-child(3),
#table_objeespe th:nth-child(4),
#table_objeespe th:nth-child(5) {
    max-width: 350px;
    min-width: 250px;
    white-space: normal;
}

/* Opcional: alinear texto justificado si deseas aún más estética */
#table_objeespe td:nth-child(3),
#table_objeespe td:nth-child(4) {
    text-align: justify;
}

/* Suavizar botones */
#table_objeespe .btn {
    padding: 3px 8px;
    font-size: 14px;
}

/* Alinear texto de celdas en child rows */
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details>li {
    text-align: left !important;
}

/* Alinear títulos como “Metas”, “Acciones” */
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details>li>span.dtr-title {
    text-align: left !important;
    font-weight: 600;
}

/* Alinear el contenido */
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details>li>span.dtr-data {
    text-align: left !important;
}

/* ======================================================
   CSS OPTIMIZADO PARA TABLA EMPRESA (CORREGIDO)
   ====================================================== */

/* Estilo base para todas las celdas */
#table_empresa td,
#table_empresa th {
    white-space: nowrap; /* evita quiebre de línea innecesario */
    overflow-wrap: break-word;
    vertical-align: middle;
    min-width: 120px;
    max-width: 320px;
    padding: 6px 10px;
    text-overflow: ellipsis;
}

/* Columnas largas (Dirección, Horario, Email, URL) */
#table_empresa td:nth-child(7),
#table_empresa td:nth-child(8),
#table_empresa td:nth-child(9),
#table_empresa td:nth-child(10) {
    max-width: 350px;
    min-width: 180px;
    text-align: justify;
    white-space: normal; /* permite salto de línea */
}

/* Encabezados de columnas largas */
#table_empresa th:nth-child(7),
#table_empresa th:nth-child(8),
#table_empresa th:nth-child(9),
#table_empresa th:nth-child(10) {
    white-space: normal;
}

/* Columna NIT */
#table_empresa td:nth-child(4),
#table_empresa th:nth-child(4) {
    min-width: 160px;
    max-width: 200px;
    font-weight: lighter;
    letter-spacing: 1px;
}

/* Botón de expansión a la izquierda */
#table_empresa td.control,
#table_empresa th.control {
    text-align: left !important;
    padding-left: 8px;
}

/* Responsividad general */
#table_empresa {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* permite que las columnas se ajusten al contenido */
}

/* Ajustes para pantallas pequeñas */
@media screen and (max-width: 768px) {
    #table_empresa td,
    #table_empresa th {
        font-size: 14px;
        padding: 4px 6px;
        white-space: normal;
    }

    #table_empresa td:nth-child(4) {
        font-size: 13px;
        letter-spacing: 0.5px;
    }
}

/* ======================================================
   👤 Imagen circular en previsualización de empresa
   ====================================================== */
/* respaldo por si acaso */
#PRE_IMG img.img-preview-circle-manual {
    width: 160px !important;
    height: 160px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
    margin: 10px auto !important;
    max-width: 100% !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    border: 2px solid #dee2e6 !important;
}

/*=================================================================
CSS SUCURSAL
=================================================================*/
#table_sucursal td:nth-child(3),
/* Gerente */
#table_sucursal td:nth-child(4),
/* sucursal */
#table_sucursal td:nth-child(5),
/* teléfono */
#table_sucursal td:nth-child(6),
/* Direción */
#table_sucursal td:nth-child(7),

/*=================================================================
CSS ÁREA DE LA EMPRESA
=================================================================*/
#table_data td:nth-child(2) {
    white-space: normal !important;
    word-break: break-word;
    min-width: 150px;
    max-width: 300px;
}

/*=================================================================
CSS CARGOS DE LA EMPRESA
=================================================================*/
/* Para tabla principal */
#table_cargos td:nth-child(2),
#table_cargos td:nth-child(3) {
    white-space: normal !important;
    word-break: break-word;
    min-width: 150px;
    max-width: 300px;
}

/* Para la tabla expandida en modo responsive */
table.dataTable.dtr-inline.collapsed>tbody>tr.child ul.dtr-details li {
    white-space: normal !important;
    word-break: break-word;
    min-width: 150px;
    max-width: 300px;
}

/*=================================================================
CSS PERMISOS DE LOS ROLES
=================================================================*/
#table_permiso td {
    white-space: normal;
    /* Permite saltos de línea en celdas */
    word-break: break-word;
    /* Rompe palabras largas si es necesario */
}

