:root {
  color-scheme: dark;
  --bg: #090d11;
  --top: #0b1015;
  --panel: #111820;
  --panel-2: #151f29;
  --line: #293744;
  --line-soft: rgba(255,255,255,.08);
  --text: #e8eef3;
  --muted: #96a7b3;
  --faint: #6e808d;
  --green: #54c39a;
  --green-soft: rgba(84,195,154,.12);
  --yellow: #d7b35f;
  --yellow-soft: rgba(215,179,95,.12);
  --red: #df7078;
  --red-soft: rgba(223,112,120,.13);
  --shadow: 0 24px 70px rgba(0,0,0,.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(84,195,154,.045), transparent 280px), var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }

.page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--top);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(84,195,154,.35);
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  flex: 0 0 auto;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; }
.brand span span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.nav a { color: var(--muted); }
.nav a.active { color: var(--text); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green); box-shadow: 0 0 14px var(--green); }

.wrap { width: min(1120px, calc(100vw - 40px)); margin: 0 auto; }
.hero { padding: 56px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 34px; align-items: start; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: #d9e7ed;
  font-size: 13px;
}
h1, h2, h3, p { margin: 0; }
h1 { max-width: 730px; font-size: clamp(34px, 5vw, 56px); line-height: 1.04; font-weight: 600; }
.lead { max-width: 690px; margin-top: 20px; color: #b7c6d0; font-size: 17px; line-height: 1.62; }

.card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(17,24,32,.88);
  box-shadow: 0 14px 38px rgba(0,0,0,.18);
}
.access-card { padding: 22px; box-shadow: var(--shadow); }
.access-card h2 { font-size: 21px; font-weight: 600; }
.access-card p { margin-top: 8px; color: var(--muted); line-height: 1.5; font-size: 14px; }
.form { display: grid; gap: 13px; margin-top: 20px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 13px; }
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1116;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}
input:focus { border-color: rgba(84,195,154,.8); box-shadow: 0 0 0 3px rgba(84,195,154,.12); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 13px;
  font-size: 14px;
  cursor: pointer;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #06231b; font-weight: 600; }
.notice {
  display: none;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(215,179,95,.35);
  border-radius: 7px;
  background: var(--yellow-soft);
  color: #ecd9ac;
  font-size: 13px;
  line-height: 1.45;
}
.notice.show { display: block; }
.loader { display: none; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.loader.show { display: flex; }
.loader i { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.17); border-top-color: var(--green); border-radius: 50%; animation: spin .85s linear infinite; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; padding: 14px 0 44px; }
.tile { padding: 16px; min-height: 126px; }
.tile h3 { font-size: 15px; font-weight: 600; margin-bottom: 9px; }
.tile p { color: var(--muted); font-size: 13px; line-height: 1.55; }

.console-shell { display: grid; grid-template-columns: 228px minmax(0,1fr); min-height: calc(100vh - 58px); }
.sidebar { border-right: 1px solid var(--line); background: #0c1218; padding: 14px 10px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; }
.side-nav { display: grid; gap: 5px; }
.side-nav span {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
  color: var(--muted);
  padding: 0 11px;
  font-size: 14px;
}
.side-nav span.active { background: var(--panel-2); color: var(--text); }
.side-box { border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(255,255,255,.025); padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.side-box b { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 500; }

.console-main { min-width: 0; padding: 18px; display: grid; gap: 16px; align-content: start; }
.view-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.view-head h1 { font-size: 24px; }
.sub { margin-top: 5px; color: var(--muted); font-size: 13px; }
.locked-layout { display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: 16px; align-items: start; }
.skeleton { padding: 16px; min-height: 410px; position: relative; overflow: hidden; }
.skeleton::after {
  content: "Данные рабочей области скрыты";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9,13,17,.34);
  backdrop-filter: blur(6px);
  color: #dfe8ed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.fake-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.fake-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.fake-stat { height: 84px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(255,255,255,.025); }
.bars { height: 210px; display: grid; grid-template-columns: repeat(20,1fr); align-items: end; gap: 6px; }
.bars i { min-height: 18px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, rgba(84,195,154,.55), rgba(84,195,154,.12)); }

.content-main { width: min(980px, calc(100vw - 40px)); margin: 0 auto; padding: 48px 0; }
.content-hero { margin-bottom: 18px; }
.content-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.content-hero p { max-width: 760px; margin-top: 14px; color: #b7c6d0; line-height: 1.6; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.content-card { padding: 18px; }
.content-card h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.content-card p, .content-card li { color: var(--muted); line-height: 1.6; }
.content-card ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.status-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.status-row:last-child { border-bottom: 0; }
.ok { color: #bcebc8; }

.error-main {
  width: min(860px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 72px 0;
  display: grid;
  gap: 16px;
}

.error-card {
  padding: 28px;
  box-shadow: var(--shadow);
}

.error-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(215,179,95,.35);
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #ecd9ac;
  font-size: 13px;
}

.error-card h1 {
  font-size: clamp(30px, 5vw, 46px);
}

.error-card p {
  max-width: 680px;
  margin-top: 14px;
  color: #b7c6d0;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.error-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.error-detail {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(17,24,32,.72);
}

.error-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.error-detail b {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
}

.footer {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--faint);
  font-size: 12px;
}
.footer span:last-child { display: flex; flex-wrap: wrap; gap: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .hero, .locked-layout { grid-template-columns: 1fr; }
  .console-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .topbar, .footer { flex-direction: column; align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
  .nav { flex-wrap: wrap; gap: 12px; }
  .wrap, .content-main, .footer { width: min(100% - 28px, 1120px); }
  .hero { padding-top: 36px; }
  .tiles, .content-grid, .fake-grid { grid-template-columns: 1fr; }
  .error-details { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .side-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .brand span span { display: none; }
}
