/* Cadence Forms 1.0 component geometry. These tokens are shared by every opted-in app. */
body[data-cadence-ui="1.0"] {
  --cad-toolbar-height:52px;
  --cad-control-height:32px;
  --cad-row-height:38px;
  --cad-header-height:34px;
  --cad-icon-size:15px;
  --cad-icon-gap:6px;
  --cad-ink:#262626;
  --cad-plum:#2b2134;
  --cad-row-alt:#f7f7f7;
}
html body[data-cadence-ui="1.0"] #shell-context-nav[data-cadence-component="toolbar"] {
  height:var(--cad-toolbar-height) !important; min-height:var(--cad-toolbar-height) !important;
  gap:12px !important;
}
html body[data-cadence-ui="1.0"] #shell-context-nav [data-cadence-component="filters"] {
  display:flex; align-items:center; flex-wrap:nowrap; gap:4px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr:not(.rwm-exp-row):not(.cad-section) > :is(td,th):not([rowspan]) {
  box-sizing:border-box !important; height:var(--cad-row-height) !important;
  padding-top:0 !important; padding-bottom:0 !important; line-height:18px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr > td :is(.link-btn,.rwm-why-btn) {
  min-height:0 !important; height:auto !important; line-height:18px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr > td :is(input,select,button.cad-rg-btn) {
  max-height:28px; box-sizing:border-box;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-rown {
  font-variant-numeric:tabular-nums;
}
html body[data-cadence-ui="1.0"] #view [data-cadence-component="footer"] {
  font-size:12.5px; font-variant-numeric:tabular-nums;
}
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-bar .pv > .cad-sel,
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-bar .pv > .cad-sel > .cad-rg-btn {
  width:auto !important; min-width:0 !important; max-width:180px !important; flex:none !important;
}
html body[data-cadence-ui="1.0"] #view .cad-foot .im-readyline {
  display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin:0; padding:0;
  border:0; background:transparent; font-size:12.5px;
}

/* Cell editors read as cells until engaged, with an explicit keyboard focus state. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel { width:auto !important; min-width:0 !important; max-width:100% !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn {
  min-width:0 !important; min-height:26px !important; height:26px !important; padding:0 4px !important;
  border:1px solid transparent !important; background:transparent !important; box-shadow:none !important;
  font:inherit !important; gap:4px !important; border-radius:3px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel .cad-sel-caret { opacity:0; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel:is(:hover,:focus-within) .cad-sel-caret { opacity:1; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn:hover { background:#eee !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn:focus-visible { outline:2px solid #76528e !important; outline-offset:0; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid :is(.rwm-adj-input,.rwm-adj-note) {
  width:100% !important; max-width:100% !important; height:28px !important; padding:0 4px !important;
  border:1px solid transparent !important; border-radius:3px !important; background:transparent !important; box-shadow:none !important;
  color:var(--cad-ink) !important; font:inherit !important;
}
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input:focus { outline:2px solid #76528e !important; outline-offset:0; background:white !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input[type=number] { appearance:textfield; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input::-webkit-inner-spin-button { appearance:none; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody :is(th,td) { font-size:13px !important; color:var(--cad-ink) !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody .rwm-adj-account { font-weight:400 !important; background:#fafafa !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody .rwm-adj-item-col { background:#fafafa !important; color:var(--cad-ink) !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid :is(.rwm-adj-consensus-row,.rwm-adj-total-row) > :is(th,td) {
  background:#f3f0f5 !important; color:var(--cad-ink) !important; border-top:1px solid #d8cfdf !important; border-bottom:1px solid #d8cfdf !important; font-weight:600 !important;
}
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td.rwm-adj-closed { background:transparent !important; color:#777 !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td.dirty { background:#f3edf8 !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid .cad-cell-select { width:100% !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid .cad-cell-select > .cad-rg-btn { width:100% !important; justify-content:space-between; }
html body[data-cadence-ui="1.0"] #view .cad-foot .cad-pagination { margin-left:auto; display:flex; align-items:center; gap:10px; }

html body[data-cadence-ui="1.0"] #view table[data-cadence-render="direct"] td[data-column="item"] strong { font-weight:600 !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"].rwm-adj-grid :is(input.rwm-adj-input,input.rwm-adj-note) { border:1px solid transparent !important; background:transparent !important; }

/* A label inside summary is interactive HTML and swallows the native details toggle. */
html body[data-cadence-ui="1.0"] #shell-context-nav details.facet-dd > summary > label { pointer-events:none; }

/* Values use one cell treatment across forms; action buttons keep their own affordance. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select) {
  border:1px solid transparent !important; border-radius:3px !important;
  background:transparent !important; box-shadow:none !important; font:inherit !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select):hover { background:#eee !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select):focus {
  outline:2px solid #76528e !important; outline-offset:0; background:white !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td input[type="number"] { appearance:textfield; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td input::-webkit-inner-spin-button { appearance:none; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td span.src {
  background:transparent !important; border:0 !important; padding:0 !important; font:inherit !important;
}

/* Compact reason cells reserve space for the label without widening period columns. */
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td:has(> .cad-cell-select) { padding-left:4px !important; padding-right:4px !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"].rwm-adj-grid .cad-cell-select > .cad-rg-btn { padding:0 2px !important; gap:2px !important; font-weight:400 !important; }

/* Preserve the approved fitted desktop grid; below its readable width use the
   native table's intrinsic numeric widths and the existing shared scroll rails.
   A container query also covers zoom, side panels and an already mounted grid. */
html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid { container-type:inline-size; }
@container (max-width:1349px) {
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default {
    table-layout:auto !important; width:max-content !important; min-width:100% !important;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-fit-default td input.rwm-edit { field-sizing:content; width:auto !important; min-width:52px; max-width:none; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-fit-default col { width:auto !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td) {
    min-width:72px !important; text-overflow:clip;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="rown"] { min-width:38px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="select"] { min-width:32px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="item"] { min-width:150px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="desc"] {
    width:220px !important; min-width:220px !important; max-width:220px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td):is([data-column="vendor"],[data-column="constraint"]) {
    width:180px !important; max-width:180px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="dest"] {
    width:240px !important; max-width:240px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="recQty"] { min-width:90px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="why"] { min-width:50px !important; }
}


/* Secondary business sections follow the same typography as grid chrome. */
html body[data-cadence-ui="1.0"] #view .cad-section-title {
  margin:16px 0 8px; font-size:13px; font-weight:600; color:var(--cad-ink);
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-render="direct"] :is(.lr-flag,.lr-urg,.tpm-status,.ctp-stat,.cbmf-conf) {
  background:transparent !important; border:0 !important; padding:0 !important; font:inherit !important;
}

/* Reports retain chart/card composition while nested grids can scroll independently. */
html body[data-cadence-ui="1.0"] #view .cad-report-table { margin-top:12px; }
html body[data-cadence-ui="1.0"] #view .cad-report-section { margin-top:16px; }
html body[data-cadence-ui="1.0"] #view .cad-report-section > h3 { font-size:13px; margin:0 0 8px; }

html body[data-cadence-ui="1.0"] #view .cad-report-columns > * { min-width:0; }

/* The expanded search wrapper supplies the icon; the input must not draw it again. */
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-filters.cad-bar.cad-bar .scope-select.cad-search.open input {
  background-image:none !important; padding:0 4px !important;
}

/* Canvas drawing dimensions update asynchronously after a viewport change. Keep
   the visible chart inside its current card during that resize as well. */
html body[data-cadence-ui="1.0"] #view .da-canvas-wrap { min-width:0; }
html body[data-cadence-ui="1.0"] #view .da-canvas-wrap > canvas {
  display:block; width:100% !important; height:100% !important; max-width:100%;
}

/* Period transitions remain visible without assigning colors to time fences. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > thead > tr > th[data-period-boundary="planning"] {
  border-left:2px dotted #938c81 !important;
}

/* Approved Cadence 1.0 header (2026-09-23). PACE colors belong to the shell,
   not tenant data/status colors. One owner across all opted-in applications. */
body[data-cadence-ui="1.0"] {
  --cad-pace-plan:#58c69f; --cad-pace-act:#69adf0;
  --cad-pace-coordinate:#b69ae8; --cad-pace-evaluate:#ea948f;
}
html body[data-cadence-ui="1.0"][data-layout="topbar"] #shell > .sidebar {
  --cad-brand-gap:32px; --cad-nav-pad:10px; --cad-nav-font:16px;
  display:flex !important; align-items:center !important; flex-wrap:nowrap;
  height:56px !important; min-height:56px !important; padding:0 24px !important;
  gap:0 !important; background:#2c2336 !important; border:0 !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-brand {
  flex:0 0 auto !important; height:auto !important; padding:0 !important;
  margin:0 var(--cad-brand-gap) 0 0 !important; border:0 !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup { column-gap:10px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup-mark { width:34px !important; height:36px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup-wm { font-size:24px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav {
  flex:0 0 auto !important; width:auto !important; height:56px !important;
  min-width:0 !important; margin:0 !important; padding:0 !important; gap:0 !important;
  justify-content:flex-start !important; align-items:stretch !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group { flex:0 0 auto; height:100%; margin:0 !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group > :is(.nav-item-top,.nav-group-label) {
  height:100% !important; padding:0 var(--cad-nav-pad) !important; gap:7px !important;
  font-size:var(--cad-nav-font) !important; font-weight:400 !important;
  color:var(--nav-accent,#ccc8d0) !important; border-bottom:3px solid transparent !important;
  background:transparent !important; filter:none !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .nav-group[data-group="plan"] { --nav-accent:var(--cad-pace-plan) !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .nav-group[data-group="act"] { --nav-accent:var(--cad-pace-act) !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .nav-group[data-group="coordinate"] { --nav-accent:var(--cad-pace-coordinate) !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .nav-group[data-group="evaluate"] { --nav-accent:var(--cad-pace-evaluate) !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group > .nav-item-top.active,
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group:has(.nav-item.active) > .nav-group-label {
  color:var(--nav-accent,#fff) !important; border-bottom-color:var(--nav-accent,#fff) !important; font-weight:700 !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group:is(:hover,.open) > :is(.nav-item-top,.nav-group-label) { background:#ffffff09 !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-actions {
  flex:0 0 auto !important; height:auto !important; margin:0 0 0 auto !important;
  padding:0 0 0 24px !important; gap:16px !important; align-items:center !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-client {
  display:inline-block !important; font-size:13px !important; margin:0 !important; color:#b5afbd !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-ask {
  height:32px !important; padding:0 12px !important; border:1px solid #746b7e !important;
  border-radius:6px !important; font-size:13px !important; font-weight:400 !important; color:#efedf1 !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-footer {
  flex:0 0 auto !important; height:auto !important; padding:0 !important; margin:0 0 0 16px !important;
}
html body[data-cadence-ui="1.0"] #shell > .sidebar .user-card { padding:0 !important; width:32px !important; height:32px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .user-card > span { width:32px !important; height:32px !important; font-size:13px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .usr-menu { top:calc(100% + 4px); }
/* Keep tenant identity available on the account tooltip as its visible label gives
   room to the full navigation. All menu destinations retain their existing handlers. */
@media(max-width:1380px) {
  html body[data-cadence-ui="1.0"][data-layout="topbar"] #shell > .sidebar { --cad-brand-gap:28px; --cad-nav-pad:8px; padding:0 20px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-client { display:none !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-actions { gap:12px !important; padding-left:20px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-footer { margin-left:12px !important; }
}
@media(max-width:1080px) {
  html body[data-cadence-ui="1.0"][data-layout="topbar"] #shell > .sidebar { --cad-brand-gap:22px; --cad-nav-pad:7px; --cad-nav-font:14px; padding:0 16px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup { column-gap:8px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup-mark { width:30px !important; height:32px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .cp-lockup-wm { font-size:22px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-actions { padding-left:16px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-ask { padding:0 10px !important; font-size:12px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group > :is(.nav-item-top,.nav-group-label) { gap:6px !important; }
}
@media(max-width:940px) {
  html body[data-cadence-ui="1.0"][data-layout="topbar"] #shell > .sidebar { flex-wrap:wrap; height:auto !important; min-height:96px !important; padding-top:10px !important; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav { order:3; flex:0 0 100% !important; height:44px !important; overflow-x:auto; }
  html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav .nav-group-items { position:fixed !important; top:96px !important; left:16px !important; right:auto !important; max-width:calc(100vw - 32px); }
}

html body[data-cadence-ui="1.0"][data-layout="topbar"] #shell > .sidebar.cad-header-wrap { flex-wrap:wrap; height:auto !important; min-height:96px !important; padding-top:10px !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar.cad-header-wrap .sidebar-nav { order:3; flex:0 0 100% !important; height:44px !important; overflow-x:auto; }
html body[data-cadence-ui="1.0"] #shell > .sidebar.cad-header-wrap .nav-group-items { position:fixed !important; top:96px !important; left:16px !important; right:auto !important; max-width:calc(100vw - 32px); }
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group:not(.open) > .nav-group-items { visibility:hidden !important; opacity:0 !important; pointer-events:none !important; }
html body[data-cadence-ui="1.0"] #shell > .sidebar .sidebar-nav > .nav-group.open > .nav-group-items { visibility:visible !important; opacity:1 !important; pointer-events:auto !important; }

html body[data-cadence-ui="1.0"] #shell > .sidebar .shell-ask[hidden] { display:none !important; }
