:root {
    --ink: #14213d;
    --ink-soft: #33415c;
    --paper: #f4f7fb;
    --surface: #ffffff;
    --line: #dbe4ee;
    --brand: #243b6b;
    --brand-bright: #315ea8;
    --red: #d62828;
    --yellow: #f5b700;
    --green: #2a9d5b;
    --muted: #6b778c;
    --shadow: 0 12px 34px rgba(20, 33, 61, 0.09);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: auto !important; }
body { color: var(--ink); background: var(--paper); font-family: Inter, "Segoe UI", system-ui, sans-serif; overflow-x: clip; }
a { color: var(--brand-bright); }
.btn, .nav-link, .form-control, .form-select, .navbar-toggler { min-height: 44px !important; }
.navbar-toggler { min-width: 52px; }
.app-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand-lockup { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); }
.brand-lockup small, .user-menu small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: linear-gradient(145deg, var(--brand-bright), var(--ink)); font-size: 1.4rem; font-weight: 800; box-shadow: 0 7px 16px rgba(36,59,107,.25); }
.header-company-logo { display: grid; place-items: center; width: 48px; height: 48px; padding: 3px; border-radius: 11px; background: white; }
.header-company-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.navbar-nav .nav-link { display: flex; align-items: center; gap: .45rem; border-radius: 10px; padding-inline: .8rem; color: var(--ink-soft); }
.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus { background: #edf3fb; color: var(--brand); }
.navbar-nav .nav-link.active { color: var(--brand); background: #e5eefb; }
.user-area { min-width: 0; }
.user-menu { display: flex; align-items: center; gap: .75rem; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; white-space: nowrap; }
.logout-button i { font-size: 1rem; line-height: 1; }
.user-summary { min-width: 0; }
.user-summary strong { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pwa-install-button { flex: 0 0 auto; white-space: nowrap; }
.pwa-install-guidance { max-width: 320px; margin: .55rem 0 0; padding: .65rem .75rem; border-radius: 10px; color: var(--ink-soft); background: #edf3fb; font-size: .78rem; line-height: 1.35; }
.notification-pill { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .45rem .75rem; border-radius: 999px; background: #edf3fb; text-decoration: none; color: var(--brand); }
.app-content { max-width: 1600px; padding-top: 1.5rem; padding-bottom: .75rem; }
.page-kicker { margin: 0 0 .3rem; color: var(--brand-bright); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-title { font-size: clamp(1.65rem, 4vw, 2.6rem); font-weight: 750; letter-spacing: -.04em; }
.page-subtitle { color: var(--muted); max-width: 720px; }
.surface-card { height: 100%; background: var(--surface); border: 1px solid rgba(219,228,238,.9); border-radius: 20px; box-shadow: var(--shadow); }
.kpi-card { padding: 1.15rem; overflow: hidden; position: relative; }
.kpi-card::after { content: ""; position: absolute; width: 84px; height: 84px; right: -25px; top: -25px; border-radius: 50%; background: rgba(49,94,168,.08); }
.kpi-button { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.kpi-button:hover { transform: translateY(-2px); border-color: #bdcce0; box-shadow: 0 16px 38px rgba(20,33,61,.14); }
.kpi-button:focus-visible { outline: 3px solid rgba(49,94,168,.3); outline-offset: 3px; }
.kpi-label { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { margin-top: .35rem; font-size: clamp(1.45rem, 4vw, 2.35rem); font-weight: 800; letter-spacing: -.04em; }
.kpi-note { color: var(--muted); font-size: .82rem; }
.section-card { padding: 1rem; }
.section-title { font-size: 1rem; font-weight: 750; }
.status-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.status-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status-red { color: #a91d1d; background: #ffe7e7; }
.status-yellow { color: #8a6500; background: #fff3c4; }
.status-green { color: #137640; background: #dcf7e7; }
.status-gray { color: #566071; background: #e9edf2; }
.status-neutral { color: #36537f; background: #e8f0fb; }
.process-rail { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.process-step { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; border-radius: 18px; border: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
button.process-step { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
button.process-step:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(36,59,107,.12); }
button.process-step:focus-visible { outline: 3px solid rgba(49,94,168,.3); outline-offset: 3px; }
.process-step i { font-size: 1.5rem; }
.process-step.red { border-top: 6px solid var(--red); }
.process-step.yellow { border-top: 6px solid var(--yellow); }
.process-step.green { border-top: 6px solid var(--green); }
.order-process .process-step { position: relative; transition: opacity .2s ease, filter .2s ease, transform .2s ease, box-shadow .2s ease; }
.order-process .process-step.is-muted { opacity: .32; filter: grayscale(.75); }
.order-process .process-step.is-active { transform: translateY(-2px); color: var(--ink); box-shadow: 0 12px 28px rgba(20,33,61,.15); }
.order-process .process-step.is-active::after { content: "Etapa actual"; position: absolute; top: .65rem; right: .75rem; padding: .22rem .48rem; border-radius: 999px; color: white; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.order-process .process-step.red.is-active { background: #fff3f3; border-color: #ef9b9b; }
.order-process .process-step.red.is-active::after { background: var(--red); }
.order-process .process-step.yellow.is-active { background: #fff9e5; border-color: #efd46f; }
.order-process .process-step.yellow.is-active::after { color: #332600; background: var(--yellow); }
.order-process .process-step.green.is-active { background: #edf9f2; border-color: #8bd2aa; }
.order-process .process-step.green.is-active::after { background: var(--green); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .9rem .75rem; border-color: #edf1f5; vertical-align: middle; }
.table thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.form-label { font-weight: 650; color: var(--ink-soft); }
.form-control, .form-select { border-radius: 12px; border-color: #cdd8e5; }
.btn { border-radius: 12px; font-weight: 700; }
.btn-sm { min-width: 44px; }
.delivery-actions { clear: both; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); width: 100%; gap: .5rem; align-items: stretch; }
.delivery-actions .btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 0; gap: .35rem; white-space: nowrap; }
.delivery-results[data-view="cards"] .delivery-list-table, .delivery-results[data-view="list"] .delivery-card-table { display: none !important; }
.dashboard-recent-results[data-view="cards"] .dashboard-recent-list-table, .dashboard-recent-results[data-view="list"] .dashboard-recent-card-table { display: none !important; }
.delivery-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.delivery-list-heading > div:first-child > span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.delivery-view-switch { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: 12px; background: #f4f7fb; }
.delivery-view-switch .btn { min-height: 38px; padding: .45rem .7rem; border: 0; color: var(--muted); background: transparent; font-size: .8rem; }
.delivery-view-switch .btn.is-active { color: white; background: var(--brand); box-shadow: 0 4px 10px rgba(20, 33, 61, .16); }
.delivery-view-switch .btn i { margin-right: .25rem; }
.delivery-list-table { border-collapse: separate; border-spacing: 0; }
.delivery-list-table td, .delivery-list-table th { vertical-align: middle; }
.delivery-list-table .delivery-list-identity strong { display: block; }
.delivery-list-table .delivery-list-client { font-weight: 650; }
.delivery-list-table .delivery-list-amount { white-space: nowrap; }
.delivery-list-table .delivery-list-actions { min-width: 190px; }
.delivery-filter-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0; color: var(--ink); text-align: left; }
.delivery-filter-toggle > span:first-child { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; }
.delivery-filter-card #delivery-filters.show { padding-top: 1rem; }
.delivery-filter-card .form-label { margin-bottom: .35rem; }
.dashboard-recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.dashboard-recent-heading > a { flex: 0 0 auto; white-space: nowrap; }
.dashboard-view-switch { margin-bottom: .75rem; }
.dashboard-recent-list-table { border-collapse: separate; border-spacing: 0; }
.dashboard-recent-list-table td, .dashboard-recent-list-table th { vertical-align: middle; }
.dashboard-recent-list-table .dashboard-recent-list-identity strong { display: block; }
.dashboard-recent-list-table .dashboard-recent-list-client { font-weight: 650; }
.dashboard-recent-list-table .dashboard-recent-list-amount { white-space: nowrap; }
.dashboard-recent-list-action { min-width: 70px; text-align: right; }
.dashboard-recent-list-action .btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; }
.dashboard-filter-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0; color: var(--ink); text-align: left; }
.dashboard-filter-toggle > span:first-child { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; }
.dashboard-filter-summary { margin-left: auto; color: var(--muted); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.dashboard-filter-card #dashboard-filters.show { padding-top: 1rem; }
@media (min-width: 576px) {
    .delivery-actions { display: flex; width: auto; clear: none; flex-wrap: wrap; }
    .delivery-actions .btn { width: auto; }
}
.billing-review-button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 94px; white-space: nowrap; }
.billing-review-button i { font-size: .9rem; line-height: 1; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: #1b315c; --bs-btn-hover-border-color: #1b315c; }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.stock-low { color: #8a6500; font-weight: 750; }
.stock-out { color: var(--red); font-weight: 750; }
.price-negative { color: var(--red); }
.price-positive { color: var(--green); }
.order-age { display: flex; align-items: center; gap: .35rem; margin-top: .5rem; color: var(--muted); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.order-age.is-warning { color: #8a6500; }
.order-age.is-late { color: var(--red); }
.order-create-header { display: flex; flex-direction: column; gap: 1rem; }
.order-create-back { align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem; }
.auth-shell { min-height: 100vh; background: radial-gradient(circle at 10% 10%, #dce9fb, transparent 42%), linear-gradient(145deg, #f7f9fc, #e8eef7); }
.auth-content { min-height: 100vh; display: grid; place-items: center; padding-block: 2rem; }
.auth-card { width: min(100%, 460px); padding: 1.5rem; }
.auth-hero { margin-bottom: 1.4rem; }
.auth-hero .brand-mark { margin-bottom: 1rem; }
.auth-login-card { height: auto; overflow: hidden; }
.auth-company-logo { display: grid; place-items: center; width: 108px; height: 108px; margin-bottom: 1rem; padding: 8px; border-radius: 18px; background: white; box-shadow: 0 12px 30px rgba(8,18,39,.2); }
.auth-company-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.company-system-title { max-width: 500px; }
.auth-login-card .auth-hero-note { display: none; }
.auth-form-heading { margin-bottom: 1.35rem; }
.auth-form-heading h2 { margin-bottom: .45rem; font-size: 1.55rem; font-weight: 780; letter-spacing: -.03em; }
.auth-form-heading > p:last-child { margin: 0; color: var(--muted); }
.wizard-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.wizard-dot { padding: .65rem; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .78rem; text-align: center; }
.wizard-dot.is-active { color: white; background: var(--brand); border-color: var(--brand); }
.wizard-panel[hidden] { display: none; }
.order-item { padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.order-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; padding-bottom: .65rem; border-bottom: 1px solid #e8eef5; }
.order-item-number { display: block; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.order-item-heading small { display: block; margin-top: .15rem; color: var(--muted); }
.order-item-remove-label { margin-left: .3rem; }
.order-product-picker-wrap { position: relative; }
.order-product-native { display: none; }
.order-product-picker { width: 100%; min-height: 44px; display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; border: 1px solid #cdd8e5; border-radius: 12px; color: var(--ink); background: white; text-align: left; }
.order-product-picker:disabled { opacity: 1; color: var(--ink); background: #f1f5fa; cursor: not-allowed; }
.order-product-picker-copy, .order-product-option-copy { min-width: 0; flex: 1 1 auto; }
.order-product-picker-copy strong, .order-product-option-copy strong { display: block; color: var(--ink); line-height: 1.3; }
.order-product-picker-copy small, .order-product-option-copy small { display: block; margin-top: .2rem; color: var(--muted); line-height: 1.3; }
.order-product-picker-placeholder { flex: 1 1 auto; color: var(--muted); }
.order-product-picker-stock, .order-product-option-stock { flex: 0 0 auto; font-weight: 800; white-space: nowrap; }
.order-product-options { position: absolute; z-index: 40; top: calc(100% + .45rem); right: 0; left: 0; display: none; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 30px rgba(20,33,61,.14); }
.order-product-options:not([hidden]) { display: block; }
.order-product-option { width: 100%; min-height: 58px; display: flex; align-items: center; gap: .65rem; padding: .7rem .75rem; border: 0; border-bottom: 1px solid #edf1f5; color: var(--ink); background: white; text-align: left; }
.order-product-option:last-child { border-bottom: 0; }
.order-product-option:hover, .order-product-option:focus-visible { background: #edf3fb; outline: 0; }
.order-product-option.is-selected { background: #e8f0fb; }
.order-product-option-check { flex: 0 0 auto; color: var(--brand-bright); opacity: 0; }
.order-product-option.is-selected .order-product-option-check { opacity: 1; }
.order-product-options-empty { margin: 0; padding: 1rem; color: var(--muted); text-align: center; }
.billing-item { padding: 1.05rem 1.15rem 1.15rem; border-color: #d8e2ee; background: #fbfcfe; }
.billing-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid #e8eef5; }
.billing-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.billing-item-number { color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.billing-item-hint { margin-left: .65rem; color: var(--muted); font-size: .78rem; }
.billing-item-status { margin-top: .65rem; color: var(--muted); font-size: .76rem; }
.billing-item-remove { min-width: 44px; }
.billing-item-edit-label, .billing-item-action-label, .billing-item-remove-label { margin-left: .3rem; }
.billing-item.is-locked .form-control:disabled, .billing-item.is-locked .form-select:disabled { opacity: 1; color: var(--ink); background: #f1f5fa; cursor: not-allowed; }
.billing-item.is-locked .product-search-control .input-group-text { color: var(--muted); background: #f1f5fa; }
.billing-item-remove-label { margin-left: .35rem; }
.billing-item-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(130px, .62fr) minmax(175px, .82fr) minmax(165px, .78fr); gap: 1rem; align-items: start; }
.billing-item-grid .form-label { margin-bottom: .4rem; }
.billing-item-product, .billing-item-field, .billing-item-reference-field { min-width: 0; }
.billing-item-product .form-text, .billing-item-field .form-text { min-height: 1.1rem; }
.billing-item-reference { min-height: 44px; display: flex; align-items: center; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: #f1f6fc; }
.billing-item-reference-label { display: block; }
.billing-item-reference-value { color: var(--ink); font-size: 1rem; }
.billing-item-difference { min-height: 1.1rem; font-size: .73rem; font-weight: 700; }
.billing-history { border-color: #d8e2ee; }
.audit-history-list { display: grid; gap: .85rem; }
.audit-history-entry { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.audit-history-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; color: var(--muted); font-size: .78rem; }
.audit-history-meta strong { color: var(--ink); }
.audit-change-list { display: grid; gap: .55rem; margin-top: .65rem; }
.audit-change { padding: .65rem .75rem; border-left: 3px solid var(--brand-bright); border-radius: 8px; background: white; }
.audit-change-added { border-left-color: var(--green); }
.audit-change-removed { border-left-color: var(--red); }
.audit-change-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem; }
.audit-change-badge { padding: .2rem .4rem; border-radius: 999px; color: var(--brand); background: #eaf1fb; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.audit-change-added .audit-change-badge { color: #137640; background: #dcf7e7; }
.audit-change-removed .audit-change-badge { color: #a91d1d; background: #ffe7e7; }
.audit-change-fields { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .45rem; color: var(--ink-soft); font-size: .78rem; }
.audit-change-fields b { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.product-search-control .input-group-text { color: var(--muted); background: white; border-color: #cdd8e5; border-radius: 12px 0 0 12px; }
.product-search-control .form-control { border-left: 0; }
.order-review-total { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; padding: .9rem 1rem; border-radius: 12px; color: white; background: var(--ink); }
.order-review-total span { font-size: .78rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.order-review-total strong { font-size: 1.15rem; }
.chart-wrap { min-height: 290px; position: relative; }
.chart-wrap canvas { display: block; max-width: 100%; }
.timeline { border-left: 2px solid var(--line); padding-left: 1.1rem; }
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.48rem; top: .25rem; width: 11px; height: 11px; border-radius: 50%; background: var(--brand-bright); box-shadow: 0 0 0 4px white; }
.order-detail-facts dt, .order-detail-facts dd { min-width: 0; overflow-wrap: anywhere; }
.order-detail-facts dd { margin-bottom: .75rem; }
.order-detail-grid { align-items: flex-start; }
.order-detail-grid > [class*="col-"] { align-self: flex-start; }
.order-detail-grid > [class*="col-"] > .surface-card { height: auto; }
.d-grid-mobile { display: grid; gap: .5rem; }
.d-grid-mobile .btn { width: 100%; }
.mobile-card-table thead { display: none; }
.mobile-card-table, .mobile-card-table tbody, .mobile-card-table tr, .mobile-card-table td { display: block; width: 100%; }
.mobile-card-table tr { margin-bottom: .8rem; padding: .7rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.mobile-card-table td { border: 0; padding: .45rem .2rem; text-align: right; overflow-wrap: anywhere; }
.mobile-card-table td::before { content: attr(data-label); float: left; width: 42%; padding-right: .75rem; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.mobile-card-table td::after { content: ""; display: block; clear: both; }
.mobile-card-table td[colspan] { text-align: center; }
.mobile-card-table td[colspan]::before { display: none; }
.orders-filter-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0; color: var(--ink); text-align: left; }
.orders-filter-toggle > span:first-child { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; }
.orders-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; margin-left: auto; padding: 0 .55rem; border-radius: 999px; color: white; background: var(--brand-bright); font-size: .72rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.orders-date-input { position: relative; }
.orders-date-input .orders-date-display { padding-right: 2.75rem; }
.orders-date-input > i { position: absolute; top: 50%; right: .9rem; color: var(--ink); font-size: 1rem; pointer-events: none; transform: translateY(-50%); }
.orders-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.orders-list-heading-copy > span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.orders-list-section[data-view="list"] .orders-card-table, .orders-list-section[data-view="cards"] .orders-compact-table { display: none !important; }
.orders-compact-table { border-collapse: separate; border-spacing: 0; }
.orders-compact-table td, .orders-compact-table th { vertical-align: middle; }
.orders-compact-table .orders-compact-identity strong { display: block; }
.orders-compact-table .orders-compact-client { font-weight: 650; }
.orders-compact-table .orders-compact-total { white-space: nowrap; }
.orders-compact-table .orders-compact-action { min-width: 70px; text-align: right; }
.orders-compact-table .orders-compact-action .btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; }
.order-list-number { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.order-list-number i { font-size: .75rem; }
.order-list-oc { margin-top: .15rem; color: var(--muted); font-size: .78rem; }
.order-list-action { white-space: nowrap; }
.role-vendedor .app-content { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
.seller-order-fab { position: fixed; z-index: 1040; right: max(1.1rem, env(safe-area-inset-right)); bottom: max(1.1rem, env(safe-area-inset-bottom)); width: 74px; height: 74px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; border: 0; border-radius: 50%; color: white; background: var(--brand-bright); box-shadow: 0 12px 28px rgba(19, 91, 197, .34), 0 3px 8px rgba(20, 33, 61, .18); text-align: center; text-decoration: none; transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease; }
.seller-order-fab i { font-size: 1.45rem; line-height: 1; }
.seller-order-fab span { font-size: .7rem; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.seller-order-fab:hover { color: white; background: var(--brand); transform: translateY(-2px); box-shadow: 0 15px 32px rgba(20, 33, 61, .35), 0 4px 10px rgba(20, 33, 61, .18); }
.seller-order-fab:active { transform: translateY(0) scale(.97); }
.seller-order-fab:focus-visible { color: white; outline: 3px solid white; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(19, 91, 197, .45), 0 12px 28px rgba(20, 33, 61, .28); }

@media (max-width: 1199.98px) {
    .app-header { background: white; backdrop-filter: none; }
    #menuPrincipal { width: min(90vw, 380px); height: 100dvh; }
    #menuPrincipal .offcanvas-body { display: flex; flex-direction: column; min-height: 0; }
    #menuPrincipal .navbar-nav { gap: .25rem; }
    #menuPrincipal .nav-link { padding: .72rem .85rem; }
    #menuPrincipal .user-area { width: 100%; margin-top: auto !important; padding-top: 1rem; border-top: 1px solid var(--line); }
    #menuPrincipal .user-menu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; }
    #menuPrincipal .pwa-install-button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 991.98px) {
    .billing-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
    .billing-item-product { grid-column: 1 / -1; }
    .billing-item-reference-field { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
    .chart-wrap { min-height: 340px; }
    .seller-order-fab { right: max(.85rem, env(safe-area-inset-right)); bottom: max(.85rem, env(safe-area-inset-bottom)); width: 68px; height: 68px; }
    .seller-order-fab--raised { bottom: calc(5.75rem + env(safe-area-inset-bottom)); }
    .order-form-shell { padding: .85rem; border-radius: 16px; }
    .order-create-back { width: 100%; justify-content: center; }
    .order-form-shell .wizard-nav { gap: .35rem; }
    .order-form-shell .wizard-dot { min-width: 0; padding: .55rem .25rem; font-size: .7rem; }
    .order-item { padding: .85rem; }
    .order-item-heading { align-items: flex-start; gap: .75rem; }
    .order-item-heading small { max-width: 210px; font-size: .72rem; line-height: 1.3; }
    .order-item .item-product { font-size: .88rem; }
    .order-item .item-search-status, .order-item .item-reference { font-size: .76rem; font-weight: 650; }
    .order-item .item-remove { flex: 0 0 auto; width: auto; }
    #add-item { width: 100%; }
    .order-wizard-actions { position: sticky; z-index: 20; bottom: max(.5rem, env(safe-area-inset-bottom)); margin: 1rem -.15rem -.15rem !important; padding: .65rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 10px 28px rgba(20,33,61,.16); backdrop-filter: blur(10px); }
    .order-wizard-actions .btn { flex: 1 1 120px; }
    .orders-page-header { margin-bottom: 1rem !important; }
    .orders-new-button { width: 100%; }
    .orders-filter-card { padding: .9rem 1rem; border-radius: 16px; }
    .orders-filter-card #orders-filters.show { padding-top: 1rem; }
    .delivery-filter-card { padding: .9rem 1rem; border-radius: 16px; }
    .delivery-list-heading { align-items: stretch; flex-direction: column; gap: .7rem; }
    .delivery-view-switch { width: 100%; }
    .delivery-view-switch .btn { flex: 1 1 0; }
    .delivery-list-table, .delivery-list-table tbody { display: block; width: 100%; }
    .delivery-list-table thead { display: none; }
    .delivery-list-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .8rem; margin-bottom: .55rem; padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .delivery-list-table td { display: block; width: auto; padding: 0; border: 0; text-align: left; font-size: .84rem; line-height: 1.25; }
    .delivery-list-table td::before { content: attr(data-label); display: block; margin-bottom: .12rem; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .delivery-list-table .delivery-list-identity, .delivery-list-table .delivery-list-client, .delivery-list-table .delivery-list-actions { grid-column: 1 / -1; }
    .delivery-list-table .delivery-list-identity { padding-bottom: .5rem; border-bottom: 1px solid #edf1f5; font-size: .9rem; }
    .delivery-list-table .delivery-list-client { font-size: .86rem; }
    .delivery-list-table .delivery-list-status, .delivery-list-table .delivery-list-amount { padding: .2rem 0; border-radius: 0; background: transparent; }
    .delivery-list-table .delivery-list-amount { font-size: .86rem; }
    .delivery-list-table .delivery-list-status .status-chip { display: inline-flex; gap: .25rem; padding: 0; border-radius: 0; background: transparent; font-size: .7rem; font-weight: 750; }
    .delivery-list-table .delivery-list-status .status-chip::before { width: 6px; height: 6px; }
    .delivery-list-table .delivery-list-actions { margin-top: .1rem; }
    .delivery-list-table .delivery-list-actions::before { display: none; }
    .delivery-list-table .delivery-actions { clear: none; }
    .delivery-list-table .delivery-actions .btn { min-height: 42px !important; padding: .4rem .55rem; font-size: .76rem; }
    .dashboard-recent-heading { align-items: flex-start; }
    .dashboard-view-switch { margin-bottom: .65rem; }
    .dashboard-recent-list-table, .dashboard-recent-list-table tbody { display: block; width: 100%; }
    .dashboard-recent-list-table thead { display: none; }
    .dashboard-recent-list-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .8rem; margin-bottom: .55rem; padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .dashboard-recent-list-table td { display: block; width: auto; padding: 0; border: 0; text-align: left; font-size: .84rem; line-height: 1.25; }
    .dashboard-recent-list-table td::before { content: attr(data-label); display: block; margin-bottom: .12rem; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .dashboard-recent-list-table .dashboard-recent-list-identity, .dashboard-recent-list-table .dashboard-recent-list-client, .dashboard-recent-list-table .dashboard-recent-list-action { grid-column: 1 / -1; }
    .dashboard-recent-list-table .dashboard-recent-list-identity { padding-bottom: .5rem; border-bottom: 1px solid #edf1f5; font-size: .9rem; }
    .dashboard-recent-list-table .dashboard-recent-list-client { font-size: .86rem; }
    .dashboard-recent-list-table .dashboard-recent-list-status, .dashboard-recent-list-table .dashboard-recent-list-amount { padding: .2rem 0; }
    .dashboard-recent-list-table .dashboard-recent-list-status .status-chip { display: inline-flex; gap: .25rem; padding: 0; border-radius: 0; background: transparent; font-size: .7rem; }
    .dashboard-recent-list-table .dashboard-recent-list-status .status-chip::before { width: 6px; height: 6px; }
    .dashboard-recent-list-table .dashboard-recent-list-amount { font-size: .86rem; }
    .dashboard-recent-list-table .dashboard-recent-list-action { margin-top: .1rem; }
    .dashboard-recent-list-table .dashboard-recent-list-action::before { display: none; }
    .dashboard-recent-list-table .dashboard-recent-list-action .btn { width: 100%; min-height: 42px !important; padding: .4rem .55rem; font-size: .76rem; }
    .dashboard-filter-card { padding: .9rem 1rem; border-radius: 16px; }
    .dashboard-filter-summary { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
    .process-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
    .process-step { min-height: 82px; padding: .6rem .45rem; border-radius: 13px; }
    .process-step i { font-size: 1.1rem; }
    .process-step strong { font-size: .75rem; }
    .process-step .small { font-size: .62rem; line-height: 1.15; }
    .orders-list-section { padding: .75rem; border-radius: 16px; background: transparent; border: 0; box-shadow: none; }
    .orders-list-heading { align-items: stretch; flex-direction: column; gap: .7rem; padding-inline: .2rem; }
    .orders-view-switch { width: 100%; }
    .orders-view-switch .btn { flex: 1 1 0; }
    .orders-list-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; margin-bottom: .85rem; padding: 1rem; border-radius: 16px; box-shadow: 0 8px 22px rgba(20,33,61,.06); }
    .orders-list-table td { width: auto; padding: 0; text-align: left; }
    .orders-list-table td::before { float: none; display: block; width: auto; margin-bottom: .18rem; padding: 0; }
    .orders-list-table .order-list-identity { grid-column: 1 / -1; padding-bottom: .7rem; border-bottom: 1px solid #edf1f5; }
    .orders-list-table .order-list-identity::before, .orders-list-table .order-list-action-cell::before { display: none; }
    .order-list-number { display: flex; justify-content: space-between; font-size: 1rem; }
    .order-list-number i { font-size: .9rem; }
    .orders-list-table .order-list-client, .orders-list-table .order-list-seller, .orders-list-table .order-list-date, .orders-list-table .order-list-tracking, .orders-list-table .order-list-action-cell { grid-column: 1 / -1; }
    .orders-list-table .order-list-client { color: var(--ink); font-size: .95rem; font-weight: 700; line-height: 1.35; }
    .orders-list-table .order-list-units, .orders-list-table .order-list-total { padding: .65rem .75rem; border-radius: 11px; background: #f4f7fb; }
    .orders-list-table .order-list-tracking { padding-top: .2rem; }
    .orders-list-table .order-list-action { width: 100%; }
    .orders-list-table .empty-state { display: block; }
    .orders-compact-table, .orders-compact-table tbody { display: block; width: 100%; }
    .orders-compact-table thead { display: none; }
    .orders-compact-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .8rem; margin-bottom: .55rem; padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .orders-compact-table td { display: block; width: auto; padding: 0; border: 0; text-align: left; font-size: .84rem; line-height: 1.25; }
    .orders-compact-table td::before { content: attr(data-label); display: block; margin-bottom: .12rem; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .orders-compact-table .orders-compact-identity, .orders-compact-table .orders-compact-client, .orders-compact-table .orders-compact-action { grid-column: 1 / -1; }
    .orders-compact-table .orders-compact-identity { padding-bottom: .5rem; border-bottom: 1px solid #edf1f5; font-size: .9rem; }
    .orders-compact-table .orders-compact-client { font-size: .86rem; }
    .orders-compact-table .orders-compact-status, .orders-compact-table .orders-compact-total { padding: .2rem 0; }
    .orders-compact-table .orders-compact-status .status-chip { display: inline-flex; gap: .25rem; padding: 0; border-radius: 0; background: transparent; font-size: .7rem; }
    .orders-compact-table .orders-compact-status .status-chip::before { width: 6px; height: 6px; }
    .orders-compact-table .orders-compact-total { font-size: .86rem; }
    .orders-compact-table .orders-compact-action { margin-top: .1rem; }
    .orders-compact-table .orders-compact-action::before { display: none; }
    .orders-compact-table .orders-compact-action .btn { width: 100%; min-height: 42px !important; padding: .4rem .55rem; font-size: .76rem; }
    .order-detail-products-table tbody tr, .order-review-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; padding: .9rem; }
    .order-detail-products-table td, .order-review-table td { width: auto; padding: 0; text-align: left; }
    .order-detail-products-table td::before, .order-review-table td::before { float: none; display: block; width: auto; margin-bottom: .15rem; padding: 0; }
    .order-detail-products-table td[data-label="Producto"], .order-review-table td[data-label="Producto"] { grid-column: 1 / -1; padding-bottom: .65rem; border-bottom: 1px solid #edf1f5; }
    .order-detail-products-table tfoot { display: block; margin-top: .75rem; }
    .order-detail-products-table tfoot tr { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border: 0; border-radius: 12px; color: white; background: var(--ink); }
    .order-detail-products-table tfoot th { display: block; padding: 0; border: 0; color: white; }
    .order-detail-facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem 0; margin-inline: 0; }
    .order-detail-facts dt, .order-detail-facts dd { width: auto; max-width: none; flex: none; margin: 0; padding-inline: 0; }
    .order-detail-facts dt { margin-top: .55rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .order-detail-facts dd { margin-bottom: .35rem; color: var(--ink); font-weight: 650; line-height: 1.35; }
    .billing-item { padding: .9rem; }
    .billing-review-button { width: 100%; }
    .billing-item-heading { align-items: flex-start; }
    .billing-item-hint { display: block; margin: .2rem 0 0; }
    .billing-item-actions { gap: .3rem; }
    .billing-item-edit-label, .billing-item-action-label, .billing-item-remove-label { display: none; }
    .billing-item-grid { grid-template-columns: minmax(0, 1fr); }
    .billing-item-product { grid-column: auto; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .brand-lockup small, .user-summary { display: none; }
    .pwa-install-label { display: none; }
}

@media (min-width: 576px) {
    .process-rail { grid-template-columns: repeat(3, 1fr); }
    .process-step { min-height: 122px; }
    .d-grid-mobile { display: flex; gap: .5rem; }
    .d-grid-mobile .btn { width: auto; }
    .mobile-card-table { display: table; }
    .mobile-card-table thead { display: table-header-group; }
    .mobile-card-table tbody { display: table-row-group; }
    .mobile-card-table tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
    .mobile-card-table td { display: table-cell; width: auto; border-bottom: var(--bs-border-width) solid var(--bs-border-color); padding: .9rem .75rem; text-align: inherit; }
    .mobile-card-table td::before, .mobile-card-table td::after { display: none; }
}

@media (min-width: 768px) {
    .order-create-header { flex-direction: row-reverse; align-items: flex-start; justify-content: space-between; }
    .section-card { padding: 1.35rem; }
    .kpi-card { padding: 1.35rem; }
    .auth-card { padding: 2rem; }
    .auth-content { padding-block: 3rem; }
    .auth-login-card {
        width: min(100%, 960px);
        min-height: 520px;
        padding: 0;
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    }
    .auth-login-card .auth-hero {
        min-height: 520px;
        margin: 0;
        padding: clamp(2.5rem, 5vw, 4.5rem);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        color: white;
        background:
            radial-gradient(circle at 85% 15%, rgba(255,255,255,.16), transparent 30%),
            linear-gradient(145deg, #315ea8 0%, #243b6b 48%, #14213d 100%);
    }
    .auth-login-card .auth-hero .page-kicker { margin-top: 2.1rem; color: #c9dcff; }
    .auth-login-card .auth-hero .page-title { max-width: 470px; color: white; font-size: clamp(2.5rem, 4.2vw, 4rem); line-height: 1.02; }
    .auth-login-card .auth-hero .company-system-title { font-size: clamp(2.65rem, 4vw, 3.75rem); }
    .auth-login-card .auth-hero .page-subtitle { max-width: 430px; margin-top: 1.25rem; color: rgba(255,255,255,.76); font-size: 1.05rem; }
    .auth-login-card .auth-hero-note { display: flex; align-items: center; gap: .6rem; margin: 2rem 0 0; color: rgba(255,255,255,.72); font-size: .88rem; }
    .auth-login-card .auth-form-panel { padding: clamp(2.5rem, 5vw, 4.5rem); display: flex; flex-direction: column; justify-content: center; }
    .auth-login-card .form-control { min-height: 50px !important; }
    .auth-login-card .btn { min-height: 50px !important; }
}
