/* Amy App — монохромный стиль бота: чёрный фон, серые карточки, без цветных акцентов. */

@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('fonts/montserrat-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('fonts/montserrat-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('fonts/montserrat-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/montserrat-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/montserrat-cyrillic-800-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('fonts/montserrat-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('fonts/montserrat-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('fonts/montserrat-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/montserrat-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/montserrat-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #09090b;
  --panel: #111113;
  --card: #161619;
  --card-hover: #1c1c20;
  --line: #26262b;
  --line-strong: #34343b;
  --text: #ededef;
  --muted: #8e8e96;
  --faint: #5c5c64;
  --invert: #f4f4f5;
  --invert-text: #111113;
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.45 'Montserrat', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Всё серое — аватары и иконки тоже, как на карточках бота. */
img { filter: grayscale(1); }

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

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }

/* ------------------------------ Заставка ------------------------------ */

.splash {
  height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}

.logo { font-weight: 800; font-size: 34px; letter-spacing: -0.02em; }
.splash p { max-width: 420px; margin: 0; }

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}

.brand img { width: 36px; height: 36px; border-radius: 10px; background: var(--card); }
.brand .name { font-weight: 700; line-height: 1.2; }
.brand .server { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

.nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--invert); color: var(--invert-text); }
.nav-item svg { width: 17px; height: 17px; flex: none; }

.sidebar .me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
}

.sidebar .me img { width: 30px; height: 30px; border-radius: 50%; }

.main { overflow-y: auto; padding: 28px 32px 48px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

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

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.card h2 .muted { font-weight: 500; }

.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }
.stat .hint { color: var(--faint); font-size: 12px; margin-top: 2px; }

.quote { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; color: var(--muted); }

/* --------------------------- Профиль участника --------------------------- */

.hero { display: flex; gap: 18px; align-items: center; }
.hero img { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--line-strong); }
.hero h1 { margin: 0; font-size: 26px; font-weight: 800; }
.hero .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

.progress { height: 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--invert); border-radius: inherit; }

/* -------------------------------- Списки -------------------------------- */

.list { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; border-radius: var(--radius-sm); }
.row.clickable:hover { background: var(--card-hover); }
.row img { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--panel); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .place { width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.row .amount { font-weight: 700; white-space: nowrap; }

.channel-group { margin-bottom: 14px; }
.channel-group .group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); padding: 6px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--card-hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--invert); color: var(--invert-text); border-color: var(--invert); }
.btn.primary:hover { background: #d4d4d8; }
.btn.danger { border-color: #4a4a52; }
.btn.danger:hover { background: #2a2a2f; }
.btn.small { padding: 5px 10px; font-size: 12px; }

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

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--invert); color: var(--invert-text); border-color: var(--invert); }

.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  outline: none;
}

.input:focus { border-color: var(--muted); }
textarea.input { min-height: 80px; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }

/* ------------------------------ Пагинация ------------------------------ */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager .info { font-size: 12px; color: var(--muted); }
.pager .info b { color: var(--text); }
.pager .buttons { display: flex; gap: 6px; }

/* -------------------------------- График -------------------------------- */

.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: var(--line-strong); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.bars div:hover { background: var(--invert); }
.bars div:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--invert);
  color: var(--invert-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.score { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.score .ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  background: conic-gradient(var(--invert) calc(var(--p) * 1%), var(--line) 0);
  position: relative;
}

.score .ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.score .ring span { position: relative; }

.check-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; }
.check-row .mark.ok { background: var(--invert); color: var(--invert-text); }
.check-row .mark.bad { border: 1.5px solid var(--faint); color: var(--muted); }

/* ------------------------------- Модалки ------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
  animation: fade 0.12s ease-out;
}

.dialog {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 20px;
}

.dialog.wide { width: min(720px, 100%); }
.dialog h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.dialog .desc { margin: 0 0 16px; color: var(--muted); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; }

.toast {
  background: var(--invert);
  color: var(--invert-text);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  max-width: 360px;
  animation: fade 0.15s ease-out;
}

.toast.error { background: var(--card); color: var(--text); border: 1px solid var(--line-strong); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 10px; }

@keyframes shimmer { to { background-position: -200% 0; } }

.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; margin: 0 6px 6px 0; cursor: pointer; background: transparent; color: var(--muted); }
.role-pill.on { background: var(--invert); color: var(--invert-text); border-color: var(--invert); }
.role-pill:disabled { cursor: default; opacity: 0.5; }

/* ---------------------------- Узкие экраны ---------------------------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .sidebar {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
    overflow-x: auto;
    gap: 6px;
  }

  .brand, .nav-title, .sidebar .me { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .main { padding: 18px 14px 40px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
