/* Painel operacional: todas as regras são locais ao dashboard. */
.dash-page {
  --dash-teal: #168576;
  --dash-teal-soft: #eaf6f2;
  --dash-red: var(--red-ink, #b6383a);
  --dash-amber: var(--orange-ink, #946000);
  display: grid;
  gap: 22px;
  min-width: 0;
  color: var(--label);
}
.dash-page *, .dash-page *::before, .dash-page *::after { box-sizing: border-box; }
.dash-page h1, .dash-page h2, .dash-page p { margin: 0; }
.dash-page ul { list-style: none; padding: 0; margin: 0; }
.dash-page button { -webkit-tap-highlight-color: transparent; }
.dash-page button:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }
.dash-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; padding: 2px 0 4px; }
.dash-eyebrow { display: block; margin-bottom: 8px; color: var(--label3); font-size: 11px; font-weight: 650; letter-spacing: .095em; }
.dash-heading h1 { color: var(--heading, var(--label)); font-size: clamp(25px, 2.4vw, 32px); line-height: 1.16; font-weight: 650; letter-spacing: -.045em; }
.dash-heading p { margin-top: 9px; max-width: 460px; color: var(--label2); font-size: 13px; line-height: 1.6; }
.dash-heading-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 13px; flex-shrink: 0; }
.dash-date { display: flex; align-items: center; gap: 7px; color: var(--label2); font-size: 12px; white-space: nowrap; }
.dash-date .ico { width: 15px; height: 15px; }
.dash-action-group { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-action-group .btn { min-height: 42px; font-size: 12px; padding: 10px 14px; }
.dash-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dash-metric {
  display: flex; flex-direction: column; align-items: stretch; min-width: 0; margin: 0;
  padding: 18px 18px 0; text-align: left; color: var(--label); font-family: inherit;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  box-shadow: 0 2px 4px rgba(15, 33, 60, .018); overflow: hidden;
}
.dash-metric:not(button) { padding-bottom: 18px; }
.dash-metric-action { cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease; }
.dash-metric-action:hover { border-color: color-mix(in srgb, var(--acento) 42%, var(--hairline)); box-shadow: 0 4px 16px rgba(15, 33, 60, .06); }
.dash-metric-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 32px; }
.dash-metric-label { color: var(--label2); font-size: 12px; line-height: 1.4; font-weight: 550; }
.dash-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; background: var(--dash-tone-soft); color: var(--dash-tone); }
.dash-icon .ico { width: 18px; height: 18px; }
.dash-tone-blue { --dash-tone: var(--acento); --dash-tone-soft: var(--blue-bg); }
.dash-tone-teal { --dash-tone: var(--dash-teal); --dash-tone-soft: var(--dash-teal-soft); }
.dash-tone-red { --dash-tone: var(--dash-red); --dash-tone-soft: var(--red-bg); }
.dash-tone-amber { --dash-tone: var(--dash-amber); --dash-tone-soft: var(--orange-bg); }
.dash-metric-value { display: block; margin: 15px 0 7px; color: var(--heading, var(--label)); font-size: 34px; font-weight: 650; line-height: 1.12; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.dash-metric-money { font-size: clamp(19px, 1.8vw, 28px); white-space: nowrap; min-height: 38px; display: flex; align-items: center; letter-spacing: -.04em; }
.dash-metric-description { color: var(--label3); font-size: 11px; line-height: 1.6; min-height: 34px; margin-bottom: 10px; }
.dash-metric-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: auto -18px 0; padding: 10px 18px; min-height: 40px; border-top: 1px solid var(--hairline); font-size: 11px; font-weight: 550; color: var(--label2); }
.dash-metric-link .ico { width: 12px; height: 12px; color: var(--label3); }
.dash-metric-action:hover .dash-metric-link { color: var(--acento); }
.dash-main-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 20px; }
.dash-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-panel { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: 0 2px 4px rgba(15, 33, 60, .018); }
.dash-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.dash-panel-heading h2 { display: flex; align-items: center; gap: 8px; color: var(--heading, var(--label)); font-size: 15px; font-weight: 650; line-height: 1.35; letter-spacing: -.018em; }
.dash-panel-heading p { margin-top: 5px; color: var(--label3); font-size: 12px; line-height: 1.5; }
.dash-heading-icon { color: var(--label3); flex: 0 0 20px; width: 20px; height: 20px; }
.dash-period { padding: 7px 10px; border: 1px solid var(--hairline); border-radius: 7px; color: var(--label2); font-size: 11px; white-space: nowrap; }
.dash-flow-totals { display: flex; gap: 34px; margin-bottom: 28px; }
.dash-flow-totals > div { min-width: 0; }
.dash-flow-totals > div > span { display: flex; gap: 7px; align-items: center; color: var(--label2); font-size: 11px; line-height: 1.5; }
.dash-flow-totals strong { display: block; margin-top: 7px; color: var(--heading, var(--label)); font-size: clamp(16px, 1.45vw, 22px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dash-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; }
.dash-dot-teal, .dash-segment-teal { background: var(--dash-teal); }
.dash-dot-blue { background: var(--acento); }
.dash-dot-amber, .dash-segment-amber { background: var(--dash-amber); }
.dash-dot-red, .dash-segment-red { background: var(--dash-red); }
.dash-chart-wrap { min-width: 0; margin: 0 -4px; }
.dash-chart-wrap .chart-legend { display: none; }
.dash-chart-wrap .chart-plot { padding-left: 46px; gap: 12px; }
.dash-chart-wrap .chart-grid { left: 46px; }
.dash-chart-wrap .chart-grid b, .dash-chart-wrap .bar-x { font-size: 11px; color: var(--label3); }
.dash-chart-wrap .bar { max-width: 24px; border-radius: 4px 4px 0 0; box-shadow: none; }
.dash-chart-wrap .bar-group { gap: 5px; }
.dash-chart-note { border-top: 1px solid var(--hairline); margin-top: 19px; padding-top: 13px; color: var(--label3); font-size: 11px; line-height: 1.6; }
.dash-health { display: flex; flex-direction: column; }
.dash-health-overview { display: flex; align-items: center; gap: 17px; margin: 10px 0 23px; }
.dash-health-overview > strong { color: var(--heading, var(--label)); font-size: 48px; font-weight: 650; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.dash-health-overview > strong > span { margin-left: 3px; font-size: 26px; font-weight: 500; color: var(--label3); }
.dash-health-overview > span { color: var(--label2); font-size: 12px; line-height: 1.6; }
.dash-composition { display: flex; gap: 3px; height: 12px; border-radius: 4px; overflow: hidden; background: var(--fill); }
.dash-composition > span { min-width: 2px; height: 100%; }
.dash-health-list { margin: 17px 0 24px !important; }
.dash-health-list li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 12px; }
.dash-health-list li + li { border-top: 1px solid var(--hairline); }
.dash-health-list li > span { display: flex; align-items: center; gap: 9px; color: var(--label2); }
.dash-health-list strong { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.dash-health-footer { display: grid; gap: 5px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--hairline); color: var(--label2); font-size: 12px; line-height: 1.6; }
.dash-text-link { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-start; flex-shrink: 0; min-height: 34px; padding: 0; background: transparent; border: 0; color: var(--acento); font-family: inherit; font-size: 11px; font-weight: 550; line-height: 1.4; cursor: pointer; text-align: left; }
.dash-text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dash-text-link .ico { width: 12px; height: 12px; }
.dash-bottom-grid .dash-panel-heading { margin-bottom: 13px; }
.dash-activity-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; min-height: 73px; }
.dash-activity-row + .dash-activity-row, .dash-critical-list li + li { border-top: 1px solid var(--hairline); }
.dash-activity-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; color: var(--dash-tone); background: var(--dash-tone-soft); }
.dash-activity-icon .ico { width: 18px; height: 18px; }
.dash-row-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.dash-row-title { color: var(--label); font-size: 12px; font-weight: 550; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dash-row-sub { color: var(--label3); font-size: 11px; font-weight: 400; line-height: 1.4; }
.dash-row-sub > span { padding: 0 3px; }
.dash-row-quantity { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--label); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-row-quantity small { color: var(--label3); font-size: 11px; font-weight: 400; }
.dash-count { display: inline-flex; justify-content: center; align-items: center; min-width: 23px; min-height: 23px; padding: 2px 6px; border-radius: 6px; background: var(--red-bg); color: var(--dash-red); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-critical-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 73px; padding: 13px 0; text-align: left; border: 0; background: transparent; font-family: inherit; }
button.dash-critical-row { cursor: pointer; }
button.dash-critical-row:hover .dash-row-title { color: var(--acento); }
.dash-critical-stock { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: 0 0 auto; }
.dash-status { display: inline-flex; align-items: center; min-height: 22px; padding: 4px 7px; border-radius: 5px; font-size: 10px; font-weight: 550; line-height: 1.1; white-space: nowrap; }
.dash-status-red { color: var(--dash-red); background: var(--red-bg); }
.dash-status-amber { color: var(--dash-amber); background: var(--orange-bg); }
.dash-row-chevron { width: 11px; height: 11px; flex: 0 0 11px; color: var(--label3); }
.dash-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; min-height: 260px; padding: 32px 18px; text-align: center; color: var(--label2); }
.dash-empty > .ico { width: 28px; height: 28px; margin-bottom: 6px; color: var(--label3); }
.dash-empty strong { font-size: 13px; font-weight: 600; }
.dash-empty p { max-width: 320px; color: var(--label3); font-size: 12px; line-height: 1.6; }
.dash-chart-empty { min-height: 248px; }
:root[data-theme="dark"] .dash-page { --dash-teal: #5cbdad; --dash-teal-soft: rgba(92, 189, 173, .12); }
@media (max-width: 1200px) {
  .dash-heading { align-items: flex-start; }
  .dash-heading-actions { max-width: 260px; }
  .dash-action-group { justify-content: flex-end; }
  .dash-metrics { gap: 12px; }
  .dash-metric { padding: 15px 14px 0; }
  .dash-metric-top { gap: 6px; }
  .dash-metric-label { font-size: 11px; }
  .dash-metric-link { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .dash-panel { padding: 19px; }
  .dash-main-grid { grid-template-columns: minmax(0, 1.75fr) minmax(250px, 1fr); gap: 16px; }
  .dash-bottom-grid { gap: 16px; }
  .dash-critical-row { gap: 8px; }
  .dash-flow-totals { gap: 24px; }
}
@media (max-width: 1050px) {
  .dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-metric-money { font-size: 27px; }
  .dash-metric-description { min-height: 20px; }
  .dash-main-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-health { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1fr); column-gap: 28px; }
  .dash-health .dash-panel-heading { grid-column: 1 / -1; margin-bottom: 8px; }
  .dash-health-overview { grid-column: 1; margin: 15px 0 20px; }
  .dash-composition { grid-column: 1; }
  .dash-health-list { grid-column: 2; grid-row: 2 / 4; margin: 0 0 14px !important; }
  .dash-health-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .dash-bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-flow-totals strong { font-size: 22px; }
}
@media (max-width: 600px) {
  .dash-page { gap: 17px; }
  .dash-heading { flex-direction: column; gap: 16px; }
  .dash-heading h1 { font-size: 28px; }
  .dash-heading p { font-size: 12px; }
  .dash-heading-actions { align-items: flex-start; max-width: none; width: 100%; gap: 12px; }
  .dash-date { font-size: 11px; }
  .dash-action-group { width: 100%; justify-content: flex-start; gap: 8px; }
  .dash-action-group:empty { display: none; }
  .dash-action-group .btn { flex: 1; min-height: 44px; font-size: 11px; padding: 10px 8px; white-space: nowrap; }
  .dash-metrics { gap: 10px; }
  .dash-metric { padding: 14px 12px 0; border-radius: 13px; }
  .dash-metric-top { align-items: flex-start; min-height: 34px; }
  .dash-metric-label { font-size: 11px; }
  .dash-icon { flex-basis: 27px; width: 27px; height: 27px; border-radius: 8px; }
  .dash-icon .ico { width: 16px; height: 16px; }
  .dash-metric-value { font-size: 29px; margin-top: 12px; }
  .dash-metric-money { font-size: clamp(14px, 4.25vw, 24px); min-height: 32px; }
  .dash-metric-description { min-height: 36px; line-height: 1.55; }
  .dash-metric-link { min-height: 44px; margin-left: -12px; margin-right: -12px; padding: 9px 12px; font-size: 11px; gap: 4px; }
  .dash-metric-link .ico { flex: 0 0 10px; width: 10px; height: 10px; }
  .dash-panel { padding: 17px; border-radius: 14px; }
  .dash-panel-heading { gap: 10px; margin-bottom: 18px; }
  .dash-panel-heading h2 { font-size: 14px; }
  .dash-panel-heading p { font-size: 11px; }
  .dash-period { padding: 6px 8px; font-size: 11px; }
  .dash-flow-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
  .dash-flow-totals strong { font-size: clamp(15px, 4.3vw, 21px); white-space: nowrap; }
  .dash-flow-totals > div > span { gap: 6px; font-size: 11px; }
  .dash-chart-wrap { margin-left: -6px; margin-right: -4px; }
  .dash-chart-wrap .chart-plot { padding-left: 40px; gap: 5px; height: 218px !important; }
  .dash-chart-wrap .chart-grid { left: 40px; }
  .dash-chart-wrap .bar-group { gap: 3px; }
  .dash-chart-wrap .bar { width: 36%; min-width: 5px; max-width: 15px; border-radius: 3px 3px 0 0; }
  .dash-chart-wrap .chart-grid b, .dash-chart-wrap .bar-x { font-size: 11px; }
  .dash-health { display: flex; }
  .dash-health-overview { margin: 23px 0; gap: 22px; }
  .dash-health-overview > strong { font-size: 52px; }
  .dash-health-list { margin: 15px 0 14px !important; }
  .dash-health-footer { display: block; }
  .dash-health-footer .dash-text-link { display: flex; margin-top: 3px; }
  .dash-text-link { min-height: 44px; font-size: 11px; }
  .dash-bottom-grid .dash-panel-heading { align-items: center; margin-bottom: 6px; }
  .dash-activity-row { gap: 9px; padding: 13px 0; }
  .dash-activity-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
  .dash-row-title { font-size: 11px; }
  .dash-critical-row { gap: 8px; }
  .dash-critical-stock { max-width: 110px; }
  .dash-critical-stock .dash-row-sub { font-size: 11px; text-align: right; }
  .dash-row-chevron { display: none; }
  .dash-status { font-size: 11px; padding: 4px 6px; }
  .dash-empty { min-height: 220px; padding: 26px 10px; }
}
@media (prefers-reduced-motion: reduce) { .dash-metric-action { transition: none; } }
