:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #111720;
  --panel-strong: #151d29;
  --line: #283241;
  --text: #eef4f8;
  --muted: #9aa8b5;
  --brand: #af1832;
  --brand-dark: #c92743;
  --success-bg: rgba(42, 195, 120, 0.16);
  --success-text: #6ee7a8;
  --danger-bg: rgba(248, 91, 91, 0.16);
  --danger-text: #ff9b9b;
  --warning-bg: rgba(245, 191, 82, 0.16);
  --warning-text: #ffd57a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(175, 24, 50, 0.12), transparent 360px),
    linear-gradient(180deg, #0b0f16 0%, var(--bg) 46%);
  color: var(--text);
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.brand-block {
  align-items: flex-start;
  display: grid;
  gap: 6px;
}

.brand-logo {
  display: block;
  height: auto;
  margin-bottom: 8px;
  max-width: 148px;
  width: 32vw;
}

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  color: #ffffff;
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
}

.refresh-panel {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 230px;
}

.refresh-panel span {
  color: var(--muted);
  font-size: 13px;
}

.refresh-panel strong {
  font-size: 14px;
}

button {
  background: var(--brand);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 750;
  min-height: 38px;
  padding: 0 14px;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metrics article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
}

.metrics span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.metrics strong {
  font-size: 26px;
}

.controls {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.search-row {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 1fr) auto;
}

.search-field {
  min-width: 0;
}

.status-buttons {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.status-buttons legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  width: 100%;
}

.status-buttons button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 42px;
}

.status-buttons button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.filter-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.filter-block h2 {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.filter-grid {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

label span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  outline: none;
  padding: 0 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(175, 24, 50, 0.22);
}

input::placeholder {
  color: #738091;
}

.message {
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.message p {
  margin: 0;
}

.message ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.warning-details summary {
  cursor: pointer;
  font-weight: 800;
}

.error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid rgba(248, 91, 91, 0.28);
}

.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid rgba(245, 191, 82, 0.28);
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 1380px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--panel-strong);
  color: #c7d2de;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: rgba(175, 24, 50, 0.08);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.sku {
  color: #ffffff;
  font-weight: 800;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.empty {
  color: var(--muted);
  margin: 0;
  padding: 24px;
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-panel {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-row,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .status-buttons {
    justify-content: flex-start;
  }
}
