/* Dashboard tool, dynamic rail navigation and contextual editors */
.rail-navigation {
  gap: 14px;
  margin-top: 24px;
  overflow-y: auto;
  scrollbar-width: none;
}

.rail-navigation::-webkit-scrollbar {
  display: none;
}

.rail-tool-navigation,
.rail-context-navigation {
  display: grid;
  gap: 8px;
}

.rail-divider {
  width: 44px;
  height: 1px;
  margin: 2px auto;
  background: #cfd7d4;
}

.app-shell[data-mode="dark"] .rail-divider {
  background: #43504c;
}

.rail-tool-button {
  min-height: 58px;
}

.rail-tool-button .rail-icon {
  font-size: 22px;
}

.shared-theme-note {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.tool-view[hidden] {
  display: none !important;
}

.dashboard-page {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 80px;
  color: #14201d;
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.dashboard-heading > div:last-child {
  min-width: 0;
}

.dashboard-hero-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--dashboard-theme-ink, #fff);
  border: 1px solid color-mix(in srgb, var(--brand-accent-light, var(--brand)) 32%, #dfe6e3);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 24%, transparent);
}

.dashboard-hero-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.dashboard-header h1 {
  margin: 0;
  letter-spacing: -.045em;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.dashboard-header p:last-child {
  margin: 10px 0 0;
  color: #697672;
  font-size: 14px;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  flex: none;
}

.dashboard-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dfe6e3;
  border-radius: 10px;
  background: #fff;
  color: #35433f;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 18px #172c250c;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
  cursor: pointer;
  text-decoration: none;
}

.dashboard-export-button:hover,
.dashboard-export-button:focus-visible {
  border-color: var(--brand-accent-light, var(--brand));
  color: var(--brand-accent-light, var(--brand));
  outline: 0;
  transform: translateY(-1px);
}

.dashboard-export-button:disabled {
  cursor: wait;
  opacity: .66;
  transform: none;
}

.dashboard-export-button img {
  width: 17px;
  height: 17px;
}

.dashboard-excel-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.dashboard-file-type {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 18px;
  padding-inline: 4px;
  border-radius: 4px;
  background: #e7f4ef;
  color: #08765f;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .04em;
}

.dashboard-upload-busy {
  pointer-events: none;
  cursor: wait;
  opacity: .66;
}

.dashboard-excel-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px 13px;
  border: 1px solid #b9ddcf;
  border-radius: 10px;
  background: #edf9f4;
  color: #17624f;
  font-size: 12px;
  font-weight: 650;
}

.dashboard-excel-status[hidden] {
  display: none;
}

.dashboard-excel-status-message {
  flex: 1;
  min-width: 0;
}

.dashboard-excel-status-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  opacity: .72;
}

.dashboard-excel-status-close:hover,
.dashboard-excel-status-close:focus-visible {
  background: color-mix(in srgb, currentColor 10%, transparent);
  outline: 0;
  opacity: 1;
}

.dashboard-excel-status.is-error {
  border-color: #efc4c4;
  background: #fff1f1;
  color: #a62d2d;
}

.dashboard-export-png img {
  opacity: .72;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-kpi-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 112px;
  padding: 16px 30px;
  border: 1px solid #e2e7e5;
  border-radius: 14px;
  background: #fff;
  color: #14201d;
  text-align: left;
  box-shadow: 0 10px 28px #172c2510;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-kpi-card:hover,
.dashboard-widget:hover,
.dashboard-kpi-card:focus-visible,
.dashboard-widget:focus-visible,
.dashboard-kpi-card.is-selected,
.dashboard-widget.is-selected {
  border-color: var(--brand-accent-light, var(--brand));
  outline: 0;
  box-shadow: 0 14px 36px #172c2520, 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
  transform: translateY(-2px);
}

.dashboard-kpi-card.is-themed {
  border-color: color-mix(in srgb, var(--dashboard-theme-ink, #fff) 18%, transparent);
  background: var(--brand);
  color: var(--dashboard-theme-ink, #fff);
}

.dashboard-kpi-card.is-themed:hover,
.dashboard-kpi-card.is-themed:focus-visible,
.dashboard-kpi-card.is-themed.is-selected {
  border-color: #ffffff88;
  box-shadow: 0 16px 38px color-mix(in srgb, var(--brand) 28%, transparent);
}

.dashboard-kpi-card.is-custom {
  border-color: transparent;
  background: var(--dashboard-card-color);
  color: var(--dashboard-card-ink);
}

.dashboard-kpi-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid currentColor;
  border-radius: 15px;
  color: var(--brand-accent-light, var(--brand));
  opacity: .84;
}

.is-themed .dashboard-kpi-icon,
.is-custom .dashboard-kpi-icon {
  color: inherit;
  opacity: 1;
}

.dashboard-kpi-icon .svg-icon {
  --icon-size: 25px;
}

.dashboard-edit-cue {
  position: absolute;
  top: 9px;
  right: 11px;
  color: inherit;
  font-size: 9px;
  opacity: 0;
  transition: opacity .18s ease;
}

.dashboard-kpi-card:hover .dashboard-edit-cue,
.dashboard-kpi-card:focus-visible .dashboard-edit-cue {
  opacity: .65;
}

.dashboard-kpi-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.dashboard-kpi-copy span {
  display: block;
  width: 100%;
  min-width: 0;
  margin-bottom: 7px;
  overflow: hidden;
  color: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: .78;
}

.dashboard-kpi-card.is-themed .dashboard-kpi-copy span,
.dashboard-kpi-card.is-custom .dashboard-kpi-copy span {
  opacity: 1;
}

.dashboard-kpi-copy strong {
  display: block;
  width: 100%;
  overflow: hidden;
  letter-spacing: -.035em;
  font-size: clamp(23px, 1.9vw, 29px);
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: minmax(220px, .84fr) repeat(2, minmax(310px, 1.3fr));
  grid-template-areas:
    "donut-one bar-one bar-two"
    "donut-two bar-three stacked";
  gap: 14px;
}

.dashboard-widget {
  position: relative;
  min-width: 0;
  min-height: 310px;
  padding: 18px;
  border: 1px solid #dce3e0;
  border-radius: 14px;
  background: #fff;
  color: #14201d;
  box-shadow: 0 10px 28px #172c2510;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-widget[data-widget-id="donut-one"] { grid-area: donut-one; }
.dashboard-widget[data-widget-id="bar-one"] { grid-area: bar-one; }
.dashboard-widget[data-widget-id="bar-two"] { grid-area: bar-two; }
.dashboard-widget[data-widget-id="donut-two"] { grid-area: donut-two; }
.dashboard-widget[data-widget-id="bar-three"] { grid-area: bar-three; }
.dashboard-widget[data-widget-id="stacked"] { grid-area: stacked; }

.dashboard-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-bottom: 11px;
  border-bottom: 1px solid #e8edeb;
}

.dashboard-widget-header h2 {
  margin: 0;
  overflow: hidden;
  letter-spacing: -.01em;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-widget-header span {
  color: #75817d;
  font-size: 11px;
  opacity: 0;
  transition: opacity .18s ease;
}

.dashboard-widget:hover .dashboard-widget-header span,
.dashboard-widget:focus-visible .dashboard-widget-header span {
  opacity: 1;
}

.dashboard-donut-layout {
  display: grid;
  align-content: start;
  place-items: center;
  gap: 20px;
  min-height: 245px;
  padding-top: 16px;
}

.dashboard-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 178px;
  height: 178px;
  border-radius: 50%;
}

.dashboard-donut::after {
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.dashboard-donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  color: #14201d;
}

.dashboard-donut-center strong {
  font-size: 21px;
}

.dashboard-donut-center span {
  color: #75817d;
  font-size: 9px;
}

.dashboard-donut-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 12px;
}

.dashboard-donut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #66736f;
  font-size: 9px;
}

.dashboard-donut-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dashboard-bars-shell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 245px;
  padding-top: 17px;
}

.dashboard-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 8px 29px 0;
  color: #7d8985;
  text-align: right;
  font-size: 9px;
}

.dashboard-bars-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 29px;
  min-width: 0;
  min-height: 0;
}

.dashboard-bars-plot {
  position: relative;
  display: flex;
  align-items: end;
  gap: clamp(4px, 1vw, 10px);
  min-width: 0;
  min-height: 0;
  padding: 0 5px;
  background: repeating-linear-gradient(to bottom, #e6ebe9 0 1px, transparent 1px calc(25% - .25px));
  border-bottom: 1px solid #dfe5e2;
}

.dashboard-bar-item {
  display: flex;
  flex: 1 1 0;
  align-items: end;
  min-width: 0;
  height: 100%;
}

.dashboard-bar-item > i {
  position: relative;
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 1px 1px;
  background: var(--bar-color);
  transition: height .24s ease;
}

.dashboard-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  z-index: 2;
  padding: 1px 3px;
  border-radius: 4px;
  background: #fff;
  color: #52615c;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateX(-50%);
}

.dashboard-x-axis {
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(0, 1fr));
  gap: clamp(4px, 1vw, 10px);
  min-width: 0;
  padding: 8px 5px 0;
}

.dashboard-x-axis span {
  display: block;
  min-width: 0;
  overflow: hidden;
  width: 100%;
  color: #697672;
  font-size: 8px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-horizontal-chart {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 245px;
  padding: 18px 6px 4px;
}

.dashboard-horizontal-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.dashboard-horizontal-row > span {
  overflow: hidden;
  color: #61706b;
  font-size: 9px;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-horizontal-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: #f0f3f2;
}

.dashboard-horizontal-track i {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: 6px;
  background: var(--bar-color);
  transition: width .24s ease;
}

.dashboard-horizontal-track strong {
  position: absolute;
  top: 50%;
  color: #34433e;
  font-size: 9px;
  line-height: 1;
  transform: translateY(-50%);
}

.dashboard-gauge-layout {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 245px;
  padding-top: 14px;
}

.dashboard-gauge-visual {
  position: relative;
  width: min(220px, 92%);
  height: 210px;
  overflow: hidden;
}

.dashboard-gauge-arc {
  position: absolute;
  top: 0;
  left: 50%;
  width: 220px;
  height: 220px;
  max-width: 100%;
  border-radius: 50%;
  background: conic-gradient(from 240deg, var(--dashboard-chart-color, var(--brand)) 0 var(--gauge-actual-angle), #e6ece9 var(--gauge-actual-angle) 240deg, transparent 240deg);
  transform: translateX(-50%);
}

.dashboard-gauge-arc::after {
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.dashboard-gauge-target-marker {
  position: absolute;
  top: 110px;
  left: 50%;
  z-index: 3;
  width: 110px;
  height: 3px;
  background: linear-gradient(to right, transparent 0 77px, #3f4a47 77px 110px);
  transform: rotate(var(--gauge-target-marker-angle));
  transform-origin: 0 50%;
}

.dashboard-gauge-target-value {
  position: absolute;
  z-index: 5;
  padding: 0;
  background: transparent;
  color: #687671;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(var(--gauge-target-label-rotation));
  transform-origin: center;
}

.dashboard-gauge-value {
  position: absolute;
  top: 82px;
  left: 50%;
  z-index: 4;
  display: grid;
  justify-items: center;
  line-height: 1.05;
  transform: translateX(-50%);
}

.dashboard-gauge-value strong {
  color: #14201d;
  font-size: 34px;
  letter-spacing: -.025em;
}

.dashboard-gauge-min,
.dashboard-gauge-max {
  position: absolute;
  bottom: 20px;
  color: #77837f;
  font-size: 9px;
  font-weight: 650;
}

.dashboard-gauge-min {
  left: 10px;
}

.dashboard-gauge-max {
  right: 10px;
}

.dashboard-gauge-summary {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 2px;
}

.dashboard-gauge-summary span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #52615c;
  white-space: nowrap;
}

.dashboard-gauge-summary i {
  display: inline-block;
  flex: 0 0 auto;
}

.dashboard-gauge-summary i.is-actual {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dashboard-chart-color, var(--brand));
}

.dashboard-gauge-summary i.is-target {
  width: 13px;
  height: 3px;
  background: #26332f;
}

.dashboard-gauge-summary small {
  font-size: 8px;
  font-weight: 650;
}

.dashboard-gauge-summary strong {
  font-size: 9px;
  font-weight: 800;
}

.dashboard-line-shell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 245px;
  padding-top: 17px;
}

.dashboard-line-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 29px;
  min-width: 0;
  min-height: 0;
}

.dashboard-line-plot {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.dashboard-line-plot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dashboard-line-export-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.dashboard-area-value {
  position: absolute;
  z-index: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .9);
  color: #52615c;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - var(--label-lift, 13px)));
}

.dashboard-matrix-wrap {
  min-height: 245px;
  padding-top: 10px;
  overflow: auto;
}

.dashboard-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #52615c;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

.dashboard-matrix-table th,
.dashboard-matrix-table td {
  height: 16px;
  padding: 2px 6px;
  border-right: 1px solid #e8eeeb;
  border-bottom: 1px solid #e8eeeb;
  text-align: right;
  white-space: nowrap;
}

.dashboard-matrix-table th:first-child {
  text-align: left;
}

.dashboard-matrix-table thead th {
  height: 20px;
  background: color-mix(in srgb, var(--dashboard-chart-color, var(--brand)) 11%, white);
  color: #25332f;
  font-weight: 800;
}

.dashboard-matrix-table tbody th {
  color: #34433e;
  font-weight: 700;
}

.dashboard-matrix-table .is-total,
.dashboard-matrix-table tfoot th,
.dashboard-matrix-table tfoot td {
  background: #f3f6f4;
  color: #25332f;
  font-weight: 800;
}

.dashboard-matrix-table thead th:first-child {
  border-top-left-radius: 7px;
}

.dashboard-matrix-table thead th:last-child {
  border-top-right-radius: 7px;
}

.dashboard-stacked-item > i {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  background: transparent;
}

.dashboard-stacked-item b {
  display: block;
  min-height: 1px;
}

.dashboard-empty-chart {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: #77837f;
  font-size: 12px;
  text-align: center;
}

.dashboard-editor-section {
  padding-bottom: 32px;
}

.dashboard-editor-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-editor-toolbar p {
  margin: 0 0 4px;
  color: var(--brand-accent, var(--brand));
  letter-spacing: .12em;
  font-size: 9px;
  font-weight: 800;
}

.dashboard-editor-toolbar h2 {
  margin: 0;
  letter-spacing: -.025em;
  font-size: 18px;
}

.dashboard-editor-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 19px;
}

.dashboard-editor-close:hover {
  border-color: var(--brand-accent, var(--brand));
  color: var(--brand-accent, var(--brand));
}

.dashboard-editor-form {
  display: grid;
  gap: 14px;
}

.dashboard-editor-form .field {
  gap: 6px;
}

.dashboard-editor-form .field input {
  min-height: 42px;
}

.dashboard-editor-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.dashboard-editor-subheading strong {
  font-size: 12px;
}

.dashboard-editor-subheading small,
.dashboard-editor-help {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-editor-help {
  margin: 0;
  line-height: 1.5;
}

.dashboard-card-color-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dashboard-card-color {
  position: relative;
  width: 33px;
  height: 33px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--option-color);
  box-shadow: 0 0 0 1px var(--line);
}

.dashboard-card-color.active {
  box-shadow: 0 0 0 2px var(--ink);
}

.dashboard-card-color[data-card-color="white"]::after {
  position: absolute;
  inset: 8px;
  border: 1px solid #cfd8d5;
  border-radius: 50%;
  content: "";
}

.dashboard-card-color[data-card-color="theme"] {
  background: var(--brand);
}

.dashboard-editor-icons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-editor-icon {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
}

.dashboard-editor-icon:hover,
.dashboard-editor-icon.active {
  border-color: var(--brand-accent, var(--brand));
  color: var(--brand-accent, var(--brand));
  box-shadow: inset 0 0 0 1px var(--brand-accent, var(--brand));
}

.dashboard-editor-icon .svg-icon {
  --icon-size: 19px;
}

.dashboard-data-editor {
  margin-top: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.dashboard-data-header,
.dashboard-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .78fr) 32px;
  gap: 5px;
  align-items: center;
}

.dashboard-data-header.stacked,
.dashboard-data-row.stacked {
  grid-template-columns: minmax(75px, 1fr) repeat(var(--series-count, 3), minmax(58px, .7fr)) 30px;
  min-width: calc(125px + var(--series-count, 3) * 62px);
}

.dashboard-data-header {
  padding: 9px 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.dashboard-data-row {
  padding: 5px;
  border-top: 1px solid var(--line);
}

.dashboard-data-row input {
  min-width: 0;
  width: 100%;
  height: 35px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
  outline: 0;
  font-size: 10px;
}

.dashboard-data-row input:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.dashboard-remove-row {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 16px;
}

.dashboard-remove-row:hover {
  background: #fdeaea;
  color: #c33131;
}

.dashboard-series-editor {
  display: grid;
  gap: 8px;
}

.dashboard-series-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: end;
}

.dashboard-series-row .field {
  min-width: 0;
}

.dashboard-remove-series {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 17px;
}

.dashboard-remove-series:hover:not(:disabled) {
  border-color: #edb9b9;
  background: #fdeaea;
  color: #c33131;
}

.dashboard-remove-series:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.dashboard-add-series {
  width: 100%;
}

.dashboard-add-row,
.dashboard-editor-done {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-add-row:hover {
  border-color: var(--brand-accent, var(--brand));
  color: var(--brand-accent, var(--brand));
}

.dashboard-editor-done {
  margin-top: 4px;
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink, #fff);
}

.dashboard-export-stage {
  position: fixed;
  top: 0;
  left: -20000px;
  z-index: -1;
  width: 1500px;
  padding: 0;
  background: #edf2ef;
  pointer-events: none;
}

.dashboard-export-stage .dashboard-page {
  display: block !important;
  width: 1500px;
  margin: 0;
  padding: 38px 36px 42px;
  background: #edf2ef;
}

.dashboard-export-stage .dashboard-header {
  margin-bottom: 24px;
}

.dashboard-export-stage .dashboard-header-actions {
  display: none;
}

.dashboard-export-stage .dashboard-excel-status {
  display: none !important;
}

.dashboard-export-stage .dashboard-kpi-card,
.dashboard-export-stage .dashboard-widget {
  transform: none !important;
}

.dashboard-kpi-export-image {
  display: block;
  width: 100%;
  height: 112px;
  border-radius: 14px;
  object-fit: fill;
}

.dashboard-export-stage .dashboard-kpi-card {
  position: relative;
  display: block;
  height: 112px;
  min-height: 112px;
  overflow: hidden;
}

.dashboard-export-stage .dashboard-kpi-copy {
  position: absolute;
  top: 24px;
  right: 30px;
  left: 98px;
  display: flex;
}

.dashboard-export-stage .dashboard-kpi-copy span {
  margin-bottom: 5px;
  line-height: 1.3;
}

.dashboard-export-stage .dashboard-kpi-copy strong {
  line-height: 1.15;
}

.dashboard-export-stage .dashboard-widget-header {
  display: block;
  min-height: 38px;
  padding-top: 2px;
  overflow: visible;
}

.dashboard-export-stage .dashboard-widget-header h2 {
  display: block;
  overflow: visible;
  line-height: 1.45;
}

.dashboard-export-stage .dashboard-widget-header > span {
  display: none;
}

.dashboard-export-stage .dashboard-horizontal-row > span {
  overflow: visible;
  line-height: 1;
}

.dashboard-export-stage .dashboard-matrix-table th,
.dashboard-export-stage .dashboard-matrix-table td {
  vertical-align: middle;
  line-height: 1;
}

.dashboard-export-stage .dashboard-export-text {
  display: inline-block;
  line-height: 1;
  transform: translateY(-1.5px);
}

.dashboard-export-stage .dashboard-donut {
  background-color: transparent !important;
}

/* Dashboard keeps its reporting cards white in dark mode; only the surrounding
   workspace adopts the dark palette. */
.app-shell[data-mode="dark"] .dashboard-page {
  color: var(--ink);
}

.app-shell[data-mode="dark"] .dashboard-header h1 {
  color: var(--ink);
}

.app-shell[data-mode="dark"] .dashboard-header p:last-child {
  color: var(--muted);
}

@container (max-width: 1120px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "donut-one bar-one"
      "bar-two donut-two"
      "bar-three stacked";
  }
}

@container (max-width: 720px) {
  .dashboard-page {
    width: min(100% - 32px, 1500px);
    padding-top: 26px;
  }

  .dashboard-header {
    align-items: start;
  }

  .dashboard-header-actions {
    gap: 7px;
  }

  .dashboard-export-button {
    padding-inline: 10px;
  }

  .dashboard-kpi-grid,
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "donut-one"
      "bar-one"
      "bar-two"
      "donut-two"
      "bar-three"
      "stacked";
  }
}

@media (max-width: 1350px) {
  .dashboard-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .dashboard-header-actions {
    margin-left: 76px;
  }
}

@media (max-width: 600px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    display: grid;
  }

  .dashboard-header-actions {
    justify-content: start;
    margin-left: 0;
  }

  .dashboard-header h1 {
    font-size: 28px;
  }

  .dashboard-heading {
    align-items: flex-start;
    gap: 14px;
  }

  .dashboard-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }

  .dashboard-hero-icon svg {
    width: 25px;
    height: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-kpi-card,
  .dashboard-widget,
  .dashboard-bar-item > i {
    transition: none;
  }
}
