@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ivory: #F7F5EC; --ink: #1F1F1F; --lime: #D7FF3F; --cobalt: #2457FF;
  --sky: #CFEBFF; --pink: #FFC2D9; --gray: #EBEBEB;
  --muted: #6B6B66; --line: #DEDCD2; --card: #FFFFFF;
  --up: #1E8E3E; --down: #C8341F;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink);
  font: 15px/1.45 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; font-feature-settings: "tnum"; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
small, .muted { color: var(--muted); }
code { background: var(--gray); padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }

/* левое меню */
.shell { display: flex; min-height: 100vh; }
.side { --w: 248px; position: sticky; top: 0; height: 100vh; width: var(--w); flex: 0 0 var(--w); background: var(--ink); color: var(--ivory);
  display: flex; flex-direction: column; padding: 14px 12px; transition: width .2s ease, flex-basis .2s ease; overflow: hidden; z-index: 40; }
.nav-collapsed .side { --w: 72px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 18px; }
.brand { font-weight: 800; font-size: 16px; color: var(--ivory); display: flex; align-items: center; gap: 12px; white-space: nowrap; line-height: 1.15; padding-left: 6px; }
.brand:hover { text-decoration: none; }
.brand i { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: var(--lime); display: inline-block; box-shadow: inset 0 0 0 9px var(--lime), inset 0 0 0 14px var(--ink); }
.side-toggle { background: rgba(255,255,255,.08); border: 0; color: var(--ivory); width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.side-toggle:hover { background: rgba(255,255,255,.16); }
.side-toggle svg { transition: transform .2s ease; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .side-foot a, .side-foot .who { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; color: var(--ivory); font-weight: 600; white-space: nowrap; opacity: .82; }
.side-nav a svg, .side-foot svg { flex: 0 0 20px; }
.side-nav a:hover, .side-foot a:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.08); }
.side-nav a.on { background: var(--lime); color: var(--ink); opacity: 1; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
.side-foot .who { opacity: .6; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
/* свёрнуто: только значки */
.nav-collapsed .side .brand span, .nav-collapsed .side-nav span, .nav-collapsed .side-foot span { display: none; }
.nav-collapsed .side-top { flex-direction: column; gap: 12px; }
.nav-collapsed .side-top .brand { padding-left: 0; }
.nav-collapsed .side-toggle svg { transform: rotate(180deg); }
.nav-collapsed .side-nav a, .nav-collapsed .side-foot a, .nav-collapsed .side-foot .who { justify-content: center; padding: 10px 0; }
.content { flex: 1; min-width: 0; }
.mobile-top { display: none; }
.scrim { display: none; }

main { max-width: 1320px; margin: 0 auto; padding: 28px 28px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* карточки и сетки */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; border: 1px solid var(--line); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .t { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; white-space: nowrap; }
.kpi.money { background: var(--lime); border-color: var(--lime); }
.kpi.money .t { color: var(--ink); opacity: .7; }
.d { font-size: 12px; font-weight: 700; white-space: nowrap; }
.d.up { color: var(--up); } .d.down { color: var(--down); } .d.flat { color: var(--muted); }
.kpi.money .d.up, .kpi.money .d.down { color: var(--ink); }

/* фильтры */
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--gray); color: var(--ink); font-weight: 600; font-size: 14px; border: 0; cursor: pointer; font-family: inherit; }
.chip:hover { text-decoration: none; background: #E0E0E0; }
.chip.on { background: var(--ink); color: var(--ivory); }
.seg { display: inline-flex; background: var(--gray); border-radius: 999px; padding: 3px; }
.seg a { padding: 5px 13px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; }
.seg a:hover { text-decoration: none; }
.seg a.on { background: var(--cobalt); color: #fff; }
.lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.hint { position: relative; display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--sky); color: var(--cobalt); font-weight: 800; font-size: 12px; align-items: center; justify-content: center; cursor: help; }
.hint .tip { display: none; position: absolute; top: 26px; left: -10px; width: 360px; max-width: 80vw; background: var(--ink); color: var(--ivory); font-weight: 500; font-size: 13px; padding: 12px 14px; border-radius: 12px; z-index: 20; line-height: 1.5; }
.hint:hover .tip, .hint:focus .tip { display: block; }
.modeinfo { font-size: 13px; color: var(--muted); }

input, select, textarea, button { font-family: inherit; font-size: 14px; }
input[type=text], input[type=date], input[type=number], input[type=password], input[type=search], select {
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--cobalt); outline-offset: -1px; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 0; background: var(--ink); color: var(--ivory); font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; opacity: .9; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.blue { background: var(--cobalt); color: #fff; }
.btn.ghost { background: var(--gray); color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cobalt); cursor: pointer; font-weight: 600; }
.csv { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gray); color: var(--ink); }
.csv:hover { text-decoration: none; background: #E0E0E0; }

/* таблицы */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
td { padding: 9px 10px; border-bottom: 1px solid #EFEDE5; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr.sub td { background: #FBFAF5; }
tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
tbody tr:hover td { background: #FAF9F3; }

/* воронка */
.funnel td { vertical-align: middle; }
.funnel .step { min-width: 220px; }
.funnel .stage { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.barw { display: flex; align-items: center; gap: 10px; }
.barw .num { font-weight: 800; font-size: 16px; min-width: 56px; text-align: right; }
.bar { position: relative; flex: 1; height: 22px; background: var(--gray); border-radius: 8px; min-width: 120px; overflow: hidden; }
.bar b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cobalt); border-radius: 8px; }
.funnel tr.paid .bar b { background: var(--lime); }
.funnel .big { font-size: 17px; font-weight: 800; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gray); white-space: nowrap; }
.tag.Instagram { background: var(--pink); }
.tag.Telegram { background: var(--sky); }
.tag.GetCourse { background: #E6F9A8; }
.tag.paid { background: var(--lime); }
.tag.warn { background: #FFE1D6; color: #8A2A12; }
.tag.src { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.chart-box { position: relative; height: 320px; }
.steps-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.steps-pick label { font-size: 13px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--gray); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; user-select: none; }
.steps-pick label i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.steps-pick input { display: none; }
.steps-pick label.off { opacity: .45; }

details.cfg summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--cobalt); list-style: none; }
details.cfg summary::-webkit-details-marker { display: none; }
details.cfg[open] summary { margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }

.alert { background: var(--pink); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; font-weight: 600; }
.alert.price-warn { background: #FFE1D6; color: #8A2A12; font-weight: 500; }
.alert.price-warn ul { margin: 6px 0 6px 20px; }
.ok { background: #E6F9A8; border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; font-weight: 600; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.props { font-size: 12px; color: var(--muted); }
.props b { color: var(--ink); font-weight: 600; }

/* карточка человека */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid #EFEDE5; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 13px; }
.timeline .gap { font-size: 11px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* продукты */
.tariff { display: grid; grid-template-columns: minmax(180px, 1.4fr) 140px minmax(260px, 2fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid #EFEDE5; }
.tariff .price { font-size: 18px; font-weight: 800; }
.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.archived { opacity: .5; }
.hist { font-size: 12px; color: var(--muted); margin-top: 4px; }

.login { max-width: 380px; margin: 10vh auto; }
.login .card { padding: 28px; }
.login label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
.login input { width: 100%; padding: 10px 12px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; --w: 264px !important; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .side { transform: none; }
  .nav-collapsed .side .brand span, .nav-collapsed .side-nav span, .nav-collapsed .side-foot span { display: inline; }
  .nav-collapsed .side-top { flex-direction: row; }
  .nav-collapsed .side-nav a, .nav-collapsed .side-foot a, .nav-collapsed .side-foot .who { justify-content: flex-start; padding: 10px 14px; }
  .nav-collapsed .side-toggle svg { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(31,31,31,.4); z-index: 30; }
  .mobile-top { display: flex; align-items: center; gap: 12px; background: var(--ink); padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .g2, .g-side { grid-template-columns: 1fr; }
  .tariff { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 16px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .v { font-size: 21px; }
  .card { padding: 16px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .kv { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
}

/* воронка-фигура: ширина этапа пропорциональна числу людей */
.fv { display: flex; flex-direction: column; border-top: 1px solid #EFEDE5; }
.fv-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.2fr) minmax(170px, 1fr); gap: 16px; align-items: center; border-bottom: 1px solid #EFEDE5; padding: 3px 0; }
.fv-row:hover { background: #F4F2E8; text-decoration: none; }
a.fv-row { color: inherit; cursor: pointer; }
a.fv-row:hover b { color: var(--cobalt); }
.fv-name { text-align: right; line-height: 1.25; }
.fv-name .stage { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.fv-name b { font-weight: 600; }
.fv-shape { position: relative; height: 50px; display: flex; justify-content: center; }
.fv-shape i { display: block; height: 100%; min-width: 4px; background: var(--c, var(--cobalt)); }
.fv-shape span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.fv-shape span em { font-style: normal; background: rgba(255,255,255,.85); padding: 1px 9px; border-radius: 999px; }
.fv-row.st-Instagram { --c: var(--pink); }
.fv-row.st-Telegram { --c: var(--sky); }
.fv-row.st-GetCourse { --c: #E6F9A8; }
.fv-row.paid { --c: var(--lime); }
.fv-row.st-После { --c: #A9BEFF; }
.fv-num { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.fv-num .big { font-size: 17px; font-weight: 800; color: var(--ink); min-width: 62px; }
.fv-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; gap: 8px; }
details.more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--cobalt); font-size: 14px; }
@media (max-width: 760px) {
  .fv-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 10px; }
  .fv-name { text-align: left; }
  .fv-shape { height: 40px; }
}

/* этапы воронки */
.stages-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.stage-list { padding: 12px; position: sticky; top: 16px; }
.stage-list-h, .stage-item { display: grid; grid-template-columns: 1fr 56px 64px; gap: 8px; align-items: center; }
.stage-list-h { font-size: 11px; color: var(--muted); font-weight: 700; padding: 0 10px 8px; text-align: right; }
.stage-list-h span:first-child { text-align: left; }
.stage-item { padding: 9px 10px; border-radius: 12px; color: var(--ink); border-bottom: 1px solid #EFEDE5; }
.stage-item:hover { text-decoration: none; background: #FAF9F3; }
.stage-item.on { background: var(--ink); color: var(--ivory); }
.stage-item small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; font-weight: 700; }
.stage-item span { font-weight: 600; font-size: 14px; line-height: 1.25; }
.stage-item b, .stage-item em { text-align: right; font-style: normal; font-weight: 800; }
.stage-item em { color: var(--cobalt); }
.stage-item.on em { color: var(--lime); }
.fv-name a { color: inherit; }
@media (max-width: 1000px) { .stages-grid { grid-template-columns: 1fr; } .stage-list { position: static; } }

/* права доступа */
fieldset.ro { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.ro[disabled] button, fieldset.ro[disabled] .btn, fieldset.ro[disabled] input[type=date],
fieldset.ro[disabled] input[placeholder], fieldset.ro[disabled] form.inline > .muted:only-child { display: none; }
fieldset.ro[disabled] input, fieldset.ro[disabled] select { background: transparent; border-color: transparent; color: var(--ink); appearance: none; -webkit-appearance: none; padding-left: 0; }
.ro-note { background: var(--sky); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.roles-help { display: grid; gap: 6px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.tag.role-admin { background: var(--ink); color: var(--ivory); }
.tag.role-editor { background: var(--lime); }
.tag.role-viewer { background: var(--sky); }
.invite-box input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* порядок меню */
.side-nav a .mv { display: none; margin-left: auto; gap: 2px; font-style: normal; }
.mv button { background: rgba(255,255,255,.12); color: inherit; border: 0; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.mv button:hover { background: rgba(255,255,255,.25); }
.side-nav a.on .mv button { background: rgba(31,31,31,.12); }
.nav-edit-bar { display: none; margin-top: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.nav-edit-bar p { margin: 0 0 8px; font-size: 12px; opacity: .7; }
.nav-edit-bar div { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-edit .side { --w: 248px !important; }
.nav-edit .side .brand span, .nav-edit .side-nav span, .nav-edit .side-foot span { display: inline !important; }
.nav-edit .side-nav a { justify-content: flex-start !important; padding: 8px 10px !important; cursor: grab; outline: 1px dashed rgba(255,255,255,.25); }
.nav-edit .side-nav a .mv { display: inline-flex; }
.nav-edit .side-nav a.dragging { opacity: .4; }
.nav-edit .nav-edit-bar { display: block; }
.nav-edit #navEdit { background: rgba(255,255,255,.12); opacity: 1; }

/* деньжата */
table.fin td:first-child, table.fin th:first-child { position: sticky; left: 0; background: var(--card); min-width: 230px; z-index: 1; }
table.fin td { white-space: nowrap; }
.fin-head td { font-weight: 800; background: #F6F5EE !important; border-top: 1px solid var(--line); }
.fin-sub td { font-weight: 700; }
.fin-sub td:first-child { padding-left: 14px; }
.fin-item td:first-child { padding-left: 28px; color: #3a3a37; }
.fin-total td { font-weight: 800; border-top: 2px solid var(--ink); background: #F4FBD8 !important; }
.fin-balance td { font-weight: 700; color: var(--cobalt); }
.fin-pct td { color: var(--muted); font-style: italic; }
.neg { color: var(--down) !important; }
.pl-form { gap: 8px; flex-wrap: nowrap; font-size: 13px; }
.pl-form input[type=month] { padding: 4px 6px; font-size: 13px; }

/* клиенты */
tr.click { cursor: pointer; }
.timeline li.day { display: block; padding: 14px 0 4px; border-bottom: 0; color: var(--muted); font-size: 13px; }
.buy { padding: 8px 0; border-bottom: 1px solid #EFEDE5; }
.buy:last-child { border-bottom: 0; }
.note { padding: 10px 0; border-bottom: 1px solid #EFEDE5; white-space: pre-wrap; font-size: 14px; }
.note:last-child { border-bottom: 0; }
textarea { width: 100%; font-family: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); resize: vertical; }
.anketa { padding: 10px 0; border-bottom: 1px solid #EFEDE5; }
.anketa:last-child { border-bottom: 0; }
.kv.answers { display: grid; grid-template-columns: minmax(160px, 2fr) 3fr; gap: 0; }
.kv.answers dt, .kv.answers dd { padding: 8px 0; border-bottom: 1px solid #EFEDE5; }
.kv.answers dt { color: var(--muted); padding-right: 16px; }
.kv.answers dd { margin: 0; white-space: pre-line; }
.kv.answers dt:nth-last-of-type(1), .kv.answers dd:last-child { border-bottom: 0; }
@media (max-width: 700px) { .kv.answers { grid-template-columns: 1fr; } .kv.answers dt { border-bottom: 0; padding-bottom: 0; } }

/* выпадающий список с галочками */
details.multi { position: relative; }
details.multi summary { list-style: none; cursor: pointer; padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
details.multi summary::-webkit-details-marker { display: none; }
details.multi summary::after { content: "▾"; position: absolute; right: 10px; top: 6px; color: var(--muted); }
details.multi[open] summary { outline: 2px solid var(--cobalt); outline-offset: -1px; }
.multi-panel { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 6px; }
.multi-panel label { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }

[hidden] { display: none !important; }   /* иначе display:inline-flex у .inline перебивает hidden */

/* переписка */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.in { align-self: flex-start; background: var(--gray); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--sky); border-bottom-right-radius: 4px; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }

/* Аналитика */
table.cohort td.n small { color: var(--muted); font-size: 11px; }
.ttp { display: grid; gap: 8px; max-width: 560px; }
.ttp > div { display: grid; grid-template-columns: 1fr 64px 150px; align-items: center; gap: 10px; font-size: 14px; }
.ttp .bar { height: 10px; background: #EBEBEB; border-radius: 6px; overflow: hidden; }
.ttp .bar span { display: block; height: 100%; background: var(--cobalt); border-radius: 6px; }

/* Рассылки */
.seg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
.mail-form { display: grid; gap: 12px; max-width: 640px; }
.mail-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.mail-form textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.mail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } }

/* Сортировка таблиц по клику на заголовок */
table:not(.no-sort) thead th { cursor: pointer; user-select: none; }
table:not(.no-sort) thead th:hover { color: var(--ink); }
th.sort-asc::after { content: " ▲"; font-size: 10px; color: var(--cobalt); }
th.sort-desc::after { content: " ▼"; font-size: 10px; color: var(--cobalt); }
.ex-panel { max-height: 70vh; overflow-y: auto; }
.ex-panel .ex-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 8px; }

/* Расширенные фильтры */
.adv-btn { font-weight: 600; }
.adv-panel { flex-basis: 100%; width: 100%; margin-top: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.adv-panel[hidden] { display: none !important; }
.adv-dims { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.adv-dims b, .adv-col h4 { font-size: 14px; margin: 0 6px 0 0; }
.adv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adv-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.adv-col:last-child { background: #FFF5F8; }
.adv-col h4 { margin-bottom: 8px; }
.adv-col h4 small { font-weight: 400; }
.adv-group { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 10px; font-size: 13px; }
.adv-group > b { flex-basis: 100%; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.adv-group label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
@media (max-width: 900px) { .adv-cols { grid-template-columns: 1fr; } }

/* Свёрнутые в «Ещё» пункты меню */
.side-nav a.folded:not(.on) { display: none; }
.nav-more-open .side-nav a.folded { display: flex; opacity: .6; }
.nav-edit .side-nav a.folded { display: flex; opacity: .45; }
.nav-edit .side-nav a.folded [data-fold] { background: var(--lime); color: var(--ink); }
.nav-more { display: flex; align-items: center; gap: 14px; width: calc(100% - 20px); margin: 2px 10px; padding: 10px 14px; border: 0; border-radius: 12px;
            background: transparent; color: var(--ivory); opacity: .65; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.nav-more:hover { opacity: 1; background: rgba(255,255,255,.08); }
.nav-more svg { flex: 0 0 20px; }
.nav-more i { margin-left: auto; font-style: normal; transition: transform .15s; }
.nav-more-open .nav-more i { transform: rotate(180deg); }
.nav-more[hidden] { display: none; }
.nav-collapsed .nav-more { justify-content: center; padding: 10px 0; }
.nav-collapsed .nav-more span, .nav-collapsed .nav-more i { display: none; }
