:root {
  color-scheme: dark;
  --bg: #030812;
  --bg-soft: #07101d;
  --panel: rgba(12, 21, 36, 0.86);
  --panel-strong: rgba(15, 26, 45, 0.96);
  --panel-muted: rgba(20, 32, 52, 0.72);
  --line: rgba(142, 156, 189, 0.16);
  --line-bright: rgba(147, 93, 255, 0.5);
  --text: #f6f8ff;
  --muted: #94a2bd;
  --dim: #66728d;
  --purple: #7c3cff;
  --purple-2: #a065ff;
  --green: #3bd777;
  --orange: #ff9a3c;
  --cyan: #31d4d4;
  --danger: #ff5b77;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(82, 54, 184, 0.18), transparent 28rem),
    linear-gradient(135deg, #030710 0%, #07101d 52%, #050914 100%);
  color: var(--text);
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background:
    linear-gradient(rgba(3, 8, 18, 0.7), rgba(3, 8, 18, 0.94)),
    url("./assets/login-register-bg.png") center / cover;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.boot-screen img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: rocketFloat 1.8s ease-in-out infinite;
}

.animate-in {
  animation: panelIn 360ms ease both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rocketFloat {
  0%, 100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background:
    linear-gradient(rgba(3, 8, 18, 0.9), rgba(3, 8, 18, 0.92)),
    url("./assets/bg-with-server.png") center / cover fixed;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(3, 9, 19, 0.82);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-button,
.account-button,
.icon-button,
.ghost-button,
.primary-button,
.pay-button,
.quick-amount,
.table-action {
  transition: 160ms ease;
}

.nav-button {
  width: 100%;
  min-height: 43px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  color: #bac5dd;
  background: transparent;
  text-align: left;
}

.nav-button svg,
.icon-button svg,
.ghost-button svg,
.primary-button svg,
.table-action svg,
.status-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(124, 60, 255, 0.15);
}

.nav-button.active svg {
  color: var(--purple-2);
}

.account {
  margin-top: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 27, 47, 0.78);
}

.account-button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #111827;
}

.money {
  color: var(--green);
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.ghost-button,
.primary-button,
.pay-button,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  color: var(--text);
}

.icon-button {
  width: 38px;
  height: 38px;
  background: rgba(14, 25, 43, 0.7);
  border: 1px solid var(--line);
}

.icon-button:hover,
.ghost-button:hover,
.table-action:hover {
  border-color: rgba(162, 113, 255, 0.54);
  background: rgba(124, 60, 255, 0.16);
}

.primary-button {
  min-height: 40px;
  padding: 0 16px;
  background: linear-gradient(135deg, #7f43ff, #5525d9);
  box-shadow: 0 12px 26px rgba(92, 41, 216, 0.32);
}

.primary-button:hover,
.pay-button:hover,
.quick-amount:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(15, 27, 47, 0.76);
}

.page {
  max-width: 1240px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px 250px;
  gap: 18px;
  margin-bottom: 18px;
}

.welcome {
  padding: 26px 28px;
  background:
    linear-gradient(90deg, rgba(8, 15, 28, 0.94), rgba(8, 15, 28, 0.76)),
    url("./assets/bg-with-server.png") right center / cover;
}

.eyebrow,
.small-label {
  color: var(--muted);
  font-size: 12px;
}

.welcome h1,
.section-title h2,
.auth-copy h1 {
  margin: 0;
  letter-spacing: 0;
}

.welcome h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

.welcome p,
.auth-copy p,
.muted {
  color: var(--muted);
}

.profile-card {
  padding: 17px;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
}

.profile-card .avatar {
  width: 76px;
  height: 76px;
}

.profile-card h3,
.wallet-card h3 {
  margin: 0 0 5px;
}

.profile-card p,
.wallet-card p {
  margin: 3px 0;
}

.wallet-card {
  padding: 18px;
}

.wallet-card strong {
  display: block;
  margin: 8px 0 14px;
  font-size: 28px;
}

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

.stat-card {
  min-height: 96px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-icon {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(124, 60, 255, 0.16);
  color: var(--purple-2);
  flex: 0 0 auto;
}

.status-icon.green {
  color: var(--green);
  background: rgba(59, 215, 119, 0.12);
}

.status-icon.orange {
  color: var(--orange);
  background: rgba(255, 154, 60, 0.12);
}

.status-icon.cyan {
  color: var(--cyan);
  background: rgba(49, 212, 212, 0.12);
}

.stat-card strong {
  display: block;
  font-size: 24px;
}

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}

.section-title h2 {
  font-size: 22px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.server-list,
.domain-list,
.activity-list,
.transaction-list {
  display: grid;
  gap: 12px;
}

.server-row,
.domain-row,
.activity-row,
.transaction-row,
.file-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(12, 23, 41, 0.74);
}

.server-row {
  min-height: 78px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1.3fr) repeat(3, minmax(90px, 0.6fr)) auto;
  gap: 14px;
  align-items: center;
}

.server-name,
.domain-name,
.file-name,
.activity-title {
  font-weight: 750;
}

.server-meta,
.domain-meta,
.file-meta,
.activity-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #bff9d4;
  background: rgba(59, 215, 119, 0.16);
}

.badge.offline {
  color: #ffb690;
  background: rgba(255, 128, 60, 0.16);
}

.badge.neutral {
  color: #c7d0e8;
  background: rgba(148, 162, 189, 0.14);
}

.activity-panel {
  padding: 18px;
}

.activity-row,
.transaction-row {
  padding: 14px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.activity-row:last-child,
.transaction-row:last-child {
  border-bottom: 0;
}

.activity-value {
  text-align: right;
  color: var(--green);
  font-weight: 700;
}

.activity-value.negative {
  color: #ffbd78;
}

.view-card {
  padding: 22px;
}

.server-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.spaced {
  margin-top: 18px;
}

.order-card {
  display: grid;
  gap: 16px;
}

.domain-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: rgba(4, 10, 20, 0.64);
}

.domain-builder input {
  min-height: 48px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: rgba(12, 22, 39, 0.84);
  padding: 0 14px;
}

.domain-builder span {
  min-width: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-left: 1px solid var(--line);
  background: rgba(14, 25, 43, 0.92);
}

.promo-band {
  min-height: 150px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(60, 35, 153, 0.72), rgba(8, 15, 28, 0.88)),
    url("./assets/bg-with-server.png") right center / cover;
}

.promo-band h3 {
  margin: 0 0 8px;
  font-size: 23px;
}

.domain-row {
  min-height: 70px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) 140px 120px auto;
  align-items: center;
  gap: 14px;
}

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

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

.quick-amount {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(14, 25, 43, 0.78);
}

.quick-amount.active {
  border-color: var(--line-bright);
  background: rgba(124, 60, 255, 0.14);
}

.quick-amount strong {
  display: block;
  font-size: 21px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(4, 10, 20, 0.64);
  overflow: hidden;
}

.input-row input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: rgba(12, 22, 39, 0.84);
  padding: 0 12px;
}

.input-row span {
  min-width: 52px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-left: 1px solid var(--line);
  background: rgba(14, 25, 43, 0.92);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.pay-button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(14, 25, 43, 0.78);
}

.pay-button.active {
  border-color: var(--line-bright);
  background: rgba(124, 60, 255, 0.18);
}

.file-manager {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
}

.file-manager.single {
  grid-template-columns: 1fr;
}

.toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-select {
  min-height: 38px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(14, 25, 43, 0.92);
  padding: 0 12px;
}

.tree {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 16, 29, 0.76);
}

.tree-item {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  color: #c8d2e8;
}

.tree-item.active {
  background: rgba(124, 60, 255, 0.14);
  color: #fff;
}

.file-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-header,
.file-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 150px auto;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
}

.file-header {
  min-height: 44px;
  color: var(--muted);
  background: rgba(14, 25, 43, 0.86);
  font-size: 12px;
}

.file-row {
  min-height: 48px;
  border-width: 1px 0 0;
  border-radius: 0;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.editor-shell {
  display: grid;
  gap: 14px;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.editor-toolbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-area {
  width: 100%;
  min-height: 510px;
  padding: 20px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #d4e1ff;
  background: rgba(3, 7, 13, 0.88);
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  line-height: 1.58;
}

.bot-manager-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.bot-console {
  width: 100%;
  min-height: 480px;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #a5ff90;
  background: rgba(3, 7, 13, 0.88);
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-console-panel .editor-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.bot-editor-area {
  min-height: 460px;
}

.settings-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field textarea {
  min-height: 130px;
  padding-top: 12px;
  resize: vertical;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  background:
    linear-gradient(90deg, rgba(3, 7, 16, 0.92) 0%, rgba(3, 7, 16, 0.5) 48%, rgba(3, 7, 16, 0.94) 100%),
    url("./assets/login-register-bg.png") center / cover;
}

.auth-copy {
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.auth-copy h1 {
  max-width: 580px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
}

.auth-copy p {
  max-width: 520px;
  font-size: 17px;
}

.auth-panel-wrap {
  display: grid;
  place-items: center;
  padding: 30px;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 34px;
}

.auth-panel .brand {
  justify-content: center;
  margin-bottom: 22px;
}

.auth-panel h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 25px;
}

.auth-panel p {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-switch {
  margin-top: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.link-button {
  color: var(--purple-2);
  background: transparent;
  padding: 0;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row input {
  accent-color: var(--purple);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
}

.modal-backdrop.active {
  display: grid;
}

.empty-state {
  min-height: 160px;
  border: 1px dashed rgba(148, 162, 189, 0.24);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  background: rgba(12, 23, 41, 0.42);
  text-align: center;
  padding: 20px;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  color: var(--purple-2);
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(59, 215, 119, 0.34);
  border-radius: 7px;
  color: #dcffe8;
  background: rgba(10, 36, 24, 0.94);
  box-shadow: var(--shadow);
  animation: panelIn 180ms ease both;
}

.toast.danger {
  color: #ffe4e8;
  border-color: rgba(255, 91, 119, 0.42);
  background: rgba(46, 13, 22, 0.95);
}

.guide {
  line-height: 1.8;
}

.guide ol {
  margin: 0 0 18px 22px;
  color: #d8e1f8;
}

.guide strong {
  color: #fff;
}

.modal {
  width: min(520px, 100%);
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 82px 1fr;
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand span,
  .nav-button span,
  .account-button div,
  .account-button svg {
    display: none;
  }

  .brand,
  .nav-button {
    justify-content: center;
  }

  .hero-grid,
  .dashboard-lower,
  .wallet-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .account-button {
    grid-template-columns: 36px;
    justify-content: start;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 38px 38px minmax(0, 1fr);
    justify-content: stretch;
  }

  .topbar .primary-button {
    min-width: 0;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .welcome {
    padding: 24px;
    overflow: hidden;
    background-position: 72% center;
  }

  .welcome h1 {
    font-size: 26px;
  }

  .welcome p {
    max-width: 290px;
  }

  .stats-grid,
  .amount-grid,
  .payment-grid,
  .settings-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .server-row,
  .domain-row,
  .file-header,
  .file-row {
    grid-template-columns: 1fr auto;
  }

  .server-row > :nth-child(n + 4):not(:last-child),
  .domain-row > :nth-child(3),
  .file-header > :nth-child(n + 2),
  .file-row > :nth-child(n + 2):not(:last-child) {
    display: none;
  }

  .file-manager {
    grid-template-columns: 1fr;
  }

  .bot-manager-grid {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    min-height: 34vh;
    padding: 28px;
  }

  .auth-panel-wrap {
    place-items: start center;
  }
}
