:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #65748b;
  --line: #d8e0eb;
  --brand: #2254d1;
  --brand-dark: #163d9b;
  --danger: #b42318;
  --ok: #087443;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.side { background: #111827; color: #e5e7eb; padding: 24px 18px; }
.brand { font-size: 18px; font-weight: 750; line-height: 1.2; margin-bottom: 28px; }
.nav a { display: block; color: #dbe3ef; padding: 10px 12px; border-radius: 6px; margin-bottom: 4px; }
.nav a:hover, .nav a.active { background: #1f2937; color: #fff; }
.main { padding: 28px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 26px; margin: 0; letter-spacing: 0; }
h2 { font-size: 18px; margin: 0 0 14px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric strong { display: block; font-size: 28px; }
.metric span, .muted { color: var(--muted); }
.panel { margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; }
label { display: block; font-size: 13px; font-weight: 700; color: #344256; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 8px 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0b8b2; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-row .btn { min-height: 42px; }
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }
.error { background: #fef3f2; color: var(--danger); border-color: #fecdca; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .panel { width: min(440px, 100%); }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; background: #f1f5f9; padding: 3px 5px; border-radius: 4px; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; }
  .grid, .row { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
}
