/* css/style.css - VERSIÓN "LOOK TIENDA CORPORATIVA" */

/* --- Estilos Generales e Identidad de Marca --- */
body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    /* FRANJA AMARILLA SUPERIOR ESTILO TIENDA */
    border-top: 6px solid #fbc02d; 
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

h1, h2 {
    color: #11335a; /* AZUL MARINO PROFUNDO */
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

/* --- Estilos de Navegación y Encabezado (HEADER TIPO TIENDA) --- */
.navbar {
    background-color: #11335a; /* AZUL MARINO PROFUNDO */
    padding: 18px 0;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.navbar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.navbar ul li {
    margin: 0 5px;
}
.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 18px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}
.navbar ul li a:hover,
.navbar ul li a.active {
    background-color: #fbc02d; /* AMARILLO INSTITUCIONAL */
    color: #11335a !important; /* Letra oscura sobre fondo amarillo */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.intro-text {
    text-align: center;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 40px;
}

/* --- Estilos para Botones y Acciones --- */
.button, a.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: #fff !important; 
    background-color: #11335a; /* Azul corporativo */
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.button:hover, a.button:hover, button.button:hover {
    background-color: #0b223c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.button.delete { background-color: #dc2626; }
.button.delete:hover { background-color: #b91c1c; }

.button.clear { background-color: #64748b; }
.button.clear:hover { background-color: #475569; }

/* Botón de acento (Amarillo) para acciones especiales */
.button.accent { 
    background-color: #fbc02d; 
    color: #11335a !important; 
}
.button.accent:hover { 
    background-color: #e4a91b; 
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

/* --- Estilos de Formularios y Búsqueda --- */
form {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #475569;
    font-size: 14px;
}

form input[type="text"],
form input[type="number"],
form input[type="email"],
form input[type="tel"],
form textarea,
form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: #11335a;
    box-shadow: 0 0 0 3px rgba(17, 51, 90, 0.1);
}

form input[type="file"] { margin-bottom: 15px; }

form button {
    background-color: #11335a;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-right: 10px;
    transition: all 0.3s ease;
}

form button:hover { background-color: #0b223c; }

form button[type="reset"],
form button.secondary { background-color: #64748b; }
form button[type="reset"]:hover,
form button.secondary:hover { background-color: #475569; }

.form-actions { margin-top: 20px; text-align: right; }

/* Barra de Búsqueda Mejorada */
.search-bar {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.search-bar form { background: none; padding: 0; border: none; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; flex-grow: 1; }
.search-bar input[type="text"] { flex-grow: 1; min-width: 150px; margin-bottom: 0; }
.search-bar button { padding: 12px 20px; background-color: #11335a; }
.search-bar button:hover { background-color: #0b223c; }

/* --- Estilos de Tablas --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 15px;
    text-align: left;
}

table th {
    background-color: #11335a; /* Azul Marino */
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

table tr:nth-child(even) { background-color: #f8fafc; }
table tr:hover { background-color: #eff6ff; }
table .actions .button { margin-right: 5px; }

/* --- Estilos de Imágenes y Vistas Previa --- */
.product-thumbnail { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid #ddd; }
.thumbnail-container { position: relative; display: inline-block; }
.thumbnail-container .rollover-image { display: none; position: absolute; top: 50%; transform: translateY(-50%); left: 100%; margin-left: 10px; z-index: 999; max-width: 250px; height: auto; border: 1px solid #ddd; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border-radius: 6px; }
.thumbnail-container:hover .rollover-image { display: block; }
.lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 51, 90, 0.95); z-index: 1000; justify-content: center; align-items: center; }
.lightbox-image { max-width: 90%; max-height: 90%; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.close-btn { position: absolute; top: 20px; right: 35px; color: #fbc02d; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close-btn:hover { color: #fff; text-decoration: none; }

/* --- Mensajes de Estado --- */
.success-msg { background-color: #dcfce7; color: #166534; border: 1px solid #86efac; padding: 15px; margin-bottom: 20px; border-radius: 6px; text-align: center; font-weight: bold; }
.error-msg { background-color: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; padding: 15px; margin-bottom: 20px; border-radius: 6px; text-align: center; font-weight: bold; }
.info-msg { color: #0284c7; font-size: 0.9em; margin-top: 5px; display: block; font-weight: bold;}

/* --- Estilos del Dashboard --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-top: 30px; }
.dashboard-card { background-color: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 30px; text-align: center; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); transition: transform 0.2s ease, box-shadow 0.2s ease; border-top: 4px solid #11335a; }
.dashboard-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); }
.dashboard-card h3 { color: #11335a; margin-top: 0; margin-bottom: 15px; font-size: 1.4em; }
.dashboard-card p { font-size: 2.5em; font-weight: 800; color: #fbc02d; margin: 10px 0; text-shadow: 1px 1px 1px rgba(0,0,0,0.1); }
.dashboard-card .card-link { background-color: #11335a; color: white; padding: 12px 25px; border-radius: 6px; text-decoration: none; font-weight: bold; margin-top: 15px; display: inline-block; transition: background-color 0.3s ease; width: 80%; box-sizing: border-box; }
.dashboard-card .card-link:hover { background-color: #0b223c; color: white !important;}

/* --- Estilos para Alertas y Movimientos --- */
.alert-low-stock { background-color: #fef3c7; border: 1px solid #f59e0b; color: #b45309; padding: 15px; margin-bottom: 20px; border-radius: 8px; font-weight: bold; text-align: center; }
.alert-low-stock ul { list-style-type: none; padding: 0; margin-top: 10px; }
.alert-low-stock ul li { margin-bottom: 5px; }
.alert-low-stock ul li a { color: #d97706; text-decoration: underline; }
.alert-low-stock ul li a:hover { color: #b45309; }
.mov-entrada { color: #16a34a; font-weight: bold; }
.mov-salida { color: #dc2626; font-weight: bold; }

/* --- ESTILOS PARA LA PÁGINA DE FACTURAS --- */
.form-container { background-color: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; }
.resultados-busqueda { margin-top: 10px; margin-bottom: 20px; border: 1px solid #cbd5e1; border-radius: 6px; max-height: 200px; overflow-y: auto; background-color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.resultado-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f1f5f9; font-size: 0.95em; transition: background-color 0.2s;}
.resultado-item:hover { background-color: #f8fafc; }
.resultado-item:last-child { border-bottom: none; }
.btn-agregar-producto { background-color: #16a34a; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-size: 0.9rem; font-weight: bold; transition: background-color 0.3s ease; }
.btn-agregar-producto:hover { background-color: #15803d; }
#productos-container { margin-top: 20px; }
.producto-linea { display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: #f8fafc; border: 1px solid #e2e8f0; border-left: 4px solid #11335a; border-radius: 6px; margin-bottom: 10px; }
.producto-linea span { font-weight: bold; color: #1e293b; }
.producto-linea button { background-color: #dc2626; color: white; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 0.8rem; }
.producto-linea button:hover { background-color: #b91c1c; }
.form-container button[type="submit"] { background-color: #11335a; color: white; border: none; padding: 15px 30px; border-radius: 6px; cursor: pointer; font-size: 1.1rem; font-weight: bold; transition: background-color 0.3s ease; margin-top: 20px; width: 100%;}
.form-container button[type="submit"]:hover { background-color: #0b223c; }

/* Media Queries para Responsividad */
@media (max-width: 768px) {
    .container { margin: 10px; padding: 15px; }
    .navbar ul { flex-direction: column; }
    .navbar ul li { margin: 5px 0; }
    .navbar ul li a { display: block; padding: 12px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-form input[type="text"], .search-form select, .search-form button { width: 100%; margin-bottom: 10px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .producto-linea { flex-direction: column; gap: 10px; align-items: flex-start;}
    .producto-linea button { width: 100%; }
}