:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0d1b2d;
  --bg-card: rgba(12, 22, 36, 0.86);
  --line: rgba(148, 163, 184, 0.22);
  --text: #dbe7f5;
  --muted: #8ea1b8;
  --accent: #4fd1c5;
  --accent-strong: #14b8a6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 26%),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 28%),
    linear-gradient(180deg, #08111d, #0a1321 38%, #081019 100%);
}

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

button,
.button-link {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: 120ms ease;
}

button:hover,
.button-link:hover {
  border-color: rgba(79, 209, 197, 0.4);
  background: rgba(15, 23, 42, 0.92);
}

button.primary {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.82), rgba(13, 148, 136, 0.82));
  border-color: rgba(95, 243, 227, 0.4);
  color: #041016;
  font-weight: 700;
}

button.danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 16, 28, 0.92);
  color: var(--text);
  padding: 10px 12px;
}

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

.page-shell {
  width: min(1480px, calc(100vw - 28px));
  margin: 18px auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 22, 36, 0.94), rgba(10, 18, 30, 0.88));
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card,
.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card {
  width: min(440px, 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card h2,
.card h2,
.card h3 {
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }

.card {
  padding: 16px;
}

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

.kpi {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 16, 28, 0.72);
}

.kpi strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-tabs button.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.7), rgba(29, 78, 216, 0.7));
  border-color: rgba(147, 197, 253, 0.5);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th:last-child,
td:last-child {
  border-right: 0;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(7, 17, 31, 0.95);
  z-index: 1;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}

.split {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
}

.notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 16, 28, 0.7);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-active { color: #86efac; }
.status-pending_payment,
.status-pending_review { color: #fde68a; }
.status-suspended,
.status-disabled,
.status-failed { color: #fca5a5; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.json-box {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 20, 0.85);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .kpi-grid,
  .split,
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .col-12,
  .col-8,
  .col-7,
  .col-6,
  .col-5,
  .col-4 {
    grid-column: auto;
  }
}
