:root {
  --bg: #0b0f14;
  --panel: #131a22;
  --panel-2: #1a2430;
  --line: #2c3a4d;
  --text: #e6edf5;
  --muted: #90a0b7;
  --accent: #6aa9ff;
  --good: #3ad08d;
  --bad: #ff6b7d;
  --warn: #f7c85a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}
input, select, textarea, button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f151d;
  color: var(--text);
  padding: 12px;
}
button { cursor: pointer; background: var(--accent); color: #07111f; font-weight: 700; }
button.secondary { background: var(--panel-2); color: var(--text); }
button.ghost { background: transparent; color: var(--muted); }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
textarea { resize: vertical; }
h1,h2,h3,p { margin-top: 0; }
.muted { color: var(--muted); }
.app-shell {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 18px;
  padding: 18px;
}
.panel { min-width: 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}
.compact-grid, .grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.full-row { grid-column: 1 / -1; }
.form-head, .toolbar, .actions, .right {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.wrap-mobile { flex-wrap: wrap; }
.partials-wrap { margin: 18px 0; }
.partial-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}
.paste-zone {
  border: 1px dashed var(--line);
  background: #0e141b;
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
}
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.thumb-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.quick-metrics, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 24px; font-weight: 800; margin-top: 6px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
tr.clickable:hover { background: #111922; cursor: pointer; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.report-list { display: grid; gap: 10px; }
.report-pill {
  display: flex; justify-content: space-between; align-items: center;
  background: #0f151d; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
dialog {
  width: min(1100px, 92vw);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 18px;
  padding: 18px;
}
dialog::backdrop { background: rgba(0,0,0,.75); }
.dialog-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}
.image-dialog {
  width: auto;
  max-width: 95vw;
  padding: 8px;
}
.image-dialog img { max-width: 92vw; max-height: 88vh; }
canvas {
  width: 100%;
  background: #0e141b;
  border-radius: 12px;
  border: 1px solid var(--line);
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
}
