:root {
  --bg: #030505;
  --panel: #07100d;
  --panel-2: #0b1713;
  --panel-3: #10100d;
  --text: #eafff4;
  --muted: #8aa899;
  --soft: #173026;
  --line: rgba(49, 255, 138, 0.28);
  --line-strong: rgba(49, 255, 138, 0.58);
  --green: #31ff8a;
  --green-2: #11c96f;
  --cyan: #2cecff;
  --red: #ff3459;
  --amber: #ffd166;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --wrap: min(1180px, calc(100vw - 32px));
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(49, 255, 138, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 255, 138, 0.02) 1px, transparent 1px),
    linear-gradient(180deg, #030505 0%, #06110d 52%, #020303 100%);
  background-size: 36px 36px, 36px 36px, auto;
  color: var(--text);
  font: 15px/1.6 "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
  opacity: 0.28;
  z-index: 10;
  animation: scanlines 7s linear infinite;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: var(--wrap);
  margin: 0 auto;
  padding: 24px 0 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
  color: var(--green);
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: #06140f;
  color: var(--red);
  box-shadow: 0 0 28px rgba(49, 255, 138, 0.2);
  animation: signalPulse 2.4s ease-in-out infinite;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.nav a,
.nav button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 16, 13, 0.86);
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.nav a:hover,
.nav button:hover,
.btn:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--green);
  background: linear-gradient(180deg, #23e781 0%, #0a9c55 100%);
  color: #02100a;
  font-weight: 800;
}

.btn-danger {
  border-color: rgba(255, 52, 89, 0.7);
  color: #ffd7de;
  background: rgba(85, 12, 25, 0.72);
}

.btn-muted {
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  min-height: auto;
}

.hero-copy,
.terminal,
.panel,
.metric,
.table-wrap,
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(7, 16, 13, 0.96), rgba(4, 8, 7, 0.96));
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 22%, rgba(49, 255, 138, 0.07) 23%, transparent 24% 58%, rgba(255, 52, 89, 0.05) 59%, transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 92px, rgba(44, 236, 255, 0.08) 94px, transparent 96px);
  transform: translateX(-12%);
  animation: dataSweep 8s linear infinite;
  opacity: 0.46;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-copy::after {
  content: "ACCESS GRANTED / WEIGHT CHANNEL / MANUAL AUDIT";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 20px;
  color: rgba(49, 255, 138, 0.18);
  font: 700 12px/1 Consolas, "Courier New", monospace;
  letter-spacing: 0.16em;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--cyan);
  font: 700 12px/1.2 Consolas, "Courier New", monospace;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
  animation: signalPulse 1.4s ease-in-out infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--text);
  font: 900 clamp(42px, 6vw, 74px)/0.98 Consolas, "Courier New", monospace;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.lead {
  max-width: 690px;
  color: #b7d8c8;
  font-size: 17px;
}

.hero-actions,
.inline-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.terminal {
  overflow: hidden;
  animation: terminalGlow 3.6s ease-in-out infinite;
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #08110e;
  color: var(--muted);
  font: 700 12px/1 Consolas, "Courier New", monospace;
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dots i {
  width: 9px;
  height: 9px;
  background: var(--green);
}

.window-dots i:nth-child(2) {
  background: var(--amber);
}

.window-dots i:nth-child(3) {
  background: var(--red);
}

.terminal-body {
  padding: 18px;
}

.terminal-lines {
  min-height: 170px;
  margin: 0 0 18px;
  color: #c9ffe1;
  font: 14px/1.7 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  animation: terminalText 2.8s steps(2, end) infinite;
}

.panel,
.form-panel,
.table-wrap {
  padding: 20px;
}

.grid {
  display: grid;
  gap: 18px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font: 800 28px/1 Consolas, "Courier New", monospace;
}

.muted {
  color: var(--muted);
}

.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(49, 255, 138, 0.06);
}

.price-line strong {
  color: var(--green);
  font: 900 24px/1 Consolas, "Courier New", monospace;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-weight: 700;
}

.field .check-line,
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.check-line input {
  width: auto;
  accent-color: var(--green);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #030806;
  color: var(--text);
  outline: none;
  padding: 12px;
}

textarea {
  min-height: 190px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 255, 138, 0.12);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
}

.app-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 16, 13, 0.92);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.side-nav a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(49, 255, 138, 0.07);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(49, 255, 138, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(49, 255, 138, 0.07);
  white-space: nowrap;
}

.status.waiting_recharge,
.status.rejected {
  border-color: rgba(255, 52, 89, 0.55);
  background: rgba(255, 52, 89, 0.1);
}

.status.processing {
  border-color: rgba(44, 236, 255, 0.5);
  background: rgba(44, 236, 255, 0.1);
}

.status.completed {
  border-color: rgba(49, 255, 138, 0.65);
}

.domain-list {
  max-width: 360px;
  max-height: 160px;
  overflow: auto;
  color: #b8ffdc;
  font: 12px/1.6 Consolas, "Courier New", monospace;
}

.domain-list-visible {
  display: grid;
  gap: 3px;
  min-width: 170px;
}

.domain-list-visible span {
  display: block;
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 116px;
}

.message-cell {
  min-width: 260px;
  max-width: 520px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-form {
  margin-top: 18px;
}

.quote {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quote div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(49, 255, 138, 0.06);
}

.quote span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quote strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 30;
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: min(540px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050b09;
  box-shadow: var(--shadow);
  padding: 22px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #06110d;
  color: var(--text);
  z-index: 40;
}

.toast.show {
  display: block;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .feature-grid,
  .metrics,
  .quote,
  .settings-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }
}

@keyframes scanlines {
  from { transform: translateY(0); }
  to { transform: translateY(12px); }
}

@keyframes dataSweep {
  from { transform: translateX(-18%); }
  to { transform: translateX(18%); }
}

@keyframes signalPulse {
  0%, 100% { opacity: 0.72; box-shadow: 0 0 10px rgba(49, 255, 138, 0.15); }
  50% { opacity: 1; box-shadow: 0 0 28px rgba(49, 255, 138, 0.38); }
}

@keyframes terminalGlow {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 rgba(49, 255, 138, 0); }
  50% { box-shadow: var(--shadow), 0 0 34px rgba(49, 255, 138, 0.12); }
}

@keyframes terminalText {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .hero-actions,
  .inline-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav,
  .nav a,
  .nav button,
  .btn {
    width: 100%;
  }

  .feature-grid,
  .metrics,
  .quote,
  .settings-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow-x: auto;
  }
}
