:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --text: #182230;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --brand: #0f5c9c;
  --accent: #0d9488;
  --bad: #b42318;
  --good: #067647;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
nav { display: flex; gap: 16px; align-items: center; }
.shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.metrics div, .panel, .grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metrics span { display: block; color: var(--muted); margin-bottom: 8px; }
.metrics strong { font-size: 24px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef3f8; font-weight: 700; }
.product-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}
.button.secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}
.button.disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}
.table-tools, .pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.pagination {
  justify-content: flex-end;
  margin: 14px 0 0;
}
.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-form label {
  margin: 0;
}
select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: #f8fbff;
}
.details-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 14px;
  margin: 0;
}
.details-list dt {
  color: var(--muted);
}
.details-list dd {
  margin: 0;
}
.raw-json {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #e5eefb;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
label { display: block; margin-bottom: 12px; color: var(--muted); }
input, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
textarea { min-height: 80px; }
.muted { color: var(--muted); }
.bad, .error { color: var(--bad); }
.good, .success { color: var(--good); }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-panel {
  width: min(380px, calc(100vw - 32px));
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login-panel h1 { margin-bottom: 18px; }
@media (max-width: 760px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px; }
  nav { flex-wrap: wrap; gap: 10px; }
  .shell { padding: 16px; }
  .metrics, .grid.two { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .table-tools, .pagination { align-items: flex-start; flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
