/* ============================================================
   Sales Dashboard — namespace: .sales-dashboard
   Visual language matches /tmp/design-pkg/revenue-dashboard/project/styles.css
   ============================================================ */

.sales-dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0 80px;
}

/* ---------- Header / date nav ---------- */
.sd-datenav {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 24px;
  width: fit-content;
}
.sd-datenav-arrow {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 18px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s;
}
.sd-datenav-arrow:hover { background: #f8fafc; }
.sd-datenav-label { display: flex; flex-direction: column; line-height: 1.2; padding: 0 4px; }
.sd-datenav-strong { font-weight: 600; color: #0f172a; font-size: 14px; }
.sd-datenav-sub { font-size: 12px; color: #64748b; }
.sd-datenav-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid #e2e8f0;
}
.sd-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  animation: sd-pulse 2s ease-in-out infinite;
}
.sd-dot--closed { background: #94a3b8; box-shadow: none; animation: none; }
@keyframes sd-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0.05); }
}

/* ---------- View tabs ---------- */
.sd-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 3px solid #0F2F4F;
  padding-bottom: 12px;
}
.sd-hdr-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-hdr-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s;
}
.sd-hdr-tab:hover { border-color: #cbd5e1; }
.sd-hdr-tab--active { background: #0F2F4F; color: #fff; border-color: #0F2F4F; }

.sd-period-wrap {
  display: inline-flex;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
}
.sd-period-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.sd-period-btn--active { background: #0F2F4F; color: #fff; }

/* ---------- KPI row ---------- */
.sd-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.sd-kpi {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sd-kpi-accent { height: 3px; background: var(--accent, #0F2F4F); }
.sd-kpi-body { padding: 16px 18px 18px; }
.sd-kpi-label {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: #94a3b8; text-transform: uppercase; margin-bottom: 8px;
}
.sd-kpi-value {
  font-size: 24px; font-weight: 700; color: #0f172a;
  line-height: 1.2; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.sd-kpi-sub { font-size: 12px; font-weight: 500; color: #64748b; }
.sd-kpi-sub--pos { color: #10b981; }
.sd-kpi-sub--neg { color: #ef4444; }

/* ---------- Generic card ---------- */
.sd-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 20px 22px;
}
.sd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.sd-card-eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: .16em;
  color: #94a3b8; text-transform: uppercase; margin-bottom: 4px;
}
.sd-card-title {
  font-size: 16px; font-weight: 700; color: #0f172a;
  display: flex; align-items: center; gap: 10px;
}
.sd-card-meta {
  font-size: 11px; color: #94a3b8; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600;
}

/* ---------- Layout grids ---------- */
.sd-grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 6px; }
.sd-grid-3 { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 16px; }
.sd-grid-2-uneven { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; margin-top: 16px; }

/* ---------- Hourly chart ---------- */
.sd-hourly-card { position: relative; }
.sd-hourly-svg { width: 100%; height: 280px; display: block; }
.sd-hourly-hint { font-size: 12px; color: #64748b; max-width: 360px; text-align: right; line-height: 1.4; }
.sd-hourly-tooltip {
  position: absolute; top: 24px; right: 22px;
  background: #0F2F4F; color: #fff;
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; box-shadow: 0 6px 20px rgba(15,47,79,.25);
  pointer-events: none; min-width: 160px;
}
.sd-hourly-parts {
  display: flex; gap: 4px; margin-top: 4px; margin-bottom: 14px;
}
.sd-hourly-part {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #94a3b8; text-align: center;
  padding: 4px 6px; background: #f8fafc; border-radius: 4px;
}
.sd-legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 14px; border-top: 1px solid #f1f5f9;
}
.sd-legend-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid #e2e8f0; background: #fff; color: #334155;
  cursor: pointer; transition: all 0.15s;
}
.sd-legend-pill:hover { border-color: #94a3b8; }
.sd-legend-pill--active { background: #0F2F4F; color: #fff; border-color: #0F2F4F; }
.sd-legend-pill--dim { opacity: .5; }
.sd-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Filter chip ---------- */
.sd-filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  padding: 3px 6px 3px 8px; border-radius: 999px; border: 1px solid;
}
.sd-filter-chip-dot { width: 7px; height: 7px; border-radius: 50%; }
.sd-filter-chip-x {
  font-size: 14px; line-height: 1; width: 16px; height: 16px;
  border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; opacity: .6; background: none; border: none; cursor: pointer;
}
.sd-filter-chip-x:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ---------- Category distribution ---------- */
.sd-cat-body { display: flex; flex-direction: column; gap: 16px; }
.sd-cat-donut-wrap { display: flex; justify-content: center; margin-bottom: 4px; }
.sd-donut-svg { width: 220px; height: 220px; }
.sd-cat-list { display: flex; flex-direction: column; gap: 2px; }
.sd-cat-row {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 6px;
  transition: all 0.15s; cursor: pointer; background: none; border: none;
}
.sd-cat-row:hover { background: #f8fafc; }
.sd-cat-row--active { background: #f1f5f9; }
.sd-cat-row--dim { opacity: .5; }
.sd-cat-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sd-cat-row-sq { width: 9px; height: 9px; border-radius: 2px; }
.sd-cat-row-label { font-size: 13px; font-weight: 600; color: #0f172a; }
.sd-cat-row-amount { margin-left: auto; font-size: 13px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.sd-cat-row-bar { height: 4px; background: #f1f5f9; border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.sd-cat-row-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.sd-cat-row-meta { display: flex; gap: 6px; font-size: 11px; color: #94a3b8; }

/* ---------- Run rate / weather stub ---------- */
.sd-runrate-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px;
}
.sd-runrate-stat-label {
  font-size: 10px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}
.sd-runrate-stat-value { font-size: 17px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.sd-weather-stub {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  font-size: 11px; color: #64748b;
}
.sd-runrate-svg { width: 100%; height: 110px; display: block; }
.sd-runrate-legend {
  display: flex; gap: 14px; margin-top: 6px;
  padding-top: 10px; border-top: 1px solid #f1f5f9;
}
.sd-runrate-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #64748b; }
.sd-runrate-legend-line { width: 16px; height: 2px; border-radius: 1px; }
.sd-runrate-legend-line--dashed {
  background: repeating-linear-gradient(90deg, #94a3b8 0 4px, transparent 4px 7px);
}

/* ---------- Attach rate ---------- */
.sd-attach-rows { display: flex; flex-direction: column; gap: 12px; }
.sd-attach-row-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.sd-attach-row-label { color: #334155; font-weight: 500; }
.sd-attach-row-pct { color: #0f172a; font-weight: 700; font-variant-numeric: tabular-nums; }
.sd-attach-row-bar { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.sd-attach-row-bar-fill { height: 100%; border-radius: 3px; }

/* ---------- Labour ---------- */
.sd-labor-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px;
}
.sd-labor-strip-stat {
  padding: 12px 14px; background: #f8fafc;
  border-radius: 8px; border: 1px solid #f1f5f9;
}
.sd-labor-strip-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #94a3b8; margin-bottom: 4px;
}
.sd-labor-strip-value { font-size: 20px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sd-labor-strip-sub { font-size: 11px; color: #64748b; margin-top: 2px; }

/* ---------- Top SKUs ---------- */
.sd-sku-list { display: flex; flex-direction: column; gap: 10px; }
.sd-sku-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 4px; border-bottom: 1px solid #f1f5f9;
}
.sd-sku-row:last-child { border-bottom: 0; }
.sd-sku-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f1f5f9; font-size: 11px; font-weight: 700; color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
}
.sd-sku-main { flex: 1; min-width: 0; }
.sd-sku-name { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 3px; }
.sd-sku-meta { display: flex; gap: 10px; font-size: 11px; color: #94a3b8; margin-bottom: 5px; }
.sd-sku-bar { height: 3px; background: #f1f5f9; border-radius: 2px; overflow: hidden; }
.sd-sku-bar-fill { height: 100%; border-radius: 2px; }
.sd-sku-amount { font-size: 13px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Heatmap ---------- */
.sd-heat-wrap { overflow-x: auto; }
.sd-heat-svg { width: 100%; height: auto; min-width: 600px; }

/* ---------- Not configured / stub empty state ---------- */
.sd-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 32px; text-align: center;
  background: #fff; border-radius: 10px; border: 1px solid #e2e8f0;
  margin-top: 24px;
}
.sd-empty-state-title { font-size: 18px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.sd-empty-state-sub { font-size: 14px; color: #64748b; max-width: 480px; line-height: 1.6; }
.sd-empty-state-code {
  margin-top: 16px; padding: 10px 18px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 13px; color: #0f172a;
}
.sd-empty-state-clients { margin-top: 16px; text-align: left; }
.sd-empty-state-clients li { font-size: 12px; color: #334155; font-family: ui-monospace, monospace; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .sd-kpi-row { grid-template-columns: repeat(3, 1fr); }
  .sd-grid-2, .sd-grid-2-uneven { grid-template-columns: 1fr; }
  .sd-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sd-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sd-grid-3 { grid-template-columns: 1fr; }
  .sd-hdr { flex-direction: column; gap: 10px; align-items: flex-start; }
}
