:root {
  --bg: #06070b;
  --bg-elevated: #10131c;
  --bg-soft: #171c29;
  --stroke: rgba(130, 160, 255, 0.18);
  --text: #f4f7ff;
  --muted: #93a0bd;
  --blue: #3297ff;
  --blue-strong: #1677ff;
  --yellow: #f5bf3c;
  --red: #ff5f73;
  --green: #4ad2a6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(47, 105, 255, 0.18), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 224, 111, 0.08), transparent 26%),
    var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.is-hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 calc(14px + env(safe-area-inset-right, 0px)) 40px calc(14px + env(safe-area-inset-left, 0px));
}

body.admin-mode .shell {
  max-width: 980px;
}

.header-stack {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 18px;
  margin-left: calc(-1 * (14px + env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * (14px + env(safe-area-inset-right, 0px)));
  padding: calc(18px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-left, 0px)) 16px calc(14px + env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.99) 0%, rgba(6, 7, 11, 0.96) 55%, rgba(6, 7, 11, 0.88) 88%, rgba(6, 7, 11, 0) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.admin-mode .header-stack {
  padding-bottom: 18px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(6, 7, 11, 0.995) 0%, rgba(6, 7, 11, 0.97) 70%, rgba(6, 7, 11, 0.92) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.header-balance {
  flex-shrink: 0;
  text-align: right;
  text-decoration: none;
  color: inherit;
  line-height: 1.15;
  padding: 4px 0 2px;
}

.header-balance-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-balance-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.header-balance-amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-balance-currency {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.brand > span {
  min-width: 0;
}

.brand img {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(20, 118, 255, 0.22);
}

.brand-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  border-radius: 28px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  margin-bottom: 18px;
}

.surface-card {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  margin-bottom: 18px;
}

.warn {
  background: linear-gradient(180deg, rgba(245,191,60,0.18), rgba(245,191,60,0.08));
  border-color: rgba(245,191,60,0.35);
  color: #fff4cf;
}

.hero-balance {
  font-size: 3.2rem;
  font-weight: 800;
  margin: 6px 0 6px;
}

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

.button-row,
.stack {
  display: grid;
  gap: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-strong));
  color: white;
  box-shadow: 0 12px 24px rgba(22,119,255,0.28);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--stroke);
}

.btn-danger {
  background: rgba(255,95,115,0.08);
  color: #ffd3d9;
  border-color: rgba(255,95,115,0.28);
}

.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  border-color: var(--stroke);
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.admin-nav-card {
  margin-top: 12px;
  padding: 14px 16px 16px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(22, 32, 52, 0.92) 0%, rgba(12, 16, 26, 0.96) 100%);
  border: 1px solid rgba(100, 140, 255, 0.28);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d2dff5;
  border: 1px solid rgba(130, 160, 255, 0.28);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-nav-link:hover {
  background: rgba(50, 151, 255, 0.18);
  color: #f2f8ff;
  border-color: rgba(90, 175, 255, 0.55);
  box-shadow: 0 4px 20px rgba(22, 119, 255, 0.2);
  transform: translateY(-1px);
}

.admin-nav-link.is-active {
  background: linear-gradient(180deg, rgba(62, 165, 255, 0.42), rgba(22, 119, 255, 0.28));
  color: #ffffff;
  border-color: rgba(120, 195, 255, 0.75);
  box-shadow:
    0 0 0 1px rgba(120, 195, 255, 0.25),
    0 10px 28px rgba(22, 119, 255, 0.35);
}

.admin-nav-link.is-logout {
  color: #ffd3d9;
  border-color: rgba(255, 95, 115, 0.35);
  background: rgba(255, 95, 115, 0.06);
}

.admin-nav-link.is-logout:hover {
  background: rgba(255, 95, 115, 0.18);
  border-color: rgba(255, 95, 115, 0.5);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2, .section-head h3, .section-head h1 {
  margin: 0;
}

.device-list {
  display: grid;
  gap: 14px;
}

.device-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
}

a.device-item.pay-tile {
  display: block;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

a.device-item.pay-tile:hover {
  background: rgba(50,151,255,0.08);
  border-color: rgba(50,151,255,0.35);
}

.device-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.device-live-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.device-live-inline {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(50,151,255,0.12);
  color: #b7dcff;
  font-size: 0.85rem;
}

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

.list-table th, .list-table td {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}

.copy-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: #0a0d14;
  border: 1px solid var(--stroke);
}

.wg-help-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
}

.wg-help-card h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.wg-help-list {
  margin: 0 0 10px;
  padding-left: 18px;
  color: #d7e1f7;
  line-height: 1.45;
}

.wg-help-list li {
  margin-bottom: 6px;
}

.wg-help-alert {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,72,72,0.16);
  border: 1px solid rgba(255,72,72,0.55);
  color: #ffe4e4;
  font-size: 0.92rem;
}

/* Destek (Telegram) — LAN uyarisyla ayni kirmizi kutu */
.wizard-support-alert {
  margin-top: 16px;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255,72,72,0.16);
  border: 1px solid rgba(255,72,72,0.55);
  color: #ffe4e4;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-support-alert .wizard-support-hint {
  margin: 0;
  font-size: 0.92rem;
  color: #ffd4d4;
  line-height: 1.45;
}

.wizard-support-alert .btn-support-telegram {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.14);
  color: #fff8f8;
  border: 1px solid rgba(255,200,200,0.5);
  text-decoration: none;
  font-weight: 600;
  box-shadow: none;
}

.wizard-support-alert .btn-support-telegram:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.wg-help-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mono {
  font-family: "Cascadia Code", "Consolas", monospace;
  word-break: break-all;
}

.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.device-help-text {
  line-height: 1.55;
}

.device-help-text .mono {
  display: block;
  margin-top: 6px;
}

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

.metric {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  background: rgba(74,210,166,0.08);
  border: 1px solid rgba(74,210,166,0.25);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.flash-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.flash-message {
  line-height: 1.45;
}

.flash-close {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.06);
  color: #dce7ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.flash-close:hover {
  background: rgba(255,255,255,0.14);
}

.flash.error {
  background: rgba(255,95,115,0.1);
  border-color: rgba(255,95,115,0.25);
}

.footer-note {
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
  font-size: 0.9rem;
}

.panel-card {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.table .admin-col-sira {
  width: 48px;
  max-width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.table td:first-child,
.table th:first-child {
  padding-left: 0;
}

.table td:last-child,
.table th:last-child {
  padding-right: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: rgba(255,255,255,0.03);
}

.table-sticky-first-last th:first-child,
.table-sticky-first-last td:first-child {
  position: sticky;
  left: 0;
  background: #0b0f18;
  z-index: 2;
}

.table-sticky-first-last th:last-child,
.table-sticky-first-last td:last-child,
.table-sticky-last th:last-child,
.table-sticky-last td:last-child {
  position: sticky;
  right: 0;
  background: #0b0f18;
  z-index: 2;
}

.input {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: #090c14;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.is-online {
  color: #d7fff1;
  background: rgba(74,210,166,0.18);
  border: 1px solid rgba(74,210,166,0.34);
}

.status-chip.is-recent {
  color: #fff4cf;
  background: rgba(245,191,60,0.16);
  border: 1px solid rgba(245,191,60,0.30);
}

.status-chip.is-offline {
  color: #d6ddf0;
  background: rgba(147,160,189,0.16);
  border: 1px solid rgba(147,160,189,0.30);
}

.status-chip.is-warning {
  color: #ffd7d7;
  background: rgba(226,94,94,0.17);
  border: 1px solid rgba(226,94,94,0.34);
}

.admin-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.03);
  color: #dce7ff;
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-pill-sm {
  padding: 4px 8px;
  font-size: 0.76rem;
}

.admin-product-pill {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-filter-stack {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.02);
}

.admin-tr1-panel {
  padding: 20px;
}

.admin-tr1-head {
  align-items: flex-start;
  gap: 14px;
}

.admin-tr1-title-wrap {
  display: grid;
  gap: 6px;
}

.admin-tr1-subtitle {
  margin: 0;
  line-height: 1.45;
  max-width: 760px;
}

.admin-tr1-alert {
  margin-bottom: 12px;
}

.admin-tr1-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-server-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.admin-server-tab {
  min-height: 52px;
  min-width: 92px;
  border-radius: 999px;
  padding: 0 22px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0;
}

.admin-server-tab.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(62, 165, 255, 0.4), rgba(22, 119, 255, 0.28));
  border-color: rgba(120, 195, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(120, 195, 255, 0.2), 0 6px 18px rgba(22, 119, 255, 0.28);
}

.admin-tr1-server-wrap {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.admin-tr1-server-pill {
  min-height: 34px;
  align-self: center;
  border-color: rgba(74, 210, 166, 0.34);
  background: rgba(74, 210, 166, 0.12);
  color: #d8ffef;
}

.admin-tr1-flag {
  min-height: 64px;
  min-width: 108px;
  border-radius: 14px;
  border: 1px solid rgba(120, 195, 255, 0.35);
  background: rgba(13, 21, 37, 0.66);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.admin-tr1-flag.is-de1 {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
}

.de-stripe {
  width: 100%;
  height: 100%;
}

.de-black { background: #111111; }
.de-red { background: #c81f2f; }
.de-gold { background: #efc33d; }

.admin-tr1-flag.is-tr1 {
  background: #d11f2b;
  animation: tr-flag-wave 1.8s ease-in-out infinite;
  transform-origin: left center;
}

.admin-tr1-flag.is-tr1::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0 8px,
    rgba(255, 255, 255, 0) 8px 16px
  );
  opacity: 0.26;
  pointer-events: none;
}

.tr-crescent {
  position: absolute;
  left: 24px;
  top: 18px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  z-index: 1;
}

.tr-crescent::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d11f2b;
}

.tr-star {
  position: absolute;
  left: 56px;
  top: 24px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  z-index: 1;
}

@keyframes tr-flag-wave {
  0%,
  100% {
    transform: perspective(380px) rotateY(0deg) translateY(0);
  }
  25% {
    transform: perspective(380px) rotateY(-15deg) translateY(-1px);
  }
  50% {
    transform: perspective(380px) rotateY(14deg) translateY(1px);
  }
  75% {
    transform: perspective(380px) rotateY(-9deg) translateY(0);
  }
}

.admin-tr1-form {
  max-width: 980px;
  margin-bottom: 16px;
  gap: 14px;
}

.admin-tr1-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-tr1-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.admin-inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-inline-check input {
  margin: 0;
}

.admin-muted-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-muted-check input {
  margin: 0;
}

.admin-tr1-submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-tr1-submit-row .btn {
  min-width: 220px;
}

.admin-table-user {
  min-width: 240px;
}

.admin-switch-form {
  margin-top: 6px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-transfer-form {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-transfer-input {
  width: 120px;
  min-width: 120px;
}

.admin-device-add-wrap {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
}

.admin-device-add-form {
  font-size: 1rem;
}

.admin-device-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.admin-device-add-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 220px;
}

.admin-device-add-row .input.admin-device-add-control {
  width: 100%;
  min-height: 48px;
  height: 48px;
  margin: 0;
  line-height: 1.25;
  font-family: inherit;
  font-size: inherit;
}

select.input.admin-device-add-control {
  cursor: pointer;
}

.admin-device-add-submit {
  min-height: 48px;
  height: 48px;
  align-self: flex-end;
  padding: 0 22px;
  box-sizing: border-box;
}

.admin-link-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(50,151,255,0.34);
  background: rgba(50,151,255,0.16);
  color: #cfe5ff;
  font-weight: 700;
}

/* Admin UI polish (layout + readability) */
body.admin-mode .shell {
  max-width: 1120px;
  padding-bottom: 48px;
}

body.admin-mode .panel-card {
  border-radius: 22px;
  border-color: rgba(120, 160, 255, 0.24);
  background: linear-gradient(180deg, rgba(22, 28, 44, 0.92), rgba(11, 15, 26, 0.96));
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.admin-mode .section-head h1,
body.admin-mode .section-head h2 {
  letter-spacing: 0.01em;
}

body.admin-mode .admin-filter-stack {
  border-radius: 16px;
  border-color: rgba(125, 165, 255, 0.28);
  background: rgba(10, 15, 28, 0.72);
}

body.admin-mode .input,
body.admin-mode .select,
body.admin-mode select.input,
body.admin-mode .table-wrap select {
  border-radius: 12px;
  border-color: rgba(118, 159, 255, 0.3);
  background: rgba(8, 12, 22, 0.92);
}

body.admin-mode .input:focus,
body.admin-mode select:focus {
  outline: none;
  border-color: rgba(92, 175, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(60, 145, 255, 0.16);
}

body.admin-mode .btn {
  border-radius: 14px;
}

body.admin-mode .btn-primary {
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.34);
}

body.admin-mode .btn-secondary,
body.admin-mode .btn-ghost {
  border-color: rgba(118, 159, 255, 0.26);
}

body.admin-mode .stats-grid {
  gap: 14px;
}

body.admin-mode .stat {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(120, 160, 255, 0.22);
  background: rgba(8, 13, 24, 0.74);
}

body.admin-mode .stat-label {
  font-size: 0.8rem;
  color: #9eb1d7;
}

body.admin-mode .stat-value {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f2f7ff;
}

body.admin-mode .table-wrap {
  border: 1px solid rgba(120, 160, 255, 0.2);
  border-radius: 14px;
  background: rgba(8, 12, 21, 0.66);
}

body.admin-mode .table {
  font-size: 0.9rem;
}

body.admin-mode .table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(9, 13, 24, 0.96);
  color: #a9bbde;
  border-bottom: 1px solid rgba(120, 160, 255, 0.24);
}

body.admin-mode .table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

body.admin-mode .table td {
  border-bottom-color: rgba(255, 255, 255, 0.055);
}

body.admin-mode .clickable-row:hover td {
  background: rgba(58, 125, 255, 0.085) !important;
}

body.admin-mode .table-sticky-first-last th:first-child,
body.admin-mode .table-sticky-first-last td:first-child,
body.admin-mode .table-sticky-first-last th:last-child,
body.admin-mode .table-sticky-first-last td:last-child,
body.admin-mode .table-sticky-last th:last-child,
body.admin-mode .table-sticky-last td:last-child {
  background: rgba(9, 13, 24, 0.98);
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.topup-intro {
  line-height: 1.55;
  margin-bottom: 6px;
}

.topup-stack .topup-block {
  padding-bottom: 16px;
}

.topup-active {
  margin: 12px 0 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.topup-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topup-form .btn {
  margin-top: 10px;
  align-self: flex-start;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}

.form-field label {
  font-size: 0.88rem;
  color: var(--muted);
}

.select-input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #090c14;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.error-inline {
  color: var(--red);
}

.select-all {
  user-select: all;
}

.field,
input[type="text"] {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: #090c14;
  color: var(--text);
  padding: 0 14px;
}

.empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--muted);
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wizard-step {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.wizard-step.active {
  background: rgba(50,151,255,0.14);
  color: #dcecff;
  border-color: rgba(50,151,255,0.32);
}

.wizard-step.done {
  background: rgba(74,210,166,0.12);
  color: #d6fff1;
  border-color: rgba(74,210,166,0.24);
}

.wizard-choice {
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.wizard-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.notice-banner {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(34, 50, 70, 0.9);
  border: 1px solid rgba(98, 143, 255, 0.16);
}

.notice-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffac2f;
  color: white;
  font-weight: 800;
}

.notice-text {
  line-height: 1.35;
  font-weight: 600;
}

.notice-body {
  min-width: 0;
}

.notice-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(98, 143, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.balance-panel {
  text-align: center;
  padding: 22px 16px 8px;
  margin-bottom: 16px;
}

.balance-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.balance-value {
  font-size: 4rem;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 12px;
}

.balance-value span {
  font-size: 0.38em;
  color: rgba(255,255,255,0.45);
}

.balance-meta {
  color: #8ea0c5;
}

.action-grid {
  display: grid;
  gap: 12px;
}

.action-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.action-tile {
  min-height: 96px;
  padding: 16px 14px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #162131;
  border: 1px solid rgba(98, 143, 255, 0.12);
  color: #3d95ff;
  font-weight: 700;
}

.action-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2583ff;
  color: white;
  font-size: 1rem;
}

.compact {
  margin-bottom: 12px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #163257;
  border: 1px solid rgba(98, 143, 255, 0.12);
  color: #47a0ff;
  font-weight: 700;
  cursor: pointer;
}

.device-card .device-list.compact {
  gap: 10px;
}

.hit-device {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
}

.device-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: linear-gradient(180deg, #3a96ff, #2577ff);
}

.device-body {
  min-width: 0;
}

.device-body strong {
  display: block;
  margin-bottom: 4px;
}

.device-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.device-id-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(50, 151, 255, 0.14);
  border: 1px solid rgba(98, 143, 255, 0.12);
  color: #b7dcff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tariff-line {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.invite-card {
  text-align: center;
}

.invite-emoji {
  font-size: 2.1rem;
  margin-bottom: 10px;
}

.invite-card h2,
.invite-card h1 {
  margin-top: 0;
  margin-bottom: 10px;
}

.invite-copy {
  line-height: 1.45;
  margin-bottom: 16px;
}

.guides-block {
  margin-bottom: 18px;
}

.guides-title {
  color: #b9c4de;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.guide-list {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.03);
}

.guide-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.guide-link:last-child {
  border-bottom: 0;
}

.guide-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.guide-icon {
  width: 24px;
  text-align: center;
}

.guide-arrow {
  color: var(--muted);
  font-size: 1.4rem;
}

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

.amount-card {
  width: 100%;
  min-height: 76px;
  border: 1px solid rgba(98, 143, 255, 0.12);
  border-radius: 18px;
  background: #162131;
  color: #f4f7ff;
  font-weight: 700;
  cursor: pointer;
}

.topup-status-box {
  margin-top: 18px;
}

.topup-copy-head {
  display: grid;
  gap: 4px;
}

.copy-value-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 143, 255, 0.16);
  border-radius: 16px;
  background: #131b28;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}

.copy-value-button .mono {
  font-size: 1rem;
  letter-spacing: 0.08em;
  word-break: normal;
}

.copy-value-label {
  white-space: nowrap;
  color: #78b8ff;
  font-size: 0.88rem;
  font-weight: 700;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-amount {
  white-space: nowrap;
  font-weight: 700;
}

.history-amount.positive {
  color: #75dcae;
}

.history-amount.negative {
  color: #ff8a98;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.guide-steps {
  display: grid;
  gap: 12px;
}

.guide-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
}

.guide-step-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(50,151,255,0.16);
  color: #b7dcff;
  font-size: 0.9rem;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(6px);
  z-index: 80;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(100%, 420px);
  position: relative;
  padding: 24px 20px 20px;
  border-radius: 24px;
  background: #1a2431;
  border: 1px solid rgba(98, 143, 255, 0.14);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: rgba(98, 143, 255, 0.12);
  color: #bfd8ff;
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-emoji {
  font-size: 2rem;
  margin-bottom: 12px;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.modal-copy {
  line-height: 1.45;
  margin: 0 0 18px;
}

.modal-action {
  width: 100%;
}

.admin-drawer-card {
  text-align: left;
}

.admin-drawer-body {
  display: grid;
  gap: 8px;
}

.drawer-line {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stroke);
}

.wizard-screen {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.wizard-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.wizard-back {
  color: #56a2ff;
  font-size: 1.05rem;
}

.wizard-balance {
  text-align: right;
  color: #c2cce0;
  font-size: 0.95rem;
}

.wizard-balance strong {
  display: block;
  font-size: 1.45rem;
  color: white;
}

.wizard-hero {
  text-align: center;
  font-size: 2.3rem;
  margin-bottom: 12px;
}

.wizard-kicker {
  text-align: center;
  color: var(--muted);
  margin-bottom: 8px;
}

.wizard-title {
  text-align: center;
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 14px;
}

.wizard-copy {
  text-align: center;
  color: #d7e1f7;
  line-height: 1.5;
  margin: 0 0 18px;
}

.wizard-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.wizard-option-list,
.wizard-download-list,
.wizard-action-stack {
  display: grid;
  gap: 12px;
}

.wizard-option {
  display: grid;
  grid-template-columns: 34px 1fr 22px;
  gap: 12px;
  align-items: center;
  padding: 18px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  cursor: pointer;
}

.wizard-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-option-icon {
  font-size: 1.5rem;
  text-align: center;
}

.wizard-option-body {
  display: grid;
  gap: 4px;
}

.wizard-option-check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.24);
}

.wizard-option input:checked + .wizard-option-icon + .wizard-option-body + .wizard-option-check {
  border-color: #2e8cff;
  box-shadow: inset 0 0 0 5px #2e8cff;
}

.wizard-download-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
}

.wizard-download-icon {
  font-size: 1.4rem;
  text-align: center;
}

.wizard-download-body {
  display: grid;
  gap: 4px;
}

.wizard-download-cta {
  color: #3d95ff;
  font-weight: 700;
}

.wizard-secret-box {
  margin-bottom: 16px;
}

.wizard-secret-input {
  width: 100%;
  min-height: 110px;
  resize: none;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #0b1019;
  color: var(--text);
  padding: 14px;
  font: inherit;
}

.wizard-help {
  margin-top: 16px;
  margin-bottom: auto;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  padding: 16px;
}

.wizard-help summary {
  cursor: pointer;
  font-weight: 700;
}

.wizard-help-body {
  margin-top: 12px;
  color: #d7e1f7;
  line-height: 1.55;
  white-space: pre-wrap;
}

.wizard-bottom-action {
  width: 100%;
  margin-top: 22px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .admin-tr1-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .admin-tr1-grid-3 > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .admin-nav-link {
    min-height: 44px;
    padding: 0 16px;
    font-size: 0.96rem;
  }
  .admin-nav-card {
    padding: 12px 12px 14px;
  }
  body.admin-mode .shell {
    max-width: 430px;
  }
  .button-row.two,
  .grid-two { grid-template-columns: 1fr; }
  .hero-balance { font-size: 2.6rem; }
  .wizard-steps { grid-template-columns: 1fr; }
  .action-grid.two,
  .amount-grid,
  .stats-grid { grid-template-columns: 1fr; }
  .action-grid.two.dashboard-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .section-head .btn {
    width: 100%;
  }
  .table {
    font-size: 0.86rem;
  }
  .admin-filter-stack {
    padding: 10px;
  }
  .admin-tr1-panel {
    padding: 14px;
  }
  .admin-tr1-topline {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-server-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-server-tab {
    width: 100%;
  }
  .admin-tr1-head {
    align-items: stretch;
  }
  .admin-tr1-server-wrap {
    justify-items: start;
  }
  .admin-tr1-server-pill {
    align-self: flex-start;
  }
  .admin-tr1-grid-2,
  .admin-tr1-grid-3 {
    grid-template-columns: 1fr;
  }
  .admin-tr1-submit-row .btn {
    width: 100%;
    min-width: 0;
  }
  .admin-table-user {
    min-width: 180px;
  }
  .table-admin-users th:nth-child(1),
  .table-admin-users td:nth-child(1) {
    min-width: 40px;
  }
  .table-admin-users th:nth-child(2),
  .table-admin-users td:nth-child(2) {
    min-width: 170px;
  }
  .table-admin-users th:nth-child(3),
  .table-admin-users td:nth-child(3) {
    min-width: 86px;
  }
  .table-admin-users th:nth-child(5),
  .table-admin-users td:nth-child(5) {
    min-width: 72px;
  }
  .table-admin-devices th:nth-child(3),
  .table-admin-devices td:nth-child(3) {
    min-width: 180px;
  }
  .table-admin-devices th:nth-child(4),
  .table-admin-devices td:nth-child(4) {
    min-width: 170px;
  }
  .balance-value {
    font-size: 3.2rem;
  }
}
