:root {
  --bg: #0a0b14;
  --bg2: #11131f;
  --card: #161a2b;
  --card2: #1f2438;
  --line: #2b3150;
  --text: #edf0fa;
  --muted: #8a90b0;
  --brand: #a855f7;
  --brand2: #ec4899;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* прячем полосы прокрутки (скролл работает, но баров не видно) */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1000px 520px at 85% -10%, rgba(168,85,247,.22) 0%, transparent 55%),
              radial-gradient(900px 500px at 0% 110%, rgba(236,72,153,.14) 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Шапка ---- */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(13,15,26,0.7);
  border-bottom: 1px solid var(--line);
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; display: flex; gap: 8px; align-items: center; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 14px var(--brand); }
.nav { display: flex; gap: 10px; align-items: center; }

/* ---- Кнопки ---- */
.btn {
  border: none; cursor: pointer; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 12px; color: #fff;
  background: var(--card2); transition: .15s; font-family: inherit;
}
.btn:hover { filter: brightness(1.15); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-red { background: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Карточки ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---- Hero (лендинг в стиле DonationAlerts) ---- */
.hero-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center;
  padding: 64px 0 50px; min-height: 540px;
}
.hero-left h1 { font-size: 56px; line-height: 1.05; letter-spacing: -1.5px; font-weight: 800; }
.hero-sub { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 480px; margin: 22px 0 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-pill {
  border: none; cursor: pointer; font-weight: 700; font-size: 14px; letter-spacing: .5px;
  padding: 16px 32px; border-radius: 40px; color: #fff; font-family: inherit; transition: .15s;
  text-transform: uppercase;
}
.btn-pill.primary { background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 30px rgba(168,85,247,.4); }
.btn-pill.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-pill.ghost { background: transparent; border: 1px solid var(--line); }
.btn-pill.ghost:hover { border-color: var(--brand); text-decoration: none; }

.hero-stats { display: flex; gap: 56px; margin-top: 60px; }
.hero-stat .num { font-size: 44px; font-weight: 800; color: var(--brand); letter-spacing: -1px; line-height: 1; }
.hero-stat .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin-top: 8px; }

/* визуал справа */
.hero-visual {
  position: relative; min-height: 460px; border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(120% 100% at 80% 20%, rgba(168,85,247,.3) 0%, transparent 55%),
    radial-gradient(90% 80% at 30% 90%, rgba(168,85,247,.18) 0%, transparent 60%),
    linear-gradient(135deg, #2a2118 0%, #1a1a1d 60%, #221a2e 100%);
  border: 1px solid var(--line);
}
.hero-visual .hv-glow {
  position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 70% 40%, rgba(168,85,247,.4), transparent 70%);
  filter: blur(20px);
}
.hero-visual .mascot {
  position: absolute; top: 38px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%; font-size: 52px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 12px 40px rgba(168,85,247,.55);
  animation: floaty 3.5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-12px); } }

.float-card {
  position: absolute; background: rgba(30,30,34,.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.alert-card { top: 150px; left: 50%; transform: translateX(-50%); text-align: center; min-width: 220px; }
.alert-card .ac-name { color: var(--brand); font-weight: 800; font-size: 17px; }
.alert-card .ac-msg { color: var(--text); font-size: 14px; margin-top: 2px; }

.goal-card { bottom: 34px; right: 28px; left: 28px; }
.goal-card .gc-title { font-weight: 700; font-size: 15px; text-align: center; margin-bottom: 10px; }
.goal-card .gc-bar { position: relative; height: 26px; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,.08); }
.goal-card .gc-bar > span { position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 8px; }
.goal-card .gc-bar > em { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-style: normal; font-size: 12.5px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.goal-card .gc-axis { display: flex; justify-content: space-between; color: var(--muted);
  font-size: 11px; margin-top: 5px; }

@media (max-width: 880px) {
  .hero-wrap { grid-template-columns: 1fr; padding-top: 36px; min-height: 0; }
  .hero-left h1 { font-size: 40px; }
  .hero-visual { min-height: 380px; order: -1; }
  .hero-stats { gap: 32px; margin-top: 40px; }
  .hero-stat .num { font-size: 34px; }
}

/* ---- Формы ---- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; margin-top: 14px; }
input, textarea, select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; color: var(--text); font-size: 15px;
  font-family: inherit; transition: .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; min-height: 72px; }

/* ---- Стримеры ---- */
.streamer-card { display: flex; flex-direction: column; gap: 8px; }
.avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: #fff;
}
.streamer-card .name { font-weight: 700; font-size: 17px; }
.streamer-card .meta { color: var(--muted); font-size: 13px; }

/* ---- Бейджи ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending { background: rgba(234,179,8,.15); color: var(--yellow); }
.badge-completed { background: rgba(34,197,94,.15); color: var(--green); }
.badge-rejected { background: rgba(239,68,68,.15); color: var(--red); }

/* ---- Таблицы / списки ---- */
.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px;
}
.row:last-child { border-bottom: none; }
.muted { color: var(--muted); font-size: 13px; }
.amount-up { color: var(--green); font-weight: 700; }
.big-balance { font-size: 40px; font-weight: 800; letter-spacing: -1px; }

/* ---- Модалка ---- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(5,6,12,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 26px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 22px; margin-bottom: 4px; }
.close-x { float: right; cursor: pointer; color: var(--muted); font-size: 24px; line-height: 1; }

/* ---- Утилиты ---- */
.section-title { font-size: 22px; font-weight: 700; margin: 36px 0 16px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); padding: 14px 22px;
  border-radius: 12px; z-index: 200; opacity: 0; transition: .25s; pointer-events: none;
  max-width: 90vw;
}
.toast.show { opacity: 1; bottom: 36px; }
.toast.err { border-color: var(--red); }
.toast.ok { border-color: var(--green); }
.calc-box { background: var(--bg2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 14px; margin-top: 14px; font-size: 14px; }
.calc-box .line { display: flex; justify-content: space-between; padding: 3px 0; }
.calc-box .total { font-weight: 800; font-size: 17px; border-top: 1px solid var(--line);
  margin-top: 6px; padding-top: 8px; }
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { padding: 9px 16px; border-radius: 10px; cursor: pointer; background: var(--card2);
  font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.tab.active { border-color: var(--brand); color: #fff; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.footer-note { color: var(--muted); font-size: 12px; text-align: center; padding: 40px 0; }
.pill-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pill { padding: 8px 14px; border-radius: 10px; background: var(--card2); cursor: pointer;
  font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.pill:hover { border-color: var(--brand); }

/* сетка выбора мемов */
.meme-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.meme-item {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; border-radius: 12px; background: var(--card2); cursor: pointer;
  border: 2px solid transparent; transition: .12s; user-select: none;
}
.meme-item:hover { border-color: var(--line); transform: scale(1.08); }
.meme-item.active { border-color: var(--brand); background: rgba(168,85,247,.18); transform: scale(1.08); }

.cover-row { display: flex; align-items: center; gap: 10px; margin-top: 14px;
  font-size: 14px; color: var(--text); cursor: pointer; }
.cover-row input { width: auto; }

/* ---- Настройка донатов: вкладки и элементы ---- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
  flex-wrap: wrap; }
.subtab { padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 14px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--text); }
.subtab.active { color: #fff; border-bottom-color: var(--brand); }
.subpanel { display: none; }
.subpanel.active { display: block; }

.opt-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer;
  transition: .12s; background: var(--card);
}
.opt-card:hover { border-color: var(--line); }
.opt-card.sel { border-color: var(--brand); background: rgba(168,85,247,.1); }
.opt-card .ot { font-weight: 700; margin-bottom: 4px; }
.opt-card .od { color: var(--muted); font-size: 13px; }

/* тумблер вкл/выкл */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: var(--card2); border: 1px solid var(--line);
  border-radius: 20px; transition: .2s; cursor: pointer; }
.switch .sl::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .sl { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent; }
.switch input:checked + .sl::before { transform: translateX(24px); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row .lbl { font-weight: 600; }
.set-row .hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
.set-row .ctl { flex-shrink: 0; min-width: 160px; }
.set-row .ctl input, .set-row .ctl select { width: 100%; }

/* ============================ ПАНЕЛЬ (кабинет) ============================ */
.app { display: flex; min-height: 100vh; }

/* --- Сайдбар --- */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--bg2);
  border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 9px; font-weight: 800;
  font-size: 19px; padding: 6px 10px 18px; }
.sidebar .brand .dot { width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
.sidebar .group { color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; padding: 16px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  cursor: pointer; color: var(--text); font-size: 14.5px; font-weight: 500; transition: .12s;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--card); }
.nav-item.active { background: linear-gradient(135deg, rgba(168,85,247,.2), rgba(236,72,153,.08));
  color: #fff; font-weight: 600; }
.nav-item.active .ic { color: var(--brand); }
.nav-item .ic { width: 20px; text-align: center; font-size: 16px; color: var(--muted); }
.nav-item.sub { padding-left: 30px; font-size: 13.5px; color: var(--muted); }
.nav-item.sub.active { color: #fff; }

/* --- Основная область --- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  height: 64px; flex-shrink: 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 26px;
  background: var(--bg2);
}
.appbar .balance {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font-weight: 700; font-size: 14px;
}
.appbar .balance b { color: var(--brand); }
.appbar .who { display: flex; align-items: center; gap: 10px; }

/* колокольчик уведомлений */
.bell { position: relative; cursor: pointer; padding: 6px; border-radius: 10px;
  display: flex; align-items: center; transition: .12s; }
.bell:hover { background: var(--card); }
.bell-badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px;
  font-weight: 800; display: flex; align-items: center; justify-content: center; }
.notif-panel { position: absolute; top: 44px; right: 0; width: 340px; max-height: 420px;
  overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); display: none; z-index: 60; cursor: default; }
.notif-panel.open { display: block; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--line); font-weight: 700; position: sticky; top: 0;
  background: var(--card); }
.notif-head span { font-size: 12px; font-weight: 600; color: var(--brand); cursor: pointer; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(168,85,247,.08); }
.notif-item .ni-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: var(--muted); }
.notif-item.t-success .ni-dot { background: var(--green); }
.notif-item.t-error .ni-dot { background: var(--red); }
.notif-item.t-info .ni-dot { background: var(--brand); }
.notif-item .ni-text { font-size: 13.5px; line-height: 1.4; }
.notif-item .ni-time { color: var(--muted); font-size: 11px; margin-top: 4px; }
.appbar .who .av { width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); display: flex;
  align-items: center; justify-content: center; font-weight: 800; }
.content { padding: 26px; flex: 1; }
.page-title { font-size: 26px; font-weight: 700; margin-bottom: 20px; }

.section { display: none; }
.section.active { display: block; }

/* --- Промо-баннер --- */
.promo {
  background: linear-gradient(120deg, var(--brand), var(--brand2));
  border-radius: 16px; padding: 26px 30px; color: #fff; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative; overflow: hidden;
}
.promo h3 { font-size: 26px; font-weight: 900; letter-spacing: .5px; }
.promo p { opacity: .95; font-size: 15px; }
.promo .btn { background: #fff; color: #9333ea; font-weight: 800; }

/* --- График --- */
.chart-card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chart-head h3 { font-size: 18px; }
.chart-wrap { width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-holder { position: relative; }
.chart-holder .chit { cursor: crosshair; }
.chart-tip {
  position: absolute; transform: translate(-50%, -130%); pointer-events: none;
  background: var(--bg2); border: 1px solid var(--brand); border-radius: 10px;
  padding: 7px 12px; opacity: 0; transition: opacity .12s; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 5; text-align: center;
}
.chart-tip b { display: block; color: var(--brand); font-size: 15px; }
.chart-tip span { color: var(--muted); font-size: 11px; }

/* --- Лента сообщений --- */
.feed-item {
  display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; background: var(--card);
}
.feed-item .src { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .body .top { font-size: 14.5px; }
.feed-item .body .top b { font-weight: 700; }
.feed-item .body .msg { color: var(--text); font-size: 14px; margin-top: 3px; }
.feed-item .body .when { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* --- Прогресс цели --- */
.progress { height: 14px; background: var(--bg2); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); }
.progress > span { display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 20px;
  transition: width .5s ease; }
.ring { width: 150px; height: 150px; }
.stat-num { font-size: 34px; font-weight: 800; letter-spacing: -1px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; z-index: 80; transition: .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; margin-right: auto; }
