/* --- Configuración General --- */
body {
    font-family: 'Public Sans', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 30px;
}

.main-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Tarjeta del Directorio --- */
.table-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- Encabezado --- */
.header-table {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f4f7f6;
    padding-bottom: 15px;
}

.title-section h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.title-section p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* --- Barra de Búsqueda --- */
.toolbar {
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    max-width: 450px;
    gap: 8px;
}

.search-group input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

.search-group input:focus {
    border-color: #3498db;
}

.btn-search, .btn-clear {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    text-decoration: none;
}

.btn-search {
    background-color: #2c3e50;
    color: white;
}

.btn-search:hover { background-color: #1a252f; }

.btn-clear {
    background-color: #ecf0f1;
    color: #e74c3c;
    border: 1px solid #dcdde1;
}

.btn-clear:hover { background-color: #dcdde1; }

/* --- Tabla de Proveedores --- */
.table-wrapper {
    overflow-x: auto; /* Permite scroll horizontal en móviles */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto; /* Permite que el navegador ajuste el ancho según contenido */
}

table thead tr {
    background-color: #2c3e50;
    color: white;
    text-align: left;
}

table th, table td {
    padding: 14px 15px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
}

/* Efecto cebra suave */
table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

table tbody tr:hover {
    background-color: #f1f4f6;
}

/* --- CONFIGURACIÓN DE COLUMNAS ESPECÍFICAS --- */

/* Columna de Ubicación (Columna 4) */
table th:nth-child(4), 
table td:nth-child(4) {
    min-width: 200px;
    max-width: 300px;       /* Evita que se estire demasiado */
    white-space: normal;    /* Permite el salto de línea */
    word-break: break-all;   /* Rompe palabras larguísimas sin espacios */
    overflow-wrap: break-word;
    line-height: 1.5;
    vertical-align: top;    /* Alineación superior para mayor orden */
}

/* Columna de Acciones (Columna 5 / Última) */
table th:last-child, 
table td:last-child {
    width: 160px;           /* Ancho fijo para que los botones no se amontonen */
    min-width: 160px;
    white-space: nowrap;    /* Mantiene 'Modificar | Eliminar' en una sola línea */
    text-align: center;
}

/* Estilo de enlaces de acción */
table td a {
    text-decoration: none;
    color: #3498db;
    font-weight: 600;
    margin: 0 4px;
    display: inline-block;
}

table td a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Botón Regresar Superior */
.btn-back-header {
    background-color: #ecf0f1;
    color: #7f8c8d;
    padding: 10px 22px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #dcdde1;
    transition: 0.3s;
}

.btn-back-header:hover {
    background-color: #bdc3c7;
    color: #2c3e50;
}