:root {
  color-scheme: dark;
  --canvas: #101a20;
  --sidebar: #111e25;
  --panel: #17252c;
  --panel-raised: #1b2c34;
  --line: #293a42;
  --muted: #82939a;
  --text: #eaf0ed;
  --green: #a5d9a5;
  --green-bright: #c2e6a8;
  --orange: #f1b870;
  --red: #ea8575;
  --mono: 'DM Mono', Consolas, monospace;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; flex-direction: column; width: 238px; padding: 27px 16px 17px; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #75977f; color: var(--green-bright); font: 800 18px Manrope, sans-serif; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong, .brand small { display: block; letter-spacing: .11em; }
.brand strong { font: 800 12px 'Segoe UI', Arial, sans-serif; }
.brand small { margin-top: 3px; color: var(--muted); font: 500 9px var(--mono); }
.workspace-label { margin: 49px 10px 13px; color: #677980; font: 500 9px var(--mono); letter-spacing: .14em; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #98a7aa; text-align: left; cursor: pointer; font-size: 12px; transition: .18s ease; }
.nav-item.auth-only-nav { display: none; text-decoration: none; }
.nav-item.auth-only-nav.is-visible { display: flex; }
.auth-signout[hidden] { display: none; }
.nav-item:hover { background: #1a2a31; color: var(--text); }
.nav-item.is-active { border-color: #2b4146; background: #1b2d33; color: var(--green-bright); }
.nav-icon { display: inline-grid; width: 16px; place-items: center; color: #829c90; font-size: 16px; }
.nav-group:not([hidden]) { display: grid; gap: 4px; }
.nav-toggle.has-active-child { color: var(--green-bright); }
.nav-caret { margin-left: auto; color: #829c90; font-size: 11px; transition: transform .15s ease; }
.nav-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-subitems { display: grid; gap: 2px; margin-left: 20px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-subitems[hidden] { display: none; }
.nav-subitem { padding: 8px 12px; font-size: 11px; }
.nav-pulse { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px #f1b87055; }
.sidebar-bottom { margin-top: auto; }
.demo-note { display: flex; gap: 9px; align-items: flex-start; margin: 0 3px 14px; padding: 12px 10px; border: 1px solid #3b342a; border-radius: 5px; background: #211f1a; }
.demo-dot { width: 7px; height: 7px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }
.demo-note strong, .demo-note small { display: block; }
.demo-note strong { color: #dbd0be; font-size: 10px; font-weight: 600; }
.demo-note small { margin-top: 4px; color: #9d9080; font-size: 9px; }
.reset-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; background: transparent; color: #819096; text-align: left; cursor: pointer; font-size: 11px; }
.reset-button:hover { color: var(--green); }
.sidebar-foot { margin: 19px 8px 0; color: #617178; font: 9px var(--mono); letter-spacing: .04em; }
.sidebar-foot span { padding: 0 4px; color: #415259; }
.main-area { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; height: 63px; align-items: center; justify-content: space-between; padding: 0 35px; border-bottom: 1px solid var(--line); background: #111d23f2; backdrop-filter: blur(12px); }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: #829198; font-size: 11px; }
.breadcrumb strong { color: #d9e2de; font-weight: 500; }
.crumb-separator { color: #52646a; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.mode-chip { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid #55432c; border-radius: 3px; color: #d9b985; font: 9px var(--mono); letter-spacing: .05em; }
.mode-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.database-status { padding: 6px 8px; border: 1px solid #334637; border-radius: 3px; color: var(--green); font: 9px var(--mono); white-space: nowrap; }
.database-status.is-error { border-color: #583a35; color: var(--red); }
.database-status.is-loading { border-color: #55432c; color: var(--orange); }
.role-control { display: flex; align-items: center; gap: 9px; color: #75868c; font: 9px var(--mono); }
.role-control select { max-width: 183px; border: 0; background: transparent; color: #d7e0dc; font: 11px 'DM Sans', sans-serif; cursor: pointer; }
.role-control option { background: var(--panel); }
.avatar { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #3c5355; border-radius: 50%; background: #26393b; color: #bad3bc; font: 10px var(--mono); }
.feed-banner { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 35px; border-bottom: 1px solid #41382b; background: #241f18; color: #d6bb90; font-size: 10px; }
.feed-banner.is-fresh { border-bottom-color: #334637; background: #19241d; color: #b0d0a8; }
.feed-banner strong { font-weight: 600; }
.feed-meta { color: #a58e6d; font: 9px var(--mono); }
.feed-refresh { padding: 5px 9px; border: 1px solid #645034; border-radius: 3px; background: transparent; color: #ddc18f; font-size: 10px; cursor: pointer; }
.feed-refresh:hover { background: #342a1c; }
.feed-banner.is-fresh .feed-refresh { border-color: #405642; color: #c2d9b6; }
.content { max-width: 1440px; margin: 0 auto; padding: 30px 35px 22px; }
.footer-note { padding: 12px 35px 22px; color: #677980; text-align: center; font-size: 9px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow { color: #8eaa95; font: 9px var(--mono); letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 7px 0 5px; color: #f0f3ee; font: 600 clamp(24px, 3vw, 31px) Manrope, sans-serif; letter-spacing: -.04em; }
.subtitle { margin: 0; color: #8e9ca0; font-size: 11px; }
.page-timestamp { margin-top: 9px; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px; font-size: 10px; font-weight: 600; cursor: pointer; transition: .16s ease; }
.button.primary { border-color: #b6d4a4; background: var(--green-bright); color: #16221b; }
.button.primary:hover { background: #d0edb4; }
.button.secondary { border-color: #3a4d53; background: #1c2a30; color: #c4d0cc; }
.button.secondary:hover { border-color: #59716d; background: #22343a; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button .plus { font-size: 15px; font-weight: 400; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.metric-card { min-height: 115px; padding: 15px 16px; }
.metric-top { display: flex; justify-content: space-between; color: #92a1a3; font-size: 10px; }
.metric-icon { color: #728b7e; font-size: 13px; }
.metric-value { margin: 15px 0 5px; color: #edf0e9; font: 600 24px 'Segoe UI', Arial, sans-serif; letter-spacing: -.04em; }
.metric-foot { color: #809097; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.positive { color: var(--green); }
.warning-text { color: var(--orange); }
.admin-overview-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, .85fr); gap: 14px; }
.panel { overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; color: #e1e9e4; font: 600 12px 'Segoe UI', Arial, sans-serif; }
.panel-subtitle { margin: 4px 0 0; color: #839299; font-size: 9px; }
.text-link { border: 0; background: none; color: #b1d2a6; font-size: 10px; cursor: pointer; }
.text-link:hover { color: #d4efbe; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 14px; color: #72838a; font: 9px var(--mono); font-weight: 400; letter-spacing: .04em; white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid #26373e; color: #b9c5c1; font-size: 10px; white-space: nowrap; }
td strong { color: #e4ebe5; font-size: 10px; font-weight: 500; }
.depot-group th { padding: 11px 14px; border-top: 1px solid #34464b; background: #1d2c32; color: #c7d8cb; font: 600 10px 'Segoe UI', Arial, sans-serif; letter-spacing: .04em; }
.depot-subtotal td { border-top: 1px solid #43554d; background: #192721; color: #c9d8ca; font-weight: 600; }
.depot-subtotal td:first-child { text-align: right; }
.depot-grand-total td { border-top: 2px solid #6a8270; background: #22342a; color: #e0ecd9; font-weight: 700; }
.depot-grand-total td:first-child { text-align: right; }
.stock-updated { display: block; margin-top: 5px; color: #788b8f; font: 8px/1.45 var(--mono); white-space: normal; }
.mono { font-family: var(--mono); }
.price { color: #dfe9db; font: 500 12px var(--mono); }
.stock-cell { min-width: 113px; }
.stock-bar { display: flex; height: 3px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: #314149; }
.stock-bar span { border-radius: 3px; background: #8cc19b; }
.stock-bar.low span { background: #d9a465; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 3px; background: #24362b; color: #b1d4af; font: 9px var(--mono); }
.status-pill::before { width: 4px; height: 4px; border-radius: 50%; background: currentColor; content: ''; }
.status-pill.stale { background: #382d21; color: #d9b575; }
.status-pill.neutral { background: #243138; color: #9aabb0; }
.feed-list { padding: 2px 15px 7px; }
.feed-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 1px; border-bottom: 1px solid #293940; }
.feed-row:last-child { border-bottom: 0; }
.feed-name { color: #dae2dc; font-size: 10px; font-weight: 600; }
.feed-source { margin-top: 4px; color: #819096; font-size: 9px; }
.feed-value { color: #e7eee7; font: 11px var(--mono); text-align: right; }
.feed-updated { max-width: 220px; margin-top: 4px; color: #849398; font: 8px/1.45 var(--mono); text-align: right; overflow-wrap: anywhere; }
.history-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-left: auto; }
.history-range-label, .history-source-label { display: flex; align-items: center; gap: 8px; color: #85949a; font: 9px var(--mono); white-space: nowrap; }
.history-panel .panel-header { flex-wrap: wrap; }
.history-demo-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 0 0 12px; padding: 11px 14px; border: 1px solid #59462c; border-radius: 4px; background: #241f18; color: #d6bb90; font-size: 10px; line-height: 1.5; }
.history-demo-notice strong { color: #f1be75; font: 9px var(--mono); letter-spacing: .08em; }
.history-saved-notice { margin: 0 0 12px; padding: 11px 14px; border: 1px solid #3b4c50; border-radius: 4px; background: #19252a; color: #9eafb0; font-size: 10px; line-height: 1.5; }
.history-chart-wrap { overflow-x: auto; padding: 12px 12px 0; scrollbar-width: thin; }
.history-chart { display: block; width: 100%; min-width: 620px; height: auto; }
.chart-grid-line { stroke: #304148; stroke-width: 1; }
.chart-tick-line { stroke: #53636a; stroke-width: 1; }
.chart-axis-label { fill: #849398; font: 10px var(--mono); }
.chart-axis-title { fill: #aab7b2; font: 10px var(--mono); }
.history-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.history-point { stroke: #17252c; stroke-width: 1.5; }
.history-legend { display: flex; flex-wrap: wrap; gap: 9px 18px; padding: 10px 18px 16px; }
.history-legend-item { display: inline-flex; align-items: center; gap: 7px; color: #aab7b2; font: 9px var(--mono); }
.history-legend-item i { width: 13px; height: 3px; border-radius: 2px; background: var(--legend-color); }
.history-error { align-items: center; margin: 12px; }
.callout { display: flex; gap: 9px; margin-top: 12px; padding: 11px 12px; border: 1px solid #443a2d; border-radius: 4px; background: #211f1a; color: #b9aa92; font-size: 9px; line-height: 1.6; }
.callout-mark { color: var(--orange); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 25px 0 10px; }
.section-heading h2 { margin: 0; color: #dfe6e1; font: 600 13px Manrope, sans-serif; }
.section-heading span { color: #819096; font-size: 9px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.product-card { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.product-card-top { display: flex; align-items: center; gap: 10px; }
.product-symbol { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid #3a5048; border-radius: 4px; background: #1f302d; color: #b5d3ad; font: 10px var(--mono); }
.product-name { margin: 0; color: #e1e8e1; font-size: 11px; font-weight: 600; }
.product-code { margin-top: 4px; color: #849399; font: 9px var(--mono); }
.product-price { margin: 17px 0 5px; color: #eff1e9; font: 600 22px 'Segoe UI', Arial, sans-serif; letter-spacing: -.04em; }
.product-price small { color: #a0ada8; font: 10px var(--mono); }
.product-meta { display: flex; justify-content: space-between; color: #839197; font-size: 9px; }
.product-card .button { width: 100%; margin-top: 14px; }
.customer-identity { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #3c4f52; border-radius: 4px; background: rgba(18, 33, 38, 0.7); color: #dbe6e0; font-size: 10px; }
.customer-identity strong { color: #f0f7ef; }
.customer-identity span:first-child { color: #8ea4a8; text-transform: uppercase; letter-spacing: .08em; }
.customer-price-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid #35514d; border-radius: 4px; background: rgba(19, 35, 38, 0.7); color: #cfe0d3; font-size: 10px; }
.customer-price-heading strong { color: #ffffff; }
.order-volume { width: 100%; margin-top: 10px; margin-bottom: 10px; padding: 9px 10px; border: 1px solid #3b4d52; border-radius: 3px; background: #122027; color: #e2eae3; font: 11px var(--mono); }
.depot-select, .toolbar-select { padding: 7px 9px; border: 1px solid #3a4d53; border-radius: 4px; background: #17252c; color: #c9d4ce; font-size: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar-label { display: flex; align-items: center; gap: 8px; color: #85949a; font-size: 9px; }
.admin-input { width: 115px; padding: 7px 8px; border: 1px solid #3a4d53; border-radius: 3px; background: #132127; color: #e0e8df; font: 10px var(--mono); }
.admin-input.wide { width: 165px; }
.admin-input.small { width: 85px; }
.inline-button { padding: 6px 8px; border: 1px solid #3a4d53; border-radius: 3px; background: #1b2a30; color: #bdd6b1; font-size: 9px; cursor: pointer; }
.inline-button:hover { border-color: #627d69; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rule-panel { padding-bottom: 14px; }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 16px 2px; }
.rule-field label, .field-label { display: block; margin-bottom: 6px; color: #a1ada9; font-size: 9px; }
.rule-field small { display: block; margin-top: 5px; color: #74858b; font-size: 8px; }
.rule-field input, .rule-field select, .quote-dialog input, .quote-dialog select { width: 100%; padding: 9px 10px; border: 1px solid #3b4d52; border-radius: 3px; background: #122027; color: #e2eae3; font: 11px var(--mono); }
.rule-field input.margin-input.is-negative, .margin-input.is-negative { border-color: var(--red); background: #33201d; color: #f3c4b8; }
.margin-warning { margin: 12px 16px 0; padding: 9px 11px; border: 1px solid #67473e; border-radius: 4px; background: #30221e; color: #edc2b3; font-size: 10px; }
.margin-warning[hidden] { display: none; }
td.margin-negative { color: var(--red); font-weight: 600; }
.price-unavailable { color: var(--orange); font-size: 15px; }
.formula-pending { border-style: dashed; }
.build-up span small { display: block; margin-top: 2px; color: #74858b; font-size: 8px; }
.build-up .build-up-total { padding-top: 7px; border-top: 1px solid #2f433c; color: #e0edcb; font-size: 11px; font-weight: 600; }
.build-up-table { margin: 0 16px 8px; border: 1px solid #2f433c; border-radius: 4px; }
.build-up-table th, .build-up-table td { padding: 8px 10px; }
.price-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 12px 16px 12px; padding: 10px 11px; border: 1px solid #2f433c; border-radius: 4px; background: #192822; color: #a1ada9; font-size: 9px; }
.price-preview strong { color: #e0edcb; font-size: 10px; font-weight: 500; text-align: right; }
.price-preview-title { color: #c4d6bd; font: 9px var(--mono); }
.formula-preview { margin: 13px 16px 0; padding: 10px 11px; border: 1px solid #2f433c; border-radius: 4px; background: #192822; color: #c4d6bd; font: 9px/1.7 var(--mono); }
.formula-preview code { color: #e0edcb; }
.quota-note { margin: 0 16px 2px; color: #829197; font-size: 9px; line-height: 1.6; }
.empty-state { padding: 32px 20px; color: #87979b; text-align: center; font-size: 11px; }
.order-id { color: #99bd9d; font: 10px var(--mono); }
.empty-hint { color: #819095; font-size: 9px; }
.quote-dialog { width: min(420px, calc(100% - 28px)); padding: 20px; border: 1px solid #3b4c50; border-radius: 7px; background: #17252c; color: var(--text); box-shadow: 0 24px 100px #0009; }
.quote-dialog::backdrop { background: #071014bd; backdrop-filter: blur(3px); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-top h2 { margin: 6px 0 0; font: 600 20px 'Segoe UI', Arial, sans-serif; }
.icon-button { width: 28px; height: 28px; border: 1px solid #3a4d53; border-radius: 3px; background: #1d2c32; color: #b8c5bf; cursor: pointer; font-size: 17px; }
.dialog-copy { margin: 10px 0 18px; color: #8b9a9f; font-size: 10px; line-height: 1.6; }
.field-label { margin-top: 12px; }
.field-label span { color: #72838a; }
.quote-summary { min-height: 49px; margin-top: 14px; padding: 10px; border: 1px solid #2e423a; border-radius: 3px; background: #192822; color: #bdcfb7; font-size: 9px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.quote-result { text-align: center; }
.quote-result .result-price { margin: 18px 0 5px; color: #e4eddf; font: 600 32px 'Segoe UI', Arial, sans-serif; }
.quote-result .result-price small { color: #98aaa1; font: 11px var(--mono); }
.quote-result p { color: #96a49f; font-size: 10px; line-height: 1.65; }
.countdown { margin: 13px 0; color: var(--orange); font: 11px var(--mono); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 10; display: grid; gap: 8px; }
.toast { max-width: min(380px, calc(100vw - 40px)); padding: 12px 14px; border: 1px solid #4a6351; border-radius: 4px; background: #1d2d25; color: #d1e0d0; box-shadow: 0 8px 30px #0005; font-size: 10px; animation: toast-in .18s ease-out; }
.toast.error { border-color: #67473e; background: #30221e; color: #edc2b3; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .sidebar { width: 205px; }
  .main-area { margin-left: 205px; }
  .topbar, .content { padding-right: 23px; padding-left: 23px; }
  .topbar { height: auto; min-height: 63px; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .topbar-actions { min-width: 0; gap: 10px; flex-wrap: wrap; }
  .role-control select { max-width: 145px; }
  .feed-banner { padding-right: 23px; padding-left: 23px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid > *, .metric-grid > *, .product-grid > *, .rule-grid > * { min-width: 0; }
}
@media (min-width: 761px) and (max-width: 850px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 12px 14px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { align-self: flex-start; }
  .workspace-label, .sidebar-bottom { display: none; }
  .primary-nav { display: flex; gap: 3px; margin-top: 12px; overflow-x: auto; scrollbar-width: thin; }
  .nav-item { width: auto; min-height: 40px; flex: 0 0 auto; padding: 8px 9px; font-size: 10px; }
  .nav-icon { width: 12px; font-size: 13px; }
  .nav-group:not([hidden]) { display: contents; }
  .nav-subitems:not([hidden]) { display: contents; }
  .nav-subitem { padding: 8px 9px; font-size: 10px; }
  .main-area { margin-left: 0; }
  .topbar { position: static; height: auto; min-height: 51px; flex-wrap: wrap; gap: 8px 12px; padding: 10px 15px; }
  .topbar-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
  .mode-chip { padding: 5px 6px; font-size: 8px; }
  .role-control { gap: 4px; }
  .role-control > span { display: none; }
  .role-control select { max-width: 140px; font-size: 10px; }
  .customer-identity { max-width: min(220px, 55vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .avatar { display: none; }
  .feed-banner { align-items: flex-start; padding: 9px 15px; font-size: 9px; }
  .feed-meta { display: none; }
  .content { padding: 22px 15px 16px; }
  .footer-note { padding: 10px 15px 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .admin-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-panel .panel-header { align-items: flex-start; flex-direction: column; }
  .history-controls { margin-left: 0; }
}
@media (max-width: 520px) {
  .history-controls { width: 100%; justify-content: space-between; }
  .history-source-label, .history-range-label { align-items: flex-start; flex-direction: column; }
  .history-source-label select, .history-range-label select { max-width: 100%; }
}
@media (max-width: 520px) {
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 102px; padding: 12px; }
  .metric-value { font-size: 21px; }
  .product-grid, .rule-grid { grid-template-columns: 1fr; }
  .rule-fields { grid-template-columns: 1fr; }
  .product-card { padding: 12px; }
  .rule-fields { gap: 10px; padding-right: 12px; padding-left: 12px; }
  .feed-banner { flex-wrap: wrap; }
  .feed-refresh { margin-left: auto; }
  .page-heading { margin-bottom: 18px; }
  h1 { font-size: 25px; }
  .topbar { align-items: stretch; flex-direction: column; padding: 10px 11px; }
  .topbar-actions { justify-content: flex-start; margin-left: 0; }
  .breadcrumb { gap: 6px; font-size: 9px; }
  .role-control select { max-width: 145px; }
  .customer-identity { max-width: calc(100vw - 24px); }
  .quote-dialog { max-height: 90vh; overflow-y: auto; padding: 16px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1 1 120px; }
}
.reference-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card .feed-status { margin-top: 9px; }
@media (max-width: 1050px) { .reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.order-filters { flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.order-filter { gap: 6px; }
.order-filter input[type="date"] { color-scheme: dark; }

/* Blazor port additions: NavLink anchors share .nav-item styling. */
a.nav-item { text-decoration: none; }
.database-status.is-error { color: var(--red); }
