/* Mobile-only layouts preserve desktop tables and printed documents. */
.mobile-filter-panel > summary { display: none; }
.sales-invoices-table { font-family: var(--font-ui); }
.sales-invoices-table thead,
.inventory-table thead,
.purchases-invoices-table thead,
.suppliers-table thead { background: #414b35; }
.sales-invoices-table th,
.inventory-table th,
.purchases-invoices-table th,
.suppliers-table th { color: #fff; font-size: .74rem; font-weight: 900; letter-spacing: .08em; border-bottom: 2px solid #303927; }
.sales-invoices-table td > a { color: #222; font-weight: 400; }
.sales-invoices-table td > .sales-invoice-primary { color: #111; font-weight: 700; }
.sales-invoices-table td > .sales-invoice-date { color: #45403a; }
.sales-invoices-table td > .sales-invoice-amount { color: #545048; font-size: .875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.sales-invoices-table td > .sales-invoice-balance { color: #111; font-size: 1.125rem; font-weight: 800; }
.sales-invoices-table td > a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
.sales-status-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; text-decoration: none; }
.sales-status-link:hover .sales-status { text-decoration: underline; text-underline-offset: .18em; }
.sales-status-link:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 8px; }
.sales-status { display: inline-block; padding: 5px 9px; border-radius: 8px; font-weight: 700; font-size: .875rem; line-height: 1.4; overflow-wrap: normal; color: #49443d; background: #ece8e2; }
.sales-status--paid { color: #384627; background: #e8eddf; }
.sales-status--partial { color: #70501e; background: #f4ead6; }
.sales-status--unpaid { color: #823c2f; background: #f4e2dd; }
.sales-status--cancelled { color: #49443d; background: #ece8e2; }
.customer-record-link { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 44px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.customer-record-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.customer-name .customer-record-link { text-decoration: underline; text-underline-offset: .18em; }
.customer-money .customer-record-link { justify-content: flex-end; }
.customer-record-link:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
.customer-detail h1, .customer-detail__fields dd { overflow-wrap: anywhere; }
.customer-detail__fields { margin: 0; }
.customer-detail__fields > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.customer-detail__fields dt { font-weight: 700; }
.customer-detail__fields dd { margin: 0; }
@media screen and (max-width: 760px) {
    .customer-money .customer-record-link { justify-content: flex-start; }
    .customer-detail__fields > div { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 0; }
}
.purchase-cell-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: .18em; overflow-wrap: anywhere; }
.purchase-cell-link:hover { text-decoration-thickness: 2px; }
.purchase-cell-link:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
.purchases-invoices-table .purchase-date { color: #45403a; font-weight: 400; }
.purchases-invoices-table .purchase-amount { color: #545048; font-size: .875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.purchases-invoices-table .purchase-balance { font-size: 1.125rem; }
.purchases-invoices-table bdi { min-width: 0; overflow-wrap: anywhere; }
.purchase-balance { color: #000; font-weight: 800; font-variant-numeric: tabular-nums; }
.purchase-status { display: inline-block; padding: 5px 9px; border-radius: 8px; font-weight: 700; font-size: .875rem; line-height: 1.4; overflow-wrap: normal; color: #49443d; background: #ece8e2; }
.purchase-status--paid { color: #384627; background: #e8eddf; }
.purchase-status--partial { color: #70501e; background: #f4ead6; }
.purchase-status--unpaid { color: #823c2f; background: #f4e2dd; }
.purchase-status--cancelled { color: #49443d; background: #ece8e2; }
:is(.purchases-header, .sales-header) { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
:is(.purchases-page .purchases-header) { margin-bottom: 0; }
:is(.purchases-page .purchases-search) { display: grid; gap: 14px; margin-bottom: 14px; }
:is(.purchases-page .purchases-search) > label { margin-bottom: -6px; }
:is(.sales-page .sales-header) { margin-bottom: 0; }
:is(.sales-page .sales-search) { display: grid; gap: 14px; margin-bottom: 14px; }
:is(.sales-page .sales-search) > label { margin-bottom: -6px; }
:is(.purchases-header, .sales-header) > div { min-width: 0; }
:is(.purchases-header__actions) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
:is(.purchases-header__due) { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); cursor: pointer; font-weight: 700; white-space: nowrap; }
:is(.purchases-header__due) input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
:is(.purchases-header__actions) .purchases-filters { margin-top: 0; }
:is(.purchases-header__actions) .purchases-filters[open] { flex: 1 0 100%; order: 2; }
:is(.sales-header__actions) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
:is(.sales-header__due) { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); cursor: pointer; font-weight: 700; white-space: nowrap; }
:is(.sales-header__due) input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
:is(.sales-header__actions) .sales-filters { margin-top: 0; }
:is(.sales-header__actions) .sales-filters[open] { flex: 1 0 100%; order: 2; }
:is(.purchases-header, .sales-header) h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
:is(.purchases-header__count, .sales-header__count) { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
:is(.purchases-search, .sales-search) { margin-bottom: 20px; }
:is(.purchases-search, .sales-search) > label { display: block; font-weight: 700; margin-bottom: 8px; }
:is(.purchases-search__controls, .sales-search__controls) { display: flex; flex-wrap: wrap; gap: 10px; }
:is(.purchases-search__controls, .sales-search__controls) input { flex: 1 1 240px; min-width: 0; width: 100%; font-size: 16px; min-height: 44px; }
:is(.purchases-search__controls, .sales-search__controls) button { min-height: 44px; }
:is(.purchases-search__options, .sales-search__options) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 8px; }
:is(.purchases-search__options, .sales-search__options) label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--text); font-weight: 600; }
:is(.purchases-search__options, .sales-search__options) input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-strong); }
:is(.purchases-search__options, .sales-search__options) a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: .18em; }
:is(.purchases-filters, .sales-filters) { margin-top: 8px; }
:is(.purchases-filters, .sales-filters) > summary { display: list-item; cursor: pointer; width: fit-content; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); font-weight: 700; }
:is(.purchases-filters__fields, .sales-filters__fields) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
:is(.purchases-filters__fields, .sales-filters__fields) .dashboard-actions { grid-column: 1 / -1; }
:is(.purchases-search, .sales-search) :is(input, select, summary, a):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
@media screen and (max-width: 760px) {
    :is(.purchases-header, .sales-header) { flex-direction: column; align-items: stretch; gap: 12px; }
    :is(.purchases-header__actions) { gap: 8px; }
    :is(.purchases-header__create).button-link { width: auto; min-width: 0; flex: 1 1 auto; }
    :is(.sales-header__actions) { gap: 8px; }
    :is(.sales-header__create).button-link { width: auto; min-width: 0; flex: 1 1 auto; }
    :is(.purchases-search__controls, .sales-search__controls) input { flex-basis: 180px; }
    :is(.purchases-filters__fields, .sales-filters__fields) { grid-template-columns: minmax(0, 1fr); }
    :is(.purchases-filters__fields, .sales-filters__fields) .form-control { min-width: 0; width: 100%; max-width: 100%; font-size: 16px; }
}
.suppliers-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.suppliers-stack { gap: 14px; }
.suppliers-header > div { min-width: 0; }
.suppliers-header h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.suppliers-header__count { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.suppliers-header__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.suppliers-header__due { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); cursor: pointer; font-weight: 700; white-space: nowrap; }
.suppliers-header__due input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
.suppliers-header__due:hover { border-color: var(--accent-strong); }
.suppliers-header__due:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.suppliers-search > label { display: block; font-weight: 700; margin-bottom: 8px; }
.suppliers-search__controls { display: flex; flex-wrap: wrap; gap: 10px; }
.suppliers-search__controls input { flex: 1 1 240px; min-width: 0; width: 100%; font-size: 16px; min-height: 44px; }
.suppliers-search__controls button { min-height: 44px; }
.suppliers-search__clear { display: inline-flex; align-items: center; min-height: 36px; margin-top: 6px; color: var(--text); text-decoration: underline; text-underline-offset: .18em; }
.suppliers-search__clear:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
@media screen and (max-width: 760px) {
    .suppliers-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .suppliers-header__actions { justify-content: space-between; flex-wrap: nowrap; }
    .suppliers-header__create.button-link { width: auto; min-width: 0; flex: 1 1 auto; }
    .suppliers-search__controls input { flex-basis: 180px; }
    .suppliers-search > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .inventory-search > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .inventory-search input { min-height: 40px; padding: 8px 12px; }
}
.products-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.products-stack { gap: 14px; }
.products-header > div { min-width: 0; }
.products-header__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.products-header__actions .products-filters { margin-top: 0; }
.products-header__actions .products-filters[open] { flex: 1 0 100%; order: 2; }
.products-header h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.products-header__count { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.products-search > label { display: block; font-weight: 700; margin-bottom: 8px; }
.products-search__controls { display: flex; flex-wrap: wrap; gap: 10px; }
.products-search__controls input { flex: 1 1 240px; min-width: 0; width: 100%; font-size: 16px; min-height: 44px; }
.products-search__controls button { min-height: 44px; }
.products-filters { margin-top: 12px; }
.products-tools.products-filters > summary { display: list-item; cursor: pointer; width: fit-content; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); font-weight: 700; }
.products-filters__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.products-filters__fields .dashboard-actions { grid-column: 1 / -1; }
@media screen and (max-width: 760px) {
    .products-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .products-header__actions { flex-wrap: wrap; }
    .products-header__actions .products-filters[open] { flex-basis: 100%; }
    .products-header__create.button-link { width: auto; min-width: 0; flex: 1 1 auto; }
    .products-filters__fields { grid-template-columns: minmax(0, 1fr); }
    .products-search__controls input { flex-basis: 180px; }
}
.split-panel.inventory-panels { grid-template-columns: minmax(0, 1fr); }
@media screen and (min-width: 1200px) {
    .split-panel.inventory-panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
    .inventory-panels > .panel-card { min-width: 0; padding: 16px; }
    .inventory-panels .panel-card__header { flex-wrap: wrap; }
    .inventory-panels .data-table { table-layout: fixed; width: 100%; }
    .inventory-panels :is(th, td) { padding: 12px 8px; overflow-wrap: anywhere; white-space: normal; }
    .inventory-panels th { letter-spacing: .04em; }
}
.inventory-movements { min-width: 0; }
.inventory-movements .panel-card__header { flex-wrap: wrap; }
.inventory-movements .table-wrap { overflow: visible; }
.inventory-movements .data-table { table-layout: fixed; width: 100%; min-width: 0; }
.inventory-movements :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
.inventory-movements .status-chip { max-width: 100%; box-sizing: border-box; white-space: normal; }
.inventory-history-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: .18em; }
.inventory-history-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; margin-block: 20px; }
.inventory-history-field { min-width: 0; }
.inventory-history-field label { display: block; font-weight: 700; margin-bottom: 6px; }
.inventory-history-field .form-control { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
.inventory-history-field .errorlist { padding-inline-start: 18px; color: #823c2f; }
.inventory-history-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.inventory-history-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.inventory-history-link:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.inventory-product-link { display: inline-flex; align-items: center; min-height: 44px; color: #000; font-weight: 700; text-decoration: underline; text-underline-offset: .18em; overflow-wrap: anywhere; }
.inventory-product-link--quantity { font-weight: 800; }
.inventory-product-link:hover { color: var(--accent-strong); }
.inventory-product-link:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
.inventory-status { display: inline-block; justify-self: start; padding: 4px 9px; border-radius: 8px; font-size: .875rem; font-weight: 700; line-height: 1.4; }
.inventory-status--available { background: #e8eddf; color: #384627; }
.inventory-status--low { background: #f4ead6; color: #70501e; }
.inventory-status--out { background: #f4e2dd; color: #823c2f; }
.inventory-watch h1 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin: 0 0 12px; }
.inventory-watch__links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.inventory-watch__links a, .inventory-search__receive { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel-strong); text-decoration: none; overflow-wrap: anywhere; }
.inventory-watch__links strong { font-size: 1.25rem; color: #000; }
.inventory-watch__links a[aria-current="page"] { background: var(--accent-strong); color: #fff; }
.inventory-watch__links a[aria-current="page"] strong { color: inherit; }
.inventory-watch__alert--out { --alert-background: #f4e2dd; --alert-text: #823c2f; --alert-border: #dec0b8; }
.inventory-watch__alert--low { --alert-background: #f7e8d4; --alert-text: #754817; --alert-border: #dcc29f; }
.inventory-watch__links a.inventory-watch__alert { background: var(--alert-background); color: var(--alert-text); border-color: var(--alert-border); }
.inventory-watch__links .inventory-watch__alert strong { color: inherit; }
.inventory-watch__links .inventory-watch__alert[aria-current="page"] { border-color: currentColor; font-weight: 700; }
.inventory-watch__links a:hover, .inventory-search__receive:hover { text-decoration: underline; }
.inventory-watch__links a:focus-visible, .inventory-search__receive:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.inventory-search { min-width: 0; }
.inventory-search > label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--text); }
.inventory-search__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inventory-search input { flex: 1 1 240px; width: 100%; min-width: 0; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-strong); color: var(--text); font: inherit; font-size: 16px; }
.inventory-search input::placeholder { color: var(--muted); opacity: 1; }
.inventory-search input:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.inventory-search .button-link { min-height: 44px; }
.inventory-search__clear { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: .18em; }
@media screen and (max-width: 760px) {
    .list-action--export { display: none !important; }
    .page-shell, .dashboard-shell { padding-bottom: calc(172px + env(safe-area-inset-bottom, 0px)); }
    :is(.products-search__controls, .suppliers-search__controls, .purchases-search__controls, .sales-search__controls) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    :is(.products-search__controls, .suppliers-search__controls, .purchases-search__controls, .sales-search__controls) button { width: auto !important; min-width: 100px; }
    :is(.products-header__create, .suppliers-header__create, .purchases-header__create, .sales-header__create, .customers-hero__action).button-link,
    .inventory-search__receive { position: fixed; z-index: 30; inset-inline: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 52px; padding-inline: 20px; border-radius: 16px; box-shadow: 0 12px 28px rgba(73, 61, 47, 0.22); }
    .page-shell :is(.page-card, .panel-card, .split-panel, .invoice-meta-grid, .quote-editor__form, .quote-editor__client, .quote-editor__bottom, .quote-editor__dates, .quote-editor__logistics, .form-row) { min-width: 0; max-width: 100%; }
    .page-shell :is(.page-header, .panel-card__header) { flex-wrap: wrap; gap: 10px; }
    .page-shell :is(.page-header > div, .invoice-meta-list strong, .invoice-meta-list span, .panel-card p, .subcopy) { min-width: 0; overflow-wrap: anywhere; }
    .page-shell .hero-stat { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 12px; }
    .page-shell .hero-stat__value { font-size: 1.25rem; }
    .page-shell .hero-stat__label { margin: 0; font-size: .9rem; }
    .page-shell .hero-banner__meta { gap: 8px; }
    .page-shell .hero-pill { font-size: .9rem; padding: 6px 10px; }
    .page-shell .scanner-status { min-width: 0; overflow-wrap: anywhere; }
    .page-shell .scanner-status:empty { display: none; }
    .page-shell :is(.invoice-sheet__actions, .dashboard-actions, .quote-editor__actions) { gap: 10px; }
    .page-shell :is(.invoice-sheet__actions, .dashboard-actions, .quote-editor__actions) > * { min-width: 0; max-width: 100%; width: 100%; }
    .page-shell :is(.quote-editor__totals > div, .delivery-signatures) { gap: 12px; }
    .page-shell .quote-editor__totals > div { flex-wrap: wrap; overflow-wrap: anywhere; }
    .page-shell .quote-editor__totals output { white-space: normal; overflow-wrap: anywhere; }
    .page-shell .delivery-signatures { grid-template-columns: 1fr; }
    .page-shell .commercial-nav { gap: 8px; }
    .page-shell .commercial-nav a { padding: 10px; min-height: 44px; overflow-wrap: anywhere; }
    .page-shell .commercial-filters { grid-template-columns: minmax(0, 1fr); }
    .mobile-filter-panel { margin-block: 12px; }
    .mobile-filter-panel > summary { display: list-item; cursor: pointer; min-height: 44px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; font-weight: 700; background: var(--panel-strong); }
    .mobile-filter-panel[open] > summary { margin-bottom: 14px; }
    .mobile-filter-panel > summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
    .data-table[data-mobile-table] { display: block; width: 100%; min-width: 0; }
    .data-table[data-mobile-table] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .data-table[data-mobile-table] :is(tbody, tfoot) { display: block; width: 100%; }
    .data-table[data-mobile-table] tbody > tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-strong); }
    .data-table[data-mobile-table] tbody > tr:first-child { padding-top: 0; }
    .data-table[data-mobile-table] tbody td {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        align-items: center; gap: 8px 12px; padding: 8px 0; border: 0;
        min-width: 0; width: auto; max-width: 100%; overflow-wrap: anywhere;
        font-size: 1rem; color: var(--text); text-align: start;
    }
    .data-table[data-mobile-table] tbody td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: .875rem; line-height: 1.4; }
    .data-table:is(.sales-invoices-table, .purchases-invoices-table)[data-mobile-table] tbody td { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(44px, auto); align-content: start; gap: 4px; padding-block: 2px; }
    .data-table:is(.sales-invoices-table, .purchases-invoices-table)[data-mobile-table] tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 12px; }
    .data-table:is(.sales-invoices-table, .purchases-invoices-table)[data-mobile-table] tbody td:last-child { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-strong); }
    .data-table.sales-invoices-table[data-mobile-table] .sales-invoice-balance,
    .data-table.purchases-invoices-table[data-mobile-table] .purchase-balance { font-size: 1.25rem; justify-content: flex-end; }
    .data-table:is(.sales-invoices-table, .purchases-invoices-table)[data-mobile-table] tbody > tr + tr { margin-top: 12px; }
    .data-table[data-mobile-table] tbody td.supplier-name { display: block; color: #000; font-weight: 800; font-size: 1.125rem; }
    .data-table[data-mobile-table] tbody td.supplier-name::before { content: none; }
    .suppliers-table[data-mobile-table] { font-family: var(--font-ui); }
    .suppliers-table[data-mobile-table] tbody td.supplier-contact { display: block; padding-block: 2px; line-height: 1.5; }
    .suppliers-table[data-mobile-table] tbody td.supplier-contact::before { content: none; }
    .suppliers-table[data-mobile-table] tbody td.supplier-contact--empty { display: none; }
    .suppliers-table[data-mobile-table] tbody td.supplier-contact + td:not(.supplier-contact) { padding-top: 14px; }
    .data-table[data-mobile-table] td > * { min-width: 0; max-width: 100%; }
    .data-table[data-mobile-table] td a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .18em; }
    .data-table[data-mobile-table] .status-chip { justify-self: start; color: var(--text); font-weight: 800; }
    .data-table[data-mobile-table] tbody > .mobile-form-row { margin-bottom: 16px; }
    .data-table[data-mobile-table] tbody > .mobile-form-row td { display: block; padding-block: 8px; }
    .data-table[data-mobile-table] .mobile-form-row td::before { display: block; margin-bottom: 6px; }
    #commercial-document-form .data-table[data-mobile-table] td { min-width: 0; }
    .data-table[data-mobile-table] :is(select, textarea, input:not([type=checkbox]):not([type=hidden])) { width: 100%; min-width: 0; max-width: 100%; font-size: 16px; min-height: 44px; }
    .data-table[data-mobile-table] input[type=checkbox] { width: 24px; height: 24px; margin: 10px; accent-color: var(--accent-strong); }
    .data-table[data-mobile-table] td label { display: flex; align-items: center; min-height: 44px; color: var(--text); }
    .data-table[data-mobile-table] .mobile-form-row output { white-space: normal; }
    .data-table[data-mobile-table] .mobile-summary-row { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 12px; border-bottom: 1px solid var(--line); }
    .data-table[data-mobile-table] .mobile-summary-row td { display: block; padding: 4px 0; border: 0; flex: 1 1 100px; font-weight: 700; overflow-wrap: anywhere; }
    .data-table[data-mobile-table] .mobile-summary-row td::before { content: none; }
    .data-table[data-mobile-table] .mobile-summary-row td:last-child { text-align: end; }
}


/* Compact customers list: one tap opens the complete record. */
@media(max-width:760px){
.customers-page{padding-bottom:calc(92px + env(safe-area-inset-bottom, 0px))}
.customers-page .customers-card{gap:8px}
.customers-page .customers-hero{grid-template-columns:minmax(0,1fr) auto;padding:10px 14px;gap:8px}
.customers-page .customers-hero__content{gap:9px}
.customers-page .customers-hero__icon{width:34px;height:34px;border-radius:10px}
.customers-page .customers-hero__icon svg{width:18px;height:18px}
.customers-page .customers-hero__copy h1{font-size:1.45rem}
.customers-page .customers-hero__count{padding:3px 6px;font-size:.66rem}
.customers-page .customers-hero__count strong{font-size:.72rem}
.customers-page .list-actions .button-secondary{display:none}
.customers-page .customers-hero__action.button-link{position:static;inset:auto;display:grid;width:40px;min-height:40px;padding:0;border-radius:12px;box-shadow:none;font-size:0}
.customers-page .customers-hero__action>span{width:22px;height:22px;font-size:1.15rem}
.customers-page .list-search{grid-template-columns:minmax(0,1fr);gap:0;padding:8px 10px;border-radius:12px}
.customers-page .list-search>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.customers-page .list-search>div{gap:6px}
.customers-page .list-search :is(input,button){min-height:40px}
.customers-page .customers-table[data-mobile-table] tbody>tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin:0;padding:0;border:0;border-bottom:1px solid #d6d3ca;border-radius:0;background:transparent;box-shadow:none}
.customers-page .customers-table[data-mobile-table] tbody>tr:first-child{padding-top:0}
.customers-page .customers-table[data-mobile-table] tbody td{display:none;padding:0;border:0;font-size:.92rem;line-height:1.25}
.customers-page .customers-table[data-mobile-table] tbody td:nth-child(1),.customers-page .customers-table[data-mobile-table] tbody td:nth-child(7){display:block}
.customers-page .customers-table[data-mobile-table] tbody td::before,
.data-table.inventory-table[data-mobile-table] tbody td::before,
.data-table.purchases-invoices-table[data-mobile-table] tbody td::before,
.data-table.suppliers-table[data-mobile-table] tbody td:not(.supplier-name):not(.supplier-contact)::before,
.data-table.sales-invoices-table[data-mobile-table] tbody td::before{justify-self:start;padding:5px 8px;border-radius:8px;color:#465130;background:#dfe7d2;font-size:.72rem;font-weight:900;letter-spacing:.04em;line-height:1.2;text-transform:none}
.customers-page .customers-table[data-mobile-table] tbody td.customer-name{color:#27241f;font-size:.95rem;font-weight:850}
.customers-page .customers-table[data-mobile-table] tbody td.customer-name::before,.customers-page .customers-table[data-mobile-table] tbody td.customer-money::before{content:none}
.customers-page .customers-table[data-mobile-table] .customer-record-link{min-height:34px;flex-wrap:nowrap;white-space:nowrap}
.customers-page .customers-table[data-mobile-table] .customer-name .customer-record-link>span{overflow:hidden;text-overflow:ellipsis}
.customers-page .customers-table[data-mobile-table] .customer-type-badge{display:none}
.customers-page .customers-table[data-mobile-table] tbody td.customer-money{font-size:.88rem;font-weight:850;text-align:end;white-space:nowrap}
.customers-page .customers-table[data-mobile-table] tbody td.customer-money small{font-size:.6rem}
}
.inventory-stock-cards{display:none}
.inventory-movement-cards{display:none}

/* Dense invoice registers on desktop: more records remain visible at once. */
@media (min-width:761px){
    :is(.purchases-invoices-table,.sales-invoices-table) :is(th,td){padding:3px 10px;font-size:.82rem;line-height:1.15}
    :is(.purchases-invoices-table,.sales-invoices-table) :is(.purchase-cell-link,.sales-status-link){min-height:20px}
    :is(.purchases-invoices-table,.sales-invoices-table) :is(.purchase-status,.sales-status){padding:2px 6px;font-size:.7rem;line-height:1.15}
    :is(.purchases-invoices-table,.sales-invoices-table) :is(.purchase-amount,.sales-invoice-amount){font-size:.82rem}
    :is(.products-table,.suppliers-table) :is(th,td){padding:3px 10px;font-size:.82rem;line-height:1.15}
    .products-table .product-thumb{width:32px;height:32px;border-radius:8px}
    .products-table .product-thumb--empty{box-sizing:border-box;padding:3px;font-size:.62rem}
    .products-table .product-detail-link{min-height:20px}
    .products-table .product-unit-chip{padding:2px 6px;font-size:.7rem;line-height:1.15}
}
.mobile-dashboard-summary{display:none}
.mobile-dashboard-summary__visual{display:none}
.mobile-action-bar{display:none}
.app-toast-region{display:none}
.warehouse-dashboard__desktop{display:grid;gap:18px}
.warehouse-dashboard__header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px;border:1px solid var(--line-strong);border-radius:16px;background:var(--panel-strong)}
.warehouse-dashboard__header h1{margin:0;font-size:clamp(1.65rem,3vw,2.35rem)}
.warehouse-dashboard__header p{margin:5px 0 0;color:var(--muted)}
.warehouse-dashboard__alerts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.warehouse-dashboard__alerts a{display:grid;gap:5px;padding:18px;border:1px solid var(--line-strong);border-radius:16px;background:#fffcf7;color:var(--text);text-decoration:none}
.warehouse-dashboard__alerts strong{font-size:1.75rem;font-variant-numeric:tabular-nums}
.warehouse-dashboard__alerts span{color:var(--muted);font-weight:750}
.warehouse-dashboard__actions{display:flex;flex-wrap:wrap;gap:10px}
.warehouse-dashboard__movements{padding:18px;border:1px solid var(--line-strong);border-radius:16px;background:#fffcf7}
.warehouse-dashboard__movements header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.warehouse-dashboard__movements h2{margin:0;font-size:1.15rem}
.warehouse-dashboard__movements header a{color:var(--accent-strong);font-weight:800}
.warehouse-dashboard__movements ul{display:grid;gap:0;margin:10px 0 0;padding:0;list-style:none}
.warehouse-dashboard__movements li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-top:1px solid var(--line)}
.warehouse-dashboard__movements li div{display:grid;gap:3px}
.warehouse-dashboard__movements li span{color:var(--muted);font-size:.88rem}
.warehouse-dashboard__movements li bdi{font-size:1.1rem;font-weight:850;font-variant-numeric:tabular-nums}
@media(max-width:760px){
.warehouse-dashboard__desktop{display:none}
.mobile-action-bar{position:fixed;z-index:40;inset-inline:0;bottom:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));min-height:64px;padding:7px max(10px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));border-top:1px solid var(--line-strong);background:#fffcf7;box-shadow:0 -8px 24px rgba(73,61,47,.12)}
.mobile-action-bar a{display:grid;place-items:center;align-content:center;gap:3px;min-width:0;min-height:50px;color:var(--text);font-size:.7rem;font-weight:800;line-height:1.1;text-align:center;text-decoration:none}
.mobile-action-bar a:active{color:var(--accent-strong)}
.mobile-action-bar svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.mobile-action-bar span{overflow-wrap:anywhere}
.app-toast-region{position:fixed;z-index:60;inset-inline:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));display:grid;gap:8px;pointer-events:none}
.site-shell:has(.app-toast) :is(.page-shell,.dashboard-shell) .notice-message{display:none}
.app-toast{margin:0;padding:12px 14px;border-radius:14px;background:#40503a;color:#fff;box-shadow:0 10px 24px rgba(42,46,34,.22);font-size:.92rem;font-weight:800;animation:app-toast-in .24s ease-out both}
.app-toast--error{background:#8b3d34}
.app-toast.is-leaving{animation:app-toast-out .2s ease-in both}
@keyframes app-toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes app-toast-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(8px)}}
@media(prefers-reduced-motion:reduce){.app-toast,.app-toast.is-leaving{animation:none}}
.mobile-dashboard-summary{display:grid;gap:16px}
.mobile-dashboard-summary__visual{display:block;height:84px;margin:0;overflow:hidden;border:1px solid var(--line-strong);border-radius:16px;background:#e8dfd3}
.mobile-dashboard-summary__visual img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 56%}
    .mobile-dashboard-summary__header h1{margin:0;font-size:1.55rem}
    .mobile-dashboard-summary__header p{margin:4px 0 0;color:var(--muted);font-size:.9rem}
    .mobile-dashboard-alerts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .mobile-dashboard-alerts a{display:grid;gap:4px;min-height:82px;padding:12px;border:1px solid var(--line-strong);border-radius:14px;background:#fffcf7;color:var(--text);text-decoration:none}
    .mobile-dashboard-alerts strong{font-size:1.15rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
    .mobile-dashboard-alerts span{color:var(--muted);font-size:.78rem;font-weight:700;line-height:1.25}
    .mobile-dashboard-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .mobile-dashboard-actions .button-link{display:flex;align-items:center;justify-content:center;min-height:48px;padding:8px 10px;text-align:center;line-height:1.2;box-shadow:none}
    .mobile-dashboard-movements{padding:14px;border:1px solid var(--line-strong);border-radius:16px;background:#fffcf7}
    .mobile-dashboard-movements header{display:flex;align-items:center;justify-content:space-between;gap:12px}
    .mobile-dashboard-movements h2{margin:0;font-size:1.05rem}
    .mobile-dashboard-movements header a{min-height:44px;display:inline-flex;align-items:center;color:var(--accent-strong);font-size:.84rem;font-weight:800;text-decoration:underline;text-underline-offset:.18em}
    .mobile-dashboard-movements ul{display:grid;gap:0;padding:0;margin:6px 0 0;list-style:none}
    .mobile-dashboard-movements li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
    .mobile-dashboard-movements li div{display:grid;gap:3px;min-width:0}
    .mobile-dashboard-movements li strong{overflow-wrap:anywhere}
    .mobile-dashboard-movements li span{color:var(--muted);font-size:.8rem}
    .mobile-dashboard-movements li bdi{flex:0 0 auto;font-size:1.05rem;font-weight:850;font-variant-numeric:tabular-nums}
    .dashboard-shell > :is(.dashboard-visual,.hero-banner,.dashboard-quick-actions,.dashboard-card),
    .commercial-dashboard > :is(.commercial-story,.commercial-dashboard__header,.dashboard-quick-actions,.commercial-kpis,.quote-performance,.commercial-activity,.daily-priorities){display:none}
}

/* Keep compact views on the same typography scale as desktop. */
@media (max-width: 760px) {
    .data-table[data-mobile-table] tbody td,
    .customers-page .customers-table[data-mobile-table] tbody td {
        font-family: var(--font-ui);
        font-weight: var(--weight-regular);
        letter-spacing: 0;
    }

    .data-table[data-mobile-table] tbody td::before,
    .customers-page .customers-table[data-mobile-table] tbody td::before,
    .data-table.inventory-table[data-mobile-table] tbody td::before,
    .data-table.purchases-invoices-table[data-mobile-table] tbody td::before,
    .data-table.suppliers-table[data-mobile-table] tbody td:not(.supplier-name):not(.supplier-contact)::before,
    .data-table.sales-invoices-table[data-mobile-table] tbody td::before {
        font-weight: var(--weight-semibold);
        letter-spacing: 0.02em;
    }

    .customers-page .customers-table[data-mobile-table] tbody td.customer-name,
    .customers-page .customers-table[data-mobile-table] tbody td.customer-phone,
    .customers-page .customers-table[data-mobile-table] tbody td.customer-money,
    .data-table[data-mobile-table] tbody td.supplier-name,
    .data-table[data-mobile-table] .status-chip {
        font-weight: var(--weight-semibold);
    }
}
@media(min-width:761px){
    .inventory-panels .inventory-table :is(th,td){padding:4px 10px;font-size:.82rem;line-height:1.15}
    .inventory-panels .inventory-table .inventory-product-link{min-height:22px;line-height:1.15}
    .inventory-panels .inventory-table .inventory-status{padding:2px 6px;font-size:.7rem;line-height:1.15}
    .inventory-stock-table-wrap .inventory-table :is(th,td):nth-child(3),
    .inventory-movements .inventory-table :is(th,td):nth-child(4){display:none}
}
@media(max-width:760px){
    .inventory-page .page-stack{gap:10px}
    .inventory-page .inventory-watch h1{margin-bottom:8px;font-size:1.25rem}
    .inventory-page .inventory-watch__links{gap:6px 8px}
    .inventory-page .inventory-watch__links a{min-height:40px;padding:6px 10px}
    .inventory-page .inventory-search__controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center}
    .inventory-page .inventory-search input{min-height:40px;padding:8px 12px}
    .inventory-page .inventory-search .button-link{min-height:40px;padding:0 14px}
    .inventory-page .inventory-search__clear{min-height:36px;font-size:.88rem}
    .inventory-stock-table-wrap{display:none}
    .inventory-stock-cards{display:grid;gap:10px}
    .inventory-stock-card{display:grid;gap:10px;padding:14px;border:1px solid var(--line-strong);border-radius:16px;background:#fffcf7;box-shadow:0 6px 18px rgba(73,61,47,.08)}
    .inventory-stock-card__link{display:grid;gap:10px;width:100%;padding:0;border:0;border-radius:0;background:transparent;color:inherit;text-align:start;box-shadow:none}
    .inventory-stock-card__link:focus-visible{outline:3px solid var(--accent-strong);outline-offset:4px}
    .inventory-stock-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
    .inventory-stock-card__header .inventory-product-link{min-height:44px;font-size:1rem;font-weight:850;color:#24211d;text-decoration:none}
    .inventory-stock-card__header .inventory-status{flex:0 0 auto}
    .inventory-stock-card__quantity{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0;padding:10px 0;border-block:1px solid var(--line)}
    .inventory-stock-card__quantity strong{font-size:1.35rem;color:#25221d;font-variant-numeric:tabular-nums}
    .inventory-stock-card__quantity span{color:var(--muted);font-size:.82rem;font-weight:700;text-align:end}
    .inventory-stock-card__meta{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:.84rem;line-height:1.4}
    .inventory-stock-card__meta span:last-child{text-align:end}
    .inventory-movements-table-wrap{display:none}
    .inventory-movement-cards{display:grid;gap:10px}
    .inventory-movement-card{display:grid;gap:10px;padding:14px;border:1px solid var(--line-strong);border-radius:16px;background:#fffcf7;box-shadow:0 6px 18px rgba(73,61,47,.08)}
    .inventory-movement-card__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;color:#25221d}
    .inventory-movement-card__header strong{font-size:1rem;line-height:1.35}
    .inventory-movement-card__header .status-chip{flex:0 0 auto}
    .inventory-movement-card__quantity{margin:0;padding:10px 0;border-block:1px solid var(--line);font-size:1.35rem;color:#25221d;font-variant-numeric:tabular-nums}
    .inventory-movement-card__meta{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:.84rem;line-height:1.4}
    .inventory-movement-card__meta time{text-align:end}
}
