/* Mobile document detail: shared by sales and purchasing, never storefronts. */
.document-mobile-overview, .document-mobile-lines, .document-header-toggle, .document-economic-heading { display: none; }
.app-shell .commercial-ficha-card .document-header-toggle { display: none; }
@media (max-width: 800px) {
    .commercial-ficha-header .subhead { display: none; }
    .app-shell .commercial-ficha-header { margin-bottom: 10px; }
    .app-shell .commercial-ficha-card { background: #f1f5f9; }
    body .app-shell .commercial-ficha-card .commercial-add-product-button:disabled { background: var(--erp-action-primary, #e86118) !important; border-color: var(--erp-action-primary, #e86118) !important; color: #fff !important; opacity: .65; cursor: not-allowed; }
    .document-mobile-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 12px; border: 1px solid #dce3ec; border-radius: 10px; overflow: hidden; background: #fff; }
    .document-mobile-overview > div { min-width: 0; padding: 10px 12px; border: 0; background: #fff; color: #17304e; }
    .document-mobile-overview span { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 600; }
    .document-mobile-overview strong { font-size: 1.15rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
    .document-mobile-overview .document-overview-total { background: #173652; color: #fff; text-align: right; }
    .document-mobile-overview .document-overview-total strong { font-size: 1.4rem; }
    .document-mobile-overview .document-overview-outstanding { color: #173652; background: #e5eff9; text-align: right; }
    .document-overview-state strong { display: inline-block; padding: 3px 7px; background: #e5eff9; border-radius: 5px; font-size: .9rem; }
    .document-overview-delivery strong { font-size: .95rem; }
    .document-mobile-overview .document-overview-party { border-bottom: 1px solid #f3d0b4; border-left: 4px solid var(--erp-action-primary, #e86118); background: #fff1e6; color: #17304e; }
    .document-mobile-overview .document-overview-party strong { font-weight: 750; }
    .document-mobile-overview :is(.document-overview-wide, .document-overview-party) { grid-column: 1 / -1; }
    .app-shell .commercial-ficha-card .document-header-toggle { display: flex; width: fit-content; margin: 10px 0 10px auto; }
    .commercial-ficha-card > .document-desktop-heading { display: none; }
    .app-shell .commercial-ficha-card > .commercial-header-form.document-header-collapsed { display: none !important; }
    .document-mobile-lines { display: grid; gap: 12px; }
    .app-shell .commercial-ficha-card .document-desktop-lines, .document-desktop-lines { display: none !important; }
    .document-mobile-line { min-width: 0; padding: 14px; border: 1px solid #dce3ec; border-radius: 12px; background: #fff; color: #17304e; }
    .document-mobile-line header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
    .document-mobile-line header strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
    .document-line-reference { padding: 5px 9px; border-radius: 6px; background: #fff1e6; color: #8e3e10; font-weight: 700; overflow-wrap: anywhere; }
    .document-mobile-line h3 { font-size: 1rem; line-height: 1.4; margin: 12px 0; overflow-wrap: anywhere; }
    .document-line-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; padding-top: 10px; border-top: 1px solid #dce3ec; }
    .document-line-metrics > div { min-width: 0; }
    .document-line-metrics dt { font-size: .72rem; color: #526274; }
    .document-line-metrics dd { margin: 4px 0; font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
    .document-mobile-line summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px 12px; margin: 8px 0; border: 1px solid #cbd5e1; border-radius: 7px; background: #f1f5f9; color: #334155; font-weight: 600; cursor: pointer; list-style: none; }
    .document-mobile-line summary::-webkit-details-marker { display: none; }
    .document-mobile-line summary:hover { background: #e2e8f0; }
    .document-mobile-line summary:focus-visible { outline: 2px solid #173652; outline-offset: 2px; }
    .document-line-collapse, details[open] > summary .document-line-expand { display: none; }
    details[open] > summary .document-line-collapse { display: inline; }
    details[open] > summary .document-line-chevron { transform: rotate(180deg); }
    .document-line-chevron { font-size: 1.4rem; line-height: 1; }
    .document-line-more { display: grid; gap: 6px; padding-bottom: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
    .document-line-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
    .document-line-actions .erp-action-button { min-height: 44px; }
    .document-economic-heading { display: block; margin: 18px 0 8px; font-size: 1.1rem; }
    .app-shell .commercial-ficha-card .commercial-totals.document-totals-summary { display: flex !important; flex-direction: column; gap: 0 !important; padding: 12px; border: 1px solid #dce3ec; border-radius: 12px; background: #fff; }
    .app-shell .commercial-ficha-card .commercial-totals.document-totals-summary > div { display: flex; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; min-width: 0; padding: 8px; border: 0 !important; border-bottom: 1px solid #dce3ec !important; border-radius: 0 !important; box-shadow: none; }
    .app-shell .commercial-ficha-card .commercial-totals.document-totals-summary > div:first-child { border-radius: 8px 8px 0 0 !important; }
    .app-shell .commercial-ficha-card .commercial-totals.document-totals-summary > div:last-child { border-radius: 0 0 8px 8px !important; border-bottom: 0 !important; }
    .app-shell .commercial-ficha-card .commercial-totals.document-totals-summary > .document-grand-total { margin-top: 0; width: 100% !important; align-self: stretch; }
}
