/* Figma Desktop - 2: Helvetica 300/400/700, half-pixel contours, 20px panel
   insets, 10px field spacing and 25px between content blocks. */
#view-summary, .summary-details-dialog { font-family: "Avenlark Helvetica", Arial, sans-serif; font-weight: 400; }
.summary-controls { padding: 20px; margin-bottom: 25px; background: rgba(61, 63, 70, .35); border: .5px solid #959595; border-radius: 12px; box-shadow: 0 4px 20px 8px rgba(0, 0, 0, .25); }
.summary-control-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.summary-control-head h2 { font-size: 18px; line-height: 26px; font-weight: 700; }
.summary-control-head p { display: none; }
#view-summary .summary-control-head > .button { min-height: 26px; padding: 0 15px; color: #979797; font-size: 13px; font-weight: 300; border: 0; background: transparent; text-decoration: underline; box-shadow: none; }
#view-summary .summary-control-head > .button:hover { color: #fff; }
.summary-fields { display: grid; grid-template-columns: 1.15fr 1.27fr .87fr .87fr 1.5fr 1.15fr 1.02fr; gap: 10px; align-items: end; }
.summary-fields .field { min-width: 0; }
.summary-fields .field label { margin-bottom: 10px; font-size: 13px; font-weight: 400; color: #fff; line-height: 18px; }
.summary-fields input, .summary-fields select { width: 100%; min-width: 0; min-height: 37px; height: 37px; padding: 7px 10px; font-family: inherit; font-size: 13px; font-weight: 300; border-radius: 8px; border: .5px solid #fff; background-color: #25262b; color: #fff; }
.summary-fields input[type=date] { padding-right: 7px; }
#view-summary .summary-fields > .button { min-height: 37px; height: 37px; padding: 7px 12px; background: #4360e8; border: .5px solid #4360e8; color: #fff; border-radius: 8px; font-size: 13px; font-weight: 400; }
#view-summary .summary-fields > .button:hover:not(:disabled) { background: #4360e8; }

.summary-sync-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 0 25px; }
.summary-sync-bar > div { min-width: 0; }
.summary-sync-bar strong { display: flex; align-items: center; gap: 2px; font-size: 13px; line-height: 19px; font-weight: 400; }
.summary-sync-bar strong::before { content: ''; width: 18px; height: 18px; flex-shrink: 0; background: url('/static/assets/figma/blue-dot.svg') center / 18px 18px no-repeat; }
.summary-sync-bar p { font-size: 13px; line-height: 20px; margin-top: 2px; max-width: 950px; color: #959595; }

/* Cost and tax remain separate, labelled values inside a single overview card. */
.summary-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 25px; margin-bottom: 25px; }
.summary-metrics .metric { min-height: 141px; padding: 20px; background: rgba(61, 63, 70, .35); border: .5px solid #959595; border-radius: 12px; box-shadow: 0 4px 20px 8px rgba(0, 0, 0, .25); overflow: hidden; }
.summary-metrics .metric-label { margin: 0 0 8px; min-height: 0; color: #fff; font-size: 18px; font-weight: 700; line-height: 20px; }
.summary-metrics .metric > strong, .summary-cost-tax-values strong { display: block; min-width: 0; max-width: 100%; font-size: 24px; font-weight: 700; line-height: 1.14; letter-spacing: normal; color: #fff; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.summary-metrics .metric > strong { margin-bottom: 0; }
.summary-metrics .metric > span:not(.sr-only) { display: block; margin-top: 10px; color: #fff; font-size: 11px; font-weight: 300; line-height: 15px; }
.summary-metrics .metric.featured { background: rgba(61, 63, 70, .35); border-color: #4360e8; box-shadow: 0 4px 4px rgba(67, 96, 232, .51); }
.summary-metrics .metric.featured::before, .summary-metrics .metric.featured::after { display: none; }
.summary-metrics .metric.featured > strong { color: #4360e8; }
.summary-metrics .metric .unknown-value { font-size: 18px; font-weight: 400; color: #959595; letter-spacing: -.2px; white-space: normal; line-height: 1.3; }
.summary-metrics .metric strong.negative { color: #fff; }
.summary-cost-tax-values { display: flex; flex-direction: column; gap: 0; }
.summary-cost-tax-values > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; color: #fff; font-size: 24px; font-weight: 700; line-height: 1.14; }
.summary-cost-tax-values strong { display: inline; }
.summary-metrics .summary-cost-tax .metric-label { margin-top: 0; }

.summary-meta-row { display: flex; flex-direction: column; gap: 25px; margin: 0 0 25px; }
#view-summary .summary-scope { margin: 0; font-size: 13px; line-height: 24px; color: #959595; }
.summary-coverage { width: 100%; max-width: 100%; margin: 0; border: .5px solid #1b21a9; border-radius: 12px; padding: 20px; background: rgba(27, 33, 169, .35); color: #fff; font-size: 13px; }
.summary-coverage > h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 25px; }
.summary-coverage-item { padding-top: 6px; line-height: 21px; }
.summary-coverage-item strong { font-size: 16px; font-weight: 700; }
.summary-coverage-item p { font-size: 13px; line-height: 21px; margin-top: 0; color: #fff; }
.summary-coverage-item .missing-ranges { color: #fff; }
.summary-coverage-item + .summary-coverage-item { margin-top: 13px; padding-top: 13px; border-top: .5px solid rgba(61, 63, 70, .35); }

/* Spreadsheet toolbar and column chooser. */
.summary-report { overflow: visible; background: rgba(0, 0, 0, .25); border: .5px solid #959595; border-radius: 12px; }
.summary-report .panel-heading { padding: 20px; min-height: 80px; border-bottom: .5px solid #959595; }
.summary-report .panel-heading h2 { font-size: 16px; font-weight: 700; line-height: 22px; }
.summary-report .panel-heading .small { font-size: 11px; font-weight: 300; margin-top: 3px; color: #fff; }
.summary-export { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
#view-summary .summary-export .button { min-height: 37px; padding: 8px 10px; font-size: 13px; border: .5px solid #959595; background: transparent; font-weight: 300; }
.summary-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 20px; }
.summary-toolbar .search-field { flex: 0 1 182px; max-width: 240px; min-width: 150px; }
.summary-toolbar .search-field input, .summary-detail-tools .search-field input { height: 35px; min-height: 35px; padding-top: 7px; padding-bottom: 7px; font-size: 11px; font-weight: 300; border: .5px solid #fff; background: transparent; }
.summary-toolbar .search-field > span, .summary-detail-tools .search-field > span { color: #fff; }
#view-summary .summary-toolbar > .button { min-height: 35px; padding: 8px 10px; border: .5px solid #4360e8; color: #4360e8; font-size: 11px; background: transparent; font-weight: 400; }
.summary-inline-label { display: flex; align-items: center; gap: 10px; color: #959595; font-size: 11px; font-weight: 400; }
.summary-inline-label select { min-height: 35px; max-width: 225px; padding: 7px 10px; font-size: 11px; font-weight: 300; background-color: transparent; color: #fff; border: .5px solid #fff; }
:is(#summary-sort, #summary-period-metric) { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 10px 6px; }
.summary-table-actions { display: flex; gap: 30px; align-items: center; flex-shrink: 0; padding-left: 10px; }
#view-summary .summary-table-actions .text-button, .summary-toolbar > .text-button { white-space: nowrap; font-size: 11px; color: #4360e8; font-weight: 400; }
.summary-toolbar-secondary { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.summary-toolbar-secondary .summary-inline-label { font-size: 0; gap: 0; }
.summary-toolbar-secondary .summary-inline-label select { width: 116px; max-width: 175px; font-size: 11px; }
.summary-column-settings { position: relative; font-size: 11px; z-index: 8; }
.summary-column-settings > summary { list-style: none; border: .5px solid #fff; border-radius: 7px; padding: 8px 10px; min-height: 35px; cursor: pointer; background: transparent; color: #fff; font-size: 11px; font-weight: 400; white-space: nowrap; }
.summary-column-settings > summary::-webkit-details-marker { display: none; }
.summary-column-settings > summary:hover { background: rgba(61, 63, 70, .35); }
.summary-column-settings[open] > summary { border-color: #4360e8; background: rgba(27, 33, 169, .35); }
.summary-column-settings fieldset { position: absolute; right: 0; top: 42px; background: #15161b; border: .5px solid #959595; border-radius: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, .25); width: 240px; max-width: 80vw; padding: 20px; display: grid; gap: 10px; }
.summary-column-settings legend { padding: 0 5px; font-size: 11px; background: #15161b; color: #979797; }
.summary-column-settings label { display: flex; gap: 9px; align-items: center; font-size: 11px; font-weight: 400; line-height: 1.4; }
.summary-column-settings input { flex-shrink: 0; }
#view-summary .summary-toolbar .button[aria-pressed=true] { background: rgba(27, 33, 169, .35); border-color: #4360e8; color: #fff; }
.summary-period-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 20px; border-top: .5px solid rgba(61, 63, 70, .35); background: rgba(18, 19, 23, .35); }
.summary-period-pager { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #979797; }
.summary-period-pager .icon-button { height: 30px; width: 30px; font-size: 18px; border-radius: 6px; }

/* Opaque sticky cells preserve legibility while the report scrolls. */
.summary-scroll { position: relative; isolation: isolate; max-height: 660px; scrollbar-color: #959595 #15161b; }
.summary-scroll table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.summary-scroll thead { position: sticky; top: 0; z-index: 5; background: #25262b; }
.summary-scroll th { vertical-align: middle; text-align: right; min-width: 130px; border-left: .5px solid rgba(61, 63, 70, .35); border-top: 0; border-bottom: .5px solid rgba(61, 63, 70, .35); background: #25262b; color: #fff; font-size: 11px; line-height: 1.5; font-weight: 400; padding: 11px 12px; white-space: normal; }
.summary-scroll th.summary-label-head { min-width: 260px; width: 260px; text-align: left; position: sticky; left: 0; z-index: 6; background: #25262b; border-left: 0; box-shadow: .5px 0 0 rgba(61, 63, 70, .35); padding-left: 20px; }
.summary-scroll th.summary-total-head { background: #25262b; color: #fff; }
.summary-scroll th.summary-total-group { background: #25262b; color: #4360e8; text-align: center; font-size: 11px; font-weight: 700; border-bottom-color: #959595; }
.summary-total-group .period-hint { display: block; font-size: 11px; font-weight: 400; color: #979797; margin-top: 3px; white-space: nowrap; }
.summary-scroll th.highlight-column { background: #25262b; color: #4360e8; }
.summary-scroll .summary-period-heading { background: #25262b; border-bottom: .5px solid #959595; text-align: center; }
.summary-period-toggle { background: none; border: 0; color: #4360e8; font-weight: 700; font-size: 11px; padding: 0; cursor: pointer; }
.summary-period-toggle:hover { color: #fff; }
.summary-period-heading .period-hint { display: block; font-size: 11px; font-weight: 400; color: #979797; margin-top: 3px; white-space: nowrap; }
.summary-scroll th.summary-period-total { background: #25262b; color: #fff; }
.summary-scroll td { padding: 6px 12px; font-size: 13px; color: #fff; border-left: .5px solid rgba(61, 63, 70, .35); border-bottom: .5px solid rgba(61, 63, 70, .35); background: #121317; }
.summary-scroll td:first-child { position: sticky; left: 0; z-index: 2; background: #121317; border-left: 0; min-width: 260px; max-width: 300px; padding-left: 20px; box-shadow: .5px 0 0 rgba(61, 63, 70, .35); }
.summary-scroll tbody tr:hover td, .summary-scroll tbody tr:hover td:first-child { background: #25262b; }
.summary-scroll td.highlight-column { background: #15161b; }
.summary-scroll td.period-cell { background: #15161b; }
.summary-scroll tr.summary-parent td, .summary-scroll tr.summary-parent td:first-child { background: #25262b; font-weight: 700; border-bottom-color: rgba(61, 63, 70, .35); }
.summary-scroll tr.summary-parent:hover td { background: #25262b; }
.summary-scroll tr.summary-grand-total td, .summary-scroll tr.summary-grand-total td:first-child { background: #25262b; font-weight: 700; border-bottom: .5px solid #959595; border-left-color: rgba(61, 63, 70, .35); color: #fff; padding-top: 10px; padding-bottom: 10px; }
.summary-scroll tr.summary-grand-total:hover td { background: #25262b; }
.summary-row-label { display: flex; align-items: center; gap: 5px; min-height: 26px; white-space: normal; line-height: 1.45; font-size: 13px; color: #fff; }
.summary-row-label.depth-1 { padding-left: 16px; }
.summary-row-label.depth-2 { padding-left: 32px; }
.summary-row-label.depth-3 { padding-left: 48px; }
.summary-row-label.depth-4 { padding-left: 64px; }
.summary-tree-toggle { position: relative; border: 0; background: none; border-radius: 4px; font-size: 0; padding: 2px; width: 20px; min-height: 26px; flex-shrink: 0; color: #979797; }
/* A centred shape avoids the different baselines of the expanded/collapsed glyphs. */
.summary-tree-toggle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 6px; height: 10px; background: currentColor; clip-path: polygon(16.667% 0, 0 10%, 66.667% 50%, 0 90%, 16.667% 100%, 100% 50%); transform: translate(-50%, -50%); }
.summary-tree-toggle[aria-expanded="true"]::before { transform: translate(-50%, -50%) rotate(90deg); }
.summary-tree-toggle:hover { background: rgba(27, 33, 169, .35); color: #fff; }
.summary-tree-spacer { display: inline-block; width: 20px; flex-shrink: 0; }
.summary-number { border: 0; background: none; color: inherit; padding: 4px 2px; width: 100%; min-height: 26px; text-align: right; font-size: 13px; font-weight: inherit; font-variant-numeric: tabular-nums; line-height: 1.5; border-radius: 4px; white-space: nowrap; }
.summary-number:hover { color: #fff; text-decoration: underline; background: rgba(27, 33, 169, .35); }
.summary-number.partial { color: #979797; }
.summary-number.unknown { color: #959595; font-size: 11px; }
.summary-number.negative { color: #fff; }
.summary-number.positive { color: #4360e8; }
.summary-number.selected { background: #1b21a9; box-shadow: inset 0 0 0 .5px #4360e8; padding-right: 6px; }
.summary-number.selected:hover { background: #1b21a9; }

.summary-report .pagination { padding: 20px; font-size: 11px; }
#view-summary .summary-report .pagination .button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.summary-selection-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 15px; padding: 20px; background: rgba(18, 19, 23, .35); border-top: .5px solid rgba(61, 63, 70, .35); font-size: 11px; line-height: 1.7; color: #979797; }
.summary-selection-bar .text-button { white-space: nowrap; }
.summary-selection-bar strong { color: #fff; font-weight: 700; }
.summary-selection-bar .selection-warning { display: block; color: #979797; font-size: 11px; }
.summary-report .table-footer { padding: 20px; color: #959595; font-size: 11px; line-height: 1.6; }
.summary-methodology { margin-top: 25px; padding: 20px; color: #959595; font-size: 13px; }
.summary-methodology > summary { cursor: pointer; font-weight: 400; color: #979797; }
.summary-methodology #summary-warnings { padding: 20px 0 0; }
.summary-methodology p { font-size: 11px; line-height: 1.7; margin-bottom: 5px; }
#view-summary .method-note { color: #959595; }

/* Drilldown remains independent of the main table's horizontal scroll. */
.summary-details-dialog { width: 1400px; max-width: min(96vw, 1450px); border: .5px solid #959595; border-radius: 12px; color: #fff; background: #15161b; }
.summary-details-content { padding: 20px; }
.summary-details-dialog .dialog-heading { margin-bottom: 10px; }
.summary-details-dialog .dialog-heading .eyebrow { font-size: 11px; color: #979797; letter-spacing: .9px; }
.summary-details-dialog .dialog-heading h2 { font-size: 18px; font-weight: 700; max-width: 1000px; }
.summary-details-dialog .dialog-heading p { margin-top: 6px; }
.summary-details-content > .small { font-size: 13px; }
.summary-detail-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 25px 0; }
.summary-detail-tools .search-field { max-width: none; }
.summary-detail-totals { padding: 8px 2px 13px; font-size: 13px; color: #fff; line-height: 1.8; }
.summary-details-scroll { max-height: 52vh; border: .5px solid #959595; border-radius: 7px; scrollbar-color: #959595 #15161b; }
.summary-details-scroll thead { background: #25262b; z-index: 2; }
.summary-details-scroll th { background: #25262b; color: #fff; font-size: 11px; padding: 10px 20px; border-bottom: .5px solid #959595; }
.summary-details-scroll td { padding: 10px 20px; color: #fff; font-size: 13px; border-bottom: .5px solid rgba(61, 63, 70, .35); }
.summary-details-scroll tbody tr:hover { background: #25262b; }
.summary-details-scroll .detail-main { max-width: 290px; white-space: normal; font-size: 13px; color: #fff; line-height: 1.5; }
.summary-details-scroll .detail-sub { max-width: 290px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: #979797; line-height: 1.5; margin-top: 4px; }
.summary-details-scroll td.negative { color: #fff; }
.summary-details-content > .small:last-child { font-size: 11px; margin-top: 12px; }
.summary-details-content .pagination { padding-left: 0; padding-right: 0; border-top: 0; }

/* Expanded workspace and narrower viewports. */
body.workspace-view.report-wide .sidebar { display: none; }
body.workspace-view.report-wide .workspace { margin-left: 0; width: 100%; }
body.workspace-view.report-wide .main-content { max-width: none; padding-left: 25px; padding-right: 25px; }
body.workspace-view.report-wide .summary-scroll { max-height: 70vh; }
body.workspace-view.report-wide .summary-scroll th.summary-label-head, body.workspace-view.report-wide .summary-scroll td:first-child { min-width: 300px; max-width: 360px; }

@media (max-width: 1250px) {
  .summary-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .summary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-toolbar-secondary { margin-left: 0; }
  .summary-table-actions { gap: 25px; padding-left: 0; }
}
@media (max-width: 900px) {
  .summary-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-fields > .button { grid-column: 1 / -1; }
  .summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-toolbar .search-field { flex-grow: 1; max-width: none; }
  .summary-toolbar-secondary { margin-left: auto; }
  .summary-period-toolbar { flex-wrap: wrap; }
  .summary-inline-label select { max-width: 210px; }
  .summary-scroll th.summary-label-head, .summary-scroll td:first-child { min-width: 225px; max-width: 270px; }
  .summary-detail-tools .search-field { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .summary-control-head { align-items: flex-start; gap: 10px; }
  #view-summary .summary-control-head > .button { padding: 0; max-width: 100px; white-space: normal; }
  .summary-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-fields .field label { white-space: normal; }
  .summary-fields input, .summary-fields select { min-height: 40px; height: 40px; }
  #view-summary .summary-fields > .button { width: 100%; grid-column: 1 / -1; min-height: 40px; }
  .summary-metrics .metric:last-child { grid-column: 1 / -1; }
  .summary-report .panel-heading { flex-wrap: wrap; gap: 10px; }
  .summary-toolbar .search-field { flex-basis: 100%; }
  .summary-table-actions { gap: 25px; margin-left: auto; flex-wrap: wrap; }
  .summary-toolbar-secondary { gap: 10px; width: 100%; justify-content: space-between; }
  .summary-toolbar-secondary .summary-inline-label { min-width: 0; flex: 1; }
  .summary-toolbar-secondary .summary-inline-label select { width: 100%; max-width: 210px; }
  .summary-period-toolbar > .summary-inline-label { flex-wrap: wrap; gap: 10px; }
  .summary-period-toolbar > .summary-inline-label select { max-width: 220px; }
  .summary-period-pager { flex-wrap: wrap; }
  .summary-scroll { max-height: 65vh; }
  .summary-scroll th.summary-label-head, .summary-scroll td:first-child { min-width: 175px; width: 175px; max-width: 190px; }
  .summary-scroll th { min-width: 118px; }
  .summary-row-label.depth-1 { padding-left: 10px; }
  .summary-row-label.depth-2 { padding-left: 20px; }
  .summary-row-label.depth-3 { padding-left: 30px; }
  .summary-row-label.depth-4 { padding-left: 40px; }
  .summary-report .pagination { gap: 10px; flex-wrap: wrap; }
  .summary-selection-bar { gap: 10px; }
  .summary-detail-tools .summary-inline-label { font-size: 0; gap: 0; }
  .summary-detail-tools .summary-inline-label select { max-width: 155px; }
  .summary-detail-tools .summary-export { margin-left: auto; }
  body.workspace-view.report-wide .main-content { padding-left: 20px; padding-right: 20px; }
  body.workspace-view.report-wide .summary-scroll th.summary-label-head, body.workspace-view.report-wide .summary-scroll td:first-child { min-width: 175px; max-width: 190px; }
}
@media (max-width: 520px) {
  .summary-metrics { grid-template-columns: minmax(0, 1fr); }
  .summary-inline-label select { width: 100%; max-width: 100%; }
}
