.dist-stack { display: grid; gap: 15px; }
.dist-form { max-width: 780px; }
.dist-span { grid-column: 1 / -1; }
.dist-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.dist-muted, .dist-line-meta { color: var(--muted); margin: 5px 0; }
.dist-table { overflow-x: auto; }
.dist-nowrap { white-space: nowrap; }

.dist-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 650;
    background: #fef3c7;
    color: #92400e;
    white-space: nowrap;
}
.dist-state.closed { background: #dbeafe; color: #1d4ed8; }
.dist-state.info { background: #e0f2fe; color: #0369a1; }
.dist-state.danger { background: #fee2e2; color: #b91c1c; }

.dist-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
    white-space: nowrap;
}
.dist-chip.danger { background: #fee2e2; color: #b91c1c; }

.dist-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; }

.dist-assign-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.dist-assign-bar label { flex: 1 1 280px; margin: 0; }

.dist-calc-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.dist-calc-box span { font-size: 12px; color: #1e40af; }
.dist-calc-box strong { font-size: 18px; color: #1d4ed8; }

.dist-metrics { margin: 12px 0 15px; grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); }
.dist-operacion { min-width: 0; padding: 0; margin: 0; border: 0; }
.dist-operacion[hidden] { display: none; }
.dist-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.dist-line { display: grid; gap: 5px 12px; align-items: end;
    grid-template-columns: minmax(160px, 2fr) minmax(90px, .6fr) minmax(105px, .8fr) auto;
    padding: 10px 0; border-bottom: 1px solid var(--line); }
.dist-line-meta { grid-column: 1 / -1; margin: 0; }
.dist-line output { display: block; min-height: 38px; padding-top: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
input.dist-qty:not([type=file]) { max-width: 120px; }

.dist-print main { max-width: 820px; margin: auto; padding: 20px; }
.dist-print .panel { padding: 22px; }
.dist-print-actions { margin: 0 0 16px; }
.dist-print dt { font-weight: 700; }
.dist-print dd { margin: 0; }
.dist-print footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 28px; color: var(--muted); }

@media (max-width: 850px) {
    .dist-line { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
    .dist-line button { justify-self: start; }
    .dist-line output { min-height: 23px; padding-top: 0; }
}
@media (max-width: 520px) {
    .panel-title, .page-head { flex-wrap: wrap; }
    .dist-brand { font-size: clamp(21px, 7vw, 25px); }
    .dist-metrics { grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }
}
@media print {
    body.dist-print { background: white; color: #000; }
    .dist-print main { max-width: none; margin: 0; padding: 0; }
    .dist-print .panel { border: 0; box-shadow: none; padding: 0; }
    .dist-print-actions { display: none; }
}
