/* =============================================================================
   StreamShop Pay — Админка (макет). Дизайн-система клиента (tokens.css).
   ============================================================================= */

/* ─────────── вход ─────────── */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--contrast);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 16px 40px rgba(16,24,40,.08);
  padding: 32px 28px;
  text-align: center;
  animation: cardIn .42s cubic-bezier(.22,.61,.36,1) both;
}
.login-logo {
  width: 48px; height: 48px; border-radius: var(--radius-xl);
  background: var(--accent); color: var(--text-on-accent);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.login-logo svg { width: 26px; height: 26px; }
.login-title { font-size: var(--text-lg); font-weight: 500; }
.login-sub { font-size: var(--text-sm); color: var(--text-secondary); margin: 4px 0 22px; }
@keyframes cardIn { from { opacity:0; transform: translateY(10px) scale(.99); } to { opacity:1; transform:none; } }

/* ─────────── общий каркас ─────────── */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--contrast);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: var(--radius-xl);
  background: var(--accent); color: var(--text-on-accent);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-logo svg { width: 20px; height: 20px; }
.brand-name { font-size: var(--text-base); font-weight: 500; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--text-secondary); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-md);
  font-family: inherit; font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary); background: none; border: none; cursor: pointer;
  text-align: left; transition: background-color .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-light); color: var(--text-primary); }
.nav-item--active { background: rgba(76,149,207,.12); color: var(--accent); }
html.dark .nav-item--active { background: rgba(76,149,207,.18); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ─────────── основная область ─────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: var(--text-lg); font-weight: 500; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: var(--text-sm); color: var(--text-secondary); }
.content { padding: 24px 28px 56px; }

.section { animation: fadeIn .25s ease both; }
.section.hidden { display: none; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

/* ─────────── статы ─────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--contrast); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 16px 18px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-sub--up { color: var(--status-green); }

/* ─────────── панели/таблицы ─────────── */
.panel {
  background: var(--contrast); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 18px 20px; margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title { font-size: var(--text-base); font-weight: 500; }
.panel-link { font-size: var(--text-sm); color: var(--accent); cursor: pointer; }

.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tbl th {
  text-align: left; font-weight: 500; color: var(--text-secondary); font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-light); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.muted { color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; }

/* бейджи статусов */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before { content:''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--paid      { color: #2f8a57; background: rgba(118,196,148,.20); }
.badge--pending   { color: #6b7785; background: rgba(180,195,210,.22); }
.badge--detected  { color: #3f6fd0; background: rgba(168,200,247,.22); }
.badge--expired   { color: #a9802f; background: rgba(229,197,140,.25); }
.badge--cancelled { color: #c0504a; background: rgba(224,140,136,.20); }
html.dark .badge--paid { color: #7ed0a0; } html.dark .badge--detected { color:#9cc1f5; }
html.dark .badge--expired { color:#e3c58c; } html.dark .badge--cancelled { color:#e58c88; }
html.dark .badge--pending { color:#aab6c4; }

/* фильтры */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.input, .select {
  font-family: inherit; font-size: var(--text-sm); color: var(--text-primary);
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 12px;
}
.input { flex: 1; min-width: 200px; }
.input::placeholder { color: var(--text-tertiary); }

/* ─────────── сбор средств ─────────── */
.sweep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sweep-card {
  background: var(--contrast); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 16px 18px;
}
.sweep-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.coin-badge {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.sweep-net { font-size: var(--text-base); font-weight: 500; }
.sweep-row { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--text-sm); padding: 5px 0; }
.sweep-row .muted { color: var(--text-secondary); }
.sweep-amt { font-weight: 500; font-variant-numeric: tabular-nums; }
.sweep-gas--low { color: var(--status-red); }
.sweep-card .btn { margin-top: 12px; }
.addr-line { font-size: 12px; color: var(--text-secondary); word-break: break-all; margin-top: 8px; }

/* ─────────── кошельки ─────────── */
.wallet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.wallet-row:last-child { border-bottom: none; }
.wallet-meta { min-width: 0; }
.wallet-net { font-size: var(--text-sm); font-weight: 500; }
.wallet-addr { font-size: 12px; color: var(--text-secondary); word-break: break-all; }

/* ─────────── настройки ─────────── */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: none; }
.set-label { font-size: var(--text-sm); }
.set-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* переключатель */
.switch { position: relative; width: 40px; height: 23px; flex-shrink: 0; cursor: pointer; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: var(--text-tertiary); transition: background-color .18s;
}
.switch span::after {
  content:''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .18s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ─────────── кнопки ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-xl);
  font-family: inherit; font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: opacity .15s, background-color .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn--full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:not(:disabled):hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--status-red); border-color: var(--status-red); }
.btn-danger:hover { background: rgba(224,140,136,.12); }
.btn svg { width: 16px; height: 16px; }

/* ─────────── модалка ─────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,14,20,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s ease both;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--contrast); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  animation: cardIn .25s cubic-bezier(.22,.61,.36,1) both;
}
.modal-title { font-size: var(--text-md); font-weight: 500; margin-bottom: 8px; }
.modal-text { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.seed-box {
  font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.7;
  background: var(--bg-light); border: 1px solid var(--status-yellow);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; word-spacing: 4px;
}
.warn-text { color: var(--status-red); }

/* тост */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--text-primary); color: var(--contrast);
  font-size: var(--text-sm); font-weight: 500; padding: 10px 16px;
  border-radius: var(--radius-xl); box-shadow: 0 10px 30px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; z-index: 100; transition: opacity .22s, transform .22s;
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

/* мини-метка макета */
.mock-tag {
  position: fixed; bottom: 10px; right: 12px; z-index: 60;
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-tertiary); background: var(--contrast);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px 8px;
}

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0; border: none; padding: 0; flex-direction: row; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sweep-grid { grid-template-columns: 1fr; }
}
