:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d9dee8;
  --text: #1f2937;
  --muted: #667085;
  --brand: #005bff;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #027a48;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { letter-spacing: 0; overflow-wrap: anywhere; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); }
.topbar nav { display: flex; gap: 16px; flex: 1; overflow-x: auto; }
.logout { margin-left: auto; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.page-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel, .auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin: 16px 0;
}
.auth-panel { max-width: 420px; margin: 48px auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.stats strong { display: block; font-size: 28px; }
.stats span, .muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.table-wrap table { min-width: 860px; }
.table-wrap th, .table-wrap td { border-bottom: 1px solid var(--line); }
.table-wrap tr:last-child td { border-bottom: 0; }
.sku-cell { max-width: 240px; overflow-wrap: anywhere; }
.title-cell { max-width: 420px; overflow-wrap: anywhere; }
.error-cell { max-width: 360px; overflow-wrap: anywhere; }
label { display: grid; gap: 6px; margin-bottom: 14px; }
input, select, button, .button {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font: inherit;
}
button, .button {
  display: inline-flex;
  align-items: center;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  cursor: pointer;
  justify-content: center;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
.search { display: flex; gap: 8px; }
.search input { min-width: 320px; }
.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}
.filters label {
  min-width: 150px;
  margin-bottom: 0;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.row-actions {
  min-width: 72px;
}
.row-actions form {
  margin: 0 0 6px;
}
.row-actions button {
  min-height: 30px;
  padding: 5px 8px;
}
.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.message { padding: 10px 12px; border-radius: 6px; background: #eef4ff; border: 1px solid #b2ccff; }
.message.error { background: #fffbfa; border-color: #fecdca; color: var(--danger); }
.message.success { background: #ecfdf3; border-color: #abefc6; color: var(--ok); }
.status { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #eef4ff; color: #175cd3; }
.status.ok { background: #ecfdf3; color: var(--ok); }
.status.warning { background: #fffaeb; color: var(--warn); }
.status.error { background: #fffbfa; color: var(--danger); }
.status.new { background: #eef4ff; color: #175cd3; }
.status.processing { background: #fffaeb; color: var(--warn); }
.status.done { background: #ecfdf3; color: var(--ok); }
.status.cancelled { background: #f2f4f7; color: var(--muted); }
.mini {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  background: #f2f4f7;
  color: var(--muted);
}
.mini.on { background: #ecfdf3; color: var(--ok); }
.mini.off { background: #fffbfa; color: var(--danger); }
dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
pre {
  overflow: auto;
  background: #101828;
  color: #f2f4f7;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code-block {
  max-height: 460px;
}
.code-block-small {
  max-width: 560px;
  max-height: 300px;
}
.issues { margin: 8px 0 0; padding-left: 20px; }
@media (max-width: 800px) {
  .stats, .grid { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 12px; align-items: flex-start; flex-wrap: wrap; }
  .topbar nav {
    order: 3;
    flex: 0 0 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 10px 14px;
  }
  .logout { margin-left: auto; }
  .container { padding: 16px; }
  .page-head, .panel-head { align-items: flex-start; flex-direction: column; }
  .search, .filters, .actions { align-items: stretch; flex-direction: column; }
  .search input, .filters label, .filters input, .filters select, .filters button, .filters .button {
    min-width: 0;
    width: 100%;
  }
  .actions form, .actions button, .actions .button { width: 100%; }
  dl { grid-template-columns: 1fr; }
  dt { font-weight: 600; }
  .table-wrap table { min-width: 760px; }
}
