/* Shared repairs: keep wide reports scrollable inside their workspace. */
.main,.main-workspace,.content,.content-area,.app-main,.workspace,.returns-shell>* {min-width:0;box-sizing:border-box}
.table-wrap,.table-responsive,.table-container,.data-table-wrap,.report-table-wrap {min-width:0;max-width:100%;overflow-x:auto}
.suite-nav-tabs {min-width:0;max-width:100%;overflow-x:auto}
html[data-theme="light"] body[data-active="amazon_warehouse_stock"] {
  --navy-bg:#f8fafc;--navy-card:#fff;--navy-card-border:#cbd5e1;--text-main:#0f172a;--text-muted:#475569;--primary:#c2410c;--primary-hover:#9a3412;
}
html[data-theme="light"] body[data-active="postgresql_backup"],
html[data-theme="light"] body[data-active="product_reviews"] {background:var(--bg-base)!important;color:var(--text-main)!important}
html[data-theme="light"] body[data-active="postgresql_backup"] .main {background:var(--bg-base)!important}
html[data-theme="light"] body[data-active="postgresql_backup"] .card {background:var(--bg-card)!important;border-color:var(--border-subtle)!important}
html[data-theme="light"] body[data-active="postgresql_backup"] .card h2 {color:var(--text-main)!important}
html[data-theme="light"] body[data-active="product_reviews"] {--bg-glass-card:#fff;--bg-glass-elevated:#f1f5f9;--border-glass:#cbd5e1}
html[data-theme="light"] body[data-active="amazon_warehouse_stock"] .hero-banner {background:#fff;box-shadow:0 4px 18px rgba(15,23,42,.08)}
html[data-theme="light"] body[data-active="amazon_warehouse_stock"] .hero-title h1,
html[data-theme="light"] body[data-active="amazon_warehouse_stock"] #insightsTitle {color:#0f172a}
html[data-theme="light"] body[data-active="amazon_warehouse_stock"] .hero-title p {color:#475569}
html[data-theme="light"] body[data-active="product_reviews"] .hero-title-group h1,
html[data-theme="light"] body[data-active="product_reviews"] .product-title,
html[data-theme="light"] body[data-active="product_reviews"] .reviews-val,
html[data-theme="light"] body[data-active="product_reviews"] .kpi-val {color:#0f172a}
html[data-theme="light"] body[data-active="product_reviews"] .hero-subtitle,
html[data-theme="light"] body[data-active="product_reviews"] .product-submeta,
html[data-theme="light"] body[data-active="product_reviews"] .kpi-title,
html[data-theme="light"] body[data-active="product_reviews"] .kpi-sub {color:#475569}
html[data-theme="light"] body[data-active="product_reviews"] .btn-action:not(.btn-accent) {color:#0f172a}
html[data-theme="light"] body[data-active="product_reviews"] .search-box input,
html[data-theme="light"] body[data-active="product_reviews"] .select-ctrl {background:#f1f5f9!important;color:#0f172a!important;border-color:#cbd5e1!important}
html[data-theme="light"] body[data-active="product_reviews"] .asin-tag,
html[data-theme="light"] body[data-active="product_reviews"] .star-score-badge.rating-good {color:#0369a1}
html[data-theme="light"] body[data-active="product_reviews"] .star-score-badge.rating-high,
html[data-theme="light"] body[data-active="product_reviews"] .latest-rev-date-pill {color:#047857}
html[data-theme="light"] body[data-active="product_reviews"] .star-score-badge.rating-fair {color:#92400e}
html[data-theme="light"] body[data-active="postgresql_backup"] .card label {color:#475569!important}
html[data-theme="light"] body[data-active="postgresql_backup"] .card input,
html[data-theme="light"] body[data-active="postgresql_backup"] .card select {background:#f1f5f9!important;color:#0f172a!important;border-color:#cbd5e1!important}
@media(max-width:700px) {
  .main-workspace {padding:16px!important;max-width:100%}
  .content,.content-area {padding:16px!important}
  .topbar,.topbar-right,.topbar-actions,.table-toolbar,.toolbar,.filter-bar,.actions {flex-wrap:wrap;min-width:0}
  .page-head,.card,.panel,.section,.split>* {min-width:0;max-width:100%;box-sizing:border-box}
  .search-box-wrap {min-width:0!important;width:100%}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea {max-width:100%;box-sizing:border-box}
  .form-row-grid,.push-progress-steps {grid-template-columns:minmax(0,1fr)!important}
  body[data-active="blinkit_invoice"] .panel-header,
  body[data-active="blinkit_invoice"] .panel-header>div,
  body[data-active="blinkit_invoice"] .action-dock,
  body[data-active="blinkit_invoice"] .action-dock>div {flex-wrap:wrap;min-width:0}
  body[data-active="financial_documents"] .tab-group {flex-wrap:wrap;max-width:100%}
  body[data-active="compliance_calendar"] .cc-layout {grid-template-columns:minmax(0,1fr)}
  body[data-active="compliance_calendar"] .cc-layout>* {min-width:0}
  body[data-active="compliance_calendar"] .cal-grid {grid-template-columns:repeat(7,minmax(0,1fr))}
  body[data-active="compliance_calendar"] .cal-nav {flex-wrap:wrap;gap:8px}
  body[data-active="sheet_estimator"] .layout {grid-template-columns:minmax(0,1fr)}
  body[data-active="sheet_estimator"] .layout>* {min-width:0}
  body[data-active="sheet_estimator"] .batch-inputs {min-width:0;max-width:100%}
  body[data-active="barcode_studio"] .studio-grid {grid-template-columns:minmax(0,1fr)}
  body[data-active="barcode_studio"] .studio-grid>* {min-width:0}
  body[data-active="barcode_studio"] .mode-switch-wrapper,
  body[data-active="barcode_studio"] .catalog-filter-bar {flex-wrap:wrap;max-width:100%}
  body[data-active="barcode_studio"] .catalog-inputs-grid {grid-template-columns:minmax(0,1fr)}
}

h1.topbar-title {margin:0;font-size:18px}
body[data-active="postgresql_backup"] .table-pill-item {min-width:0}
body[data-active="postgresql_backup"] .table-pill-item span:not(.num) {min-width:0;overflow-wrap:anywhere}
/* Later page-local declarations were overriding the Stock & Sales breakpoints. */
body[data-active="stock_and_sales"] .metric-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
body[data-active="stock_and_sales"] .metric,
body[data-active="stock_and_sales"] .metric-card {min-width:0}
body[data-active="stock_and_sales"] .metric .value,
body[data-active="stock_and_sales"] .metric-card .value {overflow-wrap:anywhere}
html[data-theme="dark"] body[data-active="stock_and_sales"] .content {background:var(--bg-base)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.page-head,.section-block,.card,.metric,.metric-card,.tabs,.bom-page,.ledger-body,.expense-booking-card,.expense-total-card) {background:var(--bg-card);border-color:var(--border-strong)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.subtabs,.table-wrap,.custom-multiselect-btn,.custom-multiselect-dropdown,.custom-multiselect-search,.ledger-payment-history,.expense-preview-panel) {background:var(--bg-surface);border-color:var(--border-strong)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(h1,h2,h3,.label,.value,.pnl-overview-heading,.lede,.bom-lede,.custom-multiselect-item,.custom-multiselect-action-btn) {color:var(--text-main)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.tabs,.subtabs) button:not(.active) {color:var(--text-main)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(input,select,textarea,option,optgroup) {color:var(--text-main)!important;background-color:var(--bg-surface)!important;border-color:var(--border-strong)!important;color-scheme:dark}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(th,td) {color:var(--text-main);border-color:var(--border-strong)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(table,tbody tr) {background:var(--bg-card)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(thead,thead tr,th,tbody tr:nth-child(even)) {background:var(--bg-surface-elevated)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.custom-multiselect-item,.custom-multiselect-action-btn):hover {background:var(--bg-surface-elevated)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(h1,h2,h3,label,.pnl-overview-heading,.custom-multiselect-btn,.custom-multiselect-item) {color:var(--text-main)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] .btn:not(.primary):not(.danger) {color:var(--text-main)!important;background:var(--bg-surface-elevated)!important;border-color:var(--border-strong)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] .pnl-metric-card {background:var(--bg-card);border-color:var(--border-strong)}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.pnl-label,.pnl-value) {color:var(--text-main)}
html[data-theme="dark"] body[data-active="stock_and_sales"] td {color:var(--text-main)!important;background:var(--bg-card)!important;border-color:var(--border-strong)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] th,
html[data-theme="dark"] body[data-active="stock_and_sales"] tbody tr:nth-child(even) td {color:var(--text-main)!important;background:var(--bg-surface-elevated)!important;border-color:var(--border-strong)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.filter-label,.custom-multiselect-label) {color:var(--text-muted)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] :is(.custom-multiselect-popover,.custom-multiselect-action-btn) {background:var(--bg-surface)!important;color:var(--text-main)!important;border-color:var(--border-strong)!important}
html[data-theme="dark"] body[data-active="stock_and_sales"] .custom-multiselect-item:hover {background:var(--bg-surface-elevated)!important}
@media(min-width:901px) {
  body[data-active="production_list"] .toolbar-row {grid-template-columns:minmax(180px,.6fr) minmax(0,2fr)}
  body[data-active="production_list"] .table-tools {min-width:0;grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
  body[data-active="production_list"] .table-tools input,
  body[data-active="production_list"] .table-tools select {min-width:0;max-width:100%}
}

/* 2026-11-03: constrain calculator filters without shrinking report tables. */
body[data-active="profit_calculator"] .unified-filter-cockpit,
body[data-active="profit_calculator"] .cockpit-left,
body[data-active="profit_calculator"] .cockpit-right,
body[data-active="profit_calculator"] .cockpit-field,
body[data-active="profit_calculator"] .cockpit-search {min-width:0;max-width:100%;box-sizing:border-box}
@media(max-width:700px) {
  body[data-active="profit_calculator"] .cockpit-left,
  body[data-active="profit_calculator"] .cockpit-right {width:100%}
  body[data-active="profit_calculator"] .cockpit-field {width:100%;flex-wrap:wrap;gap:8px}
  body[data-active="profit_calculator"] .cockpit-label {flex:0 0 100%}
  body[data-active="profit_calculator"] .cockpit-select {width:100%;min-width:0}
  body[data-active="profit_calculator"] #customDateField>div {max-width:100%;min-width:0;flex-wrap:wrap}
  body[data-active="profit_calculator"] .cockpit-search {width:100%;flex-basis:100%}
  body[data-active="profit_calculator"] .cockpit-right {flex-wrap:wrap}
}
/* Inline report styles were dark-theme colours even on white cells. */
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-base,
html[data-theme="light"] body[data-active="profit_calculator"] .td-fee-base {color:#475569!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-net {color:#0f172a!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-gst,
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-payable {color:#92400e!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-itc {color:#047857!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-tcs {color:#0369a1!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-tds {color:#4338ca!important}
html[data-theme="light"] body[data-active="profit_calculator"] .td-tax-credit,
html[data-theme="light"] body[data-active="profit_calculator"] .td-true-profit {color:#7e22ce!important}
html[data-theme="light"] body[data-active="profit_calculator"] .th-tax {color:#6d28d9!important}
html[data-theme="light"] body[data-active="profit_calculator"] .cockpit-label {color:#475569!important}
html[data-theme="light"] body[data-active="profit_calculator"] .cockpit-item-count,
html[data-theme="light"] body[data-active="profit_calculator"] .bom-link-pill {color:#0369a1!important}

/* Original calculator presentation recovered from the pre-reconciliation page.
   Bind those existing styles to the current renderer; never restore its old arithmetic. */
body[data-active="profit_calculator"] .report-kpis .kpi-value {font-size:20px}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="gross"]) {border-left:4px solid #38bdf8}
body[data-active="profit_calculator"] [data-metric="gross"] {color:#38bdf8}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="expenses"]) {border-left:4px solid #f43f5e;background:rgba(244,63,94,.04)}
body[data-active="profit_calculator"] [data-metric="expenses"] {color:#f43f5e}
body[data-active="profit_calculator"] .kpi-card:has([data-metric="expenses"]) .kpi-label {color:#fb7185;font-weight:700}
body[data-active="profit_calculator"] .kpi-card:has([data-metric="expenses"]) .kpi-sub {color:#fda4af}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="cash"]) {border-left:4px solid #0ea5e9}
body[data-active="profit_calculator"] [data-metric="cash"] {color:#0ea5e9}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="cogs"]) {border-left:4px solid #a855f7}
body[data-active="profit_calculator"] [data-metric="cogs"] {color:var(--accent-amber)}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="profit"]) {border-left:4px solid #10b981}
body[data-active="profit_calculator"] [data-metric="profit"] {color:var(--accent-green)}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="profit"][data-value^="-"]) {border-left-color:#ef4444}
body[data-active="profit_calculator"] [data-metric="profit"][data-value^="-"] {color:var(--accent-red)}
body[data-active="profit_calculator"] .report-kpis .kpi-card:has([data-metric="units"]) {border-left:4px solid #818cf8}
body[data-active="profit_calculator"] [data-metric="units"] {color:#818cf8}
body[data-active="profit_calculator"] .report-note {border-left:4px solid #f59e0b;background:rgba(245,158,11,.05)}
body[data-active="profit_calculator"] .report-note p:nth-of-type(2) {display:flex;flex-wrap:wrap;gap:6px;font-size:0}
body[data-active="profit_calculator"] .report-note p:nth-of-type(2)>span {font-size:11px;line-height:1.5;padding:5px 8px;border:1px solid var(--card-border);border-radius:6px;background:var(--bg-surface);color:var(--text-main)}
