/* ===== Loadpath refresh: the look shared with Central and Cadence (loaded after BI's own styles) ===== */
:root{--ice:#F6F8FB;--ice-line:#E3E8F0;--ink:#14223A;--muted:#5B6B82;--radius:10px;
  --font-ui:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  --font-num:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}
body{background:var(--ice)}
.num,.summary b{font-variant-numeric:tabular-nums}

/* top bar: white, like Central */
.topbar{background:#fff;color:var(--ink);border-bottom:1px solid var(--ice-line);height:64px}
.brand,.brand .mark{color:var(--ink)}
.brand .sub{color:var(--muted)}
.brand-icon{width:32px;height:32px}
.topbar .who{color:var(--muted)}
.topbar button{color:var(--ink);border:1px solid #DCE3EC;border-radius:9px;background:#fff;font-weight:500}
.topbar button:hover{background:#F1F4F9}

/* left panel */
.rail{border-right-color:var(--ice-line)}
.rail h3{letter-spacing:.08em;font-weight:600}
.field select,.field input,.date-row input{border-color:#DCE3EC;border-radius:9px}
.field select:focus,.field input:focus,.date-row input:focus{border-color:var(--navy);outline:none;box-shadow:0 0 0 3px rgba(27,54,93,.10)}

/* toggles: a grey track with the chosen option in white */
.segment{background:#EBEFF5;border:0;border-radius:11px;padding:3px;gap:2px}
.segment button{background:transparent;color:var(--muted);border-radius:8px;font-weight:500}
.segment button+button{border-left:0}
.segment button:hover{color:var(--ink)}
.segment button[aria-pressed=true]{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(16,30,54,.14)}
.preset-row{background:#EBEFF5;border-radius:11px;padding:3px;gap:2px}
.preset-row button{background:transparent;border:0;color:var(--muted);border-radius:8px;font-weight:500}
.preset-row button:hover{color:var(--ink)}
.preset-row button[aria-pressed=true]{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(16,30,54,.14)}
.chart-toggle{border-radius:9px;border-color:#DCE3EC;color:var(--ink);font-weight:500}
.chart-toggle:hover{background:#F1F4F9;border-color:#C9D3E1}

/* panels: rounder and quieter */
.side,.dash-controls,.state.card{border-color:var(--ice-line);border-radius:14px}
.side{padding:18px}
.side-head h2{font-weight:600;letter-spacing:-.01em}
.mini-title,.summary span{letter-spacing:.06em;font-weight:600}
.summary b{font-weight:700;font-size:19px;letter-spacing:-.01em}
.linkbtn{text-decoration:none;font-weight:600}
.linkbtn:hover{text-decoration:underline}
.updated{color:var(--muted)}
.updated b{color:var(--ink)}
.updated .dot{color:#AAB4C3}
.preset-row{flex-wrap:wrap}
@media (max-width:600px){.preset-row button{padding-left:10px;padding-right:10px}.date-row{justify-content:flex-start}}
@media (max-width:600px){.topbar{gap:10px;padding:0 14px}.topbar .who{display:none}}
/* the business selector (super admin): readable on the white bar */
.tenant-switch{background:#fff;color:var(--ink);border:1px solid #DCE3EC;border-radius:9px;font-weight:600;padding:7px 10px;max-width:260px}
.tenant-switch:hover{background:#F1F4F9}
.tenant-switch:focus{outline:none;border-color:var(--navy);box-shadow:0 0 0 3px rgba(27,54,93,.10)}
.tenant-switch option{color:var(--ink);background:#fff}

/* ===== Alignment pass: one 36px control height, one label style, one spacing scale ===== */
:root{--ctl-h:36px}

/* left panel: every field title looks the same, every control is the same height */
.rail{padding:20px 16px}
.rail .field{margin-bottom:20px}
.rail h3,.rail .field>label{display:block;margin:0 0 8px;font-size:11px;line-height:14px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.rail .segment{height:var(--ctl-h);box-sizing:border-box}
.rail .segment button{height:30px;padding-top:0;padding-bottom:0}
.rail .field select,.sku-filter-toggle{height:var(--ctl-h);box-sizing:border-box;padding:0 10px;font-size:13px}
.sku-filter-toggle{border:1px solid #DCE3EC;border-radius:9px;background:#fff;align-items:center;color:var(--ink)}
/* date ranges: no box inside a box, the heading already says which period */
.daterange{border:0;background:transparent;padding:0}
.dr-title{display:none}
.dr-row{gap:8px}
.dr-row label{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;margin:0}
.dr-row span{margin:0;font-size:12px;color:var(--muted)}
.dr-row input[type=date]{height:var(--ctl-h);padding:0 10px;border-color:#DCE3EC;border-radius:9px}
/* quick comparison choices: two equal buttons under the dates */
.cmp-presets{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin-top:8px;padding-left:38px}
.cmp-presets .linkbtn{margin:0;height:30px;padding:0 10px;text-align:left;border:1px solid #DCE3EC;border-radius:8px;background:#fff;color:var(--ink);font-size:12px;font-weight:500;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-presets .linkbtn:hover{background:#F1F4F9;text-decoration:none}
.legend-key{padding-top:20px;margin-top:0}

/* main column: same gutter everywhere */
.main{padding:24px}
.dash{gap:16px}

/* controls: period toggle on the left, every button 36px high on one baseline */
.dash-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:14px 16px;justify-content:flex-start}
.dash-controls .preset-row{height:var(--ctl-h);box-sizing:border-box;flex-wrap:nowrap}
.dash-controls .preset-row button{height:30px;padding:0 14px}
.date-row{flex:1 1 auto;justify-content:flex-start;align-items:center;gap:12px;row-gap:12px}
.date-row label{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.date-row input{height:var(--ctl-h);box-sizing:border-box;padding:0 10px}
.range-note{margin-right:auto;white-space:nowrap}
.chart-toggle{height:var(--ctl-h);box-sizing:border-box;padding:0 14px;white-space:nowrap}

/* the two panels: identical rhythm top to bottom */
.side{padding:20px}
.side-head h2{font-size:16px;line-height:22px}
.side-sub{display:block;margin-top:2px;font-size:12.5px;color:var(--muted)}
.side .chips{margin:14px 0 12px}
.chart .legend{margin:0 0 6px;gap:0}
.legend .sw{margin:0 6px 0 16px}
.legend .sw:first-child{margin-left:0}

/* breakdowns: both columns start on the same line, names have room */
.side-two{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start;margin-top:16px;padding-top:16px;border-top:1px solid var(--ice-line)}
.mini-title{margin-bottom:12px;line-height:14px}
.pie-wrap{align-items:flex-start;gap:14px}
.pie-wrap>svg{flex:0 0 auto}
.pie-legend{flex:1 1 auto;min-width:0;gap:6px;font-size:11.5px}
.pie-legend li{grid-template-columns:10px minmax(0,1fr) auto;gap:6px}
.pie-legend .pl-name{max-width:none}
.pie-legend .pl-pct{text-align:right;font-variant-numeric:tabular-nums}
.hbars{gap:9px}
.hbar{grid-template-columns:96px minmax(0,1fr) 48px;gap:8px}
.hb-val{text-align:right;font-variant-numeric:tabular-nums}

/* totals: a fixed three-column grid, so both panels line up figure for figure */
.summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px;margin-top:16px;padding-top:16px}
.summary div{gap:4px;min-width:0}
.summary span{line-height:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.summary b{line-height:24px}

/* insights below: same heading rhythm as the panels */
.insights-head{margin-bottom:12px;align-items:center}
.insights-head h2{font-size:16px;font-weight:600}
.insight-card{border-radius:14px;padding:16px 20px}

@media (max-width:600px){
  .main{padding:16px}
  .dash-controls .preset-row{flex-wrap:wrap;height:auto}
  .summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .side-two{grid-template-columns:minmax(0,1fr)}
}
.pie-wrap>svg{width:104px;height:auto}
.pie-legend{flex:1 1 0}
.pie-legend li{grid-template-columns:10px minmax(0,1fr) 30px}
.summary div{justify-content:flex-end}
.summary span{white-space:normal;overflow:visible}
.summary div:nth-child(n+4) span{min-height:28px;display:flex;align-items:flex-end}
@media (max-width:600px){
  .cmp-presets{padding-left:0}
  .rail .segment button{white-space:nowrap;padding-left:6px;padding-right:6px;font-size:12.5px}
  .rail .legend-key{grid-column:1/-1}
  .rail .build-tag{grid-column:1/-1}
}

/* totals: one row, same size as the chart title (16px), quiet sentence-case labels */
.summary{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none;gap:0 16px;align-items:end}
.summary div{gap:4px;justify-content:flex-end}
.summary span,.summary div:nth-child(n+4) span{min-height:0;display:block;font-size:11.5px;line-height:15px;font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted);white-space:normal}
.summary b{font-size:16px;line-height:22px;font-weight:600;letter-spacing:-.005em;white-space:nowrap}
@media (max-width:600px){.summary{grid-auto-flow:row;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 16px}}
.summary{grid-auto-columns:auto}
/* equal columns; a column only grows if its figure needs more room, labels never push widths */
.summary{grid-auto-columns:minmax(max-content,1fr)}
.summary div{min-width:max-content}
.summary span,.summary div:nth-child(n+4) span{width:0;min-width:100%}
/* both cards: totals pinned to the bottom, every label gets the same two-line slot, so figures share one line across both cards */
.dash-grid>.side{display:flex;flex-direction:column}
.dash-grid>.side>.summary{margin-top:auto}
.dash-grid>.side>.side-two{margin-bottom:16px}
.summary span,.summary div:nth-child(n+4) span{min-height:30px;display:flex;align-items:flex-end}
