@charset "UTF-8";

:root {
    color-scheme: light;
    --primary-700: #173E8C;
    --primary-600: #2357C6;
    --primary-100: #E8F0FF;
    --accent-600: #6D3BFF;
    --accent-100: #F0ECFF;
    --canvas: #F7F9FC;
    --surface: #FFFFFF;
    --line: #E3E9F2;
    --ink-950: #162033;
    --ink-700: #41506A;
    --ink-500: #718096;
    --success-700: #15803D;
    --success-100: #DCFCE7;
    --warning-700: #B45309;
    --warning-100: #FEF3C7;
    --danger-700: #B91C1C;
    --danger-100: #FEE2E2;
    --shadow-card: 0 4px 16px rgba(20, 34, 58, .06);
    --shadow-elevated: 0 12px 32px rgba(20, 34, 58, .10);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 22px;
    --sidebar-width: 264px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink-950);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 5px;
    font-size: clamp(24px, 4vw, 28px);
    line-height: 1.18;
}

h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

:focus-visible {
    outline: 3px solid rgba(35, 87, 198, .34);
    outline-offset: 3px;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: min(84vw, var(--sidebar-width));
    padding: 20px 14px 16px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 180ms ease-out;
}

.sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-elevated);
}

.sidebar-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: none;
    width: 100%;
    border: 0;
    background: rgba(22, 32, 51, .38);
}

.sidebar-backdrop.is-visible {
    display: block;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 6px 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: var(--primary-700);
    font-size: 18px;
    font-weight: 750;
}

.brand__mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    box-shadow: 0 6px 14px rgba(76, 74, 220, .24);
}

.brand__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand__name strong {
    color: var(--ink-950);
}

.icon-button {
    position: relative;
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-700);
    font-weight: 700;
}

.icon-button:hover {
    background: var(--canvas);
    border-color: var(--line);
}

.sidebar__close {
    font-size: 24px;
}

.sidebar__nav {
    display: grid;
    flex: 1;
    min-height: 0;
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar__label {
    margin: 16px 0 5px;
    padding: 7px 10px;
    border-left: 3px solid #21499A;
    border-radius: 6px;
    background: #F3F7FF;
    color: #21499A;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.2;
    text-transform: uppercase;
}

.sidebar__label:first-child {
    margin-top: 4px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    gap: 12px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-700);
    font-weight: 600;
    transition: background-color 160ms ease-out, color 160ms ease-out;
}

.nav-link:hover {
    background: var(--canvas);
    color: var(--primary-600);
}

.nav-link.is-active {
    background: var(--primary-100);
    color: var(--primary-600);
}

.nav-link.is-active::before {
    position: absolute;
    left: -14px;
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--primary-600);
    content: "";
}

.nav-link--disabled {
    cursor: default;
}

.nav-link--disabled:hover {
    background: transparent;
    color: var(--ink-700);
}

.nav-link__icon {
    display: inline-grid;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    place-items: center;
    color: currentColor;
    font-size: 18px;
    line-height: 1;
}

.sidebar__profile {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 14px 6px 0;
    border-top: 1px solid var(--line);
}

.sidebar__profile-data {
    display: grid;
    flex: 1;
    min-width: 0;
}

.sidebar__profile-data strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar__profile-data small {
    color: var(--ink-500);
    font-size: 11px;
}

.sidebar-logout-form {
    flex: 0 0 auto;
}

.sidebar-logout {
    color: var(--danger-700);
}

.sidebar-logout:hover {
    background: var(--danger-100);
    border-color: rgba(185, 28, 28, .18);
}

.avatar {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-100);
    color: var(--accent-600);
    font-size: 11px;
    font-weight: 800;
}

.avatar--small {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.app-main {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.topbar__start,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}

.menu-icon {
    position: relative;
}

.menu-icon::before {
    position: absolute;
    top: -6px;
}

.menu-icon::after {
    position: absolute;
    top: 6px;
}

.breadcrumb {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--ink-500);
    font-size: 13px;
}

.breadcrumb strong {
    color: var(--ink-700);
}

.branch-selector,
.user-menu {
    display: none;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-weight: 600;
}

.user-dropdown {
    position: relative;
    display: none;
}

.user-dropdown__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    display: none;
    width: 230px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-elevated);
}

.user-dropdown.is-open .user-dropdown__panel {
    display: grid;
    gap: 8px;
}

.user-dropdown__identity {
    display: grid;
    gap: 2px;
    padding: 8px 8px 10px;
    border-bottom: 1px solid var(--line);
}

.user-dropdown__identity strong {
    overflow: hidden;
    color: var(--ink-950);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown__identity span {
    color: var(--ink-500);
    font-size: 12px;
}

.user-dropdown__logout {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--danger-700);
    font-weight: 700;
    text-align: left;
}

.user-dropdown__logout:hover {
    background: var(--danger-100);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot--success {
    background: #22C55E;
    box-shadow: 0 0 0 3px var(--success-100);
}

.notification-button {
    font-size: 18px;
}

.notification-button__count {
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    width: 15px;
    height: 15px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--danger-700);
    color: #fff;
    font-size: 8px;
}

.page-content {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.page-heading {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}

.page-heading--compact {
    margin-top: -10px;
    margin-bottom: 18px;
}

.page-heading h1 span {
    color: var(--primary-600);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--primary-600);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-heading__subtitle,
.panel-heading p,
.panel > p,
.muted {
    margin-bottom: 0;
    color: var(--ink-500);
}

.page-heading__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.button,
.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out;
}

.button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.button--primary,
.btn-primary {
    background: linear-gradient(115deg, var(--primary-600), var(--accent-600));
    color: #fff;
    box-shadow: 0 8px 18px rgba(62, 85, 209, .22);
}

.btn-danger {
    background: var(--danger-700);
    color: #fff;
    box-shadow: 0 8px 18px rgba(185, 28, 28, .18);
}

.button:disabled,
.btn:disabled,
.button.is-loading,
.btn.is-loading {
    cursor: progress;
    opacity: .72;
    transform: none;
}

.button--secondary,
.btn-muted {
    border-color: var(--line);
    background: var(--surface);
    color: var(--primary-600);
}

.button--secondary:hover,
.btn-muted:hover {
    border-color: var(--primary-600);
    background: var(--primary-100);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card,
.panel,
.auth-card,
.system-check {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}

.stat-card {
    min-height: 139px;
    padding: 18px;
    border-radius: var(--radius-md);
}

.stat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-500);
    font-weight: 650;
}

.metric-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
}

.metric-icon--primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.metric-icon--success {
    background: var(--success-100);
    color: var(--success-700);
}

.metric-icon--warning {
    background: var(--warning-100);
    color: var(--warning-700);
}

.metric-icon--accent {
    background: var(--accent-100);
    color: var(--accent-600);
}

.stat-card__value {
    display: block;
    margin: 17px 0 3px;
    color: var(--ink-950);
    font-size: 25px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-card small {
    color: var(--ink-500);
}

.deliveries-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.deliveries-summary__card {
    min-height: 0;
}

.deliveries-summary__card--delivered {
    border-color: color-mix(in srgb, var(--success-700) 22%, var(--line));
}

.deliveries-summary__card--pending,
.deliveries-summary__card--attention {
    border-color: color-mix(in srgb, var(--warning-700) 22%, var(--line));
}

.deliveries-summary__card--completed {
    border-color: color-mix(in srgb, var(--primary-600) 22%, var(--line));
}

.deliveries-summary__card--cash {
    border-color: color-mix(in srgb, var(--primary-600) 22%, var(--line));
}

.deliveries-summary__card--credit {
    border-color: color-mix(in srgb, var(--accent-600) 22%, var(--line));
}

.delivery-list-filters {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) minmax(160px, .8fr) minmax(340px, 1.4fr);
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.delivery-list-filters__search {
    grid-column: 1 / -1;
    max-width: 520px;
}

.loads-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loads-summary__card {
    min-height: 0;
}

.loads-summary__card--prepared {
    border-color: color-mix(in srgb, var(--warning-700) 22%, var(--line));
}

.loads-summary__card--dispatched {
    border-color: color-mix(in srgb, var(--success-700) 22%, var(--line));
}

.load-list-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1.5fr) minmax(160px, .8fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.load-list-filters__period,
.load-list-filters .load-period__range {
    grid-column: 1 / -1;
}

.load-list-filters .load-list-filters__period,
.delivery-list-filters .delivery-list-filters__period {
    justify-self: start;
    width: min(100%, 310px);
}

.load-list-filters__clear {
    align-self: end;
    white-space: nowrap;
}

.loads-page .table-wrap {
    overflow-x: visible;
}

.loads-page .data-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.loads-page .data-table th,
.loads-page .data-table td {
    overflow-wrap: anywhere;
}

.loads-page .data-table th:nth-child(1),
.loads-page .data-table td:nth-child(1),
.loads-page .data-table th:nth-child(5),
.loads-page .data-table td:nth-child(5),
.loads-page .data-table th:nth-child(6),
.loads-page .data-table td:nth-child(6),
.loads-page .data-table th:nth-child(7),
.loads-page .data-table td:nth-child(7) {
    white-space: nowrap;
}

.deliveries-list__table {
    min-width: 1100px;
}

.deliveries-list__table th:nth-child(2) { min-width: 190px; }
.deliveries-list__table th:nth-child(5) { width: 70px; }
.deliveries-list__table th:nth-child(6) { width: 86px; }
.deliveries-list__table th:nth-child(8) { min-width: 130px; }
.deliveries-list__table th:nth-child(9) { min-width: 116px; }

.delivery-list-card__payment small {
    display: block;
    margin-top: 5px;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.35;
}

.status-mixto {
    background: var(--warning-100);
    color: var(--warning-700);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.dashboard-grid--distributor {
    align-items: start;
}

.app-shell--distributor .sidebar__nav {
    align-content: start;
    grid-auto-rows: max-content;
}

.app-shell--driver .sidebar__nav {
    align-content: start;
    grid-auto-rows: max-content;
    gap: 3px;
}

.app-shell--store .sidebar__nav {
    align-content: start;
    grid-auto-rows: max-content;
    gap: 3px;
}

.app-shell--store .sidebar__label {
    margin: 12px 0 5px;
}

.app-shell--store .sidebar__label:first-child {
    margin-top: 2px;
}

.app-shell--store .nav-link {
    min-height: 40px;
    gap: 10px;
    padding: 0 10px;
}

.app-shell--store .nav-link__icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    font-size: 16px;
}

.app-shell--store .nav-link__icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-shell--store .nav-link > span:last-child {
    min-width: 0;
}

.panel {
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius-lg);
}

.panel__header,
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel__header > div,
.panel-heading > div {
    min-width: 0;
}

.panel-heading.compact {
    align-items: center;
}

.panel-heading h2 {
    margin: 0;
    font-size: 18px;
}

.panel-heading p {
    overflow-wrap: anywhere;
}

.panel-heading h3 {
    margin: 0;
    font-size: 15px;
}

.text-link {
    color: var(--primary-600);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.text-button {
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 600;
}

.attention-list {
    display: grid;
}

.attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.attention-item__identifier {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.attention-item__identifier div {
    min-width: 0;
}

.attention-item__identifier strong,
.attention-item__identifier small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attention-item__identifier strong {
    font-size: 13px;
}

.attention-item__identifier small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 11px;
}

.attention-item__marker {
    width: 8px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 99px;
}

.attention-item__marker--danger {
    background: var(--danger-700);
}

.attention-item__marker--warning {
    background: #F59E0B;
}

.attention-item__marker--info {
    background: var(--primary-600);
}

.attention-item__amount {
    display: grid;
    justify-items: end;
    gap: 5px;
    color: var(--ink-950);
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.status-badge,
.status {
    display: inline-flex;
    width: fit-content;
    min-height: 22px;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.status-badge--danger,
.status-bloqueado {
    background: var(--danger-100);
    color: var(--danger-700);
}

.status-badge--warning,
.status-inactivo {
    background: var(--warning-100);
    color: var(--warning-700);
}

.status-badge--info {
    background: var(--primary-100);
    color: var(--primary-600);
}

.status-badge--success,
.status-activo {
    background: var(--success-100);
    color: var(--success-700);
}

.load-status--dispatched,
.load-status--prepared {
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
}

.load-status--dispatched {
    background: #dcfce7;
    color: #166534;
}

.load-status--prepared {
    background: #fef3c7;
    color: #92400e;
}

.load-status--dispatched svg,
.load-status--prepared svg {
    width: 15px;
    height: 15px;
    flex: none;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.load-status--dispatched svg { stroke: #15803d; }
.load-status--prepared svg { stroke: #b45309; }

.status-registrado,
.status-valida,
.status-confirmada,
.status-pagada {
    background: var(--success-100);
    color: var(--success-700);
}

.status-pendiente,
.status-parcial {
    background: var(--warning-100);
    color: var(--warning-700);
}

.status-anulado,
.status-anulada {
    background: var(--danger-100);
    color: var(--danger-700);
}

.status-cuadrada {
    background: var(--success-100);
    color: var(--success-700);
}

.status-faltante {
    background: var(--danger-100);
    color: var(--danger-700);
}

.status-sobrante {
    background: var(--warning-100);
    color: var(--warning-700);
}

.portfolio-chart {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 196px;
}

.portfolio-chart__ring {
    position: relative;
    display: grid;
    width: 145px;
    height: 145px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--primary-600) 0 68%, var(--accent-600) 68% 92%, #F59E0B 92% 100%);
}

.portfolio-chart__ring::before {
    position: absolute;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #fff;
    content: "";
}

.portfolio-chart__ring span {
    position: relative;
    z-index: 1;
    display: grid;
    color: var(--ink-950);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.portfolio-chart__ring small {
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 500;
}

.chart-legend {
    display: grid;
    flex: 1;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.chart-legend li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--ink-700);
    font-size: 12px;
}

.chart-legend strong {
    color: var(--ink-950);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot--primary {
    background: var(--primary-600);
}

.legend-dot--accent {
    background: var(--accent-600);
}

.legend-dot--warning {
    background: #F59E0B;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 -20px -4px;
    padding: 0 20px 4px;
}

.table-wrap--actions {
    overflow: visible;
}

.table-wrap table {
    width: 100%;
    min-width: 620px;
    border-spacing: 0;
    border-collapse: collapse;
}

.table-wrap th {
    padding: 0 12px 10px;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
}

.table-wrap td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    color: var(--ink-700);
    font-size: 13px;
    transition: background-color 160ms ease-out;
    vertical-align: top;
}

.table-wrap th:first-child,
.table-wrap td:first-child {
    padding-left: 0;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
    padding-right: 0;
}

.table-wrap td span,
.table-wrap td small {
    display: block;
    margin-top: 3px;
    color: var(--ink-500);
}

.table-wrap td .load-status--dispatched,
.table-wrap td .load-status--prepared {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0;
    line-height: 1.2;
}

.table-wrap td .load-status--dispatched { color: #166534; }
.table-wrap td .load-status--prepared { color: #92400e; }

.distributor-customers-list .table-wrap tbody tr:hover td {
    background: #EFF6FF;
}

.distributor-customers-list .table-wrap table {
    min-width: 960px;
}

.distributor-customers-list .table-wrap th:nth-child(1),
.distributor-customers-list .table-wrap td:nth-child(1) {
    width: 24%;
}

.distributor-customers-list .table-wrap th:nth-child(3),
.distributor-customers-list .table-wrap td:nth-child(3) {
    width: 24%;
}

.distributor-customers-list .table-wrap th:nth-child(5),
.distributor-customers-list .table-wrap td:nth-child(5) {
    width: 12%;
}

.distributor-customers-list .table-wrap th:last-child,
.distributor-customers-list .table-wrap td:last-child {
    width: 1%;
    white-space: nowrap;
}

.distributor-customers-list .table-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.distributor-customers-list .table-action {
    white-space: nowrap;
}

.customer-days-summary {
    max-width: 130px;
    line-height: 1.4;
    white-space: normal;
}

.data-table .numeric,
.numeric {
    color: var(--ink-950);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.data-table .numeric--center,
.numeric--center {
    text-align: center;
}

.distributor-receivables-list .table-wrap table {
    min-width: 880px;
}

.distributor-collections-report .table-wrap table {
    min-width: 760px;
}

.distributor-product-sales-report .table-wrap table {
    min-width: 820px;
}

.income-product-report__table {
    min-width: 980px !important;
    table-layout: fixed;
}

.income-product-report__product {
    width: 30%;
    text-align: left;
}

.income-product-report__quantity {
    width: 15%;
    text-align: right;
}

.income-product-report__prices {
    width: 25%;
    text-align: left;
}

.income-product-report__state {
    width: 13%;
    text-align: center;
}

.income-product-report__subtotal {
    width: 17%;
    text-align: right;
}

.income-product-report__table th.income-product-report__quantity,
.income-product-report__table th.income-product-report__subtotal {
    text-align: right;
}

.income-product-report__table th.income-product-report__state {
    text-align: center;
}

.income-product-report__state-list {
    display: grid;
    gap: 6px;
}

.income-product-report__state-line {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: center;
}

.income-product-report__table .product-sales-price-line {
    min-height: 24px;
    align-items: center;
}

.transfer-product-report__table {
    min-width: 820px !important;
    table-layout: fixed;
}

.transfer-product-report__product {
    width: 30%;
    text-align: left;
}

.transfer-product-report__quantity {
    width: 18%;
    text-align: right;
}

.transfer-product-report__prices {
    width: 32%;
    text-align: left;
}

.transfer-product-report__subtotal {
    width: 20%;
    text-align: right;
}

.transfer-product-report__table th.transfer-product-report__quantity,
.transfer-product-report__table th.transfer-product-report__subtotal {
    text-align: right;
}

.transfer-product-report__table .product-sales-price-line {
    min-height: 24px;
    align-items: center;
}

.store-sales-list .table-wrap table {
    min-width: 960px;
}

.store-cash-closings-report .table-wrap table {
    min-width: 1040px;
}

.store-qr-payments-report .table-wrap table {
    min-width: 1080px;
}

.store-cash-closings-report .numeric,
.store-cash-closings-report .numeric strong,
.store-qr-payments-report .numeric,
.store-qr-payments-report .numeric strong {
    white-space: nowrap;
}

.store-qr-payments-report tbody tr[data-store-qr-payment-row] {
    transition: background-color 160ms ease-out;
}

.store-qr-payments-report tbody tr[data-store-qr-payment-row]:hover {
    background: #F2F7FF;
}

.qr-payment-date strong,
.qr-payment-date small,
.qr-payment-reference {
    display: block;
}

.qr-payment-reference {
    max-width: 260px;
    overflow: hidden;
    color: var(--ink-600);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-inventory-filters {
    grid-template-columns: minmax(160px, 220px) minmax(260px, 1fr) auto;
}

.store-inventory-export {
    min-width: 168px;
    white-space: nowrap;
}

.store-inventory-table tbody tr[data-store-inventory-row] {
    transition: background-color 160ms ease-out;
}

.store-inventory-table tbody tr[data-store-inventory-row]:hover {
    background: #F2F7FF;
}

.store-inventory-table tbody tr[data-store-inventory-row]:hover td {
    color: var(--ink-950);
}

.cash-closing-date {
    display: grid;
    gap: 2px;
    min-width: 82px;
}

.cash-closing-date strong {
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.cash-closing-date small {
    margin-top: 0;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.store-sale-detail-table table {
    min-width: 720px;
}

.product-sales-price-list {
    display: grid;
    gap: 6px;
}

.product-sales-price-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.product-sales-price-line span {
    min-width: 0;
    margin: 0;
    color: var(--ink-700);
    overflow-wrap: anywhere;
}

.product-sales-price-line strong {
    color: var(--ink-950);
    text-align: right;
    white-space: nowrap;
}

.product-sales-cards {
    display: none;
}

.distributor-receivables-list .sales-summary-card__value {
    font-size: 20px;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.distributor-receivables-list .sales-summary-card--total .sales-summary-card__value {
    font-size: 22px;
}

.receivables-payment-breakdown {
    display: grid;
    gap: 2px;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 750;
}

.receivables-payment-breakdown span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0;
}

.receivables-payment-breakdown b,
.receivables-payment-breakdown strong {
    min-width: 0;
    color: inherit;
    font-size: inherit;
    font-weight: 800;
    line-height: 1.25;
}

.receivables-payment-breakdown strong {
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.due-date {
    color: var(--warning-700);
    font-weight: 650;
}

.table-action {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--primary-600);
    font-size: 12px;
    font-weight: 700;
}

.table-action--danger {
    color: var(--danger-700);
}

.table-action--danger:hover {
    border-color: #FCA5A5;
    background: #FEF2F2;
}

.distributor-color-control {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

button.distributor-color-control:hover {
    background: var(--canvas);
    color: var(--primary-600);
}

.distributor-color-control--readonly {
    min-height: 0;
}

.distributor-color-swatch {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1px solid rgba(22, 32, 51, .16);
    border-radius: 50%;
    background: var(--distributor-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.distributor-color-control--empty .distributor-color-swatch {
    border: 2px solid var(--ink-500);
    background: transparent;
    box-shadow: none;
}

.distributor-color-control--empty {
    color: var(--ink-500);
}

.distributor-color-edit {
    color: var(--primary-600);
    font-size: 11px;
    font-weight: 800;
}

.distributor-color-form {
    display: grid;
    gap: 18px;
}

.distributor-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.distributor-color-picker input[type="color"] {
    width: 64px;
    height: 44px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.distributor-color-picker output {
    color: var(--ink-950);
    font-weight: 800;
    letter-spacing: .04em;
}

.distributor-customers-summary {
    grid-template-columns: 1fr;
}

.distributor-customers-list .catalog-filters--compact {
    grid-template-columns: minmax(140px, 170px) minmax(130px, 160px) minmax(160px, 200px) minmax(240px, 1fr);
}

.customer-filter-range {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(150px, 210px));
    gap: 12px;
}

.customer-filter-range[hidden] {
    display: none;
}

.customer-location-map {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.customer-location-map--view {
    min-height: 420px;
}

.customer-location-status {
    min-height: 18px;
    margin: 0;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.customer-check-group {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.customer-commercial-readonly {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 2px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
}

.customer-commercial-readonly[hidden] {
    display: none;
}

.customer-commercial-readonly div {
    min-width: 0;
}

.customer-commercial-readonly dt {
    margin-bottom: 5px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 750;
}

.customer-commercial-readonly dd {
    margin: 0;
    color: var(--ink-950);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.customer-check-group legend {
    margin-bottom: 0;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

.customer-days-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.customer-days-grid label {
    display: flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

.customer-days-grid input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-600);
}

.customer-location-detail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.customer-location-detail div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.customer-location-detail dt {
    margin: 0 0 4px;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.customer-location-detail dd {
    margin: 0;
    color: var(--ink-950);
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.customer-created-cell time {
    display: grid;
    gap: 2px;
    color: var(--ink-700);
    font-weight: 750;
}

.customer-created-cell time span {
    margin-top: 0;
    color: var(--ink-500);
    font-size: 12px;
}

.customers-pagination {
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.customers-pagination .btn {
    flex: 0 0 auto;
}

.customers-pagination__pages {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.customers-pagination__page {
    width: auto;
    min-width: 36px;
    padding: 0 10px;
}

.customers-pagination__page.is-active {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
}

.customers-pagination__gap {
    display: inline-grid;
    min-width: 24px;
    place-items: center;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
}

.customers-pagination__label {
    display: inline-grid;
    min-height: 34px;
    place-items: center;
    padding: 0 10px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 800;
}

.distributor-customers-heading,
.distributor-customers-heading > div,
.distributor-customers-heading .page-heading__actions {
    min-width: 0;
}

.distributor-customers-heading .button {
    width: 100%;
    max-width: 100%;
}

.button--compact {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.sale-line-status {
    color: #B91C1C;
    border: 1px solid #FEE2E2;
    border-radius: 999px;
    padding: 0 8px;
    background: #FEF2F2;
    font-size: 10px;
    font-weight: 800;
}

.sale-detail-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.sale-line-head {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.sale-line-head strong {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
    overflow-wrap: anywhere;
}

.sale-line-head span {
    color: var(--ink-500);
    font-size: 12px;
}

.sale-line-subtotal {
    color: var(--ink-950);
    font-size: 12px;
    font-weight: 800;
}

.sale-line-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    gap: 6px;
    align-self: center;
}

.sale-line-actions .button {
    width: auto;
    min-width: 72px;
    justify-content: center;
}

.admin-sale-line-action {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 7px;
    border: 1px solid currentColor;
}

.admin-sale-line-action svg {
    display: block;
    width: 18px;
    height: 18px;
}

.admin-sale-line-action--edit { color: #2563EB; background: #EFF6FF; }
.admin-sale-line-action--cancel { color: #B91C1C; background: #FEF2F2; }
.sale-detail-line--void { opacity: .7; }
.admin-sale-line-history {
    grid-column: 1 / -1;
    display: grid;
    gap: 3px;
    margin: 3px 0 0;
    padding: 8px 10px;
    list-style: none;
    border-left: 3px solid #DBEAFE;
    background: #F8FAFC;
    color: var(--ink-500);
    font-size: 11px;
}

.admin-sale-item-summary {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.admin-sale-item-summary > div {
    display: grid;
    gap: 3px;
}

.admin-sale-item-summary dt { color: var(--ink-500); font-size: 12px; }
.admin-sale-item-summary dd { margin: 0; font-weight: 800; }

@media (max-width: 520px) {
    .sale-detail-line { grid-template-columns: minmax(0, 1fr); }
    .sale-line-actions { grid-column: 1; grid-row: auto; display: flex; justify-content: flex-start; }
    .admin-sale-line-history { overflow-wrap: anywhere; }
}

.sale-item-form {
    display: grid;
    gap: 12px;
}

.sale-item-form .modal-footer {
    margin-top: 2px;
}

.sale-item-form strong {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--primary-700);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.activity-list {
    display: grid;
    gap: 19px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 11px;
}

.activity-item:not(:last-child)::before {
    position: absolute;
    top: 18px;
    left: 7px;
    width: 1px;
    height: calc(100% + 10px);
    background: var(--line);
    content: "";
}

.activity-item__dot {
    position: relative;
    z-index: 1;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 2px currentColor;
}

.activity-item__dot--success {
    color: #22C55E;
    background: #22C55E;
}

.activity-item__dot--primary {
    color: var(--primary-600);
    background: var(--primary-600);
}

.activity-item__dot--accent {
    color: var(--accent-600);
    background: var(--accent-600);
}

.activity-item strong {
    font-size: 13px;
}

.activity-item p {
    margin: 3px 0;
    color: var(--ink-700);
    font-size: 12px;
}

.activity-item small {
    color: var(--ink-500);
    font-size: 11px;
}

.login-page,
.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(35, 87, 198, .12), transparent 32%), var(--canvas);
}

.login-shell,
.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 22px;
}

.login-card,
.auth-card {
    width: min(430px, calc(100vw - 44px));
    max-width: 100%;
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-elevated);
}

.auth-card h1,
.login-card h1 {
    margin: 0;
    color: var(--ink-950);
    font-size: 28px;
    line-height: 1.15;
}

.auth-card p,
.login-card__heading p:last-child {
    margin: 7px 0 0;
    color: var(--ink-500);
}

.login-brand {
    font-size: 20px;
    margin-bottom: 28px;
}

.login-card__heading {
    margin-bottom: 22px;
}

.login-form,
.form-stack,
.admin-form {
    display: grid;
    min-width: 0;
    gap: 15px;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.field,
label {
    display: grid;
    min-width: 0;
    gap: 7px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

label {
    font-size: 13px;
}

.field span {
    color: var(--ink-700);
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-950);
    outline: 0;
    min-width: 0;
    transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out;
}

select {
    text-overflow: ellipsis;
}

textarea {
    min-height: 112px;
    padding-block: 11px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px rgba(35, 87, 198, .12);
}

.password-field {
    position: relative;
    display: grid;
    min-width: 0;
}

.password-field input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: var(--primary-100);
    color: var(--primary-600);
    font-size: 12px;
    font-weight: 800;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: #DCE8FF;
}

.alert {
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-weight: 650;
}

.alert-error,
.alert--danger {
    background: var(--danger-100);
    border-color: rgba(185, 28, 28, .18);
    color: var(--danger-700);
}

.alert-success,
.alert--success {
    background: var(--success-100);
    border-color: rgba(21, 128, 61, .18);
    color: var(--success-700);
}

.quick-actions,
.form-actions,
.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-row {
    margin-bottom: 16px;
}

.search-row input {
    flex: 1 1 260px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.choice-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

legend {
    padding: 0 6px;
    color: var(--ink-950);
    font-weight: 800;
}

.check-row {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 9px;
    align-items: start;
    margin-top: 10px;
    color: var(--ink-950);
    font-weight: 600;
}

.check-row input {
    width: 18px;
    height: 18px;
    min-height: auto;
    margin-top: 1px;
}

.check-row small {
    display: inline;
    color: var(--ink-500);
    font-weight: 500;
}

.permissions-block {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.permission-filter {
    max-width: 260px;
}

.permissions-table {
    display: grid;
    gap: 8px;
}

.permissions-table h4 {
    margin: 14px 0 2px;
    color: var(--primary-600);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.permission-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.permission-row strong,
.permission-row span,
.permission-row small {
    display: block;
}

.permission-row span,
.permission-row small {
    margin-top: 3px;
    color: var(--ink-500);
}

.segmented {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.segmented label {
    display: block;
    min-width: 0;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: grid;
    min-height: 38px;
    place-items: center;
    padding: 8px 10px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    border-left: 1px solid var(--line);
}

.segmented label:first-child span {
    border-left: 0;
}

.segmented input:checked + span {
    color: #fff;
    background: var(--primary-700);
}

.link-action {
    color: var(--primary-600);
    font-weight: 800;
}

.catalog-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 210px) minmax(170px, 230px);
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.catalog-filters--compact {
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px);
}

.operations-filters {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.commercial-fields {
    display: grid;
    gap: 14px;
}

/* Control aislado: evita que la regla global de inputs convierta este checkbox en un campo ancho. */
.checkbox-field {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 9px;
    margin: 0;
    color: var(--ink-700);
    cursor: pointer;
}

.checkbox-field > input[type="checkbox"] {
    box-sizing: border-box;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary-600);
}

.checkbox-field > span {
    line-height: 1.35;
}

@media (max-width: 640px) {
    .checkbox-field {
        width: 100%;
        justify-self: stretch;
    }
}

.field-row-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.field-row-title select {
    flex: 1 1 auto;
}

.provider-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.mini-action {
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--primary-600);
    font-size: 11px;
    font-weight: 800;
}

.mini-action:hover {
    border-color: var(--primary-600);
    background: var(--primary-100);
}

.products-loading {
    align-self: center;
    color: var(--primary-600);
    font-size: 12px;
    font-weight: 800;
}

.products-loading::before {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border: 2px solid var(--primary-100);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    vertical-align: -1px;
    animation: spin 760ms linear infinite;
    content: "";
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.action-menu {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.action-menu__toggle {
    white-space: nowrap;
}

.action-menu__panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    min-width: 150px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-elevated);
}

.action-menu.is-above .action-menu__panel {
    top: auto;
    bottom: calc(100% + 6px);
}

.action-menu__panel[hidden] {
    display: none;
}

.action-menu__panel button,
.action-menu__panel a {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.action-menu__panel button:hover,
.action-menu__panel a:hover {
    background: var(--primary-100);
    color: var(--primary-600);
}

.modal-shell {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
}

.modal-shell[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 32, 51, .44);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 560px);
    max-height: min(820px, calc(100vh - 36px));
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-elevated);
}

.modal-card--large {
    width: min(100%, 900px);
}

.modal-card--wide {
    width: min(100%, 1120px);
}

.modal-card--validation {
    width: min(100%, 520px);
}

/* Patrón reutilizable para confirmaciones visuales de operaciones exitosas. */
.modal-card--success {
    width: min(100%, 430px);
    text-align: center;
}

.success-modal {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 18px 10px 8px;
}

.success-modal__icon {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border-radius: 50%;
    background: var(--success-700);
    color: #fff;
    font-size: 46px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 14px 30px rgba(21, 128, 61, .30), inset 0 0 0 6px rgba(255, 255, 255, .14);
    animation: success-modal-pop 420ms cubic-bezier(.18, 1.45, .42, 1) both;
}

.success-modal h2 {
    margin: 4px 0 0;
    color: var(--ink-950);
    font-size: 24px;
    line-height: 1.15;
}

.success-modal p {
    max-width: 300px;
    margin: 0;
    color: var(--ink-700);
    font-size: 14px;
    font-weight: 650;
}

.success-modal__actions {
    justify-content: center;
    margin-top: 8px;
}

@keyframes success-modal-pop {
    0% { opacity: 0; transform: scale(.55); }
    55% { opacity: 1; transform: scale(1.13); }
    100% { opacity: 1; transform: scale(1); }
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modal-header {
    margin-bottom: 18px;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-header--validation {
    align-items: flex-start;
    justify-content: flex-start;
}

.validation-modal__icon {
    display: inline-grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: #FFF4D6;
    color: #9A5B00;
    font-size: 20px;
    font-weight: 900;
}

.validation-modal__subtitle {
    margin: 5px 0 0;
    color: var(--ink-500);
    font-size: 13px;
    font-weight: 650;
}

.validation-modal__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0 0 0 18px;
    color: var(--danger-700);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
}

.modal-body {
    display: grid;
    gap: 15px;
}

.detail-toolbar {
    display: flex;
    justify-content: flex-end;
}

.modal-message {
    margin-bottom: 0;
    color: var(--ink-700);
    font-weight: 650;
}

.modal-summary {
    display: grid;
    gap: 10px;
}

.modal-footer {
    justify-content: flex-end;
    margin-top: 18px;
}

.modal-table-wrap {
    margin-bottom: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.compact-summary {
    grid-template-columns: 1fr;
}

.detail-grid section {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.detail-grid h3 {
    margin: 0 0 12px;
    font-size: 14px;
}

.product-picker {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.product-results {
    display: grid;
    max-height: 220px;
    overflow: auto;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.product-results[hidden] {
    display: none;
}

.product-results button {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 62px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    line-height: 1.3;
    text-align: left;
    overflow: visible;
}

.product-results strong,
.product-results span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-results button:hover {
    border-color: var(--primary-600);
    background: var(--primary-100);
}

.product-results span {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}

.income-products {
    display: grid;
    gap: 14px;
}

.income-detail-table input,
.income-detail-table select {
    min-width: 112px;
}

.income-total {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    align-items: center;
    padding-top: 8px;
    color: var(--ink-700);
    font-weight: 750;
}

.income-total strong {
    color: var(--primary-600);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.segmented--two {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.income-entry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.income-entry__feedback {
    grid-column: 1 / -1;
}

.form-feedback {
    padding: 12px 14px;
    border: 1px solid rgba(185, 28, 28, .26);
    border-radius: var(--radius-sm);
    background: var(--danger-100);
    color: var(--danger-700);
    font-weight: 700;
}

.form-feedback[hidden] {
    display: none;
}

.form-feedback ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-weight: 650;
}

.is-invalid {
    border-color: var(--danger-700) !important;
    background: #FFF7F7 !important;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, .10) !important;
}

.income-entry__left {
    display: grid;
    gap: 18px;
}

.income-entry__right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.product-search-block {
    position: relative;
    display: grid;
    gap: 10px;
    z-index: 20;
}

.product-search-control {
    position: relative;
    z-index: 30;
}

.store-other-product-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.store-other-create-button {
    min-height: 44px;
    white-space: nowrap;
}

.income-data-block {
    display: grid;
    gap: 18px;
}

.product-results--floating {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    margin-top: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: var(--shadow-elevated);
}

.product-results button.is-active {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-600);
}

.cart-list {
    display: grid;
    gap: 8px;
    align-content: start;
    align-items: start;
    grid-auto-rows: max-content;
    min-height: 180px;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-color: rgba(113, 128, 150, .55) transparent;
    scrollbar-width: thin;
}

.cart-list::-webkit-scrollbar {
    width: 8px;
}

.cart-list::-webkit-scrollbar-track {
    background: transparent;
}

.cart-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(113, 128, 150, .45);
}

.cart-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 78px 104px 112px 70px 112px 30px;
    gap: 5px;
    align-items: center;
    align-self: start;
    min-height: 0;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.cart-row.product-row-highlight {
    animation: product-row-highlight 1.35s ease-in-out;
}

@keyframes product-row-highlight {
    0%,
    100% {
        background: transparent;
        box-shadow: none;
    }

    18% {
        background: #E8F0FF;
        box-shadow: inset 0 0 0 1px #2357C6;
    }

    52% {
        background: transparent;
        box-shadow: none;
    }

    78% {
        background: rgba(232, 240, 255, .72);
        box-shadow: inset 0 0 0 1px rgba(35, 87, 198, .55);
    }
}

.cart-row--head {
    position: sticky;
    z-index: 5;
    top: 0;
    padding-top: 0;
    border-top: 0;
    background: var(--surface);
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cart-row--head span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
}

.cart-row strong,
.cart-row small {
    display: block;
}

.cart-row > div strong {
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.cart-row small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 11px;
}

.cart-row input {
    min-height: 38px;
    padding-inline: 7px;
    font-size: 12px;
}

.cart-row .numeric {
    white-space: nowrap;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.cart-row .icon-button {
    width: 30px;
    min-height: 30px;
}

.income-calculated-cost {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.totals-box {
    display: grid;
    flex-shrink: 0;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.totals-box div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

.totals-box strong {
    color: var(--ink-950);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.totals-box__discount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

.totals-box__discount-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
}

.totals-box__discount-control input {
    width: 112px;
    min-height: 34px;
    padding: 5px 8px;
    text-align: right;
}

.totals-box__net {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.totals-box__net strong {
    color: var(--primary-600);
    font-size: 16px;
}

.income-entry__actions {
    flex-shrink: 0;
    justify-content: flex-end;
}

.income-entry__actions .btn {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 13px;
}

.transfer-cart-row {
    grid-template-columns: minmax(80px, 100px) minmax(180px, 1fr) minmax(92px, 112px) minmax(118px, 140px) minmax(92px, 112px) minmax(104px, 126px) 34px;
    column-gap: 12px;
}

.transfer-cart-list .transfer-cart-row strong.numeric {
    justify-self: stretch;
    padding-right: 4px;
    font-size: 12px;
    text-align: right;
}

.transfer-cart-row > strong[data-label="Codigo"] {
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.transfer-cart-row label[data-label="Cantidad"] {
    width: 100%;
}

.transfer-cart-row label[data-label="Cantidad"] input {
    width: 100%;
}

.transfer-cart-row .icon-button {
    justify-self: end;
}

.transfer-cart-row > div strong {
    overflow-wrap: anywhere;
}

.transfer-product-code {
    display: grid;
    justify-items: start;
    gap: 4px;
}

.transfer-cart-row .transfer-bonification-button {
    display: inline-grid;
    justify-self: start;
    width: 36px;
    height: 36px;
    min-height: 36px;
    color: var(--primary-600);
}

.transfer-cart-row .transfer-bonification-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.transfer-cart-row .transfer-cart-field {
    display: flex;
    align-items: center;
    width: 100%;
}

.transfer-cart-row .transfer-cart-input {
    width: 100%;
    min-height: 38px;
    margin: 0;
    text-align: right;
}

.transfer-cart-row .transfer-cart-readonly,
.transfer-cart-row .transfer-cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
}

.transfer-cart-row--bonus {
    background: color-mix(in srgb, var(--primary-50) 65%, transparent);
}

.transfer-cart-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 38px;
}

.income-cart-row {
    grid-template-columns: minmax(82px, 100px) minmax(180px, 1fr) minmax(116px, 138px) minmax(118px, 142px) minmax(104px, 128px) 34px;
    column-gap: 12px;
}

.income-cart-row > strong[data-label="Codigo"] {
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.admin-sale-customer-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.admin-sale-destination-block {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.admin-sale-destination-block .panel-heading {
    margin-bottom: 0;
}

.admin-sale-cart-row {
    grid-template-columns: minmax(64px, .65fr) minmax(0, 1.7fr) 86px 86px 94px 36px;
    column-gap: 8px;
}

.admin-sale-cart-row > * {
    min-width: 0;
}

.admin-sale-product-code {
    display: grid;
    justify-items: start;
    gap: 3px;
}

.admin-sale-product-code > strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-sale-cart-row .admin-sale-bonification-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    color: var(--primary-600);
}

.admin-sale-bonification-button svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.admin-sale-cart-field {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    margin: 0;
}

.admin-sale-cart-field > .admin-sale-cart-input {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding-inline: 7px;
    text-align: right;
}

.admin-sale-cart-readonly,
.admin-sale-cart-subtotal {
    box-sizing: border-box;
    display: flex !important;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: flex-end;
    padding-inline: 7px;
    text-align: right;
}

.admin-sale-cart-row .admin-sale-cart-readonly,
.admin-sale-cart-row .admin-sale-cart-subtotal {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.admin-sale-cart-readonly {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.admin-sale-cart-subtotal {
    padding-right: 7px;
}

.admin-sale-cart-row .numeric {
    justify-self: stretch;
    white-space: nowrap;
}

.admin-sale-cart-actions {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: flex-end;
}

.admin-sale-cart-actions .icon-button {
    margin-left: auto;
}

.admin-sale-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
}

.admin-sale-totals .admin-sale-total-item {
    display: inline-flex;
    min-width: max-content;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    border-top: 0;
}

.admin-sale-totals .admin-sale-total-item span {
    color: var(--ink-700);
}

.admin-sale-totals .admin-sale-total-item strong {
    color: var(--ink-950);
}

.admin-sale-totals .admin-sale-total-item--amount {
    margin-left: auto;
}

.admin-sale-totals .admin-sale-total-item--amount strong {
    color: var(--primary-700);
    font-size: 18px;
}

.admin-sale-success-modal {
    text-align: center;
}

.admin-sale-success-content {
    padding-bottom: 0;
}

.admin-sale-success-content > .eyebrow {
    margin: 0 0 4px;
}

.admin-sale-success-content .store-baneco-check {
    margin-top: 0;
    color: #fff;
    font-size: 0;
    text-transform: none;
}

.admin-sale-success-actions {
    justify-content: center;
}

.admin-sale-type-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: center;
}

.store-pos {
    grid-template-columns: minmax(340px, .58fr) minmax(640px, 1fr);
}

.store-pos-heading .page-heading__actions {
    align-items: center;
}

.store-pos-location,
.store-pos-cashbox {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 800;
}

.store-pos-cashbox {
    border-color: var(--primary-300);
    background: var(--primary-100);
    color: var(--primary-700);
}

.store-pos__left {
    min-height: 260px;
}

.store-pos__right {
    min-height: min(640px, calc(100dvh - 210px));
}

.store-pos-results button {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.store-pos-results button span {
    text-align: right;
}

.store-pos-cart-list {
    max-height: min(48vh, 460px);
    min-height: 260px;
}

.store-pos-cart-row {
    grid-template-columns: minmax(80px, 108px) minmax(220px, 1fr) minmax(92px, 110px) minmax(104px, 122px) minmax(114px, 132px) 58px;
    column-gap: 14px;
}

.store-pos-cart-row > strong[data-label="Código"] {
    overflow-wrap: anywhere;
}

.store-pos-cart-row label[data-label="Cantidad"] input,
.store-pos-cart-row label[data-label="Precio"] input {
    width: 100%;
    text-align: right;
}

.store-pos-cart-row .numeric {
    justify-self: end;
    color: var(--ink-950);
    font-size: 12px;
}

.store-pos-cart-row .icon-button {
    justify-self: end;
}

.store-pos-bottom {
    display: grid;
    flex-shrink: 0;
    gap: 12px;
}

.store-pos-bottom .field select {
    min-height: 42px;
}

.store-pos-totals {
    background: linear-gradient(180deg, var(--surface), var(--canvas));
}

.store-pos-grand-total strong {
    color: var(--primary-700);
    font-size: 22px;
}

.store-pos-submit {
    min-width: 180px;
}

.store-other-income-row {
    grid-template-columns: minmax(86px, 112px) minmax(220px, 1fr) minmax(94px, 112px) minmax(116px, 132px) minmax(120px, 138px) 58px;
    column-gap: 14px;
}

.store-other-income-row > strong[data-label="Codigo"] {
    overflow-wrap: anywhere;
}

.store-other-income-row label[data-label="Cantidad"] input,
.store-other-income-row label[data-label="Precio venta"] input {
    width: 100%;
    text-align: right;
}

.store-other-income-row .numeric,
.store-other-income-table-wrap .numeric {
    text-align: right;
}

.store-other-income-row .icon-button {
    justify-self: end;
}

.store-other-income-table-wrap tr[data-other-income-detail] {
    transition: background-color 160ms ease-out;
}

.store-other-income-table-wrap tr[data-other-income-detail]:hover td {
    background: #F2F7FF;
}

.store-other-income-table-wrap td span {
    display: block;
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
}

.store-other-income-detail {
    margin-bottom: 16px;
}

.store-other-income-detail dt,
.store-other-income-detail dd {
    margin: 0;
}

.store-other-income-detail dd {
    color: var(--ink-950);
    font-weight: 850;
    text-align: right;
}

.store-other-income-detail-total {
    margin-top: 12px;
}

.store-payment-modal {
    max-width: 620px;
}

.store-payment-total {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--primary-300);
    border-radius: var(--radius-sm);
    background: var(--primary-100);
    text-align: center;
}

.store-payment-total span {
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.store-payment-total strong {
    color: var(--primary-700);
    font-size: clamp(30px, 5vw, 44px);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.store-payment-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.store-payment-options button {
    display: grid;
    min-height: 74px;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-950);
    text-align: left;
}

.store-payment-options button:hover,
.store-payment-options button.is-active {
    border-color: var(--primary-600);
    background: var(--primary-100);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.store-payment-options strong {
    font-size: 15px;
}

.store-payment-options span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.store-payment-summary,
.store-payment-mixed {
    margin-top: 14px;
}

.store-payment-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.store-payment-summary span {
    color: var(--ink-600);
    font-size: 13px;
    font-weight: 800;
}

.store-payment-summary strong {
    color: var(--ink-950);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.store-payment-mixed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.store-payment-mixed:not([hidden]) {
    display: grid;
}

.store-payment-mixed input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.store-success-modal {
    max-width: 430px;
}

.store-baneco-modal {
    width: min(100%, 460px);
}

.store-baneco-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.store-baneco-summary div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.store-baneco-summary span,
.store-baneco-qr-box p {
    margin: 0;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.store-baneco-summary strong {
    color: var(--primary-700);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.store-baneco-qr-box {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(35, 87, 198, .22);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #fff, var(--primary-100));
}

.store-baneco-qr-box img {
    width: min(100%, 280px);
    aspect-ratio: 1;
    object-fit: contain;
    border: 10px solid #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.store-baneco-placeholder {
    display: grid;
    width: min(100%, 280px);
    aspect-ratio: 1;
    place-items: center;
    gap: 14px;
    align-content: center;
    border: 1px dashed var(--primary-600);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-500);
    font-weight: 800;
    text-align: center;
}

.store-baneco-status {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-weight: 800;
}

.store-baneco-status[data-state="waiting"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.store-baneco-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border: 3px solid rgba(35, 87, 198, .18);
    border-top-color: var(--primary-600);
    border-right-color: var(--accent-600);
    border-radius: 999px;
    animation: store-baneco-spin 780ms linear infinite;
}

.store-baneco-spinner--generate {
    width: 28px;
    height: 28px;
}

.store-baneco-spinner--waiting {
    width: 30px;
    height: 30px;
}

.store-baneco-waiting-text {
    animation: store-baneco-wait-pulse 1500ms ease-in-out infinite;
}

.store-baneco-status[data-state="paid"] {
    border-color: rgba(21, 128, 61, .24);
    background: var(--success-100);
    color: var(--success-700);
}

.store-baneco-status[data-state="expired"],
.store-baneco-status[data-state="error"] {
    border-color: rgba(180, 83, 9, .24);
    background: var(--warning-100);
    color: var(--warning-700);
}

.store-baneco-confirmation {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px 8px 10px;
    text-align: center;
}

.store-baneco-check {
    position: relative;
    display: grid;
    width: 80px;
    height: 80px;
    place-items: center;
    border-radius: 999px;
    background: var(--success-700);
    color: #fff;
    font-size: 0;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 14px 30px rgba(21, 128, 61, .30), inset 0 0 0 6px rgba(255, 255, 255, .14);
    animation: store-baneco-check-pop 420ms cubic-bezier(.18, 1.45, .42, 1) both;
}

.store-baneco-check::before {
    display: block;
    width: 24px;
    height: 42px;
    margin-top: 4px;
    border-right: 7px solid #fff;
    border-bottom: 7px solid #fff;
    border-radius: 3px;
    content: "";
    transform: rotate(45deg);
    transform-origin: center;
}

.store-baneco-confirmation h3 {
    margin: 4px 0 0;
    color: var(--ink-950);
    font-size: 24px;
    line-height: 1.15;
}

.store-baneco-confirmation strong {
    color: var(--primary-700);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.store-baneco-confirmation span {
    margin-top: 6px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.store-baneco-confirmation p {
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink-950);
    font-size: 17px;
    font-weight: 850;
}

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

@keyframes store-baneco-wait-pulse {
    0%,
    100% {
        opacity: .55;
    }

    50% {
        opacity: 1;
    }
}

@keyframes store-baneco-check-pop {
    0% {
        opacity: 0;
        transform: scale(.55);
    }

    55% {
        opacity: 1;
        transform: scale(1.13);
    }

    78% {
        opacity: 1;
        transform: scale(.97);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.store-pos-cash-warning {
    display: grid;
    gap: 4px;
}

.store-pos-cash-warning a {
    color: var(--danger-700);
    font-weight: 850;
}

.store-cash-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr);
}

.store-cash-data,
.store-cash-summary {
    display: grid;
    gap: 10px;
}

.store-cash-data div,
.store-cash-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.store-cash-data dt,
.store-cash-summary span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
}

.store-cash-data dd,
.store-cash-summary strong {
    margin: 0;
    color: var(--ink-950);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.store-cash-summary__total strong {
    color: var(--primary-700);
    font-size: 20px;
}

.store-cash-count-modal {
    width: min(100%, 860px);
}

.store-cash-count-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.store-cash-count-group {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.store-cash-count-group h3 {
    margin: 0 0 2px;
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.store-cash-denomination {
    display: grid;
    grid-template-columns: minmax(86px, 1fr) minmax(88px, 112px);
    align-items: center;
    gap: 10px;
}

.store-cash-denomination span {
    color: var(--ink-700);
    font-weight: 850;
}

.store-cash-denomination input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-950);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.store-cash-denomination input:focus {
    border-color: var(--primary-600);
    outline: 3px solid rgba(35, 87, 198, .16);
}

.store-cash-count-summary {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.store-cash-count-summary div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.store-cash-count-summary__line {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.store-cash-count-summary span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.store-cash-count-summary strong {
    color: var(--ink-950);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.store-cash-count-summary .is-positive strong {
    color: var(--success-700);
}

.store-cash-count-summary .is-negative strong {
    color: var(--danger-700);
}

.store-cash-count-summary .is-zero strong {
    color: var(--success-700);
}

.store-cash-difference-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(180, 83, 9, .24);
    border-radius: var(--radius-sm);
    background: var(--warning-100);
    color: var(--warning-700);
    font-weight: 800;
}

.store-cash-lock-modal {
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.store-cash-lock-modal h2 {
    color: var(--ink-950);
    font-size: 24px;
}

.store-cash-lock-modal p {
    margin: 0;
    color: var(--ink-700);
    font-weight: 700;
}

.cash-lock {
    position: relative;
    width: 106px;
    height: 112px;
    margin-bottom: 4px;
    animation: pulsoCierre 420ms ease-out 1.18s both;
}

.cash-lock--open {
    animation: pulsoCandado 420ms ease-out 1.2s both;
}

.cash-lock__shackle {
    position: absolute;
    left: 25px;
    top: 2px;
    width: 56px;
    height: 58px;
    border: 9px solid var(--primary-600);
    border-bottom: 0;
    border-radius: 38px 38px 0 0;
    transform: translateY(-14px) rotate(-18deg);
    transform-origin: 80% 100%;
    animation: cerrarCandado 1.25s cubic-bezier(.2, .9, .2, 1) forwards;
}

.cash-lock--open .cash-lock__shackle {
    transform: translateY(0) rotate(0deg);
    transform-origin: 80% 100%;
    animation: abrirCandado 1.3s cubic-bezier(.2, .9, .2, 1) forwards;
}

.cash-lock__body {
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 3px;
    display: grid;
    height: 68px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    box-shadow: 0 16px 34px rgba(35, 87, 198, .26);
}

.cash-lock__body span {
    width: 16px;
    height: 28px;
    border-radius: 999px 999px 8px 8px;
    background: rgba(255, 255, 255, .92);
}

@keyframes cerrarCandado {
    0% {
        transform: translateY(-14px) rotate(-18deg);
    }

    62% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes abrirCandado {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    45% {
        transform: translateY(-7px) rotate(0deg);
    }

    100% {
        transform: translateY(-14px) rotate(-18deg);
    }
}

@keyframes pulsoCierre {
    0% {
        transform: scale(1);
    }

    55% {
        transform: scale(1.07);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulsoCandado {
    0% {
        transform: scale(1);
    }

    55% {
        transform: scale(1.07);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 1100px) {
    .store-pos {
        grid-template-columns: 1fr;
    }

    .store-pos-cart-list {
        max-height: 420px;
    }

    .store-cash-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .store-payment-options,
    .store-payment-mixed,
    .store-baneco-summary {
        grid-template-columns: 1fr;
    }

    .store-cash-count-grid {
        grid-template-columns: 1fr;
    }
}

.return-lines {
    display: grid;
    gap: 10px;
}

.return-line {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px minmax(110px, auto);
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.return-line:first-child {
    border-top: 0;
}

.return-line span,
.return-line strong,
.return-line small {
    display: block;
    min-width: 0;
}

.return-line strong {
    color: var(--ink-950);
    font-size: 12px;
}

.return-line small {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.detail-grid dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-grid dl div {
    display: grid;
    grid-template-columns: minmax(110px, .4fr) minmax(0, 1fr);
    gap: 10px;
}

.detail-grid dt {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.detail-grid dd {
    min-width: 0;
    margin: 0;
    color: var(--ink-950);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.catalog-mini-list {
    display: grid;
    max-height: 220px;
    overflow: auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.catalog-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.catalog-mini-item:first-child {
    border-top: 0;
}

.catalog-mini-item strong,
.catalog-mini-item small {
    display: block;
}

.catalog-mini-item small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 11px;
}

.empty-state {
    display: grid;
    gap: 8px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.empty-state--center {
    max-width: 680px;
    margin: 40px auto;
    text-align: center;
}

.empty-state p:last-child {
    margin-bottom: 0;
    color: var(--ink-500);
}

.distributor-list {
    display: grid;
    gap: 10px;
}

.distributor-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.distributor-list-item:first-child {
    border-top: 0;
}

.distributor-list-item div {
    min-width: 0;
}

.distributor-list-item strong,
.distributor-list-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.distributor-list-item small {
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 12px;
}

.toast-stack {
    position: fixed;
    z-index: 70;
    right: 18px;
    bottom: 18px;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 10px;
}

.toast {
    padding: 13px 15px;
    border: 1px solid rgba(21, 128, 61, .18);
    border-radius: var(--radius-sm);
    background: var(--success-100);
    color: var(--success-700);
    font-weight: 750;
    box-shadow: var(--shadow-elevated);
}

.toast--error {
    border-color: rgba(185, 28, 28, .18);
    background: var(--danger-100);
    color: var(--danger-700);
}

.print-page {
    background: #EEF3F8;
}

.print-sheet {
    width: min(920px, calc(100% - 32px));
    margin: 24px auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--primary-600);
}

.print-header h1 {
    font-size: 28px;
}

.print-line {
    margin: 2px 0;
    color: var(--ink-700);
    font-weight: 800;
}

.print-grid,
.print-totals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.print-grid .item,
.print-totals div {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.print-grid span,
.print-totals span {
    display: block;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.print-grid strong,
.print-totals strong {
    display: block;
    margin-top: 3px;
    color: var(--ink-950);
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

.print-table th,
.print-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.print-table th {
    color: var(--ink-500);
    font-size: 11px;
    text-transform: uppercase;
}

.print-table--transfer th:nth-child(1),
.print-table--transfer td:nth-child(1) {
    width: 140px;
}

.print-table--transfer th:nth-child(2),
.print-table--transfer td:nth-child(2) {
    width: auto;
}

.print-table--transfer th:nth-child(3),
.print-table--transfer td:nth-child(3) {
    width: 120px;
    text-align: right;
}

.transfer-print-page {
    min-height: 100vh;
    background: #E8EEF5;
    color: #162033;
    font-size: 12px;
    overflow-x: hidden;
}

.print-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    background: #DDE5EF;
    border-bottom: 1px solid #CBD5E1;
}

.print-toolbar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
    color: #FFFFFF;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.print-toolbar__button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.transfer-print-sheet {
    width: min(1040px, calc(100% - 44px));
    margin: 18px auto 30px;
    padding: 22px 26px 24px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(28, 42, 68, .14);
}

.transfer-print-header {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-600);
}

.transfer-print-brand strong {
    display: block;
    color: var(--primary-700);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.transfer-print-brand span,
.transfer-print-heading p,
.transfer-print-heading span {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.transfer-print-brand span {
    display: block;
    margin-top: 3px;
}

.transfer-print-heading {
    text-align: right;
}

.transfer-print-heading p {
    margin: 0 0 2px;
}

.transfer-print-heading h1 {
    margin: 0;
    color: var(--ink-950);
    font-size: 26px;
    line-height: 1.08;
}

.transfer-print-heading span {
    display: block;
    margin-top: 4px;
    color: var(--primary-700);
}

.transfer-print-heading .print-status-stamp {
    display: inline-flex;
    width: fit-content;
    margin-top: 7px;
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid #B91C1C;
    border-radius: 999px;
    background: #FEE2E2;
    color: #B91C1C;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.transfer-print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin: 13px 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.transfer-print-meta dl {
    display: grid;
    gap: 5px;
    margin: 0;
}

.transfer-print-meta dl div {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.transfer-print-meta dt {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.transfer-print-meta dd {
    margin: 0;
    color: var(--ink-950);
    font-weight: 750;
}

.transfer-print-page .print-table {
    margin-top: 0;
    font-size: 12px;
    table-layout: fixed;
}

.transfer-print-page .print-table th,
.transfer-print-page .print-table td {
    padding: 6px 9px;
    border-bottom: 1px solid #DDE5EF;
    line-height: 1.25;
    vertical-align: top;
    overflow-wrap: normal;
}

.transfer-print-page .print-table th {
    background: #EEF2F7;
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 900;
}

.transfer-print-page .print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.transfer-print-page .print-table thead {
    display: table-header-group;
}

.transfer-print-page .print-table--transfer th:nth-child(1),
.transfer-print-page .print-table--transfer td:nth-child(1) {
    width: 14%;
    text-align: left;
    white-space: nowrap;
}

.transfer-print-page .print-table--transfer th:nth-child(2),
.transfer-print-page .print-table--transfer td:nth-child(2) {
    width: 40%;
    text-align: left;
    overflow-wrap: break-word;
}

.transfer-print-page .print-table--transfer th:nth-child(3),
.transfer-print-page .print-table--transfer td:nth-child(3) {
    width: 12%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.transfer-print-page .print-table--transfer th:nth-child(4),
.transfer-print-page .print-table--transfer td:nth-child(4) {
    width: 16%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.transfer-print-page .print-table--transfer th:nth-child(5),
.transfer-print-page .print-table--transfer td:nth-child(5) {
    width: 18%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.transfer-print-total {
    margin: 12px 0 0;
    color: var(--ink-950);
    font-size: 13px;
    font-weight: 900;
    text-align: right;
}

.transfer-print-total strong {
    color: var(--primary-700);
}

.load-print-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.load-print-section__header,
.load-print-section__meta {
    break-after: avoid-page;
    page-break-after: avoid;
}

.load-print-cut {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0;
    color: var(--ink-500);
}

.load-print-cut::before,
.load-print-cut::after {
    flex: 1;
    border-top: 1px dashed currentColor;
    content: '';
}

.load-print-cut span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: var(--canvas);
    font-size: 13px;
}

.transfer-print-page .print-table--admin-sale th:nth-child(1),
.transfer-print-page .print-table--admin-sale td:nth-child(1) {
    width: 14%;
}

.transfer-print-page .print-table--admin-sale th:nth-child(2),
.transfer-print-page .print-table--admin-sale td:nth-child(2) {
    width: 46%;
}

.transfer-print-page .print-table--admin-sale th:nth-child(3),
.transfer-print-page .print-table--admin-sale td:nth-child(3) {
    width: 13%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.transfer-print-page .print-table--admin-sale th:nth-child(4),
.transfer-print-page .print-table--admin-sale td:nth-child(4),
.transfer-print-page .print-table--admin-sale th:nth-child(5),
.transfer-print-page .print-table--admin-sale td:nth-child(5) {
    width: 13.5%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-sale-print-totals {
    display: grid;
    justify-content: end;
    gap: 6px;
    margin-top: 12px;
    color: var(--ink-950);
    text-align: right;
}

.admin-sale-print-totals p {
    margin: 0;
    font-size: 12px;
    font-weight: 850;
}

.admin-sale-print-totals strong {
    color: var(--primary-700);
}

.admin-sale-print-grand-total {
    margin-top: 4px !important;
    font-size: 16px !important;
    font-weight: 950 !important;
}

.admin-receivables-table tbody tr:hover {
    background: #EFF6FF;
}

.has-modal {
    overflow: hidden;
}

.system-check {
    width: min(100% - 32px, 720px);
    margin: 64px auto;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.system-check h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.system-check dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.system-check dl div {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.system-check dt {
    font-weight: 700;
}

.system-check dd {
    margin: 0;
    color: var(--ink-500);
    word-break: break-word;
}

.is-hidden {
    display: none !important;
}

[hidden] {
    display: none !important;
}

@media print {
    @page {
        margin: 10mm;
    }

    .no-print {
        display: none !important;
    }

    .print-page {
        background: #FFFFFF;
    }

    .print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .transfer-print-page {
        background: #FFFFFF;
        font-size: 11px;
    }

    .transfer-print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .transfer-print-header {
        break-inside: avoid;
        page-break-inside: avoid;
        padding-bottom: 9px;
    }

    .transfer-print-meta {
        margin: 10px 0 9px;
        padding-bottom: 8px;
    }

    .transfer-print-page .print-table th,
    .transfer-print-page .print-table td {
        padding: 5px 7px;
    }

    .transfer-print-page .print-table--transfer th,
    .transfer-print-page .print-table--transfer td {
        white-space: nowrap;
    }

    .transfer-print-page .print-table--transfer th:nth-child(2),
    .transfer-print-page .print-table--transfer td:nth-child(2) {
        white-space: normal;
        overflow-wrap: break-word;
    }

    .transfer-print-total {
        margin-top: 9px;
    }

    .transfer-print-heading .print-status-stamp {
        background: #fff;
    }

    .load-print-section {
        break-inside: auto;
        page-break-inside: auto;
    }

    .load-print-section__header,
    .load-print-section__meta,
    .load-print-cut {
        break-after: avoid-page;
        page-break-after: avoid;
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .load-print-cut {
        margin: 14px 0;
    }

    .load-print-cut span {
        background: #fff;
    }

    .admin-sale-print-totals {
        margin-top: 9px;
    }
}

@media screen and (max-width: 720px) {
    .transfer-print-sheet {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        padding: 18px 12px 20px;
    }

    .transfer-print-header,
    .transfer-print-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .transfer-print-heading {
        text-align: left;
    }

    .transfer-print-heading .print-status-stamp {
        margin-left: 0;
    }

    .transfer-print-page .print-table {
        font-size: 11px;
    }

    .transfer-print-page .print-table th,
    .transfer-print-page .print-table td {
        padding: 5px 4px;
    }

    .transfer-print-page .print-table--transfer th:nth-child(1),
    .transfer-print-page .print-table--transfer td:nth-child(1) {
        width: 15%;
    }

    .transfer-print-page .print-table--transfer th:nth-child(2),
    .transfer-print-page .print-table--transfer td:nth-child(2) {
        width: 37%;
    }

    .transfer-print-page .print-table--transfer th:nth-child(3),
    .transfer-print-page .print-table--transfer td:nth-child(3) {
        width: 12%;
    }

    .transfer-print-page .print-table--transfer th:nth-child(4),
    .transfer-print-page .print-table--transfer td:nth-child(4) {
        width: 17%;
    }

    .transfer-print-page .print-table--transfer th:nth-child(5),
    .transfer-print-page .print-table--transfer td:nth-child(5) {
        width: 19%;
    }

    .transfer-print-page .print-table--admin-sale th:nth-child(1),
    .transfer-print-page .print-table--admin-sale td:nth-child(1) {
        width: 18%;
    }

    .transfer-print-page .print-table--admin-sale th:nth-child(2),
    .transfer-print-page .print-table--admin-sale td:nth-child(2) {
        width: 34%;
    }

    .transfer-print-page .print-table--admin-sale th:nth-child(3),
    .transfer-print-page .print-table--admin-sale td:nth-child(3),
    .transfer-print-page .print-table--admin-sale th:nth-child(4),
    .transfer-print-page .print-table--admin-sale td:nth-child(4),
    .transfer-print-page .print-table--admin-sale th:nth-child(5),
    .transfer-print-page .print-table--admin-sale td:nth-child(5) {
        width: 16%;
    }

    .transfer-print-total {
        font-size: 12px;
        overflow-wrap: normal;
        white-space: nowrap;
    }

    .admin-sale-print-totals {
        font-size: 12px;
        overflow-wrap: anywhere;
    }
}

@media (min-width: 560px) {
    .page-heading__actions {
        grid-template-columns: auto auto;
        justify-content: start;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .deliveries-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deliveries-summary .stat-card {
        min-width: 0;
        padding: 15px;
    }

    .deliveries-summary .stat-card__top {
        align-items: flex-start;
        font-size: 12px;
    }

    .deliveries-summary .stat-card__value {
        font-size: clamp(20px, 6vw, 25px);
    }
}

@media (max-width: 380px) {
    .deliveries-summary {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .sidebar {
        width: 72px;
        padding-inline: 10px;
        transform: translateX(0);
    }

    .sidebar__brand {
        justify-content: center;
        padding-inline: 0;
    }

    .brand__mark {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .brand__name,
    .sidebar__close,
    .nav-link > span:last-child,
    .sidebar__label,
    .sidebar__profile-data,
    .sidebar-logout-form {
        display: none;
    }

    .sidebar__nav {
        overflow-y: auto;
    }

    .nav-link {
        justify-content: center;
        padding: 0;
    }

    .nav-link.is-active::before {
        left: -10px;
    }

    .nav-link__icon {
        font-size: 19px;
    }

    .sidebar__profile {
        justify-content: center;
        padding-inline: 0;
    }

    .sidebar__profile .avatar {
        width: 32px;
        height: 32px;
    }

    .app-main {
        margin-left: 72px;
    }

    .menu-toggle {
        display: none;
    }

    .breadcrumb,
    .branch-selector {
        display: flex;
    }

    .user-dropdown {
        display: block;
    }

    .user-dropdown .user-menu {
        display: flex;
    }

    .topbar {
        min-height: 64px;
        padding: 12px 24px;
    }

    .page-content {
        padding: 32px 24px 48px;
    }

    .page-heading {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .page-heading--compact {
        margin-top: -16px;
    }

    .page-heading__actions {
        justify-content: end;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    }

    .panel--wide {
        grid-column: 1 / 2;
    }

    .panel--activity {
        grid-column: 2 / 3;
        grid-row: 2;
    }

    .portfolio-chart {
        min-height: 205px;
    }
}

@media (min-width: 1100px) {
    .sidebar {
        width: var(--sidebar-width);
        padding: 22px 14px 16px;
    }

    .sidebar__brand {
        justify-content: space-between;
        padding-inline: 6px;
    }

    .brand__mark {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }

    .brand__name,
    .nav-link > span:last-child,
    .sidebar__label,
    .sidebar__profile-data,
    .sidebar-logout-form {
        display: initial;
    }

    .sidebar__close {
        display: none;
    }

    .nav-link {
        justify-content: flex-start;
        padding: 0 12px;
    }

    .nav-link.is-active::before {
        left: -14px;
    }

    .sidebar__profile {
        justify-content: flex-start;
        padding-inline: 6px;
    }

    .sidebar__profile .avatar {
        width: 36px;
        height: 36px;
    }

    .app-main {
        margin-left: var(--sidebar-width);
    }

    .page-content {
        padding: 36px 32px 56px;
    }

    .page-heading--compact {
        margin-top: -20px;
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr);
        gap: 24px;
    }

    .panel {
        padding: 24px;
    }

    .table-wrap {
        margin-inline: -24px;
        padding-inline: 24px;
    }
}

@media (min-width: 1280px) {
    .income-entry {
        grid-template-columns: minmax(360px, .4fr) minmax(520px, .6fr);
    }

    .income-entry__right {
        height: min(720px, calc(100vh - 150px));
        min-height: 560px;
    }

    .income-entry__right .cart-list {
        flex: 1 1 auto;
        max-height: none;
    }
}

@media (min-width: 1280px) and (max-width: 1439px) {
    .income-entry__right .cart-row {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--canvas);
    }

    .income-entry__right .cart-row--head {
        display: none;
    }

    .income-entry__right .cart-row > * {
        display: grid;
        grid-template-columns: 128px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }

    .income-entry__right .cart-row > *::before {
        color: var(--ink-950);
        font-weight: 800;
        content: attr(data-label);
    }

    .income-entry__right .cart-row .icon-button {
        width: 100%;
        grid-template-columns: 1fr;
        border-color: var(--line);
        background: var(--surface);
    }

    .income-entry__right .admin-sale-cart-row .admin-sale-bonification-button {
        grid-column: 2;
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .income-entry__right .transfer-cart-row .transfer-bonification-button {
        grid-column: 2;
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .income-entry__right .admin-sale-cart-readonly,
    .income-entry__right .admin-sale-cart-subtotal {
        display: flex !important;
        min-width: 0;
        gap: 10px;
    }

    .income-entry__right .admin-sale-cart-readonly::before,
    .income-entry__right .admin-sale-cart-subtotal::before {
        flex: 0 0 128px;
        text-align: left;
    }

    .income-entry__right .cart-row .icon-button::before {
        display: none;
    }

    .income-entry__right .transfer-cart-row {
        grid-template-columns: minmax(86px, 96px) minmax(200px, 1fr) minmax(124px, 136px) minmax(146px, 160px) 34px;
        column-gap: 14px;
        padding: 10px 0;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        background: transparent;
    }

    .income-entry__right .transfer-cart-row--head,
    .income-entry__right .transfer-cart-row.cart-row--head {
        display: grid;
    }

    .income-entry__right .transfer-cart-row > * {
        display: block;
    }

    .income-entry__right .transfer-cart-row > *::before,
    .income-entry__right .transfer-cart-row .icon-button::before {
        display: none;
    }

    .income-entry__right .transfer-cart-row .icon-button {
        width: 30px;
        border-color: var(--line);
        background: var(--surface);
    }
}

@media (min-width: 1440px) {
    .income-entry__right {
        padding-inline: 12px;
    }
}

@media (max-width: 767px) {
    .topbar__actions {
        margin-left: auto;
    }

    .notification-button {
        display: none;
    }

    .panel-heading,
    .panel__header {
        display: grid;
    }

    .choice-columns,
    .form-grid,
    .permission-row,
    .catalog-filters,
    .detail-grid,
    .product-picker,
    .income-entry {
        grid-template-columns: 1fr;
    }

    .distributor-customers-list .catalog-filters--compact {
        grid-template-columns: 1fr;
    }

    .customer-filter-range {
        grid-template-columns: 1fr;
    }

    .customer-location-detail {
        grid-template-columns: 1fr;
    }

    .distributor-customers-list .table-wrap {
        margin-inline: 0;
        padding-inline: 0;
        overflow-x: visible;
    }

    .distributor-customers-list .table-wrap table,
    .distributor-customers-list .table-wrap thead,
    .distributor-customers-list .table-wrap tbody,
    .distributor-customers-list .table-wrap tr,
    .distributor-customers-list .table-wrap th,
    .distributor-customers-list .table-wrap td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .distributor-customers-list .table-wrap table {
        min-width: 0;
    }

    .distributor-customers-list .table-wrap thead {
        display: none;
    }

    .distributor-customers-list .table-wrap tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .distributor-customers-list .table-wrap td {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border: 0;
    }

    .distributor-customers-list .table-wrap td::before {
        min-width: 0;
        color: var(--ink-950);
        font-weight: 800;
        content: attr(data-label);
        overflow-wrap: anywhere;
    }

    .distributor-customers-list .table-wrap th:nth-child(1),
    .distributor-customers-list .table-wrap td:nth-child(1),
    .distributor-customers-list .table-wrap th:nth-child(3),
    .distributor-customers-list .table-wrap td:nth-child(3),
    .distributor-customers-list .table-wrap th:nth-child(5),
    .distributor-customers-list .table-wrap td:nth-child(5),
    .distributor-customers-list .table-wrap th:last-child,
    .distributor-customers-list .table-wrap td:last-child {
        width: 100%;
        white-space: normal;
    }

    .distributor-customers-list .table-wrap td[data-label="Acciones"] {
        align-items: start;
    }

    .distributor-customers-list .table-wrap td[data-label="Acciones"]::before {
        padding-top: 7px;
    }

    .distributor-customers-list .table-actions {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
        gap: 7px;
    }

    .distributor-customers-list .table-action {
        max-width: 100%;
        flex: 0 1 auto;
        white-space: nowrap;
    }

    .customers-pagination {
        justify-content: center;
    }

    .customers-pagination .btn {
        width: auto;
        min-width: 96px;
    }

    .customers-pagination__pages {
        flex: 1 1 120px;
    }

    .cart-row {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--canvas);
    }

    .income-entry__right .cart-list {
        max-height: 360px;
    }

    .cart-row--head {
        display: none;
    }

    .cart-row > * {
        display: grid;
        grid-template-columns: 118px 1fr;
        gap: 10px;
        align-items: center;
    }

    .cart-row > *::before {
        color: var(--ink-950);
        font-weight: 800;
        content: attr(data-label);
    }

    .cart-row .icon-button {
        width: 100%;
        grid-template-columns: 1fr;
        border-color: var(--line);
        background: var(--surface);
    }

    .cart-row .admin-sale-bonification-button {
        grid-column: 2;
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .cart-row .transfer-bonification-button {
        grid-column: 2;
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .cart-row .admin-sale-cart-readonly,
    .cart-row .admin-sale-cart-subtotal {
        display: flex !important;
        min-width: 0;
        gap: 10px;
    }

    .cart-row .admin-sale-cart-readonly::before,
    .cart-row .admin-sale-cart-subtotal::before {
        flex: 0 0 118px;
        text-align: left;
    }

    .cart-row .icon-button::before {
        display: none;
    }

    .transfer-cart-row {
        grid-template-columns: 1fr;
        column-gap: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .transfer-cart-row > * {
        min-width: 0;
        grid-template-columns: minmax(104px, 36%) minmax(0, 1fr);
    }

    .transfer-cart-row > *::before {
        min-width: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .transfer-cart-row > div {
        align-items: start;
    }

    .transfer-cart-list .transfer-cart-row strong.numeric {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-width: 0;
        padding-right: 0;
        text-align: right;
    }

    .transfer-cart-list .transfer-cart-row strong.numeric::before {
        flex: 0 1 auto;
        text-align: left;
    }

    .transfer-cart-row label[data-label="Cantidad"] {
        min-width: 0;
    }

    .transfer-cart-row label[data-label="Cantidad"] input {
        min-width: 0;
    }

    .transfer-cart-row .transfer-cart-field,
    .transfer-cart-row .transfer-cart-readonly,
    .transfer-cart-row .transfer-cart-subtotal,
    .transfer-cart-row .transfer-cart-actions {
        min-height: 38px;
    }

    .transfer-cart-row .transfer-cart-readonly,
    .transfer-cart-row .transfer-cart-subtotal {
        justify-content: space-between;
    }

    .transfer-cart-row .transfer-cart-readonly::before,
    .transfer-cart-row .transfer-cart-subtotal::before {
        flex: 0 0 36%;
        text-align: left;
    }

    .modal-card {
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

    .modal-footer {
        display: grid;
    }
}

@media (max-width: 640px) {
    .auth-page,
    .app-main {
        padding: 0;
    }

    .panel,
    .login-card,
    .auth-card {
        padding: 18px;
    }

    .quick-actions,
    .form-actions,
    .search-row {
        display: grid;
    }

    .store-other-product-search-row {
        grid-template-columns: 1fr;
    }

    .btn,
    .button,
    .permission-filter {
        width: 100%;
        max-width: none;
    }

    .page-heading__actions {
        min-width: 0;
    }

    .portfolio-chart {
        align-items: flex-start;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap th,
    .table-wrap td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .table-wrap td {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 10px;
        padding: 8px 0;
        border: 0;
    }

    .table-wrap td::before {
        color: var(--ink-950);
        font-weight: 800;
        content: attr(data-label);
    }

    .distributor-receivables-list .table-wrap table {
        min-width: 0;
    }

    .distributor-collections-report .table-wrap table {
        min-width: 0;
    }

    .distributor-product-sales-report .table-wrap table {
        min-width: 0;
    }

    .store-cash-closings-report .table-wrap table {
        min-width: 0;
    }

    .store-qr-payments-report .table-wrap table {
        min-width: 0;
    }

    .distributor-sales-list .table-wrap td[data-label="Total"] {
        text-align: left;
    }

    .distributor-sales-list .table-wrap td[data-label="Total"]::before {
        text-align: left;
    }

    .distributor-receivables-list .table-wrap td[data-label="Total"],
    .distributor-receivables-list .table-wrap td[data-label="Cobrado"],
    .distributor-receivables-list .table-wrap td[data-label="Saldo"] {
        text-align: left;
    }

    .distributor-collections-report .table-wrap td[data-label="Monto"] {
        text-align: left;
    }

    .distributor-product-sales-report .table-wrap td[data-label="Cantidad vendida"],
    .distributor-product-sales-report .table-wrap td[data-label="Subtotal"] {
        text-align: left;
    }

    .store-cash-closings-report .table-wrap td[data-label="N° ventas"] {
        text-align: center;
    }

    .store-cash-closings-report .table-wrap td[data-label="Total ventas"],
    .store-cash-closings-report .table-wrap td[data-label="Efectivo"],
    .store-cash-closings-report .table-wrap td[data-label="QR"],
    .store-cash-closings-report .table-wrap td[data-label="Efectivo contado"],
    .store-cash-closings-report .table-wrap td[data-label="Diferencia"] {
        text-align: right;
    }

    .store-qr-payments-report .table-wrap td[data-label="Monto QR"] {
        text-align: right;
    }

    .store-qr-payments-report .table-wrap td[data-label="Referencia"] {
        align-items: start;
    }

    .store-qr-payments-report .qr-payment-reference {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .distributor-collections-report .table-wrap td span {
        grid-column: 2;
    }

    .distributor-receivables-list .table-wrap td[data-label="Total"]::before,
    .distributor-receivables-list .table-wrap td[data-label="Cobrado"]::before,
    .distributor-receivables-list .table-wrap td[data-label="Saldo"]::before {
        text-align: left;
    }

    .distributor-collections-report .table-wrap td[data-label="Monto"]::before {
        text-align: left;
    }

    .distributor-product-sales-report .table-wrap td[data-label="Cantidad vendida"]::before,
    .distributor-product-sales-report .table-wrap td[data-label="Subtotal"]::before {
        text-align: left;
    }

    .store-cash-closings-report .table-wrap td[data-label="N° ventas"]::before,
    .store-cash-closings-report .table-wrap td[data-label="Total ventas"]::before,
    .store-cash-closings-report .table-wrap td[data-label="Efectivo"]::before,
    .store-cash-closings-report .table-wrap td[data-label="QR"]::before,
    .store-cash-closings-report .table-wrap td[data-label="Efectivo contado"]::before,
    .store-cash-closings-report .table-wrap td[data-label="Diferencia"]::before {
        text-align: left;
    }

    .store-qr-payments-report .table-wrap td[data-label="Monto QR"]::before {
        text-align: left;
    }

    .segmented {
        grid-template-columns: 1fr;
    }

    .segmented span {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .segmented label:first-child span {
        border-top: 0;
    }
}

@media (max-width: 420px) {
    .login-shell {
        padding: 16px;
    }

    .login-card,
    .auth-card {
        width: calc(100vw - 32px);
        padding: 22px;
    }

    .portfolio-chart {
        gap: 14px;
    }

    .portfolio-chart__ring {
        width: 124px;
        height: 124px;
    }

    .portfolio-chart__ring::before {
        width: 96px;
        height: 96px;
    }

    .chart-legend {
        gap: 8px;
    }
}

.distributor-sale-form { display: grid; gap: 14px; padding-bottom: 94px; }
.sale-flow-panel { display: grid; gap: 16px; }
.sale-search-control { position: relative; }
.sale-results { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; left: 0; display: grid; gap: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-elevated); -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.sale-results button { display: grid; gap: 3px; width: 100%; min-height: 58px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; background: var(--canvas); color: var(--ink-950); text-align: left; }
.sale-results button.is-active, .sale-results button:hover { border-color: var(--primary-600); background: var(--primary-100); }
.sale-results strong, .sale-results span, .sale-customer-selected strong, .sale-customer-selected small { min-width: 0; overflow-wrap: anywhere; }
.sale-results span, .sale-results small, .sale-customer-selected small { color: var(--ink-500); font-size: 12px; font-weight: 700; }
.sale-customer-selected { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--primary-300); border-radius: var(--radius-sm); background: var(--primary-100); }
.sale-customer-selected div { display: grid; gap: 3px; min-width: 0; }
.sale-add-customer { justify-self: start; min-height: 42px; }
.sale-cart { display: grid; align-content: start; grid-auto-rows: max-content; gap: 10px; }
.sale-cart-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); }
.sale-cart-card > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.sale-cart-card header div { display: grid; gap: 3px; min-width: 0; }
.sale-cart-card header strong, .sale-cart-card header small { overflow-wrap: anywhere; }
.sale-cart-card header small { color: var(--ink-500); font-size: 12px; font-weight: 700; }
.sale-cart-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sale-cart-fields label, .sale-cart-fields > div { display: grid; gap: 5px; color: var(--ink-600); font-size: 12px; font-weight: 800; }
.sale-cart-fields input { width: 100%; min-height: 44px; }
.sale-cart-fields > div { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); }
.sale-cart-fields > div strong { color: var(--primary-700); font-size: 16px; font-variant-numeric: tabular-nums; }
.sale-condition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.sale-condition legend { width: 100%; margin-bottom: 8px; color: var(--ink-600); font-size: 12px; font-weight: 800; }
.sale-condition label { position: relative; min-width: 0; }
.sale-condition input { position: absolute; opacity: 0; }
.sale-condition span { display: grid; min-height: 70px; align-content: center; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); color: var(--ink-950); font-weight: 850; }
.sale-condition small { color: var(--ink-500); font-size: 11px; font-weight: 700; }
.sale-condition input:checked + span { border-color: var(--primary-600); background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-600); }
.sale-checkout { position: sticky; z-index: 20; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 -8px 24px rgba(28, 45, 72, .12); }
.sale-checkout div { display: grid; gap: 1px; }
.sale-checkout span, .sale-checkout small { color: var(--ink-500); font-size: 11px; font-weight: 800; }
.sale-checkout strong { color: var(--primary-700); font-size: 20px; font-variant-numeric: tabular-nums; }
.sale-checkout .button { min-height: 50px; white-space: nowrap; }
.sales-list { display: grid; gap: 8px; }
.sale-list-card { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); }
.sale-list-card__main, .sale-list-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sale-list-card__main { display: grid; }
.sale-list-card__main span { color: var(--ink-500); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.sale-list-card__meta { justify-content: flex-start; }
.sale-list-card__meta strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.distributor-sales-summary { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 18px; }
.customer-master-filters { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.customer-master-table td { vertical-align: top; }
.customer-master-table td[data-label="Direccion"] { min-width: 220px; }
.customer-master-table td[data-label="Direccion"] .table-action { display: block; margin-top: 7px; }
.customer-master-table time,
.customer-master-seller { display: grid; gap: 2px; }
.customer-master-table time span,
.customer-master-seller span { color: var(--ink-500); font-size: 12px; font-weight: 700; }
.sales-summary-card { display: grid; align-content: start; gap: 3px; min-width: 0; min-height: 92px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); }
.sales-summary-card__label { color: var(--ink-500); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sales-summary-card__value { overflow: hidden; color: var(--ink-950); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.sales-summary-card small { color: var(--ink-500); font-size: 11px; font-weight: 700; }
.sales-summary-card__breakdown { display: grid; gap: 3px; padding-top: 5px; border-top: 1px solid var(--line); }
.sales-summary-card__breakdown > span { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.sales-summary-card__breakdown span span { min-width: 0; color: var(--ink-500); font-size: 11px; font-weight: 750; }
.sales-summary-card__breakdown strong { min-width: 0; color: var(--ink-950); font-size: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.sales-summary-card--credit .sales-summary-card__value { color: var(--warning-700); }
.sales-summary-card--cash .sales-summary-card__value { color: var(--success-700); }
.sales-summary-card--total { grid-column: 1 / -1; }
.sales-summary-card--total .sales-summary-card__value { color: var(--primary-700); font-size: 24px; }
.sales-summary-card--differences .sales-summary-card__breakdown { border-top: 0; padding-top: 3px; }
.cash-closing-detail-grid { margin-bottom: 18px; }
.cash-closing-modal { overflow-x: hidden; }
.cash-closing-section { display: grid; gap: 12px; margin-top: 18px; }
.cash-closing-section h3 { margin: 0; color: var(--ink-950); font-size: 14px; }
.cash-closing-denominations { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cash-closing-denomination-group { display: grid; gap: 0; min-width: 0; }
.cash-closing-denomination-group h4 { margin: 0; padding: 0 0 9px; border-bottom: 1px solid var(--line); color: var(--ink-500); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.cash-closing-denomination-line { display: grid; grid-template-columns: minmax(78px, 1fr) 16px minmax(34px, auto) 16px minmax(86px, auto); gap: 8px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); color: var(--ink-700); font-size: 13px; }
.cash-closing-denomination-line b,
.cash-closing-denomination-line em { color: var(--ink-500); font-style: normal; text-align: center; }
.cash-closing-denomination-line strong { color: var(--ink-950); font-variant-numeric: tabular-nums; text-align: right; }
.cash-closing-counted-total { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0; color: var(--ink-500); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.cash-closing-counted-total strong { color: var(--ink-950); font-size: 18px; font-variant-numeric: tabular-nums; text-transform: none; }
.cash-closing-sales-note { margin-top: -2px; font-size: 12px; }
.status-contado { background: #DCFCE7; color: #166534; }
.status-credito { background: #FEF3C7; color: #92400E; }
.sale-detail-lines { display: grid; gap: 8px; margin-top: 18px; }
.sale-detail-lines > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sale-detail-lines span { color: var(--ink-500); font-size: 12px; }
.sale-detail-lines b { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 12px; }
.sale-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sale-edit-form { display: grid; gap: 16px; }
.modal-subtitle { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; font-weight: 700; }
.validation-modal__icon--success { background: #DCFCE7; color: #166534; }
.validation-modal__icon--danger { background: var(--danger-100); color: var(--danger-700); }

.customer-visit-form { display: grid; max-width: 760px; gap: 14px; margin: 0 auto; }
.customer-visit-submit { min-height: 52px; }
.customer-visit-results { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.customer-visit-results legend { margin-bottom: 8px; color: var(--ink-600); font-size: 12px; font-weight: 800; }
.customer-visit-results label { position: relative; }
.customer-visit-results input { position: absolute; opacity: 0; }
.customer-visit-results span { display: block; min-height: 50px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); color: var(--ink-950); font-weight: 800; }
.customer-visit-results input:checked + span { border-color: var(--primary-600); background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-600); }
.punteos-table-wrap td small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 11px; font-weight: 700; }
.punteo-detail-grid { display: grid; gap: 10px; margin: 0; }
.punteo-detail-grid > div { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.punteo-detail-grid dt { color: var(--ink-500); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.punteo-detail-grid dd { margin: 0; color: var(--ink-950); overflow-wrap: anywhere; }

@media (min-width: 768px) {
    .distributor-sales-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
    .customer-master-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .distributor-customers-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .product-sales-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cash-closings-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .store-qr-payments-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .cash-closing-denominations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-summary-card { min-height: 100px; }
    .sales-summary-card--total { grid-column: auto; }
}

@media (max-width: 520px) {
    .distributor-receivables-list .distributor-sales-summary {
        grid-template-columns: 1fr;
    }

    .distributor-receivables-list .sales-summary-card--total {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .punteos-table-wrap { margin-inline: 0; padding-inline: 0; overflow-x: visible; }
    .punteos-table-wrap table, .punteos-table-wrap thead, .punteos-table-wrap tbody, .punteos-table-wrap tr, .punteos-table-wrap th, .punteos-table-wrap td { display: block; width: 100%; min-width: 0; }
    .punteos-table-wrap thead { display: none; }
    .punteos-table-wrap tr { display: grid; gap: 7px; padding: 13px; border-bottom: 1px solid var(--line); }
    .punteos-table-wrap td { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 8px; padding: 0; border: 0; }
    .punteos-table-wrap td::before { content: attr(data-label); color: var(--ink-500); font-size: 11px; font-weight: 800; }
    .punteos-table-wrap td:last-child { display: block; padding-top: 4px; }
    .punteos-table-wrap td:last-child::before { display: none; }
}

.distributor-collections {
    display: grid;
    max-width: 760px;
    gap: 12px;
    margin: 0 auto;
}

.collections-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
    gap: 10px;
}

.collections-summary article,
.collection-client-card,
.collection-debt-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.collections-summary article {
    display: grid;
    min-width: 0;
    min-height: 86px;
    align-content: center;
    gap: 5px;
    padding: 14px;
    overflow: hidden;
}

.collections-summary span,
.collection-client-card span,
.collection-debt-card span,
.collection-payment-data dt,
.collection-history > span,
.collection-success-summary span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.collections-summary strong {
    min-width: 0;
    color: var(--primary-700);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.collections-search {
    position: sticky;
    z-index: 5;
    top: 70px;
    padding: 10px 0;
    background: var(--canvas);
}

.collections-search .field {
    gap: 6px;
}

.collections-search input {
    min-height: 48px;
    background: var(--surface);
}

.collections-list,
.collection-debt-list,
.collection-payment-form,
.collection-payment-data,
.collection-success-summary {
    display: grid;
    gap: 10px;
}

.collection-client-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.collection-client-card__head,
.collection-client-card__footer,
.collection-debt-card header,
.collection-debt-card dl div,
.collection-payment-data div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.collection-client-card__head > div {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
}

.collection-client-card__head strong,
.collection-debt-card header strong,
.collection-payment-data dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

.collection-client-card__balance {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    border-block: 1px solid var(--line);
}

.collection-client-card__balance strong,
.collection-client-total strong,
.collection-success-summary strong {
    color: var(--primary-700);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.collection-client-card__footer {
    font-size: 12px;
    font-weight: 750;
}

.modal-card--collections {
    width: min(100%, 520px);
}

/* Modal de abonos de transferencias: mismo lenguaje visual de cobranzas. */
.transfer-payment-modal__number {
    margin: 5px 0 0;
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.modal-shell.transfer-payment-secondary { z-index: 60; }
[data-modal="transfer-payment-success"] { z-index: 70; }

.transfer-payment-modal__body,
.transfer-payment-section,
.transfer-payment-history {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.transfer-payment-modal h3 {
    margin: 0;
    font-size: 15px;
}

.transfer-payment-summary {
    margin: 0;
}

.transfer-payment-summary__values {
    display: grid;
    gap: 10px;
    margin: 0;
}

.transfer-payment-summary__values > div,
.transfer-payment-item__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.transfer-payment-summary__values dt {
    color: var(--ink-500);
    font-size: 13px;
    font-weight: 750;
}

.transfer-payment-summary__values dd {
    min-width: 0;
    margin: 0;
    color: var(--primary-700);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
    overflow-wrap: anywhere;
}

.transfer-payment-item {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}


.transfer-payment-item p,
.transfer-payment-history__empty {
    margin: 0;
    color: var(--ink-500);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.transfer-payment-item__heading strong {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.transfer-payment-item__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.transfer-payment-modal .collection-payment-form {
    gap: 14px;
}

.transfer-payment-modal .collection-payment-form > button {
    width: 100%;
}

.transfer-payment-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-100);
    color: var(--primary-700);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.transfer-payment-message.is-success {
    background: var(--success-100);
    color: var(--success-700);
}

@media (max-width: 400px) {
    .transfer-payment-modal { padding: 16px; }
    .transfer-payment-summary__values > div { gap: 8px; }
    .transfer-payment-item__actions button { min-height: 40px; }
}

.collection-client-total {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-sm);
    background: var(--primary-100);
}

.collection-debt-card {
    display: grid;
    gap: 11px;
    padding: 13px;
}

.collection-debt-card dl {
    display: grid;
    gap: 7px;
    margin: 0;
}

.collection-debt-card dt,
.collection-debt-card dd,
.collection-payment-data dt,
.collection-payment-data dd {
    margin: 0;
}

.collection-debt-card dd,
.collection-payment-data dd {
    color: var(--ink-950);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.collection-history {
    display: grid;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.collection-history ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-history li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.collection-history li strong {
    color: var(--ink-950);
    font-variant-numeric: tabular-nums;
}

.collection-history__payment {
    flex-wrap: wrap;
}

.collection-history__payment > span {
    flex: 1 1 160px;
}

[data-receivable-detail-body] .collection-history__payment:has(> .status-anulado) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 4px 8px;
}

[data-receivable-detail-body] .collection-history__payment > .status-anulado {
    width: fit-content;
    justify-self: end;
    white-space: nowrap;
}

[data-receivable-detail-body] .collection-history__payment:has(> .status-anulado) > small {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}

.collection-history__payment [data-open-payment-correction] {
    margin-left: auto;
}

@media (max-width: 520px) {
    .collection-history__payment [data-open-payment-correction] {
        width: 100%;
        margin-left: 0;
    }
}

.collection-history__empty {
    color: var(--ink-500);
    font-weight: 650;
}

.collection-payment-data {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.collection-payment-form input[name="monto"] {
    min-height: 50px;
    color: var(--primary-700);
    font-size: 20px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.collection-payment-form select[name="metodo_pago"] {
    min-height: 48px;
    font-weight: 800;
}

.collection-success-modal {
    text-align: left;
}

.collection-success-modal__icon {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--success-100);
    color: var(--success-700);
    font-size: 24px;
    font-weight: 900;
}

.collection-success-summary {
    gap: 5px;
    padding: 6px 0 0 54px;
}

.distributor-kardex {
    display: grid;
    max-width: 100%;
    gap: 14px;
    overflow-x: hidden;
}

.kardex-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(230px, .8fr) minmax(150px, .45fr) minmax(150px, .45fr) auto;
    max-width: 100%;
    gap: 10px;
    align-items: end;
}

.kardex-product-field {
    min-width: 0;
}

.kardex-product-field select {
    width: 100%;
    min-height: 44px;
}

.kardex-quick-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.kardex-quick-filter legend {
    grid-column: 1 / -1;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
}

.kardex-quick-filter label {
    min-width: 0;
}

.kardex-quick-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kardex-quick-filter span {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--canvas);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}

.kardex-quick-filter input:checked + span {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
}

.kardex-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.kardex-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.kardex-summary article {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.kardex-summary span {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.kardex-summary strong {
    min-width: 0;
    color: var(--primary-700);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.kardex-list {
    display: none;
    gap: 8px;
}

.kardex-card {
    display: grid;
    width: 100%;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: inherit;
    font: inherit;
    text-align: left;
    box-shadow: var(--shadow-card);
}

.kardex-card__date,
.kardex-card small,
.kardex-card__document {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.kardex-card strong {
    min-width: 0;
    color: var(--ink-950);
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.kardex-card .status-badge {
    margin-top: 5px;
}

.kardex-card__numbers {
    display: grid;
    gap: 5px;
    margin-top: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.kardex-card__numbers span,
.kardex-detail div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kardex-card__numbers span {
    color: var(--ink-500);
    font-size: 13px;
    font-weight: 800;
}

.kardex-card__numbers strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.kardex-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}

.kardex-amount--in {
    color: var(--success-700) !important;
}

.kardex-amount--out {
    color: var(--warning-700) !important;
}

.kardex-table-wrap tr[data-kardex-detail] {
    cursor: pointer;
    transition: background-color 160ms ease-out;
}

.kardex-table-wrap tr[data-kardex-detail]:hover td {
    background: #F2F7FF;
}

.kardex-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.kardex-pagination span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
}

.kardex-detail {
    display: grid;
    gap: 8px;
    margin: 0;
}

.kardex-detail div {
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.kardex-detail dt,
.kardex-detail dd {
    margin: 0;
}

.kardex-detail dt {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.kardex-detail dd {
    min-width: 0;
    color: var(--ink-950);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.store-kardex-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.store-kardex-actions .button {
    white-space: nowrap;
}

@media (min-width: 768px) {
    .distributor-sale-form { grid-template-columns: minmax(0, 1fr) minmax(290px, .55fr); align-items: start; padding-bottom: 0; }
    .distributor-sale-form .sale-flow-panel:nth-child(1), .distributor-sale-form .sale-flow-panel:nth-child(2) { grid-column: 1; }
    .distributor-sale-form .sale-flow-panel:nth-child(3), .sale-checkout { grid-column: 2; }
    .distributor-sale-form .sale-flow-panel:nth-child(3) { grid-row: 1; }
    .sale-checkout { grid-row: 2; }
}

@media (max-width: 640px) {
    .sale-checkout .button {
        width: auto;
        max-width: 58%;
    }

    .collection-client-card__head {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }
}

.distributor-sale-form--compact {
    display: block;
    max-width: 1040px;
    margin: 0 auto;
    --sale-checkout-height: 150px;
    --sale-cart-height: calc(100dvh - 300px);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.distributor-sale-form--compact .sale-products-panel {
    gap: 10px;
}

.sale-catalog-loading {
    justify-self: start;
}

.sale-cart-product {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.sale-cart-product > div {
    display: grid;
    min-width: 0;
}

.sale-cart-product-actions {
    display: flex !important;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
}

.sale-cart-product strong {
    overflow: hidden;
    color: var(--ink-950);
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-cart-product small {
    overflow: hidden;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-cart-product .icon-button {
    flex: 0 0 36px;
    min-height: 36px;
}

.sale-cart-product .admin-sale-bonification-button {
    color: var(--primary-600);
}

.sale-cart-product .admin-sale-bonification-button svg,
.sale-cart-bonus-gift svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sale-cart-card--bonus {
    border-color: color-mix(in srgb, var(--primary-600) 38%, var(--line));
    background: color-mix(in srgb, var(--primary-100) 55%, var(--canvas));
}

.sale-cart-card--bonus .sale-cart-product strong {
    color: var(--primary-700);
    white-space: normal;
}

.sale-cart-bonus-gift {
    display: inline-flex;
    margin-right: 4px;
    color: var(--primary-600);
    vertical-align: text-bottom;
}

.sale-cart-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: end;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.sale-cart-fields label,
.sale-cart-quantity,
.sale-cart-price,
.sale-cart-subtotal {
    display: grid;
    gap: 3px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 800;
}

.sale-cart-fields > label,
.sale-cart-fields--readonly > .sale-cart-quantity,
.sale-cart-price {
    font-size: 12px;
}

.sale-cart-fields > .sale-cart-quantity,
.sale-cart-fields > .sale-cart-price,
.sale-cart-fields > .sale-cart-subtotal {
    display: grid;
    grid-column: auto;
    grid-template-columns: none;
    align-items: normal;
    padding-top: 0;
    border-top: 0;
}

.sale-cart-fields > label {
    grid-column: auto;
}

.sale-cart-fields > .sale-cart-quantity,
.sale-cart-fields > .sale-cart-price {
    grid-column: auto;
}

.sale-cart-fields > .sale-cart-subtotal {
    grid-column: auto;
    text-align: right;
}

/* Las líneas bonificadas son de lectura: sus tres valores deben conservar
 * las mismas columnas del detalle, sin heredar el resumen de los <div>. */
.sale-cart-fields--readonly {
    align-items: start;
}

.sale-cart-fields--readonly .sale-cart-quantity,
.sale-cart-fields--readonly .sale-cart-price,
.sale-cart-fields--readonly .sale-cart-subtotal {
    align-content: start;
}

.sale-cart-fields--readonly .sale-cart-quantity > strong,
.sale-cart-fields--readonly .sale-cart-price > strong,
.sale-cart-fields--readonly .sale-cart-subtotal > strong {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.sale-cart-fields--readonly .sale-cart-quantity > strong,
.sale-cart-fields--readonly .sale-cart-price > strong {
    justify-content: flex-start;
    text-align: left;
}

.sale-cart-fields--readonly .sale-cart-subtotal > strong {
    justify-content: flex-end;
    text-align: right;
}

.sale-cart-fields label input,
.sale-cart-price input {
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 5px 7px;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.sale-cart-fields label input:focus,
.sale-cart-price input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: none;
}

.sale-cart-price strong,
.sale-cart-subtotal strong {
    overflow: hidden;
    min-height: 36px;
    color: var(--ink-950);
    font-size: 13px;
    line-height: 36px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-cart-subtotal {
    text-align: right;
}

.sale-cart-subtotal strong {
    display: block;
    width: 100%;
    color: var(--primary-700);
}

/* Modal de aumento: reutiliza la tarjeta de Nueva venta, con cantidad compacta. */
.sale-increase-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 0;
}

.sale-increase-form .sale-increase-cart-fields {
    grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1.1fr);
}

.sale-increase-form .sale-increase-quantity {
    width: 86px;
    max-width: 100%;
}

.sale-cart-card {
    gap: 7px;
    padding: 9px 10px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.sale-checkout--compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
}

.sale-total-summary {
    min-width: 0;
}

.sale-checkout-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sale-checkout-fields > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sale-checkout-fields > div > span {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 800;
}

.sale-footer-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
}

.sale-footer-control > button:first-child {
    overflow: hidden;
    min-width: 0;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--canvas);
    color: var(--ink-950);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-footer-control .icon-button {
    width: 38px;
    min-height: 38px;
}

.sale-checkout--compact > .button {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    min-height: 54px;
}

.sale-modal-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.sale-modal-search input,
.sale-modal-search select {
    min-width: 0;
    min-height: 44px;
}

.sale-modal-search .icon-button {
    width: 44px;
    min-height: 44px;
}

.sale-picker-list {
    display: grid;
    max-height: min(48vh, 390px);
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 12px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.sale-picker-list button,
.sale-payment-options button {
    display: grid;
    min-height: 56px;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--canvas);
    color: var(--ink-950);
    text-align: left;
}

.sale-picker-list button:hover,
.sale-payment-options button:hover {
    border-color: var(--primary-600);
    background: var(--primary-100);
}

.sale-picker-list span,
.sale-payment-options span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.sale-payment-options {
    display: grid;
    gap: 10px;
}

@media (max-width: 767px) {
    .page-content--distributor:has(.distributor-product-sales-report),
    .page-content:has(.store-product-sales-report) {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content--distributor .distributor-product-sales-report,
    .page-content .store-product-sales-report {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .product-sales-filters {
        grid-template-columns: 1fr;
    }

    .product-sales-table-wrap {
        display: none;
    }

    .product-sales-cards {
        display: grid;
        gap: 9px;
    }

    .product-sales-card {
        display: grid;
        gap: 10px;
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: var(--shadow-card);
    }

    .product-sales-card header,
    .product-sales-card footer {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        align-items: start;
    }

    .product-sales-card header div {
        display: grid;
        min-width: 0;
    }

    .product-sales-card header strong {
        min-width: 0;
        color: var(--ink-950);
        font-size: 14px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .product-sales-card header span,
    .product-sales-card footer span {
        color: var(--ink-500);
        font-size: 12px;
        font-weight: 800;
    }

    .product-sales-card header b,
    .product-sales-card footer strong {
        color: var(--primary-700);
        font-variant-numeric: tabular-nums;
        text-align: right;
        white-space: nowrap;
    }

    .product-sales-card__prices {
        display: grid;
        gap: 7px;
        padding-top: 9px;
        border-top: 1px solid var(--line);
    }

    .product-sales-card .product-sales-price-line {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
        padding-bottom: 7px;
        border-bottom: 1px solid var(--line);
    }

    .product-sales-card .product-sales-price-line:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .product-sales-card .product-sales-price-line strong {
        text-align: left;
    }

    .distributor-product-sales-report .kardex-pagination,
    .store-product-sales-report .kardex-pagination {
        justify-content: stretch;
    }

    .distributor-product-sales-report .kardex-pagination .btn,
    .store-product-sales-report .kardex-pagination .btn {
        width: auto;
    }

    .page-content--distributor:has(.distributor-kardex) {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-content--distributor .distributor-kardex {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .kardex-filters {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .kardex-quick-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kardex-summary {
        grid-template-columns: 1fr;
    }

    .kardex-list {
        display: grid;
    }

    .kardex-table-wrap {
        display: none;
    }

    .kardex-pagination {
        justify-content: stretch;
    }

    .kardex-pagination .btn {
        width: auto;
    }

    .kardex-pagination span {
        flex: 1 1 auto;
        text-align: center;
    }

    .store-kardex-actions {
        display: grid;
    }

    .page-content:has(.distributor-sale-form--compact) {
        padding-top: 6px;
    }

    .distributor-sale-heading {
        display: none;
    }

    .distributor-sale-heading h1 {
        font-size: 18px;
    }

    .distributor-sale-heading .page-heading__actions {
        position: absolute;
        left: 12px;
    }

    .distributor-sale-form--compact {
        padding-bottom: 12px;
    }

    .distributor-sale-form--compact .sale-products-panel {
        min-height: 0;
        width: calc(100vw - 32px);
        max-width: 100%;
        padding: 10px 12px;
        border-radius: 0;
        box-shadow: none;
    }

    .sale-cart {
        height: var(--sale-cart-height);
        max-height: none;
        align-content: start;
        grid-auto-rows: max-content;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 12px;
        scroll-padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .sale-checkout--compact {
        position: fixed;
        z-index: 50;
        right: 0;
        bottom: 0;
        left: 0;
        margin: 0;
        gap: 6px;
        padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        grid-template-columns: 1fr;
    }

    .sale-checkout--compact > .button {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        max-width: none;
        min-height: 46px;
    }

    .sale-checkout .sale-total-summary {
        display: flex;
        align-items: baseline;
        justify-content: flex-end;
        gap: 6px;
        min-height: 20px;
    }

    .sale-total-summary > span,
    .sale-total-summary > small {
        font-size: 12px;
    }

    .sale-total-summary > strong {
        font-size: 20px;
    }

    .sale-total-summary > small {
        order: -1;
        margin-right: auto;
        white-space: nowrap;
    }

    .sale-checkout-fields {
        gap: 6px;
    }

    .sale-checkout-fields > div {
        gap: 2px;
    }

    .sale-checkout-fields > div > span {
        font-size: 9px;
    }

    .sale-picker-modal .modal-body {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        height: min(66dvh, 520px);
        max-height: calc(100dvh - 160px);
        overflow: hidden;
    }

    .sale-picker-list {
        min-height: 0;
        max-height: none;
        padding-top: 8px;
    }

    .sale-picker-modal .modal-body.sale-payment-options {
        height: auto;
        max-height: none;
        grid-template-rows: none;
        overflow: visible;
    }

    .sale-payment-options {
        align-content: start;
        grid-auto-rows: max-content;
    }

    .sale-payment-options button {
        min-height: 56px;
    }

    .sale-cart-fields {
        width: min(100%, 300px);
        max-width: calc(100vw - 60px);
        align-items: stretch;
        gap: 5px;
    }

    .sale-cart {
        gap: 6px;
    }

    .sale-cart-card {
        gap: 3px;
        max-width: calc(100vw - 56px);
        padding: 5px 8px;
    }

    .sale-cart-card--bonus {
        gap: 5px;
        padding-block: 7px;
    }

    .sale-cart-product {
        position: relative;
        min-height: 28px;
        padding-right: 56px;
    }

    .sale-cart-product-actions {
        position: absolute;
        top: -4px;
        right: 20px;
        display: flex !important;
        gap: 2px;
    }

    .sale-cart-product .icon-button {
        position: static;
    }

    .sale-cart-product strong {
        font-size: 13px;
        line-height: 1.15;
    }

    .sale-cart-product small {
        font-size: 10px;
        line-height: 1.15;
    }

    .sale-cart-fields label,
    .sale-cart-quantity,
    .sale-cart-price,
    .sale-cart-subtotal {
        grid-template-rows: 16px 36px;
        align-content: stretch;
        align-self: stretch;
        gap: 2px;
        font-size: 14px;
        line-height: 1.1;
    }

    .sale-cart-fields label > span,
    .sale-cart-quantity > span,
    .sale-cart-price > span,
    .sale-cart-subtotal > span {
        min-height: 16px;
        font-size: 14px;
        font-weight: 800;
        line-height: 16px;
    }

    .sale-cart-fields label input,
    .sale-cart-price input,
    .sale-cart-price strong,
    .sale-cart-subtotal strong {
        align-self: stretch;
        box-sizing: border-box;
        height: 36px;
        min-height: 36px;
        margin: 0;
        padding: 4px 7px;
        font-size: 14px;
        line-height: 1;
    }

    .sale-cart-fields label input {
        margin-top: 3px;
    }

    .sale-cart-card--bonus .sale-cart-fields {
        width: 100%;
        max-width: 100%;
        grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1.15fr);
        align-items: start;
        gap: 6px;
    }

    .sale-cart-card--bonus .sale-cart-quantity,
    .sale-cart-card--bonus .sale-cart-price,
    .sale-cart-card--bonus .sale-cart-subtotal {
        grid-template-rows: 16px 22px;
        align-content: start;
        align-self: start;
        gap: 2px;
    }

    .sale-cart-card--bonus .sale-cart-quantity > strong,
    .sale-cart-card--bonus .sale-cart-price > strong,
    .sale-cart-card--bonus .sale-cart-subtotal > strong {
        height: 22px;
        min-height: 22px;
        margin: 0;
        padding: 0;
        font-size: 14px;
        line-height: 22px;
    }

    .sale-cart-price strong,
    .sale-cart-subtotal strong {
        display: flex;
        align-items: center;
    }

    .sale-cart-subtotal strong {
        justify-content: flex-end;
        font-size: 14px;
    }

    .sale-results {
        max-height: min(42dvh, 260px);
    }

    .sale-cart-fields > label {
        grid-column: auto;
    }

    .sale-cart-fields > .sale-cart-price {
        grid-column: auto;
    }

    .sale-increase-form .sale-increase-cart-fields {
        grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.1fr);
        width: min(100%, 300px);
    }

    .sale-increase-form .sale-increase-quantity {
        width: 74px;
    }
}

@media (max-width: 430px) {
    .page-content--distributor .distributor-kardex,
    .page-content--distributor .kardex-filters,
    .page-content--distributor .kardex-quick-filter {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .page-content--distributor .kardex-quick-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 374px) {
    .sale-cart-product strong {
        font-size: 12px;
    }

    .sale-cart-fields {
        gap: 5px;
    }

    .sale-cart-fields > label {
        grid-column: auto;
    }

    .sale-cart-fields > .sale-cart-price {
        grid-column: auto;
    }

    .sale-cart-fields label input,
    .sale-cart-price input,
    .sale-cart-price strong,
    .sale-cart-subtotal strong {
        font-size: 14px;
    }
}

.distributor-reports {
    display: grid;
    gap: 14px;
}

.report-period {
    position: sticky;
    z-index: 8;
    top: 68px;
    display: grid;
    gap: 10px;
    padding: 10px 0;
    background: var(--canvas);
}

.report-period__quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.report-period__quick legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.report-period__quick label {
    position: relative;
    min-width: 0;
}

.report-period__quick input {
    position: absolute;
    opacity: 0;
}

.report-period__quick span {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.report-period__quick input:checked + span {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.report-period__range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.report-period__range .button {
    grid-column: 1 / -1;
}

.report-loading {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.report-loading[hidden] {
    display: none;
}

.report-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.report-metric {
    display: grid;
    min-width: 0;
    min-height: 82px;
    align-content: center;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.report-metric--sales {
    border-color: rgba(35, 87, 198, .34);
}

.report-metric__main {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.report-metric span,
.report-mini-summary span,
.report-inventory span,
.report-rank-card span,
.report-sale-card span,
.report-compact-card span,
.report-compact-card small,
.report-low-stock span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.report-metric__breakdown {
    display: grid;
    gap: 2px;
    margin: 2px 0 0;
}

.report-metric__breakdown div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
}

.report-metric__breakdown dt,
.report-metric__breakdown dd {
    margin: 0;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
}

.report-metric__breakdown dd {
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    text-align: right;
}

.report-metric strong {
    min-width: 0;
    color: var(--primary-700);
    font-size: 19px;
    font-variant-numeric: tabular-nums;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.report-metric small,
.report-inventory__summary small {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
}

.report-chart-panel {
    padding: 16px;
}

.report-chart {
    display: grid;
    grid-auto-columns: 34px;
    grid-auto-flow: column;
    gap: 5px;
    min-height: 168px;
    align-items: end;
    overflow-x: auto;
    padding: 8px 2px 0;
}

.report-chart__bar {
    display: grid;
    min-width: 26px;
    height: 144px;
    grid-template-rows: minmax(0, 1fr) 18px;
    align-items: end;
    gap: 5px;
}

.report-chart__bar span {
    display: block;
    width: 100%;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--primary-600), var(--accent-600));
}

.report-chart__bar.is-empty span {
    background: var(--line);
}

.report-chart__bar small {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    white-space: nowrap;
}

.report-grid {
    display: grid;
    gap: 14px;
}

.report-list {
    display: grid;
    gap: 8px;
}

.report-rank-card,
.report-sale-card,
.report-compact-card,
.report-low-stock article {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.report-rank-card {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
}

.report-rank-card > b {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 12px;
}

.report-rank-card > div,
.report-sale-card > div:first-child,
.report-compact-card > div,
.report-low-stock article {
    min-width: 0;
}

.report-rank-card strong,
.report-sale-card strong,
.report-compact-card strong,
.report-low-stock strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-rank-card dl {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.report-rank-card dl div,
.report-mini-summary article,
.report-inventory__summary article,
.report-low-stock > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.report-rank-card dt {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 750;
}

.report-rank-card dd {
    margin: 0;
    color: var(--ink-950);
    font-size: 13px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.report-sale-card {
    grid-template-columns: minmax(0, 1fr);
}

.report-sale-card > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.report-sale-card > div:first-child {
    display: grid;
    gap: 2px;
}

.report-sale-card > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.report-sale-card > div:last-child strong {
    margin-left: auto;
    color: var(--primary-700);
    font-variant-numeric: tabular-nums;
}

.report-mini-summary,
.report-inventory__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.report-mini-summary strong,
.report-inventory strong,
.report-low-stock strong {
    color: var(--primary-700);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    line-height: 1.12;
}

.report-compact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.report-compact-card--warning {
    border-color: rgba(180, 83, 9, .22);
}

.report-compact-card b {
    color: var(--ink-950);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.report-compact-card > div {
    display: grid;
    gap: 2px;
}

.report-inventory {
    display: grid;
    gap: 10px;
}

.report-inventory__summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}

.report-low-stock {
    display: grid;
    gap: 8px;
}

.report-low-stock > div {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.monitoring-app {
    display: grid;
    gap: 14px;
}

.customer-map-app {
    display: grid;
    gap: 14px;
}

.customer-map-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.customer-map-toolbar .products-loading {
    grid-column: 1 / -1;
}

.customer-map-shell {
    display: grid;
    grid-template-columns: minmax(0, 2.35fr) minmax(320px, .9fr);
    gap: 14px;
    min-height: min(720px, calc(100vh - 260px));
}

.customer-map-panel,
.customer-map-side {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.customer-map-panel {
    position: relative;
    overflow: hidden;
    padding: 8px;
}

.customer-map-canvas {
    position: relative;
    height: 100%;
    min-height: 540px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--primary-100);
}

.customer-map-legend {
    position: absolute;
    z-index: 2;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 6px;
    width: min(240px, calc(100% - 40px));
    max-height: 150px;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
}

.customer-map-legend span,
.customer-map-card small,
.customer-map-info small {
    display: flex;
    gap: 7px;
    align-items: center;
    min-width: 0;
    color: var(--ink-700);
    font-size: 11px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.customer-map-legend i,
.customer-map-card i,
.customer-map-info i {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--customer-color, #64748B);
}

.customer-map-side {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: min(720px, calc(100vh - 260px));
    overflow: hidden;
    padding: 16px;
}

.customer-map-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.customer-map-summary article {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.customer-map-summary span {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.customer-map-summary strong {
    color: var(--primary-700);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
}

.customer-map-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 0 10px;
}

.customer-map-list-head span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.customer-map-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
}

.customer-map-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-700);
    text-align: left;
    transition: border-color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out;
}

.customer-map-card:hover,
.customer-map-card:focus-visible {
    border-color: rgba(35, 87, 198, .44);
    background: var(--primary-100);
}

.customer-map-card.is-active {
    border-color: var(--primary-600);
    background: #F3F7FF;
    box-shadow: inset 3px 0 0 var(--primary-700);
}

.customer-map-card time,
.customer-map-card__body,
.customer-map-info {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.customer-map-card time strong {
    color: var(--primary-700);
    font-size: 12px;
}

.customer-map-card time span,
.customer-map-card__body > span,
.customer-map-info span {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.customer-map-card__body > strong,
.customer-map-info > strong {
    color: var(--ink-950);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.customer-map-card em {
    width: max-content;
    margin-top: 3px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #EEF2F7;
    color: var(--ink-500);
    font-size: 10px;
    font-style: normal;
    font-weight: 850;
    text-transform: uppercase;
}

.customer-map-info {
    max-width: 240px;
    padding: 2px;
}

@media (max-width: 1099px) {
    .customer-map-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .customer-map-canvas {
        min-height: 440px;
    }

    .customer-map-side {
        max-height: 650px;
    }
}

@media (max-width: 620px) {
    .customer-map-toolbar {
        grid-template-columns: 1fr;
    }

    .customer-map-canvas {
        min-height: 360px;
    }

    .customer-map-legend {
        right: 16px;
        bottom: 16px;
    }

    .customer-map-side {
        max-height: 600px;
        padding: 12px;
    }

    .customer-map-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }
}

.monitoring-toolbar {
    position: sticky;
    z-index: 8;
    top: 68px;
    display: grid;
    gap: 10px;
    align-items: end;
    padding: 10px 0;
    background: var(--canvas);
}

.monitoring-toolbar__distributor {
    min-width: 0;
}

.monitoring-period {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    border: 0;
}

.monitoring-period legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.monitoring-period label {
    position: relative;
    min-width: 0;
}

.monitoring-period input {
    position: absolute;
    opacity: 0;
}

.monitoring-period span {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.monitoring-period input:checked + span {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.monitoring-range {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.monitoring-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
}

.monitoring-map-panel,
.monitoring-side {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.monitoring-map-panel {
    overflow: hidden;
    padding: 8px;
}

.monitoring-map {
    position: relative;
    min-height: 440px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(232, 240, 255, .78), rgba(240, 236, 255, .92));
}

.monitoring-map__empty {
    position: absolute;
    z-index: 1;
    inset: 50% auto auto 50%;
    width: min(82%, 420px);
    padding: 14px 16px;
    border: 1px solid rgba(35, 87, 198, .18);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .94);
    color: var(--ink-700);
    font-weight: 750;
    text-align: center;
    overflow-wrap: anywhere;
    box-shadow: var(--shadow-card);
    transform: translate(-50%, -50%);
}

.monitoring-map__empty[hidden] {
    display: none;
}

.monitoring-side {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: 720px;
    overflow: hidden;
    padding: 18px;
}

.monitoring-summary {
    display: grid;
    gap: 7px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.monitoring-summary h2 {
    overflow-wrap: anywhere;
}

.monitoring-summary strong {
    color: var(--primary-700);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    line-height: 1.12;
}

.monitoring-summary span,
.monitoring-list-head span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.monitoring-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 0 10px;
}

.monitoring-sales-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-color: rgba(113, 128, 150, .55) transparent;
    scrollbar-width: thin;
}

.monitoring-sales-list::-webkit-scrollbar {
    width: 8px;
}

.monitoring-sales-list::-webkit-scrollbar-track {
    background: transparent;
}

.monitoring-sales-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(113, 128, 150, .45);
}

.monitoring-sale-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-700);
    text-align: left;
    transition: border-color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}

.monitoring-sale-card:hover,
.monitoring-sale-card:focus-visible {
    border-color: rgba(35, 87, 198, .44);
    background: var(--primary-100);
}

.monitoring-sale-card.is-active {
    border-color: var(--accent-600);
    background: #F8F6FF;
    box-shadow: 0 8px 22px rgba(109, 59, 255, .12);
    transform: translateY(-1px);
}

.monitoring-sale-card__main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.monitoring-sale-card__main time {
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.monitoring-sale-card__main strong,
.monitoring-sale-card__main span,
.monitoring-sale-card__main small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.monitoring-sale-card__main strong {
    color: var(--ink-950);
    font-size: 13px;
}

.monitoring-sale-card__main span,
.monitoring-sale-card__main small {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.monitoring-sale-card__meta {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.monitoring-sale-card__meta b {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.status-contado {
    background: var(--primary-100);
    color: var(--primary-700);
}

.status-credito {
    background: var(--accent-100);
    color: var(--accent-600);
}

.admin-distributor-heading .page-heading__actions {
    align-items: end;
    gap: 10px;
}

.admin-distributor-selector {
    min-width: min(100%, 300px);
}

.admin-distributor-selector .field {
    margin: 0;
}

.admin-distributor-selector select {
    min-height: 42px;
}

.admin-distributor-empty {
    min-height: 280px;
}

@media (max-width: 720px) {
    .admin-distributor-heading .page-heading__actions {
        align-items: stretch;
        width: 100%;
    }

    .admin-distributor-selector {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .report-period {
        top: 60px;
    }

    .report-metric {
        min-height: 74px;
        padding: 10px;
    }

    .report-metric strong {
        font-size: 17px;
    }

    .report-chart {
        min-height: 142px;
    }

    .report-chart__bar {
        height: 120px;
    }

    .report-inventory__summary {
        grid-template-columns: 1fr;
    }

    .monitoring-toolbar {
        top: 60px;
    }

    .monitoring-map {
        min-height: 360px;
    }

    .monitoring-side {
        max-height: 560px;
        padding: 14px;
    }

    .monitoring-sale-card {
        grid-template-columns: 1fr;
    }

    .monitoring-sale-card__meta {
        grid-template-columns: auto auto;
        align-items: center;
        justify-content: space-between;
        justify-items: start;
    }
}

@media (min-width: 760px) {
    .report-period {
        grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
        align-items: start;
    }

    .report-period__range {
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    }

    .report-period__range .button {
        grid-column: auto;
        align-self: end;
    }

    .report-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .report-chart {
        grid-auto-columns: minmax(28px, 1fr);
    }

    .report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-grid__wide {
        grid-column: 1 / -1;
    }

    .report-sale-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .report-sale-card > div:last-child {
        min-width: 260px;
    }

    .monitoring-toolbar {
        grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) auto;
    }

    .monitoring-range {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
        align-items: end;
    }
}

@media (min-width: 1100px) {
    .monitoring-toolbar {
        grid-template-columns: minmax(320px, 1fr) minmax(170px, 220px) auto;
    }

    .monitoring-shell {
        grid-template-columns: minmax(0, 2.45fr) minmax(300px, .9fr);
        min-height: min(720px, calc(100vh - 210px));
    }

    .monitoring-map-panel,
    .monitoring-side {
        min-height: min(720px, calc(100vh - 210px));
    }

    .monitoring-map {
        height: 100%;
        min-height: 540px;
    }

    .monitoring-side {
        max-height: min(720px, calc(100vh - 210px));
    }
}

/* Monitoreos GPS: resumen y actividades sin contenido superpuesto. */
.activity-monitoring-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
}

.activity-monitoring-summary {
    gap: 10px;
}

.activity-monitoring-summary__primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.activity-monitoring-summary__primary > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid rgba(35, 87, 198, .16);
    border-radius: var(--radius-sm);
    background: var(--primary-100);
}

.activity-monitoring-summary__primary strong {
    color: var(--primary-700);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.activity-monitoring-summary__primary span {
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 850;
}

.activity-monitoring-summary__secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.activity-monitoring-summary__secondary span,
.activity-monitoring-summary__last {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 750;
}

.activity-monitoring-summary__secondary b {
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
}

.activity-monitoring-section {
    min-width: 0;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.activity-monitoring-section + .activity-monitoring-section {
    padding-top: 2px;
}

.activity-monitoring-section:last-child {
    border-bottom: 0;
}

.activity-monitoring-side .monitoring-list-head {
    padding: 14px 0 8px;
}

.activity-monitoring-list {
    min-height: 0;
    max-height: 280px;
    overflow-y: auto;
}

.activity-monitoring-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
}

.activity-monitoring-card__date {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
}

.activity-monitoring-card__date time {
    color: var(--primary-700);
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.activity-monitoring-card__date span,
.activity-monitoring-card__address {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.activity-monitoring-card__address {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-monitoring-card .monitoring-sale-card__meta {
    display: block;
}

.activity-monitoring-card__type {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid rgba(35, 87, 198, .18);
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
}

@media (max-width: 759px) {
    .activity-monitoring-side {
        max-height: none;
        overflow: visible;
    }

    .activity-monitoring-list {
        max-height: none;
        overflow: visible;
    }

    .activity-monitoring-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* Dashboard protegido de actividad comercial diaria (sin sidebar). */
.daily-activity-page {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    background: #EEF3FB;
}

.daily-activity-dashboard {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100vh;
    padding: clamp(10px, 1.6vw, 24px);
    gap: 14px;
}

.daily-activity-header,
.daily-activity-map-panel,
.daily-activity-sidebar {
    border: 1px solid rgba(23, 62, 140, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 34px rgba(27, 54, 105, .10);
}

.daily-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
}

.daily-activity-header__title,
.daily-activity-header__status {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.daily-activity-header__brand {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #173E8C, #6D3BFF);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-decoration: none;
}

.daily-activity-header h1,
.daily-activity-sidebar h2 {
    margin: 1px 0 0;
    color: #10213D;
    font-size: clamp(20px, 2vw, 30px);
    line-height: 1.1;
}

.daily-activity-header__status {
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 780;
}

.daily-activity-header__status > span:not(.daily-activity-connection) {
    white-space: nowrap;
}

.daily-activity-connection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #E9EEF8;
    color: #334155;
}

.daily-activity-connection i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748B;
}

.daily-activity-connection[data-state="connected"] { background: #E7F8F1; color: #087443; }
.daily-activity-connection[data-state="connected"] i { background: #10B981; }
.daily-activity-connection[data-state="error"] { background: #FEF0F0; color: #B42318; }
.daily-activity-connection[data-state="error"] i { background: #EF4444; }
.daily-activity-connection[data-state="offline"] { background: #FFF6E6; color: #9A5700; }
.daily-activity-connection[data-state="offline"] i { background: #F59E0B; }
.daily-activity-connection[data-state="loading"] i { animation: daily-activity-pulse 1.1s infinite; }

.daily-activity-retry {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.daily-activity-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
}

.daily-activity-map-panel {
    min-width: 0;
    min-height: min(64vh, 700px);
    padding: 8px;
    overflow: hidden;
}

.daily-activity-map {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #E7EFFD, #F4F0FF);
}

.daily-activity-map__notice {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    max-width: min(86%, 400px);
    padding: 13px 16px;
    border: 1px solid rgba(23, 62, 140, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, .95);
    color: #334155;
    font-size: 13px;
    font-weight: 760;
    text-align: center;
    box-shadow: 0 8px 24px rgba(23, 62, 140, .14);
    transform: translate(-50%, -50%);
}

.daily-activity-map__notice[hidden] { display: none; }

.daily-activity-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 310px;
    max-height: 700px;
    overflow: hidden;
    padding: 16px;
}

.daily-activity-sidebar__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.daily-activity-sidebar h2 { font-size: 19px; }

.daily-activity-sidebar__head > span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.daily-activity-cards {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 9px 3px 3px 0;
    scrollbar-color: rgba(100, 116, 139, .5) transparent;
    scrollbar-width: thin;
}

.daily-activity-card {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--responsible-color, #173E8C);
    color: var(--responsible-text, #fff);
    box-shadow: 0 10px 20px rgba(23, 62, 140, .20);
    opacity: 0;
    transform: translateY(8px);
    animation: daily-activity-card-in 360ms ease-out forwards;
}

.daily-activity-card__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: start;
    min-width: 0;
}

.daily-activity-card h3 {
    margin: 0;
    min-width: 0;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: .025em;
    overflow-wrap: anywhere;
}

.daily-activity-card__total {
    font-size: clamp(36px, 3.15vw, 46px);
    font-variant-numeric: tabular-nums;
    line-height: .93;
}

.daily-activity-card__metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    margin-top: 1px;
}

.daily-activity-card__breakdown {
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    text-align: right;
}

.daily-activity-card__breakdown span { white-space: nowrap; }

.daily-activity-card__last {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    opacity: .88;
}

.daily-activity-popup { max-width: 260px; padding: 3px 2px; color: #1E293B; }
.daily-activity-popup p { margin: 0 0 5px; font-size: 12px; line-height: 1.35; }
.daily-activity-popup b { color: #173E8C; }

@keyframes daily-activity-card-in {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes daily-activity-pulse {
    50% { opacity: .35; transform: scale(.72); }
}

@media (min-width: 980px) {
    .daily-activity-layout {
        grid-template-columns: minmax(0, 2.4fr) minmax(330px, .9fr);
        min-height: calc(100vh - 116px);
    }

    .daily-activity-map-panel,
    .daily-activity-sidebar { min-height: calc(100vh - 116px); }

    .daily-activity-map-panel { height: calc(100vh - 116px); }
    .daily-activity-sidebar { max-height: calc(100vh - 116px); }
}

@media (max-width: 760px) {
    .daily-activity-dashboard { padding: 8px; gap: 8px; }
    .daily-activity-header { align-items: flex-start; flex-direction: column; padding: 13px; }
    .daily-activity-header__status { justify-content: flex-start; }
    .daily-activity-map-panel { min-height: 43vh; padding: 5px; }
    .daily-activity-sidebar { max-height: none; overflow: visible; }
    .daily-activity-cards { overflow: visible; }
}

@media (max-width: 440px) {
    .daily-activity-header__status { gap: 7px; }
    .daily-activity-header__status > span:not(.daily-activity-connection) { font-size: 11px; }
    .daily-activity-header h1 { font-size: 21px; }
    .daily-activity-card__total { font-size: 40px; }
}

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

/* Preventas institucionales */
.pre-sales-page,
.pre-sale-detail,
.pre-sales-customers {
    display: grid;
    gap: 18px;
}

.pre-sales-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pre-sales-panel,
.pre-sale-detail-summary,
.pre-sale-detail-products {
    min-width: 0;
}

.filters--pre-sales {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.filters--pre-sales .field,
.pre-sales-customer-search {
    margin: 0;
}

.filters--pre-sales > .field {
    min-width: 0;
}

.filters--pre-sales > .field--search {
}

.filters--pre-sales .pre-sales-period {
    grid-column: 1 / -1;
    justify-self: start;
    width: min(100%, 310px);
    min-width: 0;
}

.filters--pre-sales .pre-sales-period-range {
    grid-column: 1 / -1;
}

.pre-sales-filter-clear {
    width: auto;
    min-height: 42px;
    padding-inline: 14px;
    white-space: nowrap;
}

.pre-sales-table td small,
.pre-sale-cart td small,
.pre-sale-detail-products td small {
    display: block;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 12px;
}

.pre-sale-number {
    color: var(--primary-700);
    font-weight: 850;
    text-decoration: none;
}

.pre-sale-number:hover,
.pre-sale-number:focus-visible {
    text-decoration: underline;
}

.pre-sale-create-form .field {
    margin: 0;
}

.load-create .form-grid {
    align-items: start;
}

.load-create [data-load-driver] {
    align-self: start;
    height: 42px;
    min-height: 42px;
    padding: 0 12px;
}

.institutional-drivers,
.institutional-driver-detail,
.institutional-driver-form {
    margin-bottom: 18px;
}

.institutional-driver-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.institutional-driver-actions form {
    margin: 0;
}

.institutional-driver-actions .link-action {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
}

.load-available-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(160px, .8fr) minmax(360px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.load-period {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

.load-period legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.load-period label {
    position: relative;
    display: block;
    min-width: 0;
}

.load-period input {
    position: absolute;
    opacity: 0;
}

.load-period span {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.load-period input:checked + span {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.load-period__range {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 210px));
    gap: 12px;
}

.load-period__range[hidden] {
    display: none;
}

.load-selection-notice {
    margin: 0 0 14px;
    color: var(--warning-700);
    font-size: 12px;
    font-weight: 700;
}

.load-selection-cell {
    width: 48px;
    vertical-align: middle !important;
    text-align: center;
}

.load-selection-header {
    width: 48px;
    vertical-align: middle !important;
    text-align: center;
}

.load-selection-control {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}

.load-selection-checkbox {
    width: 20px !important;
    height: 20px;
    min-height: 20px !important;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

[data-available-table] tr.load-available-row--selected td {
    background: color-mix(in srgb, var(--primary-100) 72%, var(--surface));
}

[data-available-table] tr.load-available-row--selected:hover td {
    background: color-mix(in srgb, var(--primary-100) 88%, var(--surface));
}

.load-dispatch-action {
    margin-top: 18px;
}

.load-dispatch-notice {
    margin: 0 0 10px;
    color: var(--danger-700);
    font-size: 13px;
    font-weight: 750;
}

.load-dispatch-action .button:disabled {
    cursor: not-allowed;
}

.load-detail-row--cancelled td {
    background: color-mix(in srgb, var(--danger-100) 58%, var(--surface));
    color: var(--muted);
}

.load-detail-row--cancelled small {
    display: inline-block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}

.page-content--driver {
    max-width: 960px;
}

.warehouse-location-page {
    display: grid;
    gap: 18px;
}

.warehouse-location-card {
    display: grid;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.warehouse-location-card__details,
.warehouse-location-map-panel {
    display: grid;
    gap: 16px;
}

.warehouse-location-details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.warehouse-location-details div {
    display: grid;
    gap: 4px;
}

.warehouse-location-details dt {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.warehouse-location-details dd {
    margin: 0;
    color: var(--ink-950);
    font-weight: 700;
}

.warehouse-location-details input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--ink-950);
    font: inherit;
    font-weight: 700;
}

.warehouse-location-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.warehouse-location-map__heading {
    display: grid;
    gap: 6px;
}

.warehouse-location-map__heading p,
.warehouse-location-map__heading h2 {
    margin: 0;
}

.warehouse-location-map__heading > p:not(.eyebrow) {
    color: var(--ink-700);
    font-size: 13px;
}

.warehouse-location-map {
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.warehouse-location-map__status {
    margin: 0;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 650;
}

@media (min-width: 900px) {
    .warehouse-location-card {
        grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
        align-items: start;
    }
}

.driver-page {
    display: grid;
    gap: 18px;
}

.driver-page__heading {
    align-items: flex-start;
}

.driver-amount-label { display: none; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.summary-card {
    display: grid;
    gap: 5px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.summary-card span, .summary-card small { color: var(--ink-500); font-weight: 700; font-size: 12px; }
.summary-card strong { color: var(--ink-900); font-size: 24px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 15px; }
.filter-periods { display: flex; gap: 4px; }
.filter-periods button { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 8px 10px; font: inherit; font-weight: 700; cursor: pointer; }
.filter-periods button.is-active { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.filter-range { display: flex; gap: 8px; }
.collection-results { transition: opacity .14s ease; }
.collection-results.is-loading { opacity: .48; pointer-events: none; }
.driver-page.is-loading [data-driver-route-content] { opacity: .48; }
@media (max-width: 720px) { .filter-range { width: 100%; } .filter-range .field { flex: 1; } }

@media (max-width: 767px) {
    .driver-page .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .driver-page .summary-card { min-height: 0; padding: 10px; gap: 2px; }
    .driver-page .summary-card strong { font-size: 18px; }
    .driver-page .summary-card small { font-size: 10px; line-height: 1.25; }
    .driver-page .filter-bar { gap: 8px; padding: 10px; }
    .driver-page .filter-periods { width: 100%; overflow-x: auto; }
    .driver-page .filter-periods button { flex: 0 0 auto; padding: 7px 9px; }

    .driver-collections-table { overflow-x: visible; }
    .driver-collections-table table,
    .driver-collections-table tbody,
    .driver-collections-table tr,
    .driver-collections-table td { display: block; width: 100%; min-width: 0; }
    .driver-collections-table thead { display: none; }
    .driver-collections-table tr[data-account-row] {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px 8px;
        margin: 0;
        padding: 10px 11px;
        border-bottom: 1px solid var(--line);
        background: var(--surface);
        text-align: left;
    }
    .driver-collections-table td { padding: 0; border: 0; }
    .driver-collections-table td::before { display: none; }
    .driver-collections-table td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; font-weight: 850; font-size: 13px; }
    .driver-collections-table td:nth-child(7) { grid-column: 3; grid-row: 1; width: auto; justify-self: end; }
    .driver-collections-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-weight: 750; font-size: 13px; line-height: 1.2; }
    .driver-collections-table td:nth-child(2) small { color: var(--ink-500); font-size: 11px; font-weight: 600; }
    .driver-collections-table td:nth-child(4),
    .driver-collections-table td:nth-child(5),
    .driver-collections-table td:nth-child(6) { display: flex; flex-direction: column; min-width: 0; gap: 1px; font-size: 13px; font-weight: 800; }
    .driver-collections-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
    .driver-collections-table td:nth-child(5) { grid-column: 2; grid-row: 3; }
    .driver-collections-table td:nth-child(6) { grid-column: 3; grid-row: 3; }
    .driver-collections-table .driver-amount-label { display: block; color: var(--ink-500); font-size: 10px; font-weight: 750; }
    .driver-collections-table .driver-amount-value { overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
    .driver-collections-table td:nth-child(3) { grid-column: 1 / 3; grid-row: 4; min-width: 0; color: var(--ink-500); font-size: 11px; line-height: 1.2; }
    .driver-collections-table .driver-distributor { display: none; }
    .driver-collections-table td:nth-child(3) br { display: none; }
    .driver-collections-table td:nth-child(8) { grid-column: 3; grid-row: 4; width: auto; justify-self: end; align-self: end; }
    .preventist-collections-table td:nth-child(7) { grid-column: 3; grid-row: 1; width: auto; justify-self: end; }
    .preventist-collections-table td:nth-child(3),
    .preventist-collections-table td:nth-child(4),
    .preventist-collections-table td:nth-child(5) { display: flex; flex-direction: column; min-width: 0; gap: 1px; font-size: 13px; font-weight: 800; }
    .preventist-collections-table td:nth-child(3) { grid-column: 1; grid-row: 3; color: inherit; font-size: 13px; }
    .preventist-collections-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
    .preventist-collections-table td:nth-child(5) { grid-column: 3; grid-row: 3; }
    .preventist-collections-table td:nth-child(6) { grid-column: 1 / 3; grid-row: 4; }
    .preventist-collections-table td:nth-child(7) { grid-column: 3; grid-row: 4; align-self: end; }
    .driver-collections-table .button { width: auto; min-height: 34px; padding: 7px 11px; font-size: 12px; white-space: nowrap; }
    [data-collection-modal] .modal-card { width: min(100% - 20px, 620px); max-height: calc(100vh - 20px); overflow-y: auto; }
    [data-collection-modal] .modal-body { padding: 14px; }
    [data-collection-modal] .modal-footer { gap: 8px; }
}

.driver-location-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 12px;
    font-weight: 800;
}

.driver-card-list,
.driver-product-list,
.driver-stop-list,
.driver-route-list {
    display: grid;
    gap: 12px;
}

.driver-load-card,
.driver-detail-card,
.driver-stop-card,
.driver-product-card,
.driver-empty-card,
.driver-route-header,
.driver-route-alert,
.driver-load-selector__item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.driver-load-card,
.driver-detail-card,
.driver-empty-card,
.driver-route-header,
.driver-route-alert {
    padding: 18px;
}

.driver-load-card__heading,
.driver-route-header,
.driver-product-card,
.driver-card-actions,
.driver-load-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.driver-load-card h2,
.driver-route-header h2,
.driver-empty-card h2,
.driver-section__heading h2 {
    margin: 2px 0 0;
}

.driver-load-card__date,
.driver-route-header p,
.driver-route-alert p,
.driver-empty-card p {
    margin: 8px 0 0;
    color: var(--ink-700);
}

.driver-load-card__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.driver-load-card__summary div {
    display: grid;
    gap: 3px;
}

.driver-load-card__summary dt {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.driver-load-card__summary dd {
    margin: 0;
    color: var(--ink-950);
    font-size: 14px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.driver-card-actions {
    justify-content: stretch;
}

.driver-card-actions .button {
    flex: 1;
    justify-content: center;
}

.driver-section {
    display: grid;
    gap: 12px;
}

.driver-section__heading {
    display: grid;
    gap: 2px;
}

.driver-section__heading .eyebrow,
.driver-route-header .eyebrow {
    margin: 0;
}

.driver-stop-card,
.driver-product-card {
    display: grid;
    gap: 5px;
    padding: 14px;
}

.driver-stop-card strong,
.driver-product-card strong,
.driver-route-stop__content > strong {
    color: var(--ink-950);
}

.driver-stop-card span,
.driver-stop-card small,
.driver-product-card span,
.driver-product-card small,
.driver-route-stop__content > span,
.driver-route-stop__content > small {
    color: var(--ink-700);
    font-size: 13px;
}

.driver-product-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.driver-product-card > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.driver-product-card b {
    color: var(--primary-700);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.driver-load-selector {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
}

.driver-load-selector__item {
    display: grid;
    min-width: 158px;
    gap: 4px;
    padding: 11px 13px;
    color: var(--ink-700);
    text-decoration: none;
}

.driver-load-selector__item.is-active {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
}

.driver-load-selector__item span {
    font-size: 11px;
}

.driver-route-alert {
    border-color: color-mix(in srgb, var(--warning-700) 28%, var(--line));
    background: var(--warning-100);
    color: var(--warning-700);
}

.driver-route-alert p {
    color: inherit;
}

.driver-map {
    position: relative;
    min-height: 270px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.driver-map [data-driver-map-canvas] {
    width: 100%;
    min-height: 270px;
}

.driver-map > p {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 18px;
    left: 18px;
    margin: 0;
    color: var(--ink-700);
    font-weight: 700;
    text-align: center;
    transform: translateY(-50%);
}

.driver-route-stop {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.driver-route-stop__order {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-700);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.driver-route-stop--unlocated .driver-route-stop__order {
    background: var(--warning-700);
}

.driver-route-stop__content,
.driver-route-products {
    display: grid;
    gap: 5px;
}

.driver-route-products {
    margin-top: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.driver-route-products span {
    color: var(--ink-950);
    font-size: 12px;
}

.pre-sale-checkout-fields .sale-footer-control {
    grid-template-columns: minmax(0, 1fr);
}

.pre-sale-observation {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.pre-sale-observation > span {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 800;
}

.pre-sale-observation input {
    min-width: 0;
    height: 38px;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--canvas);
    color: var(--ink-950);
    font-size: 12px;
    font-weight: 750;
}

.pre-sale-observation input:focus {
    outline: none;
    border-color: var(--primary-600);
}

.pre-sale-detail-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--ink-500);
}

.pre-sale-detail-modal-card,
.detail-history-modal-card {
    width: min(100%, 1280px);
    max-height: calc(100dvh - 20px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    overflow: hidden;
    padding: 0;
}

.pre-sale-detail-modal-card__header,
.pre-sale-detail-modal-card__footer,
.detail-history-modal-card__header,
.detail-history-modal-card__footer {
    margin: 0;
    padding: 18px 22px;
    background: var(--surface);
}

.pre-sale-detail-modal-card__header,
.detail-history-modal-card__header {
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.pre-sale-detail-modal-card__footer,
.detail-history-modal-card__footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
}

.pre-sale-detail-modal-card__body,
.detail-history-modal-card__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px;
}

.product-sales-detail-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.product-sales-detail-link:hover,
.product-sales-detail-link:focus-visible {
    color: var(--primary-600);
    text-decoration: underline;
}

.product-sales-detail-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 20px;
    margin-top: 16px;
}

@media (max-width: 720px) {
    .product-sales-detail-table table,
    .product-sales-detail-table tbody,
    .product-sales-detail-table tr,
    .product-sales-detail-table td { display: block; width: 100%; }
    .product-sales-detail-table thead { display: none; }
    .product-sales-detail-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .product-sales-detail-table td,
    .product-sales-detail-table td:first-child,
    .product-sales-detail-table td:last-child {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 5px 0;
        border: 0;
        text-align: right;
    }
    .product-sales-detail-table td::before { content: attr(data-label); font-weight: 750; text-align: left; }
}

.pre-sale-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 24px;
    margin: 0;
}

.pre-sale-detail-grid > div {
    min-width: 0;
}

.pre-sale-detail-grid dt {
    margin-bottom: 5px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.pre-sale-detail-grid dd {
    margin: 0;
    color: var(--ink-950);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.pre-sale-detail-grid__wide {
    grid-column: span 2;
}

.pre-sale-detail-products tfoot th {
    font-size: 15px;
    text-align: right;
}

.pre-sale-approved-input {
    width: 68px;
    min-width: 68px;
    height: 34px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--canvas);
    color: var(--ink-950);
    font: inherit;
    font-weight: 750;
    text-align: right;
}

.pre-sale-approved-input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500) 16%, transparent);
}

.pre-sale-exclude-button {
    white-space: nowrap;
}

.pre-sale-detail-row--excluded {
    background: color-mix(in srgb, #d92d20 7%, transparent);
}

.pre-sale-detail-row--stock-insufficient td {
    background: color-mix(in srgb, #d92d20 5%, var(--surface));
}

.pre-sale-stock-value {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.pre-sale-detail-row--excluded [data-detail-excluded-label] {
    color: #b42318;
}

.pre-sale-exclusion-reason {
    margin: 0;
}

.pre-sale-approval-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.pre-sale-approval-actions h2,
.pre-sale-approval-actions p {
    margin: 0;
}

.pre-sale-approval-actions p:not(.eyebrow) {
    margin-top: 5px;
    color: var(--ink-500);
}

.pre-sale-approval-actions__buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pre-sales-customer-search {
    max-width: 560px;
    margin-bottom: 18px;
}

/* Fase 4B.1: registro comercial de entregas institucionales. */
.delivery-register__form {
    display: grid;
    gap: 18px;
}

.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-results {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.delivery-result {
    position: relative;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    cursor: pointer;
}

.delivery-result input {
    position: absolute;
    opacity: 0;
}

.delivery-result span {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-700);
    font-weight: 750;
}

.delivery-result input:checked + span {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.delivery-result input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--primary-600) 26%, transparent);
    outline-offset: 2px;
}

.delivery-observation {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.delivery-total {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 14px;
    color: var(--ink-700);
    font-size: 15px;
}

.delivery-total strong {
    color: var(--ink-950);
    font-size: 18px;
}

/* Entregas y cobranzas institucionales: aprovechar el espacio disponible en escritorio. */
@media (min-width: 1024px) {
    .page-content--driver:has(.deliveries-page),
    .page-content--driver:has(.delivery-register),
    .page-content--driver:has(.delivery-history),
    .page-content--driver:has(.driver-page[data-driver-collections]),
    .page-content--distributor:has(.deliveries-page),
    .page-content--distributor:has(.delivery-register),
    .page-content--distributor:has(.delivery-history),
    .page-content:has(.deliveries-page),
    .page-content:has(.delivery-history),
    .page-content:has(.loads-page),
    .page-content:has(.institutional-sales-page) {
        width: min(100%, 1440px);
        max-width: 1440px;
    }

    .deliveries-page,
    .delivery-register,
    .delivery-history,
    .loads-page,
    .institutional-sales-page,
    .driver-page[data-driver-collections] {
        width: 100%;
        max-width: none;
    }

    .deliveries-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .loads-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .institutional-sales-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .institutional-sales-filters {
        grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(280px, 1.5fr) auto;
    }

    .institutional-sales-filters .load-period__range {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(170px, 230px));
        gap: 12px;
    }

    .filters--pre-sales {
        grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, .8fr)) auto;
    }

    .filters--pre-sales .pre-sales-period {
        grid-column: 1 / -1;
    }

    .filters--pre-sales .pre-sales-period-range {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 210px));
        gap: 12px;
    }

    .delivery-list-filters {
        grid-template-columns: minmax(180px, .9fr) minmax(150px, .75fr) minmax(160px, .8fr) minmax(300px, 1.6fr) auto;
    }

    .delivery-list-filters .delivery-list-filters__period {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .delivery-list-filters__search {
        grid-column: auto;
        max-width: none;
    }

    .delivery-list-filters .load-period__range {
        grid-column: 1 / -2;
        grid-template-columns: repeat(2, minmax(0, 210px));
    }

    .delivery-list-filters__clear {
        align-self: end;
        justify-self: start;
        white-space: nowrap;
    }

    .load-list-filters {
        grid-template-columns: minmax(280px, 1.5fr) minmax(160px, .8fr) auto;
    }

    .load-list-filters .load-period__range {
        grid-template-columns: repeat(2, minmax(0, 210px));
    }

    .driver-page[data-driver-collections] .delivery-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .driver-collections__filters {
        display: grid;
        grid-template-columns: minmax(280px, 1.5fr) minmax(160px, .75fr) minmax(190px, 1fr) auto;
        align-items: end;
    }

    .driver-collections__filters .driver-collections__periods {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .driver-collections__filters .filter-range {
        display: grid;
        grid-column: 1 / -2;
        grid-template-columns: repeat(2, minmax(0, 210px));
    }

    .driver-collections__clear {
        align-self: end;
        justify-self: start;
        white-space: nowrap;
    }

    .driver-collections-table {
        overflow-x: visible;
    }

    .driver-collections-table .data-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .driver-collections-table th,
    .driver-collections-table td {
        padding-inline: 10px;
        overflow-wrap: anywhere;
    }

    .driver-collections-table th:nth-child(1),
    .driver-collections-table td:nth-child(1) { width: 10%; }

    .driver-collections-table th:nth-child(2),
    .driver-collections-table td:nth-child(2) { width: 21%; }

    .driver-collections-table th:nth-child(3),
    .driver-collections-table td:nth-child(3) { width: 19%; }

    .driver-collections-table th:nth-child(4),
    .driver-collections-table td:nth-child(4),
    .driver-collections-table th:nth-child(5),
    .driver-collections-table td:nth-child(5),
    .driver-collections-table th:nth-child(6),
    .driver-collections-table td:nth-child(6) {
        width: 10%;
        text-align: right;
        white-space: nowrap;
    }

    .driver-collections-table th:nth-child(7),
    .driver-collections-table td:nth-child(7) {
        width: 9%;
        text-align: center;
    }

    .driver-collections-table th:nth-child(8),
    .driver-collections-table td:nth-child(8) {
        width: 11%;
        white-space: nowrap;
    }

    [data-collection-modal] .modal-card.modal-card--large {
        width: min(100%, 1040px);
    }

    [data-collection-modal] .modal-body {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 20px;
    }

    [data-collection-modal] .collection-payment-data {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .deliveries-list {
        overflow-x: visible;
    }

    .deliveries-list__table,
    .delivery-items-table-wrap .delivery-items-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .deliveries-list__table th,
    .deliveries-list__table td {
        padding-inline: 10px;
        overflow-wrap: anywhere;
    }

    .deliveries-list__table th:nth-last-child(1),
    .deliveries-list__table td:nth-last-child(1) {
        width: 132px;
    }

    .deliveries-list__table th:nth-child(1),
    .deliveries-list__table td:nth-child(1),
    .deliveries-list__table th:nth-child(5),
    .deliveries-list__table td:nth-child(5),
    .deliveries-list__table th:nth-child(6),
    .deliveries-list__table td:nth-child(6),
    .deliveries-list__table th:nth-child(7),
    .deliveries-list__table td:nth-child(7) {
        white-space: nowrap;
    }

    .delivery-register .panel,
    .delivery-register__form {
        width: 100%;
    }

    .delivery-history__summary {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
        gap: 24px;
    }

    .delivery-history__summary > section,
    .delivery-history__visit {
        min-width: 0;
    }

    .delivery-history__visit {
        padding: 20px;
    }

    .delivery-history__delivery-data {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px 20px;
    }

    .delivery-history__items .data-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .delivery-history__items th:first-child,
    .delivery-history__items td:first-child {
        width: 46%;
    }

    .delivery-history__items th:not(:first-child),
    .delivery-history__items td:not(:first-child) {
        text-align: right;
        white-space: nowrap;
    }
}

@media (min-width: 1320px) {
    .deliveries-summary {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .loads-summary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .driver-page[data-driver-collections] .delivery-summary {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .load-available-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .delivery-list-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .load-list-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .delivery-list-filters .load-period {
        grid-column: 1 / -1;
    }

    .delivery-list-filters__clear {
        justify-self: start;
    }

    .load-period {
        grid-column: 1 / -1;
    }

    .load-list-filters__clear {
        justify-self: start;
    }

    .pre-sales-filter-clear {
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .pre-sales-summary,
    .filters--pre-sales,
    .pre-sale-detail-grid,
    .load-available-filters,
    .delivery-list-filters,
    .load-list-filters,
    .form-grid--three {
        grid-template-columns: 1fr;
    }

    .filters--pre-sales {
        display: grid;
    }

    .filters--pre-sales .pre-sales-period {
        width: 100%;
        min-width: 0;
    }

    .load-period__range {
        grid-template-columns: 1fr;
    }

    .pre-sale-detail-grid__wide {
        grid-column: auto;
    }

    .modal-shell:has(.pre-sale-detail-modal-card),
    .modal-shell:has(.detail-history-modal-card) {
        padding: 8px;
    }

    .pre-sale-detail-modal-card,
    .detail-history-modal-card {
        max-height: calc(100dvh - 16px);
        border-radius: var(--radius-md);
    }

    .pre-sale-detail-modal-card__header,
    .pre-sale-detail-modal-card__footer,
    .detail-history-modal-card__header,
    .detail-history-modal-card__footer {
        padding: 14px;
    }

    .pre-sale-detail-modal-card__body,
    .detail-history-modal-card__body {
        padding: 14px;
    }

    .pre-sale-observation > span {
        font-size: 9px;
    }

    .pre-sale-approval-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pre-sale-approval-actions__buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .pre-sale-approval-actions__buttons .button:only-child {
        grid-column: 2;
    }

    .warehouse-location-card {
        padding: 16px;
    }

    .warehouse-location-card__actions .button {
        width: 100%;
        justify-content: center;
    }

    .warehouse-location-map {
        min-height: 300px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.status-logistico-despachada,
.status-operativo-entrega_parcial {
    background: var(--primary-100);
    color: var(--primary-600);
}

.status-entregada,
.status-operativo-entregada,
.status-operativo-entregado {
    background: var(--success-100);
    color: var(--success-700);
}

.status-operativo-pendiente_entrega,
.status-operativo-tienda_cerrada,
.status-operativo-sin_dinero {
    background: var(--warning-100);
    color: var(--warning-700);
}

.status-operativo-rechazado {
    background: var(--danger-100);
    color: var(--danger-700);
}

.delivery-list-card__status small {
    display: block;
    margin-top: 5px;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.35;
}

.delivery-list-card__action {
    display: grid;
    gap: 7px;
    justify-items: start;
}

.delivery-history__visits {
    display: grid;
    gap: 12px;
}

.delivery-history__visit {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--canvas);
}

.delivery-history__visit > header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.delivery-history__visit > header > div {
    display: grid;
    gap: 7px;
}

.delivery-history__visit > header strong {
    color: var(--ink-950);
    font-size: 14px;
}

.delivery-history__visit > header small {
    color: var(--ink-500);
    text-align: right;
}

.delivery-history__note {
    margin: 12px 0 0;
    color: var(--ink-700);
}

.delivery-history__delivery-data {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
    color: var(--ink-700);
    font-size: 13px;
}

.delivery-history__items {
    margin-top: 14px;
}

/* Fase 4B.1: tarjetas legibles de entregas en pantalla pequeña. */
@media (max-width: 767px) {
    .deliveries-list {
        margin-inline: 0;
        padding-inline: 0;
        overflow-x: visible;
    }

    .deliveries-list .deliveries-list__table,
    .deliveries-list .deliveries-list__table tbody,
    .deliveries-list .delivery-list-card,
    .deliveries-list .delivery-list-card td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .deliveries-list .deliveries-list__table thead {
        display: none;
    }

    .deliveries-list .delivery-list-card {
        margin-bottom: 12px;
        padding: 15px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: var(--shadow-card);
    }

    .deliveries-list .delivery-list-card td {
        display: grid;
        grid-template-columns: minmax(102px, 40%) minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .deliveries-list .delivery-list-card td::before {
        color: var(--ink-700);
        font-size: 12px;
        font-weight: 800;
        content: attr(data-label);
    }

    .deliveries-list .delivery-list-card .delivery-list-card__number,
    .deliveries-list .delivery-list-card .delivery-list-card__customer {
        display: block;
        padding: 0;
    }

    .deliveries-list .delivery-list-card .delivery-list-card__number {
        color: var(--primary-700);
        font-size: 13px;
        font-weight: 900;
    }

    .deliveries-list .delivery-list-card .delivery-list-card__customer {
        margin: 3px 0 8px;
        color: var(--ink-950);
        font-size: 16px;
        font-weight: 850;
        line-height: 1.25;
    }

    .deliveries-list .delivery-list-card .delivery-list-card__number::before,
    .deliveries-list .delivery-list-card .delivery-list-card__customer::before,
    .deliveries-list .delivery-list-card .delivery-list-card__status::before,
    .deliveries-list .delivery-list-card .delivery-list-card__action::before {
        display: none;
    }

    .deliveries-list .delivery-list-card .delivery-list-card__status {
        display: block;
        padding-top: 10px;
    }

    .deliveries-list .delivery-list-card .delivery-list-card__action {
        display: grid;
        padding-top: 12px;
        gap: 8px;
    }

    .deliveries-list .delivery-list-card .button {
        width: 100%;
        justify-content: center;
    }

    .delivery-items-table-wrap {
        margin-inline: 0;
        padding-inline: 0;
        overflow-x: visible;
    }

    .delivery-items-table-wrap .delivery-items-table,
    .delivery-items-table-wrap .delivery-items-table tbody,
    .delivery-items-table-wrap .delivery-items-table tr,
    .delivery-items-table-wrap .delivery-items-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .delivery-items-table-wrap .delivery-items-table thead {
        display: none;
    }

    .delivery-items-table-wrap .delivery-items-table tr {
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--canvas);
    }

    .delivery-items-table-wrap .delivery-items-table td {
        display: grid;
        grid-template-columns: minmax(124px, 45%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 7px 0;
        border: 0;
    }

    .delivery-items-table-wrap .delivery-items-table td::before {
        color: var(--ink-700);
        font-size: 12px;
        font-weight: 800;
        content: attr(data-label);
    }

    .delivery-items-table-wrap .delivery-items-table .delivery-item__product {
        display: block;
        padding: 0 0 10px;
        color: var(--ink-950);
        line-height: 1.3;
    }

    .delivery-items-table-wrap .delivery-items-table .delivery-item__product::before {
        display: none;
    }

    .delivery-items-table-wrap .delivery-items-table input[data-delivery-quantity] {
        width: 100%;
        min-height: 42px;
    }

    .delivery-total {
        justify-content: space-between;
        padding: 16px 2px 0;
    }

    .delivery-register [data-delivery-cash-fields] select,
    .delivery-register [data-delivery-cash-fields] input {
        width: 100%;
    }

    .delivery-history__visit > header {
        align-items: start;
        flex-direction: column;
    }

    .delivery-history__visit > header small {
        text-align: left;
    }

    .delivery-history__items {
        margin-inline: 0;
        padding-inline: 0;
        overflow-x: visible;
    }

    .delivery-history__items table,
    .delivery-history__items tbody,
    .delivery-history__items tr,
    .delivery-history__items td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .delivery-history__items thead {
        display: none;
    }

    .delivery-history__items tr {
        padding: 12px 0;
        border-top: 1px solid var(--line);
    }

    .delivery-history__items td {
        display: grid;
        grid-template-columns: minmax(120px, 46%) minmax(0, 1fr);
        gap: 10px;
        padding: 6px 0;
        border: 0;
    }

    .delivery-history__items td::before {
        color: var(--ink-700);
        font-size: 12px;
        font-weight: 800;
        content: attr(data-label);
    }
}

.institutional-sales__history-note {
    margin-bottom: 18px;
}

.institutional-sales-table__money {
    text-align: right;
    white-space: nowrap;
}

.institutional-sales-table td:last-child {
    white-space: nowrap;
}

.institutional-sale-detail__section + .institutional-sale-detail__section {
    margin-top: 24px;
}

.institutional-sale-detail__section h3,
.institutional-sale-detail__section h4 {
    margin: 0 0 12px;
}

@media (max-width: 1023px) {
    .institutional-sales-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .institutional-sales-summary {
        grid-template-columns: 1fr;
    }

    .institutional-sales-table__money {
        text-align: left;
        white-space: normal;
    }
}
