.fab-stack { display: grid; gap: 15px; }
.fab-form { max-width: 880px; }
.fab-span { grid-column: 1 / -1; }
.fab-table { overflow-x: auto; }
.fab-nowrap { white-space: nowrap; }
.fab-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fab-top { margin-top: 14px; }
.fab-muted { color: var(--muted); }
.fab-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.fab-nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#submenus a { display: flex; align-items: center; gap: 8px; }

.fab-rows { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: 12px; }
.fab-rows legend { padding-inline: 6px; font-weight: 700; }
.fab-comp-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; margin-bottom: 8px; }
.fab-comp-row:last-child { margin-bottom: 0; }

.fab-state {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    background: #e0f2fe;
    color: #0369a1;
}
.fab-state.planificada, .fab-state.pendiente { background: #fef3c7; color: #92400e; }
.fab-state.proceso, .fab-state.en_produccion { background: #dbeafe; color: #1d4ed8; }
.fab-state.calidad { background: #ede9fe; color: #5b21b6; }
.fab-state.terminada, .fab-state.entregado, .fab-state.ok { background: #dcfce7; color: #166534; }
.fab-state.faltante, .fab-state.cancelado { background: #fee2e2; color: #991b1b; }
.fab-state.materia_prima { background: #f1f5f9; color: #334155; }
.fab-state.terminado { background: #dbeafe; color: #1e40af; }

.fab-bom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.fab-bom-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.fab-bom-list { list-style: none; padding: 0; margin: 0; font-size: 13px; display: grid; gap: 4px; }
.fab-bom-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #e2e8f0; }
.fab-bom-list li:last-child { border-bottom: 0; }

.fab-balance { display: flex; flex-wrap: wrap; gap: 12px 22px; border-top: 1px solid var(--line); padding: 10px 0 0; margin: 0; }
.fab-balance dt { color: var(--muted); font-size: 12.5px; }
.fab-balance dd { margin: 2px 0 0; font-weight: 700; }

.fab-mini-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fab-mini-form input, .fab-mini-form select { width: auto; padding: 5px 8px; margin: 0; font-size: 13px; }

.fab-stepper { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; }
.fab-step { padding: 2px 7px; border-radius: 6px; background: #f1f5f9; color: #64748b; font-weight: 600; }
.fab-step.done { background: #dbeafe; color: #1d4ed8; }
.fab-step.current { background: #2563eb; color: #fff; }

@media (max-width: 720px) {
    .fab-comp-row { grid-template-columns: minmax(0, 1fr); }
}
