:root {
    --primary: #8B4513;
    --primary-hover: #6F370F;
    --accent: #D97706;
    --bg-main: #FDFBF7;
    --bg-card: #FFFFFF;
    --text-dark: #292524;
    --border: #E7E5E4;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); line-height: 1.5; }

/* Navegación */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1rem; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--primary); font-size: 1.2rem; font-weight: bold;}
.nav-menu { display: flex; gap: 0.5rem; }
.nav-link { background: none; border: none; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; color: #666; font-weight: 600;}
.nav-link.active, .nav-link:hover { background: #FEF3C7; color: var(--primary); }
.role-badge { background: #F3F4F6; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: bold; color: var(--primary); }

/* Layout Main */
.main-container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.hero-banner { background: #8B4513; border-radius: 12px; padding: 3rem 2rem; color: white; margin-bottom: 2rem; text-align: center; }

/* Grid Productos */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.product-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; text-align: center; }
.product-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem;}
.stock-badge { font-size: 0.8rem; color: #16A34A; font-weight: bold; }

/* Tablas */
.panel-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }
.panel-header { display: flex; justify-content: space-between; margin-bottom: 1rem; align-items: center;}
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.badge-pendiente { background: #FEF08A; padding: 3px 8px; border-radius: 12px; font-size: 0.8rem; }
.badge-completado { background: #BBF7D0; padding: 3px 8px; border-radius: 12px; font-size: 0.8rem; }

/* Botones */
.btn { padding: 0.5rem 1rem; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--primary); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); }
.btn-success { background: #16A34A; color: white; }
.btn-danger { background: #DC2626; color: white; }
.btn-text { background: none; font-size: 1.2rem; color: #666; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.modal.active { display: flex; }
.modal-content { background: white; padding: 1.5rem; border-radius: 12px; width: 100%; max-width: 500px; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.form-group input { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Timeline Bitácora */
.timeline-item { border-left: 3px solid var(--accent); padding-left: 1rem; margin-bottom: 1rem; }
.timeline-time { font-size: 0.8rem; color: #666; }

/* Estilos para el Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%; /* AGREGA ESTO: Nace exactamente debajo del contenedor */
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid var(--border);
    z-index: 1;
    overflow: hidden;
    /* margin-top: 0.5rem; <-- ELIMINA O BORRA ESTA LÍNEA */
}
.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
}
.dropdown-content a i { margin-right: 8px; color: var(--accent); }
.dropdown-content a:hover { background-color: #F9FAFB; color: var(--primary); }
.dropdown:hover .dropdown-content { display: block; }
.dropbtn { display: flex; align-items: center; gap: 0.5rem; }

/* Notificaciones Discretas (Toasts) */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background-color: var(--text-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    animation: toastFadeIn 0.3s ease forwards, toastFadeOut 0.3s ease forwards 2.7s;
}

.toast i {
    color: #10B981; /* Verde de éxito */
    font-size: 1.1rem;
}

@keyframes toastFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

