/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* NAVBAR (Header) */
.navbar {
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.navbar nav ul li a:hover {
    background-color: #34495e;
}

/* CONTENEDOR PRINCIPAL */
.container {
    flex: 1;
    /* Hace que el main ocupe el espacio disponible empujando el footer abajo */
    padding: 30px;
    margin: 0 auto;
    width: 100%;
}

/* FOOTER */
.footer {
    background-color: #ecf0f1;
    text-align: center;
    padding: 15px;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #ddd;
}

/* BOTONES */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    color: white;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ENCABEZADO DE SECCIÓN */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* TABLAS MODERNAS */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

.table tr:hover {
    background-color: #f1f4f8;
}

/* MODAL (Popup) */
.modal-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
}

/* FORMULARIOS */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

/* Botón Editar (Naranja) */
.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

/* BARRA DE BÚSQUEDA */
.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    padding-left: 38px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

/* FORMULARIO EN GRID (2 COLUMNAS) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Ajuste del Modal para que sea más ancho */
.modal-content.modal-lg {
    max-width: 680px;
}

/* BOTONES EXPORTAR E IMPORTAR */
.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

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

/* FILAS DINÁMICAS DE INSUMOS */
.insumo-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.insumo-row .form-control {
    margin-bottom: 0;
}

.badge-patas {
    background-color: #eef2f7;
    color: #34495e;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
}

/* BADGES DE CATEGORÍAS DE INSUMOS */
.badge-cat {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.cat-patas {
    background-color: #e8f4fd;
    color: #2980b9;
}

.cat-telas {
    background-color: #fef9e7;
    color: #d68910;
}

.cat-lustres {
    background-color: #f4ecf7;
    color: #8e44ad;
}

.cat-generales {
    background-color: #e8f8f5;
    color: #16a085;
}

/* ALERTA DE STOCK BAJO */
.stock-critico {
    color: #e74c3c;
    font-weight: bold;
}

/* MENÚ DESPLEGABLE (DROPDOWN) */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #34495e;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #2c3e50;
}

.dropdown-content a:hover {
    background-color: #2c3e50;
    border-radius: 5px;
}

.dropdown:hover .dropdown-content {
    display: block;
}