/* Venta Lite — simplified data-entry focused styles */

/* WCAG 2.4.7 — visible focus (Bootstrap components included) */
.venta-lite-body :focus-visible {
  outline: 2px solid var(--primary-color, #1e7e34);
  outline-offset: 2px;
}
.venta-lite-body .btn:focus-visible {
  outline-offset: 2px;
}

/* Venta Lite — common link format: 2px offset underline */
.venta-lite-body a[href] {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}
.venta-lite-body a.btn,
.venta-lite-body .nav-link,
.venta-lite-body .navbar-brand,
.venta-lite-body .venta-lite-home-btn,
.venta-lite-body .vl-kpi-card,
.venta-lite-body .vl-activity-item,
.venta-lite-body .vl-supplier-rank,
.venta-lite-body .supplier-catalogue-thumb-link {
    text-decoration: none !important;
}

.venta-lite-home-btn {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}
.venta-lite-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
/* Full-height column layout for home vertical centering */
.venta-lite-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}
html:has(body.venta-lite-body) {
    overflow-x: hidden;
}
/* WCAG 2.5.5 — small form controls must still meet 44 px touch target on mobile */
.venta-lite-body .form-control-sm {
    min-height: 44px;
}
/* Prevent webkit from propagating split-layout inner scroll width to documentElement.scrollWidth.
   Inner toolbars retain their own overflow-x:auto scroll containers. */
.venta-lite-split-layout {
    overflow-x: hidden !important;
}

/* Navbar — single row for primary links; vertically centered bar */
.venta-lite-nav {
    min-height: 3.25rem;
}
.venta-lite-nav .navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
}
.venta-lite-nav .navbar-nav .nav-link i {
    margin-right: 0.3rem;
    line-height: 1;
    flex-shrink: 0;
}
.venta-lite-nav .navbar-brand {
    font-size: 1.1rem;
}
/* Expanded-nav styling — matches navbar-expand-lg (hamburger below 992px, so tablets don't wrap 9+ links) */
@media (min-width: 992px) {
    .venta-lite-nav .navbar-nav .nav-link {
        font-size: 0.875rem;
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
    }
    /* Classic Bootstrap: primary (me-auto) beside logo, utilities on the right */
    .venta-lite-nav-collapse.navbar-collapse {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-width: 0;
        max-width: 100%;
    }
    .venta-lite-nav-end-group {
        border-left: 1px solid var(--bs-border-color);
        padding-left: 0.75rem;
    }
}
/* Keep nav within viewport — clip avoids a second horizontal scrollbar; collapse already wraps */
.venta-lite-nav .container-fluid {
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
}

/* Home — fill main and center block in viewport */
.venta-lite-home-hero {
    min-height: 0;
}
.venta-lite-card {
    transition: box-shadow 0.2s, transform 0.2s;
}
.venta-lite-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.venta-lite-card .card-body {
    padding: var(--vl-panel-padding, 16px);
}
.venta-lite-table th {
    font-weight: 600;
    font-size: 0.85rem;
}
.venta-lite-table td {
    vertical-align: middle;
}
/* Venta Lite — larger badges for status and level (balanced vs. buttons) */
.venta-lite-table .badge.pkg-level-primary,
.venta-lite-table .badge.pkg-level-secondary,
.venta-lite-table .badge.pkg-level-tertiary,
.venta-lite-table .badge.bg-success,
.venta-lite-table .badge.bg-warning,
.venta-lite-table .badge.bg-secondary,
.venta-lite-table .badge.vl-status-approved,
.venta-lite-table .badge.vl-status-draft,
.venta-lite-table .badge.vl-status-pending,
.venta-lite-table .badge.vl-status-rejected {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}
.venta-lite-form .form-label {
    font-weight: 500;
}
.venta-lite-form .form-control:focus,
.venta-lite-form .form-select:focus {
    border-color: var(--bs-success);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

/* Table card — do not grow beyond content; keep full width */
#specsListSection,
#productsListSection,
#volumeListSection {
    min-width: 0;
    flex: 0 0 auto !important;
    height: auto !important;
}

/* Toolbar Actions dropdown: card-body follows header in DOM and paints on top by default; overflow-x on toolbar can clip menus.
   Popper strategy="fixed" on the toggle (see views) escapes clipping; header z-index keeps stacking sane if needed. */
#specsListSection > .card-header,
#productsListSection > .card-header {
    position: relative;
    z-index: 12;
}
#specsListSection .venta-lite-packaging-specs-toolbar .dropdown-menu,
#productsListSection .venta-lite-packaging-specs-toolbar .dropdown-menu {
    z-index: 1080;
}

/* Left-pane table: size to content, 50px padding at bottom, 100px above footer */
#specsContainer.venta-lite-table-container,
#productsContainer.venta-lite-table-container,
#suppliersContainer.venta-lite-table-container {
    padding-bottom: 50px;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    margin-bottom: 100px !important;
}

/* Layout containers — ensure flex hierarchy allows proper shrinking */
#specsLayout,
#productsLayout,
#suppliersLayout,
#volumeLayout {
    min-width: 0;
    width: 100%;
}
/* 100px gap between table area and footer */
#specsLayout,
#productsLayout,
#suppliersLayout {
    margin-bottom: 100px;
}

/* Venta Lite split-pane header standard — matches Packaging Identification card-header */
.venta-lite-header-panel {
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
}
.venta-lite-header-panel .venta-lite-header-title {
    font-size: 0.875rem;
    font-weight: 700;
}

/* Page header blocks — ensure left/right columns align vertically */
.venta-lite-page-header-block {
    min-height: 3.5rem;
}

/* Right-hand detail pane — prevent collapse in flex layout */
#volumeDetailPanel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    overflow: hidden;
}
/* Split-pane body (fetch-injected HTML, no iframe) — mirrors _LayoutEmbeddedContent inner layout */
.venta-lite-detail-pane-body {
    margin: 0;
    padding: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-family: var(--venta-font-sans, 'DM Sans', system-ui, sans-serif);
}
.venta-lite-detail-pane-body.container-fluid {
    padding: 0.5rem 0.6rem;
}
.venta-lite-detail-pane-body .row {
    --bs-gutter-x: 0.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100%;
}
.venta-lite-detail-pane-body .row > [class*="col-"] {
    max-width: 100%;
    padding-left: calc(var(--bs-gutter-x) * 0.5) !important;
    padding-right: calc(var(--bs-gutter-x) * 0.5) !important;
}
.venta-lite-detail-pane-body .row.g-3 > [class*="col-md-6"],
.venta-lite-detail-pane-body .row > [class*="col-md-6"] {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}
.venta-lite-detail-pane-body .venta-embedded-compact-table { font-size: 0.7rem; table-layout: fixed; width: 100%; margin-bottom: 0.5rem; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th, .venta-lite-detail-pane-body .venta-embedded-compact-table td { padding: 0.2rem 0.3rem; word-break: break-word; vertical-align: top; }
/* Six columns (Material / Vol / Pre / Post / Origin / EPR per unit) sized to always fit the pane. */
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(1) { width: 22%; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(2) { width: 12%; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(3) { width: 13%; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(4) { width: 13%; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(5) { width: 18%; }
.venta-lite-detail-pane-body .venta-embedded-compact-table th:nth-child(6) { width: 22%; }
/* These fixed-layout tables must wrap inside their columns, never scroll sideways. */
.venta-lite-detail-pane-body .venta-embedded-compact-table th,
.venta-lite-detail-pane-body .venta-embedded-compact-table td { white-space: normal !important; }
.venta-lite-detail-pane-body .card:first-child .card-header {
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
}

/* Packaging specs: detail pane scrolls inside flex layout */
#specsDetailPanel.venta-lite-spec-detail-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    align-self: stretch;
}
/* Products list: detail iframe follows embedded content height (matches PackagingSpecs) */
#productsDetailPanel.venta-lite-products-detail-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    align-self: stretch;
}
#productsDetailPanel.venta-lite-products-detail-panel .venta-lite-detail-pane-scroll,
#specsDetailPanel.venta-lite-spec-detail-panel .venta-lite-detail-pane-scroll,
#suppliersDetailPanel.venta-lite-suppliers-detail-panel .venta-lite-detail-pane-scroll {
    flex: 1 1 auto;
    min-height: 320px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}
#suppliersDetailPanel.venta-lite-suppliers-detail-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    align-self: stretch;
    width: 100% !important;
    max-width: none !important;
    flex: 1 0 auto !important;
}
/* Remove width constraint so detail panels fill parent container */
#specsDetailPanel.venta-lite-spec-detail-panel,
#productsDetailPanel.venta-lite-products-detail-panel,
#suppliersDetailPanel.venta-lite-suppliers-detail-panel {
    width: 100% !important;
    max-width: none !important;
    flex: 1 0 auto !important;
}

/* Single-column (stacked) view: the detail panel's split-view sizing (overflow:hidden +
   align-self:stretch, so it matches the list column's height with its own internal scroll)
   must not clip content once it's folded full-width below the list instead — let it grow to
   fit whatever the pane loaded (needed for the collapsible-panel headers above to have
   anything visible to expand/collapse). */
.stacked #specsDetailPanel.venta-lite-spec-detail-panel,
.stacked #productsDetailPanel.venta-lite-products-detail-panel,
.stacked #suppliersDetailPanel.venta-lite-suppliers-detail-panel {
    overflow: visible;
    height: auto !important;
}
.stacked #specsDetailPanel.venta-lite-spec-detail-panel .venta-lite-detail-pane-scroll,
.stacked #productsDetailPanel.venta-lite-products-detail-panel .venta-lite-detail-pane-scroll,
.stacked #suppliersDetailPanel.venta-lite-suppliers-detail-panel .venta-lite-detail-pane-scroll {
    overflow: visible;
    height: auto !important;
}

/* Remove thin vertical line between left and right panes */
#specsRightColumn.border-start,
#productsRightColumn.border-start,
#suppliersRightColumn.border-start {
    border-left: none !important;
    border-left-width: 0 !important;
}
.venta-lite-spec-detail-panel,
.venta-lite-products-detail-panel,
.venta-lite-suppliers-detail-panel {
    border-left: none !important;
    border-left-width: 0 !important;
}

/* (Right-pane -7px alignment hacks removed — the rounded shell + padded header
   below handle alignment cleanly.) */

/* Single-column (stacked) view: breathing room where the right pane folds under the left */
.venta-lite-split-layout.stacked #productsRightColumn,
.venta-lite-split-layout.stacked #specsRightColumn,
.venta-lite-split-layout.stacked #suppliersRightColumn {
    margin-left: 0 !important;
    margin-top: 1.25rem !important;
}

/* Suppliers uses its own flex wrapper (#suppliersLayout) rather than .venta-lite-split-layout;
   stacked mode folds the detail column full-width under the list, same as the other pages. */
#suppliersLayout.stacked { flex-direction: column; overflow-x: visible; }
#suppliersLayout.stacked > div:first-child { flex: 1 1 auto; }
#suppliersLayout.stacked #suppliersRightColumn {
    border-left: 0 !important;
    margin-top: 1.25rem;
    flex: 1 1 auto;
}

/* Pane badges match the list-side pill sizing (Bootstrap default badge is larger) */
.venta-lite-detail-pane-body .badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3em 0.6em;
    vertical-align: middle;
}

/* Packaging level badges — Primary / Secondary / Tertiary */
.pkg-level-primary {
    background-color: #198754;
    color: #fff;
}
.pkg-level-secondary {
    background-color: #0d6efd;
    color: #fff;
}
.pkg-level-tertiary {
    background-color: #fd7e14;
    color: #fff;
}

/* Product chips in packaging-centric view */
.product-chip {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
}
.product-chip:hover {
    background-color: var(--bs-light) !important;
}

/* View toggle — packaging vs product */
#viewToggle .btn.active,
#packagingProductToggle .btn.active {
    font-weight: 600;
}

/* Volume page — quick-add bar */
.volume-quick-add-bar {
    border-color: rgba(25, 135, 84, 0.2);
    background: linear-gradient(to bottom, rgba(25, 135, 84, 0.03), transparent);
}
.volume-quick-add-bar .form-control:focus {
    border-color: var(--bs-success);
}

/* Volume table — wider product column (desktop); narrow min on small screens to reduce page-level overflow */
#volumeTable th:first-child,
#volumeTable td:first-child {
    min-width: 140px;
}

@media (min-width: 576px) {
    #volumeTable th:first-child,
    #volumeTable td:first-child {
        min-width: 200px;
    }
}

@media (min-width: 992px) {
    #volumeTable th:first-child,
    #volumeTable td:first-child {
        min-width: 280px;
    }
}

/* Volume number inputs — text-only, no spinner */
.volume-number-input::-webkit-outer-spin-button,
.volume-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.volume-number-input {
    -moz-appearance: textfield;
}

/* Volume product search typeahead */
.volume-typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-top: 2px;
}
.volume-typeahead-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.volume-typeahead-item:last-child {
    border-bottom: none;
}
.volume-typeahead-item:hover {
    background-color: rgba(25, 135, 84, 0.1);
}

/* ========== Venta Lite Dashboard — Premium ========== */
:root {
    --vl-chart-primary: #0f766e;
    --vl-chart-accent: #6366f1;
    --vl-chart-grid: rgba(100, 116, 139, 0.15);
    --vl-section-gap: 24px;
    --vl-panel-padding: 16px;
    /* Chart theme tokens — read at render time by VlCharts.readTheme() (venta-lite-charts.js).
       Slots 1-2 match the KPI accents & hero gradient; 8 slots so 7+-segment doughnuts don't cycle. */
    --vl-chart-1: #0f766e;
    --vl-chart-2: #0d9488;
    --vl-chart-3: #14b8a6;
    --vl-chart-4: #5eead4;
    --vl-chart-5: #6366f1;
    --vl-chart-6: #8b5cf6;
    --vl-chart-7: #f59e0b;
    --vl-chart-8: #f43f5e;
    --vl-chart-text: #475569;
    --vl-tooltip-bg: rgba(15, 23, 42, 0.95);
    --vl-chart-neutral: #e2e8f0;
}

/* Shared chart tooltip (dark chip) — visuals live here, positioning in venta-lite-charts.js */
.vl-tooltip {
    position: fixed;
    visibility: hidden;
    background: var(--vl-tooltip-bg);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.35;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    font-family: var(--venta-font-sans, 'DM Sans', system-ui, sans-serif);
}

/* Skeleton loaders — gray shimmer for async chart/table containers */
@keyframes vl-skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.vl-skeleton {
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: vl-skeleton-shimmer 1.5s ease-in-out infinite;
    min-height: 100px;
}

.vl-dashboard {
    background-color: #f1f5f9;
    min-height: 100%;
}
/* Section gaps — 24px between rows and columns */
.vl-dashboard .row.g-3,
.vl-dashboard .row {
    --bs-gutter-x: var(--vl-section-gap, 24px);
    --bs-gutter-y: var(--vl-section-gap, 24px);
}
.vl-dashboard .vl-welcome-bar {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.06), transparent);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.vl-dashboard .vl-welcome-bar h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}
.vl-dashboard .vl-welcome-bar .text-muted {
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

/* KPI cards — compact horizontal: icon chip left, figure + label right */
.vl-kpi-card {
    display: flex !important;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    padding: 12px 16px;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-left: 4px solid var(--bs-success);
    height: 100%;
    min-height: 72px;
}
.vl-kpi-meta { min-width: 0; }
.vl-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    color: inherit;
}
.vl-kpi-card.vl-kpi-products { border-left-color: #0f766e; }
.vl-kpi-card.vl-kpi-specs { border-left-color: #0d6efd; }
.vl-kpi-card.vl-kpi-units { border-left-color: #f59e0b; }
.vl-kpi-card.vl-kpi-epr { border-left-color: #6366f1; }
.vl-kpi-card.vl-kpi-recyclability { border-left-color: #0d9488; }
.vl-kpi-card.vl-kpi-suppliers { border-left-color: #14b8a6; }
.vl-kpi-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0;
}
.vl-kpi-products .vl-kpi-icon { background: rgba(15, 118, 110, 0.12); color: #0f766e; }
.vl-kpi-specs .vl-kpi-icon { background: rgba(13, 110, 253, 0.12); color: #0d6efd; }
.vl-kpi-units .vl-kpi-icon { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.vl-kpi-epr .vl-kpi-icon { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.vl-kpi-recyclability .vl-kpi-icon { background: rgba(13, 148, 136, 0.12); color: #0d9488; }
.vl-kpi-suppliers .vl-kpi-icon { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.vl-kpi-number {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vl-kpi-subtitle {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chart cards */
.vl-chart-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    padding: var(--vl-panel-padding, 16px);
    margin-bottom: var(--vl-section-gap, 24px);
    min-height: 320px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Dashboard cards: equal height per row */
.vl-dashboard .vl-dashboard-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.vl-dashboard .vl-dashboard-card > .tab-content,
.vl-dashboard .vl-dashboard-card > .vl-chart-canvas,
.vl-dashboard .vl-dashboard-card > .row,
.vl-dashboard .vl-dashboard-card > [id="vlTopSuppliersList"],
.vl-dashboard .vl-dashboard-card > [id="vlTopEprList"] {
    flex: 1;
    min-height: 0;
}
.vl-chart-card .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 1rem;
}
.vl-chart-card .vl-chart-canvas {
    height: 260px;
    position: relative;
}
/* Trends: grow chart into card without increasing card min-height */
.vl-chart-card.vl-trends-card > .tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.vl-chart-card.vl-trends-card > .tab-content > .tab-pane {
    flex: 1;
    min-height: 0;
    flex-direction: column;
}
.vl-chart-card.vl-trends-card > .tab-content > .tab-pane.show {
    display: flex;
}
.vl-chart-card.vl-trends-card .vl-trends-chart-canvas {
    flex: 1;
    min-height: 220px;
    height: auto;
    position: relative;
}
.vl-chart-svg-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
    position: relative;
}
.vl-chart-canvas .vl-chart-svg-container {
    min-height: 220px;
}
/* Data Quality doughnut — fill parent for centering */
.vl-chart-card .position-relative > .vl-chart-svg-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Data Quality widget overhaul */
.vl-data-quality-card .vl-quality-chart-col { flex: 0 0 auto; }
.vl-data-quality-card .vl-quality-chart-wrap {
    width: 200px;
    height: 200px;
    position: relative;
}
.vl-data-quality-card .vl-quality-legend-col { min-width: 0; }
.vl-quality-legend { padding: 0.5rem 0; }
.vl-quality-legend-title { font-size: 0.65rem; }
.vl-quality-legend-item .vl-quality-pill { min-width: 1.8em; text-align: center; }
.vl-quality-list-col { min-width: 0; }
.vl-quality-list {
    font-size: 0.8rem;
    min-width: 0;
    min-height: 22.5rem;
}
.vl-quality-list .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.vl-dash-pagination .btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}
.vl-quality-list-item { line-height: 1.5; }
.vl-quality-list-item:hover { background: rgba(0,0,0,0.03); border-radius: 4px; }
.vl-quality-filter .btn { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.vl-quality-filter .btn.active { font-weight: 600; }
/* Dashboard card toolbars: allow view toggles to wrap inside narrow columns */
.vl-dashboard .vl-chart-card .card-title .btn-group.flex-wrap {
    gap: 2px;
}

/* Quality pills */
.vl-quality-pill {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}
.vl-quality-pill.vl-grade-a { background: #0f766e; color: #fff; }
.vl-quality-pill.vl-grade-b { background: #14b8a6; color: #fff; }
.vl-quality-pill.vl-grade-c { background: #f59e0b; color: #1e293b; }
.vl-quality-pill.vl-grade-d { background: #ef4444; color: #fff; }

/* Highest EPR Exposure table — vertical centering */
.vl-epr-table td,
.vl-epr-table th { vertical-align: middle !important; }

/* Data Quality tables */
.vl-quality-table td,
.vl-quality-table th { vertical-align: middle; font-size: 0.8rem; }

/* Activity table (Recent Activity) */
.vl-activity-table .vl-activity-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}
.vl-activity-table .vl-activity-thumb-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bs-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
    font-size: 0.85rem;
}
.vl-activity-table th { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--bs-secondary); }
.vl-activity-table td { vertical-align: middle; font-size: 0.8rem; }

/* Activity feed */
.vl-activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.vl-activity-item:last-child {
    border-bottom: none;
}
.vl-activity-item:hover {
    background: rgba(25, 135, 84, 0.06);
}
.vl-activity-item .vl-activity-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bs-light);
}
.vl-activity-item .vl-activity-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bs-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
    font-size: 1rem;
    flex-shrink: 0;
}
.vl-activity-item .vl-activity-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary);
}

/* Supplier rank list */
.vl-supplier-rank {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.vl-supplier-rank:last-child {
    border-bottom: none;
}
.vl-supplier-rank:hover {
    background: rgba(25, 135, 84, 0.06);
}
.vl-supplier-rank .vl-rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bs-success);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vl-supplier-rank .vl-rank-count {
    font-size: 0.8rem;
    color: var(--bs-secondary);
    margin-left: auto;
}

/* Discovery row charts */
.vl-discovery-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    padding: var(--vl-panel-padding, 16px);
    margin-bottom: var(--vl-section-gap, 24px);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.vl-dashboard .vl-discovery-card.vl-dashboard-card {
    min-height: 320px;
}
.vl-discovery-card .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 1rem;
}
.vl-discovery-card .vl-chart-svg-container {
    min-height: 200px;
}
.vl-chart-svg-container > div {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Period toggle buttons */
.vl-period-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.vl-period-btn.active {
    font-weight: 600;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.3);
}

/* Status badge palette — consistent across Venta Lite */
.venta-lite-body .vl-status-approved,
.embedded-content .vl-status-approved { background-color: #0f766e; color: #fff; }
.venta-lite-body .vl-status-draft,
.embedded-content .vl-status-draft { background-color: #6b7280; color: #fff; }
.venta-lite-body .vl-status-pending,
.embedded-content .vl-status-pending { background-color: #f59e0b; color: #1e293b; }
.venta-lite-body .vl-status-rejected,
.embedded-content .vl-status-rejected { background-color: #ef4444; color: #fff; }

/* PackagingSpecs: stacked layout when split view is off */
.venta-lite-split-layout#specsLayout.stacked {
    flex-direction: column !important;
    align-items: stretch !important;
}
.venta-lite-split-layout#specsLayout.stacked > div:first-child {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}
.venta-lite-split-layout#specsLayout.stacked #specsRightColumn {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--bs-border-color);
}

/* Venta Lite Products: same stacked split-off behavior as PackagingSpecs */
.venta-lite-split-layout#productsLayout.stacked {
    flex-direction: column !important;
    align-items: stretch !important;
}
.venta-lite-split-layout#productsLayout.stacked > div:first-child {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}
.venta-lite-split-layout#productsLayout.stacked #productsRightColumn {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--bs-border-color);
}

/* Responsive */
@media (max-width: 991.98px) {
    .vl-dashboard .vl-kpi-number {
        font-size: 1.25rem;
    }
}

/* Dashboard widgets — empty / loading hints */
.vl-inline-empty {
    text-align: center;
    padding: 1.25rem 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}
.vl-inline-empty i {
    display: block;
    font-size: 1.75rem;
    color: var(--primary-color, #1e7e34);
    opacity: 0.85;
    margin-bottom: 0.35rem;
    line-height: 1;
}

/* ============================================================
   Mobile optimisation (WS3)
   ============================================================ */

/* Split-pane pages stack on phones/small tablets regardless of the JS split toggle.
   !important is required to beat the inline flex:1 1 60%/40% styles (same precedent as .stacked). */
@media (max-width: 767.98px) {
    .venta-lite-split-layout {
        flex-direction: column !important;
        align-items: stretch !important;
        overflow-x: visible !important;
    }
    .venta-lite-split-layout > div:first-child,
    #specsRightColumn,
    #productsRightColumn {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    #specsRightColumn,
    #productsRightColumn {
        border-left: 0 !important;
        border-top: 1px solid var(--bs-border-color);
    }
    /* The split toggle is a no-op while CSS forces stacking */
    #viewSplit { display: none !important; }

    /* Specs table: hide low-value columns on phones (Level, Recycled %, Elements, Products, Data Quality);
       full data remains in the detail pane and on larger screens. */
    #specsTable th:nth-child(4), #specsTable td:nth-child(4),
    #specsTable th:nth-child(5), #specsTable td:nth-child(5),
    #specsTable th:nth-child(8), #specsTable td:nth-child(8),
    #specsTable th:nth-child(9), #specsTable td:nth-child(9),
    #specsTable th:nth-child(10), #specsTable td:nth-child(10) { display: none; }
}

/* Wizard modal goes truly fullscreen on phones (its inline max-width/height defeats
   Bootstrap's modal-fullscreen-sm-down on its own). */
@media (max-width: 575.98px) {
    #newPackagingModal .modal-dialog {
        max-width: 100vw !important;
        width: 100vw;
        margin: 0;
        height: 100vh !important;
        max-height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
    #newPackagingModal .modal-content {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0;
    }

    /* Dashboard density on phones */
    .vl-dashboard .vl-welcome-bar { padding: 0.9rem 1rem; }
    .vl-dashboard .row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
    .vl-chart-card, .vl-discovery-card { min-height: 0; }
    .vl-dashboard .vl-dashboard-card { min-height: 260px; }
    .vl-chart-card .vl-chart-canvas { height: 220px; }
    .vl-data-quality-card .vl-quality-chart-wrap { width: 160px; height: 160px; }
    .vl-hero-exposure .vl-hero-stats { gap: 1rem !important; }
    .vl-hero-exposure .p-3, .vl-hero-exposure .p-lg-4, .vl-hero-exposure .p-4 { padding: 1rem !important; }
}

/* Smooth in-container table scrolling on touch devices */
.vl-quality-list .table-responsive,
.vl-suppliers-table,
.vl-epr-table,
.vl-jur-table { -webkit-overflow-scrolling: touch; }

/* ============================================================
   Presentation polish (WS2)
   ============================================================ */

/* Card-title hierarchy: teal accent tick */
.vl-chart-card > .card-title,
.vl-discovery-card > .card-title {
    border-left: 3px solid var(--vl-chart-1, #0f766e);
    padding-left: 0.5rem;
}

/* KPI cards: icon responds to hover along with the lift */
.vl-kpi-card .vl-kpi-icon { transition: transform 0.2s ease; }
.vl-kpi-card:hover .vl-kpi-icon { transform: scale(1.08); }

/* Nav active state: subtle underline in the brand colour */
.venta-lite-nav .nav-link.active {
    color: var(--primary-color, #1e7e34) !important;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary-color, #1e7e34);
}

/* ============================================================
   World-class presentation pass
   ============================================================ */

/* Scale the whole Venta surface up from the legacy 12px root. Charts use px fonts and
   are tuned separately in venta-lite-charts.js. */
html:has(body.venta-lite-body) {
    font-size: 15px;
}

/* The dashboard grid overflows its container by one Bootstrap gutter (~12px), producing a
   horizontal scrollbar on desktop. Clip it — nothing meaningful lives in that overflow. */
.venta-lite-main,
.vl-dashboard {
    overflow-x: clip;
}

/* Dashboard links: calm by default, underline only on hover. Beats the global
   `.venta-lite-body a[href]` underline rule on specificity. */
.venta-lite-body .vl-dashboard a[href] {
    text-decoration: none !important;
}
.venta-lite-body .vl-dashboard a[href]:hover {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}
.venta-lite-body .vl-dashboard a.vl-kpi-card:hover,
.venta-lite-body .vl-dashboard .vl-firstrun-step:hover {
    text-decoration: none !important;
}

/* KPI cards: the number leads, but stays compact in the horizontal layout */
.vl-kpi-number {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    color: #0f172a;
}

/* No stray horizontal scrollbars anywhere: wide content must scroll inside its own
   .table-responsive / overflow container, never the page. */
.venta-lite-body #mainContent { overflow-x: clip; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD TABLES — never word-wrap inside cells: truncate or scroll
   ════════════════════════════════════════════════════════════════════ */
.vl-jur-table td, .vl-jur-table th,
.vl-epr-table td, .vl-epr-table th,
.vl-suppliers-table td, .vl-suppliers-table th,
.vl-quality-table td, .vl-quality-table th,
.vl-activity-table td, .vl-activity-table th {
    white-space: nowrap;
}
.vl-cell-truncate {
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}
@media (min-width: 1400px) {
    .vl-cell-truncate { max-width: 24ch; }
}
/* Column visibility utilities for dense widget tables */
@media (max-width: 767.98px) {
    .vl-hide-md { display: none !important; }
}
@media (max-width: 1399.98px) {
    .vl-hide-xl { display: none !important; }
}
/* Compact KPI icons on phones so number + label never wrap */
@media (max-width: 575.98px) {
    .vl-kpi-icon { width: 32px; height: 32px; font-size: 0.95rem; }
    .vl-kpi-card { padding: 10px 12px; gap: 9px; min-height: 60px; }
}

/* ════════════════════════════════════════════════════════════════════
   DESIGN DISCIPLINE — one control language across every screen
   ════════════════════════════════════════════════════════════════════ */

/* Form fields: one height, one radius, one focus treatment */
.venta-lite-body .form-control,
.venta-lite-body .form-select {
    min-height: 38px;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    border-color: #dbe3ea;
    font-size: 0.875rem;
}
.venta-lite-body textarea.form-control { min-height: 76px; }
.venta-lite-body .form-control-sm,
.venta-lite-body .form-select-sm {
    min-height: 32px;
    padding: 0.25rem 0.55rem;
    border-radius: 7px;
    font-size: 0.8125rem;
}
.venta-lite-body .form-control:focus,
.venta-lite-body .form-select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}
.venta-lite-body .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #475569;
    margin-bottom: 0.3rem;
}
.venta-lite-body .form-text { font-size: 0.75rem; color: #94a3b8; }
.venta-lite-body .form-check-input:checked { background-color: #0f766e; border-color: #0f766e; }
.venta-lite-body .form-check-input:focus { border-color: #0f766e; box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12); }

/* Segmented controls: a single accent for the active state, everywhere */
.venta-lite-body .btn-group .btn.active,
.venta-lite-body .btn-group .btn-check:checked + .btn {
    background: #0f766e !important;
    border-color: #0f766e !important;
    color: #fff !important;
}
.venta-lite-body .btn-group-sm .btn,
.venta-lite-body .card-title .btn-group .btn { font-size: 0.78rem; }

/* Card-title controls sit on one baseline at one size */
.venta-lite-body .vl-chart-card .card-title .btn,
.venta-lite-body .vl-dashboard-card .card-title .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}
.venta-lite-body .vl-chart-card .card-title .form-select-sm,
.venta-lite-body .vl-dashboard-card .card-title .form-select-sm {
    min-height: 30px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Toolbars: search fields and action buttons share one baseline */
.venta-lite-body .vl-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

/* Detail pane: the materials table was collapsing into vertical letter-wrap when squeezed */
.venta-lite-detail-pane-body table th,
.venta-lite-detail-pane-body table td {
    white-space: nowrap;
}
.venta-lite-detail-pane-body .table-responsive,
.venta-lite-detail-pane-body table {
    max-width: 100%;
}

/* Jurisdiction exposure table: roomier rows, calmer chrome */
.vl-jur-table td, .vl-jur-table th { padding-top: 0.45rem; padding-bottom: 0.45rem; }
.vl-jur-table { font-size: 0.86rem; }

/* Dashboard card titles: slightly larger for the 14px base */
.vl-chart-card .card-title,
.vl-discovery-card .card-title,
.vl-dashboard-card .card-title {
    font-size: 0.82rem;
}

/* Jurisdiction exposure list scrolls within its card so it doesn't stretch the whole row */
#vlExposureByJurisdiction { max-height: 430px; overflow-y: auto; }

/* ============================================================
   Design consistency pass: tables, forms, titles, sorting
   ============================================================ */

/* Sortable headers (vl-table-sort.js) */
.vl-sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.vl-sortable-th:hover { color: var(--primary-color, #1e7e34); }
.vl-sort-ind { opacity: 0.35; font-size: 0.75em; }
.vl-sortable-th[data-vl-sort] .vl-sort-ind { opacity: 1; color: var(--primary-color, #1e7e34); }

/* Data tables: one rhythm everywhere */
.venta-lite-table th,
.vl-sortable th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}
.venta-lite-table td,
.vl-sortable td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}
.venta-lite-table tbody tr:hover,
.vl-sortable tbody tr:hover { background: #f0fdfa; }

/* Cards and widgets share edges: same radius, same border */
.venta-lite-body .card {
    border-radius: 12px;
    border-color: #e2e8f0;
}
.venta-lite-body .card-header {
    background: #fff;
    font-weight: 600;
    border-bottom-color: #eef2f7;
    border-radius: 12px 12px 0 0 !important;
}

/* Forms: clear labels, calm inputs */
.venta-lite-form .form-label,
.venta-lite-body form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.venta-lite-body .form-text { color: #64748b; }

/* Page titles: consistent scale */
.venta-lite-page-header-block h1,
.vl-dashboard h1 { font-size: 1.35rem; }

/* Dashboard rows keep an even vertical rhythm */
.vl-dashboard > .row { margin-bottom: 1.5rem; }
.vl-dashboard > .row:last-child { margin-bottom: 0; }

/* ============================================================
   Visual design pass 2
   ============================================================ */

/* Hero: subtle radial depth + top-materials strip */
.vl-hero-exposure { position: relative; overflow: hidden; }
.vl-hero-exposure::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 300px at 85% -50%, rgba(94, 234, 212, 0.18), transparent 70%),
        radial-gradient(400px 260px at 15% 130%, rgba(20, 184, 166, 0.14), transparent 70%);
    pointer-events: none;
}
.vl-hero-exposure > div { position: relative; }
.vl-hero-materials { max-width: 24rem; }
.vl-hero-mat-track { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.vl-hero-mat-bar { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #5eead4, #99f6e4); transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }

/* Status pills (recycled content etc.) */
.vl-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.vl-pill-good { background: #ccfbf1; color: #0f766e; }
.vl-pill-mid { background: #fef3c7; color: #92400e; }
.vl-pill-low { background: #fee2e2; color: #b91c1c; }

/* Supplier initial avatars */
.vl-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* Nav: active pill + gentle hover */
.venta-lite-nav .nav-link { border-radius: 8px; transition: background 0.15s ease, color 0.15s ease; }
.venta-lite-nav .navbar-nav .nav-link:hover { background: #f0fdfa; color: var(--primary-color, #1e7e34); }
.venta-lite-nav .nav-link.active {
    background: #ecfdf5;
    box-shadow: none;
    color: var(--primary-color, #1e7e34) !important;
    font-weight: 600;
}

/* Thin, calm scrollbars for in-card scroll regions */
#vlExposureByJurisdiction::-webkit-scrollbar,
.vl-quality-list ::-webkit-scrollbar,
.rb-facet::-webkit-scrollbar,
.vl-dashboard .table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#vlExposureByJurisdiction::-webkit-scrollbar-thumb,
.vl-quality-list ::-webkit-scrollbar-thumb,
.rb-facet::-webkit-scrollbar-thumb,
.vl-dashboard .table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
#vlExposureByJurisdiction::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
#vlExposureByJurisdiction::-webkit-scrollbar-track { background: transparent; }

/* Inner page headers: icon carries the brand accent */
.venta-lite-page-header-block h1 i {
    color: var(--vl-chart-1, #0f766e);
    background: #f0fdfa;
    border-radius: 10px;
    padding: 0.35rem 0.45rem;
    margin-right: 0.35rem;
    font-size: 0.9em;
    vertical-align: -0.15em;
}

/* ============================================================
   Application cohesion: one surface, one language
   ============================================================ */

/* Every Venta page sits on the same soft canvas; content lives in white cards. */
body.venta-lite-body { background: #f1f5f9; }
.venta-lite-body #mainContent { padding-left: 1.25rem; padding-right: 1.25rem; }

/* All donut charts share one canonical size */
/* Donuts are a fixed 210px everywhere — flex:1 on .vl-chart-canvas would otherwise
   stretch them to whatever the card allows (315px, 407px…), so pin flex-basis too. */
.vl-donut {
    height: 210px !important;
    max-height: 210px !important;
    flex: 0 0 210px !important;
    min-height: 210px !important;
}
.vl-donut > div { height: 100%; }
.vl-data-quality-card .vl-quality-chart-wrap { width: 210px; height: 210px; }

/* Split-pane pages: the two panes read as cards on the canvas, not bare regions.
   overflow:hidden makes the rounded corners actually clip the header and scroll area. */
#specsRightColumn, #productsRightColumn, #suppliersRightColumn {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
    margin-left: 1rem;
    border-left: 0 !important;
    overflow: hidden;
}
/* Pane header: a real padded bar inside the rounded shell */
.venta-lite-detail-header {
    padding: 0.85rem 1.25rem !important;
    margin-top: 0 !important;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
}
/* Pane content breathes: consistent inset instead of content touching the shell edges */
.venta-lite-detail-pane-scroll { padding: 1rem 1.25rem; }
.venta-lite-detail-pane-body .container-fluid { padding-left: 0; padding-right: 0; }
/* site.css's global `main { padding-top: 76px }` (navbar offset) must not leak into pane fragments */
.venta-lite-detail-pane-body main { padding-top: 0 !important; }
/* The pane's inner cards sit on the white shell — soften them to bordered sections */
.venta-lite-detail-pane-body .card {
    border: 1px solid #eef2f6;
    border-radius: 10px;
    box-shadow: none;
}
.venta-lite-detail-pane-body .card-header {
    background: #fafcfd;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
}

/* Compact definition grid for detail panes */
.vl-detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1.25rem;
    row-gap: 0.35rem;
    font-size: 0.85rem;
    min-width: 0;
}
.vl-detail-grid dt {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    align-self: center;
}
.vl-detail-grid dd { margin: 0; color: #0f172a; overflow-wrap: anywhere; }
.vl-detail-thumb img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    background: #fafcfd;
    padding: 8px;
}
#specsListSection, #productsListSection, #volumeListSection, #suppliersListSection {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
}

/* Page headers: identical rhythm everywhere */
.venta-lite-page-header-block { margin-bottom: 1rem; }
.venta-lite-page-header-block h1 { font-size: 1.35rem; font-weight: 700; color: #0f172a; }
.venta-lite-page-header-block p { color: #64748b; }

/* Skip links must never flash visible inside modals when they receive initial focus */
.modal .visually-hidden-focusable { display: none !important; }

/* ════════════════════════════════════════════════════════════════════
   COLLAPSIBLE DETAIL PANELS — single-column (stacked) view only.
   Headers get the pointer cursor/chevron only while their layout wrapper
   carries .stacked; in split view the panels stay put (JS gates the click
   the same way). Open by default — collapsing is opt-in per click.
   ════════════════════════════════════════════════════════════════════ */
.stacked .vl-collapsible-header { cursor: pointer; user-select: none; }
.vl-collapsible-chevron { display: inline-block; transition: transform .15s ease; margin-left: .5rem; flex-shrink: 0; }
.vl-collapsible-chevron-rotated { transform: rotate(-90deg); }
.vl-collapsible-body.vl-collapsed { display: none; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD WIDGET GRID — DOM order = layout order (user-reorderable)
   ════════════════════════════════════════════════════════════════════ */
.vl-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}
.vl-widget { min-width: 0; display: flex; }
.vl-widget > * { flex: 1 1 auto; min-width: 0; }
.vl-span-3 { grid-column: span 3; }
.vl-span-4 { grid-column: span 4; }
.vl-span-6 { grid-column: span 6; }
.vl-span-8 { grid-column: span 8; }
.vl-span-12 { grid-column: span 12; }
@media (max-width: 1199.98px) {
    .vl-span-3, .vl-span-4 { grid-column: span 6; }
    .vl-span-8 { grid-column: span 12; }
}
@media (max-width: 767.98px) {
    .vl-span-3, .vl-span-4, .vl-span-6, .vl-span-8 { grid-column: span 12; }
}
/* The old row wrappers carried mb-4; the grid gap replaces it */
.vl-grid .vl-dashboard-card { margin-bottom: 0; }

/* Insight chips: dense headline takeaways */
.vl-insight-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    color: #334155;
}
.vl-insight-chip a { font-weight: 600; }

/* Compact two-column material-mix legend fills the narrower card */
.vl-matmix-legend-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.9rem;
    font-size: 0.78rem !important;
}
/* Dashboard cards: content-led height, not a fixed frame with dead space */
.vl-grid .vl-chart-card,
.vl-grid .vl-discovery-card { min-height: 0; }

/* Quick Start guide */
.vl-quickstart { background: #f0fdfa; border-color: #cceee7 !important; border-radius: 12px; }
.vl-qs-num {
    width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
    background: #0f766e; color: #fff; font-size: .72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; margin-top: 2px;
}
.vl-widget-info { font-size: .8rem; cursor: help; opacity: .55; }
.vl-widget-info:hover { opacity: 1; }
#vlWidgetManageList .list-group-item { cursor: default; }

/* ── Print (POM sheet: A4 / US Letter landscape via injected @page rule) ── */
@media print {
    .venta-lite-body .navbar,
    .venta-lite-body footer,
    .venta-lite-body form#volumeFilterForm,
    .venta-lite-body .venta-lite-page-header-block ~ .d-flex.gap-2,
    .venta-lite-body #pomFlagsCard,
    .venta-lite-body .btn,
    .venta-lite-body .alert,
    .venta-lite-body .dropdown-menu {
        display: none !important;
    }
    .venta-lite-body #mainContent { padding: 0 !important; overflow: visible !important; }
    .venta-lite-body #volumeListSection {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }
    .venta-lite-body #volumeListSection .card-body { overflow: visible !important; }
    .venta-lite-body table { font-size: 8.5pt !important; width: 100% !important; }
    .venta-lite-body table thead { display: table-header-group; }
    .venta-lite-body table tr { break-inside: avoid; }
    .venta-lite-body table tfoot tr:not(.volume-total-row) { display: none; }
    .venta-lite-body .volume-product-img { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   START HERE guide (bottom-left) + VENTA ASSISTANT chat (bottom-right)
   ════════════════════════════════════════════════════════════════════ */
.vl-starthere { position: fixed; left: 1rem; bottom: 1rem; z-index: 1045; }
.vl-starthere-pill {
    display: inline-flex; align-items: center; gap: .45rem;
    background: linear-gradient(120deg, #0f766e, #115e59); color: #fff;
    border: 0; border-radius: 999px; padding: .55rem 1.05rem;
    font-size: .85rem; font-weight: 700; letter-spacing: .01em;
    transition: transform .15s ease, box-shadow .15s ease;
}
.vl-starthere-pill:hover { transform: translateY(-2px); color: #fff; }
.vl-starthere-pill-done { background: #f1f5f9; color: #0f766e; }
.vl-starthere-card {
    position: absolute; left: 0; bottom: calc(100% + .6rem);
    width: min(21rem, calc(100vw - 2rem));
    background: #fff; border-radius: 14px; overflow: hidden;
    border: 1px solid #e2e8f0;
}
.vl-starthere-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    background: linear-gradient(120deg, #0f766e, #134e4a); color: #fff;
    padding: .8rem 1rem;
}
.vl-starthere-progress { height: 4px; background: #e2e8f0; }
.vl-starthere-progress > div { height: 4px; background: linear-gradient(90deg, #14b8a6, #34d399); transition: width .5s cubic-bezier(.22,.61,.36,1); }
.vl-starthere-steps { max-height: 46vh; overflow-y: auto; padding: .4rem 0; }
.vl-starthere-step {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem 1rem; cursor: pointer; font-size: .85rem; color: #334155;
}
.vl-starthere-step:hover { background: #f8fafc; }
.vl-starthere-step.done { color: #94a3b8; }
.vl-starthere-step.done .vl-starthere-tick { background: #d1fae5; color: #059669; }
.vl-starthere-step.next { background: #f0fdfa; font-weight: 600; color: #0f172a; }
.vl-starthere-tick {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    background: #eef2f6; color: #64748b; font-size: .72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.vl-starthere-go { color: #0f766e; font-size: 1.1rem; line-height: 1; }
.vl-starthere-foot { padding: .6rem 1rem; border-top: 1px solid #eef2f6; background: #fafbfc; }

/* Spotlight coachmark */
.vl-spot-overlay { position: fixed; inset: 0; z-index: 1060; background: rgba(15, 23, 42, .45); }
.vl-spot-ring {
    position: fixed; border-radius: 12px; pointer-events: none;
    box-shadow: 0 0 0 4px rgba(94, 234, 212, .9), 0 0 0 9999px rgba(15, 23, 42, .45);
    background: transparent; transition: all .25s ease;
}
.vl-spot-overlay { background: transparent; }
.vl-spot-card {
    position: fixed; width: min(20rem, calc(100vw - 2rem));
    background: #fff; border-radius: 12px; padding: 1rem;
    border: 1px solid #e2e8f0;
}

/* Assistant */
.vl-assistant { position: fixed; right: 1rem; bottom: 1rem; z-index: 1046; }
.vl-assistant-bubble {
    width: 52px; height: 52px; border-radius: 50%; border: 0;
    background: linear-gradient(135deg, #0f766e, #134e4a); color: #fff;
    font-size: 1.35rem; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
.vl-assistant-bubble:hover { transform: translateY(-2px) scale(1.04); color: #fff; }
.vl-assistant-bubble-open { background: #134e4a; }
.vl-assistant-panel {
    position: absolute; right: 0; bottom: calc(100% + .6rem);
    width: min(24rem, calc(100vw - 2rem));
    height: min(34rem, calc(100vh - 7rem));
    background: #fff; border-radius: 14px; border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; overflow: hidden;
}
.vl-assistant-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    background: linear-gradient(120deg, #0f766e, #134e4a); color: #fff;
    padding: .8rem 1rem; flex-shrink: 0;
}
.vl-assistant-headbtn { color: rgba(255,255,255,.8); border: 0; padding: .1rem .3rem; }
.vl-assistant-headbtn:hover { color: #fff; background: rgba(255,255,255,.15); }
.vl-assistant-messages { flex: 1 1 auto; overflow-y: auto; padding: .9rem; background: #f8fafc; }
.vl-msg { max-width: 88%; margin-bottom: .6rem; padding: .55rem .8rem; border-radius: 12px; font-size: .85rem; line-height: 1.45; }
.vl-msg-user { margin-left: auto; background: #0f766e; color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.vl-msg-assistant { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; color: #1e293b; }
.vl-msg-assistant p { margin: 0 0 .45rem; }
.vl-msg-assistant p:last-child { margin-bottom: 0; }
.vl-msg-assistant ul { margin: 0 0 .45rem; padding-left: 1.1rem; }
.vl-msg-typing span {
    display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
    background: #94a3b8; animation: vlTyping 1.2s infinite;
}
.vl-msg-typing span:nth-child(2) { animation-delay: .2s; }
.vl-msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes vlTyping { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.vl-assistant-empty { text-align: center; color: #94a3b8; padding: 2.2rem .8rem; font-size: .85rem; }
.vl-assistant-empty .bi { font-size: 1.6rem; color: #14b8a6; }
.vl-assistant-chips { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .9rem 0; flex-shrink: 0; }
.vl-assistant-chip {
    border: 1px solid #d1e7e4; background: #f0fdfa; color: #0f766e;
    border-radius: 999px; font-size: .74rem; padding: .25rem .7rem;
}
.vl-assistant-chip:hover { background: #ccfbf1; }
.vl-assistant-inputrow { display: flex; gap: .5rem; padding: .7rem .9rem .35rem; flex-shrink: 0; }
.vl-assistant-inputrow textarea { resize: none; }
.vl-assistant-foot { padding: 0 .9rem .6rem; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .vl-starthere { left: .5rem; bottom: .5rem; }
    .vl-assistant { right: .5rem; bottom: .5rem; }
}

/* Learning centre: richer lesson list + multi-stop tour card */
.vl-starthere-card { width: min(24rem, calc(100vw - 2rem)); }
.vl-starthere-step { align-items: flex-start; }
.vl-starthere-step .vl-starthere-tick { margin-top: .1rem; }
.vl-starthere-step.static { cursor: default; }
.vl-starthere-min { font-size: .68rem; color: #94a3b8; font-weight: 400; margin-left: .25rem; }
.vl-starthere-desc { font-size: .72rem; color: #94a3b8; line-height: 1.35; }
.vl-starthere-step.done .vl-starthere-desc { color: #cbd5e1; }
.vl-starthere-replay { color: #94a3b8; font-size: .95rem; line-height: 1; margin-top: .15rem; }
.vl-starthere-step:hover .vl-starthere-replay { color: #0f766e; }
.vl-starthere-go { font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; margin-top: .1rem; }

.vl-spot-card { width: min(24rem, calc(100vw - 2rem)); padding: .9rem 1rem 1rem; }
.vl-tour-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; padding-bottom: .5rem; border-bottom: 1px solid #eef2f6; }
.vl-tour-lesson { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #0f766e; flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-tour-count { font-size: .7rem; color: #94a3b8; white-space: nowrap; }
.vl-tour-close { font-size: .6rem; }
.vl-tour-tip { display: flex; gap: .5rem; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: .45rem .6rem; font-size: .74rem; color: #92400e; margin-bottom: .6rem; }
.vl-tour-tip .bi { color: #f59e0b; margin-top: .1rem; }
.vl-tour-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .35rem; }
.vl-tour-dots { display: inline-flex; gap: .3rem; }
.vl-tour-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2e8f0; }
.vl-tour-dot.past { background: #99f6e4; }
.vl-tour-dot.on { background: #0f766e; }
.vl-tour-complete { text-align: center; font-size: 2rem; color: #10b981; margin: .3rem 0 .2rem; }

/* Multi-level fee table: family header rows + indented subcategory rows */
.vl-fee-family > td { background: #f8fafc; }
.vl-fee-subrow > td:first-child { border-left: 3px solid #d1e7e4; }
