:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #757575;
  --border: #eeeeee;
  --hover: #f5f5f5;
  --focus: rgba(0, 0, 0, 0.22);
  --radius: 6px;
}

body {
  background: var(--bg);
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.app-header a,
.app-main a,
.app-footer a {
  color: var(--muted);
}

.app-header a:hover,
.app-main a:hover,
.app-footer a:hover {
  color: var(--text);
}

.app-header {
  padding: 48px 0 28px;
}

.app-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-header h1 {
  margin: 24px 0 0;
  font-size: 1.6rem;
  line-height: 1.25;
}

.app-header p {
  margin: 14px 0 0;
  max-width: 72ch;
}

.app-main {
  padding-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.controls {
  display: grid;
  grid-template-columns: 1.8fr 1fr 0.9fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.control label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 6px;
}

input[type="search"],
select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  outline: none;
}

input[type="search"]:focus-visible,
select:focus-visible {
  border-color: #000;
  box-shadow: 0 0 0 4px var(--focus);
}

.control-actions {
  display: flex;
  justify-content: flex-end;
}

.app-main .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid #000;
  background: #000;
  color: #fff;
  text-decoration: none;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.app-main .btn:hover {
  background: #fff;
  color: #000;
}

.app-main .btn.secondary {
  background: #fff;
  color: #000;
  border-color: var(--border);
}

.app-main .btn.secondary:hover {
  background: var(--hover);
  border-color: #000;
}

.app-main .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.app-main .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Defensive: if Bootstrap button classes leak in, keep them monochrome. */
.app-main .btn-primary,
.app-main .btn.btn-primary {
  background: #000;
  color: #fff;
  border-color: #000;
}

.app-main .btn-primary:hover,
.app-main .btn.btn-primary:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

.app-main .btn-outline-primary,
.app-main .btn.btn-outline-primary {
  background: #fff;
  color: #000;
  border-color: #000;
}

.app-main .btn-outline-primary:hover,
.app-main .btn.btn-outline-primary:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

.app-main .btn-sm,
.app-main .btn.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.95em;
}

.status {
  margin: 14px 2px;
}

.table-wrap {
  margin-top: 8px;
  padding: 0;
}

.table-scroll {
  overflow: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:hover td {
  background: var(--hover);
}

.col-action,
td.col-action {
  text-align: right;
}

.product {
  font-weight: 700;
}

.meta {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.state {
  margin-top: 14px;
}

.state h2 {
  margin: 0;
  font-size: 1.05rem;
}

.state p {
  margin: 10px 0 0;
}

.state.error {
  border-inline-start: 4px solid #000;
}

pre {
  margin: 12px 0 0;
}

.footer.app-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.dot {
  opacity: 0.55;
  padding-inline: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 880px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-actions {
    grid-column: 1 / -1;
  }

  .app-header {
    padding: 40px 0 22px;
  }

  .app-header h1 {
    font-size: 1.4rem;
  }
}
