@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&family=Sora:wght@600;700&display=swap');

:root {
  --ink: #10233a;
  --muted: #5b6b7c;
  --line: #d7e0ea;
  --panel: #ffffffcc;
  --accent: #229ed9;
  --accent-2: #2aabee;
  --danger: #b42318;
  --ok: #0f7a4c;
  --warn: #9a6700;
  --bg1: #e8f0f4;
  --bg2: #f7f3ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(42, 171, 238, 0.18), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(16, 35, 58, 0.10), transparent 50%),
    linear-gradient(165deg, var(--bg1), var(--bg2) 55%, #eef2f6);
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; }
.page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 20px 88px;
  animation: rise 0.45s ease both;
}
.page.auth {
  width: min(640px, 100%);
  padding-top: 10vh;
}

.brand {
  font-family: Sora, Manrope, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  margin: 0 0 18px;
  color: var(--accent);
}
.brand.sm { margin-bottom: 6px; font-size: 0.92rem; }

h1 {
  font-family: Sora, Manrope, sans-serif;
  font-size: clamp(1.55rem, 4vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  font-weight: 700;
}
h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 42ch;
  line-height: 1.55;
  font-size: 1.02rem;
}
.muted { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.small { font-size: 0.84rem; margin-top: 8px; margin-bottom: 0; }

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(215, 224, 234, 0.9);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--muted);
}
.nav a:hover { background: rgba(42, 171, 238, 0.08); color: var(--ink); }
.nav a.on {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 8px 18px rgba(34, 158, 217, 0.25);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.top.tight { margin-bottom: 8px; align-items: center; }

.panel {
  background: var(--panel);
  border: 1px solid rgba(215, 224, 234, 0.95);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(16, 35, 58, 0.06);
}
.panel.clickable:hover { border-color: #8ecaf0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(34, 158, 217, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #efc4bf;
  box-shadow: none;
}
.btn.full { width: 100%; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.label {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  margin: 0 0 6px;
  color: var(--ink);
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: #8ecaf0;
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.16);
}
textarea.input { min-height: 96px; resize: vertical; }

.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .grid, .grid-3, .grid-5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid, .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .top { flex-direction: column; }
}

.stat .k { font-size: 0.78rem; color: var(--muted); }
.stat .v { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef3f7;
  color: var(--muted);
}
.badge.ok { background: #e6f6ee; color: var(--ok); }
.badge.warn { background: #fff6db; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--danger); }

.list { list-style: none; padding: 0; margin: 0; }
.item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #edf1f5;
  align-items: center;
}
.item:first-child { border-top: 0; }
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa8b5;
  display: inline-block;
}
.dot.on { background: #2aabee; box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.2); }
.sep { opacity: 0.5; }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.8rem;
  padding: 0 8px 10px 0;
}
.table td {
  padding: 12px 8px 12px 0;
  border-top: 1px solid #edf1f5;
  vertical-align: top;
}

.banner {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.banner.warn { background: #fff6db; color: #7a5b00; border: 1px solid #f0e0a0; }
.banner.ok { background: #e6f6ee; color: var(--ok); border: 1px solid #bfe8d2; }
.banner.bad { background: #fdecea; color: var(--danger); border: 1px solid #efc4bf; }
.banner.info { background: #eef7fc; color: #155a86; border: 1px solid #c5e4f6; }

.field { margin-bottom: 12px; }
.stack { display: grid; gap: 12px; }
.pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.84rem;
  max-height: 280px;
  overflow: auto;
  margin: 0;
}

.qr {
  width: 240px;
  height: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 4px 0 8px;
  display: block;
  box-shadow: 0 12px 28px rgba(16, 35, 58, 0.08);
}

.err { color: var(--danger); margin-top: 12px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
