.product-preview {
  padding-bottom: 65px;
}
.dashboard-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: white;
  border: 1px solid #d7dfda;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 55px -30px #1d332c38;
}
.dashboard-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dashboard-toolbar {
  min-height: 62px;
  padding: 18px 27px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid #e6e9e7;
}
.dashboard-toolbar strong {
  color: var(--ink);
  font-weight: 500;
}
.dashboard-toolbar > span > span {
  color: #6a716b;
  margin-inline: 13px;
}
.sync-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.sync-note::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #648570;
}
.dashboard-content {
  flex: 1;
  padding: 27px;
  background: #fbfcfb;
}
.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.dashboard-heading h2 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-wrap: initial;
}
.dashboard-heading p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 7px;
}
.sample-period {
  padding: 9px 12px;
  border: 1px solid #dce3de;
  background: #fff;
  border-radius: 5px;
  color: #515c55;
  font-size: 14px;
  white-space: nowrap;
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.dashboard-kpis > div {
  min-width: 0;
  border: 1px solid #e1e6e2;
  background: #fff;
  border-radius: 7px;
  padding: 17px 15px 15px;
}
.dashboard-kpis dt {
  font-size: 14px;
  min-height: 2.8em;
  line-height: 1.4;
  color: #5d665f;
}
.dashboard-kpis dd {
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-kpis dd > span {
  font-size: 21px;
}
.dashboard-kpis .kpi-note {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  white-space: normal;
  color: #646d67;
  margin-top: 7px;
  line-height: 1.4;
}
.detail-dashboard {
  min-width: 0;
  align-self: center;
}
.detail-dashboard figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.detail-screen {
  border: 1px solid #dce3dd;
  background: #fff;
  border-radius: 9px;
  padding: 24px;
  box-shadow: 0 12px 32px -24px #1d332c40;
}
.detail-screen-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}
.screen-breadcrumb {
  color: #657069;
  font-size: 14px;
}
.detail-screen h4 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
  margin: 6px 0 0;
}
.screen-period {
  border: 1px solid #dce3de;
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  color: #626d65;
}

@media (max-width: 1100px) {
  .detail-screen {
    padding: 20px;
  }
  .detail-screen-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}
@media (max-width: 800px) {
  .detail-dashboard {
    width: 100%;
    max-width: 620px;
    margin-top: 12px;
  }
}
@media (max-width: 520px) {
  .detail-screen {
    padding: 20px 16px;
  }
}
.dashboard-kpis .profit-kpi {
  background: #f0f7f2;
  border-color: #cfded3;
}
.profit-kpi dd {
  color: #2c6046;
}
.dashboard-panels {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.screen-panel {
  background: white;
  border: 1px solid #e1e6e2;
  border-radius: 7px;
  padding: 20px;
  min-width: 0;
}
.panel-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 14px;
}
.panel-title h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.panel-title > span {
  font-size: 14px;
  color: var(--muted);
}
.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.panel-stack .outcomes-panel {
  margin-top: 0;
}
.chart-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-key i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #477c5d;
}
.chart-key .key-open {
  margin-left: 10px;
}
.chart-key .key-open,
.day-bar.is-open {
  background: repeating-linear-gradient(135deg, #477c5d 0 2px, #c3d8ca 2px 5px);
}
.sales-chart {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}
.chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 296px;
  font-size: 14px;
  color: #67706a;
}
.chart-plot {
  position: relative;
  flex: 1;
  min-width: 0;
}
.chart-gridlines {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  inset: 0 0 auto;
  height: 296px;
  pointer-events: none;
}
.chart-gridlines i {
  display: block;
  border-top: 1px dashed #e4e9e5;
}
.day-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  height: 296px;
}
.day-bar {
  display: block;
  background: #477c5d;
  border-radius: 2px 2px 0 0;
}
.chart-range {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 14px;
  color: #626d65;
}
.source-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid #d4dcd6;
  border-radius: 3px;
  background: #f4f6f5;
  color: #4c5750;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.source-rule,
.source-entered {
  border-color: #d5e0e6;
  background: #eff4f7;
  color: #3c5e73;
}
.source-mixed,
.source-estimate {
  border-color: #efd8c8;
  background: #fcf1e9;
  color: #88502c;
}
.screen-margin-list {
  margin-top: 18px;
  font-size: 14px;
}
.screen-margin-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-block: 9px;
  line-height: 1.4;
}
.screen-margin-list dt {
  color: #69716c;
}
.screen-margin-list dd {
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.screen-margin-list .screen-subtotal {
  border-top: 1px solid #e6eae7;
}
.screen-subtotal dt {
  color: #343f37;
  font-weight: 500;
}
.screen-margin-list .screen-net {
  background: #e7f1ea;
  margin: 8px -8px -4px;
  padding: 12px 8px;
  border-radius: 3px;
}
.screen-net dt,
.screen-net dd {
  color: #2b5e43;
  font-weight: 600;
}
.outcomes-panel {
  margin-top: 16px;
}
.outcomes-track {
  display: flex;
  gap: 3px;
  height: 8px;
  overflow: hidden;
  border-radius: 3px;
  margin-top: 20px;
}
.outcomes-kept {
  width: 40.5%;
  background: #6f9d7f;
}
.outcomes-returned {
  width: 18.6%;
  background: #d8a07c;
}
.outcomes-open {
  width: 40.9%;
  background: repeating-linear-gradient(135deg, #6f9d7f 0 2px, #cfe0d4 2px 5px);
}
.outcomes-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 28px;
  margin-top: 15px;
  font-size: 14px;
  color: #626d65;
}
.outcomes-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.outcomes-legend strong {
  color: #36473b;
  font-variant-numeric: tabular-nums;
}
.outcomes-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}
.outcomes-new {
  width: 61%;
  background: #315d79;
}
.outcomes-repeat {
  width: 39%;
  background: #a5bccc;
}
.legend-new {
  background: #315d79;
}
.legend-repeat {
  background: #a5bccc;
}
.legend-kept {
  background: #6f9d7f;
}
.legend-returned {
  background: #d8a07c;
}
.legend-open {
  background: repeating-linear-gradient(135deg, #6f9d7f 0 2px, #cfe0d4 2px 4px);
}

@media (max-width: 1150px) {
  .dashboard-content {
    padding: 22px;
  }
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-kpis dd {
    font-size: 28px;
  }
  .dashboard-panels {
    grid-template-columns: 1fr;
  }
  .screen-margin-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 25px;
  }
  .screen-margin-list > div {
    border-bottom: 1px solid #edf0ed;
  }
  .screen-margin-list .screen-subtotal {
    border-top: 0;
  }
  .screen-margin-list .screen-net {
    grid-column: 1 / -1;
  }
}
@media (max-width: 800px) {
  .product-preview {
    padding-bottom: 45px;
  }
  .dashboard-content {
    padding: 22px;
  }
  .dashboard-toolbar {
    padding-inline: 22px;
  }
  .dashboard-panels {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .dashboard-screen {
    border-radius: 8px;
  }
  .dashboard-toolbar {
    padding: 14px 16px;
    min-height: 49px;
  }
  .dashboard-toolbar > .sync-note {
    display: none;
  }
  .day-bars {
    gap: 2px;
  }
  .dashboard-content {
    padding: 20px 14px;
  }
  .dashboard-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
  }
  .dashboard-heading h2 {
    font-size: 25px;
  }
  .dashboard-heading p {
    line-height: 1.5;
  }
  .sample-period {
    padding: 7px 9px;
  }
  .dashboard-kpis {
    gap: 9px;
  }
  .dashboard-kpis > div {
    padding: 14px 10px;
  }
  .dashboard-kpis dd {
    font-size: clamp(19px, 5.8vw, 26px);
    letter-spacing: -0.045em;
    margin-top: 10px;
  }
  .dashboard-kpis dt,
  .dashboard-kpis .kpi-note {
    font-size: 14px;
  }
  .dashboard-kpis dt {
    min-height: 4.2em;
  }
  .screen-panel {
    padding: 17px 12px;
  }
  .screen-margin-list {
    display: block;
  }
  .screen-margin-list .screen-subtotal {
    border-top: 1px solid #e6eae7;
    border-bottom: 0;
  }
  .screen-margin-list > div {
    border-bottom: 0;
  }
  .outcomes-legend {
    flex-direction: column;
    gap: 11px;
  }
}
