/* ============================================================
   КНОПКА БАБЛО — дизайн-система (theme.css)
   Тёмная неоновая «денежная» тема.
   Контракт §7 SPEC: все переменные и классы ниже используются
   всеми страницами проекта — не переименовывать.
   ============================================================ */

:root {
  /* Обязательные переменные дизайн-системы */
  --bg: #0a0a12;
  --bg-card: #13131f;
  --bg-elevated: #1a1a2e;
  --border: #26263a;
  --text: #f1f0ff;
  --muted: #8b8aa3;
  --accent: #7c3aed;
  --accent2: #a855f7;
  --green: #22c55e;
  --gold: #fbbf24;
  --red: #ef4444;
  --radius: 14px;

  /* Градиенты бренда */
  --grad-brand: linear-gradient(135deg, #7c3aed, #d946ef);
  --grad-gold: linear-gradient(135deg, #f59e0b, #fbbf24);

  /* Служебные (тени/свечение) */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glow-brand: 0 0 24px rgba(124, 58, 237, 0.45);
  --glow-gold: 0 0 28px rgba(251, 191, 36, 0.4);
}

/* ---------- База ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  max-width: 100%;
  vertical-align: middle;
}

code, pre {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

::selection {
  background: rgba(124, 58, 237, 0.45);
  color: #fff;
}

/* Тонкий тёмный скроллбар */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

[hidden] {
  display: none !important;
}

/* ---------- Каркас ---------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover {
  text-decoration: none;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease,
              filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.5);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-primary {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover {
  box-shadow: var(--glow-brand);
}

.btn-gold {
  background: var(--grad-gold);
  border-color: transparent;
  color: #2b1900;
  font-weight: 800;
}

.btn-gold:hover {
  box-shadow: var(--glow-gold);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  filter: none;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
  filter: none;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.15rem;
  border-radius: 16px;
}

/* ---------- Карточки ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

/* ---------- Формы ---------- */

.input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b8aa3' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.input {
  resize: vertical;
  min-height: 84px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

/* ---------- Бейджи ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-green {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.badge-gold {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold);
}

/* ---------- Сетки ---------- */

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ---------- Статы ---------- */

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-label {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Таблица ---------- */

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

.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* ---------- Утилиты ---------- */

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

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Тост (всплывающее уведомление) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(92vw, 460px);
  padding: 13px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  animation: toast-in 0.25s ease;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.55);
  color: var(--red);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.55);
  color: var(--green);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- Адаптив ---------- */

@media (max-width: 720px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .card {
    padding: 18px;
  }

  .stat-value {
    font-size: 1.55rem;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: 1.05rem;
  }

  .table th,
  .table td {
    padding: 9px 10px;
  }
}
