.app-shell:has(.inventory-overview) .page-heading p { font-size: 13px; line-height: 1.4; }

.inventory-overview { min-width: 0; display: grid; gap: 16px; }
.inventory-card, .inventory-kpi { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.inventory-card { overflow: hidden; }

.inventory-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.inventory-kpi { min-height: 104px; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 13px; padding: 15px 17px; }
.inventory-kpi-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #e7f1fe; color: #1479e8; }
.inventory-kpi-icon svg { width: 24px; height: 24px; stroke-width: 2; }
.inventory-kpi > div { min-width: 0; }
.inventory-kpi > div > span, .inventory-kpi small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-kpi > div > span { color: #40536c; font-size: 12px; font-weight: 700; line-height: 1.25; }
.inventory-kpi p { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 4px; }
.inventory-kpi strong { color: #172a45; font-size: 27px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.inventory-kpi em { color: #64748b; font-size: 10px; font-style: normal; white-space: nowrap; }
.inventory-kpi small { color: #64748b; font-size: 10.5px; line-height: 1.25; }
.inventory-kpi small b { color: #1dbb64; font-weight: 800; }
.inventory-tone-green .inventory-kpi-icon { background: #e8f8ee; color: #24bd62; }
.inventory-tone-amber .inventory-kpi-icon { background: #fff3df; color: #f59e0b; }
.inventory-tone-red .inventory-kpi-icon { background: #fdebec; color: #ed4451; }
.inventory-tone-purple .inventory-kpi-icon { background: #f2eaff; color: #7c4fd1; }
.inventory-kpi:nth-child(6) .inventory-kpi-icon svg { transform: rotate(90deg); }
.inventory-tone-amber small { color: #dd7b00; }
.inventory-tone-red small { color: #e23c47; }

.inventory-body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 16px; align-items: stretch; }
.inventory-primary { min-width: 0; display: grid; align-content: start; gap: 16px; }
.inventory-analytics { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 16px; }
.inventory-table-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.inventory-side-column { min-width: 0; display: grid; align-content: start; gap: 16px; }

.inventory-chart-card { width: 100%; max-width: none; }
.inventory-chart-header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px 7px; }
.inventory-chart-header h2, .inventory-card-heading h2 { margin: 0; color: #172a43; font-size: 14px; font-weight: 800; line-height: 1.3; }
.inventory-chart-filter select { min-width: 104px; height: 34px; padding: 0 28px 0 11px; border: 1px solid #d5e0eb; background-color: #fff; color: #263a53; font-size: 11px; font-weight: 700; }
.inventory-chart-legend { min-height: 30px; display: flex; align-items: center; gap: 25px; padding: 0 18px 3px 72px; color: #53657b; font-size: 10.5px; line-height: 1.3; }
.inventory-chart-legend > span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.legend-line { position: relative; width: 27px; height: 10px; display: inline-block; flex: 0 0 27px; color: #1479e8; }
.legend-line::before { position: absolute; top: 4px; right: 0; left: 0; border-top: 2px solid currentColor; content: ''; }
.legend-line--total em { position: absolute; z-index: 1; top: 1px; left: 10px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 1px currentColor; }
.legend-line--minimum { color: #f59e0b; }
.legend-line--low { color: #ef4444; }
.legend-line--minimum::before, .legend-line--low::before { border-top-style: dashed; }
.inventory-chart-stage { position: relative; min-width: 0; padding: 0 12px 9px 7px; }
.inventory-stock-chart { width: 100%; height: auto; display: block; overflow: visible; }
.inventory-chart-area { fill: rgba(20, 121, 232, .14); stroke: none; }
.inventory-grid-row line { stroke: #dfe7ef; stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.inventory-grid-row text, .inventory-axis-date { fill: #64748b; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 11px; font-weight: 500; }
.inventory-threshold, .inventory-total-line, .inventory-hover-guide { fill: none; vector-effect: non-scaling-stroke; }
.inventory-threshold { stroke-width: 1.5; stroke-dasharray: 6 5; }
.inventory-threshold--minimum { stroke: #f59e0b; }
.inventory-threshold--low { stroke: #ef4444; }
.inventory-total-line { stroke: #1479e8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inventory-chart-point { fill: #1479e8; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; transition: r .12s ease, stroke-width .12s ease; }
.inventory-chart-point:hover, .inventory-chart-point:focus, .inventory-chart-point.is-active { r: 7px; stroke-width: 3; outline: none; }
.inventory-hover-guide { stroke: #9aabba; stroke-width: 1; stroke-dasharray: 3 3; }
.inventory-hover-guide[hidden] { display: none; }
.inventory-chart-tooltip { position: absolute; z-index: 3; width: 146px; padding: 10px 12px; border: 1px solid #e1e8f0; border-radius: 7px; background: #fff; box-shadow: 0 8px 22px rgba(24, 45, 73, .16); pointer-events: none; }
.inventory-chart-tooltip[hidden] { display: none; }
.inventory-chart-tooltip b, .inventory-chart-tooltip span { display: block; }
.inventory-chart-tooltip b { color: #26384f; font-size: 11px; font-weight: 700; line-height: 1.3; }
.inventory-chart-tooltip span { margin-top: 4px; color: #1479e8; font-size: 11px; line-height: 1.35; }
.inventory-chart-tooltip strong { color: #1a2c44; font-variant-numeric: tabular-nums; }

.inventory-card-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--line-soft); }
.inventory-card-heading > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.inventory-card-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-count { min-width: 25px; height: 22px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: #e8f3ff; color: #1479e8; font-size: 10px; font-weight: 800; }
.inventory-count.is-danger { background: #fdebec; color: #ef4451; }
.inventory-count.is-success { background: #e7f8ee; color: #1cac59; }
.inventory-link { flex: 0 0 auto; padding: 2px 0; border: 0; background: transparent; color: #0878e8; font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.inventory-link:hover { color: #075fae; text-decoration: underline; }

.stock-status-card { min-height: 100%; }
.stock-status-card .inventory-card-heading { border-bottom: 0; }
.stock-status-content { display: grid; grid-template-columns: 142px minmax(0, 1fr); align-items: center; gap: 12px; padding: 24px 14px 25px; }
.stock-donut { position: relative; width: 142px; height: 142px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#42c875 0 72.3%, #f5a623 72.3% 79.3%, #ef4451 79.3% 80.5%, #247be1 80.5% 100%); }
.stock-donut::before { position: absolute; width: 88px; height: 88px; border-radius: 50%; background: #fff; content: ''; }
.stock-donut > div { position: relative; z-index: 1; text-align: center; }
.stock-donut strong, .stock-donut span { display: block; }
.stock-donut strong { color: #1b2c45; font-size: 25px; font-weight: 800; line-height: 1; }
.stock-donut span { margin-top: 5px; color: #64748b; font-size: 11px; }
.stock-status-legend { min-width: 0; display: grid; gap: 12px; }
.stock-status-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: start; gap: 8px; }
.stock-status-legend i { width: 8px; height: 8px; margin-top: 3px; background: #247be1; }
.stock-status-legend i.is-enough { background: #42c875; }.stock-status-legend i.is-low { background: #f5a623; }.stock-status-legend i.is-empty { background: #ef4451; }
.stock-status-legend span, .stock-status-legend small { display: block; }
.stock-status-legend span { color: #31445e; font-size: 10.5px; line-height: 1.25; }
.stock-status-legend small { margin-top: 2px; color: #52647b; font-size: 9.5px; font-variant-numeric: tabular-nums; }

.inventory-list-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.inventory-table-wrap { min-width: 0; overflow-x: auto; }
.inventory-compact-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.inventory-compact-table th, .inventory-compact-table td { height: 36px; padding: 6px 9px; border-bottom: 1px solid var(--line-soft); overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.inventory-compact-table th { height: 34px; background: #fafbfd; color: #63748a; font-size: 9.5px; font-weight: 650; }
.inventory-compact-table td { color: #40536b; font-size: 10px; }
.inventory-compact-table td:first-child { color: #31577c; font-variant-numeric: tabular-nums; }
.inventory-compact-table th:last-child, .inventory-compact-table td:last-child { text-align: right; }
.low-stock-table th:nth-child(1) { width: 20%; }.low-stock-table th:nth-child(2) { width: 38%; }.low-stock-table th:nth-child(3) { width: 17%; }.low-stock-table th:nth-child(4) { width: 25%; }
.movement-table th:nth-child(1) { width: 24%; }.movement-table th:nth-child(2) { width: 20%; }.movement-table th:nth-child(3) { width: 40%; }.movement-table th:nth-child(4) { width: 16%; }
.stock-minimum { display: grid; grid-template-columns: minmax(24px, 1fr) 22px; align-items: center; gap: 7px; }
.stock-minimum > span { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.stock-minimum i { height: 100%; display: block; border-radius: inherit; background: #f5a623; }
.stock-minimum b { color: #64748b; font-size: 9.5px; font-weight: 650; text-align: right; }
.inventory-card-footer { min-height: 36px; margin: 8px 11px 10px; border: 1px solid #d7e1eb; border-radius: 6px; background: #fff; color: #0878e8; font-size: 10.5px; font-weight: 650; }
.inventory-card-footer:hover { border-color: #aac9e6; background: #f6faff; }

.inventory-side-card .inventory-card-heading { min-height: 46px; border-bottom: 0; }
.inventory-alert-list article, .purchase-list article, .warehouse-document-list article { min-width: 0; display: grid; align-items: center; border-bottom: 1px solid var(--line-soft); }
.inventory-alert-list article:last-child, .purchase-list article:last-child, .warehouse-document-list article:last-child { border-bottom: 0; }
.inventory-alert-list article { min-height: 58px; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
.side-item-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #eef3f8; color: #58728f; }
.side-item-icon svg { width: 16px; height: 16px; }
.side-item-icon.is-danger { background: #fdebec; color: #ef4451; }.side-item-icon.is-warning { background: #fff3df; color: #f59e0b; }.side-item-icon.is-info { background: #e8f3ff; color: #1479e8; }
.inventory-alert-list div, .purchase-list div, .warehouse-document-list div { min-width: 0; }
.inventory-alert-list b, .inventory-alert-list small, .purchase-list b, .purchase-list small, .warehouse-document-list b, .warehouse-document-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-alert-list b, .purchase-list b, .warehouse-document-list b { color: #28415e; font-size: 10.5px; font-weight: 700; line-height: 1.3; }
.inventory-alert-list small, .purchase-list small, .warehouse-document-list small { margin-top: 3px; color: #718196; font-size: 9.5px; line-height: 1.25; }
.inventory-alert-list article:nth-child(1) b { color: #ed4451; }.inventory-alert-list article:nth-child(2) b { color: #db8205; }.inventory-alert-list article:nth-child(3) b { color: #1479e8; }
.inventory-alert-list time { align-self: start; padding-top: 3px; color: #718196; font-size: 8.5px; white-space: nowrap; }
.purchase-list article { min-height: 56px; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
.purchase-state { padding: 4px 6px; border-radius: 4px; background: #e8f3ff; color: #1479e8; font-size: 8.5px; white-space: nowrap; }
.warehouse-document-list article { min-height: 54px; grid-template-columns: 28px minmax(0, 1fr) 24px; gap: 8px; padding: 7px 12px; }
.document-file-icon { width: 27px; height: 27px; display: grid; place-items: center; color: #f02f5a; }
.document-file-icon svg { width: 21px; height: 21px; }
.warehouse-document-list b { color: #0878e8; }
.warehouse-document-list button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #1479e8; }
.warehouse-document-list button svg { width: 16px; height: 16px; transform: rotate(-90deg); }

.inventory-footer { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #8391a3; font-size: 10px; }

@media (max-width: 1500px) {
  .inventory-kpis { gap: 12px; }
  .inventory-kpi { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding-right: 12px; padding-left: 12px; }
  .inventory-kpi-icon { width: 42px; height: 42px; }
  .inventory-kpi strong { font-size: 24px; }
  .inventory-body { grid-template-columns: minmax(0, 1fr) 276px; gap: 12px; }
  .inventory-analytics, .inventory-table-grid, .inventory-side-column { gap: 12px; }
  .inventory-analytics { grid-template-columns: minmax(0, 1fr) 252px; }
  .stock-status-content { grid-template-columns: 126px minmax(0, 1fr); padding-right: 10px; padding-left: 10px; }
  .stock-donut { width: 126px; height: 126px; }
  .stock-donut::before { width: 78px; height: 78px; }
}

/* Warehouse final readability pass. */
.app-shell:has(.inventory-overview) .page-heading p{font-size:14px}.inventory-kpi>div>span{font-size:13px}.inventory-kpi strong{font-size:29px}.inventory-kpi em,.inventory-kpi small{font-size:11.5px}.inventory-chart-header h2,.inventory-card-heading h2{font-size:15.5px}.inventory-chart-filter select,.inventory-chart-legend{font-size:12px}.inventory-grid-row text,.inventory-axis-date{font-size:12px}.inventory-count,.inventory-link{font-size:11.5px}.stock-donut span,.stock-status-legend span,.stock-status-legend small{font-size:11.5px}.inventory-compact-table th{font-size:11.5px}.inventory-compact-table td{font-size:12px}.inventory-card-footer{font-size:12px}.inventory-alert-list b,.purchase-list b,.warehouse-document-list b{font-size:12px}.inventory-alert-list small,.purchase-list small,.warehouse-document-list small,.inventory-alert-list time,.purchase-state{font-size:11px}.inventory-footer{font-size:11.5px}

@media (max-width: 1260px) {
  .inventory-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-body { grid-template-columns: 1fr; }
  .inventory-side-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .inventory-analytics { grid-template-columns: 1fr; }
  .inventory-table-grid { grid-template-columns: 1fr; }
  .inventory-side-column { grid-template-columns: 1fr; }
  .stock-status-content { grid-template-columns: 142px minmax(0, 1fr); justify-content: start; }
  .stock-donut { width: 142px; height: 142px; }
  .stock-donut::before { width: 88px; height: 88px; }
}

@media (max-width: 620px) {
  .inventory-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .inventory-kpi { min-height: 98px; padding: 12px; }
  .inventory-kpi > div > span { font-size: 11px; }
  .inventory-kpi strong { font-size: 21px; }
  .inventory-chart-header { min-height: 50px; padding-right: 10px; padding-left: 10px; }
  .inventory-chart-legend { align-items: flex-start; flex-direction: column; gap: 6px; padding: 0 10px 9px; }
  .inventory-chart-stage { overflow-x: auto; padding-right: 8px; }
  .inventory-stock-chart { width: 800px; }
  .stock-status-content { grid-template-columns: 126px minmax(0, 1fr); }
  .stock-donut { width: 126px; height: 126px; }
  .stock-donut::before { width: 78px; height: 78px; }
  .inventory-footer { align-items: flex-start; flex-direction: column; gap: 3px; }
}
