/* Shelby Sessions — админ-панель.
   Дизайн-код общий с Shelby Scanner: токены, глубина панелей и фиолетовый акцент. */

:root {
  --bg: #080809;
  --panel: #111112;
  --panel-2: #151516;
  --panel-3: #1a191c;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f7f5fb;
  --muted: #8f8b9b;
  --muted-2: #625f6d;
  --purple: #a86dff;
  --purple-2: #7540d3;
  --purple-soft: rgba(168, 109, 255, .12);
  --green: #63d9a6;
  --red: #ff6f89;
  --orange: #ffae6c;
  --blue: #67a9ff;
  --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Urbanist", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

body { min-width: 1080px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #292633; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ───────────── Фоновая подсветка ───────────── */

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: .17;
  z-index: 0;
}
.ambient-one { width: 520px; height: 520px; background: #7e3cff; right: -180px; top: -240px; }
.ambient-two { width: 420px; height: 420px; background: #34206e; left: 14%; bottom: -320px; }

/* ───────────── Экран входа ───────────── */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #080809;
}

.auth-gate-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(169, 140, 214, .1) 1px, transparent 0);
  background-size: 23px 23px;
  mask-image: radial-gradient(circle at center, black 0 42%, transparent 79%);
  opacity: .65;
}

.auth-gate-card {
  width: 412px;
  position: relative;
  z-index: 4;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(20, 19, 22, .98), rgba(10, 10, 11, .99));
  box-shadow: 0 32px 90px rgba(0, 0, 0, .48);
  animation: cardIn .4s var(--ease);
}

.auth-gate-card:before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(192, 145, 255, .35), transparent 27%, transparent 70%, rgba(171, 107, 255, .12));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
}

@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } }

.auth-node-head { display: flex; align-items: center; gap: 15px; padding: 0 0 23px; }

.auth-node-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(186, 131, 255, .2);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #c6a3ef;
  background: radial-gradient(circle at 35% 25%, rgba(170, 105, 255, .18), rgba(114, 62, 178, .04));
  position: relative;
}
.auth-node-mark:before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255, 255, 255, .055); border-radius: 8px; }
.auth-node-mark svg { width: 17px; height: 17px; }
.auth-node-mark > i {
  position: absolute; right: -3px; top: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #b773ff; box-shadow: 0 0 10px #a159f2;
}

.auth-node-title h1 { margin: 0; color: #f3eff7; font-size: 21px; font-weight: 650; letter-spacing: -.5px; }
.auth-node-title h1 i { font-style: normal; color: #a877ed; }
.auth-node-title p { margin: 6px 0 0; color: #77717d; font-size: 11px; font-weight: 450; }

.auth-credential-panel { display: flex; flex-direction: column; gap: 14px; }

.auth-field { display: block; min-width: 0; }
.auth-field > span { display: block; margin: 0 0 7px; color: #817b86; font-size: 11px; font-weight: 560; }
.auth-field input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 11px;
  background: #0a0a0b;
  padding: 0 13px;
  color: #d7cfe0;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: .2s var(--ease);
}
.auth-field input::placeholder { color: #47424b; }
.auth-field input:focus {
  border-color: rgba(180, 116, 255, .4);
  box-shadow: 0 0 0 3px rgba(155, 83, 255, .07), inset 0 0 22px rgba(135, 69, 217, .03);
}

.login-error {
  min-height: 38px;
  margin-top: 13px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 101, 128, .22);
  border-radius: 10px;
  background: rgba(255, 82, 112, .075);
  color: #ff9daf;
  font-size: 11px;
  line-height: 1.45;
  animation: errorIn .25s var(--ease);
}
.login-error b {
  width: 17px; height: 17px; flex: 0 0 17px;
  border: 1px solid rgba(255, 120, 145, .25);
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 9px;
}
.login-error span { overflow-wrap: anywhere; }
@keyframes errorIn { from { opacity: 0; transform: translateY(-4px); } }

.auth-login-row { display: flex; flex-direction: column; gap: 15px; margin-top: 17px; }

.auth-submit {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(173, 108, 255, .48);
  border-radius: 999px;
  background: rgba(155, 89, 242, .035);
  color: #bb83ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(143, 75, 224, .04), 0 0 22px rgba(126, 61, 206, .06);
  transition: .22s var(--ease);
}
.auth-submit:hover {
  transform: translateY(-1px);
  background: rgba(155, 89, 242, .1);
  border-color: rgba(187, 128, 255, .72);
  color: #d0a7ff;
  box-shadow: 0 9px 25px rgba(126, 61, 206, .14), inset 0 0 18px rgba(155, 89, 242, .045);
}
.auth-submit:disabled { opacity: .45; cursor: default; transform: none; }

.auth-gate-foot {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding: 12px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.auth-gate-foot b { font-family: var(--mono); font-size: 10px; font-weight: 500; color: #9674bb; letter-spacing: .35px; }

/* ───────────── Стеклянный pill-навбар ───────────── */

.app { position: relative; z-index: 1; min-height: 100vh; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 30px 6px;
}

.nav-glass {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 18px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(28, 26, 33, .72), rgba(14, 14, 17, .68));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, .45),
    inset 0 1px rgba(255, 255, 255, .07),
    inset 0 -1px rgba(0, 0, 0, .35);
  position: relative;
  overflow: hidden;
}

/* Мягкий блик по верхней кромке — стекло, а не просто прозрачность. */
.nav-glass:after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190, 150, 255, .35), transparent);
  pointer-events: none;
}

.nav-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.nav-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #dfc9ff;
  border: 1px solid rgba(173, 135, 255, .32);
  background: linear-gradient(145deg, rgba(154, 100, 255, .3), rgba(97, 55, 189, .08));
  box-shadow: 0 0 22px rgba(130, 73, 255, .16), inset 0 0 16px rgba(255, 255, 255, .03);
}
.nav-brand-mark svg { width: 17px; height: 17px; }

.nav-brand-name { display: flex; align-items: baseline; gap: 4px; font-size: 15px; letter-spacing: -.2px; }
.nav-brand-name strong { font-weight: 700; color: #f0edf3; }
.nav-brand-name i { font-style: normal; font-weight: 700; color: #a877ed; }

.nav-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 999px;
  background: rgba(8, 8, 10, .5);
}

.nav-pill {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #837e8c;
  font-size: 12px;
  font-weight: 600;
  transition: .22s var(--ease);
}
.nav-pill svg { width: 16px; height: 16px; }
.nav-pill:hover { color: #d7d3de; background: rgba(255, 255, 255, .04); }
.nav-pill.active {
  color: #dcc4ff;
  background: linear-gradient(180deg, rgba(168, 109, 255, .2), rgba(168, 109, 255, .09));
  box-shadow: inset 0 0 0 1px rgba(180, 128, 255, .22), 0 6px 18px rgba(112, 55, 200, .18);
}
.nav-pill.active svg { color: #b98cff; }

.nav-side { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.nav-status {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(99, 217, 166, .16);
  border-radius: 999px;
  background: rgba(99, 217, 166, .06);
  color: #93a89f;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.nav-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.nav-status b { font-weight: 600; }

.nav-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .025);
  color: #aaa5b4;
  display: grid;
  place-items: center;
  transition: .2s var(--ease);
}
.nav-icon svg { width: 16px; height: 16px; }
.nav-icon:hover { border-color: rgba(255, 111, 137, .3); background: rgba(255, 111, 137, .08); color: #ff8fa4; }

/* ───────────── Контент ───────────── */

.content { padding: 26px 30px 60px; max-width: 1560px; margin: 0 auto; }

.page { display: none; animation: pageIn .45s var(--ease); }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
.section-kicker { margin: 0 0 7px; color: var(--purple); font-size: 10px; letter-spacing: 1.7px; font-weight: 750; }
.section-intro h2 { margin: 0; font-size: 24px; font-weight: 620; letter-spacing: -.5px; }
.section-intro > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.stat-row { display: flex; gap: 9px; flex: 0 0 auto; }
.stat-chip {
  min-width: 108px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-chip span { color: #8c8592; font-size: 11px; }
.stat-chip b { font-size: 20px; font-weight: 620; font-variant-numeric: tabular-nums; }
.stat-chip.online { border-color: rgba(99, 217, 166, .18); background: rgba(99, 217, 166, .05); }
.stat-chip.online b { color: #7ce5b8; }
.stat-chip.danger { border-color: rgba(255, 111, 137, .18); background: rgba(255, 111, 137, .05); }
.stat-chip.danger b { color: #ff8fa4; }

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(20, 20, 28, .94), rgba(13, 13, 18, .96));
  border-radius: var(--radius);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .14), inset 0 1px rgba(255, 255, 255, .018);
}

.users-panel { padding: 20px; }

.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.search-box { position: relative; width: 380px; max-width: 55%; }
.search-box svg { position: absolute; width: 15px; height: 15px; left: 13px; top: 12px; color: #64606c; }
.search-box input {
  width: 100%;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b0b0c;
  padding: 0 14px 0 39px;
  outline: none;
  color: #c9c5d0;
  font-size: 12px;
  transition: .2s var(--ease);
}
.search-box input::placeholder { color: #4d4954; }
.search-box input:focus { border-color: rgba(155, 108, 255, .4); box-shadow: 0 0 0 3px rgba(155, 108, 255, .055); }
.search-box input::-webkit-search-cancel-button { filter: invert(.5); }

.mini-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  color: #8f8a98;
  padding: 0 15px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: .2s var(--ease);
}
.mini-button svg { width: 14px; height: 14px; }
.mini-button:hover { color: white; border-color: rgba(155, 108, 255, .3); background: var(--purple-soft); }
.mini-button.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── Таблица пользователей ───────────── */

.user-table { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }

.user-head, .user-row {
  display: grid;
  grid-template-columns: 1.25fr .85fr 1.15fr .8fr .85fr .9fr 140px;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.user-head {
  height: 38px;
  background: rgba(255, 255, 255, .025);
  color: #68636f;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .9px;
  font-weight: 650;
}
.user-head .right { text-align: right; }

.user-row {
  min-height: 58px;
  border-top: 1px solid var(--line);
  color: #a6a1ad;
  font-size: 12px;
  transition: background .18s var(--ease);
  animation: rowIn .3s var(--ease);
}
.user-row:hover { background: rgba(255, 255, 255, .018); }
.user-row.is-blocked { background: rgba(255, 111, 137, .035); }
.user-row.is-blocked:hover { background: rgba(255, 111, 137, .06); }
@keyframes rowIn { from { opacity: 0; } }

.user-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #a97cff, #6740bd);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 5px 15px rgba(112, 61, 206, .25);
}
.user-row.is-blocked .user-avatar { background: linear-gradient(145deg, #6a5b6e, #3b333d); box-shadow: none; }
.user-identity > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-identity b { color: #e4e0eb; font-size: 13px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { color: var(--muted-2); font-size: 10px; font-family: var(--mono); }

.user-faker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px 2px 6px;
  margin-top: 2px;
  border: 1px solid rgba(168, 109, 255, .22);
  border-radius: 999px;
  background: rgba(168, 109, 255, .08);
  color: #c9aeff;
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: flex-start;
}
.user-faker svg { width: 10px; height: 10px; flex: 0 0 10px; }

.user-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin-top: 2px;
}
/* Внутри .user-sub оба чипа должны сидеть на одной линии — сбрасываем
   индивидуальные margin/align-self, которые у .user-faker остались с тех
   времён, когда чип был один. */
.user-sub .user-faker,
.user-sub .user-telegram {
  margin: 0;
  align-self: center;
  line-height: 14px;
}

/* Telegram-чип рядом с Faker в карточке пользователя. */
.user-telegram {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px 2px 6px;
  border: 1px solid rgba(38, 166, 224, .3);
  border-radius: 999px;
  background: rgba(38, 166, 224, .1);
  color: #8ad4f0;
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  transition: .15s var(--ease);
}
.user-telegram:hover { color: #b9e6ff; border-color: rgba(38, 166, 224, .55); background: rgba(38, 166, 224, .18); }
.user-telegram svg { width: 10px; height: 10px; flex: 0 0 10px; }

.cell-mono { font-family: var(--mono); font-size: 11px; color: #a09aab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-mono.empty { color: #4d4954; font-family: inherit; font-size: 11px; }
.cell-date { display: flex; flex-direction: column; gap: 2px; }
.cell-date b { color: #c4bfcd; font-size: 12px; font-weight: 550; }
.cell-date small { color: var(--muted-2); font-size: 10px; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: #8f8a98;
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .2px;
  white-space: nowrap;
}
.tag svg { width: 11px; height: 11px; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { border-color: rgba(99, 217, 166, .2); background: rgba(99, 217, 166, .07); color: #7ce5b8; }
.tag.danger { border-color: rgba(255, 111, 137, .22); background: rgba(255, 111, 137, .08); color: #ff8fa4; }
.tag.warn { border-color: rgba(255, 174, 108, .2); background: rgba(255, 174, 108, .07); color: #ffc08b; }
.tag.online { border-color: rgba(99, 217, 166, .2); background: rgba(99, 217, 166, .07); color: #7ce5b8; }
.tag.online i { box-shadow: 0 0 8px var(--green); }

.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .022);
  color: #8a8492;
  display: grid;
  place-items: center;
  transition: .18s var(--ease);
}
.row-action svg { width: 15px; height: 15px; }
.row-action:hover { color: #fff; border-color: rgba(155, 108, 255, .3); background: var(--purple-soft); }
.row-action.block:hover { color: var(--orange); border-color: rgba(255, 174, 108, .3); background: rgba(255, 174, 108, .08); }
.row-action.unblock:hover { color: var(--green); border-color: rgba(99, 217, 166, .3); background: rgba(99, 217, 166, .08); }
.row-action.delete:hover { color: var(--red); border-color: rgba(255, 111, 137, .3); background: rgba(255, 111, 137, .08); }
.row-action.telegram:hover { color: #8ad4f0; border-color: rgba(38, 166, 224, .5); background: rgba(38, 166, 224, .12); }
/* Уже задан контакт — иконка светится в цвет TG, чтобы отличать «есть/нет». */
.row-action.telegram.has-tg { color: #8ad4f0; border-color: rgba(38, 166, 224, .4); background: rgba(38, 166, 224, .08); }
.row-action.password:hover { color: #ffd580; border-color: rgba(255, 213, 128, .4); background: rgba(255, 213, 128, .08); }

/* Блок «Текущий пароль» в модалке смены пароля. */
.pw-current {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .022);
}
.pw-current-label {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 620;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.pw-current-value {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-current-value code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 14px;
  color: #eae4f2;
  letter-spacing: .5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
}
.pw-current-value code.pw-hidden { letter-spacing: 3px; color: #a09aab; }
.pw-current-value .row-action { width: 30px; height: 30px; }
.pw-current-note {
  color: #d69a5c;
  font-size: 11px;
  line-height: 1.35;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 54px 20px;
  border-top: 1px solid var(--line);
  color: #66616d;
}
.empty-state svg { width: 30px; height: 30px; color: #3c3844; margin-bottom: 4px; }
.empty-state b { color: #9d97a6; font-size: 13px; font-weight: 620; }
.empty-state span { font-size: 11px; }
.empty-state.hidden { display: none; }

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

.primary-button, .secondary-button, .danger-button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 650;
  transition: .22s var(--ease);
}
.primary-button svg, .secondary-button svg, .danger-button svg { width: 15px; height: 15px; }

.primary-button {
  border: 1px solid rgba(180, 145, 255, .34);
  background: linear-gradient(135deg, #a96eff, #7040bd);
  color: #fff;
  box-shadow: 0 8px 22px rgba(119, 58, 196, .18);
}
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .035);
  color: #c5c0cd;
}
.secondary-button:hover { background: rgba(255, 255, 255, .06); border-color: rgba(155, 108, 255, .35); color: white; }

.danger-button {
  border: 1px solid rgba(255, 111, 137, .28);
  background: rgba(255, 111, 137, .1);
  color: #ff91a4;
}
.danger-button:hover { background: rgba(255, 111, 137, .18); border-color: rgba(255, 111, 137, .45); }
.danger-button:disabled, .secondary-button:disabled { opacity: .45; cursor: default; }

/* ───────────── Модальные окна ───────────── */

.modal-backdrop, .confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 6, .74);
  backdrop-filter: blur(8px);
  z-index: 40;
  display: grid;
  place-items: center;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal { width: 470px; padding: 28px; position: relative; box-shadow: 0 30px 100px rgba(0, 0, 0, .5); animation: cardIn .3s var(--ease); }
.modal-close { position: absolute; right: 14px; top: 10px; color: #77717f; font-size: 24px; line-height: 1; }
.modal-close:hover { color: #fff; }

.modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 174, 108, .2);
  background: rgba(255, 174, 108, .07);
  color: var(--orange);
}

.modal h3, .confirm-card h3 { font-size: 19px; margin: 0 0 9px; font-weight: 640; letter-spacing: -.3px; }
.modal p, .confirm-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal p b { color: #d9d4e0; font-weight: 650; }

.block-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 20px 0 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .018);
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  color: #aaa5b1;
  transition: background .18s var(--ease);
}
.switch-line:hover { background: rgba(255, 255, 255, .025); }
.switch-line input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch-line > i {
  width: 32px;
  height: 18px;
  flex: 0 0 32px;
  border-radius: 20px;
  background: #27252e;
  position: relative;
  transition: .22s var(--ease);
}
.switch-line > i:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #77717f;
  left: 3px;
  top: 3px;
  transition: .22s var(--ease);
}
.switch-line input:checked + i { background: rgba(155, 108, 255, .28); }
.switch-line input:checked + i:before { left: 17px; background: #af88ff; box-shadow: 0 0 8px rgba(155, 108, 255, .45); }
.switch-line > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.switch-line span { font-size: 12px; font-weight: 560; color: #cbc6d3; }
.switch-line small { font-family: var(--mono); font-size: 10px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-line.disabled { opacity: .4; cursor: not-allowed; }

.field-block { display: block; margin-top: 16px; }
.field-block > span { display: block; color: #8c8796; font-size: 11px; margin: 0 0 7px; }
.field-block input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0b0c;
  padding: 0 12px;
  outline: none;
  color: #c9c5d0;
  font-size: 12px;
  transition: .2s var(--ease);
}
.field-block input::placeholder { color: #4d4954; }
.field-block input:focus { border-color: rgba(155, 108, 255, .4); box-shadow: 0 0 0 3px rgba(155, 108, 255, .055); }

.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

.confirm-card { width: 400px; padding: 28px; text-align: center; animation: cardIn .3s var(--ease); }
.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  background: rgba(255, 111, 137, .08);
  border: 1px solid rgba(255, 111, 137, .16);
  color: var(--red);
}
.confirm-card > div:last-child { display: flex; justify-content: center; gap: 9px; margin-top: 20px; }

/* ───────────── Рассылка ───────────── */

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 650; }

.broadcast-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }

.compose-panel, .preview-panel, .history-panel { padding: 22px; }
.history-panel { margin-top: 18px; }

.field-block textarea {
  width: 100%;
  height: 122px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0b0b0c;
  padding: 12px 13px;
  color: #c9c5d0;
  font-size: 12px;
  line-height: 1.55;
  outline: none;
  transition: .2s var(--ease);
}
.field-block textarea::placeholder { color: #4d4954; }
.field-block textarea:focus { border-color: rgba(155, 108, 255, .4); box-shadow: 0 0 0 3px rgba(155, 108, 255, .055); }

/* Список нативного <select> браузер рисует сам и стилизовать его нельзя,
   поэтому селект прячется, а значение берётся из него же. */
.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.custom-select { position: relative; width: 100%; z-index: 1; }
.custom-select.open { z-index: 90; }

.custom-select-trigger {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0b0c;
  color: #c9c4ce;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 520;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.custom-select-trigger:hover { border-color: rgba(174, 112, 249, .28); background: #0e0d10; }
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: 0;
  border-color: rgba(174, 110, 252, .47);
  box-shadow: 0 0 0 3px rgba(154, 83, 236, .07);
}

.custom-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.custom-select-arrow {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid #776e81;
  border-bottom: 1.5px solid #776e81;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .22s var(--ease), border-color .18s;
}
.custom-select.open .custom-select-arrow { border-color: #b98ae8; transform: translateY(2px) rotate(225deg); }

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 230px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 11px;
  background: rgba(16, 15, 18, .985);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .025);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(.985);
  transform-origin: top;
  transition: opacity .16s, transform .2s var(--ease), visibility .16s;
  scrollbar-width: thin;
  scrollbar-color: #39313f transparent;
}
.custom-select.open .custom-select-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.custom-select.drop-up .custom-select-menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }

.custom-select-option {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b8490;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  font-size: 11px;
  font-weight: 510;
  transition: background .15s, color .15s;
}
.custom-select-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-option:hover { background: rgba(255, 255, 255, .045); color: #eee9f2; }
.custom-select-option.selected { background: linear-gradient(90deg, rgba(164, 91, 249, .15), rgba(164, 91, 249, .055)); color: #d9c3ed; }
.custom-select-option.selected:after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #af70f4;
  box-shadow: 0 0 9px rgba(168, 91, 247, .8);
}
.custom-select-option:disabled { opacity: .35; cursor: not-allowed; }

.field-counter { display: block; margin-top: 6px; text-align: right; color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.field-counter.over { color: #ff8fa4; }

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b0b0c;
}
.segmented button {
  flex: 1;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #777280;
  font-size: 12px;
  font-weight: 600;
  transition: .22s var(--ease);
}
.segmented button:hover { color: #b6b0bf; }
.segmented button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.segmented button.active { background: rgba(165, 99, 255, .11); color: #ba95e4; box-shadow: inset 0 0 0 1px rgba(155, 108, 255, .13); }
.segmented button[data-level="success"].active { background: rgba(99, 217, 166, .1); color: #7ce5b8; box-shadow: inset 0 0 0 1px rgba(99, 217, 166, .16); }
.segmented button[data-level="warning"].active { background: rgba(255, 174, 108, .1); color: #ffc08b; box-shadow: inset 0 0 0 1px rgba(255, 174, 108, .16); }

.compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.compose-hint { color: var(--muted-2); font-size: 11px; }

.preview-tag {
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .3px;
}

/* Рамка повторяет панель уведомлений клиента, чтобы предпросмотр не врал. */
.preview-frame {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(22, 21, 30, .98), rgba(13, 13, 18, .99));
}

.notify-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .022);
  padding: 13px 14px 12px 16px;
  display: grid;
  gap: 7px;
}
.notify-card:before {
  content: "";
  position: absolute;
  left: 0; top: 11px; bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: .2s var(--ease);
}
.notify-card.unread { background: rgba(155, 108, 255, .055); border-color: rgba(155, 108, 255, .2); }
.notify-card.unread:before { background: var(--purple); box-shadow: 0 0 12px rgba(155, 108, 255, .55); }
.notify-card.unread.warning { background: rgba(255, 174, 108, .05); border-color: rgba(255, 174, 108, .2); }
.notify-card.unread.warning:before { background: var(--orange); box-shadow: 0 0 12px rgba(255, 174, 108, .5); }
.notify-card.unread.success { background: rgba(99, 217, 166, .05); border-color: rgba(99, 217, 166, .2); }
.notify-card.unread.success:before { background: var(--green); box-shadow: 0 0 12px rgba(99, 217, 166, .5); }

.notify-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notify-card b { font-size: 12.5px; font-weight: 640; line-height: 1.35; color: #e9e5f0; overflow-wrap: anywhere; }
.notify-card p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.notify-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 1px; }
.notify-time { font-size: 9.5px; color: var(--muted-2); letter-spacing: .2px; }
.notify-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; margin-top: 4px; background: var(--purple); box-shadow: 0 0 9px rgba(155, 108, 255, .6); }
.notify-card.warning .notify-dot { background: var(--orange); box-shadow: 0 0 9px rgba(255, 174, 108, .55); }
.notify-card.success .notify-dot { background: var(--green); box-shadow: 0 0 9px rgba(99, 217, 166, .55); }
.notify-mark {
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #8f8a98;
  padding: 0 9px;
  font-size: 9.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.notify-mark svg { width: 11px; height: 11px; }

.history-list { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 186px 34px;
  align-items: center;
  gap: 18px;
  padding: 14px 16px 14px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .018);
  transition: .18s var(--ease);
  animation: rowIn .3s var(--ease);
}
.history-item:hover { background: rgba(255, 255, 255, .032); }
.history-item:before {
  content: "";
  position: absolute;
  left: 0; top: 13px; bottom: 13px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--purple);
  box-shadow: 0 0 12px rgba(155, 108, 255, .45);
}
.history-item.success:before { background: var(--green); box-shadow: 0 0 12px rgba(99, 217, 166, .4); }
.history-item.warning:before { background: var(--orange); box-shadow: 0 0 12px rgba(255, 174, 108, .4); }

.history-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.history-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.history-title b { font-size: 13px; font-weight: 640; color: #e4e0eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main p { margin: 0; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 10px; }

.history-progress { display: flex; flex-direction: column; gap: 8px; }
.history-progress span { color: #9d97a6; font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-track { height: 5px; background: rgba(255, 255, 255, .055); border-radius: 20px; overflow: hidden; }
.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #7041d0, #b784ff);
  box-shadow: 0 0 14px rgba(157, 102, 255, .5);
  transition: width .6s var(--ease);
}

@media (max-width: 1400px) {
  .broadcast-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ───────────── Тосты ───────────── */

.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 9px; }

.toast {
  width: 322px;
  min-height: 54px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(28, 27, 34, .98), rgba(17, 16, 21, .98));
  box-shadow: 0 16px 42px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .035);
  animation: toastIn .35s var(--ease);
}
.toast:before {
  content: "";
  position: absolute;
  left: 0; top: 13px; bottom: 13px;
  width: 2px;
  border-radius: 2px;
  background: #a76cff;
  box-shadow: 0 0 12px rgba(167, 108, 255, .55);
}
.toast i {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(155, 108, 255, .11);
  border: 1px solid rgba(169, 113, 255, .2);
  color: #c194ff;
  display: grid; place-items: center;
  font-style: normal;
  font-size: 14px;
  font-weight: 750;
}
.toast span { font-size: 12px; font-weight: 600; line-height: 1.35; color: #ded9e5; overflow-wrap: anywhere; }
.toast.success:before { background: var(--green); box-shadow: 0 0 12px rgba(99, 217, 166, .45); }
.toast.success i { background: rgba(99, 217, 166, .1); border-color: rgba(99, 217, 166, .18); color: #7ce5b8; }
.toast.error:before { background: #ff718b; box-shadow: 0 0 12px rgba(255, 113, 139, .4); }
.toast.error i { background: rgba(255, 111, 137, .1); border-color: rgba(255, 111, 137, .2); color: #ff8fa4; }
.toast.leaving { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

@media (max-width: 1320px) {
  .user-head, .user-row { grid-template-columns: 1.2fr .9fr 1fr .8fr .85fr 128px; }
  .user-head > span:nth-child(5), .user-row > .col-login { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
