/* Xameleon admin panel. Loaded by admin.html; all behaviour lives in assets/js/admin.js. */

:root {
  --c: #00d9b4; --cb: #00b896; --p: #7c5af5; --b: #4f7af5; --o: #fb923c; --r: #ef4444; --g: #10b981; --tg: #2aabee;
  --bg: #060c18; --bg2: #0b1220; --bg3: #0f1a2e;
  --br: rgba(255,255,255,.08); --br2: rgba(255,255,255,.12);
  --t1: #fff; --t2: rgba(255,255,255,.62); --t3: rgba(255,255,255,.42);
  --f: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 240px;
  --header-h: 60px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--t1); font-family: var(--f); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--t2); }
.dim { color: var(--t3); }
.accent { color: var(--c); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.noscript { padding: 40px; text-align: center; color: var(--t2); }

/* ── SPINNER ── */
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--c);
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FULL-SCREEN STATES (boot / login / no access) ── */
.screen { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px 16px; background: #02060f; overflow-y: auto; }
.screen::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 700px 500px at 50% 40%, rgba(55,35,200,.18), transparent 70%); }
.boot { position: relative; display: flex; align-items: center; gap: 10px; color: var(--t2); font-size: 13px; }
.auth-card { position: relative; width: 100%; max-width: 400px; margin: auto; padding: 40px 36px;
  background: linear-gradient(160deg, rgba(15,22,42,.98), rgba(8,13,28,.98)); background-origin: border-box;
  border: 1px solid rgba(255,255,255,.1); border-radius: 20px; box-shadow: 0 40px 80px rgba(0,0,0,.7); }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-logo { display: block; height: 36px; width: auto; margin: 0 auto 16px; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.auth-sub { font-size: 13px; color: rgba(255,255,255,.45); margin-top: 7px; }
.auth-who { font-size: 13px; color: var(--t1); margin-top: 10px; font-weight: 600; word-break: break-word; }
.auth-who:empty { display: none; }
.btn-tg { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 18px;
  border: 0; border-radius: 12px; background: var(--tg); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .15s, opacity .15s; box-shadow: 0 10px 30px rgba(42,171,238,.25); }
.btn-tg:hover:not(:disabled) { background: #229ed9; transform: translateY(-1px); }
.btn-tg:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn-tg svg { width: 22px; height: 22px; flex-shrink: 0; }
.auth-bot { margin-top: 10px; text-align: center; font-size: 12px; color: var(--t3); min-height: 16px; }
.auth-msg { margin-top: 12px; font-size: 12.5px; color: #f87171; text-align: center; line-height: 1.5; min-height: 18px; white-space: pre-line; }
.auth-msg.info { color: var(--t2); }
.auth-hint { margin-top: 18px; padding: 14px 16px; background: rgba(0,217,180,.06); border: 1px solid rgba(0,217,180,.18);
  border-radius: 10px; font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.6; }
.auth-hint code { color: var(--c); background: rgba(0,217,180,.1); }
.auth-btns { display: flex; flex-direction: column; gap: 10px; }
.btn-block { width: 100%; text-align: center; padding: 11px 16px; font-size: 13px; text-decoration: none; display: block; }

/* ── LAYOUT ── */
.adm-wrap { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.adm-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--br);
  display: flex; flex-direction: column; flex-shrink: 0; transition: transform .25s ease; }
.sb-logo { height: var(--header-h); padding: 0 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--br); flex-shrink: 0; }
.sb-logo-img { display: block; height: 22px; width: auto; }
.sb-logo-badge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: rgba(0,217,180,.15);
  color: var(--c); border: 1px solid rgba(0,217,180,.3); letter-spacing: .5px; text-transform: uppercase; }
.sb-nav { flex: 1; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sb-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--t3); padding: 12px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--t2);
  font-size: 13px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.sb-link:hover { background: rgba(255,255,255,.05); color: var(--t1); }
.sb-link.act { background: rgba(0,217,180,.08); color: var(--c); font-weight: 700; }
.sb-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.sb-link:hover .sb-ico, .sb-link.act .sb-ico { opacity: 1; }
.sb-badge { margin-left: auto; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: rgba(0,217,180,.15); color: var(--c); }
.sb-badge.warn { background: rgba(251,146,60,.16); color: var(--o); }
.sb-bot { padding: 10px; border-top: 1px solid var(--br); display: flex; align-items: center; gap: 8px; }
.sb-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; }
.sb-user-txt { min-width: 0; display: flex; flex-direction: column; }
.sb-uname { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-urole { display: block; font-size: 11px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-logout { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--br);
  background: rgba(255,255,255,.04); color: var(--t2); font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; transition: all .15s; }
.sb-logout:hover { color: #f87171; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.sb-logout svg { width: 14px; height: 14px; }
.sb-backdrop { display: none; }

/* ── AVATARS ── */
.av { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 10px; background: linear-gradient(135deg, var(--p), var(--c)); color: #fff; font-weight: 800; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
.av-md { width: 34px; height: 34px; font-size: 13px; }
.av-lg { width: 56px; height: 56px; font-size: 22px; border-radius: 16px; }

/* ── HEADER ── */
.adm-header { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; border-bottom: 1px solid var(--br); background: var(--bg2); flex-shrink: 0; }
.adm-header-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.adm-page-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-header-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,.05); border: 1px solid var(--br);
  display: inline-flex; align-items: center; justify-content: center; color: var(--t2); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255,255,255,.09); color: var(--t1); }
.icon-btn svg { width: 15px; height: 15px; }
.burger { display: none; }
.back-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; background: rgba(255,255,255,.05);
  border: 1px solid var(--br); color: var(--t2); font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; }
.back-btn:hover { color: var(--t1); background: rgba(255,255,255,.09); }
.back-btn svg { width: 13px; height: 13px; }

/* ── BUTTONS ── */
.btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 9px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .18s; border: 1px solid transparent; text-decoration: none; white-space: nowrap; line-height: 1.3; }
.btn-xs { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 10px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; cursor: pointer; transition: all .18s; border: 1px solid transparent; white-space: nowrap; line-height: 1.3; }
/* border-box origin: the gradient also fills the 1px transparent border, otherwise its right end repeats there as a thin strip on the left */
.primary { background: linear-gradient(90deg, var(--p), var(--c)); background-origin: border-box; color: #fff; }
.primary:hover:not(:disabled) { filter: brightness(1.1); }
.ghost { background: rgba(255,255,255,.06); border-color: var(--br2); color: var(--t1); }
.ghost:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #f87171; }
.danger:hover:not(:disabled) { background: rgba(239,68,68,.2); }
.btn-sm:disabled, .btn-xs:disabled { opacity: .5; cursor: default; }
.busy { cursor: progress !important; opacity: .6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── FORM CONTROLS ── */
.ctl, .form-group input, .form-group select, .form-group textarea {
  width: 100%; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--br2); background: rgba(255,255,255,.04);
  color: var(--t1); font-size: 13px; outline: none; transition: border-color .18s, box-shadow .18s; }
.ctl:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--c); box-shadow: 0 0 0 3px rgba(0,217,180,.1); }
.ctl::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: var(--t3); }
select.ctl, .form-group select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23aab4c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2 4 6 8 10 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
select.ctl:hover, .form-group select:hover { border-color: rgba(255,255,255,.26); }
select option { background: #0e1525; color: #fff; }
.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-group input:disabled, .form-group textarea:disabled, .form-group select:disabled { opacity: .5; cursor: not-allowed; }
.invalid, .form-group input.invalid { border-color: rgba(239,68,68,.7) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important; }
.form-card { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 22px; margin-bottom: 20px; min-width: 0; }
.form-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 16px; }
.form-card h4 { font-size: 12px; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .5px; margin: 6px 0 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.form-row.four { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--t2); }
.char-count { font-size: 11px; color: var(--t3); text-align: right; }
.hint { font-size: 12px; color: var(--t2); line-height: 1.6; margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--br); }
.note { font-size: 12.5px; line-height: 1.55; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.warn-note { background: rgba(251,146,60,.08); border: 1px solid rgba(251,146,60,.28); color: #fdba74; }
.lead-txt { font-size: 13px; color: var(--t2); margin-bottom: 16px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--t2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch .sw { position: relative; width: 38px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.16); transition: background .15s; flex-shrink: 0; }
.switch .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--c); }
.switch input:checked + .sw::after { transform: translateX(16px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--c); outline-offset: 2px; }

/* segmented toggle */
.seg-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--br); flex-shrink: 0; }
.seg-btn { padding: 6px 14px; border-radius: 7px; border: 0; background: none; color: var(--t2); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg-btn.act { background: rgba(0,217,180,.14); color: var(--c); }

/* ── TOOLBAR / PAGER ── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--t3); pointer-events: none; }
.toolbar .search input { padding-left: 32px; }
.toolbar select.ctl { width: auto; flex: 0 1 auto; }
.toolbar .grow { flex: 1; }
.pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; font-size: 12px; color: var(--t2); }
.pager:empty { display: none; }
.pager-info { margin-right: auto; }

/* ── CARDS / SECTIONS ── */
.card { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; margin-bottom: 20px; min-width: 0; overflow: hidden; }
.card-hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card > .card-hdr { padding: 14px 18px; border-bottom: 1px solid var(--br); }
.form-card > .card-hdr { margin-bottom: 16px; }
.form-card > .card-hdr h3 { margin-bottom: 0; }
.sec-hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.sec-title { font-size: 15px; font-weight: 800; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.empty { padding: 28px; text-align: center; color: var(--t3); font-size: 13px; }
.loading-block { display: flex; align-items: center; gap: 10px; padding: 28px; color: var(--t2); font-size: 13px; }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { display: block; background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 16px 18px;
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; min-width: 0; }
a.stat-card:hover { border-color: rgba(0,217,180,.3); transform: translateY(-1px); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--t2); }
.stat-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico svg { width: 16px; height: 16px; }
.stat-ico.g { background: rgba(0,217,180,.1); color: var(--c); }
.stat-ico.p { background: rgba(124,90,245,.12); color: var(--p); }
.stat-ico.b { background: rgba(79,122,245,.12); color: var(--b); }
.stat-ico.o { background: rgba(251,146,60,.12); color: var(--o); }
.stat-ico.tg { background: rgba(42,171,238,.12); color: var(--tg); }
.stat-val { font-size: 27px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 11.5px; color: var(--t3); margin-top: 5px; }
.stat-sub b { color: var(--g); font-weight: 700; }
.skel { display: inline-block; width: 60px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.06); }

/* ── TABLES ── */
.tbl-wrap { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; overflow-x: auto; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.tbl-wrap.flat { border: 0; border-radius: 0; margin: 0; background: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .5px;
  text-align: left; background: rgba(255,255,255,.02); white-space: nowrap; }
.tbl tbody tr { border-top: 1px solid rgba(255,255,255,.05); transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }
.tbl td.td-muted { color: var(--t2); font-size: 12px; }
.tbl tr.row-click { cursor: pointer; }
.tbl tr.row-click:focus-visible { outline: 2px solid var(--c); outline-offset: -2px; }
.tbl tr.state-row:hover { background: none; }
.tbl tr.state-row td { padding: 26px 16px; color: var(--t3); }
.state-msg { position: sticky; left: 16px; display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 64px); white-space: normal; }
.tbl tr.state-row.err td { color: #f87171; }
.tbl.mini td, .tbl.mini th { padding: 8px 10px; }
.tbl-users { min-width: 1240px; }
.tbl-orders { min-width: 1180px; }
.tbl-proxies { min-width: 1280px; }
.tbl-campaigns { min-width: 720px; }
.tbl-tg-history { min-width: 760px; }
.tbl-tg-recipients { min-width: 760px; }
.tbl-subs { min-width: 680px; }
.tbl-contacts { min-width: 1100px; }
.tbl-audit { min-width: 820px; }
.tbl-ov-contacts { min-width: 620px; }
.cell-clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-msg { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t2); }
.lnk { color: var(--c); text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.lnk-btn { background: none; border: 0; padding: 0; color: var(--c); font-weight: 600; cursor: pointer; text-align: left; }
.lnk-btn:hover { text-decoration: underline; }
.ucell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ucell-txt { min-width: 0; display: flex; flex-direction: column; }
.ucell-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ucell-sub { display: block; font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ucell-btn { display: inline-flex; max-width: 100%; padding: 2px; margin: -2px; border: 0; border-radius: 8px; background: none; color: inherit; text-align: left; cursor: pointer; }
.ucell-btn:hover .ucell-name { color: var(--c); }
.sub-line { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.err-line { font-size: 11.5px; color: #f87171; margin-top: 3px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc { display: inline-block; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.06); }

/* ── TAGS ── */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.g { background: rgba(16,185,129,.12); color: #34d399; }
.tag.o { background: rgba(251,146,60,.12); color: var(--o); }
.tag.p { background: rgba(124,90,245,.14); color: #a28bff; }
.tag.b { background: rgba(79,122,245,.14); color: #8aa7ff; }
.tag.r { background: rgba(239,68,68,.12); color: #f87171; }
.tag.n { background: rgba(255,255,255,.07); color: var(--t2); }
.tag.tg { background: rgba(42,171,238,.13); color: #5cc3f5; }
.tag.w { background: rgba(255,255,255,.1); color: #e5e7eb; }
.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── BARS ── */
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--p), var(--c)); transition: width .4s ease; }
.bar-fill.o { background: var(--o); }
.bar-fill.r { background: var(--r); }
.traffic { min-width: 140px; }
.traffic-txt { font-size: 12px; margin-bottom: 5px; white-space: nowrap; }
.prog { min-width: 170px; }
.prog-txt { font-size: 11.5px; margin-top: 5px; white-space: nowrap; }
.prog-txt .ok { color: #34d399; }
.prog-txt .bad { color: #f87171; }

/* ── SEGMENTS / AUDIENCE ── */
.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.seg-card { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.seg-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.seg-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.seg-ico svg { width: 18px; height: 18px; }
.seg-ico.g { background: rgba(0,217,180,.1); color: var(--c); }
.seg-ico.b { background: rgba(79,122,245,.12); color: var(--b); }
.seg-ico.o { background: rgba(251,146,60,.12); color: var(--o); }
.seg-ico.p { background: rgba(124,90,245,.12); color: var(--p); }
.seg-ico.tg { background: rgba(42,171,238,.12); color: var(--tg); }
.seg-name { font-size: 13px; font-weight: 700; }
.seg-desc { font-size: 12px; color: var(--t2); margin-top: 2px; }
.seg-count { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.05); border: 1px solid var(--br); color: var(--t2); }
.pill b { color: var(--t1); }
.seg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.aud-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.aud-card { background: var(--bg2); border: 1px solid var(--br); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.aud-label { font-size: 11.5px; color: var(--t2); font-weight: 600; }
.aud-val { font-size: 22px; font-weight: 900; letter-spacing: -.5px; margin-top: 4px; }
.aud-card.g .aud-val { color: #34d399; }
.aud-card.r .aud-val { color: #f87171; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--br); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 16px 9px; font-size: 13px; font-weight: 700; color: var(--t2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--t1); }
.tab[aria-selected="true"] { color: var(--c); border-bottom-color: var(--c); }

/* ── PUSH PREVIEW ── */
.preview-label { font-size: 12px; font-weight: 700; color: var(--t2); margin-bottom: 10px; }
.preview-cap { font-size: 11.5px; color: var(--t3); margin-top: 8px; line-height: 1.5; }
.push-preview { background: #1a2540; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.push-preview-ico { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; object-fit: contain; background: #fff; }
.push-preview-body { flex: 1; min-width: 0; }
.push-preview-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; word-break: break-word; }
.push-preview-msg { font-size: 12px; color: var(--t2); line-height: 1.4; word-break: break-word; white-space: pre-wrap; }
.push-preview-site { font-size: 11px; color: var(--t3); margin-top: 4px; }

/* ── TELEGRAM PREVIEW ── */
.tg-chat { background: #0e1621; border: 1px solid var(--br); border-radius: 14px; overflow: hidden; }
.tg-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #17212b; border-bottom: 1px solid rgba(0,0,0,.3); }
.tg-chat-ava { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--p), var(--c)); font-weight: 800; font-size: 14px; }
.tg-chat-name { font-size: 13.5px; font-weight: 700; color: #f5f5f5; }
.tg-chat-sub { font-size: 11.5px; color: #6c7883; }
.tg-chat-body { padding: 16px 14px 18px; min-height: 160px; }
.tg-bubble { background: #182533; color: #f5f5f5; border-radius: 14px 14px 14px 4px; padding: 8px 12px 6px; max-width: 100%; }
.tg-bubble-text { font-size: 14px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
.tg-bubble-text.placeholder { color: #6c7883; font-style: italic; }
.tg-bubble-time { text-align: right; font-size: 11px; color: #6c7883; margin-top: 2px; }
.tg-inline-btn { margin-top: 4px; background: rgba(43,82,120,.55); border-radius: 10px; text-align: center; padding: 9px 12px;
  font-size: 13px; font-weight: 600; color: #f5f5f5; word-break: break-word; }

/* ── TEMPLATES ── */
.tpl-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--t3); margin: 8px 2px 2px; }
.tpl-item { display: block; width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--br); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; transition: border-color .15s; }
.tpl-item:hover { border-color: rgba(0,217,180,.3); }
.tpl-item.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.tpl-item-name { display: block; font-size: 13px; font-weight: 700; }
.tpl-item-desc { display: block; font-size: 12px; color: var(--t2); margin-top: 3px; }
.tpl-view { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 16px; min-width: 0; }
.tpl-view-hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tpl-view-meta { min-width: 0; }
.tpl-view-name { font-size: 15px; font-weight: 800; }
.tpl-view-subject { font-size: 13px; margin-top: 4px; word-break: break-word; }
.mail-frame { display: block; width: 100%; height: 620px; border: 1px solid var(--br); border-radius: 10px; background: #02060f; }
.tpl-test { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.tpl-test .ctl { flex: 1 1 220px; width: auto; }
.tpl-item-ch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tpl-item-ch .tag { padding: 2px 8px; font-size: 10.5px; }
.tpl-facts { margin: 2px 0 14px; padding: 12px 14px; border: 1px solid var(--br); border-radius: 10px; background: rgba(255,255,255,.02); grid-template-columns: 150px minmax(0, 1fr); }
.tpl-facts:empty { display: none; }
.tpl-facts dd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tpl-extra-act { margin-top: 10px; }
.mail-status { position: relative; background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 12px 44px 12px 16px; margin-bottom: 14px; }
.mail-status:empty { display: none; }
.mail-status.is-closed { background: none; border: 0; padding: 0; margin-bottom: 10px; }
.mailbar-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--t2); font-size: 20px; line-height: 1; cursor: pointer; }
.mailbar-close:hover, .mailbar-close:focus-visible { background: rgba(255,255,255,.07); color: #fff; }
.mail-status .kv-inline { margin-bottom: 0; }
.ok-note { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.28); color: #a7f3d0; }
.err-lnk { color: #f87171; }
.tbl-mlog { min-width: 920px; }
.modal-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--t2); cursor: pointer; }
.modal-check input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--c); }

/* ── CATALOG ── */
.cat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; margin-bottom: 16px; }
.kv-inline > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kv-inline .tag { white-space: normal; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }
.matrix input { width: 100%; min-width: 80px; }
.matrix td, .matrix th { white-space: nowrap; }
.catalog-bar { position: sticky; bottom: -24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 0 24px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 2; }
.catalog-errors { flex: 1 1 100%; color: #f87171; font-size: 12.5px; line-height: 1.6; white-space: pre-line; }
.catalog-errors:empty { display: none; }
.dirty-flag { font-size: 12px; color: var(--o); margin-right: auto; }

/* ── INTEGRATIONS ── */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 20px; }
.int-card { background: var(--bg2); border: 1px solid var(--br); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.int-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.int-name { font-size: 14px; font-weight: 800; }
.int-desc { font-size: 12px; color: var(--t2); }
.int-line { font-size: 12px; color: var(--t2); word-break: break-word; }
.int-line.err { color: #f87171; }
.int-where { font-size: 11.5px; color: var(--t3); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--br); }
.general-card { max-width: 520px; }

/* ── DRAWER ── */
.drawer-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(600px, 100%); display: flex; flex-direction: column;
  background: var(--bg2); border-left: 1px solid var(--br2); box-shadow: -30px 0 60px rgba(0,0,0,.45);
  transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--br); flex-shrink: 0; }
.drawer-title { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.dr-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dr-head-txt { min-width: 0; }
.dr-name { font-size: 18px; font-weight: 800; word-break: break-word; }
.dr-sub { font-size: 13px; color: var(--t2); word-break: break-all; }
.dr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dr-box { background: rgba(255,255,255,.025); border: 1px solid var(--br); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.dr-box-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--t3); margin-bottom: 10px; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-block { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dr-block .ctl { flex: 1 1 200px; width: auto; }
.dr-reason { font-size: 12.5px; color: #fca5a5; margin-top: 10px; word-break: break-word; }
.dr-h { font-size: 13px; font-weight: 800; margin: 20px 0 10px; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--t2); }
.kv dd { word-break: break-word; }
.px-card { background: rgba(255,255,255,.025); border: 1px solid var(--br); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.px-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.px-line { font-size: 12.5px; color: var(--t2); margin-bottom: 8px; word-break: break-all; }
.px-meta { font-size: 11.5px; color: var(--t3); margin-top: 8px; }
.px-card .row-actions { margin-top: 10px; }

/* ── MODAL ── */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px 16px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-y: auto; }
.modal { position: relative; width: min(560px, 100%); margin: auto; padding: 26px; border-radius: 18px; background: #0b1220; border: 1px solid var(--br2); }
.modal-backdrop.wide .modal { width: min(820px, 100%); }
.modal-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--br);
  background: rgba(255,255,255,.05); color: var(--t1); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.modal h3 { font-size: 17px; font-weight: 800; margin: 0 36px 14px 0; word-break: break-word; }
.modal-body { font-size: 13px; color: var(--t2); line-height: 1.6; }
.modal-body p + p { margin-top: 10px; }
.modal-body .warn { color: #fdba74; }
.modal-body .form-group { margin: 16px 0 0; }
.modal-body .kv { margin-bottom: 14px; }
.modal-body .kv dd { color: var(--t1); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.msg-full { white-space: pre-wrap; word-break: break-word; color: var(--t1); background: #080f1e; border: 1px solid var(--br);
  border-radius: 10px; padding: 14px; max-height: 340px; overflow-y: auto; }
.mail-text { white-space: pre-wrap; word-break: break-word; color: var(--t1); background: #080f1e; border-radius: 10px; padding: 16px; max-height: 420px; overflow-y: auto; }
.modal .mail-frame { height: 460px; }

/* ── TOASTS ── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; border: 1px solid;
  font-size: 13px; font-weight: 600; line-height: 1.45; box-shadow: 0 20px 50px rgba(0,0,0,.5);
  transform: translateY(16px); opacity: 0; transition: transform .25s, opacity .25s; word-break: break-word; }
.toast.show { transform: none; opacity: 1; }
.toast span { flex: 1; }
.toast.ok { background: #0f2218; border-color: rgba(16,185,129,.4); color: #34d399; }
.toast.err { background: #200d0d; border-color: rgba(239,68,68,.4); color: #f87171; }
.toast.info { background: #0e1830; border-color: rgba(79,122,245,.4); color: #9db5ff; }
.toast-x { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; }
.toast-x:hover { opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .aud-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid, .split, .cat-grid, .tpl-layout { grid-template-columns: minmax(0, 1fr); }
  .seg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 120; width: min(280px, 85vw); transform: translateX(-100%); box-shadow: 20px 0 50px rgba(0,0,0,.5); }
  .sidebar.open { transform: none; }
  .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .sb-backdrop.open { opacity: 1; visibility: visible; }
  .burger { display: inline-flex; }
  .adm-header { padding: 0 16px; }
  .adm-content { padding: 16px; }
  .back-btn span { display: none; }
  .back-btn { padding: 0; width: 36px; height: 36px; justify-content: center; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-val { font-size: 22px; }
  .form-row, .form-row.three, .form-row.four { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-card { padding: 16px; }
  .aud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .search { flex-basis: 100%; max-width: none; }
  .toolbar select.ctl { flex: 1 1 140px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .drawer { width: 100%; border-left: 0; }
  .drawer-body { padding: 16px; }
  .modal { padding: 20px 16px; }
  .mail-frame { height: 480px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .catalog-bar { bottom: -16px; padding-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══ Blog: list and post editor (assets/js/admin-blog.js) ═══ */
.tbl-blog td { vertical-align: middle; }
.be-li-t { font-weight: 700; margin-bottom: 2px; }
.be-chip { display: inline-block; min-width: 26px; margin-right: 4px; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 800; text-align: center;
  background: rgba(79,122,245,.14); color: #8aa7ff; }
.be-chip.on { background: rgba(16,185,129,.14); color: #34d399; }
.be-chip.off { background: rgba(255,255,255,.05); color: var(--t3); text-decoration: line-through; }

.be-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.be-top-t { flex: 1; min-width: 220px; }
.be-top-name { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.be-top-st { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.be-top-a { display: flex; gap: 8px; flex-wrap: wrap; }
.be-job { display: flex; align-items: center; gap: 10px; background: rgba(79,122,245,.08); border: 1px solid rgba(79,122,245,.28); color: #c7d6ff; }
.be-fail b { display: block; margin-bottom: 6px; }
.be-err { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; margin: 0 0 10px; padding: 10px; border-radius: 8px;
  background: rgba(0,0,0,.25); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: #fed7aa; }

.be-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.be-side { position: sticky; top: 12px; display: flex; flex-direction: column; }
.be-card { margin-bottom: 16px; }
.be-card-b { padding: 16px 18px 4px; }
.be-h { font-size: 13.5px; font-weight: 800; }
.be-langbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.be-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--t3); vertical-align: middle; }
.be-dot.ok { background: var(--g); }
.be-dot.bad { background: var(--r); }
.be-save { font-size: 12px; color: var(--t3); }
.be-save.ok { color: #34d399; }
.be-save.err { color: #f87171; }
.be-left { text-align: left; }
.be-over { color: #fb923c !important; }
.be-title-in { font-size: 17px !important; font-weight: 700; }
.be-checks-row, .be-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.be-row .ctl { flex: 1; min-width: 160px; }
.be-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.be-slug { display: flex; align-items: center; gap: 4px; min-width: 0; }
.be-slug .ctl { flex: 1; min-width: 0; }
.be-cover { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; border: 1px solid var(--br); margin-bottom: 8px; }
.be-cover-empty { display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; font-size: 12px; color: var(--t3); background: rgba(255,255,255,.03); }
.be-ck { margin-bottom: 14px; }
.be-ck-h { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.be-ok { font-size: 12.5px; color: #34d399; }
.be-issue { display: block; width: 100%; margin: 0 0 5px; padding: 7px 9px; border: 0; border-radius: 8px; text-align: left; font-size: 12px; line-height: 1.45; cursor: pointer; }
.be-issue.err { background: rgba(239,68,68,.1); color: #fca5a5; }
.be-issue.warn { background: rgba(251,146,60,.08); color: #fdba74; }
.be-issue:hover { filter: brightness(1.15); }
.be-problems { margin: 0 0 4px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; }

.be-blocks-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.be-blocks { display: flex; flex-direction: column; gap: 10px; }
.bb { background: var(--bg2); border: 1px solid var(--br); border-radius: 12px; padding: 10px 12px 12px; }
.bb:focus-within { border-color: rgba(0,217,180,.45); }
.bb-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bb-type { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--t3); }
.bb-acts { display: flex; gap: 4px; }
.bb-a { width: 28px; height: 26px; border-radius: 7px; border: 1px solid var(--br2); background: rgba(255,255,255,.04); color: var(--t2); cursor: pointer; font-size: 13px; }
.bb-a:hover:not(:disabled) { color: var(--t1); background: rgba(255,255,255,.1); }
.bb-a:disabled { opacity: .35; cursor: default; }
.bb-del:hover:not(:disabled) { color: #f87171; border-color: rgba(239,68,68,.4); }
.bb-tb { display: flex; gap: 4px; margin-bottom: 6px; }
.bb-tb-b { min-width: 30px; height: 26px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--br); background: rgba(255,255,255,.04); color: var(--t2); cursor: pointer; font-size: 12.5px; }
.bb-tb-b:hover { color: var(--t1); background: rgba(255,255,255,.1); }
.bb-rich { min-height: 44px; padding: 10px 12px; border: 1px solid var(--br2); border-radius: 9px; background: var(--bg); font-size: 14.5px; line-height: 1.7; color: #dbe3ee; outline: none; overflow-wrap: anywhere; }
.bb-rich:focus { border-color: var(--c); box-shadow: 0 0 0 3px rgba(0,217,180,.1); }
.bb-rich:empty::before { content: 'Текст…'; color: var(--t3); }
.bb-rich a { color: var(--c); text-decoration: underline; }
.bb-rich code { color: #a7f3d0; }
.bb-intro { font-size: 15.5px; color: #fff; }
.bb-quote { border-left: 3px solid var(--p); font-style: italic; color: #c3cbe0; }
.bb-note { border-left: 3px solid var(--c); background: rgba(0,217,180,.05); }
.bb-note.warn { border-left-color: #ffb84d; background: rgba(255,184,77,.05); }
ul.bb-list, ol.bb-list { padding-left: 34px; }
.bb-h2 { font-size: 17px !important; font-weight: 800; }
.bb-h3 { font-size: 15px !important; font-weight: 700; }
.bb-code { width: 100%; font-size: 12.5px !important; line-height: 1.55; white-space: pre; tab-size: 4; }
.bb-img { margin-bottom: 10px; text-align: center; }
.bb-img img { max-width: 100%; max-height: 360px; height: auto; border-radius: 8px; border: 1px solid var(--br); }
.bb-cta { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 9px; border: 1px dashed rgba(0,217,180,.35); background: rgba(0,217,180,.04); font-size: 13px; }
.be-chooser { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border: 1px dashed var(--br2); border-radius: 10px; background: rgba(255,255,255,.02); }
.be-add { margin-top: 4px; }
.be-add-h { font-size: 12px; font-weight: 700; color: var(--t2); margin-bottom: 6px; }
.be-preview { display: block; width: 100%; height: min(70vh, 760px); border: 1px solid var(--br); border-radius: 10px; background: #070912; }
@media (max-width: 1100px) { .be-grid { grid-template-columns: 1fr; } .be-side { position: static; } }
@media (max-width: 600px) { .be-top-a { width: 100%; } .be-top-a .btn-sm { flex: 1; } .bb { padding: 8px 9px 10px; } }
.modal-backdrop.wide .modal:has(.be-preview) { width: min(1120px, 100%); }

/* ─── Partner program (assets/js/admin-affiliates.js) ─── */
.tbl th.num, .tbl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aff-tabs .badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px; border-radius: 9px; background: var(--o); color: #111; font-size: 11px; line-height: 16px; text-align: center; }
.aff-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.aff-cols .form-card { margin-bottom: 0; }
.sub-title { font-size: 14px; font-weight: 800; margin: 24px 0 10px; }
.aff-addr { display: block; max-width: 320px; overflow-wrap: anywhere; font-size: 12px; margin: 2px 0 4px; }
.aff-settings { max-width: 680px; }
.aff-settings .modal-check { margin-bottom: 16px; }
@media (max-width: 900px) { .aff-cols { grid-template-columns: minmax(0, 1fr); } }

/* Drop-down lists (assets/css/dropdown.css) are as tall as the fields beside them. dropdown.js measures the native select; this is the
   height it would measure here, so a list is right even before it has been measured (a panel that was hidden when the page loaded). */
body .xdd-trigger { min-height: 36px; }
