:root {
  --bg: #f4f9fe;
  --bg-soft: #e8f1f9;
  --panel: #ffffff;
  --panel-soft: #f3f8fd;
  --text: #1f3d63;
  --text-soft: #6b7f97;
  --white: #ffffff;
  --border: #d6e4f1;
  --accent: #3298ed;
  --accent-deep: #275f92;
  --shadow: 0 12px 36px rgba(45, 93, 143, 0.1);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top center, rgba(50, 152, 237, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f6fbff 280px, #edf5fb 100%);
  color: var(--text);
}
.container { max-width: 1440px; margin: 0 auto; padding: 28px; }
.hero {
  color: var(--text);
  display: block;
  margin-bottom: 18px;
}
.hero-card, .summary-card, .panel, .kpi {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card {
  background:
    radial-gradient(circle at top center, rgba(50, 152, 237, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 28px 32px;
  border: 1px solid var(--border);
  min-height: 0;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7891ab;
  margin-bottom: 14px;
}
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); display: inline-block; }
.hero-copy { max-width: 780px; margin: 0 auto; }
.title {
  font-size: 24px;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.02em;
  max-width: none;
}
.title-accent {
  color: var(--accent);
}
.subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}
/* A spec decides how many KPIs, charts and filters exist, so these grids auto-fit
   instead of hardcoding a column count. */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--panel);
  padding: 18px;
  border: 1px solid var(--border);
}
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.kpi-value {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.kpi-sub { margin-top: 8px; color: var(--text-soft); font-size: 13px; }
.layout-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.layout-single { display: grid; grid-template-columns: 1fr; gap: 14px; }
.panel-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.panel--third { grid-column: span 4; }
.panel--half { grid-column: span 6; }
.panel--full { grid-column: span 12; }
.dash-section { margin: 0 0 18px; }
.dash-section-title {
  margin: 22px 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-soft);
}
.dash-empty {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 18px;
  color: var(--text-soft);
  font-size: 14px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 18px 18px 14px;
}
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.panel-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.panel-subtitle { margin: 5px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.5; max-width: 720px; }
.chart { width: 100%; height: 400px; cursor: crosshair; }
.table-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0 16px;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-label {
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.input, .select {
  height: 42px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}
.input:focus, .select:focus {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.table-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
}
/* Same line box as real labels so Reset sits flush with the Rows <select>. */
.control-label--ghost {
  visibility: hidden;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}
.table-actions .btn {
  min-width: 88px;
}
.btn {
  height: 42px;
  margin: 0;
  font: inherit;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}
.btn:hover { border-color: #cbd5e1; }
.table-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 13px;
}
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.table th {
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.product-link {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
}
.product-link:hover { color: var(--accent-deep); }
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}
.product-thumb-link {
  flex: 0 0 auto;
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}
.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fbfe 0%, #edf5fb 100%);
  flex: 0 0 auto;
}
.product-copy {
  min-width: 0;
}
.product-copy .product-link {
  display: inline-block;
}
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #edf6ff;
  color: var(--accent-deep);
}
.badge-soft {
  background: #edf6ff;
  color: #2b6da7;
}
.empty-state {
  padding: 24px 12px;
  color: var(--text-soft);
  text-align: center;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pagination-left, .pagination-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination-status {
  color: var(--text-soft);
  font-size: 13px;
}
.page-btn {
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}
.page-btn:hover { border-color: #cbd5e1; }
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.page-size {
  width: 90px;
}
.footer-note {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 12px;
}
@media (max-width: 1320px) {
  .panel--third { grid-column: span 6; }
  .table-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
@media (max-width: 1180px) {
  .container { padding: 22px; }
  .hero-card { padding: 24px 26px; }
  .layout-two { grid-template-columns: 1fr; }
  .panel--third,
  .panel--half { grid-column: span 12; }
  .panel { padding: 18px; }
  .chart { height: 360px; }
  .table-actions { justify-content: stretch; }
}
@media (max-width: 900px) {
  .container { padding: 18px; }
  .title { font-size: 22px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-subtitle { max-width: none; }
  .table-actions {
    grid-column: span 2;
    width: 100%;
    justify-content: space-between;
  }
  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 720px) {
  .container { padding: 14px; }
  .hero-card { padding: 20px 18px; }
  .title { font-size: 20px; }
  .subtitle { font-size: 15px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { padding: 16px; }
  .panel { padding: 16px 14px; }
  .chart { height: 320px; }
  .table-actions {
    grid-column: auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: stretch;
  }
  .table-actions .control-group,
  .table-actions .btn,
  .page-size {
    width: 100%;
  }
  .table-meta { flex-direction: column; align-items: flex-start; }
  .pagination-left,
  .pagination-right {
    width: 100%;
  }
  .pagination-right { justify-content: flex-start; }
  .table-wrap {
    overflow: visible;
  }
  .table,
  .table tbody {
    display: block;
    width: 100%;
  }
  .table thead {
    display: none;
  }
  .table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    padding: 12px;
    margin-bottom: 12px;
  }
  .table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(214, 228, 241, 0.8);
    text-align: left;
  }
  .table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .table td::before {
    content: attr(data-label);
    flex: 0 0 96px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .table td:first-child {
    display: block;
    padding-top: 0;
  }
  .table td:first-child::before {
    content: none;
  }
  .product-cell {
    min-width: 0;
    align-items: flex-start;
  }
  .product-thumb-link,
  .product-thumb-placeholder {
    width: 52px;
    height: 52px;
  }
}
@media (max-width: 520px) {
  .title { font-size: 18px; }
  .eyebrow { font-size: 11px; }
  .chart { height: 280px; }
  .pagination-left {
    justify-content: space-between;
  }
  .page-btn {
    flex: 1 1 auto;
  }
  .table td {
    flex-direction: column;
    gap: 4px;
  }
  .table td::before {
    flex: 0 0 auto;
  }
}