body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #333;
    font-size: 13px;
}

.container {
    width: 99%;
    margin: 5px auto;
    padding: 5px;
    box-sizing: border-box;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin: 5px 0 10px 0;
    font-size: 1.4em;
}

/* Formulario de búsqueda */
/* Estilo compacto para el formulario de búsqueda */
.search-form {
    display: flex;
    margin-bottom: 8px;
    gap: 6px;
    align-items: center; /* Alinea verticalmente los elementos */
    max-width: 500px; /* Ancho máximo del contenedor */
    margin-left: auto;
    margin-right: auto;
}

.search-form input {
    flex: 1;
    padding: 5px 8px; /* Reducción del padding */
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 0.8em; /* Tamaño de fuente más pequeño */
    height: 28px; /* Altura fija */
    box-sizing: border-box;
}

.search-form button {
    padding: 5px 10px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    height: 28px; /* Misma altura que el input */
    transition: background-color 0.2s;
    white-space: nowrap;
}

.search-form button:hover {
    background-color: #2563eb;
}

/* Versión más compacta para móviles */
@media screen and (max-width: 768px) {
    .search-form {
        max-width: 100%;
        gap: 4px;
    }
    
    .search-form input {
        padding: 4px 6px;
        font-size: 0.75em;
        height: 26px;
    }
    
    .search-form button {
        padding: 4px 8px;
        font-size: 0.75em;
        height: 26px;
    }
}

.btn-exit{
    padding: 6px 8px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #f81313;
}

/* Tabla optimizada */
.table-container {
    width: 100%;
    overflow-x: auto;
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-height: 85vh;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Cambiado a fixed para control exacto */
}

/* Anchuras específicas para columnas clave */
table th:nth-child(1), table td:nth-child(1) { width: 80px; }  /* ID Ticket */
table th:nth-child(2), table td:nth-child(2) { width: 100px; } /* Referencia */
table th:nth-child(3), table td:nth-child(3) { width: 90px; }  /* Documento */
table th:nth-child(4), table td:nth-child(4) { width: 120px; } /* Nombre */
table th:nth-child(5), table td:nth-child(5) { width: 100px; } /* Departamento */
table th:nth-child(6), table td:nth-child(6) { width: 100px; } /* Municipio */
table th:nth-child(7), table td:nth-child(7) { width: 80px; }  /* Zona */
table th:nth-child(8), table td:nth-child(8) { width: 100px; } /* IP */
table th:nth-child(9), table td:nth-child(9) { width: 150px; } /* Dirección */
table th:nth-child(10), table td:nth-child(10) { width: 90px; } /* Celular */
table th:nth-child(11), table td:nth-child(11) { width: 150px; } /* Correo */
table th:nth-child(12), table td:nth-child(12) { width: 120px; } /* Tipo Incidencia */
table th:nth-child(13), table td:nth-child(13) { width: 100px; } /* Validar Router 1 */
table th:nth-child(14), table td:nth-child(14) { width: 100px; } /* Validar Router 2 */
table th:nth-child(15), table td:nth-child(15) { width: 120px; } /* Nombre Red */
table th:nth-child(16), table td:nth-child(16) { width: 200px; } /* Comentario */
table th:nth-child(17), table td:nth-child(17) { width: 80px; }  /* Estado */
table th:nth-child(18), table td:nth-child(18) { width: 90px; }  /* Fecha */

table th {
    background-color: #3498db;
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-weight: 500;
    font-size: 0.85em;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.82em;
    line-height: 1.3;
    vertical-align: top;
    word-break: break-word;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e8f4fc;
}

/* Manejo de contenido largo */
table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

table td:hover {
    overflow: visible;
    white-space: normal;
    background-color: white;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    z-index: 2;
}

/* Barra de scroll personalizada */
.table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media screen and (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 3px;
    }
    
    table th, table td {
        padding: 4px 6px;
        font-size: 0.78em;
    }
    
    /* Reducir anchos en pantallas más pequeñas */
    table th:nth-child(9), table td:nth-child(9) { width: 120px; } /* Dirección */
    table th:nth-child(11), table td:nth-child(11) { width: 120px; } /* Correo */
    table th:nth-child(16), table td:nth-child(16) { width: 150px; } /* Comentario */
}

@media screen and (max-width: 768px) {
    body {
        font-size: 12px;
    }
    
    table {
        table-layout: auto; /* Volver a auto para móviles */
    }
    
    /* Eliminar anchos fijos en móviles */
    table th, table td {
        width: auto !important;
    }
}
