/* ============================================================
   Панель семьи — тёмная тема с цветом семьи (--accent ставится из настроек)
   ============================================================ */

:root {
  --accent: #e02b2b;
  --accent-2: #8b5cf6;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);

  --bg: #08090d;
  --bg-2: #0e1016;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --solid: #12141b;
  --solid-2: #181b24;
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .12);
  --text: #eceef4;
  --muted: #8c92a4;
  --faint: #5c6274;

  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --info: #60a5fa;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

/* второй цвет — сосед основного по цветовому кругу (где браузер умеет) */
@supports (color: oklch(from red l c h)) {
  :root { --accent-2: oklch(from var(--accent) calc(l + 0.04) c calc(h + 50)); }
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
::selection { background: var(--accent-line); color: #fff; }
a { color: var(--accent-text); text-decoration: none; transition: color .15s; }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; font-family: "Segoe UI Variable Display", "Inter", "Segoe UI", system-ui, sans-serif; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .16); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* ---------- живой фон */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .32; will-change: transform; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--accent); animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 20vh; background: var(--accent-2); opacity: .2; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 30vw; height: 30vw; left: 30vw; bottom: -18vw; background: var(--accent); opacity: .14; animation: drift3 38s ease-in-out infinite alternate; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
@keyframes drift1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vw, -8vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-10vw, -12vh) scale(1.2); } }

/* ---------- загрузка */
.boot { display: grid; place-items: center; height: 100vh; }
.loader { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r); }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.skel.title { height: 34px; width: 280px; margin-bottom: 22px; border-radius: 10px; }
.skel.stat { height: 116px; }
.skel.block { height: 300px; margin-top: 16px; }
.skel.line { height: 54px; margin-bottom: 10px; }

/* ---------- раскладка */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(180deg, rgba(14, 16, 22, .82), rgba(10, 11, 15, .9));
  backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--border);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand-logo { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--border-2), 0 8px 24px -6px var(--accent-line); }
.logo-fallback { background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.brand-name { font-weight: 800; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.search-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); cursor: pointer; text-align: left;
  transition: background .2s, border-color .2s, color .2s;
}
.search-btn:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.search-btn .grow { font-size: 14px; }
kbd { font-family: inherit; font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; color: var(--muted); }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-title { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 16px 12px 6px; }
.nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 550; font-size: 14.5px; transition: color .2s, transform .2s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover .icon { transform: scale(1.12); }
.nav a .icon { transition: transform .25s var(--spring), color .2s; }
.nav a.active { color: #fff; }
.nav a.active .icon { color: var(--accent-text); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: var(--accent); color: #fff; }
.nav-pill {
  position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 10px; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--accent-soft), rgba(255, 255, 255, .04));
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform .45s var(--ease), height .45s var(--ease), opacity .2s;
}
.nav-pill::before { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.sidebar-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.sidebar-foot .person { flex: 1; min-width: 0; }
.level { font-size: 11px; color: var(--muted); }

.main { padding: 32px 40px 80px; min-width: 0; max-width: 1340px; width: 100%; margin: 0 auto; }
.topbar { display: none; }
.backdrop { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.page-head .toolbar { margin: 0; }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); transform: translateX(-105%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .layout.menu-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); z-index: 25; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .layout.menu-open .backdrop { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; position: sticky; top: 0; z-index: 20; background: rgba(8, 9, 13, .8); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
  .topbar .brand-logo { width: 30px; height: 30px; border-radius: 9px; }
  .main { padding: 20px 16px 70px; }
  h1 { font-size: 22px; }
}

/* ---------- появление страницы */
.page > * { animation: rise .6s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: .05s; }
.page > *:nth-child(3) { animation-delay: .1s; }
.page > *:nth-child(4) { animation-delay: .15s; }
.page > *:nth-child(5) { animation-delay: .2s; }
.page > *:nth-child(n+6) { animation-delay: .25s; }
.page.same > * { animation: fade .35s ease both; }
.stagger > * { animation: rise .55s var(--ease) both; animation-delay: calc(min(var(--i, 0), 14) * 40ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* ---------- поверхности */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.card-head h2 .icon { color: var(--accent-text); }

/* подсветка за курсором */
.glow { --mx: 50%; --my: 50%; }
.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 13%, transparent), transparent 45%);
}
.glow:hover::before { opacity: 1; }

.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); margin-bottom: 16px; }
.two { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .two { grid-template-columns: minmax(0, 1fr); } }

.stat {
  position: relative; display: block; overflow: hidden; color: inherit; padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), border-color .3s, background .3s;
}
a.stat:hover { transform: translateY(-3px); border-color: var(--accent-line); color: inherit; background: var(--surface-2); }
.stat .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat .ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--tone, var(--accent-text));
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--accent)) 25%, transparent);
  transition: transform .4s var(--spring);
}
a.stat:hover .ico { transform: scale(1.1) rotate(-6deg); }
.stat .arrow { color: var(--faint); opacity: 0; transform: translateX(-6px); transition: .3s var(--ease); }
a.stat:hover .arrow { opacity: 1; transform: none; color: var(--accent-text); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .value small { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat .hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.stat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone, var(--accent)) 22%, transparent), transparent 70%); pointer-events: none; }

/* ---------- приветствие */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; padding: 26px 28px; margin-bottom: 16px; border-radius: 24px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent) 60%, transparent), var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .06) 45%, transparent 60%); transform: translateX(-100%); animation: sheen 6s ease-in-out 1s infinite; pointer-events: none; }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.hero .brand-logo { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; animation: float 6s ease-in-out infinite; }
.hero h1 { margin: 0; font-size: 28px; }
.hero .sub { color: var(--muted); margin-top: 4px; }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ---------- кнопки */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-2);
  border-radius: 10px; padding: 8px 15px; cursor: pointer; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .15s var(--ease), box-shadow .25s, opacity .2s;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px var(--accent); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 28px -6px var(--accent); filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.saving { pointer-events: none; }
.btn.saving::after { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.discord { background: linear-gradient(135deg, #5865f2, #7983f5); border: 0; color: #fff; padding: 14px 26px; font-size: 16px; border-radius: 14px; box-shadow: 0 10px 34px -10px #5865f2; }
.btn.discord:hover { box-shadow: 0 14px 40px -8px #5865f2; transform: translateY(-2px); }
.btn.discord::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 3.5s ease-in-out infinite; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.5); opacity: 0; } }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 9px; transition: background .2s, color .2s, transform .15s; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.9); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ---------- поля ввода */
input[type=text], input[type=search], select, textarea {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 12px; width: 100%; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type=text]:hover, input[type=search]:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .18); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(0, 0, 0, .35); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
select { cursor: pointer; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c92a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select option, select optgroup { background: var(--solid-2); color: var(--text); }
input[type=color] { width: 46px; height: 40px; padding: 3px; border: 1px solid var(--border-2); border-radius: 10px; background: rgba(0, 0, 0, .25); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.search { position: relative; min-width: 240px; max-width: 320px; flex: 1; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; transition: color .2s; }
.search input { padding-left: 38px; }
.search:focus-within .icon { color: var(--accent-text); }

.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--muted); font-size: 14px; user-select: none; }
.check:hover { color: var(--text); }

/* ---------- вкладки с ползунком */
.tabs { position: relative; display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 4px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; max-width: 100%; }
.tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 0; color: var(--muted);
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; transition: color .25s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; }
.tab .count { background: var(--surface-2); border-radius: 20px; padding: 0 7px; font-size: 11.5px; line-height: 18px; transition: background .25s; }
.tab.active .count { background: var(--accent); }
.tab-pill { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 9px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2), 0 4px 14px -6px rgba(0, 0, 0, .6); transition: transform .45s var(--ease), width .45s var(--ease), height .45s var(--ease); pointer-events: none; }
.tabs.noanim .tab-pill { transition: none; }
.tabs.vertical { display: flex; flex-direction: column; width: 100%; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { width: auto; min-width: 210px; }

/* ---------- таблицы */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; text-align: left; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 13px 14px; border-bottom: 1px solid var(--border); background: rgba(14, 16, 22, .6); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background .2s; }
tbody tr { animation: rise .45s var(--ease) both; animation-delay: calc(min(var(--i, 0), 20) * 22ms + 60ms); }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
tr:last-child td { border-bottom: 0; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- люди, роли, бейджи */
.person { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; vertical-align: middle; color: inherit; }
.person img, .person .ava { width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); }
.person .ava { display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #333), color-mix(in srgb, var(--accent-2) 60%, #222)); }
.person .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.person.gone .nm { color: var(--muted); text-decoration: line-through; }
.person.gone img { filter: grayscale(1); opacity: .6; }
.person.lg { gap: 12px; }
.person.lg img, .person.lg .ava { width: 38px; height: 38px; font-size: 13px; }
.person.xl img, .person.xl .ava { width: 44px; height: 44px; font-size: 15px; }
a.person, a > .person { color: var(--text); }
a.person:hover .nm, a:hover > .person .nm { color: var(--accent-text); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 25%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 25%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 25%, transparent); }
.badge.info { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 25%, transparent); }
.badge.dark { background: #000; color: #bbb; }
.badge.live::before { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }

.role { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; margin: 2px 4px 2px 0; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); }
.role .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.rank-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--surface-2); font-weight: 800; font-size: 12px; margin-right: 6px; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .icon { width: 42px; height: 42px; color: var(--faint); margin-bottom: 10px; animation: float 4s ease-in-out infinite; }
.empty .t { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.card .empty { padding: 28px 10px; }
.error-box, .warn-box, .note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; animation: rise .4s var(--ease) both; }
.error-box { background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); color: #fecaca; }
.warn-box { background: color-mix(in srgb, var(--warn) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); color: #fde68a; margin-top: 10px; }
.note { background: var(--surface); border: 1px solid var(--border); color: var(--muted); margin-bottom: 14px; }
.error-box .icon, .warn-box .icon, .note .icon { margin-top: 1px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* полоски */
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.2fr) 28px; gap: 12px; align-items: center; margin: 10px 0; font-size: 14px; }
.bar { background: rgba(255, 255, 255, .05); border-radius: 20px; height: 8px; overflow: hidden; }
.bar > i { --c: var(--accent); display: block; height: 100%; width: 0; border-radius: 20px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, transparent), var(--c)); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 50%, transparent); transition: width 1.1s var(--ease); }
.bar-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.mini-bar { width: 90px; display: inline-block; vertical-align: middle; margin-left: 10px; height: 6px; }

/* лента событий */
.timeline { position: relative; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 10px 0 10px 4px; }
.tl-item::before { content: ""; position: absolute; left: 9px; top: 32px; bottom: -10px; width: 2px; background: linear-gradient(var(--border-2), transparent); }
.tl-item:last-child::before { display: none; }
.tl-dot { --c: var(--muted); position: relative; z-index: 1; flex: none; width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent), 0 0 12px var(--c); }
.tl-body { flex: 1; min-width: 0; display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; }
.tl-meta { flex-basis: 100%; color: var(--faint); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- заявки (аккордеон) */
.app { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .3s, background .3s; }
.app:hover { border-color: var(--border-2); }
.app.open { border-color: var(--accent-line); background: var(--surface-2); }
.app-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; flex-wrap: wrap; user-select: none; }
.app-head .id { color: var(--faint); font-weight: 700; min-width: 42px; font-variant-numeric: tabular-nums; }
.app-head .grow { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.app-head .preview-line { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 50px; }
.app-head .chev { color: var(--faint); transition: transform .4s var(--ease), color .2s; }
.app.open .app-head .chev { transform: rotate(180deg); color: var(--accent-text); }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.collapse > div { overflow: hidden; min-height: 0; }
.app.open .collapse { grid-template-rows: 1fr; }
.app-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); opacity: 0; transform: translateY(-6px); transition: opacity .35s, transform .45s var(--ease); }
.app.open .app-body { opacity: 1; transform: none; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.qa { background: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.qa .q { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.qa .a { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.app-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- склад */
.items { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.item { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .4s var(--ease), border-color .3s, box-shadow .4s; }
.item:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow-lg); }
.item .pic { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, .02)); display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.item .pic .icon { width: 46px; height: 46px; transition: transform .5s var(--spring); }
.item:hover .pic .icon { transform: scale(1.12) rotate(-5deg); }
.item .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.item:hover .pic img { transform: scale(1.06); }
.item .pic .badge { position: absolute; left: 10px; top: 10px; backdrop-filter: blur(10px); background: rgba(0, 0, 0, .55); }
.item .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item .name { font-weight: 700; font-size: 15.5px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .stock { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.item .stock .bar { flex: 1; height: 6px; }
.holder { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--border); }

/* ---------- онлайн */
.home-online { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgba(255, 255, 255, .06); }
.ring .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); filter: drop-shadow(0 0 6px var(--accent-line)); }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; flex: 1; min-width: 260px; }
.metric { background: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.metric .l { color: var(--muted); font-size: 12px; }
.metric .v { font-size: 18px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- настройки */
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-side { position: sticky; top: 24px; }
.settings-side .tabs { padding: 6px; }
.settings-side .tab { justify-content: flex-start; width: 100%; padding: 9px 12px; }
@media (max-width: 980px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-side { position: static; }
  .settings-side .tabs { flex-direction: row; }
  .settings-side .tab { width: auto; }
}
.field { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); transition: border-color .3s, box-shadow .3s; }
.field:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.field.flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); border-color: var(--ok); } 100% { box-shadow: 0 0 0 14px transparent; } }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.field-head:last-child { margin-bottom: 0; }
.field-label { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.field-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.45; }
.changed-dot { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 1px 8px; border-radius: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 7px; background: color-mix(in srgb, var(--c) 12%, rgba(255, 255, 255, .03)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); border-radius: 20px; padding: 4px 5px 4px 11px; font-size: 13px; font-weight: 550; animation: pop .3s var(--spring) both; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; border-radius: 50%; transition: .2s; }
.chip button:hover { color: #fff; background: rgba(0, 0, 0, .4); transform: rotate(90deg); }
.chip.warn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 60%, transparent); }
.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .12); border-radius: 20px; transition: background .3s; box-shadow: inset 0 0 0 1px var(--border-2); }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .4s var(--spring), width .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.switch:active span::before { width: 24px; }
.switch input:checked + span { background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #0ea5e9)); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch:active input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.radio-list { display: grid; gap: 6px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; border-radius: 10px; border: 1px solid var(--border); transition: border-color .2s, background .2s; }
.radio-list label:hover { background: var(--surface); }
.radio-list label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.radio-list input { margin-top: 2px; }
.img-preview { max-height: 96px; max-width: 280px; border-radius: 10px; margin-top: 10px; display: block; background: var(--surface); box-shadow: 0 0 0 1px var(--border); animation: pop .4s var(--ease) both; }
.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-row input[type=text] { width: 120px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }

.q-card { background: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; animation: rise .4s var(--ease) both; transition: border-color .2s; }
.q-card:focus-within { border-color: var(--border-2); }
.q-card .q-top { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.q-card .q-num, .cp-row .q-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.q-card .q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .q-card .q-grid { grid-template-columns: 1fr; } }
.q-card label.lbl { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin: 8px 0 4px; }

/* предпросмотр сообщения Discord */
.preview { background: #313338; border-radius: 12px; padding: 16px; display: flex; gap: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.preview .bot-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.preview .who { font-weight: 600; margin-bottom: 4px; }
.preview .who .tag { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-left: 5px; vertical-align: 1px; }
.preview .box { background: #2b2d31; border-radius: 8px; border-left: 4px solid var(--accent); padding: 12px 14px; max-width: 520px; transition: border-color .3s; }
.preview .box.embed { border-radius: 4px; }
.preview .banner { width: 100%; max-height: 140px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; display: block; }
.preview .sec { display: flex; gap: 12px; justify-content: space-between; }
.preview .thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; }
.preview .ttl { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.preview .foot { color: #949ba4; font-size: 12px; margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.preview .foot img { width: 18px; height: 18px; border-radius: 50%; }
.preview .dbtn { display: inline-block; margin-top: 12px; background: #248046; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 14px; font-weight: 600; }

/* ---------- вход */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  position: relative; width: 100%; max-width: 440px; text-align: center; padding: 42px 36px 34px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid var(--border-2);
  backdrop-filter: blur(24px) saturate(150%); box-shadow: var(--shadow-lg); animation: pop .7s var(--ease) both;
}
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, var(--accent) 80%, var(--accent-2) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: orbit 6s linear infinite; }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes orbit { to { --angle: 360deg; } }
.login .brand-logo { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 20px; font-size: 32px; animation: float 5s ease-in-out infinite; box-shadow: 0 0 0 1px var(--border-2), 0 16px 50px -10px var(--accent); }
.login h1 { font-size: 26px; margin-bottom: 10px; }
.login p { color: var(--muted); line-height: 1.55; margin: 0 0 26px; }
.login .error-box { margin: 0 0 18px; text-align: left; }
.login .foot { margin-top: 22px; font-size: 12px; color: var(--faint); display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- уведомления */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: min(400px, calc(100vw - 40px)); }
.toast {
  --c: var(--ok); position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px 15px; border-radius: 14px; font-size: 14px; line-height: 1.4; cursor: pointer;
  background: rgba(22, 24, 32, .92); border: 1px solid var(--border-2); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg);
  animation: toast-in .5s var(--spring) both;
}
.toast .icon { color: var(--c); margin-top: 1px; }
.toast.bad { --c: var(--bad); }
.toast.warn { --c: var(--warn); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--c); transform-origin: left; animation: toast-timer var(--t, 2.5s) linear forwards; opacity: .8; }
.toast.out { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* ---------- быстрый поиск (Ctrl+K) */
.palette-wrap { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding-top: 14vh; background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); animation: fade .2s both; }
.palette-wrap.out { animation: fade .2s reverse forwards; }
.palette { width: min(580px, calc(100vw - 32px)); background: rgba(20, 22, 30, .96); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .3s var(--spring) both; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette-input .icon { color: var(--muted); }
.palette-input input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 4px 0; font-size: 16px; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette-group { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.palette-item.sel { background: var(--accent-soft); color: #fff; }
.palette-item.sel .icon { color: var(--accent-text); }
.palette-item .go { margin-left: auto; opacity: 0; transition: opacity .15s, transform .2s; transform: translateX(-4px); }
.palette-item.sel .go { opacity: 1; transform: none; }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; }

/* ---------- меньше движения */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurora i { animation: none; }
}

/* ---------- доступ к сайту ---------- */
.pick-list:not(:empty) { margin-top: 12px; }
.pick-list .empty { padding: 22px 10px; }
.pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .015); margin-bottom: 8px; transition: border-color .2s, background .2s; }
.pick-row:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.pick-row .row { gap: 6px; }
.radio-hints { display: grid; gap: 4px; margin-top: 14px; line-height: 1.45; }
.radio-hints b { color: var(--text); font-weight: 600; }
.role-access { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.role-access .muted { margin-bottom: 8px; }
select.sm-select { width: auto; min-width: 130px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
@media (max-width: 600px) { .pick-row .row { width: 100%; } .pick-row .row .btn { flex: 1; justify-content: center; } }
.access-page > .card { margin-bottom: 16px; }

/* ---------- каналы с кнопкой «Отправить отчёт» ---------- */
.cp-row { display: grid; grid-template-columns: 30px repeat(3, minmax(0, 1fr)) 34px; gap: 10px; align-items: end; background: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); transition: border-color .2s; }
.cp-row:focus-within { border-color: var(--border-2); }
.cp-row label { display: grid; gap: 5px; min-width: 0; }
.cp-row select { width: 100%; }
.cp-row .q-num { align-self: center; }
.cp-row .icon-btn { margin-bottom: 2px; }
@media (max-width: 860px) {
  .cp-row { grid-template-columns: 30px minmax(0, 1fr) 34px; }
  .cp-row label { grid-column: 2; }
  .cp-row .icon-btn { grid-column: 3; grid-row: 1; }
}

/* ---------- Оформление сервера: роли, первая настройка ---------- */
.server-page > .card, .server-page > .card + .card { margin-bottom: 16px; }
.role-list { display: flex; flex-direction: column; gap: 6px; }
.role-row { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); animation: rise .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.role-row.locked { opacity: .6; }
.role-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.role-row.locked .role-head { cursor: default; }
.role-row:not(.locked) .role-head:hover { background: var(--surface-2); border-radius: 12px; }
.role-name { font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.role-name.holo { background-image: linear-gradient(90deg, #A9C9FF, #FFBBEC, #FFC3A0, #A9C9FF); background-size: 200% 100%; color: transparent; -webkit-background-clip: text; background-clip: text; animation: shimmer 3s linear infinite; }
.role-icon { width: 18px; height: 18px; object-fit: contain; }
.role-edit { display: grid; gap: 12px; padding: 4px 14px 14px; border-top: 1px solid var(--border); margin-top: 2px; padding-top: 14px; }
.role-edit label { display: grid; gap: 4px; }
.role-edit .row label { display: inline-flex; }
.role-edit input[type=color] { width: 44px; height: 34px; padding: 2px; }
.role-preview { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #2b2d31; }
.setup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 14px; }
.setup-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; }
.setup-item:hover { border-color: var(--accent-line); color: var(--text); }
.setup-item.done { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.setup-item.done svg { color: var(--ok); }
.settings-layout .card { margin-bottom: 16px; }

/* ---------- Красивые названия ---------- */
.styler-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 14px 0; }
.styler-controls label, .studio-controls label { display: grid; gap: 4px; }
.styler-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; }
.styler-list { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.styler-row { display: grid; grid-template-columns: 22px 22px minmax(0, 1fr) 20px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; animation: fade .3s both; animation-delay: calc(var(--i, 0) * 12ms); }
.styler-row:last-child { border-bottom: 0; }
.styler-row:hover { background: var(--surface-2); }
.styler-row.cat { font-weight: 700; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.styler-row.same .styler-new { color: var(--muted); font-style: italic; }
.styler-type { color: var(--muted); text-align: center; }
.styler-old { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.styler-arrow { color: var(--muted); }
.styler-new { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.styler-divider { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 8px; }

/* ---------- GIF-студия ---------- */
.studio-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.studio-layout .card { margin-bottom: 16px; }
@media (max-width: 980px) { .studio-layout { grid-template-columns: 1fr; } }
.studio-controls { display: grid; gap: 12px; }
.studio-preview { background: repeating-conic-gradient(#1b1c22 0 25%, #15161b 0 50%) 0 0 / 22px 22px; border-radius: 12px; padding: 14px; display: grid; place-items: center; overflow: hidden; }
.studio-canvas { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.media-card { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.media-card img { width: 100%; border-radius: 8px; background: #111; max-height: 160px; object-fit: contain; }
.media-meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.media-card select { flex: 1; min-width: 0; }

/* ---------- упрощённое оформление: плитки, наборы, «как в Discord» ---------- */
.tab-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.tab-group:first-of-type { padding-top: 4px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.qa { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: .2s; }
.qa svg { grid-row: span 2; width: 26px; height: 26px; color: var(--accent-text); }
.qa span { color: var(--muted); font-size: 12.5px; }
.qa:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-2px); }

.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 7px 11px; font: inherit; font-size: 13.5px; cursor: pointer; transition: .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.pick:hover { border-color: var(--border-2); background: var(--surface-2); }
.pick.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.pick-grid.fonts .pick { flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 11px; }
.pick-big { font-size: 16px; }
.pick-sub { font-size: 11px; color: var(--muted); }
.pick-grid.themes .pick { padding: 5px 11px 5px 5px; }
.theme-dot { width: 22px; height: 22px; border-radius: 7px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset; }

.quick-steps { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; color: var(--muted); font-size: 13.5px; }
.quick-steps span { display: inline-flex; align-items: center; gap: 8px; }
.quick-steps b, .step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; margin-right: 6px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; margin-bottom: 16px; }
.preset { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; cursor: pointer; display: grid; gap: 10px; transition: .2s; }
.preset:hover { border-color: var(--border-2); transform: translateY(-2px); }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 30px -14px var(--accent); }
.preset-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.preset .dc-side { max-height: 140px; overflow: hidden; }
.preset-role { display: flex; }

.dc-side { background: #2b2d31; border-radius: 10px; padding: 8px 6px; font-family: "gg sans", "Segoe UI", "Noto Sans", sans-serif; color: #949ba4; font-size: 14px; }
.dc-group + .dc-group { margin-top: 10px; }
.dc-cat { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-arrow { font-size: 10px; }
.dc-ch { display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin: 1px 0; border-radius: 4px; white-space: nowrap; overflow: hidden; }
.dc-ch:hover { background: #35373c; color: #dbdee1; }
.dc-ico { width: 18px; text-align: center; flex: none; opacity: .8; }
.dc-name { overflow: hidden; text-overflow: ellipsis; }
.dc-role { --c: #b5bac1; display: inline-block; padding: 3px 9px; border-radius: 6px; background: #2b2d31; color: var(--c); font-weight: 600; font-size: 13.5px; }
.dc-roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }

.quick-apply { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.quick-apply .card { margin-bottom: 0; }
@media (max-width: 980px) { .quick-apply { grid-template-columns: 1fr; } }
.quick-preview .dc-side { max-height: 520px; overflow: auto; }
.quick-opts { display: grid; gap: 10px; margin: 10px 0 14px; }
.btn.big { width: 100%; justify-content: center; padding: 12px 16px; font-size: 15px; }
.quick-foot { display: grid; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }

.styler-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 18px; align-items: start; margin-top: 6px; }
@media (max-width: 1100px) { .styler-grid { grid-template-columns: 1fr; } }
.styler-side { position: sticky; top: 16px; }
.styler-section { margin-bottom: 16px; }
.styler-section .field-label { margin-bottom: 8px; }
.styler-row { grid-template-columns: 22px 22px minmax(0, 1fr) 16px minmax(0, 1fr); }

.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .2); cursor: pointer; padding: 0; transition: transform .15s; }
.swatch:hover { transform: scale(1.15); }

.idea-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 158px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.idea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px; cursor: pointer; display: grid; gap: 6px; text-align: center; font-size: 13px; transition: .2s; }
.idea:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.idea-thumb { height: 76px; display: grid; place-items: center; background: #0d0e12; border-radius: 8px; overflow: hidden; }
.idea-thumb canvas { max-width: 100%; max-height: 76px; }
.studio-step { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.studio-step .field-label { display: flex; align-items: center; }
details.more summary { cursor: pointer; color: var(--accent-text); font-weight: 600; padding: 4px 0; }
details.more[open] summary { margin-bottom: 10px; }
.studio-layout { grid-template-columns: 380px minmax(0, 1fr); }

/* ---------- карточка человека (боковая панель) ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.drawer-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); backdrop-filter: blur(3px); animation: fade .2s both; }
.drawer-wrap.out { animation: fade .25s reverse both; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--solid); border-left: 1px solid var(--border-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); overflow-y: auto; padding: 22px; animation: drawer-in .3s var(--spring, ease) both; }
.drawer-wrap.out .drawer { animation: drawer-in .25s reverse both; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-x { position: absolute; top: 14px; right: 14px; }
.drawer-body { display: grid; gap: 12px; }
.drawer-body h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 10px 0 0; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.drawer-head { display: flex; gap: 14px; align-items: center; padding-right: 40px; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.avatar.xl { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; flex: none; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.kv-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:last-child { text-align: right; display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- понятные настройки ---------- */
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: -2px 0 10px; max-width: 760px; }
.role-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.role-tools input { flex: 1; min-width: 0; }
.struct-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.struct-col { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.struct-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.struct-title .badge { margin-left: auto; }
.struct-ico { font-size: 18px; }
.ladder { display: grid; gap: 4px; max-width: 620px; }
.ladder-row { --c: var(--muted); display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c); }
.ladder-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ladder-row.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.ladder-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.rank-template { display: grid; gap: 8px; max-width: 520px; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px dashed var(--border-2); }
.rank-template textarea { font-family: inherit; }

/* ---------- мастер настройки и активность ---------- */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-size: 13.5px; transition: .2s; }
.step:hover { border-color: var(--border-2); color: var(--text); }
.step-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-weight: 700; font-size: 12px; }
.step.active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.step.active .step-dot { background: var(--accent); color: #fff; }
.step.done { color: var(--text); }
.step.done .step-dot { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.setup-auto { display: grid; gap: 10px; max-width: 640px; padding: 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.act-cell { display: grid; gap: 4px; min-width: 140px; }
