/* Панель владельца: мелкие дополнения к общей дизайн-системе */
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.code-block {
    background: var(--gray-soft);
    border: 0.0625rem solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}
.sub-until-date { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.sub-until-label { text-transform: uppercase; letter-spacing: .05em; }
.sub-invoice td { padding: 0.5rem 0.75rem; }
.sub-invoice td:first-child { width: 11rem; }
/* Переписка по обращению: ответы владельца прижаты вправо и подкрашены */
.ticket-msg {
    border: 0.0625rem solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    max-width: 46rem;
}
.ticket-msg.is-owner {
    margin-left: auto;
    background: var(--accent-soft);
    border-color: transparent;
}
.ticket-msg-head { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.35rem; }
.ticket-msg-body { line-height: 1.6; overflow-wrap: anywhere; }

.stat-card { text-decoration: none !important; color: inherit; }
/* Длинные подписи («Заблокированы») не должны распирать карточку на телефоне */
.stat-card .stat-label { overflow-wrap: anywhere; }

/* ------------------------------------------------ Раскрывающийся блок
   Тот же, что в клиентской CRM: голый <details> даёт браузерный треугольник
   и никакого признака, что на это можно нажать. */
.disclose { border: 0.0625rem solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.disclose > summary {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem; font-weight: 600; color: var(--text);
    cursor: pointer; user-select: none; list-style: none;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before {
    content: ''; flex: none; width: 0.375rem; height: 0.375rem;
    border-right: 0.09375rem solid currentColor;
    border-bottom: 0.09375rem solid currentColor;
    transform: rotate(-45deg); transition: transform .15s;
}
.disclose[open] > summary::before { transform: rotate(45deg); }
.disclose > summary:hover { color: var(--accent); }
.disclose-body { padding: 0.65rem 0.75rem; }
.disclose.is-quiet { border: 0; background: transparent; }
.disclose.is-quiet > summary { padding: 0.15rem 0; font-weight: 400; color: var(--text-muted); }
.disclose.is-quiet .disclose-body { padding: 0.35rem 0 0; }

/* --------------------------------------------------- Кабинет партнёра
   Свой каркас, а не панель владельца: партнёру нужны три экрана, и меню,
   половина которого закрыта, пришлось бы объяснять при каждом входе. */
.pt-shell { min-height: 100vh; background: var(--bg); }
.pt-head { background: var(--card); border-bottom: 0.0625rem solid var(--border); }
.pt-head-in { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
              max-width: 72rem; margin: 0 auto; padding: 0.75rem 1rem; }
.pt-brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.pt-mark { flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm);
           background: var(--accent); color: #fff; font-weight: 600;
           display: inline-flex; align-items: center; justify-content: center; }
.pt-brand-name { font-weight: 600; }
.pt-brand-sub { font-size: 0.75rem; color: var(--text-muted); }
.pt-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-left: auto; }
.pt-tab { display: flex; align-items: center; gap: 0.4rem;
          padding: 0.45rem 0.8rem; border-radius: var(--radius-sm);
          font-size: 0.875rem; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.pt-tab:hover { background: var(--gray-soft); color: var(--text); }
.pt-tab.is-active { background: var(--accent-soft); color: var(--accent); }
.pt-main { max-width: 72rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.pt-title { margin-bottom: 1rem; }
.pt-title h1 { font-size: 1.375rem; margin: 0 0 0.15rem; }

.pt-cards { display: grid; gap: 0.75rem;
            grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.pt-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.pt-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2;
            font-variant-numeric: tabular-nums; margin: 0.15rem 0 0.2rem; }

/* Запрос на выплату у владельца: кто, сколько, куда и что с этим делать. */
.po-row { display: grid; gap: 0.5rem 1rem; align-items: start;
          grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr) auto;
          padding: 0.6rem 0; }
.po-row + .po-row { border-top: 0.0625rem solid var(--border-soft); }
.po-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.po-act { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 62rem) {
    .po-row { grid-template-columns: minmax(0, 1fr) auto; }
    .po-details, .po-act { grid-column: 1 / -1; }
}

/* Снимки к версии на экране релизов. */
.rel-shots { display: grid; gap: 0.6rem;
             grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.rel-shot { margin: 0; }
.rel-shot img { width: 100%; height: auto; display: block;
                border: 0.0625rem solid var(--border); border-radius: var(--radius-sm); }
.rel-shot figcaption { display: flex; align-items: center; gap: 0.4rem;
                       justify-content: space-between; font-size: 0.75rem;
                       color: var(--text-muted); margin-top: 0.25rem; }
.rel-shots-row > td { background: var(--gray-soft); }

/* ------------------------------------------------ Единый вход и регистрация
   Слева — кому сюда и что внутри, справа — форма. На телефоне пояснение
   уходит под форму: человек пришёл войти, а не читать. */
.auth-page:has(.au-wrap) { align-items: center; padding: 1.5rem 1rem; }
.au-wrap { width: 100%; max-width: 58rem; display: grid;
           grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
           background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.au-side { background: var(--accent); color: #fff; padding: 2.25rem 2rem;
           display: flex; flex-direction: column; gap: 1rem; }
.au-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.05rem; }
.au-mark { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 0.6rem;
           background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; }
.au-side-title { font-size: 1.5rem; line-height: 1.25; margin: 0.75rem 0 0; color: #fff; }
.au-points, .au-steps { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.6rem; line-height: 1.5; opacity: .95; }
.au-points { list-style: none; padding: 0; }
.au-points li { padding-left: 1rem; position: relative; }
.au-points li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 0.4rem; height: 0.4rem;
                        border-radius: 50%; background: rgba(255,255,255,.7); }
.au-side-note { margin-top: auto; font-size: 0.8125rem; opacity: .85; }
.au-card { padding: 2.25rem 2rem; min-width: 0; }
.au-title { font-size: 1.5rem; margin: 0 0 0.25rem; }
.au-row { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.au-form .form-check { align-items: flex-start; line-height: 1.45; }
.au-form .form-check input { margin-top: 0.15rem; flex: none; }
.au-foot { margin-top: 1.25rem; display: grid; gap: 0.35rem; font-size: 0.8125rem; text-align: center; }
.au-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 48rem) {
    .au-wrap { grid-template-columns: 1fr; }
    .au-side { order: 2; padding: 1.5rem 1.25rem; }
    .au-side-title { font-size: 1.2rem; margin-top: 0; }
    .au-card { padding: 1.5rem 1.25rem; }
}
@media (max-width: 30rem) {
    .au-row { grid-template-columns: 1fr; }
}

/* --------------------------------------------------- Кабинет заказчика */
.min-w-0 { min-width: 0; }
.cb-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.cb-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ml-1 { margin-left: 0.35rem; }
.cb-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
.cb-main, .cb-side { min-width: 0; }
.cb-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.cb-section-head h2 { font-size: 1rem; margin: 0; }
.cb-hero .card-body { padding: 1.75rem; }
.cb-hero-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cb-hero h2 { font-size: 1.25rem; margin: 0 0 0.25rem; }
.cb-hero p { margin: 0; max-width: 34rem; }
.cb-alert { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

.cb-sys-list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.cb-sys .card-body { display: flex; flex-direction: column; gap: 0.6rem; }
.cb-sys-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.cb-sys-title { display: block; font-weight: 600; font-size: 1rem; color: var(--text); text-decoration: none; }
.cb-sys-title:hover { color: var(--accent); }
.cb-sys-term { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8438rem; }
.cb-days { font-weight: 600; }
.cb-days.is-ok { color: var(--text-muted); }
.cb-days.is-warn { color: var(--warning); }
.cb-days.is-bad { color: var(--danger); }
.cb-bar { height: 0.3rem; border-radius: 1rem; background: var(--gray-soft); overflow: hidden; }
.cb-bar span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.cb-bar.is-warn span { background: var(--warning); }
.cb-bar.is-bad span { background: var(--danger); width: 100% !important; }
.cb-sys-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
               border-top: 0.0625rem solid var(--border-soft); padding-top: 0.6rem; }
.cb-sys-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.cb-line { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
           padding: 0.55rem 0; color: inherit; text-decoration: none; }
.cb-line + .cb-line { border-top: 0.0625rem solid var(--border-soft); }
.cb-line > .min-w-0 { display: grid; }
.cb-line:hover .strong { color: var(--accent); }
.cb-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent);
          margin-right: 0.35rem; vertical-align: middle; }

.cb-facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.cb-value-sm { font-size: 1.05rem; }
.cb-open { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
           margin-top: 1rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm); background: var(--gray-soft); }
.cb-open .min-w-0 { display: grid; }
.cb-secret { border: 0.0625rem solid var(--success); background: var(--success-soft); }
.cb-cred { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.cb-cred > div { display: grid; background: var(--card); border-radius: var(--radius-sm); padding: 0.5rem 0.7rem; min-width: 0; overflow-wrap: anywhere; }
.cb-cred [data-copy] { cursor: copy; }

.cb-periods { display: grid; gap: 0.4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cb-period { position: relative; cursor: pointer; }
.cb-period input { position: absolute; opacity: 0; pointer-events: none; }
.cb-period-box { display: grid; gap: 0.1rem; justify-items: start; padding: 0.55rem 0.65rem; height: 100%;
                 border: 0.0625rem solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s, background .15s; }
.cb-period-price { font-size: 0.8125rem; color: var(--text-muted); }
.cb-period input:checked + .cb-period-box { border-color: var(--accent); background: var(--accent-soft); }
.cb-period input:focus-visible + .cb-period-box { outline: 0.125rem solid var(--accent); outline-offset: 0.0625rem; }

.cb-sys-mini { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.cb-mini { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.9rem;
           color: inherit; text-decoration: none; }
.cb-mini > .min-w-0 { display: grid; }
.cb-mini:hover { box-shadow: var(--shadow); }

.cb-inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.cb-inv-sum { font-size: 2rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cb-h3 { font-size: 0.9375rem; margin: 1.25rem 0 0.4rem; }
.cb-invoice .detail-row .v { overflow-wrap: anywhere; text-align: right; }

.cb-tickets { display: grid; }
.cb-ticket { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
             padding: 0.75rem 1rem; color: inherit; text-decoration: none; }
.cb-ticket + .cb-ticket { border-top: 0.0625rem solid var(--border-soft); }
.cb-ticket > .min-w-0 { display: grid; }
.cb-ticket:hover { background: var(--gray-soft); }
.cb-ticket-subj { font-weight: 600; }
.cb-ticket.is-unread .cb-ticket-subj { color: var(--accent); }

@media (max-width: 62rem) {
    .cb-grid { grid-template-columns: 1fr; }
}
/* Вкладки уходят отдельной строкой, пока в одну строку с именем и «Выйти» не помещаются. */
@media (max-width: 70rem) {
    .pt-head-in { gap: 0.5rem; }
    .pt-nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .pt-nav::-webkit-scrollbar { display: none; }
    .pt-tab { flex: none; }
    .pt-head-in > .btn { margin-left: auto; }
}
@media (max-width: 40rem) {
    .cb-sys-list { grid-template-columns: 1fr; }
    .cb-inv-sum { font-size: 1.6rem; }
    .cb-table th:nth-child(4), .cb-table td:nth-child(4) { display: none; }
}
@media print {
    .pt-head, .cb-side { display: none !important; }
    .cb-grid { display: block; }
}
.cb-discounts { display: grid; gap: 0.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Адрес системы: схема и основной домен вокруг поля поддомена. */
.cb-sub { display: flex; align-items: stretch; border: 0.0625rem solid var(--border); border-radius: var(--radius-sm);
          background: var(--card); overflow: hidden; }
.cb-sub:focus-within { border-color: var(--accent); box-shadow: 0 0 0 0.1875rem var(--accent-soft); }
.cb-sub .form-control { border: 0; box-shadow: none !important; border-radius: 0; min-width: 0; flex: 1 1 8rem;
                        font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.cb-sub-scheme, .cb-sub-base { display: flex; align-items: center; padding: 0 0.6rem; background: var(--gray-soft);
                               color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap;
                               font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.cb-plans { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.cb-plan .cb-period-box { gap: 0.25rem; }
.cb-plan-price { font-size: 1.1rem; font-weight: 600; }
.cb-plan-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.cb-steps { margin: 0 0 1rem; padding-left: 1.1rem; display: grid; gap: 0.4rem; line-height: 1.5; font-size: 0.875rem; }
.dp-hosted { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: start; }
@media (max-width: 30rem) {
    .cb-sub-scheme { display: none; }
}
.form-hint.text-success { color: var(--success); }
.form-hint.text-danger { color: var(--danger); }

/* ---------------------------------------------------------- Боковые вкладки
   Используются на экране «Сайт»: слева список разделов, справа содержимое. */
.side-tabs { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.side-tabs-nav {
    display: flex; flex-direction: column; gap: .15rem;
    position: sticky; top: calc(var(--header-h) + 1rem);
    max-height: calc(100dvh - var(--header-h) - 2rem); overflow-y: auto;
    background: var(--card); border: .0625rem solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem;
}
.side-tabs-body { min-width: 0; }
.side-tab {
    display: flex; align-items: center; gap: .55rem; width: 100%;
    padding: .6rem .75rem; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--text); font: inherit; font-weight: 600;
    text-align: left; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.side-tab:hover { background: var(--gray-soft); }
.side-tab.active { background: var(--accent-soft); color: var(--accent); }
.side-tab .icon { flex: none; }
.side-tab-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 60rem) {
    .side-tabs { grid-template-columns: 1fr; gap: .75rem; }
    .side-tabs-nav { flex-direction: row; position: static; overflow-x: auto; gap: .25rem; }
    .side-tab { width: auto; flex: none; padding: .5rem .7rem; }
}