.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, #ffffff 0, #eef4ff 42%, #dfe9f7 100%);
}

.login-wrap {
    width: min(440px, calc(100% - 24px));
}

.login-card {
    padding: 30px 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

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

.login-card h1 {
    margin: 0 0 6px;
    font-size: clamp(30px, 5vw, 36px);
    line-height: 1.05;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.login-help {
    margin-top: 18px;
}

.pwa-install-button {
    cursor: pointer;
}

.login-card .pwa-install-button {
    margin-top: 12px;
}

button.sidebar-account {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.alert.danger {
    background: #ffe8e8;
    color: var(--danger);
}

.alert.success {
    background: #e8fff3;
    color: var(--success);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

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

.stat-card {
    min-width: 0;
    display: grid;
    gap: 10px;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: clamp(22px, 4vw, 28px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 22px;
    align-items: start;
}

.dashboard-stack {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.chart-card,
.summary-card {
    min-width: 0;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-card header,
.summary-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.chart-card header > div,
.summary-card header > div {
    min-width: 0;
}

.chart-card h2,
.summary-card h2 {
    margin: 0;
    font-size: clamp(20px, 3vw, 24px);
    line-height: 1.18;
}

.chart-card p,
.summary-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.chart-shell {
    min-width: 0;
    display: grid;
    gap: 14px;
    overflow: hidden;
}

.chart-bars {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(var(--chart-count, 7), minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    min-height: 240px;
    padding: 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(45, 122, 120, 0.03) 0%, rgba(45, 122, 120, 0) 100%),
        var(--card-soft);
    border: 1px solid #e7f1ee;
}

.chart-bar {
    display: grid;
    gap: 8px;
    align-content: end;
    min-width: 0;
}

.chart-bar-meter {
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: end;
}

.chart-bar-fill {
    width: 100%;
    min-height: 14px;
    border-radius: 16px 16px 6px 6px;
    background: linear-gradient(180deg, #59aba5 0%, #2d7a78 100%);
    box-shadow: 0 12px 24px rgba(45, 122, 120, 0.18);
}

.chart-bar-fill.out {
    background: linear-gradient(180deg, #f48f8f 0%, #d92727 100%);
    box-shadow: 0 12px 24px rgba(217, 39, 39, 0.16);
}

.chart-bar strong,
.chart-bar span {
    display: block;
    text-align: center;
}

.chart-bar strong {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar span {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.legend-chip::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #59aba5 0%, #2d7a78 100%);
}

.legend-chip.out::before {
    background: linear-gradient(180deg, #f48f8f 0%, #d92727 100%);
}

.summary-list {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.summary-item {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-soft);
}

.summary-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    min-width: 0;
}

.summary-item-top strong {
    min-width: 0;
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.summary-item-top span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6f0ed;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2d7a78, #80c0bb);
}

.summary-note {
    color: var(--muted);
    font-size: 12px;
}

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.section-gap {
    margin-top: 22px;
}

.small-table {
    max-height: none;
}

.money-out {
    color: var(--danger);
    font-weight: 800;
}

.pill.ok {
    background: #e8fff3;
    color: var(--success);
}

.pill.out {
    background: #ffecec;
    color: var(--danger);
}

.movement-form h2 {
    margin-top: 24px;
}

.items-box {
    border: 1px solid var(--line);
    border-radius: 16px;
    max-height: 460px;
    overflow-y: auto;
}

.items-table {
    min-width: 780px;
}

.purchase-form {
    padding: 16px;
}

.purchase-form h2 {
    margin-top: 18px;
    margin-bottom: 12px;
    font-size: 18px;
}

.purchase-items-box {
    max-height: none;
    overflow: visible;
}

.purchase-items-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.purchase-items-table th,
.purchase-items-table td {
    padding: 9px 8px;
    vertical-align: top;
}

.purchase-items-table th:nth-child(1),
.purchase-items-table td:nth-child(1) {
    width: auto;
}

.purchase-items-table th:nth-child(2),
.purchase-items-table td:nth-child(2) {
    width: 92px;
}

.purchase-items-table th:nth-child(3),
.purchase-items-table td:nth-child(3) {
    width: 112px;
}

.purchase-items-table th:nth-child(4),
.purchase-items-table td:nth-child(4) {
    width: 104px;
}

.purchase-items-table th:nth-child(5),
.purchase-items-table td:nth-child(5) {
    width: 46px;
}

.purchase-items-table .product-picker {
    min-width: 0;
}

.purchase-items-table input {
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 14px;
}

.purchase-items-table .product-search {
    padding-right: 34px;
}

.purchase-items-table .hint {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.purchase-items-table .row-subtotal {
    white-space: nowrap;
    font-size: 14px;
}

.purchase-items-table .btn.small {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 12px;
}

.sale-layout .quote-card {
    top: 24px;
}

.sale-layout > div,
.sale-layout > aside {
    min-width: 0;
}

.sale-quote-card .cart-items {
    max-height: 44vh;
}

.sale-quote-actions {
    display: grid;
    gap: 10px;
}

.sale-cart-row {
    grid-template-columns: 88px 1fr auto;
}

.sale-cart-status {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.sale-browser,
.sale-results-wrap,
.sale-results-table,
.sale-history-records {
    min-width: 0;
}

.sale-modal-head h2 {
    margin: 0;
}

.sale-inline-total span,
.sale-checkout-resume span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.sale-inline-total strong,
.sale-checkout-resume strong {
    display: block;
    margin-top: 8px;
    color: var(--primary);
    font-size: 28px;
}

.sale-filters {
    margin: 0 18px 18px;
}

.sale-browser-table {
    max-height: none;
}

.sale-browser-range {
    text-align: right;
}

.sale-browser-range strong,
.sale-browser-range span {
    display: block;
}

.sale-browser-range strong {
    font-size: 24px;
    color: var(--primary);
}

.sale-browser-range span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid var(--line);
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-chip {
    min-width: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #44615c;
    text-align: center;
    font-weight: 700;
}

.page-chip.active,
.page-chip:hover {
    border-color: var(--primary);
    background: #edf7f5;
    color: var(--primary);
}

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

.sale-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.sale-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(19, 37, 36, 0.48);
}

.sale-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 28px));
    max-height: calc(100vh - 36px);
    margin: 18px auto;
    overflow: auto;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(19, 37, 36, 0.22);
}

.sale-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 0;
}

.sale-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #eef4f2;
    color: #45635f;
    cursor: pointer;
    font: inherit;
}

.sale-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 24px 0;
}

.sale-step-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: #eef4f2;
    color: var(--muted);
    font-weight: 700;
}

.sale-step-pill.active {
    background: var(--primary);
    color: #fff;
}

.sale-checkout-form {
    padding: 20px 24px 24px;
}

.sale-cart-box {
    max-height: 420px;
}

.sale-history-card {
    margin: 0 24px 24px;
}

.sale-history-table {
    max-height: 56vh;
}

.sale-inline-total,
.sale-checkout-resume {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f7fbfa;
}

.sale-step-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

body.modal-open {
    overflow: hidden;
}

.search-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -2px 0 14px;
    padding: 14px 16px;
    border: 1px solid #dceae6;
    border-radius: 16px;
    background: #f4faf8;
}

.search-helper strong {
    font-size: clamp(22px, 4vw, 28px);
    color: var(--primary);
}

.search-helper span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.search-helper p {
    max-width: 540px;
    margin: 0;
    text-align: right;
}

.sale-warning {
    margin: 0 18px 18px;
}

.sale-mobile-bar[hidden],
.purchase-mobile-bar[hidden] {
    display: none !important;
}

.sale-mobile-bar,
.purchase-mobile-bar {
    display: none;
}

.sale-mobile-summary,
.purchase-mobile-summary {
    min-width: 0;
}

.sale-mobile-summary span,
.sale-mobile-summary small,
.purchase-mobile-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.sale-mobile-summary strong {
    display: block;
    margin-top: 2px;
    color: var(--success);
    font-size: 24px;
}

.purchase-mobile-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--danger);
    font-size: 24px;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #dceae6;
    border-radius: 999px;
    background: #fff;
    color: #44615c;
    font-weight: 700;
}

.quick-chip.active,
.quick-chip:hover {
    border-color: var(--primary);
    background: #edf7f5;
    color: var(--primary);
}

.products-filter-panel {
    align-items: end;
}

.product-admin-quick-filters {
    margin-top: -6px;
}

.lookup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.lookup-head h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
}

.lookup-head p {
    margin: 0;
}

.lookup-head-stat {
    min-width: 178px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: right;
}

.lookup-head-stat strong,
.lookup-head-stat span {
    display: block;
}

.lookup-head-stat strong {
    color: var(--primary);
    font-size: 34px;
    line-height: 1;
}

.lookup-head-stat span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.lookup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
    gap: 18px;
    align-items: start;
}

.lookup-main {
    min-width: 0;
}

.lookup-search-panel {
    position: sticky;
    top: 12px;
    z-index: 5;
    align-items: end;
    padding: 14px;
    border-radius: 16px;
}

.lookup-search-panel input,
.lookup-search-panel select {
    min-height: 46px;
}

.lookup-quick-filters {
    flex-wrap: nowrap;
    margin-top: -4px;
    padding-bottom: 4px;
    overflow-x: auto;
}

.lookup-quick-filters .quick-chip {
    flex: 0 0 auto;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
}

.lookup-result-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dceae6;
    border-radius: 14px;
    background: #f8fcfb;
}

.lookup-result-strip strong,
.lookup-result-strip span {
    display: block;
}

.lookup-result-strip strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.lookup-result-strip span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.lookup-result-strip p {
    margin: 0;
    text-align: right;
}

.lookup-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.lookup-product-card,
.lookup-empty,
.documents-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.lookup-product-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.lookup-product-card header {
    display: grid;
    gap: 7px;
}

.lookup-product-card header strong {
    line-height: 1.25;
}

.lookup-product-card header small {
    color: #253f3b;
    font-weight: 800;
    line-height: 1.35;
}

.lookup-product-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.lookup-product-facts span {
    min-width: 0;
    padding: 9px;
    border: 1px solid #edf3f2;
    border-radius: 12px;
    background: #fbfefd;
}

.lookup-product-facts small,
.lookup-product-buy span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lookup-product-facts b {
    display: block;
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: #1f3632;
    font-size: 16px;
}

.lookup-product-buy {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f3faf8;
}

.lookup-product-buy strong {
    display: block;
    margin-top: 2px;
    font-size: 22px;
    line-height: 1;
}

.lookup-product-buy small {
    color: var(--muted);
    text-align: right;
}

.lookup-product-detail {
    border-top: 1px solid #edf3f2;
    padding-top: 8px;
}

.lookup-product-detail summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.lookup-product-detail p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.lookup-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 4px;
    padding: 26px;
    color: var(--muted);
    text-align: center;
}

.lookup-empty strong {
    color: var(--text);
}

.quote-workspace {
    top: 12px;
    padding: 16px;
    border-radius: 16px;
}

.purchase-workspace {
    top: 12px;
}

.purchase-product-cost {
    background: #fff6f4;
}

.purchase-cart-edit-grid b {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 9px;
    border: 1px solid #edf3f2;
    border-radius: 10px;
    background: #fbfefd;
    font-size: 14px;
}

.quote-workspace-title {
    align-items: flex-start;
}

.quote-workspace-title h2,
.quote-workspace-title span {
    display: block;
}

.quote-workspace-title span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.quote-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quote-close {
    display: none;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #eef3f2;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.quote-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.quote-fields .field {
    min-width: 0;
}

.quote-fields textarea {
    min-height: 74px;
}

.quote-cart-items {
    max-height: calc(100vh - 520px);
    min-height: 84px;
}

.quote-cart-item {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
}

.quote-cart-item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: start;
}

.quote-cart-item-head strong {
    margin: 0;
    line-height: 1.25;
}

.quote-cart-item-head small {
    margin-top: 4px;
}

.quote-cart-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quote-cart-edit-grid label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.quote-cart-edit-grid label > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.quote-cart-edit-grid input {
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 10px;
    font-size: 14px;
}

.quote-cart-subtotals {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #edf3f2;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.quote-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.quote-action-grid .btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.documents-panel {
    margin-top: 18px;
    overflow: hidden;
}

.document-list {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.document-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #edf3f2;
    border-radius: 14px;
    background: #fbfefd;
}

.document-card strong,
.document-card span,
.document-card small {
    display: block;
}

.document-card > div:first-child span,
.document-card small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.document-card-total {
    text-align: right;
}

.document-card-total strong {
    margin-top: 6px;
}

.document-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.document-actions form {
    margin: 0;
}

.document-filter-panel {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 440px;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
}

.document-filter-panel .field,
.document-filter-panel .field.grow,
.document-filter-panel .field.narrow {
    width: 100%;
    min-width: 0;
    flex: initial;
    align-items: stretch;
}

.document-filter-panel label {
    text-align: left;
}

.document-filter-panel input,
.document-filter-panel select {
    min-height: 46px;
}

.document-filter-panel .btn,
.document-filter-panel a.btn {
    width: 100%;
    min-height: 44px;
}

.quote-mobile-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(45, 122, 120, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 40px rgba(19, 37, 36, 0.14);
    backdrop-filter: blur(12px);
}

.quote-mobile-bar span,
.quote-mobile-bar small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.quote-mobile-bar strong {
    display: block;
    margin-top: 2px;
    color: var(--primary);
    font-size: 20px;
    line-height: 1.1;
}

.quote-mobile-bar .btn {
    width: auto;
    min-width: 104px;
    flex: 0 0 auto;
}

.documents-board {
    display: grid;
    gap: 12px;
}

.document-list-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.document-list-main {
    min-width: 0;
}

.document-list-main h2 {
    margin: 8px 0 4px;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.2;
}

.document-list-main p,
.document-list-main small {
    display: block;
    margin: 0;
    color: var(--muted);
}

.document-list-main small {
    margin-top: 6px;
    line-height: 1.4;
}

.document-list-side {
    text-align: right;
}

.document-list-side strong {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    color: var(--success);
}

.document-list-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.document-list-actions form {
    margin: 0;
}

.catalog-hero {
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: -8px 0 18px;
    padding: 28px;
    border-radius: 20px;
    background:
        linear-gradient(90deg, rgba(10, 34, 31, 0.82), rgba(10, 34, 31, 0.38)),
        url("../img/categorias/pernos.webp") center / cover no-repeat;
    color: #fff;
    overflow: hidden;
}

.catalog-hero .eyebrow,
.catalog-hero .hint {
    color: rgba(255, 255, 255, 0.82);
}

.catalog-hero h1 {
    margin: 0;
    font-size: clamp(38px, 7vw, 68px);
    line-height: 0.95;
}

.catalog-hero p {
    max-width: 62ch;
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.88);
}

.catalog-hero-actions {
    width: min(100%, 286px);
    display: grid;
    gap: 9px;
    flex: 0 0 auto;
}

.catalog-hero-total {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    text-align: right;
}

.catalog-hero-total strong,
.catalog-hero-total span {
    display: block;
}

.catalog-hero-total strong {
    font-size: 34px;
    line-height: 1;
}

.catalog-hero-total span {
    margin-top: 4px;
    font-size: 12px;
}

.catalog-pdf-button {
    min-height: 66px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    background: #fff;
    color: #0a4f49;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(2, 23, 27, 0.26);
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.catalog-pdf-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(2, 23, 27, 0.34);
}

.catalog-pdf-button:focus-visible {
    outline: 3px solid rgba(109, 230, 211, 0.75);
    outline-offset: 3px;
}

.catalog-pdf-button.is-loading {
    cursor: wait;
    opacity: 0.78;
    transform: none;
    pointer-events: none;
}

.catalog-pdf-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #e3f4f1;
    color: #0b766c;
}

.catalog-pdf-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.catalog-pdf-button.is-loading .catalog-pdf-icon {
    animation: catalog-pdf-pulse 900ms ease-in-out infinite alternate;
}

.catalog-pdf-copy {
    min-width: 0;
}

.catalog-pdf-copy strong,
.catalog-pdf-copy small {
    display: block;
}

.catalog-pdf-copy strong {
    font-size: 14px;
    line-height: 1.2;
}

.catalog-pdf-copy small {
    margin-top: 4px;
    color: #617875;
    font-size: 11px;
    line-height: 1.25;
}

.catalog-hero .catalog-pdf-status {
    min-height: 15px;
    margin: 0 2px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
}

@keyframes catalog-pdf-pulse {
    from { transform: scale(0.9); }
    to { transform: scale(1.04); }
}

.catalog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
    gap: 18px;
    align-items: start;
}

.catalog-main {
    min-width: 0;
}

.catalog-search {
    position: sticky;
    top: 12px;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
}

.catalog-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    gap: 10px;
    width: 100%;
}

.catalog-search-row .field,
.catalog-search-row .field.grow {
    min-width: 0;
    width: 100%;
    flex: initial;
}

.catalog-filter-toggle,
.catalog-search-submit {
    min-height: 46px;
    align-self: end;
    white-space: nowrap;
}

.catalog-filter-toggle {
    min-width: 88px;
}

.catalog-search-submit {
    min-width: 82px;
}

.catalog-category-field {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.catalog-category-field[hidden] {
    display: none;
}

.catalog-category-filter {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
    max-height: 176px;
    overflow-y: auto;
    padding: 2px 3px 2px 0;
    scrollbar-width: thin;
}

.catalog-category-option {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 7px;
    border: 1px solid #d6e7e3;
    border-radius: 12px;
    background: #fbfefe;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-shadow: 0 8px 18px rgba(18, 38, 37, 0.05);
}

.catalog-category-option:hover,
.catalog-category-option:focus-visible {
    border-color: rgba(45, 122, 120, 0.5);
    outline: none;
}

.catalog-category-option.active {
    border-color: var(--primary);
    background: #eef8f6;
    box-shadow: 0 10px 22px rgba(45, 122, 120, 0.14);
}

.catalog-category-filter-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    padding: 4px;
    border-radius: 10px;
    background: #f5fbfa;
}

.catalog-category-option span {
    min-width: 0;
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dceae6;
    border-radius: 14px;
    background: #f8fcfb;
}

.catalog-result-bar strong,
.catalog-result-bar span {
    display: block;
}

.catalog-result-bar strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.catalog-result-bar span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.catalog-result-bar p {
    margin: 0;
    text-align: right;
}

.catalog-selected-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(45, 122, 120, 0.22);
    border-radius: 14px;
    background: #eef8f6;
}

.catalog-selected-bar[hidden] {
    display: none;
}

.catalog-selected-bar span,
.catalog-selected-bar strong {
    display: block;
}

.catalog-selected-bar span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.catalog-selected-bar strong {
    margin-top: 2px;
    font-size: 14px;
    line-height: 1.2;
}

.catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.catalog-product {
    min-width: 0;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 10px 24px rgba(18, 38, 37, 0.06);
}

.catalog-product.selected {
    border-color: rgba(45, 122, 120, 0.48);
    box-shadow: 0 14px 28px rgba(45, 122, 120, 0.14);
}

.catalog-product-select,
.catalog-product-info {
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.catalog-product-select {
    padding: 8px;
}

.catalog-product-thumb {
    width: 72px;
    height: 64px;
    object-fit: contain;
    padding: 6px;
    border-radius: 10px;
    background: #f8fcfb;
}

.catalog-product-info {
    display: grid;
    gap: 5px;
    padding: 9px 10px;
}

.catalog-product-name {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.22;
}

.catalog-product-meta {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.28;
}

.catalog-product-action {
    display: grid;
    justify-items: end;
    gap: 6px;
    padding: 8px;
    border-left: 1px solid #edf3f2;
}

.catalog-product-action .price {
    font-size: 14px;
    line-height: 1.1;
    white-space: nowrap;
}

.catalog-cart {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.catalog-cart-body {
    display: grid;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}

.catalog-cart .cart-items {
    max-height: min(36vh, 320px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}

.catalog-order-form {
    display: grid;
    gap: 10px;
    margin-top: 0;
    min-height: 0;
}

.catalog-order-form .field {
    min-width: 0;
}

.catalog-cart-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.catalog-cart-row strong {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--success);
    text-align: right;
}

.category-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.category-gallery.is-filtered {
    grid-template-columns: minmax(138px, 220px);
    justify-content: start;
}

.category-card {
    min-width: 0;
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid #dceae6;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(20, 55, 52, 0.06);
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    box-shadow: 0 16px 34px rgba(45, 122, 120, 0.12);
    transform: translateY(-1px);
}

.category-card-image {
    width: 100%;
    aspect-ratio: 13 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fcfb;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-card-name,
.category-card-count {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-card-name {
    color: #1f3632;
    font-size: 13px;
    font-weight: 800;
}

.category-card-count {
    color: var(--muted);
    font-size: 11px;
}

.product-picker {
    position: relative;
    min-width: 360px;
}

.product-search {
    padding-right: 42px;
}

.product-selection,
.product-row-status {
    display: block;
    margin-top: 8px;
    line-height: 1.4;
}

.product-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 4;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(18, 39, 74, 0.14);
}

.product-result {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 12px;
    background: #f5fbfa;
    text-align: left;
    cursor: pointer;
}

.product-result strong,
.product-result span {
    display: block;
}

.product-result strong {
    color: #1f3632;
    font-size: 14px;
}

.product-result span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.product-result.active,
.product-result:hover {
    background: #eaf5f3;
}

.empty-state {
    color: var(--muted);
    cursor: default;
}

.danger-text {
    color: var(--danger);
    font-weight: 700;
}

.movement-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.movement-total {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}

.movement-total strong {
    color: var(--success);
    font-size: 20px;
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.adjustment-stats {
    margin-bottom: 22px;
}

.adjustment-form h2,
.adjustment-preview h2 {
    margin: 0 0 18px;
    font-size: clamp(20px, 3vw, 24px);
}

.adjustment-preview {
    display: grid;
    gap: 18px;
}

.adjustment-preview-head,
.adjustment-apply {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.adjustment-preview-head h2 {
    margin-bottom: 0;
}

.adjustment-preview-stats {
    margin-bottom: 0;
}

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

.adjustment-totals div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-soft);
}

.adjustment-totals span,
.adjustment-totals strong {
    display: block;
}

.adjustment-totals span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.adjustment-totals strong {
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 16px;
}

.adjustment-preview-table {
    box-shadow: none;
}

.adjustment-apply {
    padding: 14px;
    border: 1px solid rgba(45, 122, 120, 0.18);
    border-radius: 16px;
    background: #f3faf8;
}

.adjustment-apply .hint {
    text-align: right;
}

@media (max-width: 1480px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
    }
}

@media (max-width: 1360px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1150px) {
    .stats-grid,
    .stats-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .sale-modal-dialog {
        width: min(100%, calc(100% - 20px));
    }

    .sale-modal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-modal-close {
        align-self: flex-end;
    }

    .sale-cart-row {
        grid-template-columns: 1fr;
    }

    .sale-history-table {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .stats-grid,
    .stats-grid.three {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card,
    .chart-card,
    .summary-card {
        padding: 16px;
    }

    .chart-card header,
    .summary-card header {
        flex-direction: column;
        margin-bottom: 14px;
    }

    .chart-bars {
        gap: 8px;
        min-height: 200px;
        padding: 14px 12px;
    }

    .chart-bar strong {
        font-size: 11px;
    }

    .chart-bar-meter {
        min-height: 140px;
    }

    .sale-quote-card {
        display: none;
    }

    .sale-filters {
        margin: 0 14px 16px;
    }

    .sale-modal-dialog {
        width: min(100%, calc(100% - 14px));
        max-height: calc(100vh - 14px);
        margin: 7px auto;
    }

    .sale-modal-head,
    .sale-stepper,
    .sale-checkout-form {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sale-browser-range {
        text-align: left;
    }

    .sale-results-wrap,
    .sale-history-table,
    .purchase-items-box,
    .purchase-history-wrap {
        overflow: visible;
        max-height: none;
    }

    .sale-results-table,
    .sale-history-records,
    .sale-cart-table,
    .purchase-items-table,
    .purchase-history-records {
        min-width: 0;
    }

    .sale-cart-box {
        max-height: none;
    }

    .sale-page {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
    }

    .purchase-page {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
    }

    .sale-mobile-bar,
    .purchase-mobile-bar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 45;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 20px 40px rgba(19, 37, 36, 0.14);
        backdrop-filter: blur(12px);
    }

    .sale-mobile-bar {
        border: 1px solid rgba(45, 122, 120, 0.18);
    }

    .purchase-mobile-bar {
        border: 1px solid rgba(217, 39, 39, 0.12);
    }

    .sale-mobile-bar .btn,
    .purchase-mobile-bar .btn {
        width: auto;
        min-width: 132px;
        flex: 0 0 auto;
    }

    .sale-mobile-summary strong {
        color: var(--primary);
        font-size: 22px;
        line-height: 1.1;
    }

    .sale-mobile-summary small {
        display: none;
    }

    body.modal-open .sale-mobile-bar {
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
    }

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

    .pagination-bar .btn,
    .pagination-pages,
    .page-chip {
        width: 100%;
    }

    .sale-browser-range strong {
        font-size: 20px;
    }

    .search-helper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-helper p {
        max-width: none;
        text-align: left;
    }

    .product-picker {
        min-width: 0;
    }

    .sale-step-actions,
    .movement-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-step-actions .btn,
    .movement-actions .btn,
    .movement-total {
        width: 100%;
    }

    .sale-history-card {
        margin: 0 16px 16px;
    }

    .purchase-history-card {
        margin-bottom: 18px;
    }
}

@media (max-width: 640px) {
    .purchase-items-table,
    .purchase-items-table tbody,
    .purchase-items-table tr,
    .purchase-items-table td {
        display: block;
        width: 100% !important;
    }

    .purchase-items-table thead {
        display: none;
    }

    .purchase-items-table tbody {
        display: grid;
        gap: 10px;
        padding: 10px;
    }

    .purchase-items-table tr {
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
    }

    .purchase-items-table td {
        padding: 7px 0;
        border-bottom: 1px solid #edf3f2;
        text-align: left;
    }

    .purchase-items-table td:last-child {
        border-bottom: 0;
    }

    .purchase-items-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .purchase-items-table td.actions-cell {
        display: flex;
        justify-content: flex-end;
    }

    .purchase-items-table td.actions-cell::before {
        content: none;
    }
}

@media (max-width: 560px) {
    .login-wrap {
        width: min(100%, calc(100% - 14px));
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .sale-filters,
    .sale-warning {
        margin-left: 12px;
        margin-right: 12px;
    }

    .sale-modal-head,
    .sale-stepper,
    .sale-checkout-form {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sale-modal-close {
        width: 38px;
        height: 38px;
    }

    .sale-history-card {
        margin: 0 12px 12px;
    }

    .search-helper {
        padding: 12px 14px;
    }

    .quick-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-chip {
        justify-content: center;
    }

    .category-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .category-card {
        padding: 8px;
        border-radius: 14px;
    }

    .category-card-image {
        border-radius: 10px;
    }

    .sale-mobile-bar,
    .purchase-mobile-bar {
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        flex-direction: column;
        align-items: stretch;
    }

    .sale-mobile-bar {
        flex-direction: row;
        align-items: center;
    }

    .sale-mobile-bar .btn,
    .purchase-mobile-bar .btn {
        width: 100%;
        min-width: 0;
    }

    .sale-mobile-bar .btn {
        width: auto;
        min-width: 118px;
    }

    .sale-mobile-summary strong,
    .purchase-mobile-summary strong {
        font-size: 22px;
    }

    .sale-page,
    .purchase-page {
        padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }

    .chart-bars {
        grid-template-columns: repeat(var(--chart-count-mobile, 7), minmax(68px, 1fr));
        overflow-x: auto;
    }
}

.sale-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.sale-head h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
}

.sale-head .hint {
    margin: 6px 0 0;
}

.sale-head-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.sale-head-stat {
    min-width: 130px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.sale-head-stat strong,
.sale-head-stat span {
    display: block;
}

.sale-head-stat strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.sale-head-stat span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.sale-search-panel {
    position: sticky;
    top: 12px;
    z-index: 5;
    align-items: end;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 16px;
}

.sale-search-panel input,
.sale-search-panel select {
    min-height: 46px;
}

.sale-result-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #dceae6;
    border-radius: 14px;
    background: #f8fcfb;
}

.sale-result-strip strong,
.sale-result-strip span {
    display: block;
}

.sale-result-strip strong {
    color: var(--primary);
    font-size: 24px;
    line-height: 1;
}

.sale-result-strip span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.sale-result-strip p {
    margin: 0;
    text-align: right;
}

.sale-quick-filters {
    margin-bottom: 12px;
}

.sale-quick-filters .quick-chip {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
}

.sale-layout {
    grid-template-columns: minmax(0, 1fr) minmax(318px, 350px);
    gap: 18px;
}

.sale-results-card {
    border-radius: 16px;
}

.sale-results-card .table-head {
    padding: 14px 16px;
}

.sale-results-wrap {
    max-height: calc(100vh - 240px);
}

.sale-results-table {
    min-width: 0;
    table-layout: fixed;
}

.sale-results-table th,
.sale-results-table td {
    padding: 10px 12px;
}

.sale-results-table th:nth-child(1),
.sale-results-table td:nth-child(1) {
    width: 150px;
}

.sale-results-table th:nth-child(3),
.sale-results-table td:nth-child(3) {
    width: 132px;
}

.sale-results-table th:nth-child(4),
.sale-results-table td:nth-child(4) {
    width: 104px;
}

.sale-product-row td {
    background: #fff;
}

.sale-product-row:hover td {
    background: #f7fbfa;
}

.sale-product-title {
    display: block;
    line-height: 1.25;
}

.sale-price-cell strong,
.sale-price-cell small {
    display: block;
}

.sale-price-cell small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.sale-add-btn {
    min-width: 82px;
}

.sale-cart-head {
    align-items: flex-start;
}

.sale-cart-head h2,
.sale-cart-head span {
    display: block;
}

.sale-cart-head span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.sale-quote-card {
    border-radius: 16px;
    padding: 16px;
}

.sale-quote-card .cart-items {
    gap: 10px;
    max-height: calc(100vh - 330px);
    margin: 14px 0;
}

.sale-empty-cart {
    display: grid;
    gap: 4px;
    padding: 22px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: #f8fcfb;
    text-align: center;
}

.sale-empty-cart strong {
    font-size: 15px;
}

.sale-empty-cart span {
    color: var(--muted);
    font-size: 13px;
}

.sale-cart-item {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
}

.sale-cart-item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: start;
}

.sale-cart-item-head strong {
    margin: 0;
    line-height: 1.25;
}

.sale-cart-item-head small {
    margin-top: 4px;
}

.sale-remove-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #ffe8e8;
    color: var(--danger);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.sale-cart-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(86px, 0.9fr);
    gap: 8px;
}

.sale-cart-edit-grid label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.sale-cart-edit-grid label > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sale-cart-edit-grid input,
.sale-modal-input {
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 10px;
    font-size: 14px;
}

.sale-qty-control {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 5px;
}

.sale-qty-control button {
    border: 0;
    border-radius: 9px;
    background: #edf3f2;
    color: #24413d;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.sale-cart-item .cart-subtotal {
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid #edf3f2;
}

.sale-cart-total {
    margin-top: 10px;
}

.sale-cart-total strong {
    font-size: 26px;
}

.sale-checkout-row .sale-modal-input {
    max-width: 110px;
}

.sale-step-actions .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sale-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    max-width: min(320px, calc(100% - 32px));
    padding: 12px 14px;
    border: 1px solid rgba(45, 122, 120, 0.2);
    border-radius: 14px;
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 20px 40px rgba(19, 37, 36, 0.16);
    font-weight: 800;
}

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

    .lookup-search-panel {
        position: static;
    }

    .sale-layout {
        grid-template-columns: 1fr !important;
    }

    .sale-search-panel {
        position: static;
    }

    .sale-results-wrap {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .quote-mobile-bar {
        display: flex;
    }

    .document-list-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .document-list-side {
        text-align: left;
    }

    .document-list-actions {
        justify-content: stretch;
    }

    .document-list-actions form,
    .document-list-actions .btn,
    .document-list-actions a.btn {
        width: 100%;
    }

    .document-filter-panel {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .document-filter-panel .field,
    .document-filter-panel .field.grow,
    .document-filter-panel .field.narrow {
        width: 100%;
        min-width: 0;
    }

    .document-filter-panel label {
        margin-bottom: 1px;
    }

    .document-filter-panel .btn,
    .document-filter-panel a.btn {
        width: 100%;
    }

    .catalog-hero {
        min-height: 220px;
        display: block;
        padding: 22px;
        border-radius: 18px;
    }

    .catalog-hero-total {
        display: none;
    }

    .catalog-hero-actions {
        width: min(100%, 330px);
        margin-top: 20px;
    }

    .catalog-pdf-button {
        min-height: 62px;
    }

    .catalog-hero .catalog-pdf-status {
        text-align: left;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-search {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .catalog-search-row {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 7px;
    }

    .catalog-search .field,
    .catalog-search .field.grow,
    .catalog-search .btn {
        width: 100%;
        min-width: 0;
        flex: initial;
    }

    .catalog-search-row .btn {
        width: auto;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 13px;
    }

    .catalog-filter-toggle {
        min-width: 72px;
    }

    .catalog-search-submit {
        min-width: 68px;
    }

    .catalog-category-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 188px;
        gap: 7px;
    }

    .catalog-category-option {
        grid-template-columns: 38px minmax(0, 1fr);
        min-height: 54px;
        padding: 7px;
    }

    .catalog-category-filter-img {
        width: 38px;
        height: 38px;
    }

    .catalog-result-bar {
        display: block;
    }

    .catalog-result-bar p {
        margin-top: 8px;
        text-align: left;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-bottom: 88px;
    }

    .catalog-product {
        grid-template-columns: 58px minmax(0, 1fr) auto;
    }

    .catalog-product-select {
        padding: 6px;
    }

    .catalog-product-thumb {
        width: 58px;
        height: 54px;
    }

    .catalog-product-name {
        font-size: 13px;
    }

    .catalog-product-meta {
        font-size: 11px;
        max-height: 28px;
        overflow: hidden;
    }

    .catalog-product-action {
        gap: 5px;
        padding: 6px;
    }

    .catalog-product-action .price {
        font-size: 12px;
    }

    body.catalog-cart-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 81;
        background: rgba(15, 33, 32, 0.44);
        backdrop-filter: blur(4px);
    }

    .catalog-cart {
        position: fixed;
        inset: 12px;
        height: calc(100dvh - 24px);
        z-index: 82;
        max-height: none;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(18px) scale(0.98);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    .catalog-cart .quote-title {
        flex: 0 0 auto;
    }

    .catalog-cart-body {
        flex: 1 1 auto;
        overflow-y: auto;
        padding-right: 4px;
        overscroll-behavior: contain;
    }

    .catalog-cart .cart-items {
        max-height: min(28vh, 210px);
    }

    .catalog-order-form {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    body.catalog-cart-open {
        overflow: hidden;
    }

    body.catalog-cart-open .catalog-cart {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    body.catalog-cart-open .catalog-mobile-bar {
        opacity: 0;
        pointer-events: none;
    }

    .lookup-head {
        display: block;
        margin-bottom: 14px;
    }

    .lookup-head .eyebrow {
        margin-bottom: 4px;
    }

    .lookup-head h1 {
        font-size: 28px;
    }

    .lookup-head .hint {
        font-size: 12px;
    }

    .lookup-head-stat {
        display: none;
    }

    .lookup-search-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
        margin-bottom: 12px;
        align-items: end;
    }

    .lookup-search-panel .field,
    .lookup-search-panel .field.grow {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .lookup-search-panel .btn,
    .lookup-search-panel a.btn {
        width: 100%;
        min-height: 44px;
        flex: initial;
    }

    .lookup-result-strip {
        align-items: stretch;
    }

    .lookup-result-strip p {
        text-align: left;
    }

    .lookup-results {
        grid-template-columns: 1fr;
    }

    .lookup-product-card {
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
    }

    .lookup-product-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .lookup-product-facts span {
        padding: 8px;
    }

    .lookup-product-facts b {
        font-size: 14px;
    }

    .lookup-product-buy {
        align-items: center;
    }

    .quote-workspace {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        z-index: 80;
        max-height: calc(100vh - 16px);
        padding: 14px;
        border-radius: 18px;
        overflow-y: auto;
        opacity: 0;
        pointer-events: none;
        transform: translateY(18px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    body.quote-panel-open,
    body.purchase-panel-open {
        overflow: hidden;
    }

    body.quote-panel-open .quote-workspace,
    body.purchase-panel-open .purchase-workspace {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    body.quote-panel-open .quote-mobile-bar,
    body.purchase-panel-open .purchase-mobile-bar {
        opacity: 0;
        pointer-events: none;
        transform: translateY(18px);
    }

    .quote-close {
        display: grid;
    }

    .quote-cart-items {
        max-height: none;
    }

    .documents-panel {
        margin-bottom: 88px;
    }

    .document-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .document-card-total {
        text-align: left;
    }

    .document-actions {
        justify-content: stretch;
    }

    .document-actions form,
    .document-actions .btn {
        width: 100%;
    }

    .sale-head {
        display: block;
        gap: 12px;
        margin-bottom: 14px;
    }

    .sale-head .eyebrow {
        margin-bottom: 4px;
    }

    .sale-head .hint {
        font-size: 12px;
    }

    .sale-head-actions {
        display: flex;
        margin-top: 12px;
    }

    .sale-head-actions .btn {
        width: auto;
        min-height: 40px;
        padding: 9px 14px;
    }

    .sale-head-stat {
        display: none;
    }

    .sale-search-panel {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
        margin-bottom: 12px;
        align-items: end;
    }

    .sale-search-panel .field,
    .sale-search-panel .field.grow {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .sale-search-panel .btn,
    .sale-search-panel a.btn {
        width: 100%;
        min-height: 44px;
        flex: initial;
    }

    .sale-result-strip {
        width: 100%;
        align-items: stretch;
    }

    .sale-result-strip p {
        text-align: left;
    }

    .sale-quick-filters {
        display: flex;
        flex-wrap: nowrap;
        margin-right: -11px;
        padding-right: 11px;
        overflow-x: auto;
    }

    .sale-quick-filters .quick-chip {
        flex: 0 0 auto;
    }

    .sale-results-card .table-head {
        flex-direction: row;
        align-items: center;
    }

    .sale-results-table,
    .sale-results-table tbody,
    .sale-results-table tr,
    .sale-results-table td {
        display: block;
        width: 100% !important;
        min-width: 0;
    }

    .sale-results-table thead {
        display: none;
    }

    .sale-results-table tbody {
        display: grid;
        gap: 10px;
        padding: 10px;
    }

    .sale-product-row {
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        overflow: hidden;
    }

    .sale-results-table td {
        padding: 9px 10px;
        border-bottom: 0;
        text-align: left;
    }

    .sale-results-table td[data-label="Categoría"] {
        padding-bottom: 2px;
    }

    .sale-results-table td[data-label="Producto"] {
        padding-top: 6px;
    }

    .sale-price-cell {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 6px !important;
    }

    .sale-price-cell small {
        margin-top: 0;
        text-align: right;
    }

    .sale-results-table td.actions-cell {
        padding-top: 2px;
    }

    .sale-results-table td.actions-cell .btn {
        width: 100%;
        min-height: 42px;
    }

    .sale-mobile-bar {
        min-height: 68px;
    }

    .sale-mobile-summary strong {
        font-size: 20px;
    }

    .sale-toast {
        left: 12px;
        right: 12px;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .sale-cart-table,
    .sale-cart-table tbody,
    .sale-cart-table tr,
    .sale-cart-table td {
        display: block;
        width: 100% !important;
        min-width: 0;
    }

    .sale-cart-table thead {
        display: none;
    }

    .sale-cart-table tbody {
        display: grid;
        gap: 10px;
        padding: 10px;
    }

    .sale-cart-table tr {
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
    }

    .sale-cart-table td {
        padding: 7px 0;
        border-bottom: 1px solid #edf3f2;
        text-align: left;
    }

    .sale-cart-table td:last-child {
        border-bottom: 0;
    }

    .sale-cart-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .sale-checkout-row .sale-modal-input {
        max-width: none;
    }

    .sale-cart-table td.actions-cell {
        display: flex;
        justify-content: flex-end;
    }

    .sale-cart-table td.actions-cell::before {
        content: none;
    }
}

@media (max-width: 560px) {
    .catalog-search-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-search-row .field {
        grid-column: 1 / -1;
    }

    .catalog-search-row .btn {
        width: 100%;
    }

    .catalog-filter-toggle,
    .catalog-search-submit {
        min-width: 0;
    }

    .sale-head h1 {
        font-size: 28px;
    }

    .sale-head-actions {
        justify-content: flex-start;
    }

    .sale-result-strip {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sale-results-card .table-head {
        padding: 12px;
    }

    .sale-results-card .table-head span {
        font-size: 12px;
        text-align: right;
    }

    .sale-mobile-bar {
        padding: 10px;
        border-radius: 16px;
    }

    .sale-mobile-bar .btn {
        min-width: 112px;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 760px) {
    .page-head-actions,
    .adjustment-preview-head,
    .adjustment-apply {
        flex-direction: column;
        align-items: stretch;
    }

    .adjustment-totals {
        grid-template-columns: 1fr;
    }

    .adjustment-apply .hint {
        text-align: left;
    }
}
