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

.mue-nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #7c3aed;
    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; }

.mue-state {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    background: #ede9fe;
    color: #5b21b6;
}
.mue-state.reservado, .mue-state.enviado { background: #ede9fe; color: #5b21b6; }
.mue-state.fabricar, .mue-state.borrador { background: #fef3c7; color: #92400e; }
.mue-state.listo, .mue-state.ok, .mue-state.convertido { background: #dcfce7; color: #166534; }
.mue-state.entregado { background: #dbeafe; color: #1d4ed8; }
.mue-state.bajo, .mue-state.vencido { background: #fee2e2; color: #991b1b; }

.mue-rows { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: 12px; }
.mue-rows legend { padding-inline: 6px; font-weight: 700; }
.mue-sale-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; margin-bottom: 10px; }
.mue-sale-row:last-child { margin-bottom: 0; }
.mue-sale-row select { width: 100%; text-overflow: ellipsis; }

.mue-facts dt, .mue-balance dt { color: var(--muted); font-size: 13px; }
.mue-facts dd, .mue-balance dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.mue-balance { display: flex; flex-wrap: wrap; gap: 12px 24px; border-top: 1px solid var(--line); padding: 12px 0 0; margin-bottom: 0; }
.mue-total { text-align: right; font-size: 18px; font-weight: 700; }
.mue-form textarea {
    display: block; width: 100%; margin-top: 4px; padding: 8px 10px; resize: vertical;
    font: inherit; color: var(--ink); background: white; border: 1px solid #cbd5e1; border-radius: 7px;
}

.mue-print main { max-width: 820px; margin: auto; padding: 20px; }
.mue-print-nav { margin-bottom: 16px; }
@media (max-width: 640px) { .mue-sale-row { grid-template-columns: minmax(0, 1fr); } }
@media print {
    body.mue-print { background: white; color: #000; }
    .mue-print .panel { border: 0; box-shadow: none; padding: 0; }
    .mue-print-nav { display: none; }
}
