/* Портал разработчика — тот же язык, что у консолей, но плотнее:
   это рабочий инструмент, а не витрина. */
:root {
  --bg: #f1f3f5; --card: #fff; --ink: #16181b; --ink-2: #42474d;
  --ink-3: #6b7178; --ink-4: #9aa1a8; --line: #e4e7ea;
  --sand: #b29b74; --sand-2: #e4d9c4; --good: #4e8a58; --bad: #b0473d;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; }
.mark { width: 32px; height: 32px; border-radius: 10px; background: #24282d; display: grid; place-items: center; }
.mark svg { width: 19px; height: 19px; }
.name { font-weight: 800; letter-spacing: -.02em; }
.sep { width: 1px; height: 18px; background: #3a3f45; }
.sub { color: #9aa1a8; font-size: 13.5px; }
.health { font-size: 13px; color: #9aa1a8; }
.health.ok { color: #8fd29a; }
.health.bad { color: #e39b94; }

.tabs { display: flex; gap: 6px; padding: 12px 22px 0; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  padding: 9px 14px; border-radius: 11px; font: inherit; font-weight: 700; font-size: 14px;
}
.tab:hover { background: #e7eaed; }
.tab.on { background: var(--ink); color: #fff; }

main { padding: 18px 22px 40px; }
.view { display: none; }
.view.on { display: block; }

.grid { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.01em; }
.muted { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 12px; }
input, select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 11px; font: inherit; background: #fbfcfd;
}
input:focus, select:focus { outline: 2px solid var(--sand); outline-offset: -1px; }

.btn {
  border: 0; background: var(--ink); color: #fff; cursor: pointer;
  padding: 11px 16px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 14px;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: #eef1f3; color: var(--ink); }

.chip {
  border: 1px solid var(--line); background: #fbfcfd; color: var(--ink-2); cursor: pointer;
  padding: 7px 12px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters { display: flex; gap: 7px; }

.qr-card { display: grid; justify-items: center; gap: 12px; }
#qr { width: 320px; max-width: 100%; height: auto; border-radius: 14px; }
.bar { width: 320px; max-width: 100%; height: 5px; border-radius: 3px; background: #e4e7ea; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--sand); transition: width .95s linear; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--ink-3); }
.pill { padding: 2px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: #eef1f3; }
.pill.ok { background: #e6f2e8; color: var(--good); }
.pill.bad { background: #f7e7e5; color: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 13px; padding: 13px; }
.tile.off { opacity: .55; }
.tile .n { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.tile .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.tile .v small { font-size: 14px; color: var(--ink-3); font-weight: 700; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-4); padding: 8px 10px; }
.tbl td { padding: 10px; border-top: 1px solid var(--line); }
.tbl tbody tr:hover { background: #fafbfc; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.warn { color: var(--bad); font-weight: 700; }

.log { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink-2); max-height: 260px; overflow: auto; }
.log div { padding: 4px 0; border-bottom: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

.login { max-width: 360px; margin: 12vh auto; }
