/* стили раздела support · WhiteCas proto5.
   «Шире и информативнее»: full-width 3-колоночный пульт, корзины, подвкладки, панель лида.
   База классов (.gbl-chatboard, .chat-item, .msg, .composer, .tag-chip…) — в styles.css. */

/* на всю ширину — снять max-width у корневого блока раздела */
#main > .sup-root{ max-width:none; margin:0; }

/* ---------- подвкладки ---------- */
.sup-subtabs{ display:flex; gap:8px; flex-wrap:wrap; margin:0 0 16px; border-bottom:1px solid var(--border); padding-bottom:12px; }
.sup-sub{ border:1px solid var(--border); background:var(--card); color:var(--ink-2); font-size:13.5px; font-weight:500;
  padding:8px 15px; border-radius:var(--r-pill); display:inline-flex; align-items:center; gap:7px; cursor:pointer; }
.sup-sub:hover{ border-color:var(--primary-bd); color:#fff; }
.sup-sub.on{ background:var(--primary-soft); border-color:var(--primary-bd); color:#fff; }
.sup-sub-n{ font-size:11px; font-weight:700; background:var(--card-2); color:var(--muted); border-radius:var(--r-pill); padding:1px 7px; }
.sup-sub.on .sup-sub-n{ color:#cdbcff; }

/* ---------- верхняя плашка раздела ---------- */
.sup-aiwrap{ display:inline-flex; gap:14px; align-items:center; padding-right:4px; }
.sup-ai{ display:inline-flex; align-items:center; gap:7px; font-size:12px; }
.sup-ai .muted{ color:var(--muted); }

/* ---------- корзины ---------- */
.sup-baskets{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.sup-basket{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); background:var(--card);
  color:var(--ink-2); font-size:13px; font-weight:500; padding:8px 13px; border-radius:var(--r-md); cursor:pointer; position:relative; }
.sup-basket svg{ color:var(--muted); }
.sup-basket:hover{ border-color:var(--primary-bd); color:#fff; }
.sup-basket.on{ background:var(--primary-soft); border-color:var(--primary-bd); color:#fff; }
.sup-basket.on svg{ color:#cdbcff; }
.sup-basket .cnt{ font-family:var(--mono); font-size:12px; color:var(--muted); }
.sup-basket.on .cnt{ color:#cdbcff; }
.sup-basket .u{ background:var(--bad); color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px;
  padding:0 4px; border-radius:var(--r-pill); display:grid; place-items:center; }

/* ---------- борд: шире и на высоту экрана ---------- */
.sup-board{ grid-template-columns:316px 1fr 312px; grid-template-rows:minmax(0,1fr); height:calc(100vh - 236px); min-height:600px; }
@media (min-width:1700px){ .sup-board{ grid-template-columns:360px 1fr 340px; } }
/* компактный композер: селекты в одну строку, лента сообщений получает больше высоты */
.sup-board .composer{ padding:10px 14px; }
.sup-board .sup-composer{ gap:6px; }
.sup-board .sup-comp-tools{ flex-wrap:nowrap; }
.sup-board .sup-comp-tools .sel-wrap, .sup-board .sup-comp-tools .inp{ height:30px; font-size:12px; }
.sup-board .sup-comp-tools select.inp{ max-width:190px; }
.sup-board .sup-tpl-hint{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:260px; }
.sup-board .dialog-msgs{ min-height:160px; }
.sup-board .sup-dh{ flex-wrap:wrap; align-items:flex-start; padding:12px 16px; }
.sup-board .sup-badges{ margin-top:5px; }
.sup-board .sup-acts{ flex:1 0 100%; margin-left:0; justify-content:flex-end; padding-top:2px; border-top:1px dashed var(--border-soft); margin-top:4px; }
.sup-board .sup-badges{ margin-top:6px; }
.sup-board .sup-acts .btn{ padding:0 10px; height:30px; font-size:12.5px; }
/* скролл внутри колонок: колонка не выше борда, прокручиваемая часть забирает остаток */
.sup-board > .cb-col{ min-height:0; height:100%; overflow:hidden; }
.sup-board .cb-scroll{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.sup-board .dialog-msgs{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.sup-board .cb-lead-b{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.sup-board .cb-filters{ flex:none; }
.sup-board .cb-head, .sup-board .dialog-h, .sup-board .composer{ flex:none; }
.sup-cnt{ font-family:var(--mono); font-size:12px; color:var(--muted); margin-left:2px; }
.cb-head .sup-cnt{ margin-left:auto; }
.cb-head .rnd{ margin-left:8px; }

/* чипы фильтров слева */
.sup-chipsrow{ display:flex; gap:6px; flex-wrap:wrap; }
.sup-chip{ border:1px solid var(--border); background:var(--card-2); color:var(--ink-2); font-size:11.5px; font-weight:500;
  padding:5px 10px; border-radius:var(--r-pill); cursor:pointer; line-height:1; }
.sup-chip:hover{ border-color:var(--primary-bd); color:#fff; }
.sup-chip.on{ background:var(--primary-soft); border-color:var(--primary-bd); color:#cdbcff; }
.sup-adv{ display:flex; flex-direction:column; gap:9px; padding-top:9px; margin-top:2px; border-top:1px dashed var(--border); }
.sup-adv .inp{ flex:1; min-width:0; }

/* строки списка: онлайн-точка + бейджи */
.chat-item .av{ position:relative; }
.sup-on{ position:absolute; top:-1px; right:-1px; width:9px; height:9px; border-radius:50%; background:var(--good); border:2px solid var(--card); }
.sup-ci-badges{ display:flex; gap:4px; flex-wrap:wrap; margin-top:6px; }
.sup-ci-badges .badge{ height:17px; font-size:10px; padding:0 7px; }

/* ---------- шапка диалога ---------- */
.sup-dh{ flex-wrap:wrap; row-gap:8px; }
.sup-dh-top{ display:flex; align-items:center; gap:8px; }
.sup-dh-nm{ font-weight:600; font-size:14.5px; color:var(--ink); }
.sup-dh .em{ font-size:11.5px; color:var(--muted); }
.sup-badges{ display:flex; gap:5px; flex-wrap:wrap; margin-top:7px; }
.sup-badges .badge{ height:19px; font-size:10.5px; }
.sup-acts{ display:flex; gap:7px; flex-wrap:wrap; margin-left:auto; align-items:center; }

/* системные события в ленте */
.sup-sysmsg{ align-self:center; display:inline-flex; align-items:center; gap:6px; font-size:11px; color:var(--muted);
  background:var(--card-2); border:1px solid var(--border-soft); border-radius:var(--r-pill); padding:4px 11px; }
.sup-sysmsg svg{ color:var(--muted); }
.sup-ck{ display:inline-flex; margin-left:5px; color:var(--primary); vertical-align:middle; }
.sup-trbtn{ align-self:flex-end; border:0; background:transparent; color:var(--muted); font-size:10.5px; cursor:pointer; padding:2px 0; }
.sup-trbtn:hover{ color:var(--primary); }

/* ---------- композер ---------- */
.sup-composer{ display:flex; flex-direction:column; gap:8px; }
.sup-macros{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.sup-macro{ border:1px dashed var(--border); background:var(--card-2); color:var(--ink-2); font-size:11.5px;
  padding:3px 9px; border-radius:var(--r-sm); cursor:pointer; }
.sup-macro:hover{ border-color:var(--primary-bd); color:#cdbcff; }
.sup-comp-tools{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sup-comp-tools .inp{ height:32px; padding:0 9px; font-size:12.5px; }
.sup-tpl-hint{ font-size:11px; color:var(--muted); margin-left:auto; }
.sup-tpl-hint .mono{ color:var(--ink-2); }

/* ---------- поповеры ---------- */
.sup-pop{ position:absolute; z-index:30; background:#0a0c10; border:1px solid var(--border); border-radius:var(--r-md);
  box-shadow:0 14px 40px #0009; padding:12px; width:252px; }
.sup-paypop{ top:58px; right:14px; }
.sup-delay{ bottom:96px; right:16px; width:200px; }
.sup-delay button{ display:block; width:100%; text-align:left; border:0; background:transparent; color:var(--ink-2);
  font-size:13px; padding:8px 9px; border-radius:8px; cursor:pointer; }
.sup-delay button:hover{ background:var(--card-2); }
.sup-pop-t{ font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:9px; }
.sup-f{ display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted); margin-bottom:9px; }
.sup-f .inp{ width:100%; }

/* ---------- правая панель лида ---------- */
.sup-lead-sec{ border:1px solid var(--border); border-radius:var(--r-md); padding:12px; background:var(--card); }
.sup-lead-sec .sec-t{ margin-bottom:9px; }
.sup-needdep{ margin-top:11px; font-size:12.5px; color:var(--ink-2); background:var(--card-2);
  border:1px solid var(--border); border-radius:var(--r-sm); padding:9px 11px; }
.sup-vip{ display:flex; align-items:baseline; gap:9px; }
.sup-vip b{ font-size:15px; }
.sup-vip .muted{ font-size:12px; }
.sup-remind-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.sup-fs-val{ font-size:12px; color:var(--muted); margin-top:8px; }
.sup-diag{ border:1px solid var(--primary-bd); background:var(--primary-soft); border-radius:var(--r-md); padding:12px; }
.sup-diag-t{ font-size:12px; font-weight:600; color:#cdbcff; text-transform:uppercase; letter-spacing:.04em; margin-bottom:9px; }
.sup-diag-rec{ margin-top:9px; font-size:12.5px; color:#eae3ff; line-height:1.45; }
.sup-hist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px; }
.sup-hist li{ display:flex; gap:10px; }
.sup-hist .dot{ width:8px; height:8px; border-radius:50%; background:var(--primary); margin-top:4px; flex:none;
  box-shadow:0 0 0 3px var(--primary-soft); }
.sup-hist .t{ font-size:12.5px; color:var(--ink-2); }
.sup-hist .m{ font-size:11px; color:var(--muted); margin-top:2px; }

/* ---------- потенциалы / шаблоны / смены / боты ---------- */
.sup-pot-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.sup-pot-tabs .sup-chip{ font-size:13px; padding:7px 13px; }
.sup-flexhead{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.sup-tpl-form{ margin-bottom:16px; }
.sup-team-h{ font-size:14px; font-weight:600; margin-bottom:10px; }
.sup-team-h .muted{ font-size:12px; font-weight:400; }
.sup-team-m{ display:flex; flex-direction:column; gap:8px; }
.sup-op{ display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-2); }
.sup-op .av{ width:26px; height:26px; border-radius:50%; background:var(--card-2); display:grid; place-items:center;
  font-size:11px; font-weight:600; color:var(--ink-2); }

/* ---------- модал рассылки ---------- */
.sup-modal{ position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); width:min(520px,calc(100vw - 32px));
  background:var(--card); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:0 30px 80px #000a; z-index:60;
  display:flex; flex-direction:column; max-height:calc(100vh - 48px); }
.sup-modal-h{ display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border); }
.sup-modal-h b{ font-size:16px; }
.sup-modal-b{ padding:16px 18px; overflow-y:auto; display:flex; flex-direction:column; gap:12px; }
.sup-modal-b .inp{ width:100%; }
.sup-modal-f{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-top:1px solid var(--border); }
.sup-bc-prev .sec-t{ margin-bottom:7px; }
.sup-bc-bub{ background:var(--primary-soft); border:1px solid var(--primary-bd); border-radius:14px; border-top-left-radius:4px;
  padding:11px 13px; font-size:13px; color:#eae3ff; min-height:20px; white-space:pre-wrap; }

/* ---------- Pro-режим: плотнее ---------- */
#app[data-mode="pro"] .sup-board{ height:calc(100vh - 248px); }
#app[data-mode="pro"] .sup-basket{ padding:6px 11px; font-size:12px; border-radius:9px; }
#app[data-mode="pro"] .sup-sub{ padding:6px 13px; font-size:13px; }
#app[data-mode="pro"] .chat-item{ padding:9px 14px; }
#app[data-mode="pro"] .sup-needdep,
#app[data-mode="pro"] .sup-basket .cnt{ font-family:var(--mono); }

/* ---------- «?»-справка ---------- */
.sup-help{ display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; flex:none;
  border:1px solid var(--border); background:var(--card-2); color:var(--muted); border-radius:50%;
  font-size:10.5px; font-weight:700; line-height:1; cursor:help; padding:0; vertical-align:middle; }
.sup-help:hover{ border-color:var(--primary-bd); color:#cdbcff; }
.sup-root .sec-t,.sup-modal .sec-t{ display:flex; align-items:center; gap:6px; }
.sup-kbd{ font-family:var(--mono); font-size:10px; background:var(--card-2); border:1px solid var(--border);
  border-radius:5px; padding:1px 5px; margin-left:2px; color:var(--muted); }

/* ---------- сохранённые представления ---------- */
.sup-views{ display:flex; gap:6px; margin-bottom:9px; }

/* ---------- «Закреплено за» список имён ---------- */
.sup-assign{ display:flex; gap:6px; flex-wrap:wrap; }
.sup-name{ display:inline-flex; align-items:center; gap:4px; border:1px solid var(--border); background:var(--card-2);
  color:var(--ink-2); font-size:12px; padding:5px 10px; border-radius:var(--r-pill); cursor:pointer; line-height:1; }
.sup-name:hover{ border-color:var(--primary-bd); color:#fff; }
.sup-name.on{ background:var(--primary-soft); border-color:var(--primary-bd); color:#cdbcff; }
.sup-name svg{ color:#cdbcff; }

/* ---------- фриспины: подпись ---------- */
.sup-fs-note{ font-size:10.5px; color:var(--muted); margin-top:8px; line-height:1.4; }
.sup-fs .sup-f span{ font-size:10.5px; }

/* ---------- рассылка: сетка фильтров + тумблер перевода ---------- */
.sup-bc-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px 12px; }
.sup-bc-grid .sup-f{ margin-bottom:0; }
.sup-bc-tr{ flex-direction:row; align-items:center; gap:9px; color:var(--ink-2); font-size:12.5px; }

/* ---------- toast с Undo ---------- */
.sup-undo{ display:inline-flex; align-items:center; gap:12px; pointer-events:auto; }
.sup-undo button{ border:1px solid var(--primary-bd); background:var(--primary-soft); color:#cdbcff;
  font-size:12px; font-weight:600; padding:3px 11px; border-radius:var(--r-pill); cursor:pointer; }
.sup-undo button:hover{ color:#fff; }

/* ---------- ПКМ-меню на чате: деструктивный пункт ---------- */
.menu-item.bad{ color:var(--bad); }
.menu-item.bad:hover{ background:rgba(252,89,90,.12); color:var(--bad); }

/* ---------- адаптив ---------- */
@media (max-width:1280px){
  .sup-board{ grid-template-columns:340px 1fr; height:calc(100vh - 300px); }
  .sup-board .cb-lead{ display:none; }
}
@media (max-width:760px){
  .sup-board{ grid-template-columns:1fr; height:auto; min-height:auto; }
  .sup-board .cb-list{ display:flex; }          /* styles.css прячет .cb-list на мобиле — возвращаем */
  .sup-board .cb-col:not(.cb-list){ display:none; }
  .sup-board .cb-scroll{ max-height:70vh; }
  .sup-baskets{ overflow-x:auto; flex-wrap:nowrap; padding-bottom:4px; }
  .sup-basket{ flex:none; }
  .sup-acts{ margin-left:0; }
  /* шапка раздела не должна тянуть страницу вправо */
  #main > .sup-root .pagehead{ flex-wrap:wrap; }
  #main > .sup-root .pagehead .right{ width:100%; margin-left:0; justify-content:flex-start; }
  .sup-aiwrap{ gap:10px; flex-wrap:wrap; }
  .sup-subtabs{ overflow-x:auto; flex-wrap:nowrap; }
  .sup-sub{ flex:none; }
}
