/* public/css/style.css - Versión Completa y Consolidada v2 */

/* Reset básico y configuración global */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6; 
    color: #333;
    font-size: 16px;
}

.container {
    width: 95%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px;
}

/* Cabecera y Navegación Principal */
.site-header {
    background: #004084; 
    color: #ecf0f1; 
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; 
    top: 0;
    z-index: 1000; 
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-header h1 { margin: 0; }
.site-header h1 a { color: #ecf0f1; text-decoration: none; font-size: 1.6rem; font-weight: 500; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.main-nav ul li { margin-left: 5px; }
.main-nav ul li a { color: #f0f0f0; text-decoration: none; padding: 0.75rem 1rem; display: block; border-radius: 5px; transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; font-weight: 500; font-size: 0.95rem; }
.main-nav ul li a:hover, .main-nav ul li a.active { background-color: #0059b3; color: #fff; }

/* Contenido Principal */
.main-content { padding: 30px; background-color: #ffffff; min-height: calc(100vh - 160px); margin: 25px auto; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.08); }

/* Títulos */
h1, h2, h3, h4 { color: #004084; margin-top: 0; margin-bottom: 1rem; font-weight: 500; }
h2 { font-size: 1.8rem; border-bottom: 2px solid #e9ecef; padding-bottom: 0.6rem; margin-bottom: 1.8rem;}
h3 { font-size: 1.5rem; margin-bottom: 1.2rem;}
h4 { font-size: 1.2rem; margin-bottom: 0.8rem;}

/* Formularios */
form { background-color: #fdfdfd; padding: 20px 25px; border-radius: 6px; border: 1px solid #e9ecef; margin-bottom: 25px; }
fieldset { border: 1px solid #dee2e6; padding: 20px 25px; margin-bottom: 20px; border-radius: 5px; background-color: #fff; }
legend { font-weight: 500; font-size: 1.15em; padding: 0 10px; color: #34495e; }
form div, .form-group { margin-bottom: 20px; }
form label { display: block; margin-bottom: 8px; font-weight: 500; color: #495057; font-size: 0.9rem; }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="number"], form input[type="date"], form input[type="tel"], form input[type="file"], form select, form textarea { width: 100%; padding: 10px 14px; border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box; font-size: 0.95rem; background-color: #fff; transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
form input[type="file"] { padding: 8px 12px; }
form input:focus, form select:focus, form textarea:focus { border-color: #80bdff; box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); outline: none; }
form textarea { min-height: 120px; resize: vertical; }
form small { font-size: 0.85em; color: #6c757d; display: block; margin-top: 5px; }

/* Botones */
.btn, form button[type="submit"] { display: inline-block; background-color: #0059b3; color: #fff; padding: 10px 22px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 0.95rem; font-weight: 500; line-height: 1.5; transition: background-color 0.2s ease-in-out, transform 0.1s ease, box-shadow 0.2s ease; text-align: center; }
.btn:hover, form button[type="submit"]:hover { background-color: #004084; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn:active, form button[type="submit"]:active { transform: translateY(0px); box-shadow: none; }
.btn-secondary { background-color: #6c757d; } .btn-secondary:hover { background-color: #5a6268; }
.btn-danger, .delete-link { background-color: #dc3545; } .btn-danger:hover, .delete-link:hover { background-color: #c82333; }
.btn-success { background-color: #28a745; } .btn-success:hover { background-color: #218838; }
.btn-info { background-color: #17a2b8; } .btn-info:hover { background-color: #138496; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.875rem; }
.btn-outline-secondary { background-color: transparent; border: 1px solid #6c757d; color: #6c757d; } .btn-outline-secondary:hover { background-color: #6c757d; color: #fff; }
.btn-outline-primary { background-color: transparent; border: 1px solid #0059b3; color: #0059b3; } .btn-outline-primary:hover { background-color: #0059b3; color: #fff; }
.btn-outline-danger { background-color: transparent; border: 1px solid #dc3545; color: #dc3545; } .btn-outline-danger:hover { background-color: #dc3545; color: #fff; }

/* Tablas */
table { width: 100%; border-collapse: collapse; margin-top: 25px; margin-bottom: 25px; background-color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.06); border-radius: 6px; overflow: hidden; }
table th, table td { border: 1px solid #e9ecef; padding: 12px 15px; text-align: left; font-size: 0.9rem; vertical-align: middle;}
table th { background-color: #f8f9fa; font-weight: 500; color: #495057; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
table tr:nth-child(even) { background-color: #fbfcfc; }
table tr:hover { background-color: #f1f5f8; }
table .actions a, table .actions button { margin-right: 6px; margin-bottom: 4px; text-decoration: none; padding: 5px 10px; font-size: 0.85rem; border-radius: 3px; }
table .actions .edit-link { color: #fff; background-color: #ffc107; border:none; } 
table .actions .edit-link:hover { background-color: #e0a800; }
table .actions .delete-link { color: #fff; background-color: #dc3545; border:none; } 
table .actions .delete-link:hover { background-color: #c82333; }
table .actions .view-link { color: #fff; background-color: #17a2b8; border:none; } 
table .actions .view-link:hover { background-color: #138496; }

/* Mensajes Flash */
.mensaje {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.mensaje.exito {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.mensaje.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.mensaje.stock {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
}

/* Dashboard */
.dashboard-summary-container { display: flex; justify-content: center; align-items: flex-start; padding-top: 10px; padding-bottom: 20px; }
.dashboard-summary { background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-top: 0; width: 100%; max-width: 800px; }
.dashboard-summary h2 { font-size: 1.8rem; color: #004084; border-bottom: 2px solid #e9ecef; padding-bottom: 0.8rem; margin-bottom: 1.8rem; text-align: center; }
.dashboard-summary .summary-section { margin-bottom: 25px; }
.dashboard-summary .summary-section h4 { margin-bottom: 12px; color: #34495e; border-bottom: 1px solid #f1f1f1; padding-bottom: 10px; font-size: 1.15rem; font-weight:500; }
.dashboard-summary ul { list-style: none; padding-left: 0; }
.dashboard-summary li { padding: 10px 5px; border-bottom: 1px dashed #f1f1f1; font-size: 0.9rem; }
.dashboard-summary li:last-child { border-bottom: none; }
.dashboard-summary li a { color: #0059b3; text-decoration: none; font-weight: 500; }
.dashboard-summary li a:hover { text-decoration: underline; color: #004084; }

/* Prioridades y Estados */
.prioridad-baja, .estado-baja { color: #28a745; font-weight: bold; } 
.prioridad-media, .estado-media { color: #ffc107; font-weight: bold; } 
.prioridad-alta, .estado-alta { color: #dc3545; font-weight: bold; } 
.prioridad-fila-alta { background-color: #f8d7da !important; } 
.prioridad-fila-media { background-color: #fff3cd !important; } 
.estado-pec { padding: 0.25em 0.6em; border-radius: 0.25rem; color: white; font-size: 0.85em; display: inline-block; font-weight:500; }
.estado-en-curso { background-color: #17a2b8; } 
.estado-recibido { background-color: #28a745; } 
.estado-cancelado { background-color: #dc3545; } 
.reclamacion-vencida td { background-color: #fff3cd !important; font-weight: 500; }
.reclamacion-vencida td strong { color: #c82333 !important; }

/* Barra de acciones y filtros en listas */
.actions-bar { margin-bottom: 25px; padding: 15px; background-color: #e9ecef; border-radius: 5px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.filter-form label { margin-bottom: 0; font-size: 0.85rem; color: #495057; }
.filter-form select, .filter-form .btn { font-size: 0.85rem; padding: 6px 10px; }

/* Pie de Página */
.site-footer { background: #343a40; color: #adb5bd; text-align: center; padding: 25px 0; margin-top: 40px; font-size: 0.9rem; }
.site-footer p { margin: 0; }

/* --- ESTILOS PARA FICHA PROVEEDOR (Pestañas y Tarjetas de Contacto) --- */
.proveedor-header { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #004084; }
.proveedor-header h1 { font-size: 2rem; color: #004084; margin-bottom: 3px; border-bottom: none; padding-bottom: 0; }
.proveedor-priority-info-minimal { font-size: 0.85em; color: #777; margin-top: 0; margin-bottom: 20px; }
.proveedor-priority-info-minimal strong { color: #555; font-weight: 500; }
.proveedor-contact-section { margin-bottom: 25px; }
.no-contacts-message { font-style: italic; color: #666; padding: 10px; background-color: #f9f9f9; border: 1px dashed #ddd; border-radius: 4px; text-align: center; }

.detail-section { background-color: #fff; padding: 20px; margin-bottom: 20px; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.detail-section > p > strong { font-weight: bold; } /* Esto es para el formato "Etiqueta: VALOR" si se usa */
.detail-section > p { font-weight: normal; }
.detail-section > p strong { font-weight: 600; }

.contact-cards-container { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 5px; }
.contact-card { background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 15px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; flex-direction: column; flex-grow: 1; flex-basis: 280px; max-width: calc(33.333% - 10px); /* Intenta 3 por fila, ajustando por el gap */ }
/* Si solo hay una tarjeta, o dos, podrían expandirse. Para un control más estricto: */
@media (min-width: 992px) { /* Pantallas grandes */
    .contact-cards-container .contact-card {
        /* max-width: calc(33.333% - 10px); /* (100% / 3) - (gap * 2/3) */
    }
}
@media (max-width: 991.98px) and (min-width: 650px) { /* Pantallas medianas */
    .contact-cards-container .contact-card {
        flex-basis: calc(50% - 8px); /* (100% / 2) - (gap * 1/2) */
        max-width: calc(50% - 8px);
    }
}
@media (max-width: 649.98px) { /* Pantallas pequeñas */
    .contact-cards-container .contact-card {
        flex-basis: 100%;
        max-width: 100%;
    }
}

.contact-card p { margin: 3px 0; font-size: 0.88rem; line-height: 1.4; word-break: break-word; }
.contact-card .contact-name strong { font-size: 1.05em; color: #004084; margin-bottom: 6px; display: block; }
.contact-card .contact-description { font-size: 0.82em; color: #555; margin-top: 6px; font-style: italic; }
.contact-card a { color: #0059b3; text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

.tab-container { margin-top: 20px; border: 1px solid #dee2e6; border-radius: 5px; background-color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.06); }
.tab-headers { display: flex; background-color: #f8f9fa; border-bottom: 1px solid #dee2e6; border-top-left-radius: 5px; border-top-right-radius: 5px; overflow: hidden; }
.tab-link { background-color: #f8f9fa; color: #495057; border: none; outline: none; cursor: pointer; padding: 12px 18px; transition: background-color 0.3s, color 0.3s, border-bottom-color 0.3s; font-size: 0.95rem; font-weight: 500; border-right: 1px solid #dee2e6; border-bottom: 2px solid transparent; }
.tab-link:last-child { border-right: none; }
.tab-link:hover { background-color: #e9ecef; color: #343a40; }
.tab-link.active { background-color: #fff; color: #004084; border-bottom-color: #004084; }
.tab-alert { color: #dc3545; font-weight: bold; margin-left: 5px; display: inline-block; animation: blinkAlert 1.5s infinite; }
@keyframes blinkAlert { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.tab-content { padding: 20px; border-top: none; display: none; }
.tab-content.active { display: block; }
.tab-content h4 { font-size: 1.3rem; color: #343a40; margin-top: 0; margin-bottom: 15px; }
.tab-content table { margin-top: 0; }
.tab-content p:last-child { margin-bottom: 0; }
.tab-content .btn-sm { margin-top: 15px; }

/* Estilos para la tabla de listado de proveedores */
#tablaProveedores th, #tablaProveedores td {
    font-size: 0.88rem; 
    padding: 10px 8px; 
}
#tablaProveedores .actions a, #tablaProveedores .actions button {
    padding: 4px 7px; 
    font-size: 0.8rem;
}

