/* Админка — макет */
.adm { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100vh; background: var(--paper); }

.adm-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.adm-side .wordmark { color: var(--white); padding: 0 .5rem; }
.adm-side .wordmark__mark { box-shadow: .3rem .3rem 0 0 var(--white); }
.adm-side__sub { padding: .25rem .5rem 1.25rem; font-size: .8125rem; color: var(--g-300); }
.adm-nav { display: grid; gap: 2px; }
.adm-nav a { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; padding: .5rem .75rem; border-radius: var(--radius); color: var(--g-200); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.adm-nav a:hover { background: var(--g-800); color: var(--white); }
.adm-nav a[aria-current="page"] { background: var(--g-800); color: var(--white); box-shadow: inset 3px 0 0 var(--orange); }
.adm-nav__pill { min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: .75rem; text-align: center; }
.adm-side__user { margin-top: auto; display: flex; gap: .75rem; align-items: center; padding: 1rem .5rem 0; border-top: 1px solid var(--g-700); }
.adm-avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--g-700); font-weight: 700; }
.adm-side__name { font-weight: 700; font-size: .9375rem; }
.adm-side__role { font-size: .75rem; color: var(--g-300); }

.adm-body { min-width: 0; }
.adm-demo { padding: .625rem 2rem; background: #FFF4EC; border-bottom: 2px solid var(--orange); font-size: .875rem; }
.adm-main { padding: 2rem; max-width: 90rem; }

.adm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.adm-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; letter-spacing: -.01em; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 2px; }
.seg button { min-height: 2.5rem; padding: 0 .875rem; border: 0; border-radius: 4px; background: none; font-weight: 600; font-size: .875rem; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.kpi { background: var(--white); padding: 1.25rem 1.5rem; }
.kpi--accent { box-shadow: inset 0 3px 0 var(--orange); }
.kpi__label { font-size: .8125rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.kpi__value { font-family: var(--font-display); font-weight: 600; font-size: 2.25rem; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: .8125rem; color: var(--ink-soft); }

.adm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel__title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; gap: .5rem; align-items: center; }
.panel__foot { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .875rem; color: var(--ink-soft); }
.placeholder p { color: var(--ink-soft); max-width: 40rem; }

.funnel { display: grid; gap: .75rem; }
.funnel li { display: grid; grid-template-columns: 11rem 1fr 4rem; align-items: center; gap: 1rem; font-size: .9375rem; }
.funnel__bar { height: .625rem; background: var(--paper-2); border-radius: 999px; position: relative; overflow: hidden; }
.funnel__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: max(var(--w), 4px); background: var(--g-800); border-radius: 999px; }
.funnel li:last-child .funnel__bar::after { background: var(--orange); }
.funnel__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.stat-list { margin: 0; display: grid; }
.stat-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.stat-list dt { color: var(--ink-soft); }
.stat-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.integr { display: grid; gap: .75rem; }
.integr li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; font-weight: 600; }
.state { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; border: 1.5px solid; }
.state::before { font-size: .875rem; }
.state--off { color: var(--ink-soft); border-color: var(--g-300); background: var(--paper); }
.state--off::before { content: "○"; }
.state--warn { color: #8A3A00; border-color: var(--orange); background: #FFF4EC; }
.state--warn::before { content: "↻"; }
.state--ok { color: var(--ok); border-color: var(--ok); background: #EAF5EE; }
.state--ok::before { content: "✓"; }

/* Leads */
.search input { min-height: 2.75rem; width: min(22rem, 70vw); padding: .5rem .875rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); background: var(--white); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.filter-bar label, .lc-actions label, .lc-extra label { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 700; color: var(--ink-soft); }
.filter-bar select, .lc-actions select, .lc-extra select, .lc-extra input { min-height: 2.5rem; min-width: 10rem; padding: .4rem .6rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); background: var(--white); font-weight: 500; color: var(--ink); }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.leads { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.leads th { text-align: left; padding: .875rem 1rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.leads td { padding: .875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.leads tbody tr:hover { background: var(--paper); }
.leads .lead-link { font-weight: 700; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.leads .muted { color: var(--ink-soft); font-size: .8125rem; display: block; }
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap; border: 1.5px solid; }
.status--new { color: #8A3A00; border-color: var(--orange); background: #FFF4EC; }
.status--new::before { content: "●"; }
.status--work { color: var(--ink); border-color: var(--ink); }
.status--work::before { content: "◐"; }
.status--quote { color: #1D4F7A; border-color: #1D4F7A; background: #EEF4FA; }
.status--quote::before { content: "✉"; }
.status--sale { color: var(--ok); border-color: var(--ok); background: #EAF5EE; }
.status--sale::before { content: "✓"; }
.status--lost { color: var(--ink-soft); border-color: var(--g-300); background: var(--paper); }
.status--lost::before { content: "✕"; }
.tg-err { display: block; margin-top: .25rem; font-size: .75rem; font-weight: 700; color: var(--err); }

.mini { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.mini th, .mini td { padding: .6rem 0; border-bottom: 1px solid var(--line); text-align: left; }
.mini th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.mini td:not(:first-child), .mini th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* Lead card */
.lead-card { width: min(40rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--white); color: var(--ink); }
.lead-card[open] { display: flex; flex-direction: column; }
.lead-card::backdrop { background: rgba(18,20,23,.5); }
.lead-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.5rem; border-bottom: 1px solid var(--line); }
.lead-card__meta { font-size: .8125rem; color: var(--ink-soft); font-weight: 600; }
.lead-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; margin-top: .25rem; }
.lead-card__body { overflow-y: auto; padding: 0 1.5rem 2rem; }
.lead-card__body section { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.lc-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; margin-bottom: .875rem; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; margin-bottom: 1rem; counter-reset: st; }
.stepper li { counter-increment: st; position: relative; padding-top: .875rem; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); border-top: 4px solid var(--paper-2); }
.stepper li::before { content: counter(st) ". "; }
.stepper li.is-done { border-color: var(--g-800); color: var(--ink); }
.stepper li.is-current { border-color: var(--orange); color: var(--ink); font-weight: 800; }
.stepper li.is-current::after { content: " ← сейчас"; font-weight: 600; color: var(--orange-text); }
.lc-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.lc-extra { margin-top: 1rem; display: grid; gap: .5rem; }
.lc-note { font-size: .8125rem; color: var(--ink-soft); margin-top: .5rem; }
.lc-list li { display: flex; justify-content: space-between; padding: .4rem 0; }
.lc-dl { margin: 0; display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; font-size: .9375rem; }
.lc-dl dt { color: var(--ink-soft); }
.lc-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.lc-history { display: grid; gap: .75rem; }
.lc-history li { padding-left: 1rem; border-left: 2px solid var(--line); font-size: .9375rem; }
.lc-history__who { font-size: .8125rem; color: var(--ink-soft); font-weight: 600; }
.lc-comment textarea { width: 100%; margin-top: .75rem; padding: .6rem .75rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); }

/* ---------- Товары ---------- */
.adm-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-btn { min-height: 2.75rem; padding: .5rem 1rem; font-size: .875rem; }
.btn--ghost.adm-btn { border-color: var(--ink); color: var(--ink); }

.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.5rem; }
.tabs [role="tab"] { min-height: 2.75rem; padding: .5rem 1.125rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; font-weight: 700; color: var(--ink-soft); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }

.pstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.pstat button { display: grid; gap: .125rem; width: 100%; padding: 1rem 1.25rem; border: 0; background: var(--white); text-align: left; }
.pstat button:hover { background: var(--paper); }
.pstat__n { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.pstat__l { font-size: .8125rem; font-weight: 700; color: var(--ink-soft); }
.pstat--warn button { box-shadow: inset 0 3px 0 var(--orange); }

.filter-bar__search { min-height: 2.5rem; min-width: 16rem; padding: .4rem .6rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); background: var(--white); font-weight: 500; color: var(--ink); }
.pcount { font-size: .875rem; color: var(--ink-soft); font-weight: 600; margin-bottom: .75rem; }
.ptable td { vertical-align: middle; }
.ptable__img { width: 4.5rem; }
.ptable__img img { width: 3.5rem; height: 3.5rem; object-fit: contain; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.ptable tr.is-hidden td:not(:last-child):not(:nth-last-child(2)) { opacity: .5; }
.ptable .state { font-size: .75rem; white-space: nowrap; }
.pmore { display: flex; justify-content: center; margin-top: 1rem; }

.pswitch { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; font-weight: 600; cursor: pointer; }
.pswitch input { appearance: none; -webkit-appearance: none; position: relative; width: 2.5rem; height: 1.5rem; margin: 0; border-radius: 999px; background: var(--g-300); cursor: pointer; transition: background-color .2s; flex: none; }
.pswitch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: var(--white); transition: transform .2s; }
.pswitch input:checked { background: var(--ok); }
.pswitch input:checked::after { transform: translateX(1rem); }
.pswitch--sm span { font-size: .8125rem; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: 1.25rem; align-items: start; }
.cats-hint { margin: 0 0 1.25rem; padding-top: 0; border-top: 0; }
.cats__item { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.cats__drag { color: var(--g-300); cursor: grab; letter-spacing: -.15em; }
.cats__name { font-weight: 600; }
.cats .muted { color: var(--ink-soft); font-size: .8125rem; }

.pcard { width: min(46rem, 100vw); }
.pphoto { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; align-items: start; }
.pphoto__img { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); display: grid; place-items: center; overflow: hidden; }
.pphoto__img img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.pphoto__img img.is-lowres { object-fit: scale-down; }
.pphoto__side { display: grid; gap: .5rem; justify-items: start; }
.pphoto__state { display: grid; gap: .25rem; }
.pphoto__upload { cursor: pointer; }
.pphoto__upload:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .75rem; }
.pfield { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 700; color: var(--ink-soft); }
.pfield--wide { grid-column: 1 / -1; }
.pfield input, .pfield select, .pfield textarea { min-height: 2.75rem; padding: .5rem .7rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); background: var(--white); font-weight: 500; font-size: .9375rem; color: var(--ink); }
.pfield textarea { resize: vertical; line-height: 1.5; }
.pform > section + section, .pform section { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.pform__actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .75rem; padding: 1rem 0; background: var(--white); }
.pform__actions .lc-note { flex: 1 1 100%; margin: 0; }

.isteps { counter-reset: is; display: grid; gap: 0; padding-top: 1rem; }
.istep { counter-increment: is; position: relative; padding: 0 0 1.5rem 3rem; border-left: 2px solid var(--line); margin-left: 1rem; }
.istep::before { content: counter(is); position: absolute; left: -1.0625rem; top: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--paper-2); font-weight: 700; }
.istep.is-current::before { background: var(--orange); color: var(--ink); }
.istep:last-child { border-left-color: transparent; }
.istep h3 { font-size: 1.0625rem; margin-bottom: .375rem; }
.istep p { color: var(--ink-soft); font-size: .9375rem; margin-bottom: .75rem; }
.idiff { display: grid; gap: .5rem; font-size: .9375rem; }
.idiff li { display: grid; grid-template-columns: 11rem 1fr; gap: .75rem; align-items: start; }
.idiff .status { justify-self: start; }
.pnote { display: flex; gap: .5rem; align-items: baseline; margin: -.5rem 0 1.25rem; font-size: .875rem; color: var(--ink-soft); }
@media (max-width: 36rem) { .idiff li { grid-template-columns: 1fr; gap: .25rem; } }

/* ---------- Роли (в макете — только скрытие; в рабочей версии права проверяет сервер) ---------- */
.adm-side__who { display: flex; gap: .75rem; align-items: center; }
.adm-side__user { flex-direction: column; align-items: stretch; gap: .625rem; }
.role-switch { display: grid; gap: .25rem; font-size: .75rem; font-weight: 700; color: var(--orange-hi); text-transform: uppercase; letter-spacing: .06em; }
.role-switch select { min-height: 2.5rem; padding: .3rem .5rem; border: 1.5px solid var(--g-500); border-radius: var(--radius); background: var(--g-850); color: var(--white); font-size: .875rem; text-transform: none; letter-spacing: 0; }
.role-switch__note { font-size: .6875rem; color: var(--g-300); line-height: 1.4; }
body[data-role="installer"] [data-can="manage"], body[data-role="operator"] [data-can="manage"],
body[data-role="installer"] [data-can="money"], body[data-role="operator"] [data-can="money"] { display: none !important; }
body[data-role="installer"] #view-products .adm-head__actions,
body[data-role="installer"] [data-pcard] .pphoto__upload,
body[data-role="installer"] [data-pcard] [data-pc-find],
body[data-role="installer"] [data-pcard] button[type="submit"],
body[data-role="installer"] #view-products [data-cat-demo] { display: none !important; }

/* ---------- CRM: воронка ---------- */
.board-hint { margin-bottom: 1rem; }
.board { display: grid; grid-template-columns: repeat(6, minmax(10.5rem, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; }
.board__col { background: var(--paper-2); border-radius: var(--radius); padding: .625rem; min-width: 10.5rem; }
.board__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.board__head h2 { font-size: .875rem; font-weight: 700; }
.board__n { min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--white); font-size: .75rem; font-weight: 700; text-align: center; }
.board__sum { font-size: .75rem; color: var(--ink-soft); font-weight: 600; margin-top: .125rem; }
.board__list { display: grid; gap: .5rem; margin-top: .75rem; }
.board__empty { font-size: .8125rem; color: var(--ink-soft); padding: .5rem 0; }
.ocard { display: grid; gap: .25rem; width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-align: left; transition: border-color .15s, box-shadow .15s; }
.ocard:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(18,20,23,.08); }
.ocard__top { display: flex; justify-content: space-between; gap: .5rem; }
.ocard__n { font-weight: 800; font-size: .875rem; }
.ocard__type { font-size: .75rem; font-weight: 700; color: var(--ink-soft); }
.ocard__client { font-weight: 600; font-size: .9375rem; }
.ocard__area { font-size: .8125rem; color: var(--ink-soft); }
.ocard__sum { font-size: .8125rem; font-weight: 700; }
.ocard__meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin-top: .25rem; font-size: .75rem; color: var(--ink-soft); }
.ocard__late { color: var(--err); font-weight: 700; }
.stepper--6 { grid-template-columns: repeat(3, 1fr); row-gap: .75rem; }
.oc-sum { margin-top: .75rem; font-size: .9375rem; }
.otasks { display: grid; gap: .5rem; margin-bottom: .75rem; }
.otasks li { display: grid; grid-template-columns: auto 1fr; gap: .125rem .75rem; font-size: .9375rem; align-items: center; }
.otasks .muted { grid-column: 2; font-size: .8125rem; color: var(--ink-soft); }

.tstate { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; border: 1.5px solid; }
.tstate--new { color: var(--ink); border-color: var(--g-300); }
.tstate--new::before { content: "○"; }
.tstate--work { color: #1D4F7A; border-color: #1D4F7A; background: #EEF4FA; }
.tstate--work::before { content: "◐"; }
.tstate--done { color: var(--ok); border-color: var(--ok); background: #EAF5EE; }
.tstate--done::before { content: "✓"; }
.tstate--late { color: var(--err); border-color: var(--err); background: #FCEEEE; }
.tstate--late::before { content: "⚠"; }
.tphoto { cursor: pointer; }
.tacts { display: flex; flex-wrap: wrap; gap: .25rem .875rem; }
[data-task-rows] .lead-link { white-space: nowrap; }
.tphoto:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- CRM: отчёты ---------- */
.rep-period { margin-bottom: 1.25rem; }
.hbars, .hbar { display: grid; gap: .625rem; }
.hbar { grid-template-columns: 12rem 1fr 2rem; align-items: center; gap: .75rem; font-size: .9375rem; }
.hbar__track { height: .75rem; background: var(--paper-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar__fill { display: block; height: 100%; min-width: 2px; background: var(--g-800); border-radius: 0 4px 4px 0; }
.hbar__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cols__plot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; align-items: end; height: 13rem; border-bottom: 1px solid var(--g-300); padding-top: 1.25rem; }
.cols__col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.cols__val { font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: .25rem; }
.cols__bar { display: block; width: min(2.5rem, 70%); background: var(--g-800); border-radius: 4px 4px 0 0; cursor: default; }
.cols__bar:hover, .cols__bar:focus-visible { background: var(--orange); }
.cols__lab { position: absolute; bottom: -1.5rem; font-size: .75rem; color: var(--ink-soft); }
[data-rep-sales] .lc-note { margin-top: 2rem; }
.rep-table { margin-top: .75rem; font-size: .875rem; }
.rep-table summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); min-height: 2rem; display: flex; align-items: center; }
.rep-team td, .rep-team th { text-align: left !important; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); padding: .35rem .6rem; border-radius: 4px; background: var(--ink); color: var(--white); font-size: .8125rem; font-weight: 600; pointer-events: none; white-space: nowrap; z-index: 5; }
#view-sales { position: relative; }

/* ---------- Сотрудники и роли ---------- */
.staff-panel { margin-bottom: 1.5rem; }
.staff-panel select { min-height: 2.5rem; padding: .3rem .5rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); background: var(--white); }
.acc-actions { display: flex; flex-wrap: wrap; gap: .25rem .75rem; min-width: 14rem; }

.matrix th[scope="row"] { font-weight: 600; text-align: left; padding-right: 1rem; text-transform: none; letter-spacing: 0; font-size: .9375rem; color: var(--ink); }
.matrix td, .matrix thead th:not(:first-child) { text-align: left !important; font-size: .8125rem; white-space: nowrap; padding-right: 1rem; }
.matrix__sub th[scope="row"] { font-weight: 500; color: var(--ink-soft); padding-left: 1rem; }
.matrix__c--e { color: var(--ok); font-weight: 700; }
.matrix__c--v { color: #1D4F7A; font-weight: 600; }
.matrix__c--n { color: var(--g-300); }
.invite-steps { margin-top: 1rem; padding-left: 1.25rem; list-style: disc; display: grid; gap: .375rem; font-size: .875rem; color: var(--ink-soft); }
@media (max-width: 48rem) { .hbar { grid-template-columns: 1fr 2rem; } .hbar__track { grid-column: 1 / -1; grid-row: 2; } .stepper--6 { grid-template-columns: 1fr 1fr; } }

/* ---------- О нас и команда ---------- */
.about-adm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: start; }
.about-form { display: grid; gap: 1rem; }
.about-form section, .about-form { border: 0; }
.about-langs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.about-lang { min-height: 2.25rem; padding: .25rem .75rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }
.about-lang[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.about-lang small { font-weight: 500; opacity: .75; }
.team-adm__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.team-adm__head .panel__title { margin-bottom: 0; }
.team-adm__hint { margin: .5rem 0 1rem; }
.team-adm { display: grid; }
.tm { display: grid; grid-template-columns: 5rem 1fr auto; gap: 1rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--line); }
.tm.is-hidden .tm__img, .tm.is-hidden .tm__body > :not(.tm__tags) { opacity: .5; }
.tm__img { width: 5rem; height: 5rem; object-fit: cover; border-radius: var(--radius); background: var(--g-900); }
.tm__role { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; }
.tm__name { font-size: .875rem; color: var(--ink-soft); }
.tm__text { margin-top: .25rem; font-size: .9375rem; color: var(--ink-soft); }
.tm__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tm__tags .state { font-size: .75rem; }
.tm__actions { display: flex; gap: .4rem; align-items: center; }
.tm__move { width: 2.5rem; height: 2.5rem; font-size: 1.125rem; font-weight: 700; }
.tm__move:disabled { opacity: .35; cursor: default; }
.member-photo { background: var(--g-900); }
.member-photo img { object-fit: cover; padding: 0; }
.member-delete { margin-right: auto; border-color: var(--err) !important; color: var(--err) !important; }
@media (max-width: 72rem) { .about-adm { grid-template-columns: 1fr; } }
@media (max-width: 36rem) {
  .tm { grid-template-columns: 4rem 1fr; }
  .tm__img { width: 4rem; height: 4rem; }
  .tm__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 48rem) {
  .pstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pphoto, .pgrid { grid-template-columns: 1fr; }
  .pphoto__img { max-width: 12rem; }
  .cats__item { grid-template-columns: auto 1fr; }
  .cats__item .muted, .cats__item .link-btn { grid-column: 2; justify-self: start; }
}

@media (max-width: 64rem) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; }
  .adm-nav { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .adm-side__user { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-cols { grid-template-columns: 1fr; }
}
@media (max-width: 36rem) {
  .adm-main { padding: 1.25rem 1rem; }
  .adm-demo { padding: .625rem 1rem; }
  .funnel li { grid-template-columns: 1fr 3.5rem; }
  .funnel__bar { grid-column: 1 / -1; grid-row: 2; }
  .stepper { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Рабочая админка: дополнения
   ========================================================= */
.adm-boot [data-shell], .adm-boot [data-auth-screen] { visibility: hidden; }
.adm-noscript { padding: 2rem; }
.adm-loading { color: var(--ink-soft); padding: 1rem 0; }
.adm-side__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .8125rem; }
.adm-side__links a, .adm-side__links .link-btn { color: var(--g-200); }
.adm-side__links a:hover, .adm-side__links .link-btn:hover { color: var(--white); }
.adm-main:focus { outline: none; }
.adm-sub { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 1.5rem 0 .75rem; }
.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi__value--sm { font-size: 1.375rem; }
@media (max-width: 80rem) { .kpis--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .kpis--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini--left td, .mini--left th { text-align: left !important; }
.mini .muted, .leads .muted { display: block; color: var(--ink-soft); font-size: .8125rem; }
.pgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 48rem) { .pgrid--3 { grid-template-columns: 1fr; } }
.custom-period { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; width: 100%; justify-content: flex-end; }
.custom-period label { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 700; color: var(--ink-soft); }
.custom-period input { min-height: 2.5rem; padding: .3rem .5rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); }
.stat-list dd .muted { display: inline; margin-left: .375rem; font-weight: 500; }
.days { display: flex; align-items: flex-end; gap: 2px; height: 10rem; border-bottom: 1px solid var(--g-300); }
.days__bar { flex: 1; min-width: 2px; background: var(--g-800); border-radius: 3px 3px 0 0; }
.days__bar:hover, .days__bar:focus-visible { background: var(--orange); }
.pcard--wide { width: min(52rem, 100vw); }
.pcard .pform section { border-bottom: 1px solid var(--line); }
.lc-form { display: grid; gap: .75rem; }
.lc-form > .btn, .lc-form > a.btn { justify-self: start; }
.lc-comment { display: grid; gap: .5rem; justify-items: start; margin-top: .75rem; }
.lc-comment label { width: 100%; }
.slides-form, .slide-edit { display: grid; gap: 1rem; }
.slide-edit { margin-bottom: 1.5rem; border: 1px solid var(--line); }
.slide-edit legend { padding: 0 .5rem; }
.slide-edit__grid { display: grid; grid-template-columns: 16rem 1fr; gap: 1.5rem; align-items: start; }
.slide-edit__img { display: grid; gap: .5rem; justify-items: start; }
.slide-edit__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--g-800); }
@media (max-width: 56rem) { .slide-edit__grid { grid-template-columns: 1fr; } }
.svc-panel { margin-bottom: 1.5rem; }
.works-toggle { margin-bottom: 1.5rem; }
.work-photos-adm { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.work-photos-adm img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.plink { font-size: .75rem; word-break: break-all; }
.pc-link { padding: .75rem; background: var(--paper-2); border-radius: var(--radius); word-break: break-all; }
.idiff-list { margin: -.25rem 0 .5rem 1rem; font-size: .8125rem; color: var(--ink-soft); max-height: 10rem; overflow: auto; }
.audit-details { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; color: var(--ink-soft); max-width: 24rem; word-break: break-all; }
.ledger-form { margin-bottom: 1rem; }
.cats__item { grid-template-columns: 1fr auto auto auto auto auto; }
.cats__item.is-hidden .cats__name { opacity: .5; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--g-900); }
.auth__box { width: min(26rem, 100%); padding: 2rem; border-radius: var(--radius); background: var(--white); }
.auth__mark { margin-bottom: 1.5rem; }
.auth__title { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: .75rem; }
.auth__form { display: grid; gap: 1rem; margin-top: 1rem; }
.auth__hint { font-size: .875rem; color: var(--ink-soft); margin-top: .75rem; }
.auth__qr { margin: 1rem auto; border: 1px solid var(--line); border-radius: var(--radius); }
.auth__secret { word-break: break-all; }

.toasts { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; max-width: min(26rem, calc(100vw - 2rem)); }
.toast { padding: .875rem 1rem; border-radius: var(--radius); background: var(--g-900); color: var(--white); font-weight: 600; font-size: .9375rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); border-left: 4px solid var(--ok); }
.toast--error { border-left-color: var(--err); }
/* ---------- переводы ---------- */
.tr-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.tr-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.tr-tools .pfield { flex: 1 1 18rem; margin: 0; }
.tr-group { margin-bottom: 1.25rem; }
.tr-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.tr-item:last-child { border-bottom: 0; }
.tr-item.is-missing .tr-ru::after { content: "нет перевода"; margin-left: .5rem; font-size: .75rem; color: #9a3412; background: #fff1e6; border-radius: 4px; padding: .1rem .4rem; }
.tr-ru { margin: 0 0 .5rem; font-size: .9375rem; color: var(--ink-soft); }
.tr-item .pgrid { margin-bottom: .25rem; }
.tr-item textarea { width: 100%; resize: vertical; }
.tr-cyr { margin: 0; }
.tr-save { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); padding: 1rem 0; z-index: 2; }
@media (max-width: 720px) { .tr-item .pgrid { grid-template-columns: 1fr; } }

/* ---------- канал Telegram ---------- */
.state--err { color: var(--err); border-color: var(--err); background: #FDECEC; }
.ch-days { display: flex; flex-wrap: wrap; gap: .5rem 1rem; border: 0; padding: 0; margin: .5rem 0; }
.ch-found { display: grid; gap: .35rem; margin-top: .75rem; }
.ch-next { margin: 1.25rem 0; }
.ch-post { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ch-post__img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.ch-post__caption { white-space: normal; font-size: .9375rem; line-height: 1.5; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-bottom: 1rem; }
.ch-hist td { vertical-align: top; }
@media (max-width: 860px) { .ch-post { grid-template-columns: 1fr; } }

/* Видеонаблюдение: объекты, настройка роутера, регистраторы */
.state--err { color: var(--err); border-color: var(--err); background: #FCEDEC; }
.state--err::before { content: "!"; }
.vms-steps { display: grid; gap: 1.25rem; padding-left: 1.25rem; list-style: decimal; }
.vms-steps li { padding-left: .25rem; line-height: 1.55; }
.vms-kv { margin-top: .5rem; max-width: 46rem; }
.vms-kv th { width: 14rem; text-align: left; font-weight: 600; color: var(--ink-soft); }
.vms-kv td code, .vms-link code { font-size: .875rem; word-break: break-all; }
.vms-kv td:last-child { width: 7rem; text-align: right; }
.vms-other, .vms-add { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.vms-other summary, .vms-add summary { cursor: pointer; font-weight: 700; }
.vms-conf { margin: .75rem 0 0; padding: 1rem; border-radius: var(--radius); background: var(--g-900); color: var(--white); font-size: .8125rem; overflow-x: auto; }
.vms-dev { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.vms-dev:first-of-type { padding-top: 0; }
.vms-dev__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.vms-dev__head h3 { font-size: 1.0625rem; }
.vms-dev__head > div:last-child { text-align: right; }
.vms-cam-name { width: 100%; min-width: 12rem; min-height: 2.25rem; padding: .25rem .5rem; border: 1.5px solid var(--g-300); border-radius: var(--radius); font-size: .9375rem; }
.vms-actions { white-space: nowrap; }
.vms-link { padding: .75rem; margin: 1rem 0 0; border: 1px dashed var(--g-300); border-radius: var(--radius); background: var(--paper); }
/* таблицы раздела: все колонки по левому краю, с отступами; действия — справа */
.mini.vms-table th, .mini.vms-table td, .mini.vms-table th:not(:first-child), .mini.vms-table td:not(:first-child) { text-align: left; padding: .75rem 1rem; vertical-align: middle; }
.mini.vms-table th:last-child, .mini.vms-table td.vms-actions { text-align: right; }
.mini.vms-table tbody tr:last-child td { border-bottom: 0; }
.vms-actions { display: table-cell; }
.vms-actions .link-btn { margin-left: 1rem; }
.vms-actions .link-btn:first-child { margin-left: 0; }
.vms-del { color: var(--err); }
.vms-del:hover { color: var(--err); }
.vms-online, .vms-offline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .875rem; }
.vms-online { color: var(--ok); }
.vms-offline { color: var(--ink-soft); }
.vms-online::before, .vms-offline::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.vms-online::before { box-shadow: 0 0 0 3px #D7EEDF; }
