/* Центр ТГ-аккаунтов БАДлаб. Палитра, шрифты и радиус — сайта thebadlab.ru v6 (css/v6.css) [TC14].
   Устройство экранов — по сборке Димы (NumShield): боковое меню, таблицы с итогами, мессенджер как в Телеграме. */
@font-face{font-family:'Golos Text';font-weight:400;font-display:swap;src:url(fonts/GolosText-400-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Golos Text';font-weight:400;font-display:swap;src:url(fonts/GolosText-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2116,U+2190-21FF,U+2212}
@font-face{font-family:'Golos Text';font-weight:500;font-display:swap;src:url(fonts/GolosText-500-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Golos Text';font-weight:500;font-display:swap;src:url(fonts/GolosText-500-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2116,U+2190-21FF,U+2212}
@font-face{font-family:'Golos Text';font-weight:600;font-display:swap;src:url(fonts/GolosText-600-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Golos Text';font-weight:600;font-display:swap;src:url(fonts/GolosText-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2116,U+2190-21FF,U+2212}
@font-face{font-family:'Onest';font-weight:500;font-display:swap;src:url(fonts/Onest-500-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Onest';font-weight:500;font-display:swap;src:url(fonts/Onest-500-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:'Onest';font-weight:600;font-display:swap;src:url(fonts/Onest-600-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Onest';font-weight:600;font-display:swap;src:url(fonts/Onest-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:'Onest';font-weight:700;font-display:swap;src:url(fonts/Onest-700-cyrillic.woff2) format('woff2');unicode-range:U+0400-04FF}
@font-face{font-family:'Onest';font-weight:700;font-display:swap;src:url(fonts/Onest-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F}

:root{
  --paper:#F7F7F4; --surface:#FFFFFF;
  --ink:#14181A; --ink-muted:#4E565A; --ink-faint:#6B7276;
  --rule:#DDDFD9; --rule-strong:#C3C7BF;
  --seal:#167451; --seal-mid:#3E9575; --seal-soft:#E6F1EB; --seal-hover:#115E41; --seal-press:#0E5038;
  --flag:#A33B23; --flag-lift:#D07A5E;
  --nep:#E0301E; /* [TC24] непрочитанные — ярко-красным (Игорь 15.10.2026) */
  --font-display:'Onest',sans-serif; --font-body:'Golos Text',sans-serif;
  --radius-s:10px; --radius:14px; --radius-l:18px; --motion:120ms cubic-bezier(0,0,.2,1);
  --side:248px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--paper);color:var(--ink);font-family:var(--font-body);font-size:16px;line-height:1.5;
  font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased}
a{color:var(--seal)}
button,input,textarea,select{font:inherit;color:inherit}
h1,h2,h3{font-family:var(--font-display);font-weight:600;letter-spacing:-.02em;margin:0;line-height:1.15}
h1{font-size:34px} h2{font-size:23px} h3{font-size:18px}
.muted{color:var(--ink-muted)} .faint{color:var(--ink-faint)} .small{font-size:14px}
.hidden{display:none!important}

/* ── кнопки и поля ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 18px;border-radius:var(--radius-s);
  border:1px solid transparent;font-weight:500;cursor:pointer;white-space:nowrap;text-decoration:none;
  transition:background var(--motion),border-color var(--motion)}
.btn:active{transform:scale(.985)}
.btn--seal{background:var(--seal);color:var(--surface)} .btn--seal:hover{background:var(--seal-hover)} .btn--seal:active{background:var(--seal-press)}
.btn--ghost{background:transparent;border-color:var(--rule-strong)} .btn--ghost:hover{border-color:var(--ink)}
.btn--flag{background:transparent;border-color:var(--flag);color:var(--flag)}
.btn--sm{height:32px;padding:0 12px;font-size:14px}
.btn[disabled]{opacity:.55;pointer-events:none}
.ikon{width:36px;height:36px;border-radius:var(--radius-s);border:0;background:transparent;cursor:pointer;display:inline-grid;place-items:center;color:var(--ink-muted)}
.ikon:hover{background:var(--seal-soft);color:var(--ink)}
.pole{width:100%;height:40px;padding:0 12px;border:1px solid var(--rule-strong);border-radius:var(--radius-s);background:var(--surface)}
textarea.pole{height:auto;padding:10px 12px;resize:vertical;min-height:80px}
.pole:focus,.btn:focus-visible,.ikon:focus-visible{outline:2px solid var(--seal);outline-offset:1px}
label.f{display:block;margin:0 0 14px} label.f>span{display:block;font-size:14px;color:var(--ink-muted);margin-bottom:6px}
.chip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--rule);border-radius:999px;
  background:var(--surface);font-size:14px;cursor:pointer;white-space:nowrap}
.chip.on{border-color:var(--seal);background:var(--seal-soft);color:var(--seal-press)}
.metka{display:inline-block;padding:1px 8px;border-radius:999px;font-size:13px;font-weight:500;background:var(--seal-soft);color:var(--seal-press)}
.metka.flag{background:var(--flag);color:var(--surface)} .metka.lift{background:var(--flag-lift);color:var(--surface)}
.metka.sery{background:var(--rule);color:var(--ink-muted)}

/* ── каркас ── */
.app{display:grid;grid-template-columns:var(--side) 1fr;min-height:100vh}
.side{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:24px 14px;border-right:1px solid var(--rule);background:var(--paper)}
.brand{font-family:var(--font-display);font-size:23px;font-weight:700;letter-spacing:-.02em;padding:0 10px}
.brand small{display:block;font-family:var(--font-body);font-size:14px;font-weight:400;color:var(--ink-muted);letter-spacing:0;margin-top:2px}
.menu{margin-top:28px;display:flex;flex-direction:column;gap:2px}
.menu a{display:flex;align-items:center;gap:12px;height:42px;padding:0 10px;border-radius:var(--radius-s);text-decoration:none;color:var(--ink);font-weight:500}
.menu a:hover{background:var(--seal-soft)} .menu a{border-left:3px solid transparent} .menu a.on{background:var(--surface);border-left-color:var(--seal)}
.menu a svg{width:20px;height:20px;color:var(--ink-muted);flex:none}
.menu .n{margin-left:auto;font-size:13px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;display:grid;place-items:center;background:var(--rule);color:var(--ink-muted)}
.menu .n.ja{background:var(--nep);color:var(--surface)}
.side .niz{margin-top:auto;padding:12px 10px;border-top:1px solid var(--rule);font-size:14px}
.main{min-width:0;padding:28px 36px 48px}
.shapka{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.shapka h1{margin-right:auto}
.instr{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.mob-menu{display:none}

/* ── таблица (как у Димы: рамка, серые шапка и итоги, сортировка в заголовках) ── */
.tabl{background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);overflow-x:auto}
table{width:100%;border-collapse:collapse}
th{font-weight:500;font-size:14px;color:var(--ink-muted);text-align:left;padding:10px 14px;background:var(--paper);border-bottom:1px solid var(--rule);white-space:nowrap;cursor:default}
th.sort{cursor:pointer} th.sort:hover{color:var(--ink)}
td{padding:12px 14px;border-bottom:1px solid var(--rule);vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr.klik{cursor:pointer} tbody tr.klik:hover td{background:var(--paper)}
tfoot td{background:var(--paper);font-weight:500;border-top:1px solid var(--rule);border-bottom:0}
td.num,th.num{text-align:right}
.akk{display:flex;align-items:center;gap:12px;min-width:220px}
.akk b{display:block;font-weight:500} .akk span{font-size:13px;color:var(--ink-muted)}
.ava{width:40px;height:40px;border-radius:50%;flex:none;display:grid;place-items:center;font-family:var(--font-display);font-weight:600;
  background:var(--seal-soft);color:var(--seal-press);overflow:hidden;font-size:15px}
.ava{position:relative} .ava img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ava.v2{background:var(--rule);color:var(--ink)} .ava.v3{background:var(--seal-mid);color:var(--surface)} .ava.v4{background:var(--ink-muted);color:var(--surface)}
.svet{display:inline-flex;align-items:center;gap:8px;font-size:14px}
.svet i{width:10px;height:10px;border-radius:50%;background:var(--seal);flex:none}
.svet.zheltyy i{background:var(--flag-lift)} .svet.krasnyy i{background:var(--flag)} .svet.sery i{background:var(--rule-strong)}
.svet small{display:block;color:var(--ink-faint);font-size:13px;max-width:240px}
.kanaly{display:flex;gap:6px;flex-wrap:wrap;max-width:330px}
.nep{display:inline-grid;place-items:center;min-width:28px;height:24px;padding:0 8px;border-radius:12px;background:var(--nep);color:var(--surface);font-weight:600;font-size:14px;text-decoration:none}
.nep.nol{background:transparent;color:var(--ink-faint);font-weight:400}

/* ── плитки ── */
.plitki{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:1px;background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);overflow:hidden;margin-bottom:24px}
.plitka{background:var(--surface);padding:18px 20px;outline:1px solid var(--rule)}
.plitka b{display:block;font-family:var(--font-display);font-size:34px;font-weight:600;letter-spacing:-.02em;line-height:1.1}
.plitka span{font-size:14px;color:var(--ink-muted)}
.blok{background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);padding:20px 22px;margin-bottom:20px}
.blok h2{margin-bottom:14px}
.vyvod{font-size:14px;color:var(--ink-muted);margin:10px 0 0}

/* ── вкладки аккаунта ── */
.vkladki{display:flex;gap:4px;border-bottom:1px solid var(--rule);margin-bottom:18px;overflow-x:auto}
.vkladki a{padding:10px 14px;text-decoration:none;color:var(--ink-muted);font-weight:500;border-bottom:2px solid transparent;white-space:nowrap}
.vkladki a.on{color:var(--ink);border-bottom-color:var(--seal)}

/* ── мессенджер: как в Телеграме ── */
.tg{display:grid;grid-template-columns:340px 1fr;height:calc(100vh - 190px);min-height:480px;background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius-l);overflow:hidden}
.tg-spisok{display:flex;flex-direction:column;border-right:1px solid var(--rule);min-height:0}
.tg-poisk{padding:10px;border-bottom:1px solid var(--rule)}
.tg-poisk .pole{height:36px;border-radius:18px;background:var(--paper);border-color:transparent}
.tg-filtr{display:flex;gap:6px;padding:8px 10px 0}
.tg-dialogi{overflow-y:auto;flex:1}
.dlg{display:flex;gap:12px;padding:9px 12px;cursor:pointer;align-items:center}
.dlg:hover{background:var(--paper)} .dlg.on{background:var(--seal)} .dlg.on *{color:var(--surface)!important}
.dlg .ava{width:52px;height:52px;font-size:18px}
.dlg .t{flex:1;min-width:0}
.dlg .r1,.dlg .r2{display:flex;gap:8px;align-items:center}
.dlg .im{font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dlg .vr{font-size:13px;color:var(--ink-faint)}
.dlg .tx{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-muted);font-size:15px}
.dlg .bd{min-width:22px;height:22px;padding:0 7px;border-radius:11px;background:var(--nep);color:var(--surface);font-size:13px;font-weight:600;display:grid;place-items:center}
.dlg .bd.tiho{background:var(--rule-strong)}
.dlg.on .bd{background:var(--surface);color:var(--nep)!important}
.tg-chat{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--seal-soft)}
.tg-chat .pusto{margin:auto;padding:6px 14px;border-radius:14px;background:rgba(20,24,26,.35);color:var(--surface);font-size:14px}
.tg-head{display:flex;align-items:center;gap:12px;padding:8px 14px;background:var(--surface);border-bottom:1px solid var(--rule);min-height:58px}
.tg-head b{display:block;font-weight:500} .tg-head span{font-size:13px;color:var(--ink-faint)}
.tg-lenta{flex:1;overflow-y:auto;padding:12px 8% 8px;display:flex;flex-direction:column;gap:3px}
.den{align-self:center;margin:10px 0;padding:3px 12px;border-radius:12px;background:rgba(20,24,26,.35);color:var(--surface);font-size:13px;font-weight:500}
.msg{max-width:min(520px,78%);padding:6px 10px 6px 11px;border-radius:16px;background:var(--surface);align-self:flex-start;position:relative;
  border:1px solid var(--rule);word-wrap:break-word;font-size:15px;line-height:1.4}
.msg .tx{white-space:pre-wrap}
.msg.out{align-self:flex-end;background:var(--seal-soft);border:1px solid rgba(22,116,81,.18)}
.msg .kto{display:block;font-size:13px;font-weight:600;color:var(--seal)}
.msg .meta{float:right;margin:8px 0 -4px 10px;font-size:12px;color:var(--ink-faint);white-space:nowrap}
.msg.out .meta{color:var(--seal-mid)}
.msg .cit{display:block;border-left:2px solid var(--seal);padding:2px 8px;margin:2px 0 4px;background:rgba(22,116,81,.07);border-radius:6px;font-size:13px;color:var(--ink-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.msg img.foto{display:block;max-width:100%;max-height:340px;border-radius:12px;margin:2px 0 4px;cursor:zoom-in}
.msg .fl{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);margin:3px 0;min-width:0;max-width:100%}
.msg .fl i{width:46px;height:46px;flex:none;border-radius:50%;background:var(--seal);color:var(--surface);display:grid;place-items:center;font-style:normal}
.msg .fl i svg{width:24px;height:24px}
.msg .fl:hover i{background:var(--seal-hover)}
.fl-t{display:flex;flex-direction:column;min-width:0;gap:2px}
.fl-t b{font-weight:500;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fl-t small{font-size:13px;color:var(--ink-faint)}
.msg.s-faylom{min-width:260px;padding:8px 12px 8px 8px}
.msg.s-faylom .tx{display:none}
.msg.s-faylom .meta{position:absolute;right:10px;bottom:7px;float:none;margin:0}
.msg.s-faylom .fl-t small{padding-right:58px}
@media (max-width:600px){.msg.s-faylom{max-width:88%}}
.msg.vybran{outline:2px solid var(--seal)}
.tg-otvet{display:flex;align-items:center;gap:10px;padding:6px 14px;background:var(--surface);border-top:1px solid var(--rule);font-size:14px}
.tg-otvet div{flex:1;min-width:0;border-left:2px solid var(--seal);padding-left:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tg-niz{display:flex;align-items:flex-end;gap:6px;padding:8px 10px;background:var(--surface);border-top:1px solid var(--rule)}
.tg-niz textarea{flex:1;border:0;resize:none;max-height:180px;min-height:40px;padding:9px 6px;outline:none;background:transparent;font-size:15px;line-height:1.4}
.tg-otpr{width:42px;height:42px;border-radius:50%;border:0;background:var(--seal);color:var(--surface);cursor:pointer;display:grid;place-items:center;flex:none}
.tg-otpr:hover{background:var(--seal-hover)}
.emoji{position:absolute;bottom:62px;left:10px;width:300px;max-height:230px;overflow-y:auto;padding:8px;background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);display:grid;grid-template-columns:repeat(8,1fr);gap:2px;z-index:5}
.emoji button{border:0;background:none;font-size:22px;cursor:pointer;border-radius:8px;height:34px} .emoji button:hover{background:var(--paper)}
.niz-wrap{position:relative}
.fayly{display:flex;gap:8px;flex-wrap:wrap;padding:6px 14px;background:var(--surface);border-top:1px solid var(--rule);font-size:14px}

/* ── окно ── */
.fon{position:fixed;inset:0;background:rgba(20,24,26,.45);display:grid;place-items:center;z-index:50;padding:16px}
.okno{background:var(--surface);border-radius:var(--radius-l);width:min(520px,100%);max-height:92vh;overflow-y:auto;padding:24px}
.okno h2{margin-bottom:16px}
.okno .knopki{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
.oshibka{color:var(--flag);font-size:14px;margin:8px 0 0}
.uvedoml{position:fixed;right:20px;bottom:20px;background:var(--ink);color:var(--surface);padding:12px 16px;border-radius:var(--radius-s);z-index:60;max-width:360px;font-size:15px}
.prosmotr{position:fixed;inset:0;background:rgba(20,24,26,.85);display:grid;place-items:center;z-index:70;cursor:zoom-out}
.prosmotr img{max-width:94vw;max-height:94vh}
.menu-vyb{position:absolute;background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);padding:4px;z-index:40;min-width:200px}
.menu-vyb button{display:block;width:100%;text-align:left;border:0;background:none;padding:9px 12px;border-radius:8px;cursor:pointer}
.menu-vyb button:hover{background:var(--paper)} .menu-vyb button.flag{color:var(--flag)}

/* ── вход ── */
.vhod{min-height:100vh;display:grid;place-items:center;padding:16px}
.vhod .okno{text-align:center;width:min(420px,100%);border:1px solid var(--rule)}
.vhod .qr{width:240px;height:240px;margin:18px auto;display:block}
.vhod .qr svg{width:100%;height:100%}

/* ── графики ── */
.stolby{display:flex;align-items:flex-end;gap:3px;height:160px;border-bottom:1px solid var(--rule);padding-top:10px}
.stolby div{flex:1;background:var(--seal);border-radius:6px 6px 0 0;position:relative;min-width:4px}
.stolby div i{position:absolute;left:0;right:0;bottom:0;background:var(--flag)}
.os{display:flex;justify-content:space-between;font-size:13px;color:var(--ink-faint);margin-top:6px}

@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .side{position:fixed;left:0;top:0;bottom:0;width:260px;z-index:45;transform:translateX(-100%);transition:transform 200ms}
  .side.otkr{transform:none}
  .mob-menu{display:inline-grid}
  .main{padding:16px}
  h1{font-size:26px}
  .tg{grid-template-columns:1fr;height:calc(100vh - 150px)}
  .tg.v-chate .tg-spisok{display:none} .tg:not(.v-chate) .tg-chat{display:none}
  .tg-lenta{padding:10px 10px 6px}
}
