:root { --bg:#f5f6f8; --ink:#222; --muted:#667085; --line:#d0d5dd; --brand:#1f4b99; --danger:#b42318; }
* { box-sizing: border-box; }
body { margin:0; font-family: Arial, Helvetica, sans-serif; background:var(--bg); color:var(--ink); font-size:14px; }
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }
.header { display:flex; gap:14px; align-items:center; flex-wrap:wrap; padding:12px 18px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:3; }
.header .brand { font-weight:800; font-size:18px; color:#111; margin-right:8px; }
.logout-form { margin-left:auto; }
.logout-form button { border:0; background:#eee; padding:7px 11px; border-radius:7px; cursor:pointer; }
.container { max-width:1220px; margin:20px auto; padding:0 16px; }
h1 { margin:0 0 14px; font-size:26px; }
h2 { margin:24px 0 10px; font-size:20px; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin:14px 0 18px; }
.card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.card span { display:block; color:var(--muted); font-size:13px; margin-bottom:6px; }
.card strong { font-size:22px; }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.btn, .btn-primary, .btn-danger { display:inline-block; padding:9px 12px; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--ink); cursor:pointer; }
.btn-primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.btn-danger { background:var(--danger); color:#fff; border-color:var(--danger); }
.danger { color:var(--danger); }
table { width:100%; border-collapse:collapse; background:#fff; margin:10px 0 18px; }
th, td { border:1px solid var(--line); padding:7px 8px; vertical-align:middle; }
th { background:#eef2f7; text-align:left; font-weight:700; }
.compact th, .compact td { padding:5px; font-size:12px; }
.group-row td { background:#dbeafe; font-weight:700; }
.subtotal td, tr.subtotal td { background:#f8fafc; font-weight:700; }
.center { text-align:center; }
.bold { font-weight:700; }
.qty { width:72px; text-align:center; padding:5px; }
.devolucion { width:100px; font-weight:700; }
.devolucion-col { min-width:145px; text-align:center; }
.blank-cell { height:34px; background:#fff; }
.form-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; max-width:850px; }
.form-card p { margin:0 0 12px; }
.form-card label { display:block; font-weight:700; margin-bottom:5px; }
.form-control, input, select, textarea { width:100%; max-width:650px; padding:8px; border:1px solid var(--line); border-radius:7px; }
textarea { min-height:90px; }
.messages { list-style:none; padding:0; }
.messages li, .alert { background:#ecfdf3; border:1px solid #abefc6; color:#067647; padding:10px; border-radius:8px; margin-bottom:8px; }
.login-body { display:flex; min-height:100vh; align-items:center; justify-content:center; background:#eef2f7; }
.login-card { background:#fff; width:360px; border:1px solid var(--line); border-radius:16px; padding:28px; box-shadow:0 10px 30px rgba(0,0,0,.08); }
.login-card h1 { text-align:center; }
.login-card label { display:block; margin-top:12px; font-weight:700; }
.full { width:100%; margin-top:16px; }
.remito { background:#fff; border:2px solid #111; padding:12px; margin:12px 0; page-break-inside:avoid; }
.print-ticket { min-height: 135mm; }
.firmas { display:flex; justify-content:space-between; gap:40px; margin-top:22px; }
.firmas span { flex:1; border-top:1px solid #111; padding-top:5px; text-align:center; }
small { color:var(--muted); font-size:13px; }
@media print {
    @page { size:A4 portrait; margin:8mm; }
    body { background:#fff; font-size:11px; }
    .no-print, .header { display:none !important; }
    .container { max-width:none; margin:0; padding:0; }
    h1 { font-size:18px; }
    h2 { font-size:14px; margin:0 0 6px; }
    table { margin:4px 0; }
    th, td { padding:4px; }
    .print-ticket { height:137mm; margin:0 0 7mm 0; page-break-inside:avoid; }
    .print-ticket:nth-of-type(2n) { page-break-after:always; }
    .remito { border:1.5px solid #000; }
}

.help-box {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #c8d8ef;
    background: #f4f8ff;
    border-radius: 8px;
    font-size: 0.92rem;
}

.btn-small {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    border: 1px solid #bbb;
    border-radius: 5px;
    text-decoration: none;
    background: #f8f8f8;
    color: #222;
    font-size: 0.85rem;
}

.btn-danger {
    border-color: #d08a8a;
    background: #fff2f2;
}

.bloque-linea {
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    padding:12px;
    margin:18px 0 26px;
    page-break-inside:avoid;
}
.linea-header h2 { margin:0 0 4px; font-size:18px; }
.linea-header h3 { margin:0 0 10px; font-size:16px; color:#344054; }
.matriz-linea th,
.matriz-linea td { font-size:12px; }
.cantidad-matriz { font-weight:700; min-width:52px; }
@media print {
    .bloque-linea { border:0; padding:0; margin:0 0 8mm; page-break-inside:avoid; }
    .bloque-linea + .bloque-linea { page-break-before:always; }
    .linea-header h2 { font-size:16px; }
    .linea-header h3 { font-size:14px; }
    .matriz-linea th,
    .matriz-linea td { font-size:10px; padding:3px; }
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 10px 0 18px;
}
.photo-card {
    border: 1px solid #d9dee8;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
}
.photo-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
}

/* v1.6 modernización visual */
:root {
    --bg:#f3f6fb;
    --ink:#111827;
    --muted:#667085;
    --line:#d7deea;
    --brand:#2563eb;
    --brand-dark:#1d4ed8;
    --accent:#10b981;
    --danger:#dc2626;
}
body { background:linear-gradient(180deg,#eef4ff 0,#f8fafc 220px,#f3f6fb 100%); color:var(--ink); }
.header { background:rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom:1px solid rgba(37,99,235,.12); box-shadow:0 8px 24px rgba(15,23,42,.06); }
.header a { padding:8px 10px; border-radius:999px; color:#334155; font-weight:700; }
.header a:hover { background:#eaf1ff; color:var(--brand); text-decoration:none; }
.header .brand { color:var(--brand); font-size:20px; padding-left:0; }
.card, .form-card, .bloque-linea, table { border-radius:16px; box-shadow:0 10px 28px rgba(15,23,42,.06); border-color:#e2e8f0; }
table { overflow:hidden; }
th { background:linear-gradient(180deg,#eff6ff,#eaf2ff); color:#1e293b; }
.btn, .btn-primary, .btn-danger, .btn-small, .logout-form button { border-radius:999px; font-weight:700; transition:.15s ease; box-shadow:0 1px 2px rgba(15,23,42,.08); }
.btn:hover, .btn-small:hover { transform:translateY(-1px); text-decoration:none; background:#f8fafc; }
.btn-primary { background:linear-gradient(135deg,var(--brand),#3b82f6); border-color:var(--brand); }
.btn-primary:hover { background:var(--brand-dark); transform:translateY(-1px); text-decoration:none; }
.btn-danger { background:linear-gradient(135deg,var(--danger),#ef4444); color:#fff; }
.form-control, input, select, textarea { border-radius:12px; border-color:#cbd5e1; }
.form-control:focus, input:focus, select:focus, textarea:focus { outline:2px solid rgba(37,99,235,.18); border-color:var(--brand); }
.messages li, .alert { border-radius:14px; }
.remito { border-radius:14px; }

.alert-warning{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;padding:12px 14px;border-radius:14px;margin:12px 0;font-weight:700;}

/* v1.13 listado de vendedores */
.badge { display:inline-block; padding:3px 8px; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:12px; font-weight:700; }
.badge.ok { background:#dcfce7; color:#166534; }
.badge.danger { background:#fee2e2; color:#991b1b; }
.muted { color:var(--muted); }
/* v1.17 colocación dinámica */
.badge.warn { background:#fef3c7; color:#92400e; }
.matriz-colocacion th:first-child,
.matriz-colocacion td:first-child { min-width:180px; }
.matriz-colocacion input.qty { max-width:76px; }
.matriz-colocacion .general td { background:#eef6ff; }
.text-center { text-align:center; }
.text-right { text-align:right; }


/* v1.17.3 - drag & drop de columnas en colocación */
.matriz-colocacion th.draggable-product {
    cursor: grab;
    user-select: none;
    position: relative;
}
.matriz-colocacion th.draggable-product.dragging {
    opacity: 0.55;
}
.matriz-colocacion th.draggable-product.drag-over {
    outline: 2px dashed #2563eb;
    outline-offset: -4px;
}
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    margin-right: .25rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
    color: #1d4ed8;
    font-weight: 700;
}
.muted { color: #64748b; }


/* v1.17.4 - encabezado fijo en matriz de colocación */
.colocacion-table-wrap {
    max-height: calc(100vh - 260px);
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.colocacion-table-wrap table {
    margin: 0;
    box-shadow: none;
    border: 0;
    border-radius: 0;
}
.matriz-colocacion thead th {
    position: sticky;
    top: 0;
    z-index: 8;
    box-shadow: 0 2px 0 rgba(15,23,42,.08);
}
.matriz-colocacion thead th.draggable-product {
    z-index: 9;
}

/* v1.17.5 - corrección encabezado fijo real en colocación */
.colocacion-table-wrap {
    height: calc(100vh - 230px);
    min-height: 420px;
    max-height: 78vh;
    overflow: auto;
    position: relative;
    overscroll-behavior: contain;
}
.colocacion-table-wrap .matriz-colocacion {
    border-collapse: separate !important;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}
.colocacion-table-wrap .matriz-colocacion thead {
    position: sticky;
    top: 0;
    z-index: 50;
}
.colocacion-table-wrap .matriz-colocacion thead th {
    position: sticky;
    top: 0;
    z-index: 51;
    background: linear-gradient(180deg,#eff6ff,#dbeafe) !important;
    box-shadow: 0 2px 0 rgba(15,23,42,.15), 0 3px 8px rgba(15,23,42,.08);
}
.colocacion-table-wrap .matriz-colocacion th:first-child,
.colocacion-table-wrap .matriz-colocacion td:first-child {
    position: sticky;
    left: 0;
    z-index: 35;
    background: #ffffff;
    box-shadow: 2px 0 0 rgba(15,23,42,.08);
}
.colocacion-table-wrap .matriz-colocacion thead th:first-child {
    z-index: 60;
    background: linear-gradient(180deg,#eff6ff,#dbeafe) !important;
}
.colocacion-table-wrap .matriz-colocacion .group-row td:first-child,
.colocacion-table-wrap .matriz-colocacion tr.subtotal td:first-child {
    background: inherit;
}

/* v1.17.6 - referencia fija robusta de productos en colocación */
.colocacion-fixed-reference {
    position: sticky;
    top: 58px;
    z-index: 120;
    display: flex;
    align-items: stretch;
    width: 100%;
    overflow: hidden;
    border: 1px solid #bfdbfe;
    border-bottom: 2px solid #2563eb;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg,#eff6ff,#dbeafe);
    box-shadow: 0 8px 18px rgba(15,23,42,.16);
    margin-top: 10px;
}
.colocacion-fixed-reference .col-fixed-left,
.colocacion-fixed-reference .col-fixed-total,
.colocacion-fixed-reference .col-fixed-product {
    box-sizing: border-box;
    padding: 8px 7px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #bfdbfe;
    color: #1e293b;
    font-weight: 800;
    font-size: 12px;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    background: linear-gradient(180deg,#eff6ff,#dbeafe);
}
.colocacion-fixed-reference .col-fixed-left {
    justify-content: flex-start;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
}
.colocacion-fixed-reference .col-fixed-total {
    border-right: 0;
    border-left: 1px solid #bfdbfe;
    margin-left: auto;
}
.colocacion-fixed-reference .col-fixed-products {
    overflow: hidden;
    flex: 1 1 auto;
}
.colocacion-fixed-reference .col-fixed-products-row {
    display: flex;
    will-change: transform;
}
.colocacion-fixed-reference .drag-handle {
    display: none;
}
.colocacion-table-wrap {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}
@media print {
    .colocacion-fixed-reference { display: none !important; }
}


/* v1.17.7 - cantidades y totales centrados en colocación */
.matriz-colocacion td:not(:first-child),
.matriz-colocacion th:not(:first-child) {
    text-align: center;
}
.matriz-colocacion input.qty {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-weight: 700;
}
.matriz-colocacion .total-vendedor,
.matriz-colocacion .subtotal-linea,
.matriz-colocacion .total-linea,
.matriz-colocacion .total-general-producto,
.matriz-colocacion #total-general-unidades {
    display: inline-block;
    min-width: 2.5rem;
    text-align: center;
}
.matriz-colocacion tr.subtotal td,
.matriz-colocacion tfoot td {
    text-align: center;
}
.matriz-colocacion tr.subtotal td:first-child,
.matriz-colocacion tfoot td:first-child {
    text-align: left;
}

/* v1.17.8 - encabezado único externo y drag & drop en referencia fija */
.colocacion-table-wrap .matriz-colocacion thead {
    visibility: collapse;
}
.colocacion-table-wrap .matriz-colocacion thead th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
    box-shadow: none !important;
}
.colocacion-fixed-reference .col-fixed-product.draggable-product-ref {
    cursor: grab;
    user-select: none;
}
.colocacion-fixed-reference .col-fixed-product.draggable-product-ref.dragging {
    opacity: .55;
}
.colocacion-fixed-reference .col-fixed-product.draggable-product-ref.drag-over {
    outline: 2px dashed #2563eb;
    outline-offset: -4px;
    background: linear-gradient(180deg,#dbeafe,#bfdbfe);
}
.colocacion-fixed-reference .drag-handle {
    display: inline-flex;
    flex: 0 0 auto;
}
.matriz-colocacion input.qty:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.18);
    background: #eff6ff;
}

/* v1.17.17 - administración rápida de vendedores desde listado */
.link-button {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}
.link-button.strong { font-weight: 800; }
.money-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-danger { color: #b91c1c; font-weight: 800; }
.btn.small { padding: .35rem .65rem; font-size: .82rem; border-radius: 999px; margin-right: .35rem; }
body.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem;
    background: rgba(15, 23, 42, .58);
    z-index: 2000;
    overflow-y: auto;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
    width: min(1180px, 98vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .35);
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, .35);
}
.vendor-modal-card h2 { margin: 0; }
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: .9rem;
}
.modal-subtitle { margin: .2rem 0 0; }
.modal-close {
    border: 0;
    background: #f1f5f9;
    color: #0f172a;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { background: #e2e8f0; }
.summary-grid.compact { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1rem; }
.modal-section { margin: 1rem 0; }
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    align-items: end;
}
.grid-form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 700; color: #334155; }
.grid-form .span-2 { grid-column: span 2; }
.grid-form .form-actions { display: flex; align-items: end; }
.compact-form .form-control { min-height: 38px; }
.vendor-date-filter { gap: .75rem; align-items: end; }
.modal-table-scroll { max-height: 280px; overflow: auto; margin-bottom: 1.25rem; border: 1px solid #e2e8f0; border-radius: 14px; }
.modal-table-scroll table { margin: 0; }
.modal-table-scroll thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; }
@media (max-width: 760px) {
    .grid-form .span-2 { grid-column: span 1; }
    .modal-card { padding: .9rem; }
}

/* v1.17.19 - mejor legibilidad de saldos dentro del modal de vendedores */
.summary-grid.compact.vendor-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin: 1.1rem 0 1.35rem;
}
.vendor-balance-grid .summary-card {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: 1rem 1.1rem;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    min-height: 122px;
}
.vendor-balance-grid .summary-card span {
    display: block;
    color: #475569;
    font-size: .86rem;
    font-weight: 800;
    letter-spacing: .01em;
    margin: 0;
}
.vendor-balance-grid .summary-card strong {
    display: block;
    margin: .05rem 0;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.15;
    font-weight: 900;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.vendor-balance-grid .summary-card small {
    display: block;
    margin-top: auto;
    padding-top: .35rem;
    color: #64748b;
    font-size: .86rem;
    line-height: 1.25;
}
.vendor-balance-grid .summary-card.danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}
.vendor-balance-grid .summary-card.danger strong { color: #b91c1c; }

.selected-row {
    outline: 2px solid #f59e0b;
    background: #fff7ed;
}
.confirm-box {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fff1f2;
}
.confirm-box input {
    margin-top: 8px;
    max-width: 260px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* v1.17.23 - filtros en pantalla vendedores */
.vendor-filter-card {
    margin: 0 0 1rem;
    padding: 1rem;
}
.vendor-list-filter {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(210px, .9fr) auto;
    gap: .85rem;
    align-items: end;
}
.vendor-list-filter label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-weight: 800;
    color: #334155;
}
.vendor-list-filter .filter-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.btn.secondary {
    background: #f8fafc;
    color: #334155;
}
@media (max-width: 860px) {
    .vendor-list-filter {
        grid-template-columns: 1fr;
    }
}

/* v1.17.25 - totales de consulta de vendedores más claros */
.vendor-query-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.1rem 0 1.35rem;
}
.vendor-query-totals .summary-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    min-height: 136px;
    padding: 1.15rem 1.25rem;
    border-radius: 20px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}
.vendor-query-totals .summary-card span {
    display: block;
    color: #334155;
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: .015em;
    text-transform: uppercase;
}
.vendor-query-totals .summary-card strong {
    display: block;
    width: 100%;
    color: #0f172a;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.05;
    font-weight: 950;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.vendor-query-totals .summary-card small {
    display: block;
    margin-top: auto;
    padding-top: .55rem;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.32;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}
.vendor-query-totals .summary-card.danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #ffffff 0%, #fff7f7 100%);
}
.vendor-query-totals .summary-card.danger strong { color: #b91c1c; }
.vendor-query-totals .summary-card.total {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #ffffff 0%, #f7fff9 100%);
}
.vendor-query-totals .summary-card.total strong { color: #166534; }
@media (max-width: 720px) {
    .vendor-query-totals .summary-card strong { white-space: normal; }
}

/* v1.17.26 - administración de vendedores más clara */
.vendor-admin-search-card {
    margin-bottom: 1rem;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}
.vendor-admin-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(190px, .9fr) minmax(150px, .7fr) minmax(150px, .7fr) auto;
    gap: .85rem;
    align-items: end;
}
.vendor-admin-filter label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-weight: 900;
    color: #334155;
}
.vendor-admin-filter-help {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}
.vendor-selector-card { margin-bottom: 1rem; }
.vendor-selector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}
.vendor-selector-head strong { display: block; font-size: 1rem; }
.vendor-selector-head small { display: block; margin-top: .2rem; }
.vendor-selector { max-width: none; }
.vendor-admin-hero {
    display: grid;
    grid-template-columns: minmax(280px, 1.25fr) repeat(3, minmax(210px, .85fr));
    gap: 1rem;
    margin: 1.1rem 0 1.35rem;
}
.vendor-identity-card,
.vendor-balance-tile {
    border-radius: 22px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 34px rgba(15,23,42,.08);
    padding: 1.15rem 1.25rem;
    min-height: 148px;
}
.vendor-identity-card span,
.vendor-balance-tile span {
    display: block;
    color: #334155;
    font-size: .84rem;
    font-weight: 950;
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: .55rem;
}
.vendor-identity-card strong {
    display: block;
    color: #0f172a;
    font-size: clamp(1.65rem, 2.2vw, 2.25rem);
    line-height: 1.05;
    font-weight: 950;
    margin-bottom: .75rem;
}
.vendor-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem .9rem;
    color: #64748b;
}
.vendor-meta-grid small { font-size: .88rem; }
.vendor-balance-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.vendor-balance-tile strong {
    display: block;
    color: #0f172a;
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    line-height: 1.05;
    font-weight: 950;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.vendor-balance-tile small {
    display: block;
    margin-top: .75rem;
    padding-top: .6rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    line-height: 1.3;
}
.vendor-balance-tile.consignado { border-color: #bfdbfe; }
.vendor-balance-tile.vencido { border-color: #fecaca; background: linear-gradient(135deg, #ffffff 0%, #fff7f7 100%); }
.vendor-balance-tile.vencido strong { color: #b91c1c; }
.vendor-balance-tile.scoring { border-color: #bbf7d0; background: linear-gradient(135deg, #ffffff 0%, #f7fff9 100%); }
.vendor-balance-tile.scoring strong { color: #166534; }
.vendor-admin-period-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin: 0 0 1.25rem;
}
.vendor-admin-period-totals .summary-card {
    min-height: 118px;
    padding: 1rem 1.1rem;
    border-radius: 18px;
}
.vendor-admin-period-totals .summary-card strong {
    display: block;
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
}
.vendor-admin-period-totals .summary-card small {
    display: block;
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px solid #e2e8f0;
}
@media (max-width: 1120px) {
    .vendor-admin-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vendor-admin-filter .filter-actions { grid-column: span 2; }
    .vendor-admin-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .vendor-admin-filter { grid-template-columns: 1fr; }
    .vendor-admin-filter .filter-actions { grid-column: span 1; }
    .vendor-admin-hero { grid-template-columns: 1fr; }
    .vendor-meta-grid { grid-template-columns: 1fr; }
    .vendor-balance-tile strong { white-space: normal; }
    .vendor-selector-head { align-items: flex-start; flex-direction: column; }
}

/* Pedidos: tarjetas de resumen y asignación */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.25rem;
}
.summary-cards.compact-cards { margin: .75rem 0 1rem; }
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.stat-card span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: .45rem;
}
.stat-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.1;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}
.stat-card small {
    display: block;
    margin-top: .65rem;
    padding-top: .55rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}
.stat-card.danger-card {
    border-color: #fecaca;
    background: #fff7f7;
}
.stat-card.danger-card strong { color: #b91c1c; }

/* v1.17.38 - menú reorganizado en detalle de salida */
.salida-status-card {
    margin: 12px 0 16px;
}
.salida-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin: 16px 0 18px;
}
.menu-section {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15,23,42,.07);
}
.menu-section summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 800;
}
.menu-section summary::-webkit-details-marker { display:none; }
.menu-section summary span { font-size: 18px; letter-spacing: .2px; }
.menu-section summary small { color: rgba(255,255,255,.9); font-size: 12px; font-weight: 700; }
.menu-section-green summary { background: linear-gradient(135deg,#059669,#10b981); }
.menu-section-blue summary { background: linear-gradient(135deg,#1d4ed8,#3b82f6); }
.menu-section-purple summary { background: linear-gradient(135deg,#7c3aed,#a855f7); }
.menu-section-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.menu-action {
    display: block;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 800;
}
.menu-action:hover { background:#eef6ff; text-decoration:none; transform: translateY(-1px); }
.menu-action-strong { background:#ecfdf3; border-color:#86efac; color:#166534; }
.menu-action.danger { background:#fff1f2; border-color:#fecdd3; color:#be123c; }
.menu-action.disabled {
    color:#64748b;
    background:#f1f5f9;
    border-style:dashed;
    cursor:not-allowed;
}
.menu-help {
    padding: 10px 12px;
    border-radius: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color:#78350f;
    font-size: 13px;
    line-height: 1.35;
}
@media print { .salida-menu { display:none !important; } }

/* v1.17.38 - remitos de venta orientados al vendedor */
.remito-venta-title { text-align:center; margin-bottom:8px; }
.remito-vendedor-destacado {
    text-align:center;
    font-size:18px;
    font-weight:900;
    text-transform:uppercase;
    margin: 8px 0 10px;
    letter-spacing:.3px;
}
.remito-meta { text-align:center; color:#334155; margin:4px 0 10px; }
.remito-venta-table th,
.remito-venta-table td { text-align:center; }
.remito-venta-table td:first-child,
.remito-venta-table th:first-child { text-align:left; }
.remito-venta-total td { background:#eef6ff; font-weight:900; }


/* v1.17.39 - detalle de salida más colorido, visual y moderno */
.salida-hero-panel {
    margin: 0 0 18px;
    padding: 20px;
    border-radius: 28px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 48%, #10b981 100%);
    color: #fff;
    box-shadow: 0 24px 56px rgba(15, 23, 42, .18);
}
.salida-eyebrow {
    margin: 0 0 6px;
    font-size: .84rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: rgba(255,255,255,.78);
}
.salida-hero-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}
.salida-hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.02;
}
.salida-hero-subtitle {
    margin: .55rem 0 0;
    color: rgba(255,255,255,.95);
    font-size: 1rem;
}
.salida-hero-docs {
    min-width: 320px;
    max-width: 420px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.16);
    backdrop-filter: blur(6px);
}
.doc-heading {
    display: block;
    font-size: .83rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.82);
    margin-bottom: .7rem;
}
.doc-pills { display:flex; flex-wrap:wrap; gap:.55rem; }
.doc-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .58rem .82rem;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    font-size: .88rem;
    font-weight: 800;
}
.doc-pill:hover { text-decoration:none; background: rgba(255,255,255,.24); }
.doc-pill.empty {
    color: rgba(255,255,255,.86);
    background: rgba(255,255,255,.10);
}
.salida-state-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin: 1rem 0 1.05rem;
}
.ribbon-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .62rem .9rem;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-weight: 800;
}
.ribbon-chip .badge { background: rgba(255,255,255,.92); }
.salida-mini-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.salida-mini-card {
    min-height: 120px;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.salida-mini-card span {
    display:block;
    font-size:.8rem;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
    color: rgba(255,255,255,.78);
    margin-bottom:.55rem;
}
.salida-mini-card strong {
    display:block;
    font-size:1.32rem;
    line-height:1.12;
    color:#fff;
    margin-bottom:.55rem;
}
.salida-mini-card small { color: rgba(255,255,255,.88); }
.salida-menu {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.menu-section {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 38px rgba(15,23,42,.10);
}
.menu-section summary {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}
.menu-section summary:hover { filter: brightness(1.02); }
.menu-section .summary-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.25rem;
    background: rgba(255,255,255,.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.menu-section .summary-copy { display:flex; flex-direction:column; gap:4px; }
.menu-section .summary-copy span { font-size:1.12rem; }
.menu-section .summary-copy small { font-size:.79rem; color: rgba(255,255,255,.92); line-height:1.3; }
.summary-badge {
    padding: .42rem .72rem;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.22);
    color:#fff;
    font-size:.76rem;
    font-weight:900;
    letter-spacing:.05em;
    text-transform:uppercase;
}
.menu-section-green summary { background: linear-gradient(135deg,#059669,#22c55e); }
.menu-section-blue summary { background: linear-gradient(135deg,#2563eb,#38bdf8); }
.menu-section-green-soft summary { background: linear-gradient(135deg,#16a34a,#34d399); }
.menu-section-purple summary { background: linear-gradient(135deg,#7c3aed,#ec4899); }
.menu-section-body {
    padding: 14px;
    background: linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
}
.menu-action {
    display:flex;
    align-items:center;
    gap:.75rem;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 850;
    box-shadow: 0 8px 18px rgba(15,23,42,.04);
}
.menu-action .action-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius: 12px;
    background:#f8fafc;
    font-size:1rem;
}
.menu-action:hover {
    background:#f8fbff;
    border-color:#bfdbfe;
    box-shadow: 0 12px 22px rgba(37,99,235,.12);
}
.menu-action-strong {
    background: linear-gradient(135deg,#ecfdf3 0%, #f0fdf4 100%);
    border-color:#86efac;
    color:#166534;
}
.menu-action-strong .action-icon { background:#dcfce7; }
.menu-action.danger {
    background: linear-gradient(135deg,#fff1f2 0%, #fff7f7 100%);
    border-color:#fecdd3;
    color:#be123c;
}
.menu-action.danger .action-icon { background:#ffe4e6; }
.menu-action.disabled {
    background:#f8fafc;
    border-style:dashed;
    opacity:.78;
}
.menu-help {
    margin-top: 4px;
    padding: 13px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg,#fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
    color:#7c2d12;
}
@media (max-width: 980px) {
    .salida-hero-top { flex-direction: column; }
    .salida-hero-docs { min-width: 0; max-width: none; width: 100%; }
    .salida-mini-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .salida-mini-cards { grid-template-columns: 1fr; }
    .menu-section summary { grid-template-columns: auto 1fr; }
    .summary-badge { grid-column: 1 / -1; justify-self: start; }
}
@media print {
    .salida-hero-panel, .salida-menu { display:none !important; }
}


/* v1.17.40 - menú de salida con cabeceras tipo botón grande y panel desplegable */
.salida-menu {
    grid-template-columns: 1fr;
    gap: 14px;
}
.salida-menu .menu-section {
    border-radius: 26px;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.salida-menu .menu-section summary {
    position: relative;
    min-height: 118px;
    padding: 18px 24px;
    border-radius: 26px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.salida-menu .menu-section summary:hover {
    transform: translateY(-2px);
    filter: saturate(1.03);
    box-shadow: 0 22px 38px rgba(15, 23, 42, .16);
}
.salida-menu .menu-section[open] summary {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}
.salida-menu .menu-section .summary-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 1.45rem;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.salida-menu .menu-section .summary-copy {
    align-items: center;
}
.salida-menu .menu-section .summary-copy span {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: .01em;
}
.salida-menu .menu-section .summary-copy small {
    font-size: .93rem;
    max-width: 680px;
    line-height: 1.35;
    color: rgba(255,255,255,.92);
}
.salida-menu .menu-section .summary-badge {
    margin-top: 2px;
    font-size: .74rem;
    padding: .48rem .8rem;
    background: rgba(255,255,255,.16);
}
.salida-menu .menu-section summary::after {
    content: '▾';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    font-weight: 900;
    color: rgba(255,255,255,.95);
    transition: transform .15s ease;
}
.salida-menu .menu-section[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}
.salida-menu .menu-section-body {
    margin-top: -6px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-top: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 18px 34px rgba(15, 23, 42, .10);
}
.salida-menu .menu-section-green .menu-section-body {
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
}
.salida-menu .menu-section-blue .menu-section-body {
    background: linear-gradient(180deg, #eff6ff 0%, #eef4ff 100%);
}
.salida-menu .menu-section-green-soft .menu-section-body {
    background: linear-gradient(180deg, #f0fdf4 0%, #f7fff9 100%);
}
.salida-menu .menu-section-purple .menu-section-body {
    background: linear-gradient(180deg, #faf5ff 0%, #fdf4ff 100%);
}
.salida-menu .menu-section-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}
.salida-menu .menu-section-body .menu-help {
    grid-column: 1 / -1;
}
.salida-menu .menu-action {
    min-height: 68px;
    border-radius: 18px;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 10px 22px rgba(15,23,42,.05);
}
.salida-menu .menu-action span:last-child {
    line-height: 1.28;
}
.salida-menu .menu-action .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}
.salida-menu .menu-action:hover {
    transform: translateY(-2px);
}
.salida-menu .menu-action.disabled {
    background: rgba(255,255,255,.62);
}
.salida-menu .menu-help {
    border-radius: 18px;
}
@media (max-width: 720px) {
    .salida-menu .menu-section summary {
        min-height: 108px;
        padding: 18px 16px 20px;
    }
    .salida-menu .menu-section .summary-copy span {
        font-size: 1.18rem;
    }
    .salida-menu .menu-section summary::after {
        right: 16px;
        top: 18px;
        transform: none;
    }
    .salida-menu .menu-section[open] summary::after {
        transform: rotate(180deg);
    }
    .salida-menu .menu-section-body {
        grid-template-columns: 1fr;
    }
}


/* v1.17.41 - menú de salida minimalista con botones grandes y despliegue dinámico */
.salida-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.salida-menu-intro {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: 0 12px 24px rgba(15,23,42,.06);
}
.salida-menu-intro h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}
.salida-menu-intro p {
    margin: 0;
    color: #64748b;
}
.salida-accordion .menu-section {
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
}
.salida-accordion .menu-section summary {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 118px;
    padding: 20px 54px 20px 20px;
    text-align: center;
    border-radius: 24px;
    color: #fff;
    box-shadow: 0 18px 36px rgba(15,23,42,.12);
    transition: transform .16s ease, box-shadow .16s ease;
}
.salida-accordion .menu-section summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(15,23,42,.16);
}
.salida-accordion .menu-section summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 900;
}
.salida-accordion .menu-section[open] summary::after {
    content: '–';
}
.salida-accordion .menu-big-icon {
    font-size: 1.7rem;
    line-height: 1;
}
.salida-accordion .menu-big-title {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.1;
}
.salida-accordion .menu-big-subtitle {
    max-width: 680px;
    font-size: .95rem;
    line-height: 1.35;
    color: rgba(255,255,255,.92);
    font-weight: 700;
}
.salida-accordion .menu-section-body {
    display: none;
    margin-top: 8px;
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 16px 32px rgba(15,23,42,.10);
}
.salida-accordion .menu-section[open] .menu-section-body {
    display: grid;
}
.salida-accordion .compact-panel {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.salida-accordion .menu-action {
    min-height: 64px;
    background: rgba(255,255,255,.94);
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,.18);
}
.salida-accordion .menu-help {
    grid-column: 1 / -1;
    border-radius: 16px;
}
@media (max-width: 760px) {
    .salida-accordion .menu-section summary {
        min-height: 102px;
        padding-right: 48px;
    }
    .salida-accordion .menu-big-title {
        font-size: 1.22rem;
    }
    .salida-accordion .compact-panel {
        grid-template-columns: 1fr;
    }
}


/* v1.17.42 - menú horizontal con botones grandes de color y panel desplegable */
.salida-accordion {
    display: block;
}
.salida-accordion .salida-menu-intro {
    display: none !important;
}
.salida-accordion .menu-section {
    margin-bottom: 12px;
}
.salida-accordion .menu-section summary {
    min-height: 92px;
    padding: 16px 58px 16px 18px;
    border-radius: 22px;
    flex-direction: row;
    text-align: left;
    justify-content: flex-start;
    gap: 14px;
}
.salida-accordion .menu-section .menu-big-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 56px;
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.20);
}
.salida-accordion .menu-section .menu-big-title {
    display: block;
    font-size: 1.28rem;
    font-weight: 950;
}
.salida-accordion .menu-section .menu-big-subtitle {
    display: block;
    font-size: .88rem;
    margin-top: 3px;
    color: rgba(255,255,255,.92);
}
.salida-accordion .menu-section summary::after {
    right: 20px;
}
.salida-accordion .menu-section-body.compact-panel {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 14px;
}
.salida-accordion .menu-action {
    min-height: 58px;
    border-radius: 16px;
    font-size: .93rem;
}
.salida-accordion .menu-action .action-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
}
.menu-section-payments summary {
    background: linear-gradient(135deg,#ea580c,#f59e0b) !important;
}
.salida-accordion .menu-section-payments .menu-section-body {
    background: linear-gradient(180deg,#fff7ed 0%, #fffbeb 100%) !important;
}

/* Pantallas anchas: mostrar encabezados generales como botones horizontales */
@media (min-width: 980px) {
    .salida-accordion {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
        align-items: start;
    }
    .salida-accordion .menu-section {
        margin-bottom: 0;
        display: contents;
    }
    .salida-accordion .menu-section summary {
        grid-row: 1;
        min-height: 138px;
        padding: 18px 18px 48px;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 10px;
        border-radius: 24px;
    }
    .salida-accordion .menu-section .menu-big-icon {
        width: 58px;
        height: 58px;
        flex: 0 0 58px;
    }
    .salida-accordion .menu-section .menu-big-title {
        font-size: 1.2rem;
    }
    .salida-accordion .menu-section .menu-big-subtitle {
        font-size: .78rem;
        line-height: 1.25;
    }
    .salida-accordion .menu-section summary::after {
        right: 50%;
        top: auto;
        bottom: 12px;
        transform: translateX(50%);
    }
    .salida-accordion .menu-section[open] summary::after {
        transform: translateX(50%);
        content: '–';
    }
    .salida-accordion .menu-section .menu-section-body {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 0;
        animation: menuDrop .14s ease-out;
    }
}
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* v1.17.43 - encabezados principales bien resaltados por color */
.salida-accordion .menu-section summary {
    border: 0 !important;
    color: #fff !important;
    background-size: 140% 140%;
    position: relative;
    overflow: hidden;
}
.salida-accordion .menu-section summary::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,.34), transparent 28%),
        radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 24%);
    pointer-events: none;
}
.salida-accordion .menu-section summary > * {
    position: relative;
    z-index: 1;
}
.salida-accordion .menu-section-green summary {
    background: linear-gradient(135deg, #047857 0%, #10b981 58%, #34d399 100%) !important;
}
.salida-accordion .menu-section-blue summary {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #38bdf8 100%) !important;
}
.salida-accordion .menu-section-green-soft summary {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 56%, #86efac 100%) !important;
}
.salida-accordion .menu-section-purple summary {
    background: linear-gradient(135deg, #6d28d9 0%, #a855f7 52%, #ec4899 100%) !important;
}
.salida-accordion .menu-section-payments summary {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 52%, #facc15 100%) !important;
}
.salida-accordion .menu-big-title {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: .42rem .95rem;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(15,23,42,.20);
}
.salida-accordion .menu-big-subtitle {
    color: rgba(255,255,255,.96) !important;
    text-shadow: 0 1px 1px rgba(15,23,42,.18);
    font-weight: 800 !important;
}
.salida-accordion .menu-big-icon {
    background: rgba(255,255,255,.24) !important;
    border-color: rgba(255,255,255,.32) !important;
    box-shadow: 0 8px 18px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.24);
}
.salida-accordion .menu-section[open] summary {
    outline: 4px solid rgba(15,23,42,.08);
    box-shadow: 0 24px 46px rgba(15,23,42,.22) !important;
}
.salida-accordion .menu-section summary:hover {
    filter: brightness(1.04) saturate(1.08) !important;
}

/* Asegura paneles de opciones con color suave correspondiente */
.salida-accordion .menu-section-green .menu-section-body {
    background: linear-gradient(180deg, #dcfce7 0%, #f0fdf4 100%) !important;
    border: 1px solid #86efac;
}
.salida-accordion .menu-section-blue .menu-section-body {
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%) !important;
    border: 1px solid #93c5fd;
}
.salida-accordion .menu-section-green-soft .menu-section-body {
    background: linear-gradient(180deg, #d1fae5 0%, #ecfdf5 100%) !important;
    border: 1px solid #6ee7b7;
}
.salida-accordion .menu-section-purple .menu-section-body {
    background: linear-gradient(180deg, #f3e8ff 0%, #fdf4ff 100%) !important;
    border: 1px solid #d8b4fe;
}
.salida-accordion .menu-section-payments .menu-section-body {
    background: linear-gradient(180deg, #ffedd5 0%, #fffbeb 100%) !important;
    border: 1px solid #fdba74;
}

@media (min-width: 980px) {
    .salida-accordion .menu-section summary {
        min-height: 158px !important;
    }
    .salida-accordion .menu-big-title {
        font-size: 1.32rem !important;
        min-width: 126px;
    }
}


/* v1.17.45 - resumen general al final del armado por línea */
.resumen-general-lineas {
    border: 2px solid #2563eb;
    background: #ffffff;
}
.resumen-general-lineas .linea-header {
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    margin-bottom: 10px;
}
.resumen-general-table th {
    text-align: center;
    background: linear-gradient(180deg, #dbeafe, #bfdbfe);
}
.resumen-general-table td:first-child,
.resumen-general-table th:first-child {
    text-align: left;
    min-width: 220px;
}
.resumen-general-table tr.subtotal td {
    background: #fff7ed;
    font-weight: 900;
}
@media print {
    .resumen-general-lineas {
        page-break-before: always;
        border: 0;
    }
}


/* v1.17.48 - navbar superior reorganizado y moderno */
.app-navbar {
    gap: 16px;
    align-items: center;
    padding: 10px 18px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 26px rgba(15,23,42,.08);
}
.app-navbar .brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: 6px 10px 6px 0;
    border-radius: 14px;
    color: #0f172a;
}
.app-navbar .brand:hover {
    background: transparent;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    color: #fff;
    font-size: .82rem;
    font-weight: 950;
    letter-spacing: -.02em;
    box-shadow: 0 8px 18px rgba(37,99,235,.22);
}
.nav-groups {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.nav-dropdown {
    position: relative;
}
.nav-dropdown summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
    transition: .14s ease;
}
.nav-dropdown summary::-webkit-details-marker {
    display: none;
}
.nav-dropdown summary::after {
    content: '▾';
    font-size: .8rem;
    color: #64748b;
    transition: transform .14s ease;
}
.nav-dropdown[open] summary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 10px 22px rgba(37,99,235,.20);
}
.nav-dropdown[open] summary::after {
    color: #fff;
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 9px);
    min-width: 230px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    border: 1px solid #e2e8f0;
    box-shadow: 0 22px 54px rgba(15,23,42,.18);
    z-index: 1200;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    left: 22px;
    top: -7px;
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    background: rgba(255,255,255,.98);
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}
.header .nav-dropdown-menu a,
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 12px;
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
}
.header .nav-dropdown-menu a:hover,
.nav-dropdown-menu a:hover {
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
}
.nav-direct {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    font-weight: 900;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
}
.nav-direct:hover {
    background: #eff6ff;
    text-decoration: none;
}
.nav-admin {
    background: linear-gradient(135deg, #111827, #334155);
    border-color: #111827;
    color: #fff !important;
}
.nav-admin:hover {
    background: linear-gradient(135deg, #020617, #1e293b);
    color: #fff !important;
}
.app-navbar .logout-form {
    margin-left: auto;
}
.app-navbar .logout-form button {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 900;
}
@media (max-width: 860px) {
    .app-navbar {
        align-items: flex-start;
    }
    .nav-groups {
        width: 100%;
        order: 3;
    }
    .nav-dropdown {
        position: static;
    }
    .nav-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: 0 10px 24px rgba(15,23,42,.10);
    }
    .nav-dropdown-menu::before {
        display: none;
    }
}


/* v1.17.49 - buscador en listado de productos */
.list-search-card {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-color: #dbeafe;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}
.list-search-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.list-search-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 900;
    color: #334155;
}
.list-search-form input[type="search"] {
    max-width: none;
    min-height: 42px;
}
.list-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 720px) {
    .list-search-form {
        grid-template-columns: 1fr;
    }
}


/* v1.17.50 - módulo pedidos/ajustes más claro */
.pedidos-hero,
.pedido-detail-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 20px;
    border-radius: 26px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 52%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 22px 48px rgba(15,23,42,.16);
    margin-bottom: 18px;
}
.pedidos-hero h1,
.pedido-detail-hero h1 {
    color: #fff;
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 3vw, 2.55rem);
}
.pedidos-hero p,
.pedido-detail-hero p {
    margin: 0;
    color: rgba(255,255,255,.92);
    max-width: 850px;
}
.pedidos-eyebrow {
    margin: 0 0 6px !important;
    font-size: .78rem;
    font-weight: 950;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(255,255,255,.74) !important;
}
.pedido-flow-grid,
.pedido-detail-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 16px 0 18px;
}
.pedido-flow-card,
.pedido-detail-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 14px 32px rgba(15,23,42,.08);
}
.pedido-flow-card h2,
.pedido-detail-card h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}
.pedido-flow-card p,
.pedido-detail-card p {
    color: #64748b;
    line-height: 1.4;
}
.pedido-flow-card.proveedor,
.pedido-detail-card.proveedor {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
}
.pedido-flow-card.vendedor,
.pedido-detail-card.venta {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}
.pedido-flow-card.producto {
    border-color: #ddd6fe;
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
}
.pedido-flow-card.control {
    border-color: #fed7aa;
    background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}
.flow-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37,99,235,.10);
    font-size: 1.45rem;
    margin-bottom: 12px;
}
.flow-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
.pedido-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.pedido-search-card {
    margin: 14px 0;
}
.pedido-search-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(210px, .7fr) auto;
    gap: 12px;
    align-items: end;
}
.pedido-search-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 900;
    color: #334155;
}
.pedido-search-form input,
.pedido-search-form select {
    max-width: none;
}
.pedido-search-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.pedido-actions {
    white-space: normal;
    min-width: 280px;
}
.pedido-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.pedido-choice {
    display: block;
    min-height: 116px;
    padding: 16px;
    border-radius: 20px;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15,23,42,.06);
}
.pedido-choice:hover {
    text-decoration: none;
    transform: translateY(-2px);
}
.pedido-choice strong {
    display: block;
    font-size: 1.08rem;
    margin-bottom: 8px;
}
.pedido-choice span {
    display: block;
    color: #64748b;
    line-height: 1.35;
}
.pedido-choice.vendedor {
    background: linear-gradient(135deg, #dcfce7, #f0fdf4);
    border-color: #86efac;
}
.pedido-choice.producto {
    background: linear-gradient(135deg, #ede9fe, #faf5ff);
    border-color: #c4b5fd;
}
.pedido-choice.remito {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border-color: #93c5fd;
}
.pedido-choice.danger {
    background: linear-gradient(135deg, #ffe4e6, #fff1f2);
    border-color: #fecdd3;
}
.pedido-choice.disabled {
    background: linear-gradient(135deg, #f1f5f9, #fff);
}
@media (max-width: 840px) {
    .pedidos-hero,
    .pedido-detail-hero {
        flex-direction: column;
    }
    .pedido-search-form {
        grid-template-columns: 1fr;
    }
}


/* v1.17.51 - estado proveedor liquidado/cerrado en detalle de pedido */
.stat-card.success-card {
    border-color: #86efac;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}
.stat-card.success-card strong {
    color: #166534;
}
.pedido-provider-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    margin: 12px 0 4px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.pedido-provider-status span {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
}
.pedido-provider-status.ok {
    border-color: #86efac;
    background: #f0fdf4;
}
.pedido-provider-status.ok span {
    background: #dcfce7;
}
.pedido-provider-status.warn {
    border-color: #fde68a;
    background: #fffbeb;
}
.pedido-provider-status.warn span {
    background: #fef3c7;
}
.pedido-provider-status.pending {
    border-color: #bfdbfe;
    background: #eff6ff;
}


/* v1.17.52 - asignación por producto más compacta */
.pedido-producto-bloque {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.pedido-asignacion-compact-wrap {
    max-width: 620px;
    margin: 0 auto 18px;
}
.pedido-asignacion-producto {
    width: 100%;
    table-layout: fixed;
}
.pedido-asignacion-producto th:first-child,
.pedido-asignacion-producto td:first-child {
    width: 72%;
}
.pedido-asignacion-producto th.num,
.pedido-asignacion-producto td.num {
    width: 28%;
    text-align: center;
}
.pedido-asignacion-producto input.qty {
    width: 86px;
    max-width: 86px;
    text-align: center;
    font-weight: 800;
    display: inline-block;
}
.pedido-asignacion-producto .vendedor-asignacion {
    padding-left: 12px;
    padding-right: 10px;
}
.pedido-asignacion-producto .vendedor-asignacion strong {
    font-size: 1rem;
}
.pedido-resumen-fijo {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 760px) {
    .pedido-producto-bloque,
    .pedido-asignacion-compact-wrap,
    .pedido-resumen-fijo {
        max-width: 100%;
    }
    .pedido-asignacion-producto th:first-child,
    .pedido-asignacion-producto td:first-child {
        width: 68%;
    }
    .pedido-asignacion-producto th.num,
    .pedido-asignacion-producto td.num {
        width: 32%;
    }
}


/* v1.17.53 - venta directa de producto como pedido */
.venta-directa-config {
    margin: 16px auto;
    max-width: 960px;
}
.venta-directa-config h2 {
    margin-top: 0;
}
.venta-directa-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.venta-directa-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 900;
    color: #334155;
}
.venta-directa-grid .span-2 {
    grid-column: span 2;
}
.venta-directa-grid input,
.venta-directa-grid select {
    max-width: none;
}
.venta-directa-vendedores {
    margin-top: 18px;
}
.venta-producto-libre-form .actions {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 860px) {
    .venta-directa-grid {
        grid-template-columns: 1fr;
    }
    .venta-directa-grid .span-2 {
        grid-column: span 1;
    }
}


/* v1.17.55 - venta producto libre más cómoda y dinámica */
.venta-libre-hero {
    margin-bottom: 12px;
}
.venta-libre-filtro {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
.venta-libre-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
}
.venta-libre-panel {
    position: sticky;
    top: 84px;
    z-index: 20;
    padding: 16px;
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}
.venta-libre-panel h2 {
    margin-top: 0;
}
.venta-libre-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 11px;
    font-weight: 900;
    color: #334155;
}
.venta-libre-field input,
.venta-libre-field select {
    max-width: none;
    min-height: 42px;
}
.venta-libre-resumen {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 14px 30px rgba(15,23,42,.18);
}
.venta-libre-resumen span,
.venta-libre-resumen small {
    display: block;
    color: rgba(255,255,255,.76);
}
.venta-libre-resumen strong {
    display: block;
    margin: 4px 0;
    font-size: 1.08rem;
    color: #fff;
}
.venta-libre-totales {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.venta-libre-totales div {
    padding: 11px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dbeafe;
}
.venta-libre-totales span {
    display: block;
    color: #64748b;
    font-size: .78rem;
    font-weight: 900;
}
.venta-libre-totales strong {
    display: block;
    color: #1d4ed8;
    font-size: 1.35rem;
}
.venta-libre-actions {
    display: grid;
    gap: 8px;
}
.venta-libre-actions .btn,
.venta-libre-actions .btn-primary {
    width: 100%;
    justify-content: center;
}
.venta-libre-carga {
    min-width: 0;
}
.venta-libre-carga-header {
    position: sticky;
    top: 76px;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.96);
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}
.venta-libre-carga-header h2 {
    margin: 0 0 4px;
}
.venta-libre-chip {
    padding: 9px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 950;
    white-space: nowrap;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.venta-libre-table-wrap {
    max-width: 720px;
}
.venta-libre-table {
    width: 100%;
    table-layout: fixed;
}
.venta-libre-table th:first-child,
.venta-libre-table td:first-child {
    width: 68%;
}
.venta-libre-table th.num,
.venta-libre-table td.num {
    width: 32%;
    text-align: center;
}
.venta-libre-table input.qty {
    width: 110px;
    max-width: 110px;
    height: 42px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 900;
}
.venta-libre-table tr.row-con-cantidad td {
    background: #ecfdf5;
}
.venta-libre-table tr.row-con-cantidad input.qty {
    border-color: #22c55e;
    background: #f0fdf4;
}
.venta-libre-bottom-actions {
    max-width: 720px;
}
@media (max-width: 980px) {
    .venta-libre-layout {
        grid-template-columns: 1fr;
    }
    .venta-libre-panel,
    .venta-libre-carga-header {
        position: static;
    }
    .venta-libre-table-wrap,
    .venta-libre-bottom-actions {
        max-width: 100%;
    }
}
@media print {
    .venta-libre-layout {
        display: block;
    }
}


/* v1.17.56 - tabla venta producto libre más chica y legible */
.venta-libre-carga {
    max-width: 620px;
}
.venta-libre-carga-header {
    max-width: 620px;
}
.venta-libre-table-wrap {
    max-width: 520px;
    margin-left: 0;
    margin-right: auto;
}
.venta-libre-table {
    width: 520px;
    max-width: 100%;
    table-layout: fixed;
}
.venta-libre-table th:first-child,
.venta-libre-table td:first-child {
    width: 68%;
}
.venta-libre-table th.num,
.venta-libre-table td.num {
    width: 32%;
    text-align: left;
    padding-left: 6px;
}
.venta-libre-table .vendedor-asignacion {
    padding: 8px 8px 8px 12px;
}
.venta-libre-table .vendedor-asignacion strong {
    display: block;
    font-size: 1.18rem;
    line-height: 1.15;
    font-weight: 950;
    color: #0f172a;
    letter-spacing: -.01em;
}
.venta-libre-table .vendedor-asignacion small {
    display: block;
    margin-top: 3px;
    font-size: .78rem;
    color: #64748b;
}
.venta-libre-table input.qty {
    width: 78px;
    max-width: 78px;
    height: 38px;
    padding: 4px 6px;
    text-align: center;
    font-size: 1.08rem;
    font-weight: 950;
}
.venta-libre-bottom-actions {
    max-width: 520px;
}
@media (max-width: 700px) {
    .venta-libre-carga,
    .venta-libre-carga-header,
    .venta-libre-table-wrap,
    .venta-libre-bottom-actions {
        max-width: 100%;
    }
    .venta-libre-table {
        width: 100%;
    }
    .venta-libre-table th:first-child,
    .venta-libre-table td:first-child {
        width: 66%;
    }
    .venta-libre-table th.num,
    .venta-libre-table td.num {
        width: 34%;
    }
}


/* v1.17.57 - proveedor automático en venta producto libre */
.proveedor-auto-msg {
    display: block;
    margin-top: -3px;
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
}
.proveedor-auto-msg.ok {
    color: #166534;
}


/* v1.17.58 - filtro dinámico sin perder carga en venta producto libre */
.venta-libre-filtro small.muted {
    display: block;
    margin-top: 8px;
    font-weight: 800;
    color: #64748b;
}
.venta-libre-vendedor-row[style*="display: none"] {
    display: none !important;
}


/* v1.17.68 - Scoring visual de vendedores */
.scoring-badge,
.scoring-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 950;
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.scoring-mini {
    min-width: 46px;
    padding: 3px 8px;
    font-size: .82rem;
    margin-left: 8px;
}

.scoring-verde {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.scoring-amarillo {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.scoring-rojo {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.scoring-card {
    border: 2px solid transparent;
}

.scoring-card-verde {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}

.scoring-card-amarillo {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border-color: #fde047;
}

.scoring-card-rojo {
    background: linear-gradient(135deg, #fff1f2, #fee2e2);
    border-color: #fca5a5;
}

.scoring-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 12px 0 16px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.matriz-colocacion tr.fila-scoring td:first-child {
    border-left: 7px solid transparent;
    font-weight: 900;
}

.matriz-colocacion tr.fila-scoring-verde td {
    background: #f0fdf4;
}

.matriz-colocacion tr.fila-scoring-verde td:first-child {
    border-left-color: #22c55e;
}

.matriz-colocacion tr.fila-scoring-amarillo td {
    background: #fefce8;
}

.matriz-colocacion tr.fila-scoring-amarillo td:first-child {
    border-left-color: #eab308;
}

.matriz-colocacion tr.fila-scoring-rojo td {
    background: #fff1f2;
}

.matriz-colocacion tr.fila-scoring-rojo td:first-child {
    border-left-color: #ef4444;
}

.matriz-colocacion tr.fila-scoring:hover td {
    filter: brightness(.98);
}

.vendedor-scoring-cell {
    white-space: nowrap;
}


/* v1.17.69 - tabla de vendedores más concisa y acciones como botones */
#tabla-vendedores .scoring-badge {
    min-width: 66px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 950;
    letter-spacing: .02em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
}

.acciones-vendedor {
    white-space: nowrap;
}

.btn-tabla {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 7px 10px;
    margin: 2px;
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 900;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.1;
}

.btn-detalle {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.btn-editar {
    background: #f59e0b !important;
    color: #1f2937 !important;
    border-color: #d97706 !important;
}

.btn-eliminar {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

.btn-tabla:hover {
    filter: brightness(.95);
    transform: translateY(-1px);
}


/* v1.17.71 - panel de actualización de scoring */
.scoring-update-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 12px 0;
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.scoring-update-card small {
    display: block;
    margin-top: 6px;
    color: #475569;
    font-weight: 800;
}

.scoring-help-panel {
    margin: 12px 0 16px;
    border-color: #c7d2fe;
    background: #f8fafc;
}

.scoring-help-panel pre {
    white-space: pre-wrap;
    background: #0f172a;
    color: #e5e7eb;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 800;
}

.scoring-help-toggle {
    white-space: nowrap;
}


/* v1.17.72 - foco al abrir menú desplegable de salida */
.salida-accordion details.menu-section {
    scroll-margin-top: 18px;
}
.salida-accordion details.menu-section[open] summary {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 3px;
}


/* v1.17.73 - refuerzo scroll menú salida */
.salida-accordion {
    scroll-margin-top: 12px;
}
.salida-accordion details.menu-section summary:focus {
    outline: 4px solid rgba(37, 99, 235, .30);
    outline-offset: 4px;
}


/* v1.17.74 - scroll al cuerpo abierto del menú de salida */
.salida-accordion .menu-section-body {
    scroll-margin-top: 24px;
}
.salida-accordion .menu-section-body:focus {
    outline: 4px solid rgba(34, 197, 94, .28);
    outline-offset: 4px;
    border-radius: 14px;
}


/* v1.17.75 - foco inicial en primer casillero de colocación */
#tabla-colocacion input.qty:focus {
    outline: 4px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}


/* v1.17.76 - buscador lateral de vendedor en colocación */
.colocacion-buscar-vendedor {
    position: sticky;
    top: 10px;
    z-index: 35;
    float: right;
    width: 230px;
    margin: 0 0 10px 14px;
    padding: 10px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: rgba(239, 246, 255, .96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.colocacion-buscar-vendedor label {
    display: block;
    margin: 0 0 6px;
    font-size: .82rem;
    font-weight: 900;
    color: #1e3a8a;
}

.colocacion-buscar-vendedor input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid #93c5fd;
}

.colocacion-buscar-vendedor .btn.small {
    width: 100%;
    margin-top: 5px;
    padding: 7px 8px;
}

.colocacion-buscar-vendedor small {
    display: block;
    margin-top: 6px;
    line-height: 1.25;
}

.matriz-colocacion tr.fila-vendedor-encontrada td {
    outline: 3px solid rgba(37, 99, 235, .38);
    outline-offset: -3px;
    filter: brightness(.96);
}

@media (max-width: 900px) {
    .colocacion-buscar-vendedor {
        float: none;
        width: auto;
        position: static;
        margin: 0 0 12px;
    }
}


/* v1.17.77 - buscador de vendedor al margen izquierdo de la tabla */
.colocacion-layout-con-buscador {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    clear: both;
}

.colocacion-layout-con-buscador .colocacion-buscar-vendedor {
    position: sticky;
    top: 12px;
    z-index: 35;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 9px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: rgba(239, 246, 255, .96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.colocacion-layout-con-buscador .colocacion-table-wrap {
    min-width: 0;
}

@media (max-width: 1050px) {
    .colocacion-layout-con-buscador {
        grid-template-columns: 1fr;
    }

    .colocacion-layout-con-buscador .colocacion-buscar-vendedor {
        position: static;
        width: auto !important;
        margin-bottom: 8px !important;
    }
}


/* v1.17.78 - buscador flotante en borde izquierdo sin achicar tabla */
.colocacion-buscar-vendedor.flotante-margen {
    position: fixed !important;
    left: 8px !important;
    top: 185px !important;
    width: 168px !important;
    z-index: 80 !important;
    float: none !important;
    margin: 0 !important;
    padding: 8px !important;
    border: 1px solid #93c5fd !important;
    border-radius: 14px !important;
    background: rgba(239, 246, 255, .97) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18) !important;
}

.colocacion-buscar-vendedor.flotante-margen label {
    font-size: .78rem;
    margin-bottom: 5px;
}

.colocacion-buscar-vendedor.flotante-margen input {
    padding: 6px 7px;
    font-size: .82rem;
}

.colocacion-buscar-vendedor.flotante-margen .btn.small {
    padding: 6px 7px;
    font-size: .82rem;
}

.colocacion-buscar-vendedor.flotante-margen small {
    font-size: .72rem;
}

.colocacion-table-wrap {
    width: 100%;
}

@media (max-width: 1200px) {
    .colocacion-buscar-vendedor.flotante-margen {
        position: static !important;
        width: auto !important;
        margin: 0 0 10px 0 !important;
    }
}


/* v1.17.79 - fila activa al cargar colocación y Enter como avance */
.matriz-colocacion tr.fila-vendedor-activa td {
    outline: 3px solid rgba(37, 99, 235, .48);
    outline-offset: -3px;
    box-shadow: inset 0 0 0 9999px rgba(59, 130, 246, .12);
}

.matriz-colocacion tr.fila-vendedor-activa td:first-child {
    box-shadow: inset 7px 0 0 #2563eb, inset 0 0 0 9999px rgba(59, 130, 246, .14);
}

.matriz-colocacion tr.fila-vendedor-activa input.qty:focus {
    background: #ffffff;
    outline: 4px solid rgba(37, 99, 235, .48);
    outline-offset: 1px;
}


/* v1.17.81 - búsqueda automática, filtro scoring y navegación estable */
.colocacion-buscar-vendedor.flotante-margen .colocacion-scoring-filtro {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #bfdbfe;
}

.colocacion-buscar-vendedor.flotante-margen .colocacion-scoring-filtro strong {
    display: block;
    font-size: .76rem;
    margin-bottom: 4px;
    color: #1e3a8a;
}

.colocacion-buscar-vendedor.flotante-margen .colocacion-scoring-filtro label {
    display: block;
    margin: 3px 0;
    font-size: .77rem;
    color: #0f172a;
}

.matriz-colocacion tr.fila-vendedor-encontrada td,
.matriz-colocacion tr.fila-vendedor-activa td {
    transition: box-shadow .08s ease, outline .08s ease, filter .08s ease;
}


/* v1.17.82 - foco real al buscar vendedor en colocación */
.matriz-colocacion tr.fila-vendedor-encontrada td:first-child {
    box-shadow: inset 7px 0 0 #1d4ed8, inset 0 0 0 9999px rgba(59, 130, 246, .18);
}


/* v1.17.83 - filtro de línea en colocación sin perder carga parcial */
.colocacion-buscar-vendedor.flotante-margen .colocacion-linea-filtro {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #bfdbfe;
}

.colocacion-buscar-vendedor.flotante-margen .colocacion-linea-filtro strong {
    display: block;
    font-size: .76rem;
    margin-bottom: 4px;
    color: #1e3a8a;
}

.colocacion-buscar-vendedor.flotante-margen .colocacion-linea-filtro select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 7px;
    border-radius: 10px;
    border: 1px solid #93c5fd;
    background: #ffffff;
    font-size: .80rem;
}


/* v1.17.85 - scroll interno de tabla al navegar con flechas */
#colocacion-table-wrap {
    scroll-behavior: auto;
}

.matriz-colocacion tr.fila-vendedor-activa {
    scroll-margin-top: 70px;
    scroll-margin-bottom: 70px;
}


/* v1.17.86 - resumen externo de totales de colocación */
.colocacion-resumen-totales {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 10px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.colocacion-resumen-totales .resumen-total-card {
    flex: 1 1 180px;
    min-width: 170px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.colocacion-resumen-totales .resumen-total-card span {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.colocacion-resumen-totales .resumen-total-card strong {
    display: block;
    margin-top: 4px;
    font-size: 1.45rem;
    line-height: 1;
    color: #0f172a;
}

.colocacion-resumen-totales .resumen-total-card.pendiente {
    border-color: #f59e0b;
    background: #fffbeb;
}

.colocacion-resumen-totales .resumen-total-card.pendiente strong {
    color: #b45309;
}

.colocacion-resumen-totales .resumen-total-card.exceso {
    border-color: #ef4444;
    background: #fef2f2;
}

.colocacion-resumen-totales .resumen-total-card.exceso strong {
    color: #b91c1c;
}

.colocacion-resumen-totales .resumen-total-card.ok {
    border-color: #22c55e;
    background: #f0fdf4;
}

.colocacion-resumen-totales .resumen-total-card.ok strong {
    color: #15803d;
}


/* v1.17.87 - spinner y barra de progreso al guardar colocación */
.colocacion-guardando-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(3px);
}

.colocacion-guardando-overlay.visible {
    display: flex;
}

.colocacion-guardando-card {
    width: min(420px, 92vw);
    padding: 24px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(15, 23, 42, .35);
    text-align: center;
    border: 1px solid #bfdbfe;
}

.colocacion-spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 999px;
    border: 6px solid #dbeafe;
    border-top-color: #2563eb;
    animation: colocacion-spin .85s linear infinite;
}

@keyframes colocacion-spin {
    to { transform: rotate(360deg); }
}

.colocacion-guardando-card h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: #0f172a;
}

.colocacion-guardando-card p {
    margin: 0 0 16px;
    color: #475569;
    font-size: .95rem;
}

.colocacion-progress {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
}

.colocacion-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    transition: width .35s ease;
}

#colocacion-progress-text {
    display: block;
    margin-top: 8px;
    font-weight: 800;
    color: #334155;
}

#form-colocacion .disabled {
    opacity: .65;
    pointer-events: none;
}


/* v1.17.88 - control producto por producto */
.colocacion-control-productos {
    margin: 12px 0 10px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.colocacion-control-productos h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: #0f172a;
}

.colocacion-control-productos p {
    margin: 0 0 10px;
}

.control-productos-wrap {
    overflow-x: auto;
}

.control-productos-tabla {
    width: 100%;
    min-width: 620px;
}

.control-productos-tabla th,
.control-productos-tabla td {
    padding: 7px 9px;
}

.control-productos-tabla .num {
    text-align: right;
    white-space: nowrap;
}

.control-productos-tabla tr.control-producto-row.pendiente td {
    background: #fffbeb;
}

.control-productos-tabla tr.control-producto-row.pendiente .control-diferencia {
    color: #b45309;
}

.control-productos-tabla tr.control-producto-row.exceso td {
    background: #fef2f2;
}

.control-productos-tabla tr.control-producto-row.exceso .control-diferencia {
    color: #b91c1c;
}

.control-productos-tabla tr.control-producto-row.ok td {
    background: #f0fdf4;
}

.control-productos-tabla tr.control-producto-row.ok .control-diferencia {
    color: #15803d;
}

.control-productos-tabla tfoot td {
    font-weight: 900;
    background: #e2e8f0;
}


/* v1.17.89 - filtro solo vendedores con carga */
.colocacion-buscar-vendedor.flotante-margen .colocacion-carga-filtro {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #bfdbfe;
}

.colocacion-buscar-vendedor.flotante-margen .colocacion-carga-filtro label {
    display: block;
    font-size: .78rem;
    font-weight: 850;
    color: #0f172a;
    line-height: 1.25;
}


/* v1.17.91 - armado por línea: totales destacados y ceros en blanco */
.matriz-linea td.total-vendedor-linea {
    background: #e2e8f0 !important;
    font-weight: 900;
}

.matriz-linea tr.subtotal td.total-vendedor-linea {
    background: #facc15 !important;
}


/* v1.17.92 - contador de remitos generados */
.remitos-count-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.remitos-count-card span {
    font-weight: 900;
    color: #1e3a8a;
}

.remitos-count-card strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 950;
}

.remitos-count-card small {
    color: #475569;
    font-weight: 700;
}


/* v1.17.92 - resumen cantidad de remitos de carga */
.remitos-carga-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.remitos-carga-card {
    flex: 1 1 220px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.remitos-carga-card span {
    display: block;
    font-size: .78rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.remitos-carga-card strong {
    display: block;
    margin-top: 4px;
    font-size: 2rem;
    line-height: 1;
    color: #1d4ed8;
}

.remitos-carga-card small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-weight: 750;
}


/* v1.17.93 - filtro de líneas para imprimir remitos de carga */
.remitos-lineas-panel {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.remitos-lineas-panel > strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3a8a;
}

.remitos-lineas-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.remitos-lineas-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.remitos-lineas-checks label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    font-weight: 800;
}

#remitos-lineas-estado {
    display: block;
    margin-top: 8px;
    color: #334155;
    font-weight: 850;
}

@media print {
    .print-ticket.remito[style*="display: none"] {
        display: none !important;
    }
}


/* v1.17.94 - filtro compacto de líneas en remitos de carga */
.remitos-toolbar-compacta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 8px;
    padding: 7px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.remitos-toolbar-linea {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .86rem;
}

.selector-linea-remito-carga {
    min-width: 160px;
    max-width: 260px;
    padding: 5px 7px;
    border: 1px solid #93c5fd;
    border-radius: 9px;
    background: #ffffff;
}

.remitos-toolbar-compacta .btn.small {
    padding: 5px 8px;
    font-size: .80rem;
}

.remitos-toolbar-compacta .btn-primary {
    padding: 7px 12px;
    white-space: nowrap;
}

.remitos-toolbar-compacta #remitos-lineas-estado {
    font-weight: 850;
    color: #334155;
}

.remitos-toolbar-compacta .compact-hidden {
    display: none !important;
}

@media (max-width: 800px) {
    .remitos-toolbar-compacta {
        align-items: stretch;
        flex-direction: column;
    }
}


/* v1.17.95 - venta libre más cómoda con remito vivo */
.venta-libre-layout {
    align-items: flex-start;
}

.venta-libre-panel {
    position: sticky;
    top: 12px;
}

.venta-libre-totales {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.venta-libre-precio-producto {
    display: block;
    margin-top: 6px;
    font-weight: 850;
    color: #1d4ed8;
}

.venta-libre-carga-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.venta-libre-table th,
.venta-libre-table td {
    vertical-align: middle;
}

.venta-libre-table .venta-libre-cantidad-cell input {
    width: 92px;
    font-size: 1.08rem;
    font-weight: 900;
    text-align: center;
}

.venta-libre-table tr.row-con-cantidad td {
    background: #eff6ff;
}

.venta-libre-table tr.row-con-cantidad .vendedor-asignacion strong {
    color: #1d4ed8;
}

.venta-libre-importe-cell {
    min-width: 115px;
}

.importe-vendedor-libre {
    color: #0f172a;
}

.venta-libre-remito-vivo {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

.remito-vivo-header span,
.remito-vivo-total span {
    display: block;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 900;
    color: #64748b;
}

.remito-vivo-header strong {
    display: block;
    margin-top: 3px;
    font-size: 1rem;
    color: #0f172a;
}

.remito-vivo-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 8px 0;
    color: #475569;
    font-size: .84rem;
    font-weight: 750;
}

.remito-vivo-lista {
    max-height: 230px;
    overflow: auto;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 0;
}

.remito-vivo-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.remito-vivo-item:last-child {
    border-bottom: 0;
}

.remito-vivo-item strong {
    color: #0f172a;
}

.remito-vivo-item span {
    white-space: nowrap;
    font-weight: 850;
    color: #1d4ed8;
}

.remito-vivo-total {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
}

.remito-vivo-total strong {
    font-size: 1.25rem;
    color: #15803d;
}

@media (max-width: 1100px) {
    .venta-libre-panel {
        position: static;
    }
    .venta-libre-totales {
        grid-template-columns: 1fr;
    }
}


/* v1.17.96 - pedido libre por vendedor y varios productos */
.pedido-vendedor-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(460px, 1fr) minmax(280px, 360px);
    gap: 14px;
    align-items: start;
}

.pedido-vendedor-panel,
.pedido-remito-vivo-panel {
    position: sticky;
    top: 12px;
}

.pedido-vendedor-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0;
}

.pedido-vendedor-kpis div {
    padding: 10px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.pedido-vendedor-kpis span {
    display: block;
    font-size: .76rem;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pedido-vendedor-kpis strong {
    display: block;
    margin-top: 3px;
    font-size: 1.35rem;
    color: #1d4ed8;
}

.pedido-productos-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pedido-productos-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.pedido-productos-tools input {
    min-width: 220px;
}

.pedido-productos-wrap {
    max-height: calc(100vh - 235px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.pedido-productos-table {
    width: 100%;
}

.pedido-productos-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e2e8f0;
}

.pedido-productos-table td small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.pedido-productos-table input.qty {
    width: 88px;
    text-align: center;
    font-size: 1.08rem;
    font-weight: 900;
}

.pedido-productos-table tr.row-con-cantidad td {
    background: #eff6ff;
}

.pedido-productos-table tr.row-con-cantidad td:first-child {
    box-shadow: inset 6px 0 0 #2563eb;
}

.pedido-remito-vendedor {
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-weight: 950;
    color: #0f172a;
}

.pedido-remito-meta {
    margin: 8px 0;
    color: #475569;
    font-weight: 850;
}

.pedido-remito-lista {
    max-height: calc(100vh - 310px);
    overflow: auto;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
}

.pedido-remito-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.pedido-remito-item:last-child {
    border-bottom: 0;
}

.pedido-remito-item small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.pedido-remito-item span {
    white-space: nowrap;
    font-weight: 900;
    color: #1d4ed8;
}

.pedido-remito-total {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    padding-top: 10px;
}

.pedido-remito-total span {
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    font-size: .78rem;
}

.pedido-remito-total strong {
    font-size: 1.35rem;
    color: #15803d;
}

@media (max-width: 1250px) {
    .pedido-vendedor-layout {
        grid-template-columns: 1fr;
    }
    .pedido-vendedor-panel,
    .pedido-remito-vivo-panel {
        position: static;
    }
    .pedido-productos-wrap,
    .pedido-remito-lista {
        max-height: none;
    }
}


/* v1.17.97 - ajustes pedido libre: guardar bajo remito y filtro dinámico */
.pedido-remito-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.pedido-remito-actions .btn-primary,
.pedido-remito-actions .btn {
    width: 100%;
    text-align: center;
}

.pedido-productos-filtro-estado {
    flex-basis: 100%;
    color: #475569;
    font-weight: 850;
    text-align: right;
}

.pedido-productos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
    min-height: 0;
}

.pedido-preview-chip {
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    padding: 5px 9px;
    font-size: .82rem;
    font-weight: 850;
    cursor: pointer;
}

.pedido-preview-chip:hover {
    background: #dbeafe;
}


/* v1.17.98 - remito de pedido sin firma/aclaración */
.remito-pedido .firmas {
    display: none !important;
}


/* v1.17.99 - remito pedido: total general alineado */
.remito-pedido .total-general-pedido td {
    vertical-align: middle;
}

.remito-pedido .total-general-pedido td:nth-child(1) {
    text-align: right;
}

.remito-pedido .total-general-pedido td:nth-child(2) {
    text-align: center;
}

.remito-pedido .total-general-pedido td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
}


/* v1.18.00 - remito pedido: total e importe centrados */
.remito-pedido .total-general-pedido td:nth-child(1),
.remito-pedido .total-general-pedido td:nth-child(4) {
    text-align: center !important;
}


/* v1.18.01 - remito pedido: total e importe hacia la izquierda */
.remito-pedido .total-general-pedido td:nth-child(1),
.remito-pedido .total-general-pedido td:nth-child(4) {
    text-align: left !important;
}


/* v1.18.02 - pedido proveedor como stock propio */
.inline-form {
    display: inline;
}

.inline-form button {
    display: inline-block;
}

.stock-propio-btn {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
    font-weight: 900;
}

.pedido-stock-alert {
    margin-top: 8px;
}


/* v1.18.03 - pantalla de gestión de pedidos */
.pedido-gestion-filtros {
    margin-bottom: 12px;
}

.pedido-gestion-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(130px, .7fr)) minmax(220px, 1.2fr) minmax(160px, .9fr) minmax(190px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.pedido-gestion-form label span {
    display: block;
    margin-bottom: 4px;
    font-size: .78rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pedido-gestion-form input,
.pedido-gestion-form select {
    width: 100%;
}

.pedido-gestion-actions {
    display: flex;
    gap: 6px;
}

.pedido-stats.gestion {
    margin: 12px 0;
}

.pedido-gestion-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.pedido-gestion-table-wrap {
    overflow-x: auto;
}

.pedido-gestion-table {
    min-width: 1150px;
}

.pedido-gestion-table td {
    vertical-align: top;
}

.pedido-gestion-table td small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.pedido-gestion-table .badge {
    display: inline-block;
    margin: 2px 2px 0 0;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 14px 0;
}

@media (max-width: 1250px) {
    .pedido-gestion-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pedido-gestion-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .pedido-gestion-form {
        grid-template-columns: 1fr;
    }
}



/* v1.18.05 - tabla pedidos más limpia */
.pedido-gestion-table td:nth-child(2) small {
    display: none;
}

.pedido-vendedores-cell small {
    display: none !important;
}

.pedido-vendedores-cell .pedido-vendedores-list {
    font-size: .95rem;
}



/* v1.18.07 - flujo teclado pedido libre */
#pedidoVendedorSelect.vendedor-fijado {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
    font-weight: 900;
}

.pedido-productos-tools .btn.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* v1.18.08 - seleccionar pedidos e imprimir remitos */
.pedido-seleccion-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 9px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.pedido-check-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 900;
    color: #1e3a8a;
}

.pedido-seleccion-toolbar span {
    font-weight: 850;
    color: #475569;
}

.pedido-gestion-table .col-select {
    width: 48px !important;
    min-width: 48px !important;
    text-align: center !important;
    white-space: nowrap;
}

.pedido-gestion-table .pedido-select-check {
    transform: scale(1.15);
}






/* v1.18.14 - tabla pedidos sin anchos forzados */
.pedido-gestion-table th {
    text-align: center;
    vertical-align: middle;
}

.pedido-gestion-table td.pedido-actions {
    vertical-align: middle;
    text-align: center;
}

.pedido-gestion-table td.pedido-actions .btn-small {
    margin: 2px;
}

.pedido-fecha-correccion {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.pedido-fecha-correccion label span {
    display: block;
    margin-bottom: 4px;
    font-size: .78rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pedido-fecha-correccion input[type="date"] {
    min-width: 150px;
}


/* v1.18.15 - pedidos inicia sin cargar tabla pesada */
.pedido-inicio-vacio {
    margin-top: 12px;
    text-align: center;
    border: 1px dashed #bfdbfe;
    background: #f8fafc;
}

.pedido-inicio-vacio h2 {
    margin-top: 0;
}

.pedido-inicio-vacio p {
    color: #64748b;
    font-weight: 700;
}


/* v1.18.16 - vendedores listado liviano */
.vendedor-inicio-vacio {
    margin-top: 14px;
    text-align: center;
    border: 1px dashed #bfdbfe;
    background: #f8fafc;
}

.vendedor-inicio-vacio h2 {
    margin-top: 0;
}

.vendedor-inicio-vacio p {
    color: #64748b;
    font-weight: 750;
}

a.link-button {
    display: inline;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}


/* v1.18.17 - totales generales y de página en vendedores */
.vendor-query-totals-general {
    margin-bottom: 8px;
}

.vendor-query-totals-page {
    opacity: .92;
}

.vendor-query-totals-page .summary-card {
    background: #f8fafc;
}


/* v1.18.18 - totales vendedores contenidos dentro del recuadro */
.vendor-query-totals {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.vendor-query-totals-general,
.vendor-query-totals-page {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
}

.vendor-query-totals .summary-card {
    min-width: 0;
    overflow: hidden;
}

.vendor-query-totals .summary-card strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.12;
    font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.vendor-query-totals .summary-card span,
.vendor-query-totals .summary-card small {
    overflow-wrap: anywhere;
}


/* v1.18.21 - login moderno, registro y sesión visible */
.auth-body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, .35), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(14, 165, 233, .28), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 48%, #0f766e 100%);
    color: #0f172a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-shell {
    width: min(1040px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 18px;
    align-items: stretch;
}

.auth-shell-narrow {
    grid-template-columns: minmax(280px, 520px);
    justify-content: center;
}

.auth-panel {
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(2, 6, 23, .38);
}

.auth-panel-brand {
    position: relative;
    overflow: hidden;
    padding: 38px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.06)),
        rgba(15, 23, 42, .26);
    color: #fff;
    backdrop-filter: blur(16px);
}

.auth-panel-brand:after {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(34, 211, 238, .22);
}

.auth-brand-pill {
    width: 68px;
    height: 68px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #38bdf8, #22c55e);
    color: #082f49;
    font-size: 1.6rem;
    font-weight: 950;
    box-shadow: 0 14px 34px rgba(34, 211, 238, .28);
}

.auth-panel-brand h1 {
    margin: 0 0 12px 0;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: .95;
    letter-spacing: -.06em;
}

.auth-panel-brand p {
    max-width: 520px;
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
    font-weight: 650;
}

.auth-feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.auth-feature-grid span,
.auth-note {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.9);
    font-weight: 850;
}

.auth-note {
    width: fit-content;
    margin-top: 26px;
    border-radius: 16px;
}

.auth-card {
    padding: 34px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(18px);
}

.auth-eyebrow {
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #2563eb;
    font-size: .78rem;
    font-weight: 950;
}

.auth-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 2rem;
    letter-spacing: -.04em;
}

.auth-muted {
    margin: 8px 0 20px 0;
    color: #64748b;
    font-weight: 700;
}

.auth-card form {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.auth-card label {
    color: #334155;
    font-size: .82rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-card input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    padding: 13px 14px;
    font-size: 1rem;
    color: #0f172a;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.auth-card input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

.auth-primary {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    margin-top: 8px;
    background: linear-gradient(135deg, #2563eb, #0891b2);
    color: #fff;
    font-size: 1rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .25);
}

.auth-primary:hover {
    filter: brightness(.98);
    transform: translateY(-1px);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.auth-links a {
    color: #1d4ed8;
    font-weight: 900;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-alert {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 850;
}

.auth-help {
    color: #64748b;
    font-weight: 700;
    margin-top: -4px;
}

.auth-error {
    color: #b91c1c;
    font-weight: 850;
}

.user-session-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    white-space: nowrap;
}

.user-session-pill span {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 950;
    color: #64748b;
}

.user-session-pill strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 950;
}

.user-session-pill em {
    font-style: normal;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: .72rem;
    font-weight: 950;
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px 0;
    }

    .auth-panel-brand {
        min-height: auto;
        padding: 28px;
    }

    .auth-card {
        padding: 26px;
    }
}


/* v1.18.22 - usuario alineado a la derecha del navbar */
.app-navbar {
    display: flex;
    align-items: center;
}

.app-navbar .nav-groups {
    flex: 1 1 auto;
}

.user-session-pill {
    margin-left: auto;
}

.logout-form {
    margin-left: 8px;
}


/* v1.18.23 - débito vendedores desde archivo de venta */
.venta-debito-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}

.venta-debito-panel strong {
    display: block;
    color: #0f172a;
}

.venta-debito-panel small {
    display: block;
    color: #475569;
    font-weight: 750;
}

.menu-action-form {
    margin: 0;
    padding: 0;
}

.menu-action-form .menu-action {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.debit-action {
    background: #ecfdf5 !important;
    color: #166534 !important;
}

/* v1.18.27 - filtros pedidos contenidos y tablas separadas */
.pedido-gestion-filtros {
    overflow: hidden;
}

.pedido-gestion-form {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(120px, .65fr)) minmax(190px, 1fr) minmax(150px, .8fr) minmax(170px, .9fr);
}

.pedido-gestion-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.pedido-gestion-actions .btn,
.pedido-gestion-actions .btn-primary {
    white-space: nowrap;
}

.pedido-tipo-section {
    margin: 14px 0 18px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.pedido-tipo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: #f8fafc;
}

.pedido-tipo-header span {
    display: block;
    font-size: .72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
}

.pedido-tipo-header h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
}

.pedido-tipo-header p {
    margin: 2px 0 0;
    color: #64748b;
    font-weight: 700;
}

.pedido-tipo-header > strong {
    min-width: 44px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 1.05rem;
}

.pedido-tipo-ventas {
    border-color: #bbf7d0;
}

.pedido-tipo-ventas .pedido-tipo-header {
    background: #f0fdf4;
}

.pedido-tipo-compras {
    border-color: #bfdbfe;
}

.pedido-tipo-compras .pedido-tipo-header {
    background: #eff6ff;
}

.badge.venta {
    background: #dcfce7;
    color: #166534;
}

.badge.compra {
    background: #dbeafe;
    color: #1e3a8a;
}

@media (max-width: 760px) {
    .pedido-gestion-actions {
        justify-content: stretch;
    }

    .pedido-gestion-actions .btn,
    .pedido-gestion-actions .btn-primary {
        flex: 1 1 100%;
        text-align: center;
    }

    .pedido-tipo-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v1.18.28 - corrección fuerte botones filtros pedidos dentro del recuadro */
.pedido-gestion-filtros {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.pedido-gestion-form {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pedido-gestion-fields {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(120px, .65fr)) minmax(190px, 1fr) minmax(150px, .8fr) minmax(170px, .9fr);
    gap: 10px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pedido-gestion-fields label {
    min-width: 0;
}

.pedido-gestion-fields input,
.pedido-gestion-fields select {
    max-width: 100%;
    box-sizing: border-box;
}

.pedido-gestion-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.pedido-gestion-actions .btn,
.pedido-gestion-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}

@media (max-width: 1250px) {
    .pedido-gestion-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pedido-gestion-fields {
        grid-template-columns: 1fr;
    }

    .pedido-gestion-actions {
        justify-content: stretch;
    }

    .pedido-gestion-actions .btn,
    .pedido-gestion-actions .btn-primary {
        flex: 1 1 100%;
        width: 100%;
    }
}


/* v1.18.29 - filtros pedidos rediseñados sin desborde */
.pedido-gestion-filtros {
    padding: 16px;
    overflow: visible;
}

.pedido-gestion-form-clean {
    display: block;
    width: 100%;
}

.pedido-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(130px, .75fr) minmax(130px, .75fr);
    gap: 12px;
    align-items: end;
}

.pedido-filter-grid label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.pedido-filter-grid label span {
    font-size: .78rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pedido-filter-grid input,
.pedido-filter-grid select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pedido-filter-search {
    grid-column: span 1;
}

.pedido-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.pedido-filter-bar small {
    color: #64748b;
    font-weight: 750;
}

.pedido-filter-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.pedido-filter-buttons .btn,
.pedido-filter-buttons .btn-primary {
    white-space: nowrap;
}

@media (min-width: 1100px) {
    .pedido-filter-grid {
        grid-template-columns: minmax(300px, 2fr) repeat(5, minmax(130px, 1fr));
    }
}

@media (max-width: 900px) {
    .pedido-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pedido-filter-search {
        grid-column: 1 / -1;
    }

    .pedido-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .pedido-filter-buttons {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    .pedido-filter-grid {
        grid-template-columns: 1fr;
    }

    .pedido-filter-buttons .btn,
    .pedido-filter-buttons .btn-primary {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }
}

/* v1.18.30 - exportar/imprimir títulos anunciados */
.productos-control-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.productos-control-header h2 {
    margin-bottom: 4px;
}

.productos-control-header p {
    margin-top: 0;
}

.productos-control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.productos-control-table {
    margin-top: 4px;
}

/* v1.18.32 - contador vendedores filtrados y aviso múltiplo display */
.colocacion-vendedores-contador {
    display: grid;
    gap: 2px;
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.colocacion-vendedores-contador span {
    font-size: .72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #475569;
}

.colocacion-vendedores-contador strong {
    font-size: 1.35rem;
    color: #1e3a8a;
}

.colocacion-vendedores-contador small {
    color: #64748b;
    font-weight: 750;
}

.display-multiplo-error-cell {
    background: #fff7ed !important;
    box-shadow: inset 0 0 0 2px #fb923c;
}

.display-multiplo-error-input {
    border-color: #f97316 !important;
    background: #fffbeb !important;
    color: #9a3412 !important;
    font-weight: 900;
}

.display-multiplo-aviso {
    display: none;
    max-width: 96px;
    margin: 3px auto 0;
    color: #9a3412;
    font-size: .68rem;
    font-weight: 850;
    line-height: 1.1;
}

.display-multiplo-error-cell .display-multiplo-aviso {
    display: block;
}

.display-multiplo-resumen {
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #fdba74;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
}

.display-multiplo-resumen strong {
    margin-right: 6px;
}

.display-multiplo-resumen small {
    display: block;
    margin-top: 3px;
    color: #c2410c;
    font-weight: 750;
}

/* v1.18.33 - mejor visibilidad títulos en matriz de colocación */
body:has(#tabla-colocacion) .container {
    width: min(99vw, 1880px);
    max-width: 99vw;
    padding-left: 8px;
    padding-right: 4px;
}

body:has(#tabla-colocacion) main.container {
    margin-left: 6px;
    margin-right: 2px;
}

.colocacion-fixed-reference {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
}

.colocacion-table-wrap {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
    margin-right: 0;
}

.colocacion-table-wrap .matriz-colocacion th.draggable-product,
.colocacion-fixed-reference .col-fixed-product {
    min-width: 128px !important;
    max-width: 190px;
}

.colocacion-fixed-reference .col-fixed-product {
    min-height: 72px;
    padding: 8px 6px;
    align-items: flex-start;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.15;
}

.producto-titulo-colocacion {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.7em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    font-weight: 950;
}

.colocacion-fixed-reference .producto-titulo-colocacion {
    -webkit-line-clamp: 4;
    max-height: 4.7em;
}

.colocacion-fixed-reference .col-fixed-left {
    min-width: 205px !important;
}

.colocacion-fixed-reference .col-fixed-total {
    min-width: 96px !important;
}

.colocacion-table-wrap .matriz-colocacion th:first-child,
.colocacion-table-wrap .matriz-colocacion td:first-child {
    min-width: 205px;
}

.matriz-colocacion input.qty {
    max-width: 62px;
    width: 58px;
    padding-left: 4px;
    padding-right: 4px;
}

.titulo-producto-tooltip {
    position: fixed;
    z-index: 5000;
    display: none;
    max-width: min(520px, 80vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .34);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
    pointer-events: none;
}

.titulo-producto-tooltip.visible {
    display: block;
}

@media (max-width: 900px) {
    body:has(#tabla-colocacion) .container {
        max-width: 100vw;
        padding-left: 4px;
        padding-right: 4px;
    }

    .colocacion-fixed-reference,
    .colocacion-table-wrap {
        width: calc(100vw - 8px);
        max-width: calc(100vw - 8px);
    }
}

/* v1.18.34 - corregir márgenes colocación sin superponer filtros */
body:has(#tabla-colocacion) .container {
    width: min(96vw, 1560px) !important;
    max-width: min(96vw, 1560px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 18px !important;
    padding-right: 12px !important;
}

/* Deja lugar para el panel fijo izquierdo, así no pisa la tabla. */
@media (min-width: 1201px) {
    body:has(#tabla-colocacion) .container {
        padding-left: 190px !important;
    }
}

/* El buscador queda al margen izquierdo, pero no encima del contenido. */
.colocacion-buscar-vendedor.flotante-margen {
    left: 12px !important;
    top: 185px !important;
    width: 160px !important;
}

/* La tabla gana algo de espacio a la derecha, pero conserva margen visual. */
.colocacion-fixed-reference,
.colocacion-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
}

/* Títulos más legibles sin agrandar excesivamente las columnas. */
.colocacion-table-wrap .matriz-colocacion th.draggable-product,
.colocacion-fixed-reference .col-fixed-product {
    min-width: 116px !important;
    max-width: 158px !important;
}

.colocacion-fixed-reference .col-fixed-product {
    min-height: 64px !important;
    padding: 7px 5px !important;
    align-items: flex-start !important;
    font-size: 11.5px !important;
    line-height: 1.12 !important;
}

.producto-titulo-colocacion {
    -webkit-line-clamp: 3 !important;
    max-height: 3.6em !important;
    overflow-wrap: anywhere;
}

.colocacion-fixed-reference .producto-titulo-colocacion {
    -webkit-line-clamp: 3 !important;
    max-height: 3.6em !important;
}

.colocacion-fixed-reference .col-fixed-left {
    min-width: 190px !important;
}

.colocacion-fixed-reference .col-fixed-total {
    min-width: 88px !important;
}

.colocacion-table-wrap .matriz-colocacion th:first-child,
.colocacion-table-wrap .matriz-colocacion td:first-child {
    min-width: 190px !important;
}

.matriz-colocacion input.qty {
    max-width: 60px !important;
    width: 56px !important;
}

@media (max-width: 1200px) {
    body:has(#tabla-colocacion) .container {
        width: min(98vw, 1220px) !important;
        max-width: min(98vw, 1220px) !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .colocacion-buscar-vendedor.flotante-margen {
        position: static !important;
        width: auto !important;
        margin: 0 0 10px 0 !important;
    }
}

@media (max-width: 900px) {
    body:has(#tabla-colocacion) .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* v1.18.35 - totales colocación calculados, sombreados y sin foco */
.matriz-colocacion .th-total-vendedor,
.colocacion-fixed-reference .col-ref-total-calculado {
    background: linear-gradient(180deg, #e0f2fe, #bae6fd) !important;
    color: #0c4a6e !important;
    font-weight: 950 !important;
    text-align: center !important;
}

.matriz-colocacion .th-total-vendedor small,
.colocacion-fixed-reference .col-ref-total-calculado small {
    display: block;
    margin-top: 2px;
    font-size: .68rem;
    color: #0369a1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.matriz-colocacion .celda-total-calculado,
.matriz-colocacion .celda-subtotal-calculado {
    background: #f1f5f9 !important;
    color: #0f172a;
    font-weight: 950;
    cursor: default;
    user-select: none;
}

.matriz-colocacion .celda-total-vendedor {
    background: #e0f2fe !important;
    box-shadow: inset 4px 0 0 #0284c7;
}

.matriz-colocacion .celda-total-vendedor .total-vendedor,
.matriz-colocacion .celda-total-linea .total-linea,
.matriz-colocacion .subtotal-linea {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.7rem;
    min-height: 1.7rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.matriz-colocacion .celda-total-vendedor .total-vendedor {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0c4a6e;
    font-size: 1rem;
}

.matriz-colocacion .subtotal .celda-subtotal-calculado {
    background: #f8fafc !important;
}

.matriz-colocacion .celda-total-calculado:focus,
.matriz-colocacion .celda-subtotal-calculado:focus,
.matriz-colocacion .th-total-vendedor:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Evita que un click accidental parezca una celda editable. */
.matriz-colocacion .celda-total-calculado *,
.matriz-colocacion .celda-subtotal-calculado * {
    pointer-events: none;
}

/* v1.18.36 - total vendedor simple, dinámico y solo lectura */
.matriz-colocacion .th-total-vendedor,
.colocacion-fixed-reference .col-ref-total-calculado {
    background: linear-gradient(180deg, #dbeafe, #bfdbfe) !important;
    color: #1e3a8a !important;
    font-weight: 950 !important;
    text-align: center !important;
}

.matriz-colocacion .celda-total-vendedor {
    background: #e0f2fe !important;
    color: #0c4a6e !important;
    font-weight: 950 !important;
    cursor: default !important;
    user-select: none !important;
    box-shadow: inset 4px 0 0 #0284c7;
}

.matriz-colocacion .celda-total-vendedor .total-vendedor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.8rem;
    min-height: 1.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #7dd3fc;
    color: #0c4a6e;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.matriz-colocacion .celda-total-vendedor:focus,
.matriz-colocacion .celda-total-vendedor:focus-within {
    outline: none !important;
    box-shadow: inset 4px 0 0 #0284c7 !important;
}

/* Neutraliza estilos demasiado amplios de v1.18.35 en subtotales. */
.matriz-colocacion .subtotal td:not(.celda-total-vendedor) {
    cursor: default;
}

.matriz-colocacion .celda-subtotal-calculado {
    background: inherit !important;
    box-shadow: none !important;
    user-select: auto !important;
}

/* v1.18.37 - navegación estable en matriz de colocación */
#tabla-colocacion input.qty {
    scroll-margin: 80px 90px;
}

#tabla-colocacion input.qty:focus {
    position: relative;
    z-index: 5;
}

/* v1.18.38 - bloqueo de repetición de teclas en colocación */
#tabla-colocacion input.qty:focus {
    caret-color: transparent;
}

/* v1.18.39 - scroll acompaña foco horizontal en colocación */
#tabla-colocacion input.qty:focus {
    outline-offset: 1px;
}

/* v1.18.40 - scroll vertical de pantalla acompaña foco */
#tabla-colocacion input.qty {
    scroll-margin-top: 150px;
    scroll-margin-bottom: 90px;
}

/* v1.18.41 - mejora matriz colocación: vendedor fijo, totales al pie y foco visual */
.colocacion-table-wrap .matriz-colocacion th:first-child,
.colocacion-table-wrap .matriz-colocacion td:first-child,
.colocacion-table-wrap .matriz-colocacion .col-vendedor-sticky {
    position: sticky !important;
    left: 0 !important;
    z-index: 85 !important;
    min-width: 190px !important;
    max-width: 230px !important;
    box-shadow: 3px 0 0 rgba(15, 23, 42, .10), 8px 0 18px rgba(15, 23, 42, .05) !important;
}

.colocacion-table-wrap .matriz-colocacion thead th:first-child {
    z-index: 120 !important;
}

.colocacion-table-wrap .matriz-colocacion tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 70;
    background: #e0f2fe !important;
    border-top: 2px solid #0284c7 !important;
    box-shadow: 0 -3px 10px rgba(15, 23, 42, .12);
}

.colocacion-table-wrap .matriz-colocacion tfoot td:first-child {
    z-index: 130 !important;
    background: #bfdbfe !important;
    color: #1e3a8a;
    font-weight: 950;
}

.matriz-colocacion .total-asignado-footer .total-general-producto,
.matriz-colocacion .total-asignado-footer .total-general-unidades {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.7rem;
    min-height: 1.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #7dd3fc;
    color: #0c4a6e;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) td {
    opacity: .42;
    filter: grayscale(.45);
    transition: opacity .10s ease, filter .10s ease;
}

.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor.fila-vendedor-activa td {
    opacity: 1;
    filter: none;
}

.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) input.qty {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.matriz-colocacion input.qty[value="0"] {
    color: transparent;
}


/* v1.18.42 - corrección: columna completa de vendedor fija y visible */
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor > td.col-vendedor-sticky,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor > td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 160 !important;
    min-width: 220px !important;
    max-width: 260px !important;
    width: 220px !important;
    background-clip: padding-box !important;
    opacity: 1 !important;
    filter: none !important;
    box-shadow: 4px 0 0 rgba(15, 23, 42, .16), 10px 0 20px rgba(15, 23, 42, .08) !important;
    white-space: normal !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-verde > td.col-vendedor-sticky,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-verde > td:first-child {
    background: #dcfce7 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-amarillo > td.col-vendedor-sticky,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-amarillo > td:first-child {
    background: #fef3c7 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-rojo > td.col-vendedor-sticky,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-rojo > td:first-child {
    background: #fee2e2 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-vendedor-activa > td.col-vendedor-sticky,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-vendedor-activa > td:first-child {
    z-index: 190 !important;
    outline: 2px solid #2563eb !important;
    outline-offset: -2px !important;
    box-shadow: 5px 0 0 #2563eb, 12px 0 24px rgba(37, 99, 235, .22) !important;
}

.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) > td.col-vendedor-sticky,
.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) > td:first-child {
    opacity: .88 !important;
    filter: none !important;
}

.colocacion-table-wrap .matriz-colocacion thead th:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 220 !important;
    min-width: 220px !important;
    width: 220px !important;
}

.colocacion-table-wrap .matriz-colocacion tfoot td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 210 !important;
    min-width: 220px !important;
    width: 220px !important;
}

/* Evita que filas de grupo/subtotal con colspan interfieran con la columna fija de vendedores. */
.colocacion-table-wrap .matriz-colocacion tbody tr.group-row > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.subtotal:not(.general) > td:first-child {
    z-index: 120 !important;
}


/* v1.18.47 - referencia flotante de vendedor activo */
.vendedor-activo-flotante {
    position: sticky;
    top: 58px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 8px;
    padding: 10px 14px;
    border: 2px solid #2563eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #eff6ff, #dbeafe);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
    color: #0f172a;
}

.vendedor-activo-flotante .vendedor-activo-label {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.vendedor-activo-flotante strong {
    font-size: 17px;
    font-weight: 950;
    color: #1e3a8a;
}

.vendedor-activo-flotante .vendedor-activo-extra {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

#tabla-colocacion tr.fila-vendedor.fila-vendedor-activa td {
    outline: 2px solid rgba(37, 99, 235, .20);
    outline-offset: -2px;
}

#tabla-colocacion tr.fila-vendedor.fila-vendedor-activa input.qty:focus {
    outline: 3px solid #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16) !important;
}

@media (max-width: 900px) {
    .vendedor-activo-flotante {
        top: 48px;
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .vendedor-activo-flotante strong {
        font-size: 15px;
    }
}


/* v1.18.48 - vendedor flotante solo nombre */
.vendedor-activo-flotante {
    padding: 7px 11px !important;
    gap: 8px !important;
}

.vendedor-activo-flotante strong {
    font-size: 16px !important;
}

.vendedor-activo-flotante .vendedor-activo-extra {
    display: none !important;
}


/* v1.18.49 - recuperar primera fila fija y reforzar primera columna */
.colocacion-table-wrap {
    position: relative !important;
    overflow: auto !important;
}

.colocacion-table-wrap .matriz-colocacion {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: max-content !important;
    min-width: 100% !important;
}

/* Primera fila fija: encabezados de productos siempre visibles al bajar. */
.colocacion-table-wrap .matriz-colocacion thead,
.colocacion-table-wrap .matriz-colocacion thead tr {
    position: sticky !important;
    top: 0 !important;
    z-index: 600 !important;
}

.colocacion-table-wrap .matriz-colocacion thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 610 !important;
    background: linear-gradient(180deg,#eff6ff,#dbeafe) !important;
    box-shadow: 0 2px 0 rgba(15,23,42,.15), 0 4px 10px rgba(15,23,42,.08) !important;
}

/* Primera columna fija: vendedores visibles al desplazarse horizontalmente. */
.colocacion-table-wrap .matriz-colocacion th:first-child,
.colocacion-table-wrap .matriz-colocacion td:first-child,
.colocacion-table-wrap .matriz-colocacion .sticky-vendedor-col,
.colocacion-table-wrap .matriz-colocacion .col-vendedor-sticky {
    position: sticky !important;
    left: 0 !important;
    z-index: 620 !important;
    min-width: 230px !important;
    width: 230px !important;
    max-width: 270px !important;
    box-sizing: border-box !important;
    background-clip: padding-box !important;
    box-shadow: 5px 0 0 rgba(15,23,42,.16), 12px 0 24px rgba(15,23,42,.10) !important;
}

/* Esquina superior izquierda: fija vertical y horizontal. */
.colocacion-table-wrap .matriz-colocacion thead th:first-child,
.colocacion-table-wrap .matriz-colocacion thead th.sticky-corner-col,
.colocacion-table-wrap .matriz-colocacion thead th.sticky-vendedor-col {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 900 !important;
    background: linear-gradient(180deg,#dbeafe,#bfdbfe) !important;
    color: #1e3a8a !important;
}

/* Fondos sólidos para que los nombres no se transparenten debajo de productos. */
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-verde > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-verde > td.sticky-vendedor-col {
    background: #dcfce7 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-amarillo > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-amarillo > td.sticky-vendedor-col {
    background: #fef3c7 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-rojo > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-scoring-rojo > td.sticky-vendedor-col {
    background: #fee2e2 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor > td.sticky-vendedor-col {
    z-index: 650 !important;
    opacity: 1 !important;
    filter: none !important;
    color: #0f172a !important;
    white-space: normal !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
}

.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-vendedor-activa > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.fila-vendedor.fila-vendedor-activa > td.sticky-vendedor-col {
    z-index: 780 !important;
    background: #dbeafe !important;
    outline: 3px solid #2563eb !important;
    outline-offset: -3px !important;
}

/* Subtotales y grupos también quedan con primera columna visible. */
.colocacion-table-wrap .matriz-colocacion tbody tr.group-row > td:first-child,
.colocacion-table-wrap .matriz-colocacion tbody tr.subtotal > td:first-child {
    z-index: 640 !important;
    background: #f1f5f9 !important;
    font-weight: 900 !important;
}

/* Pie total asignado fijo abajo y esquina izquierda visible. */
.colocacion-table-wrap .matriz-colocacion tfoot td {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 700 !important;
    background: #e0f2fe !important;
}

.colocacion-table-wrap .matriz-colocacion tfoot td:first-child,
.colocacion-table-wrap .matriz-colocacion tfoot td.sticky-vendedor-col {
    left: 0 !important;
    z-index: 850 !important;
    background: #bfdbfe !important;
    color: #1e3a8a !important;
    font-weight: 950 !important;
}

/* El foco visual no debe apagar el nombre del vendedor. */
.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) > td:first-child,
.matriz-colocacion.matriz-con-foco-vendedor tbody tr.fila-vendedor:not(.fila-vendedor-activa) > td.sticky-vendedor-col {
    opacity: 1 !important;
    filter: none !important;
}


/* v1.18.51 - Estado cuenta proveedor: columnas monetarias más anchas */
.estado-proveedor-table th.col-monto-ancho,
.estado-proveedor-table td.col-monto-ancho {
    min-width: 125px;
    width: 125px;
    white-space: nowrap;
    text-align: right;
}

.estado-proveedor-table td.nowrap,
.estado-proveedor-table th.nowrap {
    white-space: nowrap;
}

.estado-proveedor-table th:nth-child(7),
.estado-proveedor-table td:nth-child(7),
.estado-proveedor-table th:nth-child(9),
.estado-proveedor-table td:nth-child(9),
.estado-proveedor-table th:nth-child(10),
.estado-proveedor-table td:nth-child(10) {
    min-width: 125px;
    white-space: nowrap;
    text-align: right;
}


/* v1.18.52 - Estado cuenta proveedor: incluir A pagar proveedor como columna monetaria ancha */
.estado-proveedor-table th:nth-child(8),
.estado-proveedor-table td:nth-child(8) {
    min-width: 145px;
    width: 145px;
    white-space: nowrap;
    text-align: right;
}

.estado-proveedor-table th.col-monto-ancho,
.estado-proveedor-table td.col-monto-ancho {
    min-width: 135px;
    white-space: nowrap;
    text-align: right;
}


/* v1.18.55 - Estética remitos de pedidos */
.remito-pedido .remito-pedido-vendedor-nombre {
    text-align: center;
    font-weight: 950;
    font-size: 18px;
    line-height: 1.2;
    margin: 4px 0 8px;
    color: #111827;
    text-transform: uppercase;
}

.remito-pedido .remito-pedido-fecha {
    text-align: center;
    margin: 0 0 8px;
    font-size: 12px;
}

.remito-pedido h2 {
    text-align: center;
    margin-bottom: 4px;
}


/* v1.18.56 - Corrección de precios de salida */
.price-correction-help ul {
    margin: 8px 0 0 18px;
}

.price-correction-table input[type="number"] {
    width: 130px;
    max-width: 100%;
    text-align: right;
}

.price-correction-table th,
.price-correction-table td {
    white-space: nowrap;
}

.price-correction-table td:first-child,
.price-correction-table th:first-child {
    min-width: 260px;
    white-space: normal;
}

.price-correction-form textarea {
    width: 100%;
    margin-top: 8px;
}


/* v1.18.57 - RI editable en corrección de precios */
.price-correction-table input[name^="ri_"] {
    width: 110px;
}


/* v1.18.60 - Barra de progreso en corrección de precios */
.price-correction-progress {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.price-correction-progress[hidden] {
    display: none;
}

.price-correction-progress .progress-card {
    width: min(520px, 94vw);
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.35);
    text-align: center;
}

.price-correction-progress .progress-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 6px;
    color: #0f172a;
}

.price-correction-progress .progress-card small {
    display: block;
    color: #475569;
    margin-bottom: 18px;
}

.price-correction-progress .progress-bar-shell {
    width: 100%;
    height: 16px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.price-correction-progress .progress-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    transition: width 0.3s ease;
}

.price-correction-progress .progress-percent {
    margin-top: 10px;
    font-weight: 800;
    color: #0f172a;
}


/* v1.18.61 - Links de remitos en detalle de vendedor */
.remitos-vendedor-links {
    min-width: 150px;
    white-space: nowrap;
}

.remitos-vendedor-links .btn-mini {
    display: inline-block;
    padding: 4px 7px;
    margin: 2px 2px 2px 0;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.remitos-vendedor-links .btn-mini:hover {
    background: #e0f2fe;
    border-color: #38bdf8;
}


/* v1.18.62 - Filtros y selección de remitos por vendedor */
.remitos-vendedor-toolbar {
    display: grid;
    gap: 12px;
}

.remitos-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.remitos-search-form label {
    flex: 1 1 320px;
}

.remitos-search-form input,
.remitos-vendedor-seleccion input[type="search"] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.remitos-vendedor-seleccion {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
}

.remitos-vendedor-lista {
    margin-top: 8px;
    max-height: 180px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px;
}

.remito-vendedor-check-label {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 7px 9px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
}

@media print {
    .remito-oculto-impresion {
        display: none !important;
    }
}


/* v1.18.65 - Distribuidora activa en navbar */
.active-distribuidora-pill {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    justify-content: center;
    min-width: 150px;
    max-width: 260px;
    padding: 7px 11px;
    border-radius: 14px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #064e3b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.active-distribuidora-pill span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    color: #047857;
}

.active-distribuidora-pill strong {
    display: block;
    max-width: 235px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.15;
}

.active-distribuidora-pill em {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
    font-style: normal;
    font-size: 10px;
    font-weight: 900;
}

@media (max-width: 980px) {
    .active-distribuidora-pill {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .active-distribuidora-pill strong {
        max-width: 100%;
    }
}

/* Selector desplegable de distribuidora activa */
.active-distribuidora-selector {
    position: relative;
    cursor: pointer;
}

.active-distribuidora-selector summary {
    display: flex;
    flex-direction: column;
    gap: 1px;
    list-style: none;
    cursor: pointer;
}

.active-distribuidora-selector summary::-webkit-details-marker {
    display: none;
}

.active-distribuidora-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 230px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #bbf7d0;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
}

.active-distribuidora-selector[open] .active-distribuidora-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.active-distribuidora-menu a,
.active-distribuidora-menu span {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: #064e3b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.active-distribuidora-menu a:hover,
.active-distribuidora-menu a.active {
    background: #dcfce7;
}

@media (max-width: 980px) {
    .active-distribuidora-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}

/* v1.18.74 - Selección puntual de remitos en cada tarjeta */
.remitos-seleccion-compacta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
}

.remitos-seleccion-compacta span {
    color: #475569;
}

.remito-selector-puntual {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.remito-selector-puntual input {
    width: 16px;
    height: 16px;
}

.print-ticket.remito.remito-oculto-impresion {
    opacity: .35;
}

@media print {
    .print-ticket.remito.remito-oculto-impresion {
        opacity: 1;
    }
}

/* v1.18.75 - valorizado y acciones modernas en listado de salidas */
.salidas-table th,
.salidas-table td {
    vertical-align: middle;
}

.salidas-table .valorizado-cell {
    white-space: nowrap;
    font-weight: 900;
    letter-spacing: .01em;
}

.salidas-table .valorizado-distribuidor {
    color: #0f766e;
}

.salidas-table .valorizado-vendedor {
    color: #1d4ed8;
}

.acciones-salida {
    min-width: 250px;
    white-space: normal;
}

.acciones-salida .btn-tabla,
.salida-docs-cell .btn-small {
    margin: 3px 2px;
}

.btn-alerta {
    background: #f97316 !important;
    color: #ffffff !important;
    border-color: #ea580c !important;
}

.salida-docs-cell .btn-small {
    border: 0 !important;
    color: #ffffff !important;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 999px;
}

.salida-docs-cell .doc-remito {
    background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
}

.salida-docs-cell .doc-fc {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
}

.salida-docs-cell .doc-nc {
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
}

.salidas-actions-top .btn-primary {
    background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
}

@media (max-width: 980px) {
    .salidas-table {
        font-size: 12px;
    }
    .acciones-salida {
        min-width: 190px;
    }
    .btn-tabla {
        min-width: 58px;
        padding: 6px 8px;
        font-size: .78rem;
    }
}

/* v1.18.93 - indicador liviano para filtros de administración de vendedores */
.vendor-admin-loading {
    display: none;
    align-items: center;
    gap: .75rem;
    margin-top: .85rem;
    padding: .8rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 900;
}
.vendor-admin-loading.is-visible { display: flex; }
.vendor-admin-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 999px;
    animation: vendor-admin-spin .8s linear infinite;
}
@keyframes vendor-admin-spin { to { transform: rotate(360deg); } }

/* v1.18.119 - ordenamiento y scoring rápido */
.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    gap: .25rem;
    align-items: center;
}
.sort-link.active {
    font-weight: 800;
    text-decoration: underline;
}
.scoring-quick-table .scoring-input {
    width: 90px;
    min-width: 80px;
    text-align: center;
}
.scoring-inline-form {
    margin: 0;
}
.scoring-message {
    display: block;
    margin-top: .25rem;
    min-height: 1rem;
}
.scoring-quick-card .table-scroll {
    max-height: none;
}

/* v1.18.311 - Identidad visual Urban Soft (solo branding; sin cambios técnicos) */
.brand-mark,
.auth-brand-pill{
  letter-spacing:-.03em;
}
.brand > span:last-child{
  font-weight:900;
  letter-spacing:-.015em;
}


/* v1.18.314 - Navbar compacto Urban Soft en una sola fila de escritorio */
@media (min-width: 1100px) {
    .header.app-navbar {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        padding: 7px 10px !important;
        min-height: 50px;
    }

    .app-navbar .brand {
        flex: 0 0 auto;
        gap: 6px !important;
        padding: 3px 5px 3px 0 !important;
        margin-right: 2px !important;
        font-size: 15px !important;
        white-space: nowrap;
    }

    .app-navbar .brand-mark {
        width: 30px !important;
        height: 30px !important;
        border-radius: 10px !important;
        font-size: .72rem !important;
    }

    .app-navbar .nav-groups {
        display: flex;
        flex: 1 1 auto !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        min-width: 0;
        white-space: nowrap;
    }

    .app-navbar .nav-dropdown {
        flex: 0 0 auto;
    }

    .app-navbar .nav-dropdown summary,
    .app-navbar .nav-direct {
        min-height: 32px !important;
        padding: 5px 8px !important;
        font-size: 12px !important;
        border-radius: 999px;
    }

    .app-navbar .nav-dropdown summary {
        gap: 4px !important;
    }

    .app-navbar .nav-dropdown summary::after {
        font-size: .68rem !important;
    }

    .app-navbar .active-distribuidora-pill {
        flex: 0 1 auto;
        min-width: 0 !important;
        max-width: 175px !important;
        padding: 5px 8px !important;
        border-radius: 11px !important;
    }

    .app-navbar .active-distribuidora-selector summary {
        flex-direction: row !important;
        align-items: center !important;
        gap: 5px !important;
        min-width: 0;
        white-space: nowrap;
    }

    .app-navbar .active-distribuidora-selector summary > span {
        display: none !important;
    }

    .app-navbar .active-distribuidora-pill strong {
        max-width: 128px !important;
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .app-navbar .active-distribuidora-pill em {
        flex: 0 0 auto;
        margin-top: 0 !important;
        padding: 1px 5px !important;
        font-size: 9px !important;
    }

    .app-navbar .user-session-pill {
        flex: 0 1 auto;
        margin-left: 0 !important;
        gap: 5px !important;
        padding: 5px 8px !important;
        min-height: 32px;
        border-radius: 999px;
    }

    .app-navbar .user-session-pill > span {
        display: none !important;
    }

    .app-navbar .user-session-pill strong {
        max-width: 105px !important;
        font-size: 11px !important;
    }

    .app-navbar .user-session-pill em {
        padding: 1px 5px !important;
        font-size: 9px !important;
    }

    .app-navbar .logout-form {
        flex: 0 0 auto;
        margin-left: 0 !important;
    }

    .app-navbar .logout-form button {
        min-height: 32px;
        padding: 5px 8px !important;
        font-size: 11px !important;
        border-radius: 9px !important;
        white-space: nowrap;
    }
}

/* En anchos intermedios puede compactar antes de pasar al layout móvil. */
@media (min-width: 861px) and (max-width: 1099px) {
    .header.app-navbar {
        gap: 5px;
        padding: 8px 10px;
    }
    .app-navbar .nav-groups {
        gap: 4px;
    }
    .app-navbar .nav-dropdown summary,
    .app-navbar .nav-direct {
        padding: 6px 9px;
        font-size: 12px;
    }
}


/* v1.18.315 - Separar distribuidora y usuario en navbar compacto */
@media (min-width: 1100px) {
    .header.app-navbar {
        overflow: visible !important;
    }

    .app-navbar .nav-groups {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .app-navbar .active-distribuidora-pill {
        flex: 0 0 150px !important;
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        margin-left: 4px !important;
        overflow: hidden !important;
    }

    .app-navbar .active-distribuidora-selector summary {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .app-navbar .active-distribuidora-pill strong {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 102px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .app-navbar .active-distribuidora-pill em {
        flex: 0 0 auto;
    }

    .app-navbar .user-session-pill {
        flex: 0 0 125px !important;
        width: 125px !important;
        min-width: 125px !important;
        max-width: 125px !important;
        margin-left: 4px !important;
        overflow: hidden !important;
    }

    .app-navbar .user-session-pill strong {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 76px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .app-navbar .user-session-pill em {
        flex: 0 0 auto;
    }

    .app-navbar .logout-form {
        margin-left: 4px !important;
    }
}

/* En pantallas de escritorio algo más angostas, compactar aún más sin superponer. */
@media (min-width: 861px) and (max-width: 1099px) {
    .app-navbar .active-distribuidora-pill,
    .app-navbar .user-session-pill {
        position: relative !important;
        z-index: auto !important;
        margin-left: 4px !important;
    }

    .app-navbar .active-distribuidora-pill {
        min-width: 135px !important;
        max-width: 135px !important;
    }

    .app-navbar .active-distribuidora-pill strong {
        max-width: 90px !important;
    }

    .app-navbar .user-session-pill {
        min-width: 112px !important;
        max-width: 112px !important;
    }

    .app-navbar .user-session-pill strong {
        max-width: 66px !important;
    }
}


/* v1.18.316 - Selector distribuidora operativo + usuario completo */
@media (min-width: 1100px) {
    /* El details debe permitir que su menú salga por fuera de la pill. */
    .app-navbar .active-distribuidora-pill,
    .app-navbar .active-distribuidora-selector {
        overflow: visible !important;
        position: relative !important;
        z-index: 1300 !important;
    }

    .app-navbar .active-distribuidora-selector summary {
        overflow: hidden !important;
        width: 100%;
        min-width: 0;
        position: relative;
        z-index: 1301;
    }

    /* Sólo el texto largo se recorta; nunca el menú desplegable. */
    .app-navbar .active-distribuidora-pill strong {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .app-navbar .active-distribuidora-menu {
        display: none;
        position: absolute !important;
        top: calc(100% + 7px) !important;
        right: 0 !important;
        left: auto !important;
        min-width: 235px !important;
        width: max-content !important;
        max-width: 330px !important;
        overflow: visible !important;
        z-index: 5000 !important;
        pointer-events: auto !important;
    }

    .app-navbar .active-distribuidora-selector[open] .active-distribuidora-menu {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
    }

    .app-navbar .active-distribuidora-menu a {
        pointer-events: auto !important;
        cursor: pointer !important;
        white-space: nowrap;
    }

    /* Un poco más de ancho para distribuidora y usuario sin romper una fila. */
    .app-navbar .active-distribuidora-pill {
        flex: 0 0 158px !important;
        width: 158px !important;
        min-width: 158px !important;
        max-width: 158px !important;
    }

    .app-navbar .active-distribuidora-pill strong {
        max-width: 108px !important;
    }

    .app-navbar .user-session-pill {
        flex: 0 0 154px !important;
        width: 154px !important;
        min-width: 154px !important;
        max-width: 154px !important;
        overflow: visible !important;
    }

    .app-navbar .user-session-pill strong {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 105px !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        font-size: 11px !important;
    }
}

/* En monitores de escritorio amplios mostrar todavía más cómodos los dos bloques. */
@media (min-width: 1280px) {
    .app-navbar .active-distribuidora-pill {
        flex-basis: 170px !important;
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
    }

    .app-navbar .active-distribuidora-pill strong {
        max-width: 120px !important;
    }

    .app-navbar .user-session-pill {
        flex-basis: 166px !important;
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
    }

    .app-navbar .user-session-pill strong {
        max-width: 118px !important;
        font-size: 11.5px !important;
    }
}



/* v1.18.319 - Perfiles y modo consulta */
.readonly-banner{
    margin:0 0 14px;
    padding:9px 12px;
    border-radius:10px;
    border:1px solid #bfdbfe;
    background:#eff6ff;
    color:#1e3a8a;
    font-size:13px;
}
.profile-readonly .user-session-pill{
    background:#fef3c7;
    border-color:#fde68a;
    color:#92400e;
}
