/* ── Layout ─────────────────────────────────────────────────────────────── */

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    height: 100%;
    background-color: #f8f9fa;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.impersonation-watermark {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(3.5rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: 0.8rem;
    color: rgba(255, 193, 7, 0.08);
    transform: rotate(-24deg);
    pointer-events: none;
    user-select: none;
    z-index: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.impersonation-return-button {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1045;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12);
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
}

.sync-toast {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 1080;
    min-width: 280px;
    max-width: 420px;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.16);
    color: #fff;
}

.sync-toast-success {
    background: linear-gradient(135deg, #198754, #157347);
}

.sync-toast-info {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
}

.sync-toast-error {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

.sync-toast-title {
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.main-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.container-full-height {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-full-height-layout {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.table-wrapper > .table,
.table-wrapper table {
    width: 100%;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 220px;
}

.nav-right {
    justify-content: flex-end;
    text-align: right;
}

.top-user-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.nav-left {
    justify-content: flex-start;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.top-navbar-toggle,
.top-navbar-mobile {
    display: none;
}

.top-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-menu-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    padding-bottom: 0.35rem;
    margin-bottom: -0.35rem;
}

.top-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 220px;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08);
    z-index: 1040;
}

.top-submenu-end {
    left: auto;
    right: 0;
}

.top-menu-dropdown:hover .top-submenu,
.top-menu-dropdown:focus-within .top-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.top-sublink,
.top-sublink-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.55rem 0.75rem;
    color: #495057;
    text-decoration: none;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    text-align: left;
    font-weight: 500;
}

.top-sublink:hover,
.top-sublink.active,
.top-sublink-button:hover {
    color: #0d6efd;
    background-color: #e9f2ff;
}

.top-sublink-button:disabled {
    opacity: 0.7;
}

.top-menu-right {
    justify-content: flex-end;
    width: 100%;
}

.top-link,
.top-action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    color: #495057;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.top-link-button {
    border: 0;
    background: transparent;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.top-link-email {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-link:hover,
.top-link.active,
.top-action-button:hover {
    color: #0d6efd;
    background-color: #e9f2ff;
}

.brand-mark {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0d6efd;
    letter-spacing: 0.03em;
}

.brand-link {
    text-decoration: none;
}

.brand-user {
    display: block;
    color: #6c757d;
    font-size: 0.875rem;
}

/* ── Content ─────────────────────────────────────────────────────────────── */

.content {
    padding: 1.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.auth-page {
    min-height: calc(100vh - 72px - 3rem);
    padding: 1.5rem 0;
}

.admin-card-link {
    color: inherit;
    text-decoration: none;
}

.admin-card-link .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-card-link:hover .card {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.12);
}

.table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

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

.table td.table-cell-wrap,
.table th.table-cell-wrap {
    white-space: normal;
}

.product-thumb {
    width: 100px;
    height: 100px;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    flex: 0 0 auto;
}

.product-thumb-admin {
    width: 76px;
    height: 76px;
    cursor: pointer;
}

.product-thumb-clickable {
    cursor: pointer;
}

.product-thumb-wrapper {
    position: relative;
    display: inline-block;
}

.product-thumb-preview {
    display: none;
    position: absolute;
    top: 0;
    left: 56px;
    z-index: 1000;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-thumb-preview img {
    width: auto;
    height: auto;
    max-width: 260px;
    max-height: 260px;
    object-fit: contain;
    display: block;
}

.product-thumb-wrapper:hover .product-thumb-preview {
    display: block;
    opacity: 1;
}

.product-thumb-wrapper-large .product-thumb-preview {
    left: 104px;
}

.product-thumb-preview-large img {
    width: auto;
    max-width: 260px;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: lightbox-fade-in 0.2s ease;
}

.lightbox-content-productos {
    max-width: 96vw;
    max-height: 96vh;
}

.lightbox-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-image-productos {
    width: auto;
    height: auto;
    max-width: min(1100px, 92vw);
    max-height: 92vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #fff;
    color: #000;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sync-panel {
    padding: 10px;
    margin-bottom: 15px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #dee2e6;
}

.sync-ratio-low {
    color: #198754;
    font-weight: 600;
}

.sync-ratio-medium {
    color: #fd7e14;
    font-weight: 600;
}

.sync-ratio-high {
    color: #dc3545;
    font-weight: 600;
}

.sync-dashboard-card {
    margin-bottom: 15px;
}

.sync-indicator {
    font-size: 1.05rem;
    font-weight: 700;
}

.estado-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.estado-verde {
    color: #2e7d32;
    font-weight: bold;
}

.estado-naranja {
    color: #f57c00;
    font-weight: bold;
}

.estado-info {
    color: #0d6efd;
    font-weight: bold;
}

.estado-rojo {
    color: #c62828;
    font-weight: bold;
}

.estado-gris {
    color: #9e9e9e;
    font-weight: bold;
}

.estado-dot.estado-verde {
    background-color: #2e7d32;
}

.estado-dot.estado-naranja {
    background-color: #f57c00;
}

.estado-dot.estado-rojo {
    background-color: #c62828;
}

.estado-dot.estado-gris {
    background-color: #9e9e9e;
}

.sync-mini {
    font-size: 12px;
    color: #666;
}

.sync-chart {
    display: flex;
    align-items: end;
    gap: 6px;
    min-height: 80px;
}

.sync-chart-item {
    display: flex;
    align-items: end;
    gap: 2px;
}

.sync-bar {
    width: 10px;
    border-radius: 4px 4px 0 0;
}

.sync-bar-ratio {
    background-color: #fd7e14;
}

.sync-bar-time {
    background-color: #0d6efd;
}

.observability-chart {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 130px;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.observability-chart-item {
    display: flex;
    align-items: end;
    gap: 3px;
    min-width: 24px;
}

.observability-line {
    width: 6px;
    border-radius: 999px;
}

.observability-line.ratio.ratio-verde {
    background-color: #198754;
}

.observability-line.ratio.ratio-naranja {
    background-color: #fd7e14;
}

.observability-line.ratio.ratio-rojo {
    background-color: #dc3545;
}

.observability-line.tiempo {
    background-color: #0d6efd;
}

.observability-line.actualizados {
    background-color: #6f42c1;
}

.observability-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.legend-dot.ratio {
    background-color: #fd7e14;
}

.legend-dot.tiempo {
    background-color: #0d6efd;
}

.legend-dot.actualizados {
    background-color: #6f42c1;
}

.ratio-verde {
    color: #198754;
}

.ratio-naranja {
    color: #fd7e14;
}

.ratio-rojo {
    color: #dc3545;
}

@keyframes lightbox-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.table-scroll-page {
    max-height: 60vh;
    overflow-y: auto;
}

.table-scroll-clientes {
    max-height: 60vh;
}

.table-scroll-productos {
    max-height: 60vh;
}

.table-scroll-pedidos {
    max-height: 65vh;
}

.table-scroll-mis-productos {
    max-height: 72vh;
}

.admin-cliente-productos-page {
    overflow: hidden;
}

.admin-cliente-productos-grid,
.admin-cliente-productos-column,
.admin-cliente-productos-card,
.admin-cliente-productos-body {
    min-height: 0;
}

.admin-cliente-productos-column,
.admin-cliente-productos-card,
.admin-cliente-productos-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.admin-cliente-productos-card {
    overflow: hidden;
}

.admin-cliente-productos-table {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 328px);
    overflow: auto;
}

.admin-cliente-productos-footer {
    flex: 0 0 auto;
    background-color: #fff;
}

.table-scroll-historial {
    overflow-x: auto;
}

.historial-card {
    width: 100%;
}

.historial-card-body {
    width: 100%;
}

.historial-table-shell {
    width: 100%;
    overflow-x: auto;
}

.historial-table-frame {
    width: 100%;
}

.table-scroll-historial-body {
    width: 100%;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.historial-table {
    width: auto !important;
    min-width: 0 !important;
    table-layout: auto !important;
}

.historial-table th,
.historial-table td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    text-align: left !important;
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.historial-col-nowrap {
    white-space: nowrap;
}

.historial-col-fecha,
.historial-col-pedido {
    width: 1%;
}

.historial-col-total {
    width: 1%;
}

.historial-col-base,
.historial-col-iva {
    width: 1%;
}

.historial-col-acciones {
    width: 1%;
}

.table-scroll-historial-body .sticky-top th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f8f9fa;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.historial-table th,
.historial-table td {
    width: 1%;
}

.historial-col-base,
.historial-col-iva,
.historial-col-total {
    text-align: left !important;
}

.historial-acciones-cell {
    white-space: nowrap;
}

.historial-acciones-cell .btn {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0;
}

.historial-acciones-cell .btn:last-child {
    margin-right: 0;
}

.table-scroll-form {
    max-height: 60vh;
    overflow-y: auto;
}

.table-scroll-split {
    max-height: 58vh;
    overflow-y: auto;
}

.table-scroll-modal {
    max-height: 48vh;
    overflow-y: auto;
}

.table-scroll-page .sticky-top th,
.table-scroll-form .sticky-top th,
.table-scroll-modal .sticky-top th,
.table-scroll-split .sticky-top th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f8f9fa;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

.product-list-table th,
.product-list-table td {
    vertical-align: middle;
}

.product-list-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.product-list-name {
    color: #212529;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.product-list-code {
    color: #6c757d;
    font-size: 0.92rem;
    line-height: 1.2;
}

.product-list-price {
    color: #0d6efd;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
}

.product-list-qty-cell {
    min-width: 140px;
    vertical-align: bottom !important;
}

.product-list-qty-input {
    max-width: 110px;
    margin-left: auto;
    margin-top: auto;
}

.order-lines-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.order-lines-list-scroll {
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.order-cart-view.order-lines-list-scroll {
    max-height: 74vh;
}

.order-lines-list-modal {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.order-line-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 0.2rem 0.75rem rgba(0, 0, 0, 0.04);
}

.order-line-card-compact {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    padding: 0.75rem 0.85rem;
}

.order-line-image {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 0.9rem;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

.order-line-image-compact {
    width: 72px;
    height: 72px;
}

.order-line-info {
    min-width: 0;
}

.order-line-title {
    margin-bottom: 0.2rem;
    color: #212529;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
}

.order-line-title-compact {
    font-size: 1.05rem;
}

.order-line-ref,
.order-line-origin {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.25;
}

.order-line-meta {
    margin-top: 0.2rem;
    color: #343a40;
    font-size: 0.95rem;
}

.order-line-unit-price {
    margin-top: 0.2rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.order-line-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.5rem;
    text-align: right;
    align-self: stretch;
}

.order-line-side-editable {
    min-width: 150px;
}

.order-line-price {
    color: #212529;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.order-line-price-compact {
    font-size: 1.35rem;
}

.order-line-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.order-line-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.order-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #dbe7ff;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.order-summary-card-modal {
    margin-top: 0.5rem;
}

.order-summary-label {
    color: #0d6efd;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.order-summary-value {
    color: #0d6efd;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.order-totals-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.order-detail-lines-scroll {
    max-height: 72vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.order-detail-view .order-line-card {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    padding: 0.7rem 0.85rem;
}

.order-detail-view .order-line-image {
    width: 72px;
    height: 72px;
}

.order-detail-view .order-line-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.order-detail-view .order-line-ref,
.order-detail-view .order-line-origin,
.order-detail-view .order-line-meta,
.order-detail-view .order-line-unit-price {
    font-size: 0.9rem;
}

.order-detail-view .order-line-price {
    font-size: 1.12rem;
    font-weight: 600;
}

.order-detail-view .order-summary-label {
    font-size: 0.95rem;
}

.order-detail-view .order-summary-value {
    font-size: 1.15rem;
}

.order-detail-totals-panel {
    margin-left: auto;
    width: min(100%, 360px);
}

.order-detail-summary-card {
    padding: 0.8rem 1rem;
}

.order-detail-summary-card .order-summary-label {
    color: #495057;
}

.order-detail-summary-card .order-summary-value {
    color: #212529;
    font-size: 1.05rem;
    font-weight: 700;
}

.order-detail-summary-card-total {
    border-color: #cfe2ff;
    background: linear-gradient(135deg, #eef5ff, #dce9ff);
}

.order-detail-summary-card-total .order-summary-label,
.order-detail-summary-card-total .order-summary-value {
    color: #0d3b8e;
    font-weight: 800;
}

.order-cart-view .order-line-card {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    padding: 0.75rem 0.9rem;
}

.order-cart-view .order-line-card-compact {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    padding: 0.65rem 0.8rem;
}

.order-cart-view .order-line-image {
    width: 72px;
    height: 72px;
}

.order-cart-view .order-line-image-compact {
    width: 60px;
    height: 60px;
}

.order-cart-view .order-line-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.order-cart-view .order-line-title-compact {
    font-size: 0.92rem;
}

.order-cart-view .order-line-ref,
.order-cart-view .order-line-meta,
.order-cart-view .order-line-unit-price {
    font-size: 0.86rem;
}

.order-cart-view .order-line-price {
    font-size: 1.15rem;
    font-weight: 600;
}

.order-cart-view .order-line-price-compact {
    font-size: 1.02rem;
}

.order-cart-view .order-line-actions .btn,
.order-cart-view .order-line-qty-controls .btn {
    padding: 0.2rem 0.45rem;
}

.order-cart-view .order-line-qty-controls {
    font-size: 0.92rem;
}

/* ── Blazor loading / error ──────────────────────────────────────────────── */

.loading-progress circle {
    transition: stroke-dasharray 0.3s ease;
}

#blazor-error-ui .btn-close {
    padding: 0.25rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .container-full-height {
        height: calc(100vh - 112px);
    }

    .top-navbar {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0.75rem;
    }

    .nav-left,
    .nav-right {
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .nav-left {
        justify-content: flex-start;
        text-align: left;
    }

    .nav-right {
        display: none;
    }

    .nav-center {
        display: none;
    }

    .top-navbar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 0.85rem;
    }

    .top-navbar-mobile {
        display: block;
        background: #fff;
        border-bottom: 1px solid #dee2e6;
    }

    .top-navbar-mobile-panel {
        display: none;
        padding: 0 1rem 1rem;
    }

    .top-navbar-mobile-panel.open {
        display: block;
    }

    .top-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .top-menu-right {
        justify-content: flex-end;
    }

    .top-navbar-mobile .top-link,
    .top-navbar-mobile .top-action-button,
    .top-navbar-mobile .top-sublink-button {
        width: 100%;
        justify-content: flex-start;
        border-radius: 0.75rem;
    }

    .top-navbar-mobile-user {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 0.85rem;
        padding-top: 0.85rem;
        border-top: 1px solid #e9ecef;
    }

    .top-navbar-mobile-user .brand-user {
        text-align: left;
    }

    .auth-page {
        min-height: auto;
    }

    .table-full-height-layout,
    .table-wrapper {
        min-height: 0;
    }

    .table-scroll-page,
    .table-scroll-form,
    .table-scroll-split,
    .table-scroll-modal {
        max-height: 50vh;
    }

    .order-lines-list-scroll,
    .order-lines-list-modal {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .order-cart-view.order-lines-list-scroll {
        max-height: none;
    }

    .order-detail-lines-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 0;
    }

    .order-line-card,
    .order-line-card-compact {
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: start;
    }

    .order-line-image,
    .order-line-image-compact {
        width: 72px;
        height: 72px;
    }

    .order-line-title {
        font-size: 1.05rem;
    }

    .order-line-title-compact {
        font-size: 0.98rem;
    }

    .order-line-ref,
    .order-line-origin,
    .order-line-meta,
    .order-line-unit-price {
        font-size: 0.88rem;
    }

    .order-line-side,
    .order-line-side-editable {
        grid-column: 1 / -1;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-end;
        width: 100%;
        min-width: 0;
        text-align: right;
        padding-top: 0.25rem;
    }

    .order-line-price,
    .order-line-price-compact {
        font-size: 1.4rem;
    }

    .order-line-actions {
        justify-content: flex-end;
    }

    .order-summary-card {
        padding: 0.9rem 1rem;
    }

    .order-summary-value {
        font-size: 1.45rem;
    }

    .order-detail-view .order-line-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .order-detail-view .order-line-image {
        width: 64px;
        height: 64px;
    }

    .order-detail-view .order-line-title {
        font-size: 0.9rem;
    }

    .order-detail-view .order-line-ref,
    .order-detail-view .order-line-origin,
    .order-detail-view .order-line-meta,
    .order-detail-view .order-line-unit-price {
        font-size: 0.84rem;
    }

    .order-detail-view .order-line-price {
        font-size: 1rem;
    }

    .order-detail-view .order-summary-value {
        font-size: 1.05rem;
    }

    .order-cart-view .order-line-card,
    .order-cart-view .order-line-card-compact {
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 0.65rem 0.75rem;
    }

    .order-cart-view .order-line-image,
    .order-cart-view .order-line-image-compact {
        width: 56px;
        height: 56px;
    }

    .order-cart-view .order-line-title {
        font-size: 0.9rem;
    }

    .order-cart-view .order-line-title-compact {
        font-size: 0.86rem;
    }

    .order-cart-view .order-line-ref,
    .order-cart-view .order-line-meta,
    .order-cart-view .order-line-unit-price {
        font-size: 0.8rem;
    }

    .order-cart-view .order-line-price,
    .order-cart-view .order-line-price-compact {
        font-size: 0.98rem;
    }

    .product-list-name {
        font-size: 0.95rem;
    }

    .product-list-code,
    .product-list-price {
        font-size: 0.86rem;
    }

    .product-list-qty-cell {
        min-width: 100px;
    }

    .product-list-qty-input {
        max-width: 84px;
    }
}
