/* Dashboard only. Status tones and business values remain owned by components. */
.so-dashboard { color:var(--so-text,#1e293b); background:var(--so-bg,#f5f7fb); min-width:0; }
.so-dashboard-content { min-height:0; padding:var(--so-page-padding,16px); }
.so-dashboard-top-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-items:stretch; }
.so-dashboard-top-cards>* { min-width:0; }
.so-dashboard-activity {
  display:flex; flex-direction:column; min-inline-size:0; block-size:220px;
  border:1px solid var(--so-border,#e2e8f0); border-radius:var(--so-radius-card,12px);
  background:var(--so-surface,#fff); color:var(--so-text,#1e293b); font-size:12px;
  box-shadow:0 1px 2px #0f172a0d; overflow:hidden;
  --activity-add-bg:#e9f4ed; --activity-add-fg:#235a3b;
}
html[data-so-theme="franchise-light"] .so-dashboard-activity { --activity-add-bg:#eee; --activity-add-fg:#242424; }
.so-dashboard-activity__header {
  display:flex; align-items:center; gap:7px; padding:8px 10px;
  background:var(--so-bg,#f5f7fb); border-block-end:1px solid var(--so-border,#e2e8f0);
}
.so-dashboard-activity__header h2 { flex:1; min-inline-size:0; margin:0; font-size:12px; font-weight:650; line-height:1.2; }
.so-dashboard-activity__icon {
  display:grid; place-items:center; flex:none; inline-size:25px; block-size:25px; border-radius:7px;
  background:var(--so-surface,#fff); color:var(--so-primary,#4354c7);
}
.so-dashboard-activity__period { color:var(--so-muted,#64748b); font-size:11px; text-align:end; }
.so-dashboard-activity__scroll { flex:1; min-block-size:0; overflow:auto; }
.so-dashboard-activity__scroll:focus-visible { outline:2px solid var(--so-primary,#4354c7); outline-offset:-2px; }
.so-dashboard-activity table { inline-size:100%; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.so-dashboard-activity :is(th,td) { padding:5px 5px; text-align:start; overflow-wrap:anywhere; vertical-align:top; }
.so-dashboard-activity tr > :first-child { padding-inline-start:10px; }
.so-dashboard-activity tr > :last-child { padding-inline-end:10px; }
.so-dashboard-activity thead th {
  position:sticky; inset-block-start:0; z-index:1; background:var(--so-surface,#fff);
  color:var(--so-muted,#64748b); font-size:11px; font-weight:550; border-block-end:1px solid var(--so-border,#e2e8f0);
}
.so-dashboard-activity thead th:nth-child(2) { inline-size:74px; }
.so-dashboard-activity thead th:nth-child(3) { inline-size:76px; }
.so-dashboard-activity tbody tr + tr > * { border-block-start:1px solid var(--so-border,#e2e8f0); }
.so-dashboard-activity__customer { display:flex; align-items:baseline; gap:2px 6px; flex-wrap:wrap; }
.so-dashboard-activity__customer bdi { min-inline-size:0; font-weight:600; }
.so-dashboard-activity__customer time { color:var(--so-muted,#64748b); font-size:10px; font-weight:400; white-space:nowrap; }
.so-dashboard-activity__count { font-weight:650; font-variant-numeric:tabular-nums; }
.so-dashboard-activity__added { display:inline-block; padding:2px 5px; border-radius:5px; background:var(--activity-add-bg); color:var(--activity-add-fg); font-size:10px; }
.so-dashboard-activity__none { color:var(--so-muted,#64748b); }
.so-dashboard-activity__brands { display:flex; gap:3px; align-items:start; flex-wrap:wrap; font-weight:400; }
.so-dashboard-activity__customer + .so-dashboard-activity__brands { margin-block-start:3px; }
.so-dashboard-activity__brand, .so-dashboard-activity details summary {
  display:inline-flex; gap:4px; max-inline-size:100%; align-items:baseline; padding:0 4px; border-radius:4px;
  color:var(--so-text,#1e293b); background:var(--so-bg,#f5f7fb); font-size:10px; overflow-wrap:anywhere;
}
.so-dashboard-activity__brand small { color:var(--so-muted,#64748b); font-size:inherit; }
.so-dashboard-activity details { max-inline-size:100%; }
.so-dashboard-activity details[open] { flex-basis:100%; }
.so-dashboard-activity details[open] > div { margin-block-start:3px; }
.so-dashboard-activity details summary { cursor:pointer; }
.so-dashboard-activity details summary::-webkit-details-marker { display:none; }
.so-dashboard-activity__message { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:auto; padding:10px; color:var(--so-muted,#64748b); }
.so-dashboard-activity__message button { color:var(--so-primary,#4354c7); text-decoration:underline; }
.so-dashboard-period-card { min-height:104px; min-width:0; width:100%; padding:10px; text-align:start; background:var(--so-surface,#fff); border-color:var(--so-border,#e2e8f0); border-radius:var(--so-radius-card,12px); }
.so-dashboard-period-card {
  display:grid;
  grid-template-columns:minmax(65px,.9fr) minmax(0,1.6fr);
  grid-template-rows:auto auto 1fr auto;
  align-items:start;
  gap:6px 8px;
  container-type:inline-size;
  container-name:so-dashboard-period;
}
.so-dashboard-period-heading { display:flex; grid-column:1/-1; align-items:center; gap:8px; min-width:0; color:var(--so-muted,#64748b); font-size:11px; font-weight:650; line-height:1.3; letter-spacing:.025em; text-transform:uppercase; overflow-wrap:anywhere; }
.so-dashboard-period-icon { width:20px; height:20px; display:grid; place-items:center; flex-shrink:0; border-radius:6px; background:#eff6ff; color:var(--so-primary,#4354c7); }
.so-dashboard-period-body { display:contents; }
.so-dashboard-period-pending { min-width:0; display:flex; flex-direction:column; gap:2px; }
.so-dashboard-period-pending-orders { grid-area:2/1; margin-block-start:4px; }
.so-dashboard-period-pending-positions { grid-area:3/1; align-self:end; }
.so-dashboard-pending-count { font-size:26px; line-height:1.05; font-weight:750; font-variant-numeric:tabular-nums; color:var(--so-primary,#4354c7); }
.so-dashboard-period-metrics { display:grid; grid-area:4/1/5/-1; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; min-width:0; padding-block-start:6px; border-block-start:1px solid var(--so-border,#e2e8f0); }
.so-dashboard-period-metric { display:flex; flex-direction:column; justify-content:center; gap:2px; min-width:0; }
.so-dashboard-period-label,.so-dashboard-period-hint { color:var(--so-muted,#64748b); font-size:11px; line-height:1.2; overflow-wrap:anywhere; }
.so-dashboard-period-amount { color:var(--so-text,#1e293b); font-size:16px; line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.so-dashboard-week-chart {
  --so-week-chart-plot-height:74px;
  display:grid;
  grid-area:2/2/4/3;
  place-self:center;
  gap:5px;
  inline-size:100%;
  max-inline-size:228px;
  min-inline-size:0;
  text-align:center;
}
.so-dashboard-week-chart-heading {
  color:var(--so-muted,#64748b);
  font-size:10px;
  font-weight:650;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.so-dashboard-week-chart-plot {
  position:relative;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:2px;
}
.so-dashboard-week-chart-plot::before {
  position:absolute;
  inset-block-start:0;
  inset-inline:0;
  block-size:var(--so-week-chart-plot-height);
  background:repeating-linear-gradient(to top,transparent 0 23px,var(--so-border,#e2e8f0) 23px 24px);
  pointer-events:none;
  content:"";
}
.so-dashboard-week-chart-day {
  position:relative;
  display:grid;
  grid-template-rows:var(--so-week-chart-plot-height) auto;
  gap:3px;
  min-inline-size:0;
}
.so-dashboard-week-chart-track {
  display:flex;
  align-items:end;
  justify-content:center;
  padding-inline:2px;
  border-block-end:1px solid var(--so-border,#e2e8f0);
}
.so-dashboard-week-chart-bar {
  display:block;
  inline-size:min(100%,18px);
  block-size:var(--so-day-height,0px);
  border-radius:3px 3px 0 0;
  background:color-mix(in srgb,var(--so-primary,#4354c7) 82%,var(--so-surface,#fff));
}
.so-dashboard-week-chart-day[data-state="value"] .so-dashboard-week-chart-bar { min-block-size:3px; }
.so-dashboard-week-chart-day[data-state="zero"] .so-dashboard-week-chart-bar { block-size:3px; }
.so-dashboard-week-chart-day[data-state="future"] .so-dashboard-week-chart-bar {
  block-size:5px;
  border:1px dashed var(--so-muted,#64748b);
  border-radius:2px 2px 0 0;
  background:transparent;
}
.so-dashboard-week-chart-day[data-state="unavailable"] .so-dashboard-week-chart-bar {
  inline-size:min(65%,10px);
  block-size:2px;
  background:var(--so-border,#e2e8f0);
}
.so-dashboard-week-chart-tick {
  overflow:hidden;
  color:var(--so-muted,#64748b);
  font-size:9px;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.so-dashboard-week-chart-status {
  position:absolute;
  inset-inline:0;
  inset-block-start:calc(var(--so-week-chart-plot-height) / 2 - 7px);
  justify-self:center;
  padding-inline:4px;
  background:var(--so-surface,#fff);
  color:var(--so-muted,#64748b);
  font-size:11px;
  line-height:1.2;
  overflow-wrap:anywhere;
  pointer-events:none;
}
.so-dashboard-feed-body { max-height:276px; overscroll-behavior:contain; }
.so-dashboard-feed-all { min-height:32px; padding:4px 8px; border-radius:var(--so-radius-control,8px); color:var(--so-primary,#4354c7); font-size:12px; line-height:1.3; white-space:normal; }
.so-dashboard-feed-all:hover { background:#eff6ff; }
.so-dashboard-feed-all:focus-visible { outline:2px solid var(--so-primary,#4354c7); outline-offset:2px; }
.so-dashboard-feed-item .so-feed-title { font-size:13px; }
.so-dashboard-toolbar { min-height:40px; padding:4px 16px; }
.so-dashboard-toolbar>button,.so-dashboard-toolbar select { min-height:32px; height:auto; padding-block:4px; font-size:13px; line-height:1.3; }
.so-dashboard-toolbar>div:last-child { margin-inline-start:auto; margin-inline-end:0; }
@container so-dashboard-period (max-width:380px) {
  .so-dashboard-period-amount { font-size:14px; }
}
@media(min-width:1200px) {
  .so-dashboard-top-cards { grid-template-columns:minmax(0,1fr) minmax(0,1.8fr) minmax(0,1fr) minmax(0,1fr); }
  .so-dashboard-top-cards.has-new-customers {
    grid-template-columns:minmax(0,1.2fr) minmax(322px,1.8fr) minmax(0,1fr) minmax(0,1fr);
    grid-auto-rows:minmax(208px,auto);
  }
  .has-new-customers .so-dashboard-period-card {
    grid-template-columns:minmax(78px,1fr) minmax(116px,1.5fr) minmax(88px,1.12fr);
    grid-template-rows:auto minmax(0,1fr) auto;
    row-gap:4px;
  }
  .has-new-customers .so-dashboard-period-metrics { display:contents; }
  .has-new-customers .so-dashboard-period-heading { grid-area:1/1/2/3; }
  .has-new-customers .so-dashboard-week-chart { --so-week-chart-plot-height:84px; }
  .has-new-customers .so-dashboard-period-metric { grid-column:3; }
  .has-new-customers [data-order-period="today"] { grid-row:1; }
  .has-new-customers [data-order-period="week"] { grid-row:3; align-self:end; }
}
@container so-dashboard-period (max-width:350px) {
  .has-new-customers .so-dashboard-week-chart { --so-week-chart-plot-height:74px; }
}
@media(max-width:767px) {
  .so-dashboard-top-cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .so-dashboard-toolbar { padding:4px 12px; gap:4px; }
  .so-dashboard-toolbar>button,.so-dashboard-toolbar select,.so-dashboard-feed-all { min-height:44px; }
  .so-dashboard-toolbar>div:first-child { width:100%; }
  .so-dashboard-period-card { padding:10px; }
  .has-new-customers>.so-dashboard-new-customers,
  .has-new-customers>.so-dashboard-period-card { grid-column:1/-1; }
}
