.dashboard { --dash-green: #277d6b; --dash-purple: #8a78bb; position: relative; width: 100%; min-width: 0; max-width: 1600px; margin-inline: auto; }
.dash-heading, .dash-actions, .dash-boardbar, .dash-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-heading { margin-bottom: 14px; }
.dash-heading h1 { margin: 0; font-size: clamp(27px, 3vw, 35px); font-weight: 680; letter-spacing: -1px; }
.dash-eyebrow { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.7px; margin: 0 0 5px; }
.dash-actions { justify-content: flex-end; gap: 9px; }
.dashboard label { min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.dashboard select, .dashboard input:not([type=checkbox]) { background: var(--surface, var(--white)); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; max-width: 100%; }
.dash-boardbar { padding: 10px 0 14px; border-top: 1px solid var(--line); }
.dash-boardbar > span { color: var(--muted); font-size: 12px; }
.dash-boardbar select { min-width: 160px; max-width: min(360px, 60vw); font-weight: 650; }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.dash-card { position: relative; min-width: 0; background: var(--surface, var(--white)); border: 1px solid var(--line); border-radius: 17px; padding: 21px; box-shadow: 0 4px 14px #142d4a04; display: flex; flex-direction: column; overflow: hidden; }
.dash-wide { grid-column: span 2; }
.dash-card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
.dash-card h2 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.dash-value { font-size: clamp(23px, 2.25vw, 34px); font-weight: 660; line-height: 1.2; letter-spacing: -1px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; margin-block: 2px 23px; }
.dash-warning { color: #bd5945; }
.dash-stat-footer { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dash-stat-footer .button { font-size: 12px; min-height: 32px; padding: 5px 10px; box-shadow: none; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 11px; margin-bottom: 20px; }
.dash-legend span { display: flex; align-items: center; gap: 6px; }
.dash-legend i { width: 8px; height: 8px; border-radius: 2px; }
.dash-series-0 { background: var(--blue); }
.dash-series-1 { background: var(--dash-green); }
.dash-chart { height: 170px; display: flex; gap: 11px; margin-top: auto; }
.dash-month { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: stretch; gap: 9px; text-align: center; font-size: 10px; color: var(--muted); }
.dash-bars { display: flex; flex: 1; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent calc(33.33% - 1px), var(--line) calc(33.33% - 1px), var(--line) 33.33%); }
.dash-bar { width: 30%; max-width: 32px; border-radius: 4px 4px 0 0; opacity: .85; }
.dash-aging, .dash-recent { margin: 0; padding: 0; list-style: none; }
.dash-aging { display: grid; gap: 17px; margin-block: auto; }
.dash-aging li > div:first-child { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 7px; }
.dash-aging small { color: var(--muted); }
.dash-aging strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.dash-track { height: 6px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.dash-track i { display: block; height: 100%; background: var(--dash-purple); border-radius: inherit; }
.dash-recent li + li { border-top: 1px solid var(--line); }
.dash-recent button { width: 100%; display: flex; align-items: start; justify-content: space-between; gap: 15px; text-align: left; background: none; border: 0; border-radius: 6px; padding: 12px 0; }
.dash-recent li:first-child button { padding-top: 0; }
.dash-recent span { min-width: 0; }
.dash-recent span:last-child { max-width: 60%; text-align: right; flex-shrink: 0; overflow-wrap: anywhere; }
.dash-recent strong, .dash-recent small { display: block; }
.dash-recent strong { font-size: 12px; font-weight: 650; }
.dash-recent small { margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.dash-empty { color: var(--muted); text-align: center; padding: 34px 12px; margin: auto 0; font-size: 13px; }
.dash-editor { background: var(--blue-soft); border: 1px solid var(--line); border-radius: 14px; padding: 17px; margin-bottom: 19px; }
.dash-edit-row { justify-content: flex-start; gap: 10px; margin-bottom: 15px; }
.dash-editor fieldset { border: 0; padding: 0; margin: 0; }
.dash-editor legend { font-size: 12px; font-weight: 650; margin-bottom: 10px; }
.dash-toggles { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.dash-toggles label { color: var(--ink); cursor: pointer; }
.dash-toggles input { accent-color: var(--blue); width: 17px; height: 17px; }
.dash-editor > p { color: var(--muted); margin: 14px 0 0; font-size: 12px; }
.dash-widget-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.dash-widget-controls .button { min-height: 32px; padding: 4px 9px; font-size: 11px; }
.dash-card[draggable=true] { border-style: dashed; cursor: grab; }
.dash-card.dash-dragging { opacity: .45; }
/* Clip a block wrapper, not the table: intrinsic table widths must not enlarge the canvas. */
.dashboard .dash-sr { position: absolute; top: 0; left: 0; width: 1px; height: 1px; min-width: 0; max-width: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.dash-heading, .dash-actions, .dash-boardbar, .dash-grid { min-width: 0; max-width: 100%; }
:root[data-theme=dark] .dashboard { --dash-green: #63b69d; --dash-purple: #bba2e6; }
:root[data-theme=dark] .dash-warning { color: #f8a492; }
@media (min-width: 1600px) { .dash-grid { gap: 22px; } .dash-card { padding: 25px; } }
@media (max-width: 1150px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; } .dash-wide { grid-column: span 1; } .dash-card { padding: 18px; } .dash-actions { justify-content: flex-start; } .dash-heading { gap: 18px; } .dash-boardbar > span { display: none; } .dash-edit-row label { flex-direction: column; align-items: stretch; width: 100%; } .dash-edit-row input { width: 100%; } .dash-widget-controls .button { min-height: 44px; min-width: 44px; } .dash-value { font-size: 30px; } .dash-chart { gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .dashboard * { scroll-behavior: auto; } }

.dash-bars.dash-signed { display: block; position: relative; }
.dash-signed::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--muted); opacity: .55; }
.dash-signed .dash-bar { position: absolute; width: 30%; z-index: 1; border-radius: 3px; }
/* UX62 mapping: series 0 = diagonal stripes + solid outline;
   series 1 = dots + dashed outline. The same classes style bars and legend keys.
   Dark charts use dark marks against pastel series fills; light charts use white.
   Forced-colors may remove gradients, so outline styles remain distinct. */
.dashboard { --dash-pattern-ink: #ffffff; --dash-pattern-border: var(--ink,#172237); }
:root[data-theme=dark] .dashboard { --dash-pattern-ink: #142036; }
/* Narratives remain visible; tabular values are available to all readers. */
.dash-chart-summary { margin: 0 0 1rem; color: var(--ink); font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; }
.dash-legend small { color: inherit; }
.dash-series-0 { background-image: repeating-linear-gradient(135deg,transparent 0,transparent 4px,var(--dash-pattern-ink) 4px,var(--dash-pattern-ink) 6px); border: 1px solid var(--dash-pattern-border); }
.dash-series-1 { background-image: radial-gradient(var(--dash-pattern-ink) 1px,transparent 1px); background-size: 5px 5px; border: 1px dashed var(--dash-pattern-border); }
.dash-legend i { width: 20px; height: 16px; flex-shrink: 0; }
.dash-chart-data { margin-top: 1rem; max-width: 100%; }
.dash-chart-data > summary { cursor: pointer; padding: .5rem 0; font-size: .85rem; font-weight: 600; }
.dash-data-scroll { max-width: 100%; overflow-x: auto; margin-top: .75rem; }
.dash-data-scroll table { border-collapse: collapse; width: 100%; font-size: .8rem; }
.dash-data-scroll th,.dash-data-scroll td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.dash-data-scroll th:first-child { text-align: left; }
.dash-data-scroll caption { padding: .5rem; text-align: left; white-space: normal; }
.dash-table-skip { display: inline-block; padding: .5rem 0; }
.dash-after-table { font-size: .75rem; color: var(--muted); }
.dashboard :is(button,input,select,summary,a,[tabindex]):focus-visible { outline: 3px solid var(--blue,#315be8); outline-offset: 3px; }
.dash-edit-row:focus-within,.dash-widget-controls:focus-within { background: var(--soft,#f1f4f9); box-shadow: inset 0 0 0 1px var(--line,#cbd5e1); }
.dash-card:focus-within { border-color: var(--blue,#315be8); }
@media (max-width:620px) { .dash-chart-summary { font-size: .82rem; }.dash-legend { gap:.75rem; }.dash-data-scroll { margin-inline: 0; } }
.dash-bar { box-sizing: border-box; }
.dash-bar.dash-zero { border: 0; min-height: 0; }
.dash-card.dash-keyboard-moving { outline: 2px dashed var(--blue,#315be8); outline-offset: 2px; }
.dash-widget-controls [data-move-widget][aria-pressed="true"] { font-weight: 750; text-decoration: underline; }
.dash-widget-controls [data-move-widget] { white-space: normal; }

/* Pattern contrast must not be diluted by the former decorative bar opacity. */
.dashboard .dash-bar { opacity: 1; }
@media (forced-colors: active) {
  .dashboard .dash-series-0,.dashboard .dash-series-1 { background: Canvas; border-color: CanvasText; forced-color-adjust: auto; }
  .dashboard .dash-series-0 { border-style: solid; }
  .dashboard .dash-series-1 { border-style: dashed; }
  .dashboard .dash-bar.dash-zero { border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard .dash-bar,.dashboard .dash-legend i { animation: none !important; transition: none !important; }
}
