/* Admin dashboard — embedded in demo store so visitors can see
   exactly what PVSN shows a real merchant. */

.dashboard-body { background: #f7f7f5; }

.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 30px 0 24px;
  font-family: 'Inter', system-ui, sans-serif;
  flex-wrap: wrap;
}
.dash-hero h1 {
  font-family: 'Fraunces', 'Inter', serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
  color: #111827;
}
.dash-sub {
  color: #4b5563;
  max-width: 620px;
  font-size: 14px;
  line-height: 1.6;
}
.dash-chip {
  display: inline-block;
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.dash-refresh {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.dash-btn {
  background: #111827;
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.dash-btn:hover { background: #374151; }
.dash-updated { font-size: 11px; color: #6b7280; font-family: ui-monospace, monospace; }

.dash-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 16px 20px;
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

/* KPI strip */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #eef0ee;
  font-family: 'Inter', system-ui, sans-serif;
}
.kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi-hint {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

/* Generic card */
.dash-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #eef0ee;
  margin-bottom: 16px;
  font-family: 'Inter', system-ui, sans-serif;
}
.dash-card-head { margin-bottom: 14px; }
.dash-card-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  font-family: inherit;
  margin: 0;
}
.dash-card-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-split .dash-card { margin: 0; }
@media (max-width: 760px) {
  .dash-split { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: stretch; }
  .dash-refresh { align-items: flex-start; flex-direction: row; }
  .dash-hero h1 { font-size: 26px; }
  .dash-sub { font-size: 13px; }
  .kpi-value { font-size: 22px; }
  .bar-row { grid-template-columns: 90px 1fr 36px; font-size: 12px; }
}
@media (max-width: 480px) {
  .dash-hero h1 { font-size: 22px; }
  .kpi-card { padding: 12px 14px; }
  .dash-card { padding: 14px; }
}

/* Offer direction bar */
.offer-mix-bar {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  margin-bottom: 10px;
}
.mix-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: width 400ms ease;
  font-variant-numeric: tabular-nums;
}
.mix-up   { background: linear-gradient(90deg, #b91c1c, #e11d48); }
.mix-flat { background: #6b7280; }
.mix-down { background: linear-gradient(90deg, #059669, #0d9488); }
.mix-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: #374151;
  flex-wrap: wrap;
}
.sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}
.sw-up   { background: #b91c1c; }
.sw-flat { background: #6b7280; }
.sw-down { background: #059669; }

/* Bar list (segments / categories / event types) */
.bar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bar-label {
  text-transform: capitalize;
  color: #374151;
  font-weight: 500;
}
.bar-track {
  background: #f3f4f6;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 400ms ease;
}
.bar-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #6b7280;
  font-weight: 600;
  font-size: 12px;
}

/* Tables — always fit width; scroll horizontally on narrow screens */
.dash-card { overflow-x: auto; }
.dash-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
}
.dash-table tbody td {
  padding: 8px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.td-strong { color: #111827; font-weight: 700; }
.td-muted { color: #6b7280; font-size: 12px; }
.move-up   { color: #b91c1c; font-weight: 700; }
.move-down { color: #059669; font-weight: 700; }
.move-flat { color: #6b7280; }

.evt-pill {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Nav active state on dashboard */
.site-header nav a.active {
  color: #111827;
  font-weight: 600;
}
