:root {
  --bg: #030303;
  --panel: #0a0b0b;
  --line: #2a2a27;
  --text: #efebe3;
  --muted: #8c8a84;
  --red: #e31317;
  --green: #2fb86f;
  --blue: #2aa7df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 45%, #0a0a08 0, #030303 42%, #000 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.topbar {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px 0;
}

.brand { display: flex; align-items: flex-start; gap: 12px; text-transform: uppercase; }
.brand-logo { width: 154px; height: auto; display: block; }
.brand-copy { display: flex; flex-direction: column; line-height: 0.95; padding-top: 22px; }
.brand-copy small { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }

.nav { display: flex; gap: 28px; color: #a6a29a; text-transform: uppercase; font-size: 12px; font-weight: 900; }
.nav i { display: inline-block; width: 7px; height: 7px; background: var(--red); margin-right: 9px; }

.ghost-button, .actions button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-transform: uppercase;
  font-weight: 900;
}
.actions button.danger-button { border-color: var(--red); color: var(--red); }

.sound-toggle {
  position: fixed;
  right: 48px;
  bottom: 48px;
  z-index: 20;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #050505;
  color: var(--text);
  border: 1px solid var(--line);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 1000;
  cursor: pointer;
}
.sound-toggle.is-playing {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.auth-layout {
  min-height: calc(100vh - 148px);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(240px, 0.55fr) minmax(360px, 0.75fr);
  gap: 36px;
  align-items: center;
  padding: 20px 56px 70px;
}

.eyebrow {
  color: #c7b46a;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 34px; height: 1px; background: #c7b46a; }

h1 {
  margin: 22px 0 22px;
  max-width: 620px;
  font-size: clamp(46px, 7vw, 74px);
  line-height: 0.92;
  text-transform: uppercase;
  font-weight: 1000;
}
h1 em { color: var(--red); font-style: normal; display: block; }

.hero-copy p, .headline p, .form p, .empty-box p, .status-box p, .connect-box p {
  color: #d4d0c8;
  font-size: 18px;
  line-height: 1.15;
  max-width: 520px;
  font-weight: 800;
  text-transform: uppercase;
}

.rider-panel {
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  overflow: hidden;
}
.rider-panel img { width: min(560px, 115%); filter: contrast(1.08) saturate(0.82); }

.auth-panel, .admin-panel, .status-box, .qr-box, .config-box, .empty-box, .connect-box, .timeline-box {
  border: 1px solid var(--line);
  background: rgba(8, 9, 8, 0.88);
}

.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tabs a { padding: 22px; text-align: center; text-transform: uppercase; font-weight: 1000; color: #8e8982; }
.tabs a.active { background: var(--text); color: #111; }

.form { padding: 30px; }
h2 { margin: 0 0 20px; text-transform: uppercase; font-size: 30px; line-height: 1; }

input {
  width: 100%;
  height: 48px;
  margin: 0 0 12px;
  background: #070707;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0 14px;
  font-size: 14px;
}

.red-button {
  border: 0;
  min-height: 52px;
  background: var(--red);
  color: #fff;
  padding: 0 26px;
  text-transform: uppercase;
  font-weight: 1000;
  display: inline-grid;
  place-items: center;
}
.red-button.inline { margin-bottom: 18px; }

.notice { padding: 14px 30px; border-bottom: 1px solid var(--line); text-transform: uppercase; font-weight: 900; }
.notice.bad { color: var(--red); }
.checks { display: grid; gap: 8px; margin-top: 20px; color: var(--green); font-weight: 900; }

.status-strip {
  margin: 0 48px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text);
  text-transform: uppercase;
  font-weight: 1000;
  font-size: 14px;
}
.progress { margin-left: auto; width: 260px; height: 7px; background: linear-gradient(90deg, var(--red) 0 86%, #222 86%); }

.cabinet, .admin-layout { padding: 42px 56px 92px; }
.headline { margin-bottom: 28px; }
.headline h1 { font-size: clamp(46px, 5vw, 68px); }
.telegram-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
}
.telegram-dialog {
  width: min(540px, 100%);
  border: 2px solid var(--text);
  background: #070707;
  padding: 30px;
  box-shadow: 0 0 0 5px var(--red), 0 24px 70px rgba(0,0,0,0.72);
}
.telegram-dialog p {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
}
.telegram-dialog .red-button { width: 100%; }

.access-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.access-grid > *, .access-box > *, .access-item > *, .donate-box > * { min-width: 0; }
.status-box, .qr-box, .config-box, .empty-box, .admin-panel, .connect-box, .donate-box, .access-box, .timeline-box { padding: 24px 26px; }
.status-primary { grid-column: span 3; }
.status-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.status-primary h2 { margin: 0; font-size: 26px; }
.status-primary p { margin: 0; color: var(--muted); font-weight: 1000; text-transform: uppercase; }
.timeline-box {
  grid-column: span 3;
}
.timeline-box .eyebrow { margin-bottom: 18px; }
.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  min-height: 86px;
  border-top: 4px solid var(--line);
  padding: 14px 10px 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 1000;
}
.timeline li.done {
  border-color: var(--green);
  color: var(--text);
}
.timeline li span, .timeline li small {
  display: block;
}
.timeline li small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.access-box {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.qr-box img, .qr-panel img { width: min(100%, 280px); background: var(--text); padding: 12px; }
.qr-panel h2, .access-panel h2 { margin-bottom: 14px; }
.qr-panel p, .access-panel p { color: var(--muted); font-weight: 900; text-transform: uppercase; }
.access-panel .eyebrow { margin-bottom: 18px; }
.access-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.access-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 1000;
}
.access-value {
  display: block;
  max-width: 100%;
  color: #ffe600;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.access-note {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}
.access-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}
.access-actions .red-button, .access-actions .copy-config { min-height: 48px; }
.vpn-open {
  background: #050505;
  border-color: var(--line);
  color: var(--text);
}
.access-full {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.access-full summary {
  cursor: pointer;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 1000;
}
.access-full pre {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #ffe600;
}
.connect-box { grid-column: span 3; }
.connect-box .eyebrow { margin-bottom: 18px; }
.activity-box form { margin-top: 18px; }
.activity-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.activity-cards div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.activity-cards span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 1000;
}
.activity-cards strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.donate-box {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 22px;
  min-height: 136px;
  border: 4px solid #fff;
  background:
    linear-gradient(90deg, #ff0033, #ffe600, #21f38a, #2aa7df, #ff0033);
  background-size: 380% 100%;
  color: #050505;
  box-shadow:
    0 0 0 5px #ffe600,
    0 0 34px rgba(255, 230, 0, 0.95),
    0 0 78px rgba(227, 19, 23, 0.7);
  position: relative;
  overflow: hidden;
  animation: donate-shine 4s linear infinite;
}
.donate-box::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.8) 47%, transparent 59%);
  transform: translateX(-45%);
  animation: donate-flare 2.3s ease-in-out infinite;
}
.donate-box > * { position: relative; z-index: 1; }
.donate-box .eyebrow { color: #050505; }
.donate-box h2 {
  max-width: 900px;
  color: #fff;
  margin: 0 0 10px;
  font-size: clamp(28px, 3.4vw, 44px);
  text-shadow: 4px 4px 0 #050505, 0 0 18px rgba(255,255,255,0.9);
}
.donate-box p {
  max-width: 900px;
  margin: 0 0 18px;
  color: #050505;
  text-transform: uppercase;
  font-weight: 1000;
  font-size: 14px;
  line-height: 1.25;
}
.connect-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.ghost-link {
  min-height: 52px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 20px;
  text-transform: uppercase;
  font-weight: 1000;
  display: inline-grid;
  place-items: center;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.copy-source {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.copy-status {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 1000;
}
.copy-config {
  min-height: 58px;
  border: 3px solid #fff;
  background: #ffe600;
  color: #050505;
  padding: 0 28px;
  text-transform: uppercase;
  font-family: inherit;
  font-size: 15px;
  font-weight: 1000;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--red);
}
.copy-config.small-copy {
  min-height: 38px;
  padding: 0 14px;
  border-width: 2px;
  box-shadow: 0 0 0 2px var(--red);
  font-size: 11px;
}
.copy-config:hover, .copy-config:focus-visible {
  background: var(--blue);
  border-color: #fff;
  color: #fff;
  outline: 3px solid #ffe600;
  outline-offset: 3px;
}
.donate-link {
  min-height: 58px;
  background: #050505;
  color: #ffe600;
  border: 3px solid #fff;
  padding: 0 28px;
  text-transform: uppercase;
  font-weight: 1000;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 0 0 4px #e31317;
}
.donate-link:hover, .donate-link:focus-visible {
  background: var(--blue);
  color: #fff;
  outline: 3px solid #050505;
  outline-offset: 3px;
}
@keyframes donate-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 380% 50%; }
}
@keyframes donate-flare {
  0%, 32% { transform: translateX(-55%) rotate(0deg); opacity: 0; }
  48% { opacity: 1; }
  74%, 100% { transform: translateX(55%) rotate(0deg); opacity: 0; }
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}
.steps li {
  min-height: 120px;
  border-top: 1px solid var(--line);
  padding: 16px 14px 0 42px;
  color: #d4d0c8;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  position: relative;
}
.steps li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: #090909;
  font-weight: 1000;
}

.state { color: var(--muted); text-transform: uppercase; font-weight: 1000; }
.state.active { color: var(--green); }
.state.pending_moderation { color: #c7b46a; }
.state.rejected, .state.blocked { color: var(--red); }

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #030303;
  border: 1px solid var(--line);
  padding: 18px;
  max-height: 430px;
  overflow: auto;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.admin-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #050505;
  color: var(--muted);
  padding: 0 16px;
  text-transform: uppercase;
  font-family: inherit;
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}
.admin-tabs button.active {
  background: var(--text);
  color: #050505;
  border-color: var(--text);
}
.admin-tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  background: var(--red);
  color: #fff;
}
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.admin-section { display: none; grid-template-columns: 1fr; gap: 24px; }
.admin-section.active { display: grid; }
.admin-panel.wide { grid-column: auto; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.overview-card {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 9, 8, 0.88);
  color: var(--text);
  padding: 18px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.overview-card span, .overview-card small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 1000;
}
.overview-card strong {
  color: var(--text);
  text-transform: uppercase;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 0.95;
  font-weight: 1000;
}
.overview-card.hot strong { color: var(--red); }
.overview-card.good strong { color: var(--green); }
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.row-form { display: grid; grid-template-columns: 210px 1fr; gap: 12px; align-items: end; }
.endpoint-form { display: grid; grid-template-columns: minmax(240px, 1fr) 220px; gap: 12px; }
.number-field { display: grid; gap: 8px; }
.number-field span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 1000;
}
.number-field input { margin: 0; }
.admin-note {
  margin: 14px 0 0;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 12px;
}
.admin-note.bad { color: var(--red); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-top: 1px solid var(--line); padding: 12px 8px; text-align: left; }
th { color: var(--muted); text-transform: uppercase; }
.invite-link-cell {
  min-width: min(360px, 42vw);
}
.invite-link-cell input {
  height: 38px;
  margin: 0 0 8px;
  font-size: 12px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.template-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.template-form label {
  display: grid;
  gap: 10px;
}
.template-form span {
  color: var(--text);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 1000;
}
textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: #050505;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}
.template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.template-footer small {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
  font-size: 10px;
}
.template-footer .red-button {
  min-height: 40px;
  padding: 0 18px;
}
.activity-cell { min-width: 180px; }
.activity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 1000;
}
.activity-pill.online {
  border-color: rgba(45, 201, 91, 0.62);
  color: var(--green);
  background: rgba(45, 201, 91, 0.10);
}
.activity-pill.offline {
  border-color: rgba(227, 19, 25, 0.48);
  color: var(--red);
  background: rgba(227, 19, 25, 0.08);
}
.activity-meta, .activity-traffic {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}
.activity-traffic { color: var(--text); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }

@media (max-width: 980px) {
  .topbar { padding: 18px 20px 0; height: auto; gap: 18px; align-items: flex-start; }
  .brand-logo { width: 132px; }
  .brand-copy { padding-top: 19px; }
  .nav { display: none; }
  .cabinet, .admin-layout { padding: 28px 20px 76px; }
  .auth-layout, .access-grid, .admin-grid { grid-template-columns: 1fr; padding-left: 0; padding-right: 0; }
  .rider-panel { min-height: 280px; }
  .rider-panel img { width: min(520px, 118%); }
  h1 { font-size: 46px; }
  h2 { font-size: 28px; }
  .headline h1 { font-size: 44px; }
  .admin-panel.wide { grid-column: auto; }
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 12px;
  }
  .admin-tabs button { flex: 0 0 auto; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-form { grid-template-columns: 1fr; }
  .endpoint-form { grid-template-columns: 1fr; }
  .connect-box, .donate-box, .access-box, .status-primary, .timeline-box { grid-column: auto; }
  .status-box, .qr-box, .config-box, .empty-box, .admin-panel, .connect-box, .donate-box, .access-box, .timeline-box { padding: 22px; }
  .status-primary { display: block; }
  .status-primary h2 { margin-bottom: 14px; }
  .donate-box { grid-template-columns: 1fr; min-height: 0; gap: 16px; }
  .donate-box h2 { font-size: 33px; }
  .donate-link { width: 100%; text-align: center; }
  .access-box { grid-template-columns: 1fr; }
  .access-panel { display: flex; flex-direction: column; }
  .qr-panel { display: none; }
  .qr-panel img { display: block; margin: 0 auto; width: min(100%, 260px); }
  .access-full { display: none; }
  .vpn-access-item { order: 1; }
  .file-access-item { order: 2; }
  .access-item { grid-template-columns: 1fr; gap: 12px; }
  .access-actions { flex-direction: column; justify-content: stretch; }
  .access-actions .red-button, .access-actions .copy-config { width: 100%; }
  .access-actions .vpn-open { order: -1; width: 100%; }
  .access-value { white-space: nowrap; overflow-wrap: normal; }
  .timeline, .activity-cards { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .sound-toggle { display: none; }
  .status-strip { margin: 20px; display: block; line-height: 1.5; }
  .progress { display: block; margin: 14px 0 0; width: 100%; }
}
