/* V3 / Quiet Precision · visual-r01. Load after the existing styles.css. */
:root {
  --ink: #292b30;
  --muted: #686b72;
  --line: #dcdedc;
  --paper: #f7f7f5;
  --canvas: #eaeae7;
  --navy: #24262b;
  --navy-2: #343942;
  --teal: #526f89;
  --teal-soft: #e5eaf0;
  --amber: #a47737;
  --amber-soft: #f7f1e7;
  --red: #ac5c56;
  --red-soft: #fbefed;
  --shadow: 0 2px 5px #152d3503, 0 0 0 1px #fff8 inset;
  --ui-fast: 150ms;
  --ui-ease: cubic-bezier(.2,.7,.2,1);
  --sidebar-width: 208px;
}
html { scroll-behavior: auto; }
body { background: var(--canvas); font-size: 14px; -webkit-font-smoothing: antialiased; }
body.dashboard-booting { background: #111d27; }
.dashboard-booting > .topbar, .dashboard-booting > .tabs, .dashboard-booting > main, .dashboard-booting > footer { visibility: hidden; }
.dashboard-booting .loading-layer.tide-wait { animation: none; background: #111d27; }
::selection { background: #dce4ef; color: #33485f; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, .primary-button, .secondary-button, input, select, summary {
  transition: background-color var(--ui-fast) var(--ui-ease), border-color var(--ui-fast) var(--ui-ease),
    box-shadow var(--ui-fast) var(--ui-ease), color var(--ui-fast) var(--ui-ease), transform var(--ui-fast) var(--ui-ease);
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #6684a1; outline-offset: 3px;
}
.topbar { min-height: 88px; padding: 20px 32px; color: #e8e9ed; background: #24262b; border-bottom: 1px solid #373a41; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #e8e9ec; color: #54677f; border: 1px solid #d9dde4; font-size: 14px; font-weight: 700; }
.topbar .eyebrow { color: #a0a5af; font-size: 10px; font-weight: 500; letter-spacing: .06em; margin-bottom: 6px; }
h1 { font-size: 19px; font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 25px; font-weight: 650; letter-spacing: -.04em; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.eyebrow { font-size: 10px; font-weight: 550; letter-spacing: .06em; margin-bottom: 6px; }
.data-status { padding: 8px 11px; font-size: 11px; color: #bec6d0; background: #30343c; border: 1px solid #474e58; border-radius: 7px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; background: #398873; box-shadow: 0 0 0 3px #3988730d; flex: 0 0 auto; }
.workspace-brand { display: none; }
.nav-caption, .nav-footnote { display: none; }
.tabs { padding: 10px 24px; gap: 4px; scrollbar-width: thin; }
.tab { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 40px; padding: 10px 13px; border-radius: 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tab svg { width: 17px; height: 17px; color: #849197; stroke-width: 1.55; flex: 0 0 auto; }
.tab.active { color: #485f7c; background: #e6eaf0; font-weight: 650; }
.tab.active svg { color: #586f8c; }
.tab::after { display: none; }
main { width: min(1560px, calc(100% - 64px)); padding: 25px 0 40px; }
.visual-preview-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 17px; color: #5e6a74; font-size: 10px; }
.visual-preview-note > span { display: flex; align-items: center; gap: 7px; }
.visual-preview-note b { padding: 3px 5px; color: #596b80; border: 1px solid #d5dce6; border-radius: 4px; font: 10px ui-monospace, monospace; }
.visual-preview-note a { color: #52677f; text-decoration: none; border-bottom: 1px solid #bbc7d6; }
.filter-panel, .panel, .metric-card { background: #f7f7f5; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; }
.filter-panel { padding: 19px 20px; margin-bottom: 25px; }
.filter-summary { font-size: 12px; font-weight: 550; }
.quick-ranges { gap: 2px; padding: 3px; background: #f3f5f6; border: 1px solid #e8eced; border-radius: 8px; }
.quick-ranges button { min-height: 29px; padding: 5px 10px; border-radius: 5px; background: transparent; border: 1px solid transparent; font-size: 11px; }
.quick-ranges button.selected { color: #495f7b; background: #fff; border-color: #dadfe6; box-shadow: 0 1px 3px #213c3310; }
.filter-grid { margin-top: 17px; gap: 10px; }
label { color: #65737a; font-size: 11px; font-weight: 500; gap: 7px; }
input, select { min-height: 38px; padding: 8px 10px; background-color: #fff; border: 1px solid #dce3e5; border-radius: 7px; font-size: 12px; font-weight: 450; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus { border-color: #8eabc4; box-shadow: 0 0 0 3px #698db410; }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); }
.primary-button, .secondary-button { min-height: 38px; padding: 9px 15px; border-radius: 7px; font-size: 12px; font-weight: 550; gap: 7px; }
.primary-button { color: #eef3f7; background: linear-gradient(180deg,#3d4856,#303b49); border: 1px solid #2c3642; box-shadow: 0 1px 0 #ffffff20 inset, 0 2px 3px #172f3618; }
.secondary-button { color: #4f5e73; background: #fff; border-color: #d7dce2; box-shadow: 0 1px 2px #152d3505; }
.quiet-button { color: #56666b; background: #f2f3f4; border-color: #e0e6e8; border-radius: 6px; font-size: 11px; font-weight: 500; }
.primary-button svg, .secondary-button svg, .quiet-button svg { width: 14px; height: 14px; flex: 0 0 auto; }
button:not(:disabled):active, .primary-button:not([aria-disabled=true]):active, .secondary-button:not([aria-disabled=true]):active { transform: translateY(1px); box-shadow: 0 1px 2px #152d350d inset; }
button:disabled, a[aria-disabled=true] { cursor: not-allowed; transform: none; opacity: .46; box-shadow: none; }
.section-heading { margin: 0 0 18px; }
.tab-panel.active { animation: quiet-enter 220ms var(--ui-ease) both; }
.hero-grid { gap: 12px; }
.metric-card { min-height: 135px; padding: 18px; }
.metric-card::before { top: 22px; right: 18px; width: 5px; height: 5px; border-radius: 50%; opacity: .7; }
.metric-label { padding-right: 15px; font-size: 11px; color: #637177; font-weight: 500; }
.metric-value { margin: 16px 0 11px; font-size: clamp(23px, 2.2vw, 31px); letter-spacing: -.045em; font-weight: 620; }
.metric-note { font-size: 10px; line-height: 1.5; color: #667179; }
#heroMetrics > .metric-card:first-child { color: #fff; background: linear-gradient(115deg,#2a3039,#39434e); border-color: #353e49; box-shadow: 0 1px 0 #ffffff12 inset; }
#heroMetrics > .metric-card:first-child .metric-label { color: #c3d0da; }
#heroMetrics > .metric-card:first-child .metric-note { color: #b6c5d0; }
#heroMetrics > .metric-card:first-child::before { background: #9cbdcf; box-shadow: 0 0 0 3px #b0d9e90c; }
.metric-chip { border-radius: 4px; font-size: 10px; }
.support-grid { margin-top: 17px; gap: 17px; grid-template-columns: minmax(0,1.65fr) minmax(300px,1fr); }
.panel { padding: 20px; min-width: 0; }
.panel-heading { gap: 14px; }
.compact-select { min-width: 135px; font-size: 10px; }
.compact-select select { min-height: 32px; font-size: 11px; border-radius: 6px; }
.chart-wrap { height: 255px; margin-top: 18px; }
.chart-legend { font-size: 11px; }
.chart-tooltip { background: #243c3ef5; border-radius: 7px; box-shadow: 0 5px 18px #102a3020; }
.subtle { font-size: 11px; line-height: 1.5; }
.panel-note { font-size: 10px; line-height: 1.8; padding-top: 13px; margin-top: 18px; }
.target-ring-wrap { grid-template-columns: 124px 1fr; gap: 17px; margin-top: 31px; }
.target-ring { width: 122px; height: 122px; }
.target-ring::before { width: 102px; height: 102px; background: #f7f7f5; }
.target-ring strong { font-size: 24px; font-weight: 600; letter-spacing: -.04em; }
.target-ring span { font-size: 9px; margin-top: 4px; }
.target-ring-copy strong { font-size: 14px; font-weight: 580; }
.target-ring-copy p { font-size: 10px; line-height: 1.5; margin-bottom: 5px; }
.version-badge { font: 9px ui-monospace, SFMono-Regular, monospace; border: 1px solid #e2e8e6; border-radius: 4px; padding: 5px 6px; white-space: nowrap; }
.table-panel { margin-top: 17px; }
.table-scroll { margin-top: 17px; scrollbar-width: thin; scrollbar-color: #c9d4d6 transparent; }
th, td { padding: 13px 12px; font-size: 11px; border-color: #edf0f1; }
th { color: #64767c; background: #f0f1f2; font-weight: 550; }
td { color: #435158; }
td.number { color: #28363c; font-variant-numeric: tabular-nums; }
tbody tr { transition: background-color 120ms ease; }
.subtabs { gap: 5px; }
.subtab, .inner-tab { min-height: 35px; padding: 8px 12px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.subtab.active { background: #e7eaf0; color: #4b627e; border-color: #d5dce7; }
.read-only-badge, .context-badge, .status-pill, .inventory-risk-badge { border-radius: 5px; font-size: 10px; font-weight: 500; }
.module-filter { padding: 17px; background: #f2f3f4; border-radius: 9px; }
.notice { font-size: 11px; border-radius: 7px; line-height: 1.7; }
.product-detail-dialog { border: 1px solid #dbe4e5; border-radius: 12px; box-shadow: 0 24px 80px #102a3030; }
dialog::backdrop { background: #172f3659; backdrop-filter: blur(3px); }
.loading-layer { background: #f5f8f9bd; backdrop-filter: blur(4px); }
.loading-card { border-radius: 12px; box-shadow: 0 16px 60px #172f3612; font-size: 13px; }
.loader { width: 24px; height: 24px; border-width: 2px; animation-duration: 1s; }
footer { background: transparent; color: #5e6a74; padding: 18px 32px; font-size: 10px; border-top: 1px solid var(--line); }
.empty-state, .chart-empty { color: #6e8085; }
@keyframes quiet-enter { from { opacity: .2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (hover:hover) {
  .tab:not(.active):hover { color: #4b617d; background: #eceef2; }
  .quick-ranges button:not(.selected):hover { background: #e5e8ec; color: #4c5f75; border-color: transparent; }
  .primary-button:not(:disabled):not([aria-disabled=true]):hover { background: linear-gradient(180deg,#4b5c70,#3b4b5e); border-color: #50647b; box-shadow: 0 1px 0 #ffffff28 inset,0 3px 9px #15303b2a; }
  .secondary-button:not(:disabled):not([aria-disabled=true]):hover { background: #f1f3f5; border-color: #aabacd; box-shadow: 0 2px 5px #153b3009; }
  .quiet-button:not(:disabled):hover { background: #e9edf2; border-color: #b9c8d7; }
  input:hover:not(:disabled), select:hover:not(:disabled) { border-color: #b6c3d1; }
  tbody tr:hover { background: #edf0f3; }
}
@media (min-width:1180px) {
  .tabs { position: fixed; inset: 0 auto 0 0; z-index: 12; width: var(--sidebar-width); padding: 26px 15px 20px; flex-direction: column; overflow-y: auto; overflow-x: hidden; border-right: 1px solid #303339; border-bottom: 0; background: #1b1d21; }
  .workspace-brand { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 7px; margin-bottom: 23px; }
  .workspace-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #49616f; border-radius: 9px; background: linear-gradient(135deg,#3f5663,#2b3e4b); box-shadow: 0 1px 0 #ffffff28 inset; }
  .workspace-symbol svg { width: 20px; height: 20px; stroke: #dbe6ed; stroke-width: 1.4; }
  .workspace-brand strong { display: block; font-size: 14px; letter-spacing: -.03em; color: #e7edf0; font-weight: 650; }
  .workspace-brand small { display: block; margin-top: 4px; font-size: 8px; line-height: 1.45; max-width: 115px; white-space: normal; letter-spacing: .01em; color: #8a9fac; }
  .nav-caption { display: block; padding: 0 13px; margin: 0 0 10px; color: #8f97a4; font-size: 10px; letter-spacing: .07em; }
  .nav-caption.tools { margin-top: 16px; }
  .tabs .tab { flex-shrink: 0; min-height: 42px; font-size: 12px; color: #b5bbc6; }
  .tabs .tab svg { color: #989fab; }
  .tabs .tab.active { color: #e1edf4; background: #323a46; box-shadow: 0 1px 0 #ffffff08 inset; }
  .tabs .tab.active svg { color: #9fc3d7; }
  .tabs .tab:not(.active):hover { color: #dce6ed; background: #292f38; }
  .nav-footnote { display: grid; gap: 9px; margin-top: auto; padding: 18px 13px 0; color: #a4acb8; font-size: 10px; line-height: 1.7; }
  .nav-footnote span { display: flex; align-items: center; gap: 8px; }
  .nav-footnote .status-dot { width: 4px; height: 4px; }
  .nav-footnote small { padding-top: 12px; border-top: 1px solid #34434e; font-size: 9px; color: #959eac; letter-spacing: .035em; }
  .topbar { margin-left: var(--sidebar-width); }
  .topbar .brand-mark { display: none; }
  main { width: auto; max-width: 1700px; margin: 0 32px 0 calc(var(--sidebar-width) + 32px); }
  .filter-grid { grid-template-columns: minmax(145px,1.4fr) repeat(4,minmax(104px,1fr)) auto; }
  footer { margin-left: var(--sidebar-width); }
}
@media (min-width:1750px) { main { margin-right: auto; } }
@media (max-width:1179px) {
  .tab svg { width: 15px; height: 15px; }
  .tabs { position: sticky; top: 0; z-index: 12; background: #fffffff5; backdrop-filter: blur(12px); }
  .filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hero-grid, .compact-hero { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:850px) {
  .support-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
  .data-status { align-self: auto; }
}
@media (max-width:640px) {
  .topbar { padding: 18px 20px; min-height: 88px; }
  .topbar .data-status { font-size: 10px; }
  .tabs { padding: 8px 12px; }
  .tab { padding: 9px 11px; min-height: 40px; }
  main { width: calc(100% - 32px); padding-top: 18px; }
  .visual-preview-note { font-size: 9px; align-items: flex-start; }
  .visual-preview-note a { white-space: nowrap; }
  .filter-panel { padding: 16px; margin-bottom: 24px; }
  .filter-heading { gap: 16px; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 10px; }
  .filter-grid label { min-width: 0; }
  .filter-grid input, .filter-grid select { width: 100%; min-width: 0; font-size: 12px; }
  .hero-grid, .compact-hero { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metric-card { padding: 15px 13px; min-height: 128px; }
  .metric-card::before { right: 12px; top: 19px; width: 4px; height: 4px; }
  .metric-value { font-size: clamp(21px,5.5vw,27px); margin: 15px 0 10px; }
  .metric-label { font-size: 10px; }
  .metric-note { font-size: 10px; align-items: flex-start; }
  .panel { padding: 17px; }
  .section-heading { gap: 9px; margin-bottom: 16px; }
  h2 { font-size: 23px; }
  .chart-wrap { height: 240px; }
  .panel-heading .subtle { font-size: 10px; }
  .target-ring-wrap { grid-template-columns: 122px 1fr; margin-top: 24px; }
  .quick-ranges button { min-height: 32px; padding: 6px 11px; }
  .compact-select { min-width: 130px; }
  footer { padding: 18px 20px; line-height: 1.8; }
  input, select, .primary-button, .secondary-button { min-height: 40px; }
}
@media (max-width:360px) {
  .filter-grid, .hero-grid, .compact-hero { grid-template-columns: 1fr; }
  .target-ring-wrap { grid-template-columns: 1fr; justify-items: center; }
  .target-ring-copy { text-align: center; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .tabs, .visual-preview-note { display: none !important; }
  .topbar, main, footer { margin-left: 0; }
  main { width: 100%; margin-right: 0; }
  .metric-card, .panel { break-inside: avoid; box-shadow: none; }
}

/* Keep the sidebar scrollable at low heights without a heavy gutter. */
.tabs::-webkit-scrollbar { width:4px; height:4px; }
.tabs::-webkit-scrollbar-thumb { background:#6b849344; border-radius:3px; }
.brand-mark { color:#c3d4de; background:#334753; border-color:#4b606d; }

/* Session navigation in the production workspace. */
.topbar-controls { display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap; }
.workspace-actions { display:flex; align-items:center; gap:12px; }
.workspace-actions form { margin:0; }
.workspace-actions a, .workspace-actions button { display:inline-block; padding:7px 0; border:0; color:#bbc3cd; background:transparent; text-decoration:none; font:inherit; font-size:11px; cursor:pointer; }
.workspace-actions a:hover, .workspace-actions button:hover { color:#fff; }
@media(max-width:640px) { .topbar-controls { width:100%; justify-content:space-between; gap:8px; } }

/* Tide chart language: mineral colours, precise lines, quiet data surfaces. */
:root {
  --chart-blue:#52758f; --chart-teal:#4c7e78; --chart-copper:#96734f; --chart-violet:#81718e;
  --chart-olive:#7c8257; --chart-rose:#a16e79; --chart-steel:#577d92; --chart-slate:#5f6675;
  --chart-grid:#dce2e5; --chart-ink:#586571;
}
.chart-wrap { border-radius:5px; background:linear-gradient(180deg,#52758f04,transparent 58%); }
.chart-tooltip { padding:11px 13px; gap:5px; border:1px solid #7992a34d; border-radius:8px; background:#1c2934f5; box-shadow:0 6px 24px #14253325,0 1px 0 #d4e2ef0d inset; font-variant-numeric:tabular-nums; line-height:1.5; }
.chart-tooltip strong { font-size:11px; font-weight:550; color:#e7edf2; }
.chart-tooltip span { color:#bbcfda; }
.chart-legend { color:var(--chart-ink); gap:8px; }
.chart-legend i { width:18px; height:2px; border-radius:2px; background:var(--chart-blue); }
.chart-series-legend { color:var(--chart-ink); }
.chart-series-legend i { width:18px; height:3px; border-radius:2px; }
.target-ring { background:conic-gradient(var(--chart-teal) var(--progress),#e1e6e7 0deg); box-shadow:0 0 0 1px #526f890a; }
.target-ring strong { color:#365b63; }
.progress-bar { background:#e2e7e8; }
.progress-bar span { background:linear-gradient(90deg,var(--chart-blue),var(--chart-teal)); }
.climate-map-wrap { background:#edf0ef; border-color:#d8dfdf; border-radius:9px; }
.province-shape { stroke:#f7f7f5dc; stroke-width:.8; }
.province-shape:hover,.province-shape:focus { stroke:#364f64; stroke-width:1.5; }
.temperature-scale { border-radius:5px; }

/* Each report keeps a recognisable accent within one shared mineral palette. */
body { --chart-primary:var(--chart-blue); --chart-secondary:var(--chart-teal); }
body[data-visual-section="promotion"] { --chart-primary:var(--chart-violet); --chart-secondary:var(--chart-blue); --tide-a:#afa1c9; --tide-b:#8aaecc; --tide-c:#c2a0ac; }
body[data-visual-section="competition"] { --chart-primary:var(--chart-teal); --chart-secondary:var(--chart-violet); --tide-a:#8fbbb2; --tide-b:#aaa7c3; --tide-c:#9cb2c5; }
body[data-visual-section="ownLaunch"] { --chart-primary:var(--chart-copper); --chart-secondary:var(--chart-violet); --tide-a:#c2aa8c; --tide-b:#b3a5bd; --tide-c:#91afc3; }
body[data-visual-section="climate"] { --chart-primary:var(--chart-steel); --chart-secondary:var(--chart-copper); --tide-a:#93b2ca; --tide-b:#9cb9b3; --tide-c:#c8ac8d; }
body[data-visual-section="refunds"] { --chart-primary:var(--chart-rose); --chart-secondary:var(--chart-violet); --tide-a:#c4a3ad; --tide-b:#b0a5c3; --tide-c:#93b2c5; }
body[data-visual-section="reports"] { --chart-primary:var(--chart-violet); --chart-secondary:var(--chart-teal); --tide-a:#b0a6c5; --tide-b:#91b8ae; --tide-c:#99b1ca; }
body[data-visual-section="database"],body[data-visual-section="ingestion"] { --chart-primary:var(--chart-slate); --chart-secondary:var(--chart-steel); --tide-a:#a0b0bf; --tide-b:#91afb7; --tide-c:#aaaec2; }
.tab-panel .section-heading h2 { text-decoration-color:var(--chart-primary); }
.tab-panel .panel-heading h3::before { content:""; display:inline-block; width:3px; height:11px; margin-right:8px; border-radius:2px; background:var(--chart-primary); opacity:.75; vertical-align:0; }
.chart-legend i { background:var(--chart-primary); }

/* The landing wave resolves into the first-screen business trend. */
#operationsPanel > .support-grid { margin-top:0; margin-bottom:18px; }
