:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-2: #f6f7f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --line: #e2e8f0;
    --sidebar: #111827;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #ffffff;
    --app-sidebar-width: 228px;
    --app-sidebar-collapsed-width: 64px;
    --app-shell-min-width: 1120px;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef2ff;
    --ps-row-open-bg: #e6e4fb;
    /* Фирменный цвет Сибтел-Крипто */
    --sk-brand: #364761;
    --sk-brand-hover: #2c3a4f;
    --sk-brand-soft: rgba(54, 71, 97, 0.14);
    --success: #059669;
    --success-soft: #ecfdf5;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning-soft: #fff7ed;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --input-bg: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(226, 232, 240, 0.9);
    --login-card-bg: rgba(255, 255, 255, 0.95);
    --card-head-bg: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    --body-gradient-a: rgba(79, 70, 229, 0.12);
    --body-gradient-b: rgba(14, 165, 233, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    overflow-x: auto;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--body-gradient-a), transparent 28%),
        radial-gradient(circle at top right, var(--body-gradient-b), transparent 24%),
        var(--bg);
    min-width: var(--app-shell-min-width);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

.app-shell {
    display: grid;
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    min-width: var(--app-shell-min-width);
    width: 100%;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--app-sidebar-width);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
    z-index: 40;
    transition: width 0.18s ease, padding 0.18s ease;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 6px;
    flex-shrink: 0;
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.15s ease;
    position: relative;
    z-index: 2;
}

.app-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-sidebar-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-sidebar-footer {
    flex-shrink: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}

a.app-brand:hover {
    background: rgba(255, 255, 255, 0.06);
}

.app-brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
}

.app-brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-brand-copy strong {
    display: block;
    color: #fff;
    font-size: 0.88rem;
}

.app-brand-copy span {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    color: #94a3b8;
}

.app-sidebar-user-icon {
    display: none;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.app-sidebar-user-icon .las {
    font-size: 1.1rem;
    line-height: 1;
}

.app-nav {
    display: grid;
    gap: 6px;
    flex-shrink: 0;
}

.app-nav-main {
    margin-bottom: 4px;
}

.app-nav-divider {
    height: 1px;
    margin: 14px 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.app-nav-admin {
    margin-bottom: 4px;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--sidebar-text);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-nav a.is-active {
    background: rgba(99, 102, 241, 0.18);
    color: var(--sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.25);
}

.app-nav-icon {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    color: #94a3b8;
}

.app-nav-icon .las {
    font-size: 1.42rem;
    line-height: 1;
}

.app-nav-icon-mark {
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    filter: invert(72%) sepia(19%) saturate(415%) hue-rotate(174deg) brightness(88%) contrast(85%);
}

.app-nav a:hover .app-nav-icon,
.app-nav a.is-active .app-nav-icon,
.app-nav-trigger:hover .app-nav-icon,
.app-nav-trigger.is-active .app-nav-icon {
    color: currentColor;
}

.app-nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.app-nav-badge--hot {
    background: #ef4444;
    color: #fff;
    font-weight: 600;
}

.app-nav-label {
    flex: 1 1 auto;
    min-width: 0;
}

.app-nav a.is-active .app-nav-badge {
    background: #fff;
    color: #4338ca;
    font-weight: 600;
}

.app-nav a.is-active .app-nav-badge--hot {
    background: #ef4444;
    color: #fff;
}

.app-sidebar-user {
    position: relative;
    flex-shrink: 0;
    margin-top: 4px;
}

.app-sidebar-user-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    padding: 10px 10px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.app-sidebar-user-trigger:hover {
    background: rgba(255, 255, 255, 0.09);
}

.app-sidebar-user-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-sidebar-user-code {
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.app-sidebar-user-name {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar-user-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(226, 232, 240, 0.65);
    border-bottom: 2px solid rgba(226, 232, 240, 0.65);
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.app-sidebar-user-trigger[aria-expanded="true"] .app-sidebar-user-chevron {
    transform: rotate(225deg) translateY(2px);
}

/* Узкий сайдбар: только иконки, подписи скрыты */
@media (max-width: 1600px) {
    :root {
        --app-sidebar-width: var(--app-sidebar-collapsed-width);
    }

    .app-sidebar {
        padding: 16px 8px;
        align-items: stretch;
    }

    .app-brand {
        justify-content: center;
        padding: 4px 0;
        margin-bottom: 14px;
        gap: 0;
    }

    .app-brand-copy {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .app-nav a,
    .app-nav-trigger {
        justify-content: center;
        gap: 0;
        padding: 10px 0;
        position: relative;
    }

    .app-nav-label,
    .app-nav a > span:not(.app-nav-icon):not(.app-nav-badge):not(.app-nav-sublabel):not(.app-nav-subicon),
    .app-nav-trigger > span:not(.app-nav-icon) {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .app-nav-icon {
        width: auto;
        flex: 0 0 auto;
    }

    .app-nav-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        margin-left: 0;
        min-width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 999px;
        font-size: 0;
        line-height: 0;
        background: #818cf8;
        color: transparent;
        box-shadow: 0 0 0 2px #111827;
    }

    .app-nav a.is-active .app-nav-badge {
        background: #a5b4fc;
        color: transparent;
    }

    .app-nav-badge--hot,
    .app-nav a.is-active .app-nav-badge--hot {
        background: #ef4444;
        color: transparent;
    }

    .app-nav-divider {
        margin: 10px 6px 8px;
    }

    .app-sidebar-footer {
        margin-top: 6px;
        padding-top: 6px;
    }

    .app-sidebar-user {
        padding-top: 0;
        z-index: 60;
    }

    .app-sidebar-user-trigger {
        position: relative;
        justify-content: center;
        padding: 8px 0;
        gap: 0;
    }

    .app-sidebar-user-icon {
        display: inline-flex;
    }

    .app-sidebar-user-lines,
    .app-sidebar-user-chevron {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .app-user-dropdown {
        left: calc(100% + 8px);
        right: auto;
        bottom: 0;
        width: 220px;
    }

    /* Мгновенные подписи справа от иконок */
    .app-brand[data-nav-tip]::before,
    .app-nav a[data-nav-tip]::before,
    .app-nav-trigger[data-nav-tip]::before,
    .app-sidebar-user-trigger[data-nav-tip]::before {
        content: "";
        position: absolute;
        left: calc(100% + 6px);
        top: 50%;
        z-index: 101;
        width: 0;
        height: 0;
        border: 5px solid transparent;
        border-right-color: #1e293b;
        transform: translateY(-50%) translateX(-2px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
    }

    .app-brand[data-nav-tip]::after,
    .app-nav a[data-nav-tip]::after,
    .app-nav-trigger[data-nav-tip]::after,
    .app-sidebar-user-trigger[data-nav-tip]::after {
        content: attr(data-nav-tip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        z-index: 100;
        padding: 7px 11px;
        border-radius: 8px;
        background: #1e293b;
        color: #f8fafc;
        font-size: 0.8rem;
        font-weight: 500;
        line-height: 1.3;
        letter-spacing: 0.01em;
        white-space: nowrap;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
        transform: translateY(-50%) translateX(-4px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
    }

    .app-brand[data-nav-tip]:hover::before,
    .app-brand[data-nav-tip]:focus-visible::before,
    .app-nav a[data-nav-tip]:hover::before,
    .app-nav a[data-nav-tip]:focus-visible::before,
    .app-nav-trigger[data-nav-tip]:hover::before,
    .app-nav-trigger[data-nav-tip]:focus-visible::before,
    .app-sidebar-user-trigger[data-nav-tip]:hover::before,
    .app-sidebar-user-trigger[data-nav-tip]:focus-visible::before,
    .app-brand[data-nav-tip]:hover::after,
    .app-brand[data-nav-tip]:focus-visible::after,
    .app-nav a[data-nav-tip]:hover::after,
    .app-nav a[data-nav-tip]:focus-visible::after,
    .app-nav-trigger[data-nav-tip]:hover::after,
    .app-nav-trigger[data-nav-tip]:focus-visible::after,
    .app-sidebar-user-trigger[data-nav-tip]:hover::after,
    .app-sidebar-user-trigger[data-nav-tip]:focus-visible::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }

    .app-sidebar-user-trigger[aria-expanded="true"][data-nav-tip]::before,
    .app-sidebar-user-trigger[aria-expanded="true"][data-nav-tip]::after {
        opacity: 0;
        visibility: hidden;
    }
}

.app-user-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    padding: 6px;
    border-radius: 12px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    z-index: 50;
}

.app-user-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
}

.app-user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-user-dropdown-link {
    text-decoration: none;
    color: #e2e8f0;
}

/* Лочим скролл на html, не на body: overflow у body делает его контейнером
   для sticky, и левое меню спрыгивает вверх вместе со страницей. */
html:has(body.app-drawer-open),
html:has(body.app-global-search-open),
html:has(body.app-kontur-resources-open) {
    overflow-y: hidden;
}

.app-drawer {
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    visibility: hidden;
}

.app-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.app-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-drawer.is-open .app-drawer-backdrop {
    opacity: 1;
}

.app-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(420px, 100%);
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
}

.app-drawer.is-open .app-drawer-panel {
    transform: translateX(0);
}

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.app-drawer-title {
    margin: 0;
    font-size: 1.15rem;
}

.app-drawer-close {
    border: none;
    background: var(--surface-muted);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.app-drawer-close:hover {
    color: var(--text);
    background: var(--line);
}

.app-drawer-close:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.app-drawer-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
}

.app-drawer-panel--ps {
    width: min(896px, calc((100vw - 16px) * 0.8));
    max-width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Карточка ПП: список слева остаётся кликабельным (без модального оверлея). */
.app-drawer--ps.is-open:not(.app-drawer--ps-modal) {
    pointer-events: none;
}

.app-drawer--ps.is-open:not(.app-drawer--ps-modal) .app-drawer-panel {
    pointer-events: auto;
}

.app-drawer--ps.is-open:not(.app-drawer--ps-modal) .app-drawer-backdrop {
    opacity: 0;
    pointer-events: none;
}

.app-drawer-panel--ps-create {
    width: min(720px, calc(100vw - 16px));
}

.app-drawer-panel--ps-excel {
    width: min(920px, calc(100vw - 16px));
}

.app-drawer-body--ps {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.app-drawer-panel--clients-contact {
    width: min(720px, calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    padding: 0;
}

.app-drawer-panel--clients-requisites {
    width: min(900px, calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.clients-requisites-drawer {
    flex: 1 1 auto;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #eef1f6;
}

.clients-requisites-drawer-head {
    flex-shrink: 0;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
}

.clients-requisites-drawer-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.clients-requisites-drawer-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.clients-requisites-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clients-requisites-section {
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    flex: 0 0 auto;
}

.clients-requisites-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}

.clients-requisites-section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.clients-requisites-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}

.clients-requisites-section-toggle i {
    color: var(--text-muted);
    font-size: 0.78rem;
    transition: transform 0.18s ease;
}

.clients-requisites-section.is-open .clients-requisites-section-toggle i {
    transform: rotate(180deg);
}

.clients-requisites-section-body {
    display: none;
    padding: 0 18px 18px;
    flex-direction: column;
    gap: 2px;
}

.clients-requisites-section.is-open .clients-requisites-section-body {
    display: flex;
}

.clients-requisites-org-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 4px;
}

.clients-requisites-org-field {
    flex: 1 1 auto;
    min-width: 0;
}

.clients-requisites-dadata-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid rgba(79, 70, 229, 0.22);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 14px;
    min-height: 40px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1);
    margin-bottom: 8px;
    text-decoration: none;
}

.clients-requisites-dadata-btn:hover {
    color: var(--accent-hover);
    background: #e0e7ff;
    text-decoration: none;
}

.clients-requisites-dadata-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.clients-requisites-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.clients-requisites-textarea {
    resize: vertical;
    min-height: 64px;
    line-height: 1.4;
}

.clients-requisites-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 12px;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.clients-requisites-bank-field {
    position: relative;
}

.clients-requisites-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow: auto;
}

.clients-requisites-suggest-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.clients-requisites-suggest-item:hover,
.clients-requisites-suggest-item.is-active {
    background: rgba(13, 148, 136, 0.12);
}

.clients-requisites-suggest-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.clients-requisites-suggest-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.clients-requisites-bank-hint {
    margin: 10px 0 0;
    font-size: 0.84rem;
}

.clients-requisites-dadata-diff {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.22);
    font-size: 0.86rem;
    color: var(--text);
}

.clients-requisites-dadata-diff-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.clients-requisites-dadata-diff-list {
    margin: 0;
    padding-left: 18px;
}

.clients-requisites-dadata-diff-list li + li {
    margin-top: 4px;
}

.clients-requisites-preamble-label {
    margin: 16px 0 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.clients-requisites-preamble {
    margin-top: 0;
    padding: 14px 14px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    line-height: 1.85;
    font-size: 0.94rem;
    color: var(--text);
}

.clients-requisites-preamble-select-wrap {
    display: inline-block;
    vertical-align: baseline;
}

.clients-requisites-preamble-select,
.clients-requisites-preamble-input {
    display: inline-block;
    vertical-align: baseline;
    font: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px 9px;
    margin: 2px 2px;
    max-width: 100%;
}

.clients-requisites-preamble-select {
    cursor: pointer;
}

.clients-requisites-preamble-input {
    min-width: 160px;
    width: 180px;
}

.clients-requisites-preamble-input--wide {
    min-width: 220px;
    width: min(280px, 100%);
}

.clients-requisites-preamble-input--basis {
    min-width: 200px;
    width: min(260px, 100%);
}

.clients-requisites-preamble-select:focus,
.clients-requisites-preamble-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.clients-requisites-preamble-preview {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #e8edf5;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.clients-requisites-drawer-error {
    margin-top: 4px;
}

.clients-requisites-drawer-footer {
    flex-shrink: 0;
    justify-content: flex-start;
    padding-left: 22px;
    padding-right: 22px;
    background: var(--surface);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.clients-requisites-drawer-footer .clients-requisites-drawer-submit {
    min-width: 140px;
}

.ps-create-form .ps-float-input[readonly],
.ps-create-form .ps-float-input:disabled {
    color: var(--text-muted);
    border-bottom-style: dashed;
    cursor: default;
}

@media (max-width: 640px) {
    .clients-requisites-pair {
        grid-template-columns: 1fr;
    }

    .clients-requisites-org-row {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-requisites-dadata-btn {
        width: 100%;
        margin-bottom: 4px;
    }
}

.clients-contact-drawer {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.clients-contact-drawer-head {
    flex-shrink: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clients-contact-drawer-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.clients-contact-drawer-form {
    flex: 1;
    min-height: 0;
}

.clients-contact-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 8px 44px;
}

.clients-contact-drawer-fields {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clients-contact-channel-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.clients-contact-channel-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.clients-contact-channel-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.clients-contact-channel-row .ps-float-field {
    flex: 1;
    min-width: 0;
}

.clients-contact-channel-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: 18px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.clients-contact-channel-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.clients-contact-channel-add {
    margin: 0 0 10px;
}

.clients-contact-parser-add-channel {
    grid-column: 1 / -1;
    justify-self: start;
    margin: 0 0 4px;
}

.clients-contact-drawer-products {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.clients-contact-drawer-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.clients-contact-drawer-products-title {
    margin: 0;
}

.clients-contact-product-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.clients-contact-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
}

.clients-contact-product-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 0;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.clients-contact-product-item input {
    flex-shrink: 0;
}

.clients-contact-product-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.clients-contact-product-icon--empty {
    display: inline-block;
    background: #e2e8f0;
}

.clients-contact-product-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clients-contact-drawer-products-empty {
    margin: 16px 0 0;
    font-size: 0.92rem;
}

.clients-contact-drawer-error {
    margin-top: 12px;
}

.clients-contact-drawer-footer {
    justify-content: flex-start;
    padding-left: 20px;
}

.clients-contact-drawer-footer .clients-contact-drawer-submit {
    min-width: 140px;
}

@media (max-width: 640px) {
    .clients-contact-drawer-body {
        padding-left: 20px;
    }

    .clients-contact-products-grid {
        grid-template-columns: 1fr;
    }
}

.app-drawer-panel--clients-contact-parser {
    width: min(calc(100vw - 12px), 1400px);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.clients-contact-parser {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.clients-contact-parser-head {
    flex-shrink: 0;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.clients-contact-parser-title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.clients-contact-parser-subtitle {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 720px;
}

.clients-contact-parser-step {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
}

.clients-contact-parser-step.is-active {
    display: flex;
}

.clients-contact-parser-source-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 18px 22px 12px;
    gap: 8px;
}

.clients-contact-parser-input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.clients-contact-parser-textarea {
    flex: 1;
    min-height: 280px;
    width: 100%;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font: inherit;
    line-height: 1.45;
    color: var(--text);
    background: var(--surface-muted);
}

.clients-contact-parser-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.clients-contact-parser-input-actions {
    flex-shrink: 0;
    padding: 0 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.clients-contact-parser-toolbar {
    flex-shrink: 0;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.clients-contact-parser-toolbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clients-contact-parser-result-error {
    margin: 12px 22px 0;
}

.clients-contact-parser-split {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 0;
    overflow: hidden;
}

.clients-contact-parser-col {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.clients-contact-parser-col--contacts {
    border-right: 1px solid var(--line);
}

.clients-contact-parser-col-title {
    margin: 0;
    padding: 14px 18px 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.clients-contact-parser-lines-hint {
    margin: 0;
    padding: 0 18px 10px;
    font-size: 0.85rem;
}

.clients-contact-parser-contacts,
.clients-contact-parser-lines {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 18px 18px;
}

.clients-contact-parser-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clients-contact-parser-contacts-footer {
    flex-shrink: 0;
    padding: 0 18px 14px;
}

.clients-contact-parser-contacts-footer .app-button-secondary {
    width: 100%;
}

.clients-contact-parser-empty {
    margin: 0 18px 18px;
}

.clients-contact-parser-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 12px 14px;
}

.clients-contact-parser-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.clients-contact-parser-card-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    min-width: 0;
}

.clients-contact-parser-card-delete {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.clients-contact-parser-card-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.clients-contact-parser-card-delete i {
    font-size: 0.82rem;
}

.clients-contact-parser-card-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.clients-contact-parser-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    border-radius: 8px;
    padding: 4px;
    margin: -4px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.clients-contact-parser-field.is-drag-over {
    background: rgba(37, 99, 235, 0.06);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.clients-contact-parser-field.is-drag-over .clients-contact-parser-field-label {
    color: var(--accent);
}

.clients-contact-parser-field:has(textarea) {
    grid-column: 1 / -1;
}

.clients-contact-parser-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.clients-contact-parser-field-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.clients-contact-parser-field-wrap .clients-contact-parser-drop {
    width: 100%;
    padding-right: 34px;
}

.clients-contact-parser-field-wrap--textarea .clients-contact-parser-drop {
    padding-right: 34px;
    min-height: 64px;
}

.clients-contact-parser-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.clients-contact-parser-field-wrap--textarea .clients-contact-parser-clear {
    top: 8px;
    transform: none;
}

.clients-contact-parser-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}

.clients-contact-parser-clear i {
    font-size: 0.72rem;
}

.clients-contact-parser-drop {
    width: 100%;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.clients-contact-parser-drop.is-drag-over,
.clients-contact-parser-field.is-drag-over .clients-contact-parser-drop {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.06);
}

.clients-contact-parser-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clients-contact-parser-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    cursor: grab;
    font: inherit;
    color: var(--text);
}

.clients-contact-parser-chip.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.clients-contact-parser-chip-kind {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.clients-contact-parser-chip-text {
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
}

.clients-contact-parser-chip--phone .clients-contact-parser-chip-kind { color: #0f766e; }

.clients-contact-parser-chip--email .clients-contact-parser-chip-kind { color: #1d4ed8; }

.clients-contact-parser-chip--name .clients-contact-parser-chip-kind { color: #7c3aed; }

.clients-contact-parser-chip--position .clients-contact-parser-chip-kind { color: #b45309; }

.clients-contact-parser-chip--noise .clients-contact-parser-chip-kind { color: #94a3b8; }

@media (max-width: 960px) {
    .clients-contact-parser-split {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .clients-contact-parser-col--contacts {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .clients-contact-parser-card-fields {
        grid-template-columns: 1fr;
    }
}

.ps-drawer-loading {
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Карточка ПП (drawer + полная страница) */
.ps-detail-page {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ps-shell {
    --ps-aside-w: 220px;
    height: 100%;
    min-height: 0;
    background: var(--surface);
    overflow: hidden;
}

.ps-shell-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ps-aside-w);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.ps-shell-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px 0;
    border-right: 1px solid var(--line);
}

.ps-shell-header {
    flex-shrink: 0;
}

.ps-shell-aside {
    background: #f8fafc;
    padding: 12px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

.ps-shell-aside--refused {
    background: #fef2f2;
}

.ps-shell-aside--online {
    background: #f5f3ff;
}

.ps-shell-aside--completed {
    background: #ecfdf5;
}

.ps-shell-aside-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ps-shell-aside-status__label {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ps-shell-aside-status__text,
.ps-shell-aside-status__manager {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.ps-shell-aside-status__text {
    font-weight: 400;
}

.ps-shell-aside-status__text--emph {
    font-weight: 600;
}

.ps-shell-aside-status__text--pre {
    white-space: pre-wrap;
}

.ps-shell-aside-status__manager {
    font-weight: 600;
    color: var(--text);
}

.ps-shell-aside-status--refused .ps-shell-aside-status__label {
    color: #991b1b;
}

.ps-shell-aside-status--refused .ps-shell-aside-status__text {
    color: #991b1b;
}

.ps-shell-aside-status--refused .ps-shell-aside-status__text--emph {
    color: #7f1d1d;
}

.ps-shell-aside-status--online .ps-shell-aside-status__label {
    color: #5b21b6;
}

.ps-shell-aside-status--online .ps-shell-aside-status__text {
    color: #4c1d95;
}

.ps-shell-aside-status--completed .ps-shell-aside-status__label {
    color: #047857;
}

.ps-shell-aside-status__actions {
    margin-top: 10px;
}

.ps-shell-aside-head {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    margin: 0 0 2px;
}

.ps-shell-aside-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-date-anchor-wrap {
    position: relative;
    z-index: 1;
}

.ps-date-anchor-wrap:has(.ps-date-popover:not([hidden])),
.ps-date-anchor-wrap:has(.ps-mgr-popover:not([hidden])),
.ps-date-anchor-wrap:has(.ps-bill-popover:not([hidden])),
.ps-date-anchor-wrap:has(.ps-ext-popover:not([hidden])),
.ps-date-anchor-wrap:has(.ps-refuse-popover:not([hidden])),
.ps-date-anchor-wrap:has(.ps-comment-popover:not([hidden])),
.ps-comment-edit-anchor:has(.ps-comment-popover:not([hidden])) {
    z-index: 30;
}

.ps-shell-aside-top {
    flex-shrink: 0;
}

.ps-shell-aside-back {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent);
}

.ps-shell-aside-user {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.ps-shell-actions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-size: 0.86rem;
}

.ps-shell-actions-block {
    margin: 15px 0;
}

.ps-shell-action--extra-top-margin {
    margin-top: 10px;
}

.ps-shell-action {
    display: block;
    color: var(--text);
    cursor: default;
}

.ps-shell-action--disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.ps-shell-action--muted {
    color: #94a3b8;
}

.ps-shell-action--clickable:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.ps-shell-action--clickable:disabled:hover {
    color: #94a3b8;
}

.ps-shell-action--clickable {
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ps-shell-action--clickable:hover,
.ps-shell-action--clickable[aria-expanded="true"] {
    color: var(--accent);
}

.ps-shell-action--info {
    font-weight: 600;
}

.ps-shell-action--suggest {
    font-weight: 700;
}

.ps-shell-action--reservation-expired {
    color: #b91c1c;
}

.ps-shell-aside-foot {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-shell-aside-foot-btn,
.ps-shell-aside-foot-link {
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.ps-shell-aside-foot-btn:hover,
.ps-shell-aside-foot-link:hover {
    text-decoration: underline;
}

.ps-shell-aside-foot-btn:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: none;
}

.ps-shell-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.ps-shell-meta-sep {
    color: #cbd5e1;
}

.ps-shell-meta-type {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1.25;
}

.ps-shell-meta-channel {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.ps-shell-meta-channel--online {
    color: #5b21b6;
}

.ps-shell-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    line-height: 1.25;
    vertical-align: middle;
}

.ps-shell-meta-item--online-until {
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
}

.ps-shell-meta-cal-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ps-shell-meta-cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    padding: 2px 4px;
    margin: -2px -4px;
    font: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1.25;
}

.ps-shell-meta-cal-btn:hover,
.ps-shell-meta-cal-btn[aria-expanded="true"] {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.ps-shell-meta-cal-btn i,
.ps-shell-meta-chan i {
    flex-shrink: 0;
    opacity: 0.85;
}

.ps-shell-meta-call-reminder {
    display: none;
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1;
    color: #f59e0b;
    opacity: 1;
}

.ps-shell-meta-call-reminder.is-active {
    display: inline-block;
}

.ps-shell-meta-cal-wrap .ps-shell-meta-call-reminder {
    margin-left: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ps-date-popover {
    position: absolute;
    z-index: 120;
    width: min(272px, calc(100vw - 32px));
    padding: 14px 14px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    overflow: visible;
}

.ps-date-popover--header {
    top: calc(100% + 8px);
    left: 0;
}

.ps-date-popover--aside {
    top: 0;
    right: calc(100% + 10px);
    left: auto;
    transform: none;
}

.ps-date-popover--header::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-date-popover--aside::before {
    content: "";
    position: absolute;
    top: 12px;
    right: -7px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-date-popover--tab {
    top: 0;
    left: calc(100% + 10px);
    right: auto;
    transform: none;
}

.ps-date-popover--tab::before {
    content: "";
    position: absolute;
    top: 12px;
    left: -7px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-tab-refuse-wrap {
    display: inline-block;
}

.ps-tab-bill-wrap {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.ps-tab-bill-wrap:has(.ps-bill-popover:not([hidden])) {
    z-index: 30;
}

.ps-bills-link-row {
    margin: 12px 0 0;
}

.ps-bills-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    text-align: left;
}

.ps-bills-link-btn:hover {
    color: var(--accent-hover);
}

.ps-mgr-popover {
    z-index: 150;
    width: min(450px, calc(100vw - 32px));
    padding-top: 12px;
}

.ps-bill-popover {
    z-index: 150;
    width: min(450px, calc(100vw - 32px));
    padding-top: 12px;
}

.ps-ext-popover {
    z-index: 150;
    width: min(450px, calc(100vw - 32px));
    padding-top: 12px;
}

.ps-ext-popover-title {
    margin: 0 0 12px;
    padding-right: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.ps-ext-status {
    margin: 0 0 12px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text);
}

.ps-ext-status--ok {
    color: #15803d;
    font-weight: 600;
}

.ps-ext-status--deny {
    color: #b91c1c;
    font-weight: 600;
}

.ps-ext-status--pending {
    color: var(--text-muted);
}

.ps-ext-limits {
    margin: 0 0 10px;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.ps-ext-limits[hidden] {
    display: none;
}

.ps-bill-popover-title {
    margin: 0 0 12px;
    padding-right: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.ps-bill-field {
    display: block;
    margin-bottom: 10px;
}

.ps-bill-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: #fff;
}

.ps-bill-input:hover,
.ps-bill-input:focus {
    border-color: #b91c1c;
    outline: none;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ps-bill-popover--suggest {
    width: min(620px, calc(100vw - 32px));
}

.ps-bill-popover.ps-date-popover--tab {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
}

.ps-bill-popover.ps-date-popover--tab::before {
    top: -7px;
    left: var(--ps-bill-arrow-left, 24px);
    right: auto;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-bill-suggest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0 18px;
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
}

.ps-bill-suggest-row {
    display: grid;
    grid-template-columns: 16px minmax(4.2em, max-content) minmax(5.4em, max-content) minmax(5.4em, max-content) minmax(0, 1fr);
    column-gap: 10px;
    margin: 0;
    padding: 1px 0;
    border: none;
    background: none;
    cursor: pointer;
    user-select: none;
}

.ps-bill-suggest-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    overflow: hidden;
}

.ps-bill-suggest-check .ps-list-check-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.ps-bill-suggest-check .ps-list-row-check-input:checked + .ps-list-check-box::after {
    left: 3.5px;
    top: 0;
    width: 4px;
    height: 8px;
}

.ps-bill-suggest-number {
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
}

.ps-bill-suggest-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ps-bill-suggest-stack-primary {
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #15803d;
    white-space: nowrap;
}

.ps-bill-suggest-stack-secondary {
    font-size: 0.68rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    white-space: nowrap;
}

.ps-bill-suggest-package {
    min-width: 0;
    font-size: 0.68rem;
    line-height: 1.25;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-refuse-popover {
    z-index: 150;
    width: min(450px, calc(100vw - 32px));
    padding-top: 12px;
}

.ps-refuse-field {
    display: block;
    margin-bottom: 10px;
}

.ps-refuse-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 32px 8px 10px;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
}

.ps-refuse-select:hover,
.ps-refuse-select:focus {
    border-color: #b91c1c;
    outline: none;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ps-refuse-select:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background-color: #f8fafc;
}

.ps-refuse-comment {
    width: 100%;
    box-sizing: border-box;
    min-height: 88px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text);
    background: #fff;
}

.ps-refuse-comment::placeholder {
    color: #94a3b8;
}

.ps-refuse-comment:hover,
.ps-refuse-comment:focus {
    border-color: #b91c1c;
    outline: none;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ps-mgr-search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.ps-mgr-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.82rem;
    pointer-events: none;
}

.ps-mgr-search-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px 8px 32px;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: #fff;
}

.ps-mgr-search-input:hover,
.ps-mgr-search-input:focus {
    border-color: #b91c1c;
    outline: none;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ps-mgr-results {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.ps-mgr-results[hidden] {
    display: none !important;
}

.ps-mgr-results-item {
    display: block;
    width: 100%;
    border: none;
    background: none;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.84rem;
    line-height: 1.35;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    white-space: normal;
}

.ps-mgr-results-item + .ps-mgr-results-item {
    border-top: 1px solid #f1f5f9;
}

.ps-mgr-results-item:hover,
.ps-mgr-results-item.is-active {
    background: #f8fafc;
}

.ps-mgr-results-code {
    font-weight: 600;
}

.ps-mgr-results-name {
    color: var(--text-muted);
}

.ps-mgr-results-empty {
    padding: 8px 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ps-date-popover[hidden] {
    display: none !important;
}

.ps-date-popover-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.ps-date-popover-close:hover {
    color: var(--text);
    background: #f1f5f9;
}

.ps-date-popover-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 20px;
    overflow: visible;
}

.ps-date-field {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.ps-date-field--date {
    flex: 0 0 130px;
    max-width: 130px;
}

.ps-date-field--time {
    flex: 0 0 64px;
    max-width: 64px;
}

.ps-date-input,
.ps-time-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: #fff;
}

.ps-date-field--date .ps-date-input {
    padding-right: 36px;
}

.ps-date-input:hover,
.ps-date-input:focus,
.ps-time-input:hover,
.ps-time-input:focus {
    border-color: #b91c1c;
    outline: none;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.15);
}

.ps-date-input--invalid,
.ps-date-input.ps-date-input--invalid:hover,
.ps-date-input.ps-date-input--invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18);
}

.ps-date-field-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 130;
    display: none;
    width: max-content;
    max-width: 160px;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    pointer-events: none;
    white-space: normal;
}

.ps-date-field-tooltip::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #e2e8f0;
}

.ps-date-field-tooltip::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translate(1px, -50%);
    border: 5px solid transparent;
    border-right-color: #fff;
}

.ps-date-field--date:hover .ps-date-field-tooltip,
.ps-date-field--date:focus-within .ps-date-field-tooltip {
    display: block;
}

.ps-date-popover--cal-open .ps-date-field-tooltip {
    display: none !important;
}

.ps-date-cal-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #64748b;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 6px;
}

.ps-date-cal-toggle:hover {
    color: var(--accent);
    background: #f1f5f9;
}

.ps-time-input::placeholder {
    color: #94a3b8;
}

.ps-date-picker {
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 4px 6px 8px;
    background: #fafbfc;
}

.ps-date-picker[hidden] {
    display: none !important;
}

.ps-date-picker-scroll {
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ps-date-picker-scroll::-webkit-scrollbar {
    display: none;
}

.ps-date-picker-month {
    padding: 8px 4px 12px;
}

.ps-date-picker-month + .ps-date-picker-month {
    border-top: 1px solid #e2e8f0;
}

.ps-date-picker-month-title {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.ps-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.72rem;
}

.ps-date-picker-dow {
    text-align: center;
    color: #94a3b8;
    padding: 2px 0 4px;
    font-weight: 500;
}

.ps-date-picker-dow.is-weekend {
    color: #dc2626;
}

.ps-date-picker-day {
    border: none;
    background: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    cursor: pointer;
    color: var(--text);
    font: inherit;
    font-size: 0.74rem;
    line-height: 1;
}

.ps-date-picker-day.is-other {
    color: #cbd5e1;
    pointer-events: none;
}

.ps-date-picker-day.is-weekend:not(.is-disabled):not(.is-selected) {
    color: #dc2626;
}

.ps-date-picker-day.is-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.ps-date-picker-day.is-valid:not(.is-selected) {
    background: #dcfce7;
}

.ps-date-picker-day.is-selected {
    background: #64748b;
    color: #fff;
}

.ps-date-picker-day.is-valid:hover:not(.is-selected) {
    background: #bbf7d0;
}

.ps-date-reservation {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.35;
}

.ps-date-reservation--expired {
    color: #b91c1c;
}

.ps-date-reservation--empty[hidden] {
    display: none !important;
}

.ps-date-popover-error {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #b91c1c;
    line-height: 1.35;
}

.ps-date-popover-error[hidden] {
    display: none !important;
}

.ps-date-popover-actions {
    display: flex;
    gap: 8px;
}

.ps-date-submit,
.ps-date-cancel {
    flex: 1;
    border-radius: 8px;
    padding: 9px 12px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
}

.ps-date-submit {
    border: none;
    background: #e2e8f0;
    color: #94a3b8;
}

.ps-date-submit:not(:disabled) {
    background: #334155;
    color: #fff;
}

.ps-date-submit:not(:disabled):hover {
    background: #1e293b;
}

.ps-date-cancel {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--text);
}

.ps-date-cancel:hover {
    background: #f8fafc;
}

.ps-shell-meta-product {
    flex-wrap: nowrap;
    gap: 6px;
    color: var(--text);
    font-weight: 500;
    max-width: min(300px, 100%);
}

.ps-shell-product-icon {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ps-shell-product-icon--empty {
    background: #f1f5f9;
    border-radius: 2px;
}

.ps-shell-meta-product-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: inherit;
}

.ps-shell-title-row {
    margin-bottom: 16px;
}

.ps-shell-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ps-shell-title-text {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ps-shell-title-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ps-shell-title-link:hover,
.ps-shell-title-link:focus-visible {
    color: inherit;
    text-decoration: none;
}

.ps-shell-title-temp {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    background: #94a3b8;
}

.ps-shell-title-temp--1 {
    background: #ef4444;
}

.ps-shell-title-temp--2 {
    background: #f9ad01;
}

.ps-shell-title-temp--3 {
    background: #3b82f6;
}

.ps-shell-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.ps-shell-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
}

.ps-shell-close:hover {
    color: var(--text);
    background: var(--line);
}

.ps-shell-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    border-bottom: 1px solid var(--line);
    margin: 0 -4px 0;
    padding: 0 4px;
}

.ps-shell-tab {
    border: none;
    background: none;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 2px 12px;
    cursor: pointer;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
}

.ps-shell-tab:hover {
    color: var(--text);
}

.ps-shell-tab.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.ps-shell-panels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 28px;
}

.ps-shell-panel[hidden] {
    display: none !important;
}

.ps-tab-muted {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.ps-tab-fake-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
}

.ps-tab-fake-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ps-tab-fake-link:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.ps-tab-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ps-tab-related {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ps-related-group-title {
    margin: 0 0 8px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text);
}

.ps-related-group-title-value {
    font-weight: 700;
}

.ps-related-group-list {
    margin: 0;
}

.ps-tab-contacts-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0;
}

.ps-tab-contacts .ps-tab-block,
.clients-org-contact-list.ps-tab-block,
.clients-org-links-list.ps-tab-block {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.ps-tab-contacts .ps-tab-block,
.clients-org-contact-list.ps-tab-block {
    margin: 0;
}

.clients-org-links-list.ps-tab-block {
    margin-top: 16px;
}

.ps-tab-contacts .ps-tab-block .ps-contacts-section,
.clients-org-contact-list.ps-tab-block .ps-contacts-section,
.clients-org-links-list.ps-tab-block .ps-contacts-section {
    margin-top: 0;
}

.ps-tab-details {
    margin: 12px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--surface-muted);
}

.ps-tab-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
}

.ps-partner-comments-block {
    display: flex;
    flex-direction: column;
}

.ps-partner-comments-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 4pt;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.ps-partner-comments-count {
    display: flex;
    align-items: center;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    color: inherit;
    margin: 0 0 4pt;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    text-align: left;
}

.ps-partner-comments-toggle::before {
    content: '';
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent currentColor;
    opacity: 0.75;
    transition: transform 0.35s ease;
}

.ps-partner-comments-block.is-expanded .ps-partner-comments-toggle::before {
    transform: rotate(90deg);
}

.ps-partner-comments-toggle:hover {
    color: var(--accent);
}

.ps-partner-comments-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.ps-partner-comments-block.is-expanded .ps-partner-comments-collapse {
    grid-template-rows: 1fr;
}

.ps-partner-comments-collapse-inner {
    overflow: hidden;
    min-height: 0;
}

/* Редактор комментария рисуется поверх следующих блоков, а не обрезается анимацией списка. */
.ps-partner-comments-block.is-expanded:has(.ps-comment-popover:not([hidden])) {
    position: relative;
    z-index: 20;
}

.ps-partner-comments-block.is-expanded .ps-partner-comments-collapse:has(.ps-comment-popover:not([hidden])),
.ps-partner-comments-block.is-expanded .ps-partner-comments-collapse-inner:has(.ps-comment-popover:not([hidden])) {
    overflow: visible;
}

.ps-partner-comments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ps-partner-comments-block .ps-partner-comments--older {
    margin-top: 0;
}

.ps-partner-comments-block .ps-partner-comments--latest {
    margin-top: 0;
}

.ps-partner-comment {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.ps-partner-comment--billing {
    margin: 8px 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(79, 70, 229, 0.14);
    border-top: 1px solid rgba(79, 70, 229, 0.14);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(238, 242, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 42%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(79, 70, 229, 0.04);
}

.ps-partner-comment--local {
    margin: 8px 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-top: 1px solid rgba(13, 148, 136, 0.16);
    border-left: 3px solid #0d9488;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(240, 253, 250, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(13, 148, 136, 0.05);
}

.ps-partner-comment--kontur {
    margin: 8px 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(234, 88, 12, 0.16);
    border-top: 1px solid rgba(234, 88, 12, 0.16);
    border-left: 3px solid #ea580c;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(255, 247, 237, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(234, 88, 12, 0.05);
}

.ps-partner-comment-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.ps-partner-comment-origin {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.ps-partner-comment-author {
    font-weight: 600;
}

.ps-partner-comment-tail {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ps-partner-comment-time {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ps-comment-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    border-radius: 999px;
    padding: 4px 8px;
    white-space: nowrap;
}

.ps-comment-source--billing {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(79, 70, 229, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ps-comment-source--billing i {
    font-size: 0.72rem;
    opacity: 0.9;
}

.ps-comment-source--local {
    color: #0f766e;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(13, 148, 136, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ps-comment-source--local i {
    font-size: 0.72rem;
    opacity: 0.92;
}

.ps-comment-source--kontur {
    color: #9a3412;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(234, 88, 12, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ps-comment-source--kontur i {
    font-size: 0.72rem;
    opacity: 0.92;
}

.ps-comment-partner-name {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ps-comment-partner-name::before {
    content: "·";
    margin-right: 8px;
    color: #cbd5e1;
}

.ps-partner-comment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ps-partner-comment-actions form {
    margin: 0;
}

.ps-partner-comment-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.ps-partner-comment-action:hover,
.ps-partner-comment-action:focus-visible {
    border-color: var(--line);
    background: #fff;
    color: var(--accent);
}

.ps-partner-comment-action--danger:hover,
.ps-partner-comment-action--danger:focus-visible {
    color: #b91c1c;
}

.ps-partner-comment-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ps-partner-comment-body {
    font-size: 0.88rem;
    line-height: 1.45;
}

.ps-comment-phone {
    display: inline;
    margin: 0;
    padding: 0 0.08em;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--accent, #2563eb);
    font: inherit;
    font-weight: 600;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
}

.ps-comment-phone:hover,
.ps-comment-phone:focus-visible,
.ps-comment-phone.is-open {
    background: #eef2ff;
    outline: none;
}

.ps-comment-phone-popover {
    position: fixed;
    z-index: 420;
    width: min(280px, calc(100vw - 16px));
    padding: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.ps-comment-phone-popover[hidden] {
    display: none !important;
}

.ps-comment-phone-popover-number {
    margin: 0 0 10px;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ps-comment-phone-popover .app-telephony-call-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.ps-comment-phone-popover .app-telephony-call-btn {
    width: 100%;
    justify-content: flex-start;
}

.ps-comment-phone-popover .app-telephony-call-provider {
    margin-left: auto;
}

.ps-comment-phone-popover-note,
.ps-comment-phone-popover-status,
.ps-comment-phone-popover-error {
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
}

.ps-comment-phone-popover-note {
    color: var(--text-muted, #64748b);
}

.ps-comment-phone-popover-status {
    color: #047857;
}

.ps-comment-phone-popover-error {
    color: #b91c1c;
}

.ps-comment-edit-anchor {
    position: relative;
    display: block;
}

.ps-partner-comment.is-editing,
.ps-history-item.is-editing {
    position: relative;
    z-index: 25;
}

.ps-comment-create-block {
    display: block;
    width: 100%;
}

.ps-comment-create-block[hidden] {
    display: none !important;
}

.bill-drawer-comments:has(.ps-partner-comments-block) .ps-js-ps-comment-trigger {
    display: none;
}

.ps-comment-editor--inline {
    position: static;
    z-index: auto;
    width: 100%;
    max-width: none;
    margin-top: 10px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.ps-comment-editor--inline::before {
    display: none;
}

.ps-comment-editor--inline .ps-date-popover-actions {
    justify-content: flex-start;
}

.ps-comment-editor--inline .ps-date-submit,
.ps-comment-editor--inline .ps-date-cancel {
    flex: 0 0 auto;
    min-width: 108px;
}

.ps-comment-popover {
    top: calc(100% + 8px);
    left: 0;
    width: min(420px, calc(100vw - 32px));
}

.ps-comment-edit-anchor .ps-comment-popover {
    width: min(420px, calc(100vw - 32px));
    max-width: min(420px, 100%);
}

.ps-comment-popover::before {
    content: "";
    position: absolute;
    top: -7px;
    left: var(--ps-comment-arrow-left, 24px);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-comment-popover--above {
    top: auto;
    bottom: calc(100% + 8px);
}

.ps-comment-popover--above::before {
    top: auto;
    bottom: -7px;
    border-left: none;
    border-top: none;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ps-comment-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.ps-comment-md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.ps-comment-md-btn:hover {
    border-color: #cbd5e1;
    background: #fff;
    color: var(--accent);
}

.ps-comment-editor-field {
    display: block;
    margin: 0 0 8px;
}

.ps-comment-editor-input {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    font-size: 0.86rem;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
}

.ps-comment-editor-input::placeholder {
    color: #94a3b8;
}

.ps-comment-editor-input:hover,
.ps-comment-editor-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.md-body {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.md-body > :first-child {
    margin-top: 0;
}

.md-body > :last-child {
    margin-bottom: 0;
}

.md-body p {
    margin: 0.45em 0;
}

.md-body .md-list {
    margin: 0.45em 0;
    padding-left: 1.35em;
}

.md-body .md-list li {
    margin: 0.2em 0;
}

.md-body .md-table {
    width: 100%;
    margin: 0.6em 0;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.md-body .md-table th,
.md-body .md-table td {
    border: 1px solid var(--line);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.md-body .md-table th {
    background: #f8fafc;
    font-weight: 600;
}

.md-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.md-body a:hover {
    text-decoration-thickness: 2px;
}

.md-body .md-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.5em 0;
    border-radius: 4px;
}

.ps-stage-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.ps-stage-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--line);
}

.ps-stage-item:last-child {
    border-bottom: none;
}

.ps-stage-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 10px 4px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ps-stage-row--empty {
    display: block;
    grid-template-columns: 1fr;
    color: var(--text-muted);
    cursor: default;
    padding: 10px 0;
}

.ps-stage-row:not(:disabled):hover,
.ps-stage-row:not(:disabled):focus-visible {
    background: rgba(15, 23, 42, 0.04);
    outline: none;
}

.ps-stage-row:disabled:not(.ps-stage-row--empty) {
    color: #cbd5e1;
    cursor: default;
}

.ps-stage-row:disabled .ps-stage-check {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.ps-stage-row:disabled.is-done .ps-stage-check {
    border-color: #cbd5e1;
    background: #cbd5e1;
}

.ps-stage-row:disabled .ps-stage-when {
    color: #cbd5e1;
}

.ps-stage-row.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.ps-stage-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #94a3b8;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    line-height: 1;
    color: #fff;
    pointer-events: none;
}

.ps-stage-row.is-done .ps-stage-check::before {
    content: '✓';
}

.ps-stage-row.is-done .ps-stage-check {
    border-color: var(--text);
    background: var(--text);
}

.ps-stage-name {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    justify-self: start;
    pointer-events: none;
}

.ps-stage-row.is-done .ps-stage-name {
    color: var(--text-muted);
}

.ps-stage-row.is-done .ps-stage-name::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1.5px;
    margin-top: -0.75px;
    background: currentColor;
    transform: scaleX(1);
    transform-origin: left center;
    pointer-events: none;
}

.ps-stage-row.is-striking .ps-stage-name::after {
    transform: scaleX(0);
    animation: ps-stage-strike-through 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ps-stage-strike-through {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps-stage-row.is-striking .ps-stage-name::after {
        animation: none;
        transform: scaleX(1);
    }
}

.ps-stage-when {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
}

.ps-tab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.ps-btn {
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
}

.ps-btn:disabled {
    cursor: not-allowed;
}

.ps-btn--ghost {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.ps-btn--ghost:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.ps-btn--ghost:not(:disabled):hover {
    border-color: var(--accent);
    color: var(--accent);
}

.ps-btn--outline {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.ps-btn--outline:disabled {
    color: #94a3b8;
}

.ps-bills-section {
    margin-top: 24px;
    overflow: visible;
}

.ps-bills-table-wrap {
    overflow-x: auto;
}

.ps-bills-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ps-bills-table th,
.ps-bills-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.ps-bills-table thead th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.82rem;
}

.ps-bills-table th.ps-bills-table-th-sums,
.ps-bills-table td.ps-bills-table-sums {
    text-align: right;
}

.ps-bills-table-th-sums,
.ps-bills-table-sums {
    width: 55%;
    padding-right: 10px;
}

.ps-bills-table-head-sums,
.ps-bills-table-sums-wrap {
    display: grid;
    grid-template-columns: max-content 1px minmax(5.5em, max-content);
    column-gap: 12px;
    align-items: center;
    justify-content: end;
    margin-left: auto;
    width: fit-content;
    max-width: 100%;
}

.ps-bills-table-head-sums {
    min-height: auto;
}

.ps-bills-table-th-paid,
.ps-bills-table-th-amount,
.ps-bill-sum-value--paid,
.ps-bill-sum-value--total {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
}

.ps-bills-table-head-sep {
    width: 1px;
    height: 1.15em;
    justify-self: center;
    visibility: hidden;
}

.ps-bill-sum-sep {
    width: 1px;
    height: 1.15em;
    background: #64748b;
    justify-self: center;
}

.ps-bills-table tbody tr {
    background: var(--surface-muted);
}

.ps-bills-table-th-date,
.ps-bills-table-date {
    width: 1%;
    white-space: nowrap;
    color: var(--text-muted);
}

.ps-bills-table-date {
    font-variant-numeric: tabular-nums;
}

.ps-bills-table-num {
    font-weight: 500;
}

.ps-bills-table-row--link {
    cursor: pointer;
}

.ps-bills-table-row--link:hover .ps-bills-table-num {
    color: var(--accent);
}

.ps-bills-table-sums-wrap {
    position: relative;
    min-height: 36px;
    min-width: 10rem;
}

.ps-bill-sum-value {
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.ps-bill-sum-value--paid {
    color: var(--text-muted);
    font-weight: 500;
}

.ps-bill-unlink {
    position: absolute;
    right: 0;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ps-bill-unlink-icon {
    font-size: 1.1rem;
    line-height: 1;
    color: inherit;
}

.ps-bill-unlink-text {
    line-height: 1.2;
}

.ps-bills-table-row:hover .ps-bill-unlink,
.ps-bill-unlink:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.ps-bills-table-row:hover .ps-bills-table-sums-wrap .ps-bill-sum-value {
    opacity: 0.2;
}

.ps-bill-unlink:hover,
.ps-bill-unlink:focus-visible {
    color: var(--text);
    background: var(--line);
}

.ps-bill-unlink:disabled {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.ps-summary-dl {
    margin: 0;
}

.ps-summary-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px 16px;
    padding: 10px 0;
    font-size: 0.88rem;
}

.ps-summary-row dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}

.ps-summary-row dd {
    margin: 0;
    line-height: 1.45;
}

.ps-summary-billing-link {
    margin-top: 6px;
}

.ps-summary-billing-link a {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--accent);
}

.ps-summary-billing-link a:hover {
    color: var(--accent-hover);
}

.ps-summary-brief-link {
    font-weight: 500;
    color: var(--accent);
}

.ps-summary-brief-link:hover {
    color: var(--accent-hover);
}

.ps-summary-source-comment {
    margin-top: 12px;
}

.ps-contacts-section {
    margin-top: 8px;
}

.ps-tab-contacts .ps-tab-block .ps-contacts-section-empty,
.clients-org-contact-list.ps-tab-block .ps-contacts-section-empty {
    margin-top: 4px;
}

.ps-contacts-section-empty {
    margin: 4px 0 0;
}

.ps-contacts-list {
    margin-top: 2px;
}

.ps-contacts-list .ps-org-contact-card,
.ps-contacts-list .ps-org-contact-link-card {
    list-style: none;
}

.ps-org-contact-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.ps-org-contact-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.ps-org-contact-temp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.ps-org-contact-temp-dot--1 {
    background: #ef4444;
}

.ps-org-contact-temp-dot--2 {
    background: #f9ad01;
}

.ps-org-contact-temp-dot--3 {
    background: #3b82f6;
}

.ps-org-contact-name-muted {
    color: var(--text-muted);
    font-weight: 500;
}

.ps-org-contact-product-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ps-org-contact-product-icon {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.ps-org-contact-position {
    color: var(--text-muted);
    font-weight: 500;
}

.ps-org-contact-action--transfer {
    flex-shrink: 0;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.ps-org-contact-action--transfer:hover:not(:disabled),
.ps-org-contact-action--transfer:focus-visible {
    border-color: #c5d4f5;
    background: #f8fafc;
    color: var(--accent);
}

.ps-org-contact-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.ps-org-contact-lines {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.ps-org-contact-link {
    color: var(--accent);
    text-decoration: none;
    word-break: break-word;
}

.ps-org-contact-link:hover,
.ps-org-contact-link:focus-visible {
    text-decoration: underline;
    color: var(--accent-hover);
}

.ps-org-contact-text {
    color: var(--text);
}

.ps-org-contact-comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.ps-org-contact-comment-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.72;
}

.ps-org-contact-comment-text {
    flex: 1;
    min-width: 0;
    white-space: pre-wrap;
}

.ps-org-contact-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(226, 232, 240, 0.95);
}

.ps-org-contact-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 28px;
    padding: 2px 0;
}

.ps-org-contact-link-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.ps-org-contact-link-row-icons {
    flex-shrink: 0;
}

.ps-org-contact-link-row-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 20px;
    color: var(--text);
    white-space: nowrap;
}

.ps-org-contact-link-row .ps-partner-comment-actions {
    flex-shrink: 0;
}

.js-clients-contact-link-open {
    cursor: pointer;
}

.clients-link-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
}

.clients-link-list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.clients-link-list-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.clients-link-list-back:hover,
.clients-link-list-back:focus-visible {
    color: var(--text);
    background: rgba(148, 163, 184, 0.14);
}

.clients-link-list-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.clients-link-list-comment {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.clients-link-list-comment-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    font-size: 0.88rem;
    line-height: 1;
    opacity: 0.72;
}

.clients-link-list-comment-text {
    flex: 1;
    min-width: 0;
    white-space: pre-wrap;
}

.clients-link-list-orgs {
    display: flex;
    flex-direction: column;
}

.clients-list-inn-line .clients-list-org-star {
    flex-shrink: 0;
    color: #f59e0b;
    font-size: 0.72rem;
    margin-right: 2px;
}

.ps-org-contact-card.is-muted {
    opacity: 0.72;
}

.clients-org-contacts-block .ps-contacts-section + .ps-contacts-section {
    margin-top: 14px;
}

.ps-contact-transfer-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ps-contact-transfer-btn:hover:not(:disabled) {
    border-color: #c7d2fe;
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.ps-contact-transfer-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.ps-history-day {
    background: #f1f5f9;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 16px 0 0;
}

.ps-history-day:first-child {
    margin-top: 0;
}

.ps-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ps-history-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0;
}

.ps-history-time {
    flex: 0 0 3rem;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-muted);
    text-align: right;
    padding-top: 13px;
    font-variant-numeric: tabular-nums;
}

.ps-history-card {
    flex: 1;
    min-width: 0;
}

.ps-history-item {
    font-size: 0.88rem;
}

.ps-history-item--billing {
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(79, 70, 229, 0.14);
    border-bottom: 1px solid rgba(79, 70, 229, 0.14);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(238, 242, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 42%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(79, 70, 229, 0.04);
}

.ps-history-item--local {
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-bottom: 1px solid rgba(13, 148, 136, 0.16);
    border-left: 3px solid #0d9488;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(240, 253, 250, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(13, 148, 136, 0.05);
}

.ps-history-item--kontur {
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(234, 88, 12, 0.16);
    border-bottom: 1px solid rgba(234, 88, 12, 0.16);
    border-left: 3px solid #ea580c;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(255, 247, 237, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(234, 88, 12, 0.05);
}

.ps-history-item--event {
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(100, 116, 139, 0.16);
    border-bottom: 1px solid rgba(100, 116, 139, 0.16);
    border-left: 3px solid #64748b;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(100, 116, 139, 0.05);
}

.ps-history-item--reservation {
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(2, 132, 199, 0.16);
    border-bottom: 1px solid rgba(2, 132, 199, 0.16);
    border-left: 3px solid #0284c7;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(240, 249, 255, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(2, 132, 199, 0.05);
}

.ps-history-event-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    justify-content: space-between;
}

.ps-history-event-info-btn {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
    cursor: pointer;
}

.ps-history-event-info-btn:hover {
    border-color: rgba(100, 116, 139, 0.55);
    color: var(--text);
    background: #fff;
}

.ps-history-event-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ps-history-event-title,
.ps-history-event-value {
    font-size: 0.9rem;
}

.ps-history-event-value--link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.ps-history-event-value--link:hover {
    color: var(--accent);
}

.ps-history-event-author {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.ps-history-event-body {
    margin-top: 8px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.ps-comment-source--event {
    color: #475569;
}

.ps-comment-source--event i {
    color: #64748b;
}

.ps-comment-source--reservation {
    color: #0369a1;
}

.ps-comment-source--reservation i {
    color: #0284c7;
}

.ps-history-comment-body {
    font-size: 0.88rem;
    line-height: 1.45;
}

.ps-history-item--billing .ps-partner-comment-head,
.ps-history-item--local .ps-partner-comment-head,
.ps-history-item--kontur .ps-partner-comment-head {
    margin-bottom: 8px;
}

/* Карточка ПП на всю высоту окна: прокрутка только основного поля */
body.app-page-ps:has(.ps-detail-page) {
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
}

body.app-page-ps:has(.ps-detail-page) .app-shell {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
}

body.app-page-ps:has(.ps-detail-page) .app-main-ps {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.app-page-ps:has(.ps-detail-page) .ps-detail-page {
    flex: 1;
    min-height: 0;
}

.app-drawer-body--ps .ps-shell {
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .app-drawer-body--ps {
        overflow-y: auto;
    }
}

/* Уведомления (toast), универсальные */
.app-instant-tip-anchor {
    display: inline-flex;
    vertical-align: middle;
    max-width: 100%;
}

.app-instant-tip {
    position: fixed;
    z-index: 10050;
    width: max-content;
    max-width: 240px;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    pointer-events: none;
    white-space: normal;
    overflow: visible;
}

.app-instant-tip[hidden] {
    display: none !important;
}

.app-instant-tip[data-placement="left"]::before,
.app-instant-tip[data-placement="left"]::after,
.app-instant-tip[data-placement="right"]::before,
.app-instant-tip[data-placement="right"]::after,
.app-instant-tip[data-placement="top"]::before,
.app-instant-tip[data-placement="top"]::after,
.app-instant-tip[data-placement="bottom"]::before,
.app-instant-tip[data-placement="bottom"]::after {
    content: "";
    position: absolute;
    border: 6px solid transparent;
    z-index: 1;
}

.app-instant-tip[data-placement="left"]::before {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #e2e8f0;
}

.app-instant-tip[data-placement="left"]::after {
    left: calc(100% - 1px);
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-left-color: #fff;
    z-index: 2;
}

.app-instant-tip[data-placement="right"]::before {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #e2e8f0;
}

.app-instant-tip[data-placement="right"]::after {
    right: calc(100% - 1px);
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-right-color: #fff;
    z-index: 2;
}

.app-instant-tip[data-placement="top"]::before {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-top-color: #e2e8f0;
}

.app-instant-tip[data-placement="top"]::after {
    left: 50%;
    top: calc(100% - 1px);
    transform: translateX(-50%);
    border-width: 5px;
    border-top-color: #fff;
    z-index: 2;
}

.app-instant-tip[data-placement="bottom"]::before {
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border-bottom-color: #e2e8f0;
}

.app-instant-tip[data-placement="bottom"]::after {
    left: 50%;
    bottom: calc(100% - 1px);
    transform: translateX(-50%);
    border-width: 5px;
    border-bottom-color: #fff;
    z-index: 2;
}

.app-toast-host {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 0;
    width: auto;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    pointer-events: none;
}

.app-toast {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: calc(100vw - 48px);
    padding: 10px 10px 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #334155;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
    transition-duration: 0.18s;
}

.app-toast-message {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    color: #ffffff;
    white-space: normal;
    word-wrap: break-word;
}

.app-toast--debug {
    align-items: flex-start;
    max-width: min(920px, calc(100vw - 48px));
}

.app-toast--debug .app-toast-message {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    font-weight: 400;
    max-height: min(70vh, 560px);
    overflow: auto;
}

.app-toast-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.app-toast-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.app-toast-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Варианты оставлены для API; визуально единый тёмный стиль */
.app-toast--success,
.app-toast--error,
.app-toast--info {
    border-color: rgba(255, 255, 255, 0.12);
    background: #334155;
}

.app-toast--success .app-toast-message,
.app-toast--error .app-toast-message,
.app-toast--info .app-toast-message {
    color: #ffffff;
}

.app-drawer-body--profile {
    padding: 20px 20px 24px;
    background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 120px);
}

.app-drawer-panel--profile {
    width: min(480px, 100%);
    border-left: none;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.app-profile-hero {
    position: relative;
    padding: 28px 24px 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18) 0%, transparent 42%),
        linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%);
    color: #fff;
    flex-shrink: 0;
}

.app-profile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.app-profile-close:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.app-profile-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding-top: 8px;
}

.app-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 2px solid rgba(255, 255, 255, 0.35);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.app-profile-name {
    margin: 6px 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

.app-profile-email {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.88);
    word-break: break-word;
}

.app-profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.app-profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.app-profile-badge--role {
    color: #312e81;
    background: rgba(255, 255, 255, 0.92);
}

.app-profile-badge--2fa {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(15, 23, 42, 0.22);
    border-color: rgba(255, 255, 255, 0.18);
}

.app-profile-badge--2fa.is-on {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.app-profile-stack {
    display: grid;
    gap: 16px;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.app-profile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.app-profile-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--card-head-bg);
}

.app-profile-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.65rem;
    flex-shrink: 0;
}

.app-profile-card-icon--security {
    background: #ecfdf5;
    color: #059669;
}

.app-profile-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.app-profile-card-subtitle {
    margin: 4px 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.app-profile-meta {
    padding: 6px 0;
}

.app-profile-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.app-profile-meta-row:last-child {
    border-bottom: none;
}

.app-profile-meta-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.app-profile-meta-label i {
    width: 1.35rem;
    text-align: center;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
}

.app-profile-meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    word-break: break-word;
}

.app-profile-subsection {
    padding: 16px 18px 18px;
    border-top: 1px solid var(--line);
}

.app-profile-subsection:first-of-type {
    border-top: none;
}

.app-profile-subsection-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.app-profile-subsection-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #f8fafc;
    color: #64748b;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.app-profile-subsection-title {
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text);
}

.app-profile-subsection-desc {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.app-profile-subsection-body {
    margin-top: 4px;
}

.app-profile-subsection--password {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
}

.app-profile-form {
    max-width: none;
    gap: 12px;
}

.app-profile-form-actions {
    margin-top: 4px;
}

.app-profile-form-actions .app-button,
.app-profile-form-actions .app-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.app-profile-form-actions .app-button i,
.app-profile-form-actions .app-button-secondary i {
    font-size: 1.25rem;
    line-height: 1;
}

.app-profile-form-hint {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.app-profile-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.app-profile-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
}

.app-profile-status-pill i {
    font-size: 1.2rem;
    line-height: 1;
}

.app-profile-status-pill.is-success {
    color: #047857;
    background: var(--success-soft);
    border: 1px solid #a7f3d0;
}

.app-profile-totp-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.app-profile-totp-start-btn i {
    font-size: 1.25rem;
    line-height: 1;
}

.app-profile-totp-text {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.app-profile-totp-apps {
    display: grid;
    gap: 4px;
}

.app-profile-totp-app-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.app-profile-totp-store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}

.app-profile-totp-store-link:hover {
    color: #ffffff;
    background: var(--accent);
}

.app-profile-totp-store-link i {
    font-size: 1.05rem;
    line-height: 1;
}

.app-profile-totp-store-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
}

.app-profile-totp-store-icon svg {
    display: block;
    width: 1.05rem;
    height: 1.05rem;
}

.app-profile-totp-store-link--rustore .app-profile-totp-store-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.app-profile-totp-store-link--rustore .app-profile-totp-store-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.app-profile-totp-muted {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.app-profile-totp-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 12px 0 16px;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px dashed #cbd5e1;
}

.app-profile-totp-qr {
    display: block;
    width: 220px;
    height: 220px;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.app-profile-secret-input,
.app-profile-code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.04em;
}

.app-profile-totp-confirm-field {
    margin-top: 16px;
}

.app-profile-recovery-panel {
    padding-top: 4px;
}

.app-profile-recovery-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.app-profile-recovery-callout i {
    font-size: 1.65rem;
    margin-top: 2px;
}

.app-profile-recovery-callout strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.app-profile-recovery-callout p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #b45309;
}

.app-profile-totp-recovery-list {
    margin: 0 0 16px;
    padding: 14px;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.86rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
}

.app-profile-totp-recovery-list li {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
}

@media (max-width: 420px) {
    .app-drawer-panel--profile {
        width: 100%;
    }

    .app-profile-meta-row {
        flex-direction: column;
        gap: 6px;
    }

    .app-profile-meta-value {
        text-align: left;
    }

    .app-profile-totp-recovery-list {
        grid-template-columns: 1fr;
    }
}

.app-profile-totp-disable {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.app-profile-card--security .app-alert {
    margin-bottom: 12px;
}

.app-profile-totp-admin {
    margin: 24px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.app-profile-totp-admin h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.app-form-compact .app-field label {
    font-size: 0.88rem;
}

.app-form-compact .app-field input {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.app-main {
    padding: 28px;
}

.app-main-shell-naked {
    padding-top: 20px;
}

.app-main-bills {
    width: 100%;
    max-width: none;
    padding: 24px 28px 32px;
    box-sizing: border-box;
}

/* Страница «Клиенты» */
.app-main-clients {
    padding: 20px 28px 20px;
}

/* Сплит с двумя колонками: отдельная прокрутка списка и карточки (страница не скроллится) */
body.app-page-clients:has(.clients-layout) {
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
}

body.app-page-clients:has(.clients-layout) .app-shell {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
}

body.app-page-clients:has(.clients-layout) .app-main-clients {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.app-page-clients:has(.clients-layout) .app-main-clients .clients-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 342px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    overflow: hidden;
}

body.app-page-clients:has(.clients-layout) .app-main-clients .clients-list-pane {
    margin-bottom: 0;
    max-height: none;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

body.app-page-clients:has(.clients-layout) .app-main-clients .clients-detail-pane {
    max-height: none;
    height: auto;
    min-height: 0;
    padding-bottom: 28px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

body.app-page-clients:has(.clients-layout) .clients-list-scroll {
    overscroll-behavior: contain;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.app-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-user-email {
    font-weight: 600;
    color: var(--text);
}

.app-user-role {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.app-logout-btn {
    padding: 8px 14px;
    min-height: auto;
    font-size: 0.9rem;
}

.app-topbar h1 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.15;
}

.app-topbar p {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 720px;
}

.app-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-panel-body {
    padding: 24px;
}

.app-grid {
    display: grid;
    gap: 20px;
}

.app-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-stat-card {
    padding: 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.app-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.app-stat-value {
    margin-top: 10px;
    font-size: 2rem;
    font-weight: 700;
}

.app-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.app-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.app-button,
.app-button-secondary,
.app-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.app-button {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.app-button:hover {
    color: #fff;
    transform: translateY(-1px);
}

.app-button-secondary {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
}

.app-button-danger {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.app-table-wrap {
    overflow-x: auto;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.app-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--surface-muted);
}

.app-table th.app-table-sortable {
    padding: 0;
}

.app-table th.app-table-sortable a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}

.app-table th.app-table-sortable a:hover {
    color: var(--text);
    background: rgba(79, 70, 229, 0.06);
}

.app-table th.app-table-sortable.is-active a {
    color: var(--text);
}

.app-table-sort-indicator {
    font-size: 0.72rem;
    line-height: 1;
    color: var(--accent);
}

.app-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.app-users-table td {
    vertical-align: middle;
}

.app-users-table tbody tr.app-users-row {
    cursor: default;
}

.app-instant-tip--user-card {
    width: min(340px, calc(100vw - 24px));
    max-width: 340px;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.app-user-tip {
    display: flex;
    flex-direction: column;
}

.app-user-tip-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 12px;
    background:
        linear-gradient(120deg, rgba(238, 242, 255, 0.98) 0%, rgba(255, 255, 255, 0.7) 48%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #eef2f7;
}

.app-user-tip-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.9rem;
}

.app-user-tip-head-copy {
    min-width: 0;
    flex: 1;
}

.app-user-tip-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    word-break: break-word;
}

.app-user-tip-subtitle {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.app-user-tip-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px 14px;
}

.app-user-tip-section-title {
    margin-bottom: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
}

.app-user-tip-meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.app-user-tip-meta-label {
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

.app-user-tip-meta-value {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.app-user-tip-empty {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.app-user-tip-provider {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.app-user-tip-provider + .app-user-tip-provider {
    margin-top: 8px;
}

.app-user-tip-provider-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.app-user-tip-provider-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.app-user-tip-provider-logo--empty {
    display: inline-block;
    background: #e2e8f0;
}

.app-user-tip-provider-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.app-user-tip-provider-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-user-tip-provider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.app-user-tip-provider-row strong {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.app-user-tip-linked {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.app-user-tip-linked-chip {
    display: inline-flex;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-users-col-notify {
    width: 44px;
    text-align: center;
    color: #94a3b8;
}

.app-users-col-notify .ps-partner-comment-action {
    margin: 0 auto;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.app-badge-success {
    color: var(--success);
    background: var(--success-soft);
}

.app-badge-muted {
    color: #475569;
    background: #f1f5f9;
}

.app-badge-warning {
    color: #b45309;
    background: var(--warning-soft);
}

.app-badge-role {
    color: #4338ca;
    background: var(--accent-soft);
}

.app-alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}

.app-alert-success {
    color: #047857;
    background: var(--success-soft);
    border: 1px solid #a7f3d0;
}

.app-alert-error {
    color: #b91c1c;
    background: var(--danger-soft);
    border: 1px solid #fecaca;
}

.app-form {
    display: grid;
    gap: 18px;
    max-width: 720px;
}

.app-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.app-field input,
.app-field select,
.app-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease
}

.app-field textarea {
    min-height: 120px;
    resize: vertical;
}

.app-field small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
}

.app-field.has-error input,
.app-field.has-error select {
    border-color: #f87171;
}

.app-field-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.9rem;
}

.app-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-check input {
    width: auto;
    min-height: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: #534ce7;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none; /* Отключает стандартное браузерное свечение */
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

.app-check label {
    margin: 0;
}

.app-user-permissions {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.app-user-permissions h2 {
    margin: 0;
    font-size: 1rem;
}

.app-user-permissions > p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.app-user-permissions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.app-user-permissions-list .app-field {
    margin: 0;
}

.app-user-links {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.app-user-links[hidden] {
    display: none;
}

.app-user-links h2 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.app-user-links p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.app-user-links-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.app-user-link-panel {
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr);
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.app-user-link-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.app-user-link-panel-head small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 700;
}

.app-user-link-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 220px;
    margin: 0;
    padding: 10px;
    list-style: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.app-user-link-list.is-drop-target {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.app-user-link-item[hidden] {
    display: none;
}

.app-user-link-card {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.app-user-link-card:hover,
.app-user-link-item.is-selected .app-user-link-card {
    border-color: #a5b4fc;
    background: var(--accent-soft);
}

.app-user-link-item.is-selected .app-user-link-card {
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.28);
}

.app-user-link-item.is-dragging {
    opacity: 0.55;
}

.app-user-link-name {
    font-weight: 700;
}

.app-user-link-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.app-user-link-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.app-user-link-controls .app-button-secondary {
    width: 44px;
    min-width: 44px;
    padding: 0;
    margin-bottom: 0;
}

.app-user-link-empty {
    padding: 22px 12px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .app-user-links-grid {
        grid-template-columns: 1fr;
    }

    .app-user-link-controls {
        flex-direction: row;
    }

    .app-user-link-controls .app-button-secondary {
        width: 48px;
    }
}

.app-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.app-empty h2 {
    margin: 0 0 10px;
    color: var(--text);
}

.app-placeholder {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px dashed #cbd5e1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
}

.app-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-inline-actions form {
    margin: 0;
}

.entity-toolbar-copy {
    color: var(--text-muted);
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.entity-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.entity-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: #c7d2fe;
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.12);
}

.entity-card-client {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.entity-card-top,
.entity-card-footer,
.entity-detail-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.entity-card-type,
.entity-detail-kicker {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4338ca;
    background: var(--accent-soft);
}

.entity-card-client .entity-card-type,
.entity-detail-hero-client .entity-detail-kicker {
    color: #0f766e;
    background: #ecfdf5;
}

.entity-card-date,
.entity-card-id,
.entity-detail-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.entity-card-title,
.entity-detail-title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.entity-card-subtitle,
.entity-detail-subtitle {
    margin: 0;
    color: var(--text-muted);
}

.entity-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.entity-chip-accent {
    color: #4338ca;
    background: var(--accent-soft);
}

.entity-chip-muted {
    color: #475569;
    background: #f1f5f9;
}

.entity-chip-success {
    color: #047857;
    background: var(--success-soft);
}

.entity-card-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.entity-card-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.entity-detail {
    display: grid;
    gap: 22px;
}

.entity-detail-hero {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(199, 210, 254, 0.9);
}

.entity-detail-hero-client {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(59, 130, 246, 0.08));
    border-color: rgba(153, 246, 228, 0.9);
}

.entity-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.entity-meta-item-wide {
    grid-column: 1 / -1;
}

.entity-meta-item {
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.entity-meta-label {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entity-meta-value {
    font-weight: 600;
    word-break: break-word;
}

.entity-json-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #0f172a;
    overflow: hidden;
}

.entity-json-panel summary {
    padding: 14px 18px;
    cursor: pointer;
    color: #e2e8f0;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.96);
}

.entity-json {
    margin: 0;
    padding: 18px;
    overflow: auto;
    max-height: 520px;
    color: #e2e8f0;
    background: #0f172a;
    font-size: 0.84rem;
    line-height: 1.55;
}

.entity-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 22px;
    color: var(--text-muted);
}

.entity-pagination a {
    font-weight: 600;
}

.entity-section-title {
    margin: 24px 0 12px;
    font-size: 1.05rem;
    color: var(--text);
}

.entity-subtable-wrap {
    display: grid;
    gap: 12px;
}

.entity-contact-card {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.clients-org-contacts-block {
    padding: 0;
}

.clients-org-contacts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.clients-block-head-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.clients-block-head-start .entity-section-title {
    margin: 0;
    min-width: 0;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.clients-block-reorder {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    gap: 0;
    height: 28px;
}

.clients-block-reorder-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 28px;
}

.clients-block-reorder-stack:not(:has(.clients-block-reorder-btn:not([hidden]))) {
    display: none;
}

.clients-block-reorder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 13px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.62rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.72;
    transition: color 0.12s ease, opacity 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.clients-block-reorder-btn--left,
.clients-block-reorder-btn--right {
    width: 16px;
    height: 22px;
    font-size: 0.58rem;
}

.clients-block-reorder-btn i {
    display: block;
    line-height: 1;
}

.clients-block-reorder-btn:hover:not(:disabled),
.clients-block-reorder-btn:focus-visible:not(:disabled) {
    color: var(--accent);
    opacity: 1;
    background: rgba(59, 130, 246, 0.08);
}

.clients-block-reorder-btn:active:not(:disabled) {
    transform: scale(0.92);
}

.clients-block-reorder-btn[hidden] {
    display: none !important;
}

.clients-org-contacts-head .clients-detail-block-title {
    margin: 0;
}

.clients-org-contacts-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clients-org-links-list .ps-contacts-section {
    margin-top: 0;
}

.ps-org-contact-link-card .ps-org-contact-head {
    margin-bottom: 0;
    align-items: center;
}

.ps-org-contact-link-card .ps-org-contact-name-row {
    align-items: center;
}

.ps-org-contact-link-card .ps-org-contact-link-row-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.app-drawer-panel--clients-contact-link {
    width: min(720px, calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    padding: 0;
}

.clients-contact-link-drawer {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.clients-contact-link-drawer-head {
    flex-shrink: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clients-contact-link-drawer-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.clients-contact-link-drawer-form {
    flex: 1;
    min-height: 0;
}

.clients-contact-link-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 8px 44px;
}

.clients-contact-link-org-section {
    margin-bottom: 18px;
}

.clients-contact-link-org-search-wrap,
.clients-contact-link-contact-wrap {
    position: relative;
}

.clients-contact-link-org-search,
.clients-contact-link-contact-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text);
    background: #fff;
}

.clients-contact-link-org-search:focus,
.clients-contact-link-contact-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.clients-contact-link-org-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clients-contact-link-org-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.clients-contact-link-org-star-btn {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.clients-contact-link-org-star-btn.is-active {
    color: #f59e0b;
}

.clients-contact-link-org-star-btn:not(.is-active):hover,
.clients-contact-link-org-star-btn:not(.is-active):focus-visible {
    color: #94a3b8;
}

.clients-contact-link-org-star-btn.is-active:hover,
.clients-contact-link-org-star-btn.is-active:focus-visible {
    color: #d97706;
}

.clients-contact-link-org-item-label {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent);
}

.clients-contact-link-org-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.clients-contact-link-org-remove:hover {
    color: var(--text);
}

.clients-contact-link-field {
    margin-bottom: 18px;
}

.clients-contact-link-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.clients-contact-link-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.clients-contact-link-suggest-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

.clients-contact-link-suggest-item:hover,
.clients-contact-link-suggest-item:focus-visible {
    background: var(--surface-muted);
}

.clients-contact-link-products {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.clients-contact-link-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.clients-contact-link-products-title {
    margin: 0;
}

.clients-contact-link-comment-field {
    margin-top: 18px;
}

.clients-contact-link-drawer-error {
    margin-top: 12px;
}

.clients-contact-link-drawer-footer {
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
}

.clients-contact-link-drawer-submit {
    min-width: 140px;
}

.clients-contact-link-drawer-delete {
    margin-left: auto;
}

@media (max-width: 640px) {
    .clients-contact-link-drawer-body {
        padding-left: 20px;
    }

    .clients-org-contacts-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.clients-bookings-frame {
    min-height: 120px;
}

.clients-bookings-block {
    margin: 0;
}

.clients-bookings-block--enter {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.clients-bookings-block--enter.is-visible {
    opacity: 1;
    transform: none;
}

.clients-bookings-block--loading .clients-bookings-table tbody tr:hover {
    background: transparent;
}

.clients-bookings-shimmer-filter {
    width: 132px;
    height: 34px;
    border-radius: 999px;
    flex-shrink: 0;
}

.clients-bookings-shimmer-row td {
    border-bottom-color: #eef2f7;
}

.clients-bookings-shimmer-row:last-child td {
    border-bottom: none;
}

.clients-bookings-shimmer-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: 220px;
}

.clients-bookings-shimmer-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
}

.clients-bookings-shimmer-line {
    display: block;
    height: 12px;
    border-radius: 999px;
}

.clients-bookings-shimmer-line--product {
    width: min(100%, 148px);
}

.clients-bookings-shimmer-line--partner {
    width: min(100%, 176px);
}

.clients-bookings-shimmer-line--date {
    width: 88px;
}

.clients-bookings-shimmer-line--action {
    width: 92px;
    margin-left: auto;
}

.clients-bookings-loading-fallback {
    margin: 0;
    padding: 8px 0;
}

.clients-bookings-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 4px 0 2px;
    padding: 28px 20px 30px;
    text-align: center;
    border: 1px dashed #dbe3ef;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #fafbfd 0%, #f8fafc 100%);
}

.clients-bookings-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 4px;
    border-radius: 16px;
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%);
    color: var(--accent);
    font-size: 1.35rem;
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.clients-bookings-empty-state-title {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.clients-bookings-empty-state-desc {
    margin: 0;
    max-width: 34ch;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .clients-bookings-block--enter {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .clients-bookings-block--loading .app-shimmer::after {
        animation: none;
        transform: none;
        opacity: 0.35;
    }
}

.clients-bookings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.clients-bookings-title {
    margin: 0;
}

.clients-bookings-table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
}

.clients-bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    line-height: 1.35;
}

.clients-bookings-table thead th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
}

.clients-bookings-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.clients-bookings-table tbody tr:last-child td {
    border-bottom: none;
}

.clients-bookings-table tbody tr:hover {
    background: #f8fafc;
}

.clients-bookings-th-product {
    width: 28%;
}

.clients-bookings-cell-product {
    width: 28%;
}

.clients-bookings-table tbody tr.clients-bookings-row--multi .clients-bookings-cell-product {
    vertical-align: top;
}

.clients-bookings-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.clients-bookings-product-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.clients-bookings-product-icon--empty {
    display: inline-block;
    border-radius: 4px;
    background: #e2e8f0;
}

.clients-bookings-product-name {
    min-width: 0;
}

.clients-bookings-th-partners,
.clients-bookings-cell-partners {
    color: var(--text);
}

.clients-bookings-table tbody .clients-bookings-cell-partners {
    padding: 0;
}

.clients-bookings-partners {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.clients-bookings-partner-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7.5rem;
    column-gap: 14px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.clients-bookings-table tbody .clients-bookings-partner-item {
    padding: 12px 14px;
}

.clients-bookings-table--with-actions .clients-bookings-partner-item {
    grid-template-columns: minmax(0, 1fr) 7.5rem 7.5rem;
}

.clients-bookings-partner-item--head {
    font: inherit;
}

.clients-bookings-row--multi .clients-bookings-partner-item + .clients-bookings-partner-item {
    border-top: 1px solid #eef2f7;
}

.clients-bookings-partner-item--own {
    background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 72%);
}

.clients-bookings-partner-item-sc {
    min-width: 0;
}

.clients-bookings-partner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.clients-bookings-partner-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clients-bookings-partner--own .clients-bookings-partner-text {
    font-weight: 600;
}

.clients-bookings-partner-own-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.15);
    line-height: 1.35;
}

.clients-bookings-partner-item-upto {
    white-space: nowrap;
}

.clients-bookings-partner-item-action {
    width: 7.5rem;
    white-space: nowrap;
    text-align: right;
    justify-self: end;
}

.clients-bookings-extend-btn {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

.clients-bookings-extend-btn:hover:not(:disabled),
.clients-bookings-extend-btn:focus-visible:not(:disabled) {
    text-decoration: underline;
}

.clients-bookings-extend-btn:disabled {
    color: var(--text-muted);
    opacity: 0.55;
    cursor: not-allowed;
    text-decoration: none;
}

.clients-ps-footer,
.clients-bookings-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.clients-ps-footer[hidden],
.clients-bookings-footer[hidden] {
    display: none !important;
}

[data-clients-bookings-empty][hidden] {
    display: none !important;
}

.clients-bookings-empty-state[data-clients-bookings-empty] {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .clients-bookings-table thead {
        display: none;
    }

    .clients-bookings-table tbody tr {
        display: grid;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid #e2e8f0;
    }

    .clients-bookings-table tbody tr:last-child {
        border-bottom: none;
    }

    .clients-bookings-table tbody td {
        display: block;
        padding: 0;
        border: 0;
        width: auto;
    }

    .clients-bookings-partner-item,
    .clients-bookings-table--with-actions .clients-bookings-partner-item {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .clients-bookings-partner-item-action {
        width: auto;
        text-align: left;
        justify-self: start;
    }

    .clients-bookings-table tbody .clients-bookings-partner-item {
        padding: 0;
    }

    .clients-bookings-row--multi .clients-bookings-partner-item + .clients-bookings-partner-item {
        margin-top: 8px;
        padding-top: 8px;
    }

    .clients-bookings-partner-item--own {
        margin: 0 -10px;
        padding: 8px 10px;
    }

    .clients-bookings-shimmer-line--action {
        margin-left: 0;
    }

    .clients-bookings-shimmer-filter {
        width: 100%;
        max-width: 180px;
    }
}

.clients-bills-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.clients-bills-source-toggle {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
}

.clients-bills-title {
    margin: 0;
}

.clients-bills-source-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.clients-bills-source-btn:hover {
    color: var(--text);
}

.clients-bills-source-btn.is-active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.clients-bills-source-btn[data-clients-bills-source="local"].is-active {
    background: var(--sk-brand);
}

.clients-bills-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: visible;
}

.clients-bills-panel[hidden] {
    display: none !important;
}

.clients-bills-row--local,
.clients-bills-row-extra--local {
    cursor: pointer;
}

.bills-state-pill.is-local-issued {
    border-color: rgba(54, 71, 97, 0.28);
    background: var(--sk-brand-soft);
    color: var(--sk-brand);
}

.bill-drawer-onec-error {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #9b2c2c;
}

.bill-drawer-onec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.bill-drawer-onec-dot.is-ok {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.bill-drawer-onec-dot.is-error {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.bill-drawer-onec-dot.is-pending {
    background: transparent;
    border: 1.5px solid #94a3b8;
}

.bill-drawer-ps-link {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    text-align: left;
}

.bill-drawer-ps-link:hover {
    text-decoration: underline;
}

.bills-state-pill.is-local-ps,
.clients-bills-open-ps.bills-state-pill {
    cursor: pointer;
    border-color: rgba(54, 71, 97, 0.28);
    background: var(--sk-brand-soft);
    color: var(--sk-brand);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
}

.bills-state-pill.is-local-ps:hover,
.clients-bills-open-ps.bills-state-pill:hover {
    background: rgba(54, 71, 97, 0.2);
}

.clients-bills-filters-bar {
    position: relative;
    z-index: 2;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.clients-bills-filters-bar:has(.clients-ps-product-popover:not([hidden])),
.clients-bills-filters-bar:has(.ps-filter-period-popover:not([hidden])) {
    z-index: 30;
}

.clients-bills-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.clients-bills-hide-deleted {
    margin-left: auto;
}

.clients-bills-period-filter {
    position: relative;
    z-index: 1;
}

.clients-bills-period-filter .ps-filter-period-trigger {
    width: auto;
    min-height: 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 0.86rem;
    font-weight: 500;
    gap: 8px;
}

.clients-bills-period-filter .ps-filter-period-trigger:hover {
    border-color: #c5d4f5;
    background: #f8fafc;
}

.clients-bills-period-filter .ps-date-popover--filter {
    z-index: 40;
    width: min(440px, calc(100vw - 32px));
}

.clients-bills-product-filter {
    position: relative;
    z-index: 1;
}

.clients-bills-product-filter .clients-ps-product-popover {
    z-index: 40;
    left: 0;
    right: auto;
}

.clients-bills-table-wrap {
    position: relative;
    z-index: 0;
    border: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: #fff;
    overflow: hidden;
}

.clients-bills-empty {
    margin: 0;
    padding: 18px 14px;
}

[data-clients-bills-source-empty] {
    margin: 16px;
}

.clients-bills-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    line-height: 1.35;
}

.clients-bills-table thead th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    min-height: 40px;
}

.clients-bills-filters-row th {
    height: 40px;
    padding: 8px 14px;
    vertical-align: middle;
}

.clients-bills-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.clients-bills-table tbody tr:last-child td {
    border-bottom: none;
}

.clients-bills-row td {
    border-bottom: 0;
    padding-bottom: 4px;
}

.clients-bills-table tbody tr.clients-bills-row td {
    border-bottom: 0;
}

.clients-bills-row,
.clients-bills-row-extra,
.clients-bills-row-comment {
    position: relative;
    cursor: pointer;
    transition: background 0.12s ease;
}

.clients-bills-row:hover:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)),
.clients-bills-row:focus-visible:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)),
.clients-bills-row:hover:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra,
.clients-bills-row:focus-visible:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra,
.clients-bills-row:hover:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra + .clients-bills-row-comment,
.clients-bills-row:focus-visible:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra + .clients-bills-row-comment,
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra:hover),
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra:hover) + .clients-bills-row-extra,
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra:hover) + .clients-bills-row-extra + .clients-bills-row-comment,
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra + .clients-bills-row-comment:hover),
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra + .clients-bills-row-comment:hover) + .clients-bills-row-extra,
.clients-bills-row:not(.clients-bills-row--paid):not(.clients-bills-row--not-visible):has(+ .clients-bills-row-extra + .clients-bills-row-comment:hover) + .clients-bills-row-extra + .clients-bills-row-comment {
    background: #f8fafc;
    outline: none;
}

.clients-bills-row--paid:focus-visible,
.clients-bills-row--not-visible:focus-visible {
    outline: none;
}

.clients-bills-row--paid,
.clients-bills-row-extra--paid,
.clients-bills-row-comment.clients-bills-row-extra--paid {
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.12) 0%, rgba(22, 163, 74, 0.06) 24%, rgba(22, 163, 74, 0.03) 36%, transparent 52%);
}

.clients-bills-row--paid:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)),
.clients-bills-row--paid:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)),
.clients-bills-row--paid:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra--paid,
.clients-bills-row--paid:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra--paid,
.clients-bills-row--paid:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra--paid + .clients-bills-row-comment,
.clients-bills-row--paid:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra--paid + .clients-bills-row-comment,
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid:hover),
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid:hover) + .clients-bills-row-extra--paid,
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid:hover) + .clients-bills-row-extra--paid + .clients-bills-row-comment,
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid + .clients-bills-row-comment:hover),
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid + .clients-bills-row-comment:hover) + .clients-bills-row-extra--paid,
.clients-bills-row--paid:has(+ .clients-bills-row-extra--paid + .clients-bills-row-comment:hover) + .clients-bills-row-extra--paid + .clients-bills-row-comment {
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.18) 0%, rgba(22, 163, 74, 0.09) 24%, rgba(22, 163, 74, 0.04) 36%, rgba(248, 250, 252, 0.35) 52%, transparent 68%);
}

.clients-bills-row--not-visible,
.clients-bills-row-extra--not-visible,
.clients-bills-row-comment.clients-bills-row-extra--not-visible {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.14) 0%, rgba(220, 38, 38, 0.07) 24%, rgba(220, 38, 38, 0.03) 36%, transparent 52%);
}

.clients-bills-row--not-visible:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)),
.clients-bills-row--not-visible:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)),
.clients-bills-row--not-visible:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra--not-visible,
.clients-bills-row--not-visible:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra--not-visible,
.clients-bills-row--not-visible:hover:not(:has(.clients-bills-pdf-btn:hover)):not(:has(.clients-bills-pdf-api-btn:hover)) + .clients-bills-row-extra--not-visible + .clients-bills-row-comment,
.clients-bills-row--not-visible:focus-visible:not(:has(.clients-bills-pdf-btn:focus-visible)):not(:has(.clients-bills-pdf-api-btn:focus-visible)) + .clients-bills-row-extra--not-visible + .clients-bills-row-comment,
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible:hover),
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible:hover) + .clients-bills-row-extra--not-visible,
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible:hover) + .clients-bills-row-extra--not-visible + .clients-bills-row-comment,
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible + .clients-bills-row-comment:hover),
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible + .clients-bills-row-comment:hover) + .clients-bills-row-extra--not-visible,
.clients-bills-row--not-visible:has(+ .clients-bills-row-extra--not-visible + .clients-bills-row-comment:hover) + .clients-bills-row-extra--not-visible + .clients-bills-row-comment {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2) 0%, rgba(220, 38, 38, 0.1) 24%, rgba(220, 38, 38, 0.04) 36%, rgba(248, 250, 252, 0.35) 52%, transparent 68%);
}

.clients-bills-row.is-hidden,
.clients-bills-row[hidden],
.clients-bills-row-extra.is-hidden,
.clients-bills-row-extra[hidden],
.clients-bills-row-comment.is-hidden,
.clients-bills-row-comment[hidden] {
    display: none;
}

.clients-bills-cell-number {
    position: relative;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
}

.clients-bills-table tbody td.clients-bills-cell-number {
    width: 1%;
    vertical-align: top;
    white-space: nowrap;
}

.clients-bills-number-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    max-width: 100%;
}

.clients-bills-number-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clients-bills-copy-btn.clients-copy-btn {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    opacity: 1;
    border-color: rgba(226, 232, 240, 0.9);
}

.clients-bills-row:hover .clients-bills-copy-btn.clients-copy-btn,
.clients-bills-copy-btn.clients-copy-btn:hover {
    color: var(--accent);
    border-color: var(--line);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.clients-bills-copy-btn.clients-copy-btn.is-copied {
    color: var(--success);
}

.clients-bills-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.clients-bills-stack-primary {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #15803d;
    white-space: nowrap;
}

.clients-bills-stack-secondary {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    white-space: nowrap;
}

.clients-bills-filters-row th:nth-child(2),
.clients-bills-filters-row th:nth-child(3) {
    width: 7.5rem;
    max-width: 7.5rem;
    padding-left: 6px;
    padding-right: 6px;
}

.clients-bills-cell-bill-meta,
.clients-bills-cell-paid-meta {
    width: 7.5rem;
    max-width: 7.5rem;
    padding-left: 6px;
    padding-right: 6px;
    white-space: nowrap;
}

.clients-bills-cell-bill-meta {
    padding-right: 2px;
}

.clients-bills-cell-paid-meta {
    padding-left: 2px;
}

.clients-bills-cell-bill-meta .clients-bills-stack,
.clients-bills-cell-paid-meta .clients-bills-stack {
    gap: 1px;
}

.clients-bills-cell-bill-meta .clients-bills-stack-primary,
.clients-bills-cell-paid-meta .clients-bills-stack-primary {
    font-size: 0.84rem;
}

.clients-bills-cell-bill-meta .clients-bills-stack-secondary,
.clients-bills-cell-paid-meta .clients-bills-stack-secondary {
    font-size: 0.72rem;
}

.clients-bills-paid-empty {
    color: #94a3b8;
}

.clients-bills-cell-paid-meta .clients-bills-stack .clients-bills-paid-empty {
    font-size: 0.84rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.clients-bills-cell-product {
    padding-left: 28px;
}

.clients-bills-product {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.clients-bills-product-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.clients-bills-product-icon--empty {
    display: inline-block;
    border-radius: 4px;
    background: #e2e8f0;
}

.clients-bills-product-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.clients-bills-product-name {
    min-width: 0;
    color: #334155;
    line-height: 1.25;
}

.clients-bills-product-issuer {
    font-style: italic;
    font-size: 12px;
    line-height: 1.2;
    color: #94a3b8;
}

.clients-bills-row-extra td {
    padding-top: 0;
    padding-bottom: 10px;
}

.clients-bills-row-extra-packages {
    padding-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    border-top: 0;
    line-height: 1.25;
}

.clients-bills-row-extra:has(+ .clients-bills-row-comment) > .clients-bills-row-extra-packages {
    border-bottom: 0;
    padding-bottom: 2px;
}

.clients-bills-row-comment > .clients-bills-row-comment-cell {
    padding-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    border-top: 0;
    vertical-align: top;
}

.clients-bills-row-comment-box {
    margin: 0;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-left: 3px solid #0d9488;
    border-radius: 10px;
    background:
        linear-gradient(120deg, rgba(240, 253, 250, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(13, 148, 136, 0.05);
}

.clients-bills-row-comment-body {
    font-size: 0.8rem;
    line-height: 1.35;
    color: #334155;
}

.clients-bills-row-comment-body > *:first-child {
    margin-top: 0;
}

.clients-bills-row-comment-body > *:last-child {
    margin-bottom: 0;
}

.clients-bills-row-comment-body p {
    margin: 0 0 0.35em;
}

.clients-bills-row-comment-body p:last-child {
    margin-bottom: 0;
}

.clients-bills-row-comment-body ul,
.clients-bills-row-comment-body ol {
    margin: 0.2em 0 0.35em;
    padding-left: 1.2em;
}

.clients-bills-row-comment-body .md-table {
    margin: 0.35em 0;
    font-size: 0.78rem;
}

.clients-bills-row-extra-label {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-right: 6px;
}

.clients-bills-row-extra-text {
    font-size: 0.8rem;
    color: #475569;
}

.clients-bills-row-extra:last-child td,
.clients-bills-row-comment:last-child td,
.clients-bills-row:last-child + .clients-bills-row-extra td {
    border-bottom: none;
}

/* Горизонтальный разделитель между счетами (PDF/номер rowspan + пакеты/комментарий) */
.clients-bills-table tbody tr.clients-bills-row > td.clients-bills-cell-pdf,
.clients-bills-table tbody tr.clients-bills-row > td.clients-bills-cell-number {
    border-bottom: 1px solid #e2e8f0;
}

.clients-bills-table tbody tr.clients-bills-row-extra > td.clients-bills-row-extra-packages {
    border-bottom: 1px solid #e2e8f0;
}

.clients-bills-table tbody tr.clients-bills-row-extra:has(+ .clients-bills-row-comment) > td.clients-bills-row-extra-packages {
    border-bottom: 0;
}

.clients-bills-table tbody tr.clients-bills-row:has(+ .clients-bills-row-extra:last-child) > td.clients-bills-cell-pdf,
.clients-bills-table tbody tr.clients-bills-row:has(+ .clients-bills-row-extra:last-child) > td.clients-bills-cell-number,
.clients-bills-table tbody tr.clients-bills-row-extra:last-child > td.clients-bills-row-extra-packages,
.clients-bills-table tbody tr.clients-bills-row:has(+ .clients-bills-row-extra + .clients-bills-row-comment:last-child) > td.clients-bills-cell-pdf,
.clients-bills-table tbody tr.clients-bills-row:has(+ .clients-bills-row-extra + .clients-bills-row-comment:last-child) > td.clients-bills-cell-number,
.clients-bills-table tbody tr.clients-bills-row-comment:last-child > td.clients-bills-row-comment-cell {
    border-bottom: none;
}

.clients-bills-footer {
    margin-top: 10px;
}

.clients-ps-block {
    margin: 0;
}

.clients-ps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.clients-ps-title {
    margin: 0;
}

.clients-ps-product-filter {
    position: relative;
}

.clients-ps-product-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.86rem;
    color: var(--text);
    cursor: pointer;
}

.clients-ps-product-filter-btn:hover,
.clients-ps-product-filter-btn:focus-visible {
    border-color: #c5d4f5;
    background: #f8fafc;
}

.clients-ps-product-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    width: min(640px, calc(100vw - 48px));
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.clients-ps-product-popover-body {
    padding: 14px 16px 10px;
}

.clients-ps-product-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.clients-ps-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
}

.clients-ps-product-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.clients-ps-product-item {
    margin: 0;
}

.clients-ps-product-popover-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--line);
}

.clients-ps-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.clients-ps-tab {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.clients-ps-tab-label {
    line-height: 1.2;
}

.clients-ps-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 5px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.64rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.clients-ps-tab.is-active {
    border-color: #c5d4f5;
    background: #eef2ff;
    color: var(--accent);
}

.clients-ps-tab.is-active .clients-ps-tab-count {
    background: var(--accent);
    color: #fff;
}

.clients-ps-tab[data-clients-ps-tab="important"] .clients-ps-tab-count {
    background: #fef3c7;
    color: #b45309;
}

.clients-ps-tab[data-clients-ps-tab="important"].is-active .clients-ps-tab-count {
    background: #d97706;
    color: #fff;
}

.clients-ps-tab.is-disabled,
.clients-ps-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.clients-ps-tab:not(:disabled):hover,
.clients-ps-tab:not(:disabled):focus-visible {
    border-color: #c5d4f5;
    background: #f8fafc;
}

.clients-ps-tab.is-active:not(:disabled):hover,
.clients-ps-tab.is-active:not(:disabled):focus-visible {
    background: #eef2ff;
}

.clients-ps-list-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
}

.clients-ps-list {
    display: flex;
    flex-direction: column;
}

.clients-ps-row-line {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e2e8f0;
}

.clients-ps-list .clients-ps-row-line:last-child {
    border-bottom: none;
}

.clients-ps-row-line .clients-ps-row {
    flex: 1;
    min-width: 0;
    border-bottom: none;
    padding-left: 6px;
}

.clients-ps-row-line:hover,
.clients-ps-row-line:hover .clients-ps-row {
    background: #f8fafc;
}

.clients-ps-row-line.is-ps-open,
.clients-ps-row-line.is-ps-open:hover,
.clients-ps-row-line.is-ps-open .clients-ps-row,
.clients-ps-row-line.is-ps-open:hover .clients-ps-row,
.clients-ps-row.is-ps-open,
.clients-ps-row.is-ps-open:hover {
    background: var(--ps-row-open-bg);
}

.clients-ps-row {
    display: grid;
    grid-template-columns: 16px minmax(88px, 0.9fr) minmax(96px, 0.85fr) 16px minmax(0, 1.8fr) 52px minmax(100px, 1fr);
    gap: 8px 10px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    font-size: 0.86rem;
    line-height: 1.35;
    transition: background 0.12s ease;
}

.clients-ps-list .clients-ps-row:last-child {
    border-bottom: none;
}

.clients-ps-row:hover {
    background: #f8fafc;
}

.clients-ps-row-product .ps-list-product-icon {
    width: 20px;
    height: 20px;
}

.clients-ps-row-product {
    justify-content: center;
}

.clients-ps-row-product .ps-list-product-icon-wrap {
    display: inline-flex;
    flex-shrink: 0;
    cursor: default;
}

.clients-ps-row-type {
    font-weight: 450;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.clients-ps-row-temp {
    display: flex;
    align-items: center;
    justify-content: center;
}

.clients-ps-row-text {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
}

.clients-ps-row-text-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clients-ps-row--new {
    font-weight: 700;
}

.clients-ps-row--new .clients-ps-row-type,
.clients-ps-row--new .clients-ps-row-when,
.clients-ps-row--new .clients-ps-row-text,
.clients-ps-row--new .clients-ps-row-mgr {
    font-weight: 700;
}

.clients-ps-row--muted {
    opacity: 0.6;
}

.clients-ps-row.is-hidden,
.clients-ps-row-line.is-hidden {
    display: none !important;
}

.clients-ps-list-empty {
    margin: 0;
    padding: 20px 16px;
    text-align: center;
}

@media (max-width: 900px) {
    .clients-ps-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clients-ps-row {
        grid-template-columns: 16px minmax(72px, 0.8fr) minmax(80px, 0.75fr) 14px minmax(0, 1.2fr) 44px minmax(72px, 0.9fr);
        font-size: 0.82rem;
    }
}

.entity-tag--product {
    background: #f4f7ff;
    border-color: #d8e2ff;
}

.contact-products-page {
    max-width: 920px;
}

.contact-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}

.contact-products-item {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-products-item:hover {
    border-color: #c5d4f5;
    background: #fff;
}

.contact-products-item.is-checked {
    border-color: #93b4f7;
    background: #f4f8ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.contact-products-item-check {
    flex-shrink: 0;
    margin: 4px 0 0;
}

.contact-products-item-body {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.contact-products-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: contain;
}

.contact-products-item-icon--empty {
    display: inline-block;
    background: #e2e8f0;
}

.contact-products-item-name {
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--text);
    min-width: 0;
}

.contact-products-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.contact-products-status {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .contact-products-grid {
        grid-template-columns: 1fr;
    }
}

.entity-muted {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.entity-tag {
    display: inline-block;
    margin: 4px 8px 0 0;
    padding: 4px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.85rem;
}

.entity-comment-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted);
    line-height: 1.6;
}

.entity-grid-admin {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.entity-admin-card {
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.entity-admin-card h3 {
    margin-top: 0;
}

.entity-grid-admin .entity-admin-card-wide {
    grid-column: 1 / -1;
}

.admin-ref-sync-blocked {
    margin-top: 12px;
}

.admin-ref-sync-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 14px;
    line-height: 1.45;
}

.admin-ref-sync-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 14px;
}

.admin-ref-sync-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-ref-sync-wrap {
    margin-top: 4px;
}

.admin-ref-sync-table code {
    font-size: 0.8rem;
}

.admin-ref-sync-api {
    word-break: break-all;
}

.admin-ref-sync-col-num {
    text-align: right;
    white-space: nowrap;
}

.admin-ref-sync-err {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #b91c1c;
    line-height: 1.4;
}

.admin-ref-sync-skip-msg {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.admin-ref-sync-summary td {
    border-top: 2px solid var(--line);
    padding-top: 12px;
}

.admin-ref-sync-note-warn {
    color: #b45309;
}

body.db-preview-modal-open {
    overflow: hidden;
}

.db-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.db-preview-modal[hidden] {
    display: none;
}

.db-preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.db-preview-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    max-height: min(88vh, 920px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.db-preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.db-preview-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.db-preview-modal-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.db-preview-modal-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

.db-preview-modal-body {
    padding: 16px 20px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.db-preview-modal-loading {
    margin: 0;
    color: var(--text-muted);
}

.db-preview-modal-error {
    margin-bottom: 12px;
}

.db-preview-table-wrap {
    overflow: auto;
    max-height: min(52vh, 480px);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.db-preview-data-table {
    font-size: 0.8125rem;
}

.db-preview-data-table th,
.db-preview-data-table td {
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-preview-null {
    color: var(--text-muted);
    font-style: italic;
}

.db-preview-modal-note {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ps-event-info-dialog {
    width: min(920px, calc(100vw - 2rem));
    max-height: calc(100vh - 32px);
}

.ps-event-info-modal .db-preview-modal-body {
    overflow: auto;
    min-height: 0;
    max-height: min(70vh, 640px);
}

.ps-event-info-section {
    margin-bottom: 1.25rem;
}

.ps-event-info-section:last-child {
    margin-bottom: 0;
}

.ps-event-info-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.ps-event-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ps-event-info-table th,
.ps-event-info-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    vertical-align: top;
    text-align: left;
}

.ps-event-info-table th {
    width: 34%;
    color: var(--text-muted);
    font-weight: 500;
}

.ps-event-info-table td code,
.ps-event-info-table td.ps-event-info-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    word-break: break-word;
}

.ps-event-info-table tr:last-child th,
.ps-event-info-table tr:last-child td {
    border-bottom: none;
}

/* Раздел «Клиенты»: список + карточка (без внешней app-panel) */
.clients-layout {
    display: grid;
    grid-template-columns: minmax(280px, 342px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* Ультраширокие мониторы (21:9 и шире): ширина как на 16:9 при той же высоте экрана */
@media (min-aspect-ratio: 21/9) and (min-width: 1800px) {
    body.app-page-clients:has(.clients-layout) .app-main-clients {
        align-items: flex-start;
    }

    .clients-layout,
    body.app-page-clients:has(.clients-layout) .app-main-clients .clients-layout {
        width: 100%;
        max-width: min(100%, max(720px, calc(100vh * 16 / 9 - var(--app-sidebar-width) - 56px)));
        grid-template-columns: minmax(280px, 342px) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        justify-content: start;
    }
}

.clients-list-pane {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    min-height: 0;
    overflow: hidden;
    max-height: calc(100vh - 110px);
}

.clients-detail-pane {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 110px);
    padding-right: 2px;
    transition: opacity 0.15s ease;
}

.clients-detail-pane.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.clients-list-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.clients-list-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-width: 0;
}

.clients-list-filter-bar .ps-list-home {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.clients-list-filter-name {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.clients-list-filter-edit {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
}

.clients-list-filter-edit:hover,
.clients-list-filter-edit:focus-visible {
    border-color: var(--line);
    background: #fff;
    color: var(--accent);
    outline: none;
}

.clients-list-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.clients-list-search {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.55) 100%);
    flex-shrink: 0;
}

.clients-list-search-field {
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clients-list-search-field:focus-within {
    border-color: #a5b4fc;
    box-shadow:
        0 0 0 3px rgba(79, 70, 229, 0.12),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.clients-list-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 0.82rem;
    pointer-events: none;
}

.clients-list-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 9px 6px 9px 0;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
}

.clients-list-search-input::placeholder {
    color: #94a3b8;
}

.clients-list-search-input::-webkit-search-cancel-button,
.clients-list-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.clients-list-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 4px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.clients-list-search-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}

.clients-list-search-clear i {
    font-size: 0.78rem;
}

.clients-list-empty {
    padding: 28px 16px 32px;
    text-align: center;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.clients-list-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.clients-list-row {
    position: relative;
    display: block;
    padding: 11px 40px 10px 12px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease;
}

.clients-list-row:hover {
    background: rgba(248, 250, 252, 0.95);
    color: inherit;
}

.clients-list-row.is-selected {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 0 var(--accent);
}

.clients-list-row.is-ps-open,
.clients-list-row.is-ps-open:hover {
    background: var(--ps-row-open-bg);
    box-shadow: none;
}

.clients-list-row-body {
    min-width: 0;
}

.clients-list-inn-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-right: 2px;
}

.clients-list-inn {
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.clients-list-fl {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f1f5f9;
}

.clients-list-name {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clients-list-filter-products {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding-right: 2px;
}

.clients-list-date-group {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 6px 12px 5px;
}

.clients-list-date-group .ps-list-date-group-label {
    font-size: 0.76rem;
    flex: 1 1 auto;
    min-width: 0;
}

.clients-list-date-group-stats {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

.clients-list-filter-product-icon {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.clients-list-filter-product-icon--empty {
    background: #e2e8f0;
}

.clients-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.clients-copy-btn i {
    font-size: 0.88rem;
}

.clients-list-row:hover .clients-copy-btn,
.clients-list-row.is-selected .clients-copy-btn {
    opacity: 1;
}

.clients-copy-btn:hover {
    border-color: var(--line);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.clients-copy-btn.is-copied {
    opacity: 1;
    color: var(--success);
}

.clients-list-sentinel {
    padding: 12px;
    border-top: 1px solid var(--line);
    text-align: center;
    flex-shrink: 0;
}

.clients-list-sentinel-text {
    display: none;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.clients-list-sentinel.is-loading .clients-list-sentinel-text {
    display: block;
}

.clients-detail-placeholder {
    padding: 28px 20px;
    text-align: center;
    margin: 0;
}

.clients-detail-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clients-detail-blocks {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clients-detail-blocks-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.clients-detail-blocks[data-clients-blocks-layout="one"] [data-clients-detail-col="right"] {
    display: none;
}

.clients-detail-blocks[data-clients-blocks-layout="two"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.clients-detail-blocks[data-clients-blocks-layout="two"] .clients-detail-frame {
    min-width: 0;
}

.clients-detail-blocks[data-clients-blocks-layout="two"] .clients-bookings-table-wrap,
.clients-detail-blocks[data-clients-blocks-layout="two"] .clients-bills-table-wrap {
    overflow-x: auto;
}

.clients-detail-frame {
    position: relative;
    z-index: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    padding: 18px 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.clients-detail-frame:has(.ps-comment-popover:not([hidden])),
.clients-detail-frame:has(.clients-ps-product-popover:not([hidden])),
.clients-detail-frame:has(.ps-filter-period-popover:not([hidden])) {
    z-index: 25;
}

.clients-detail-frame--solo {
    padding: 20px 22px;
}

.clients-detail-frame .clients-detail-block {
    margin: 0;
}

.clients-detail-frame .clients-detail-block-title,
.clients-detail-frame .entity-section-title {
    margin: 0 0 14px;
}

.clients-detail-frame .clients-block-head-start .entity-section-title {
    margin: 0;
}

.clients-detail-hero {
    margin: 0;
}

.clients-detail-layout-toggle {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
    gap: 2px;
}

.clients-detail-layout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.clients-detail-layout-btn i {
    font-size: 0.92rem;
    line-height: 1;
}

.clients-detail-layout-btn:hover {
    color: var(--text, #0f172a);
    background: rgba(255, 255, 255, 0.85);
}

.clients-detail-layout-btn.is-active,
.clients-detail-layout-btn[aria-pressed="true"] {
    color: var(--accent, #4f46e5);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.clients-detail-hero-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.clients-detail-focus-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.88rem;
    border-radius: 10px;
}

.clients-detail-focus-btn-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.clients-detail-hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex-wrap: wrap;
}

.clients-detail-create-ps-btn,
.clients-detail-create-bill-btn,
.clients-detail-create-sk-invoice-btn,
.clients-detail-requisites-btn {
    min-height: 36px;
    padding: 0 14px 0 10px;
    font-size: 0.88rem;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.clients-detail-create-ps-btn.app-button {
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.28);
}

.clients-detail-create-ps-btn.app-button:hover {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: #fff;
}

.clients-detail-requisites-btn.app-button {
    background: linear-gradient(135deg, #1a8f9c, #0d6b75);
    box-shadow: 0 4px 8px rgba(13, 107, 117, 0.28);
}

.clients-detail-requisites-btn.app-button:hover {
    background: linear-gradient(135deg, #157f8b, #0a5c65);
    color: #fff;
}

.clients-detail-create-bill-btn.app-button {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.28);
}

.clients-detail-create-bill-btn.app-button:hover {
    background: linear-gradient(135deg, #9333ea, #6d28d9);
    color: #fff;
}

.clients-detail-create-sk-invoice-btn.app-button {
    gap: 8px;
    background: var(--sk-brand);
    box-shadow: 0 6px 12px rgba(54, 71, 97, 0.32);
}

.clients-detail-create-sk-invoice-btn.app-button:hover {
    background: var(--sk-brand-hover);
    color: #fff;
}

.clients-detail-create-sk-invoice-btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.clients-detail-create-ps-btn:hover,
.clients-detail-create-bill-btn:hover,
.clients-detail-create-sk-invoice-btn:hover,
.clients-detail-requisites-btn:hover {
    transform: none;
}

.clients-detail-billing-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.clients-detail-billing-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.clients-detail-hero-inn-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.clients-detail-inn {
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    color: var(--text);
}

.clients-detail-hero-inn-line .clients-detail-copy-btn {
    position: static;
    opacity: 1;
    width: 32px;
    height: 32px;
    margin-left: 2px;
}

.clients-detail-name {
    margin: 0 0 8px;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.clients-detail-address {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.clients-detail-address-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.clients-detail-address-row .clients-detail-address {
    flex: 1 1 auto;
    min-width: 0;
}

.clients-detail-address-btn {
    position: static;
    flex: 0 0 auto;
    opacity: 1;
    width: 28px;
    height: 28px;
    margin-top: -2px;
}

.clients-detail-address-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
}

.clients-detail-address-offer {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.clients-detail-address-offer[hidden] {
    display: none;
}

.clients-detail-address-offer-text {
    margin: 0 0 10px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text);
}

.clients-detail-address-offer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clients-detail-address-offer-apply,
.clients-detail-address-offer-cancel {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.84rem;
    border-radius: 10px;
    box-shadow: none;
}

.clients-detail-products-frame {
    margin-top: 12px;
    min-height: 0;
}

.clients-detail-products-frame:empty {
    display: none;
    margin: 0;
}

.clients-detail-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clients-detail-products-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.clients-detail-products-expired {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clients-detail-products-expired-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.clients-detail-products-row--expired {
    opacity: 0.62;
}

.clients-detail-product-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    box-shadow: none;
}

.clients-detail-product-btn:hover,
.clients-detail-product-btn:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.clients-detail-product-icon-wrap {
    position: relative;
    display: inline-flex;
    width: 24px;
    height: 24px;
}

.clients-detail-product-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 5px;
}

.clients-detail-product-icon--empty {
    display: block;
    background: #e2e8f0;
}

.clients-detail-product-lock {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
    pointer-events: none;
}

.clients-detail-product-lock .la-lock {
    font-size: 11px;
    line-height: 1;
}

.clients-detail-product-shimmer {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-block;
}

.app-drawer-panel--client-product {
    width: min(420px, calc(100vw - 16px));
    display: flex;
    flex-direction: column;
    padding: 0;
}

.app-drawer-body--client-product {
    padding: 0;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.client-product-drawer {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.client-product-drawer-head {
    flex-shrink: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.client-product-drawer-head-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.client-product-drawer-icon-wrap {
    position: relative;
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.client-product-drawer-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

.client-product-drawer-titles {
    min-width: 0;
}

.client-product-drawer-kicker {
    margin: 0 0 2px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.client-product-drawer-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.client-product-drawer-body {
    padding: 16px 20px 24px;
}

.client-product-tariff-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-product-tariff {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted, #f8fafc);
}

.client-product-tariff-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.client-product-tariff-type {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.client-product-tariff-period {
    margin-top: 6px;
    font-size: 0.86rem;
    color: var(--text);
}

.clients-detail-comments {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.clients-detail-comments .clients-detail-comments-inner {
    margin: 0;
}

.clients-detail-comments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clients-detail-comments-toolbar .ps-comment-anchor-create {
    min-width: 0;
}

.clients-detail-comments .ps-tab-fake-link {
    font-size: 0.88rem;
}

.clients-detail-comments .ps-partner-comments-block {
    margin-top: 10px;
}

.clients-detail-comments .ps-date-anchor-wrap:has(.ps-comment-popover:not([hidden])),
.clients-detail-comments .ps-comment-edit-anchor:has(.ps-comment-popover:not([hidden])) {
    z-index: 30;
}

.entity-contact-card.is-muted {
    opacity: 0.55;
}

.clients-row-muted td {
    color: var(--text-muted);
}

/* Потенциальные продажи: страница фильтров */
.app-main-ps {
    padding: 20px 28px 28px;
    box-sizing: border-box;
    max-width: 100%;
}

.ps-filter-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

.ps-block {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    padding: 20px 22px 22px;
    box-sizing: border-box;
}

.ps-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 20px;
    margin-bottom: 14px;
}

.ps-calendar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.ps-calendar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ps-calendar-select {
    min-height: 40px;
    padding: 0 36px 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1.5L6 6l5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.ps-calendar-select:disabled {
    opacity: 0.65;
    cursor: wait;
    background-color: var(--surface-muted);
}

.ps-calendar-month-picker {
    position: relative;
    flex-shrink: 0;
}

.ps-calendar-month-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 158px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ps-calendar-month-trigger:hover,
.ps-calendar-month-trigger[aria-expanded="true"] {
    border-color: rgba(123, 44, 191, 0.35);
    background: #fbf7ff;
}

.ps-calendar-month-trigger:disabled {
    opacity: 0.65;
    cursor: wait;
    background-color: var(--surface-muted);
}

.ps-calendar-month-trigger i {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.ps-calendar-month-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: 220px;
    max-width: calc(100vw - 48px);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.ps-calendar-month-popover[hidden] {
    display: none !important;
}

.ps-calendar-month-popover-head {
    padding: 6px 8px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ps-calendar-month-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 2px;
}

.ps-calendar-month-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.ps-calendar-month-option:hover {
    background: var(--surface-muted);
}

.ps-calendar-month-option.is-selected {
    background: #f3e8ff;
    color: #5b21b6;
    font-weight: 700;
}

.ps-calendar-month-option.is-current:not(.is-selected) {
    background: #fff7ed;
    color: #9a3412;
}

.ps-calendar-month-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.12);
    color: #9a3412;
    font-size: 0.68rem;
    font-weight: 700;
}

.ps-calendar-block--loading .ps-calendar-count {
    opacity: 0.35;
}

.ps-calendar-block--loading .ps-calendar-cell--day {
    pointer-events: none;
}

.ps-calendar-product-filter {
    flex-shrink: 0;
}

.ps-calendar-product-filter-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
}

.ps-calendar-block:has([data-ps-cal-month-popover]:not([hidden])),
.ps-calendar-block:has([data-ps-cal-product-popover]:not([hidden])),
.ps-calendar-block:has([data-ps-cal-mgr-popover]:not([hidden])) {
    position: relative;
    z-index: 2;
}

.ps-calendar-block:has([data-ps-cal-month-popover]:not([hidden])) .ps-calendar-toolbar,
.ps-calendar-block:has([data-ps-cal-product-popover]:not([hidden])) .ps-calendar-toolbar,
.ps-calendar-block:has([data-ps-cal-mgr-popover]:not([hidden])) .ps-calendar-toolbar {
    position: relative;
    z-index: 5;
}

.ps-calendar-block:has([data-ps-cal-month-popover]:not([hidden])) .ps-calendar-body,
.ps-calendar-block:has([data-ps-cal-product-popover]:not([hidden])) .ps-calendar-body,
.ps-calendar-block:has([data-ps-cal-mgr-popover]:not([hidden])) .ps-calendar-body {
    pointer-events: none;
}

.ps-calendar-product-filter .clients-ps-product-popover[hidden] {
    display: none !important;
}

.ps-calendar-product-filter:not(.ps-calendar-mgr-filter) .clients-ps-product-popover:not([hidden]) {
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 480px);
    overflow: hidden;
}

.ps-calendar-product-filter:not(.ps-calendar-mgr-filter) .clients-ps-product-popover-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.ps-calendar-product-filter:not(.ps-calendar-mgr-filter) .clients-ps-product-popover-footer {
    flex-shrink: 0;
    background: #fff;
}

.ps-calendar-mgr-popover {
    width: min(360px, calc(100vw - 48px));
}

.ps-calendar-mgr-popover::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    transform: rotate(45deg);
    background: #fff;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.ps-calendar-mgr-radio-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.ps-calendar-mgr-radio {
    margin: 0;
}

.ps-calendar-mgr-search-block[hidden] {
    display: none !important;
}

.ps-calendar-mgr-search-wrap {
    margin-top: 4px;
}

.ps-calendar-mgr-results {
    margin-top: 6px;
}

.ps-calendar-mgr-filter [data-ps-cal-mgr-save]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ps-calendar-body {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: stretch;
    gap: 4px;
}

.ps-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ps-calendar-nav:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.ps-calendar-grid-wrap {
    min-width: 0;
}

.ps-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.ps-calendar-wd {
    padding: 10px 6px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: lowercase;
    color: #64748b;
    background: #f8fafc;
}

.ps-calendar-wd--weekend {
    color: #c08497;
}

.ps-calendar-cell--empty {
    min-height: 51px;
    background: #fff;
}

.ps-calendar-cell--day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 51px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.ps-calendar-cell--day:hover {
    background: #f8fafc;
}

.ps-calendar-cell--has {
    background: #fff9e6;
}

.ps-calendar-cell--has:hover {
    background: #fff3cc;
}

.ps-calendar-cell--day.is-selected {
    box-shadow: inset 0 0 0 2px #7b2cbf;
    z-index: 1;
}

.ps-calendar-cell--day.is-today {
    z-index: 1;
}

.ps-calendar-cell--day.is-today::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    pointer-events: none;
}

.ps-calendar-cell--day.is-today .ps-calendar-daynum {
    color: var(--accent);
    font-weight: 700;
}

.ps-calendar-daynum {
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
}

.ps-calendar-count {
    font-size: clamp(0.95rem, 1.8vw, 1.35rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.ps-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ps-saved-filters-block {
    padding: 0;
}

.ps-saved-filters {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.ps-saved-filters-row--head .ps-saved-filters-cell {
    padding: 16px 22px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.ps-saved-filters-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.ps-saved-filters-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 16px;
}

.ps-saved-filters-head-title {
    font-size: inherit;
    font-weight: inherit;
}

.ps-saved-filters-add {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent, #2563eb);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ps-saved-filters-add:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ps-saved-filters-add--local {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--sk-brand);
    color: #fff;
}

.ps-saved-filters-add--local:hover {
    background: var(--sk-brand-hover);
    color: #fff;
    text-decoration: none;
}

.ps-saved-filters-local-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: 4px;
    background: var(--sk-brand);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.ps-filter-local-note {
    margin: 0 0 14px;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.ps-saved-filters-row:not(.ps-saved-filters-row--head) .ps-saved-filters-cell {
    padding: 0;
    border-bottom: 1px solid var(--line);
}

.ps-saved-filters-row:last-child .ps-saved-filters-cell {
    border-bottom: none;
}

.ps-saved-filters-link {
    display: block;
    min-height: 63px;
    box-sizing: border-box;
    padding: 21px 22px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ps-saved-filters-row--custom .ps-saved-filters-link[role="link"] {
    cursor: pointer;
    -webkit-user-drag: none;
    user-select: none;
}

.ps-saved-filters-row--custom .ps-saved-filters-link[role="link"]:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: -2px;
}

body.ps-saved-filters-sorting,
body.ps-saved-filters-sorting * {
    cursor: grabbing !important;
}

.ps-saved-filters-link:hover {
    background: var(--surface-muted);
    color: #0f172a;
}

.ps-saved-filters-link--all {
    background: #fff9e6;
}

.ps-saved-filters-row--all .ps-saved-filters-link {
    display: grid;
    grid-template-columns: 50% 16.666667% 16.666667% 16.666667%;
    align-items: center;
    gap: 0;
    min-width: 0;
    min-height: 63px;
    box-sizing: border-box;
    padding: 14px 0;
}

.ps-saved-filters-link--all:hover {
    background: #fff3cc;
    color: #0f172a;
}

.ps-saved-filters-row-inner {
    display: flex;
    align-items: stretch;
    min-height: 63px;
    position: relative;
}

.ps-js-saved-filter-sort-surface {
    touch-action: none;
    -webkit-touch-callout: none;
}

.ps-saved-filters-table.is-sorting-active {
    user-select: none;
    -webkit-user-select: none;
}

.ps-saved-filters-table.is-sorting-active .ps-js-saved-filter-nav {
    pointer-events: none;
}

.ps-saved-filters-row-inner.is-press-pending {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.ps-saved-filters-row--placeholder .ps-saved-filters-cell {
    padding: 0 8px;
    background: transparent;
    border: none;
}

.ps-saved-filters-placeholder-gap {
    display: block;
    min-height: 63px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.05);
    border: 2px dashed rgba(37, 99, 235, 0.28);
    box-sizing: border-box;
    transition: min-height 0.18s ease, background 0.18s ease;
}

.ps-saved-filters-floater {
    position: fixed;
    z-index: 1200;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    pointer-events: none;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    will-change: top, left, transform, box-shadow;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.06),
        0 8px 20px rgba(15, 23, 42, 0.1);
    transform: translateY(0) scale(1);
}

.ps-saved-filters-floater.is-lifted {
    transform: translateY(-4px) scale(1.008);
    box-shadow:
        0 6px 10px rgba(15, 23, 42, 0.08),
        0 16px 36px rgba(15, 23, 42, 0.18);
}

.ps-saved-filters-floater.is-settling {
    transition:
        top 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        left 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.24s ease,
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateY(0) scale(1);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.06),
        0 8px 18px rgba(15, 23, 42, 0.1);
}

.ps-saved-filters-floater-cell {
    height: 100%;
    box-sizing: border-box;
    background: #fff;
    overflow: hidden;
}

/* Копия строки вне <tr> — дублируем layout .ps-saved-filters-row--custom */
.ps-saved-filters-floater .ps-saved-filters-row-inner {
    display: flex;
    align-items: stretch;
    min-height: 63px;
    height: 100%;
    position: relative;
}

.ps-saved-filters-floater .ps-saved-filters-link {
    flex: 1;
    display: grid;
    grid-template-columns: 50% 16.666667% 16.666667% 16.666667%;
    align-items: center;
    gap: 0;
    min-width: 0;
    min-height: 63px;
    height: 100%;
    box-sizing: border-box;
    padding: 14px 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
    background: transparent;
}

.ps-saved-filters-floater .ps-saved-filters-col--main {
    padding-left: 22px;
    padding-right: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.ps-saved-filters-floater .ps-saved-filters-col--period {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 0 14px;
    text-align: left;
}

.ps-saved-filters-floater .ps-saved-filters-col--count {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 18px;
}

.ps-saved-filters-floater .ps-saved-filters-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.ps-saved-filters-floater .ps-saved-filters-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-height: 63px;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.05rem;
    pointer-events: none;
}

.ps-saved-filters-row--custom .ps-saved-filters-cell {
    position: relative;
}

.ps-saved-filters-row--custom .ps-saved-filters-link {
    flex: 1;
    display: grid;
    grid-template-columns: 50% 16.666667% 16.666667% 16.666667%;
    align-items: center;
    gap: 0;
    min-width: 0;
    min-height: 63px;
    box-sizing: border-box;
    padding: 14px 0;
}

.ps-saved-filters-col {
    min-width: 0;
    box-sizing: border-box;
}

.ps-saved-filters-col--main {
    padding-left: 22px;
    padding-right: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ps-saved-filters-col--period {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 0 14px;
    text-align: left;
}

.ps-saved-filters-col--count {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 18px;
}

.ps-saved-filters-count-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 0;
}

.ps-saved-filters-name {
    display: block;
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-saved-filters-params-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.ps-saved-filters-temp-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.ps-saved-filters-params {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-saved-filters-period-value {
    display: block;
    max-width: 100%;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-saved-filters-period-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    color: #64748b;
    white-space: nowrap;
}

.ps-saved-filters-count {
    font-size: clamp(1.15rem, 2.0vw, 1.55rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ps-saved-filters-count.is-loading {
    font-size: 1.2rem;
    font-weight: 500;
    color: #94a3b8;
}

.ps-saved-filters-count-sum {
    display: block;
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-saved-filters-count-sum.is-loading {
    min-height: 0.86em;
    color: #94a3b8;
}

.ps-saved-filters-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.ps-saved-filters-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-height: 63px;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ps-saved-filters-menu-btn:hover,
.ps-saved-filters-menu-btn[aria-expanded="true"] {
    background: var(--surface-muted);
    color: #0f172a;
}

.ps-saved-filters-menu {
    position: absolute;
    top: calc(100% - 10px);
    right: 10px;
    z-index: 50;
    min-width: 168px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ps-saved-filters-menu[hidden] {
    display: none;
}

.ps-saved-filters-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    box-sizing: border-box;
}

.ps-saved-filters-menu-item:hover {
    background: #f1f5f9;
}

.ps-saved-filters-menu-item--danger {
    color: #b91c1c;
}

.ps-saved-filters-menu-item--danger:hover {
    background: #fef2f2;
}

.app-drawer-panel--ps-filter {
    width: min(720px, calc(100vw - 16px));
    max-width: 100vw;
    display: flex;
    flex-direction: column;
}

.app-drawer-body--ps-filter {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ps-filter-drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.ps-filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.ps-filter-drawer-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.ps-filter-drawer-close {
    border: none;
    background: var(--surface-muted);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.ps-filter-drawer-close:hover {
    color: var(--text);
    background: var(--line);
}

.ps-filter-drawer-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ps-filter-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 20px;
}

.ps-filter-field {
    padding: 18px 0 8px;
}

.ps-filter-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.ps-filter-input,
.ps-filter-select {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.ps-filter-input--date {
    min-width: 0;
}

.ps-filter-section {
    border-top: 1px solid var(--line);
}

.ps-filter-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.ps-filter-section-chevron {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.15s ease;
}

.ps-filter-section:not(.is-open) .ps-filter-section-body {
    display: none;
}

.ps-filter-section:not(.is-open) .ps-filter-section-chevron {
    transform: rotate(180deg);
}

.ps-filter-section-body {
    padding-bottom: 14px;
}

.ps-filter-check-grid {
    display: grid;
    gap: 8px 20px;
}

.ps-filter-check-grid--2 {
    grid-template-columns: 1fr 1fr;
}

.ps-filter-check-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ps-filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    cursor: pointer;
    user-select: none;
}

.ps-filter-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-filter-check-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    position: relative;
}

.ps-filter-check-input:checked + .ps-filter-check-box {
    background: #0f172a;
    border-color: #0f172a;
}

.ps-filter-check-input:checked + .ps-filter-check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0.5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ps-filter-check-label {
    font-size: 0.88rem;
    line-height: 1.35;
    color: #0f172a;
}

.ps-filter-check--product {
    align-items: center;
    min-width: 0;
}

.ps-filter-check--product .ps-filter-check-label--product {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-filter-product-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.ps-filter-product-icon--empty {
    display: inline-block;
    background: #e2e8f0;
}

.ps-filter-reset {
    margin-top: 10px;
    padding: 0;
    border: none;
    background: none;
    color: #2563eb;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.ps-filter-reset:hover {
    text-decoration: underline;
}

.ps-filter-temp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.ps-filter-temp-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ps-filter-temp-dot--hot { background: #ef4444; }

.ps-filter-temp-dot--warm { background: #f9ad01; }

.ps-filter-temp-dot--cold { background: #3b82f6; }

.ps-filter-period-extra {
    margin-top: 10px;
}

.ps-filter-period-wrap {
    position: relative;
}

.ps-filter-period-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f1f5f9;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
}

.ps-filter-period-trigger:hover {
    background: #e8eef4;
}

.ps-filter-period-trigger-chevron {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ps-date-popover--filter {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: min(440px, 100%);
    padding: 16px 16px 14px;
}

.ps-date-popover--filter::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 28px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.ps-filter-period-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.ps-filter-period-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    cursor: pointer;
    user-select: none;
}

.ps-filter-period-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-filter-period-radio-mark {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
}

.ps-filter-period-radio:checked + .ps-filter-period-radio-mark {
    border-color: #0f172a;
}

.ps-filter-period-radio:checked + .ps-filter-period-radio-mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #0f172a;
}

.ps-filter-period-option-label {
    font-size: 0.9rem;
    color: #0f172a;
}

.ps-filter-period-option-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ps-filter-period-option-body--range {
    gap: 6px;
}

.ps-filter-period-select {
    min-height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    color: #0f172a;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ps-filter-period-select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ps-filter-period-date-field {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ps-filter-period-date {
    min-width: 130px;
    min-height: 36px;
    padding: 0 34px 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.ps-filter-period-date::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ps-filter-period-date::-moz-calendar-picker-indicator {
    display: none;
}

.ps-filter-period-date:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ps-filter-period-date-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
}

.ps-filter-period-date-icon:hover {
    color: #64748b;
    background: rgba(148, 163, 184, 0.12);
}

.ps-filter-period-date:disabled + .ps-filter-period-date-icon {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.ps-filter-period-range-sep {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ps-filter-period-popover-actions {
    margin-top: 4px;
}

.ps-date-anchor-wrap:has(.ps-filter-period-popover:not([hidden])) {
    z-index: 50;
}

.ps-filter-period-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.ps-filter-inline-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ps-filter-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.ps-filter-radio-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ps-filter-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.ps-filter-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-filter-radio-mark {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.ps-filter-radio input:checked + .ps-filter-radio-mark {
    border-color: #0f172a;
}

.ps-filter-radio input:checked + .ps-filter-radio-mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #0f172a;
}

.ps-filter-mgr-pick {
    margin-top: 12px;
}

.ps-filter-mgr-search-wrap {
    position: relative;
}

.ps-filter-mgr-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.ps-filter-mgr-search {
    width: 100%;
    min-height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ps-filter-mgr-results {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    max-height: 180px;
    overflow-y: auto;
}

.ps-filter-mgr-results-item,
.ps-filter-mgr-results-empty {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}

.ps-filter-mgr-results-item:hover {
    background: var(--surface-muted);
}

.ps-filter-mgr-results-empty {
    color: var(--text-muted);
    cursor: default;
}

.ps-filter-mgr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ps-filter-mgr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.84rem;
}

.ps-filter-mgr-chip-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

.ps-filter-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.ps-filter-footer-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.ps-filter-count {
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ps-filter-count.is-loading {
    opacity: 0.55;
}

.ps-filter-btn {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.ps-filter-btn--primary {
    background: #0f172a;
    color: #fff;
}

.ps-filter-btn--primary:hover {
    background: #1e293b;
}

.ps-filter-btn--secondary {
    background: #e2e8f0;
    color: #64748b;
}

.ps-filter-btn--secondary:not(:disabled) {
    background: #cbd5e1;
    color: #0f172a;
}

.ps-filter-btn--secondary:disabled {
    cursor: not-allowed;
}

.ps-filter-btn--ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
    margin-left: auto;
}

.ps-filter-btn--ghost:hover {
    background: var(--surface-muted);
}

@media (max-width: 640px) {
    .ps-filter-check-grid--2 {
        grid-template-columns: 1fr;
    }

    .ps-filter-drawer-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .ps-filter-btn--ghost {
        margin-left: 0;
    }
}

.ps-add-billing-block {
    padding: 18px 22px;
}

.ps-add-billing-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 18px;
}

.ps-add-billing-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.ps-add-billing-controls {
    display: flex;
    flex: 1 1 420px;
    justify-content: flex-end;
    gap: 10px;
    min-width: 260px;
}

.ps-add-billing-input {
    width: min(100%, 520px);
    min-height: 40px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 0 14px;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
}

.ps-add-billing-input:focus {
    outline: 2px solid rgba(123, 44, 191, 0.18);
    border-color: #7b2cbf;
}

.ps-add-billing-btn {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: #7b2cbf;
    color: #fff;
    padding: 0 18px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.ps-add-billing-btn:hover {
    background: #6923a4;
}

.ps-add-billing-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.ps-add-billing-btn--secondary {
    background: #fff;
    color: #7b2cbf;
    box-shadow: inset 0 0 0 1px #7b2cbf;
}

.ps-add-billing-btn--secondary:hover {
    background: #f6edfc;
    color: #6923a4;
}

.ps-create-ps-home-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
}

.ps-create-ps-home-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.ps-create-ps-home-actions-stack .ps-add-billing-btn {
    width: 100%;
}

.ps-bottom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.ps-bottom-row > .ps-block,
.ps-bottom-col-aside {
    min-width: 0;
}

.ps-bottom-col-aside {
    display: grid;
    gap: 20px;
    align-content: start;
}

.ps-reservations-block {
    padding: 0;
}

.ps-reservations-title {
    margin: 0;
    padding: 18px 22px 14px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.ps-reservations-shimmer,
.ps-reservations-content {
    padding: 16px 22px 20px;
}

.ps-reservations-block.is-loading .ps-reservations-content {
    display: none;
}

.ps-reservations-block:not(.is-loading) .ps-reservations-shimmer {
    display: none;
}

/* Карточки «Заканчивается бронирование»: главная и страница ПП */
.home-reservations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.home-reservations-grid--shimmer .home-reservations-card {
    min-height: 118px;
    border: 0;
    background: transparent;
}

.home-reservations-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 118px;
    padding: 18px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-reservations-card:hover {
    transform: translateY(-1px);
}

.home-reservations-card--expired {
    background: #fff5f5;
    border-color: #f5c2c2;
}

.home-reservations-card--expired:hover {
    background: #ffecec;
}

.home-reservations-card--expired .home-reservations-card-label {
    color: #e11d48;
}

.home-reservations-card--today {
    background: #fff8f1;
    border-color: #f5d0a9;
}

.home-reservations-card--today:hover {
    background: #fff1e4;
}

.home-reservations-card--today .home-reservations-card-label {
    color: #ea580c;
}

.home-reservations-card--soon {
    background: #f3faf5;
    border-color: #b7e0c2;
}

.home-reservations-card--soon:hover {
    background: #e8f7ed;
}

.home-reservations-card--soon .home-reservations-card-label {
    color: #16a34a;
}

.home-reservations-card-label {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-reservations-card-value {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}

@media (max-width: 720px) {
    .home-reservations-grid {
        grid-template-columns: 1fr;
    }
}

.ps-create-ps-home-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    min-height: 40px;
}

.ps-create-ps-home-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.ps-limits-block {
    padding: 0;
}

.ps-limits-title {
    margin: 0;
    padding: 18px 22px 14px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.ps-limits-list {
    padding: 16px 22px 20px;
}

.ps-limits-state {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.ps-limits-state--error {
    color: #b91c1c;
}

.ps-limits-item + .ps-limits-item {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.ps-limits-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 20px;
    margin-bottom: 12px;
}

.ps-limits-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.ps-limits-item-stats {
    flex: 0 0 auto;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text);
    white-space: nowrap;
}

.ps-limits-remain {
    font-weight: 700;
}

.ps-limits-remain--success {
    color: #16a34a;
}

.ps-limits-remain--warning {
    color: #ea580c;
}

.ps-limits-remain--danger {
    color: #dc2626;
}

.ps-limits-remain--muted {
    color: var(--text-muted);
}

.ps-limits-total {
    font-weight: 700;
    color: var(--text);
}

.ps-limits-bar-wrap {
    padding-top: 2px;
}

.ps-limits-bar {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: #eceff3;
    overflow: visible;
}

.ps-limits-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 0;
    border-radius: 3px 0 0 3px;
    background: #4b5563;
    transition: width 0.35s ease;
    overflow: visible;
}

.ps-limits-bar-badge {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #4b5563;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Потенциальные продажи: форма создания */
.ps-create-drawer {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.ps-create-head {
    flex-shrink: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ps-create-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.ps-create-stepsbar {
    flex-shrink: 0;
    padding: 10px 20px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.ps-create-stepbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ps-create-stepbar-item {
    font-weight: 600;
    color: var(--text-muted);
}

.ps-create-stepbar-item.is-current {
    font-weight: 800;
    color: var(--text);
}

.ps-create-stepbar-arrow {
    color: var(--text-muted);
    font-weight: 600;
}

.ps-create-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ps-create-form .ps-float-field {
    position: relative;
    display: block;
    margin-bottom: 4px;
}

.ps-create-form .ps-float-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    border-radius: 0;
    background: transparent;
    padding: 22px 0 10px;
    min-height: auto;
    font: inherit;
    color: var(--text);
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s ease;
}

.ps-create-form .ps-float-input:hover {
    border-bottom-color: #94a3b8;
}

.ps-create-form .ps-float-input:focus {
    border-bottom-width: 2px;
    border-bottom-color: var(--accent);
    padding-bottom: 9px;
}

.ps-create-form .ps-float-field label {
    position: absolute;
    left: 0;
    top: 26px;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
    transition: top 0.16s ease, font-size 0.16s ease, color 0.16s ease;
    transform-origin: left top;
}

.ps-create-form .ps-float-input:focus + label,
.ps-create-form .ps-float-input:not(:placeholder-shown) + label,
.ps-create-form .ps-float-field.is-filled label {
    top: 2px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.ps-create-form .ps-float-field--select .ps-float-input {
    padding-right: 28px;
    cursor: pointer;
}

.ps-create-form .ps-float-field--select.is-open .ps-float-input {
    border-bottom-color: var(--accent);
    border-bottom-width: 2px;
    padding-bottom: 9px;
}

.ps-create-form .ps-float-field-chevron {
    position: absolute;
    right: 2px;
    top: 30px;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.16s ease, color 0.16s ease, top 0.16s ease;
}

.ps-create-form .ps-float-field--select:has(.ps-float-input:not(:placeholder-shown)) .ps-float-field-chevron,
.ps-create-form .ps-float-field--select.is-open .ps-float-field-chevron {
    top: 18px;
}

.ps-create-form .ps-float-field--select.is-open .ps-float-field-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.ps-create-form .ps-float-field--textarea .ps-float-input:focus + label,
.ps-create-form .ps-float-field--textarea .ps-float-input:not(:placeholder-shown) + label,
.ps-create-form .ps-float-field--textarea.is-filled label {
    top: 4px;
}

.ps-create-form .ps-float-field--textarea .ps-float-input {
    min-height: 96px;
    resize: vertical;
    padding-top: 28px;
}

.ps-create-form .ps-float-field--textarea label {
    top: 30px;
}

.ps-create-step {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 18px 44px;
}

.ps-create-section {
    margin-bottom: 18px;
}

.ps-create-section-title {
    font-weight: 800;
    margin: 0 0 12px;
}

.ps-create-section-subtitle {
    font-weight: 700;
}

.ps-create-help {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px 14px;
    border-radius: 10px;
    color: #b45309;
    font-size: 0.9rem;
    margin: 10px 0 16px;
    overflow: hidden;
    max-height: 96px;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.28s ease,
        opacity 0.22s ease,
        transform 0.22s ease,
        padding 0.28s ease,
        margin 0.28s ease,
        border-color 0.22s ease;
}

.ps-create-help.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-left-color: transparent;
    pointer-events: none;
}

.ps-create-temp-row {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

.ps-create-radio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    color: var(--text);
}

.ps-create-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-create-radio-dot {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    opacity: 0.85;
}

.ps-create-radio input:checked + .ps-create-radio-dot {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(123, 44, 191, 0.14);
}

.ps-create-radio-label {
    white-space: nowrap;
}

.ps-create-product-field {
    margin-bottom: 16px;
}

.ps-create-product-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-left: -34px;
}

.ps-create-product-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 22px;
    margin-left: 4px;
    object-fit: contain;
}

.ps-create-product-icon[hidden] {
    display: block !important;
    visibility: hidden;
}

.ps-create-product-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.ps-create-product-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.ps-create-product-result {
    padding: 10px 14px;
    cursor: pointer;
}

.ps-create-product-result:hover,
.ps-create-product-result:focus {
    background: #f8fafc;
}

.ps-create-product-result-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.ps-create-product-result-hint {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ps-create-product-mark {
    background: #fef08a;
    color: inherit;
    padding: 0;
}

.ps-create-product-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ps-create-product-result--add {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2px;
}

.ps-create-product-result--add:hover,
.ps-create-product-result--add:focus {
    background: var(--accent-soft);
}

.ps-create-product-result-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.ps-create-product-result-divider {
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.ps-create-source-wrap {
    margin-bottom: 12px;
}

.ps-create-contact-section {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ps-create-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ps-create-contact-card + .ps-create-contact-card {
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.ps-create-contact-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ps-create-contact-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.ps-create-contact-details[hidden] {
    display: none !important;
}

.ps-create-contact-name-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.ps-create-form .ps-float-field--contact-wide {
    width: 24em;
    max-width: 100%;
    flex: 0 0 auto;
}

.ps-create-contact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    transition: margin-bottom 0.28s ease;
}

.ps-create-contact-section:has(.ps-create-help.is-collapsed) .ps-create-contact-header {
    margin-bottom: 16px;
}

.ps-create-inline-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.ps-create-inline-action:hover {
    color: var(--accent-hover, var(--accent));
    text-decoration: underline;
}

.ps-create-inline-action--repeatable {
    margin-bottom: 10px;
}

.ps-js-create-contact-add[hidden] {
    display: none !important;
}

.ps-create-inline-action--remove {
    color: #dc2626;
}

.ps-create-inline-action--remove:hover {
    color: #b91c1c;
}

.ps-create-repeatable-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ps-create-repeatable-extra-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ps-create-repeatable-extra-list:empty {
    display: none;
}

.ps-create-repeatable-row,
.ps-create-email-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.ps-create-form .ps-float-field--email {
    width: 24em;
    max-width: 100%;
    flex: 0 0 auto;
}

.ps-create-repeatable-row .ps-create-phone-inline {
    width: auto;
}

.ps-create-phone-inline {
    display: inline-flex;
    align-items: flex-end;
    gap: 14px;
    width: auto;
}

.ps-create-form .ps-float-field--phone {
    width: 12em;
    flex: 0 0 auto;
}

.ps-create-form .ps-float-field--phone-ext {
    width: 11em;
    flex: 0 0 auto;
}

.ps-create-manager-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.ps-create-manager-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.ps-create-manager-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.ps-create-manager-option-row--picker {
    align-items: flex-end;
}

.ps-create-manager-option-row input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-create-manager-option-row .ps-create-manager-radio-dot {
    flex-shrink: 0;
}

.ps-create-manager-radio-hit {
    display: inline-flex;
    flex-shrink: 0;
    margin-bottom: 12px;
    cursor: pointer;
}

.ps-create-manager-radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    box-shadow: none;
    opacity: 1;
}

.ps-create-manager-option-row input[type="radio"]:checked + .ps-create-manager-radio-dot,
.ps-create-manager-option-row input[type="radio"]:checked + .ps-create-manager-radio-hit .ps-create-manager-radio-dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.ps-create-manager-option-label {
    font-weight: 600;
    color: var(--text);
}

.ps-create-manager-picker {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 24em;
    cursor: text;
    user-select: text;
}

.ps-create-form .ps-float-field--hint-hide .ps-float-input {
    padding: 8px 0;
    min-height: 0;
}

.ps-create-form .ps-float-field--hint-hide .ps-float-input:focus {
    padding-bottom: 7px;
}

.ps-create-form .ps-float-field--hint-hide label {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.ps-create-form .ps-float-field--hint-hide .ps-float-input:focus + label,
.ps-create-form .ps-float-field--hint-hide .ps-float-input:not(:placeholder-shown) + label,
.ps-create-form .ps-float-field--hint-hide.is-filled label {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
}

.ps-create-manager-option-row--picker .ps-create-manager-radio-hit {
    margin-bottom: 12px;
}

.ps-create-org-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 18px;
}

.ps-create-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px 16px 44px;
    border-top: 1px solid var(--line);
}

.ps-create-footer .ps-create-back,
.ps-create-footer .ps-create-next {
    min-width: 160px;
}

.ps-create-footer .ps-create-submit {
    min-width: 220px;
}

.ps-create-footer .ps-create-back:disabled,
.ps-create-footer .ps-create-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Создание ПП из карточки клиента */
.ps-client-create-drawer .ps-client-create-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 18px 44px;
}

.ps-client-create-section {
    margin-bottom: 20px;
}

.ps-client-create-type-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ps-client-create-type-option {
    min-height: 44px;
    padding: 4px 0;
    font-weight: 600;
}

.ps-client-create-type-row--renewal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    min-height: 44px;
}

.ps-client-create-type-row--connection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    min-height: 44px;
}

.ps-client-create-type-row--renewal .ps-client-create-type-option {
    flex: 0 0 auto;
    min-height: 0;
    padding: 4px 0;
}

.ps-client-create-type-row--connection .ps-client-create-type-option {
    flex: 0 0 auto;
    min-height: 0;
    padding: 4px 0;
}

.ps-client-create-renewal-end {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ps-client-create-renewal-end[hidden] {
    display: none !important;
}

.ps-client-create-connection-limit {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text);
    white-space: nowrap;
}

.ps-client-create-connection-limit[hidden] {
    display: none !important;
}

.ps-client-create-connection-limit-label {
    font-weight: 400;
    color: var(--muted);
}

.ps-client-create-connection-limit-value {
    font-size: 0.9rem;
}

.ps-client-create-renewal-end-label {
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--muted);
    white-space: nowrap;
}

.ps-client-create-renewal-date-root {
    position: relative;
}

.ps-client-create-renewal-date-root .ps-date-picker {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    z-index: 80;
    min-width: 280px;
    margin-bottom: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ps-client-create-renewal-date-root.is-cal-open .ps-date-picker {
    z-index: 80;
}

.ps-client-create-empty-contacts {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

.ps-client-create-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px 16px 44px;
    border-top: 1px solid var(--line);
}

.ps-client-create-footer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ps-client-create-submit {
    min-width: 140px;
    min-height: 40px;
    box-shadow: none;
}

.ps-client-create-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ps-client-create-cancel {
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.ps-client-create-cancel:hover {
    text-decoration: underline;
}

.ps-client-create-hint {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: right;
}

.ps-client-create-hint[hidden] {
    display: none;
}

/* Загрузка Excel: проверка пачки ПП */
.ps-excel-form-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 18px 28px;
}

.ps-excel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
    gap: 8px 32px;
    align-items: start;
}

.ps-excel-col--file {
    padding: 4px 0 0;
}

.ps-excel-col .ps-create-product-row {
    margin-left: 0;
}

.ps-excel-col--params > .ps-float-field {
    margin-bottom: 16px;
}

.ps-excel-supplier-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.ps-excel-col .ps-create-product-icon {
    margin-left: 0;
}

.ps-excel-drop {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ps-excel-drop.is-drag-over,
.ps-excel-drop.has-file {
    border-color: #7b2cbf;
    background: rgba(123, 44, 191, 0.05);
}

.ps-excel-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ps-excel-drop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: #7b2cbf;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.ps-excel-drop-btn:hover {
    background: #6923a4;
}

.ps-excel-file-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
}

.ps-excel-file-stats {
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}

.ps-excel-file-stats-total {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ps-excel-file-stats-ok {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #15803d;
    font-weight: 600;
}

.ps-excel-file-stats-ok i {
    color: #22c55e;
}

.ps-excel-file-stats-err {
    margin-top: 4px;
    color: #b91c1c;
    font-weight: 600;
}

.ps-excel-comment-check {
    margin-top: 16px;
    align-items: flex-start;
    font-size: 0.92rem;
    color: var(--text);
}

.ps-comment-excel-local-note,
.ps-manager-excel-note {
    margin: 18px 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.ps-excel-summary-link {
    margin: 12px 0 0;
}

.ps-excel-summary-link a {
    font-weight: 600;
}

.ps-excel-reqs {
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ps-excel-reqs-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.ps-excel-reqs ul {
    margin: 0;
    padding-left: 18px;
}

.ps-excel-reqs li + li {
    margin-top: 4px;
}

.ps-excel-reqs-renewal {
    margin-top: 10px;
    margin-left: -18px;
    list-style: none;
    color: #7b2cbf;
    font-weight: 700;
    line-height: 1.4;
}

.ps-excel-reqs-renewal[hidden] {
    display: none;
}

.ps-excel-template-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.ps-excel-template-link:hover {
    text-decoration: underline;
}

.ps-excel-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 18px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ps-excel-results[hidden] {
    display: none;
}

.ps-excel-progress-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.ps-excel-progress-bar {
    height: 6px;
    border-radius: 99px;
    background: #eceff3;
    overflow: hidden;
}

.ps-excel-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #7b2cbf;
    transition: width 0.2s ease;
}

.ps-excel-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ps-excel-summary-cards--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ps-excel-summary-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.ps-excel-summary-card span {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ps-excel-summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 1.2rem;
}

.ps-excel-summary-card.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ps-excel-summary-card.is-created {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.ps-excel-summary-card.is-error {
    background: #fef2f2;
    border-color: #fecaca;
}

.ps-excel-summary-note {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ps-excel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ps-excel-filter {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.ps-excel-filter.is-active {
    background: #7b2cbf;
    border-color: #7b2cbf;
    color: #fff;
}

.ps-excel-table-wrap {
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.ps-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ps-excel-table th,
.ps-excel-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.ps-excel-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-weight: 700;
    z-index: 1;
}

.ps-excel-table tr.is-ok td.ps-excel-result {
    color: #047857;
}

.ps-excel-table tr.is-warn td.ps-excel-result {
    color: #b45309;
}

.ps-excel-table tr.is-error td.ps-excel-result {
    color: #b91c1c;
}

.ps-excel-table td.ps-excel-action {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.ps-excel-row-create {
    border: 0;
    background: #7b2cbf;
    color: #fff;
    border-radius: 8px;
    padding: 5px 10px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.ps-excel-row-create:hover {
    background: #6d28d9;
}

.ps-excel-row-create:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ps-excel-created-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #047857;
}

.ps-excel-back,
.ps-excel-download {
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.ps-excel-back:hover,
.ps-excel-download:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .ps-excel-layout,
    .ps-excel-summary-cards,
    .ps-excel-summary-cards--3 {
        grid-template-columns: 1fr;
    }
}

/* ПП: список по дате отложения */
.ps-list-page {
    gap: 14px;
}

.ps-list-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    border-top-left-radius: calc(var(--radius) - 1px);
    border-top-right-radius: calc(var(--radius) - 1px);
}

.ps-list-header-title {
    margin: 0;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.ps-list-header-edit {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
}

.ps-list-header-edit:hover,
.ps-list-header-edit:focus-visible {
    border-color: var(--line);
    background: #fff;
    color: var(--accent);
    outline: none;
}

.ps-list-home {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    color: var(--text-muted);
    background: #fff;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ps-list-home:hover {
    background: var(--surface-muted);
    color: var(--text);
    border-color: #cbd5e1;
}

.ps-list-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    position: relative;
    z-index: 4;
    overflow: visible;
}

.ps-list-actions-normal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    width: 100%;
}

.ps-list-actions-normal[hidden] {
    display: none;
}

.ps-list-actions-mode {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.ps-list-actions-mode[hidden] {
    display: none;
}

.ps-list-actions-assign {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
}

.ps-list-actions-assign[hidden] {
    display: none;
}

.ps-list-mode-assign,
.ps-list-mode-postpone,
.ps-list-mode-refuse {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px 12px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.ps-list-mode-assign[hidden],
.ps-list-mode-postpone[hidden],
.ps-list-mode-refuse[hidden] {
    display: none;
}

.ps-list-postpone-title,
.ps-list-refuse-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.ps-list-postpone-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ps-list-refuse-setup-wrap {
    display: inline-flex;
}

.ps-list-refuse-setup-wrap .ps-list-refuse-setup:disabled {
    pointer-events: none;
}

.ps-list-refuse-setup {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 14px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.ps-list-refuse-setup:hover:not(:disabled),
.ps-list-refuse-setup:focus-visible:not(:disabled) {
    border-color: #b91c1c;
    color: #b91c1c;
}

.ps-list-refuse-setup:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ps-list-refuse-modal-body .ps-refuse-field:last-of-type {
    margin-bottom: 0;
}

.ps-list-refuse-modal-summary {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
}

.ps-list-refuse-modal-progress {
    margin-top: 4px;
}

.ps-list-refuse-modal-progress[hidden] {
    display: none;
}

.ps-list-refuse-progress-label {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.ps-list-refuse-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.ps-list-refuse-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b91c1c 0%, #dc2626 100%);
    transition: width 0.2s ease;
}

.ps-list-refuse-modal.is-refuse-running .ps-refuse-field,
.ps-list-refuse-modal.is-refuse-running .ps-list-refuse-modal-summary,
.ps-list-refuse-modal.is-refuse-running .ps-js-list-refuse-error {
    display: none;
}

.ps-list-refuse-modal.is-refuse-running .ps-js-list-refuse-modal-close,
.ps-list-refuse-modal.is-refuse-running .ps-js-list-refuse-modal-cancel {
    visibility: hidden;
    pointer-events: none;
}

.ps-list-postpone-date-root {
    position: relative;
}

.ps-list-postpone-date-root .ps-date-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    min-width: 280px;
    margin-bottom: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ps-list-postpone-date-root.is-cal-open .ps-date-picker {
    z-index: 60;
}

.ps-list-assign-master-check {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ps-list-row-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-list-check-box {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    position: relative;
    box-sizing: border-box;
}

.ps-list-row-check-input:checked + .ps-list-check-box {
    background: #0f172a;
    border-color: #0f172a;
}

.ps-list-row-check-input:checked + .ps-list-check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0.5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ps-list-row-check-input:indeterminate + .ps-list-check-box {
    background: #0f172a;
    border-color: #0f172a;
}

.ps-list-row-check-input:indeterminate + .ps-list-check-box::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 7px;
    width: 10px;
    height: 2px;
    background: #fff;
    transform: none;
    border: none;
}

.ps-list-assign-select-wrap {
    position: relative;
    flex-shrink: 0;
}

.ps-list-assign-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ps-list-assign-select-btn i {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.ps-list-assign-select-btn:hover,
.ps-list-assign-select-btn[aria-expanded="true"] {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.ps-list-assign-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 240px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ps-list-assign-select-menu[hidden] {
    display: none;
}

.ps-list-assign-select-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}

.ps-list-assign-select-item:hover {
    background: var(--surface-muted);
}

.ps-list-assign-select-first {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    cursor: pointer;
}

.ps-list-assign-select-first .ps-list-assign-select-item {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.ps-list-assign-select-first:hover .ps-list-assign-select-item {
    background: var(--surface-muted);
}

.ps-list-assign-select-first-n {
    width: 68px;
    flex-shrink: 0;
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    box-sizing: border-box;
}

.ps-list-assign-select-first-n:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.ps-list-assign-mgr-wrap {
    position: relative;
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 260px;
}

.ps-list-assign-mgr-search {
    margin-bottom: 0;
}

.ps-list-assign-mgr-wrap .ps-mgr-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 60;
    margin: 0;
}

.ps-list-assign-submit-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ps-list-assign-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: help;
}

.ps-list-assign-info:hover,
.ps-list-assign-info:focus-visible {
    color: var(--text);
}

.ps-list-assign-submit {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.ps-list-assign-submit:hover:not(:disabled) {
    background: var(--accent-hover);
}

.ps-list-assign-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ps-list-assign-submit.is-postpone-running:disabled {
    opacity: 1;
    cursor: progress;
}

.ps-list-assign-add-mgr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ps-list-assign-add-mgr:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.ps-list-assign-add-mgr:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.55;
}

body.ps-assign-mgr-modal-open {
    overflow: hidden;
}

.ps-assign-mgr-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ps-assign-mgr-modal[hidden] {
    display: none;
}

.ps-assign-mgr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.ps-assign-mgr-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.ps-assign-mgr-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.ps-assign-mgr-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.ps-assign-mgr-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.ps-assign-mgr-modal-close:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.ps-assign-mgr-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ps-assign-mgr-modal-summary {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: var(--text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ps-assign-mgr-modal-count-input {
    width: 72px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
}

.ps-assign-mgr-modal-count-input:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.ps-assign-mgr-modal-search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.ps-assign-mgr-modal-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.ps-assign-mgr-modal-search {
    width: 100%;
    min-height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ps-assign-mgr-modal-search:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.ps-assign-mgr-modal-results {
    position: relative;
    z-index: 2;
    margin-bottom: 12px;
}

.ps-assign-mgr-modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ps-assign-mgr-modal-list:empty {
    display: none;
}

.ps-assign-mgr-modal-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.ps-assign-mgr-modal-row-label {
    min-width: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.ps-assign-mgr-modal-row-qty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.ps-assign-mgr-modal-row-count {
    width: 64px;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
}

.ps-assign-mgr-modal-row-count:focus {
    outline: none;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.ps-assign-mgr-modal-row-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
}

.ps-assign-mgr-modal-row-remove:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.ps-assign-mgr-modal-error {
    margin: 12px 0 0;
    font-size: 0.86rem;
    color: #b91c1c;
}

.ps-assign-mgr-modal-error[hidden] {
    display: none;
}

.ps-assign-mgr-progress-bar {
    background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
}

.ps-assign-mgr-modal-result {
    margin-top: 4px;
}

.ps-assign-mgr-modal-result[hidden] {
    display: none;
}

.ps-assign-mgr-modal-result-message {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.ps-assign-mgr-modal-result-errors {
    margin: 0;
    padding-left: 18px;
    font-size: 0.86rem;
    color: #b91c1c;
}

.ps-assign-mgr-modal-result-errors[hidden] {
    display: none;
}

.ps-assign-mgr-modal.is-assign-running .ps-assign-mgr-modal-summary,
.ps-assign-mgr-modal.is-assign-running .ps-assign-mgr-modal-search-wrap,
.ps-assign-mgr-modal.is-assign-running .ps-assign-mgr-modal-results,
.ps-assign-mgr-modal.is-assign-running .ps-assign-mgr-modal-list,
.ps-assign-mgr-modal.is-assign-running .ps-js-assign-mgr-modal-error,
.ps-assign-mgr-modal.is-assign-done .ps-assign-mgr-modal-summary,
.ps-assign-mgr-modal.is-assign-done .ps-assign-mgr-modal-search-wrap,
.ps-assign-mgr-modal.is-assign-done .ps-assign-mgr-modal-results,
.ps-assign-mgr-modal.is-assign-done .ps-assign-mgr-modal-list,
.ps-assign-mgr-modal.is-assign-done .ps-js-assign-mgr-modal-error {
    display: none;
}

.ps-assign-mgr-modal.is-assign-running .ps-js-assign-mgr-modal-close,
.ps-assign-mgr-modal.is-assign-running .ps-js-assign-mgr-modal-cancel,
.ps-assign-mgr-modal.is-assign-running .ps-js-assign-mgr-modal-redistribute {
    visibility: hidden;
    pointer-events: none;
}

.ps-assign-mgr-modal.is-assign-done .ps-js-assign-mgr-modal-redistribute {
    display: none;
}

.ps-assign-mgr-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.ps-assign-mgr-modal-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ps-assign-mgr-modal-redistribute {
    min-height: 38px;
    padding: 0 16px;
    margin-left: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ps-assign-mgr-modal-redistribute:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.ps-assign-mgr-modal-redistribute:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.55;
}

.ps-assign-mgr-modal-cancel {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.ps-assign-mgr-modal-cancel:hover {
    background: var(--surface-muted);
}

.ps-list-assign-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ps-list-assign-close:hover {
    background: var(--surface-muted);
    color: var(--text);
    border-color: #cbd5e1;
}

.ps-list-row-line {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e2e8f0;
}

.ps-list-flag {
    --ps-flag-on: #e85a2a;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: stretch;
    width: 28px;
    margin: 0 0 0 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, color 0.12s ease;
    user-select: none;
}

.ps-list-flag i {
    font-size: 0.78rem;
    pointer-events: none;
}

.ps-list-row-line:hover .ps-list-flag,
.clients-ps-row-line:hover .ps-list-flag,
.ps-list-flag.is-on,
.ps-list-flag:focus-visible {
    pointer-events: auto;
}

.ps-list-row-line:hover .ps-list-flag:not(.is-on),
.clients-ps-row-line:hover .ps-list-flag:not(.is-on) {
    opacity: 0.28;
}

.ps-list-row-line:hover .ps-list-flag:not(.is-on):hover,
.clients-ps-row-line:hover .ps-list-flag:not(.is-on):hover,
.ps-list-flag:not(.is-on):focus-visible {
    opacity: 0.5;
    color: #64748b;
}

.ps-list-flag.is-on {
    opacity: 1;
    color: var(--ps-flag-on);
}

.ps-list-flag:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: -2px;
    border-radius: 4px;
}

.ps-list-page .ps-list-row {
    padding-left: 8px;
}

.ps-list-page .ps-list-row-line:hover,
.ps-list-page .ps-list-row-line:hover .ps-list-row {
    background: #f8fafc;
}

.ps-list-row-line.is-ps-open,
.ps-list-row-line.is-ps-open:hover,
.ps-list-page .ps-list-row-line.is-ps-open,
.ps-list-page .ps-list-row-line.is-ps-open:hover,
.ps-list-row-line.is-ps-open .ps-list-row,
.ps-list-row-line.is-ps-open:hover .ps-list-row,
.ps-list-page .ps-list-row-line.is-ps-open .ps-list-row,
.ps-list-page .ps-list-row-line.is-ps-open:hover .ps-list-row,
.ps-list-row.is-ps-open,
.ps-list-row.is-ps-open:hover {
    background: var(--ps-row-open-bg);
}

.ps-list-row-line:last-child {
    border-bottom: none;
}

.ps-list-row-check {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    padding-left: 16px;
    cursor: pointer;
    box-sizing: border-box;
}

.ps-list-wrap.is-assign-mode .ps-list-row-check,
.ps-list-wrap.is-list-action-mode .ps-list-row-check {
    display: inline-flex;
}

.ps-list-row-check--disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.ps-list-row-check-input:disabled + .ps-list-check-box {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.ps-list-row-line .ps-list-row {
    flex: 1;
    min-width: 0;
    border-bottom: none;
}

.ps-list-actions-wrap {
    position: relative;
    flex-shrink: 0;
}

.ps-list-actions-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.ps-list-online-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.ps-list-online-check-label {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

.ps-list-actions-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ps-list-actions-btn i {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.ps-list-actions-btn:hover,
.ps-list-actions-btn[aria-expanded="true"] {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.ps-list-actions-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.ps-list-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 80;
    min-width: 220px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.ps-list-actions-menu[hidden] {
    display: none;
}

.ps-list-actions-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}

.ps-list-actions-menu-item:hover:not(:disabled) {
    background: var(--surface-muted);
}

.ps-list-actions-menu-item:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.ps-list-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: visible;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.ps-list-wrap > .ps-list-row-line:last-child,
.ps-list-wrap > .ps-list-date-group:last-child,
.ps-list-wrap > .ps-list-empty:last-child,
.ps-list-wrap > .ps-list-inline-alert:last-child {
    border-bottom-left-radius: calc(var(--radius) - 1px);
    border-bottom-right-radius: calc(var(--radius) - 1px);
}

.ps-list-date-group {
    padding: 6px 16px 5px;
    background: linear-gradient(
        90deg,
        #dde4ed 0%,
        #e8edf3 14%,
        #f1f5f9 42%,
        #f8fafc 100%
    );
    border-bottom: 1px solid #e2e8f0;
    box-shadow: inset 2px 1px 4px rgba(15, 23, 42, 0.09);
}

.ps-list-date-group + .ps-list-date-group {
    border-top: 1px solid #e2e8f0;
}

.ps-list-date-group-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.ps-list-wrap .ps-list-inline-alert {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.ps-list-empty {
    margin: 0;
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.ps-list-row {
    display: grid;
    /* Колонки списка ПП: продукт | дата | ИНН-КПП | организация | статус | бронь/счета | менеджер. */
    grid-template-columns: minmax(120px, 0.8fr) minmax(128px, 0.92fr) minmax(88px, 1.2fr) minmax(0, 1.6fr) minmax(13.5rem, 1.25fr) calc(20ch + 36px) minmax(88px, 1fr);
    gap: 8px 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    font-size: 0.86rem;
    line-height: 1.35;
    transition: background 0.12s ease;
}

.ps-list-row-line:last-child .ps-list-row {
    border-bottom: none;
}

.ps-list-row:hover {
    background: #f8fafc;
}

.ps-list-row--new {
    font-weight: 700;
}

.ps-list-row--new .ps-list-type,
.ps-list-row--new .ps-list-cell--org,
.ps-list-row--new .ps-list-cell--when,
.ps-list-row--new .ps-list-inn,
.ps-list-row--new .ps-list-cell--mgr {
    font-weight: 700;
}

.ps-list-cell {
    min-width: 0;
}

.ps-list-cell--product {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-list-product-icon-wrap {
    display: inline-flex;
    flex-shrink: 0;
    cursor: default;
}

.ps-list-product-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.ps-list-product-icon--empty {
    display: inline-block;
    background: #f1f5f9;
}

.ps-list-type {
    font-weight: 500;
    color: var(--text);
}

.ps-list-type--local,
.ps-shell-meta-type.ps-list-type--local {
    color: #0f766e;
}

.ps-create-local-seller-row {
    align-items: flex-start;
    gap: 0.75rem;
}

.ps-create-local-seller-name {
    font-weight: 650;
}

.ps-create-local-seller-hint {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: #0f766e;
    line-height: 1.35;
}

.ps-client-create-local-hint {
    margin: 0.35rem 0 0 1.7rem;
    font-size: 0.82rem;
    color: #0f766e;
}

.ps-create-local-check {
    margin-top: 0.15rem;
}

.ps-list-cell--when {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
    color: #475569;
    white-space: nowrap;
}

.ps-list-when--online-until {
    white-space: normal;
    line-height: 1.3;
    font-weight: 400;
}

.ps-list-cell--when:has(.ps-list-when--online-until) {
    white-space: normal;
    align-items: flex-start;
}

.ps-list-tz {
    flex-shrink: 0;
    font-size: 0.82em;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
}

.ps-list-cell--idline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.ps-list-temp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.ps-list-temp-dot.ps-list-temp--1 {
    background: #ef4444;
}

.ps-list-temp-dot.ps-list-temp--2 {
    background: #f9ad01;
}

.ps-list-temp-dot.ps-list-temp--3 {
    background: #3b82f6;
}

.ps-list-inn {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    white-space: nowrap;
}

.ps-list-cell--org {
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.ps-list-cell--status {
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-list-status-ico {
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.ps-list-status-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-list-statuscell--new {
    font-weight: 700;
    text-transform: uppercase;
    color: #0f172a;
}

.ps-list-statuscell--work {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ps-list-statuscell--online-channel {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.ps-list-cell--bills {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.ps-list-reservation {
    flex: 0 0 20ch;
    width: 20ch;
    max-width: 20ch;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    color: #64748b;
    white-space: nowrap;
}

.ps-list-reservation--loading {
    position: relative;
    display: inline-block;
    flex: 0 0 20ch;
    width: 20ch;
    max-width: 20ch;
    height: 0.95em;
    color: transparent;
    user-select: none;
    pointer-events: none;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.ps-list-reservation--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 45%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.55) 55%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: ps-list-reservation-shimmer 1.35s ease-in-out infinite;
}

@keyframes ps-list-reservation-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps-list-reservation--loading::after {
        animation: none;
        transform: none;
        opacity: 0.35;
    }
}

.ps-list-reservation--expired {
    color: #b91c1c;
}

.ps-list-reservation--pending {
    color: #64748b;
}

.ps-list-billtag-slot {
    flex: 0 0 32px;
    width: 32px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.ps-list-billtag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: #fff;
}

.ps-list-billtag--paid {
    border-color: #94a3b8;
}

.ps-list-billtag--paid.ps-list-billtag--full {
    background: #ecfdf5;
    border-color: #86efac;
    color: #15803d;
}

.ps-list-billtag--paid.ps-list-billtag--partial {
    background: #fefce8;
    border-color: #fde047;
    color: #a16207;
}

.ps-list-billcur {
    font-weight: 700;
}

.ps-list-cell--mgr {
    text-align: right;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-list-pagination,
.app-list-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    padding: 0;
    font-size: inherit;
    flex-wrap: wrap;
}

.app-list-pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.app-list-footer,
.ps-list-footer,
.app-search-page-footer,
.clients-ps-footer,
.clients-bookings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.app-list-footer-nav {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.app-list-footer-total {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 14px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.app-list-page-link,
.ps-list-pagelink {
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    color: #4e5570;
    text-decoration: none;
    font-weight: 600;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

button.app-list-page-link {
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.app-list-page-link:hover,
.ps-list-pagelink:hover {
    border-color: #b9c2f7;
    color: #3642b8;
}

.app-list-page-link.is-current,
.ps-list-pagelink.is-current {
    border-color: #ced6ff;
    background: #eef2ff;
    color: #3f4bd1;
    cursor: default;
}

.app-list-page-gap,
.ps-list-pagegap {
    color: #8e94a6;
    padding: 0 2px;
    user-select: none;
}

.app-list-page-next,
.ps-list-pagenext {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    margin-left: 2px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: #4e5570;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    box-sizing: border-box;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

button.app-list-page-next {
    margin: 0 0 0 2px;
    font: inherit;
    cursor: pointer;
}

button.app-list-page-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.app-list-page-next:hover,
.ps-list-pagenext:hover {
    border-color: #b9c2f7;
    color: #3642b8;
    text-decoration: none;
}

.app-list-page-next i,
.ps-list-pagenext i {
    font-size: 0.72rem;
}

.ps-calendar-cell--day:not(a) {
    cursor: default;
}

@media (max-width: 960px) {
    
.app-grid-3,
    .app-grid-2 {
        grid-template-columns: 1fr;
    }

    
.app-main {
        padding: 18px;
    }

    
.app-main-clients {
        padding: 18px 18px 18px;
    }

    
.app-main-ps {
        padding: 18px 16px 20px;
    }

    
.ps-calendar-body {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
    }

    
.ps-calendar-nav {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    
.ps-add-billing-form,
    .ps-add-billing-controls {
        align-items: stretch;
        flex-direction: column;
    }

    
.ps-add-billing-controls {
        flex-basis: auto;
        min-width: 0;
    }

    
.ps-add-billing-input {
        width: 100%;
    }

    
.ps-bottom-row {
        grid-template-columns: 1fr;
    }

    
.ps-limits-item-head {
        flex-direction: column;
        align-items: flex-start;
    }

    
.ps-limits-item-stats {
        white-space: normal;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-nav-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 11px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    color: var(--sidebar-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-nav-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-nav-trigger:focus,
.app-nav-trigger:focus-visible {
    outline: none;
}

.app-nav-trigger.is-active {
    background: rgba(99, 102, 241, 0.18);
    color: var(--sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.25);
}

.app-nav-resources {
    min-width: 0;
    max-width: 100%;
}

.app-nav-resources-head {
    position: relative;
    min-width: 0;
}

.app-nav-resources-chevron {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 0.9rem;
    line-height: 1;
    color: #94a3b8;
    transform: rotate(-90deg);
    transition: transform 0.15s ease, color 0.15s ease;
}

.app-nav-resources.is-open .app-nav-resources-chevron,
.app-nav-resources-head .app-nav-trigger:hover .app-nav-resources-chevron {
    color: #fff;
}

.app-nav-resources.is-open .app-nav-resources-chevron {
    transform: rotate(0deg);
}

.app-nav-resources-tip {
    position: fixed;
    z-index: 120;
    padding: 7px 11px;
    border-radius: 8px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: pre;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.app-nav-resources-tip[hidden] {
    display: none;
}

.app-nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 8px;
    padding-left: 8px;
}

.app-nav-sub[hidden] {
    display: none;
}

.app-nav .app-nav-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.25;
    text-decoration: none;
}

.app-nav .app-nav-sublink:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-nav-subicon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: #e2e8f0;
}

.app-nav-subicon img {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.app-nav-subicon .las {
    font-size: 1rem;
    line-height: 1;
}

.app-nav-sublabel {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-nav-subext {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: #64748b;
}

.app-nav-sublink:hover .app-nav-subext {
    color: #cbd5e1;
}

@media (max-width: 1600px) {
    .app-nav-resources-chevron {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .app-nav-resources-head .app-nav-trigger[data-nav-tip]::before,
    .app-nav-resources-head .app-nav-trigger[data-nav-tip]::after,
    .app-nav-resources.is-open .app-nav-trigger[data-nav-tip]::before,
    .app-nav-resources.is-open .app-nav-trigger[data-nav-tip]::after {
        opacity: 0;
        visibility: hidden;
    }

    .app-nav-sub.is-flyout {
        position: fixed;
        z-index: 80;
        width: 280px;
        margin: 0;
        padding: 8px;
        background: #111827;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    }

    .app-nav-sub.is-flyout .app-nav-sublink {
        justify-content: flex-start;
        gap: 8px;
        padding: 6px 8px 6px 10px;
    }
}

.app-global-search {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 56px 16px 24px;
}

.app-global-search[hidden] {
    display: none;
}

.app-global-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.app-global-search-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.app-global-search-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 18px 10px 20px;
}

.app-global-search-input-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-global-search-input-icon {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 1rem;
}

.app-global-search-input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    color: var(--text);
}

.app-global-search-input::placeholder {
    color: #94a3b8;
}

.app-global-search-input::-webkit-search-cancel-button,
.app-global-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.app-global-search-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.app-global-search-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

.app-global-search-toolbar {
    padding: 0 20px 12px;
}

.app-global-search-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.app-global-search-filter {
    appearance: none;
    margin: 0;
    padding: 6px 30px 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
}

.app-global-search-filter:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.app-global-search-filter-chevron {
    position: absolute;
    right: 11px;
    pointer-events: none;
    font-size: 0.68rem;
    color: #94a3b8;
}

.app-global-search-results-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-top: 1px solid #f1f5f9;
}

.app-global-search-status {
    padding: 28px 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.app-global-search-status--loading {
    padding: 0;
    text-align: left;
}

.app-global-search-results-wrap:has(.app-global-search-result) .app-global-search-status--loading {
    border-top: 1px solid #f1f5f9;
}

.app-global-search-results-wrap:not(:has(.app-global-search-result)) .app-global-search-status--loading {
    padding: 6px 0;
}

.app-global-search-loading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
}

.app-global-search-loading-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-global-search-shimmer {
    display: block;
    border-radius: 4px;
    background: #eef2f7;
    position: relative;
    overflow: hidden;
}

.app-global-search-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 45%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.55) 55%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: app-global-search-shimmer 1.35s ease-in-out infinite;
}

.app-global-search-shimmer--title {
    width: 58%;
    height: 12px;
}

.app-global-search-shimmer--subtitle {
    width: 42%;
    height: 10px;
}

.app-global-search-shimmer--tag {
    flex-shrink: 0;
    width: 36px;
    height: 10px;
    margin-top: 2px;
}

@keyframes app-global-search-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-global-search-shimmer::after {
        animation: none;
        transform: none;
        opacity: 0.35;
    }
}

.app-global-search-results-wrap:has(.app-global-search-result) .app-global-search-status:not(.app-global-search-status--loading) {
    padding: 10px 20px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.app-global-search-results {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.app-global-search-result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.app-global-search-result:hover,
.app-global-search-result.is-active {
    background: #f8fafc;
}

.app-global-search-result-body {
    flex: 1 1 auto;
    min-width: 0;
}

.app-global-search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-global-search-result-subtitle {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-global-search-result-tag {
    flex-shrink: 0;
    padding-top: 2px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.app-global-search-result--more .app-global-search-result-title {
    font-weight: 400;
    color: var(--text-muted);
}

.app-global-search-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fcfdff;
}

.app-global-search-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: #94a3b8;
    white-space: nowrap;
}

.app-global-search-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1;
    color: #64748b;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.app-global-search-kbd i {
    font-size: 0.58rem;
}

.app-global-search-result--related .app-global-search-result-title {
    font-weight: 400;
}

.app-global-search-result--related .app-global-search-result-subtitle {
    color: #94a3b8;
}

.app-instant-tip--search-preview {
    z-index: 10070;
    width: min(320px, calc(100vw - 24px));
    max-width: 320px;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.app-instant-tip--ps-product {
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px 10px;
}

.app-instant-tip--ps-product.is-list {
    max-width: min(320px, calc(100vw - 24px));
}

.ps-product-tip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-product-tip--list {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.ps-product-tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ps-product-tip-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.ps-product-tip-icon--empty {
    display: inline-block;
    background: #e2e8f0;
    border-radius: 4px;
}

.ps-product-tip-name {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
}

.bill-drawer-product-name.app-instant-tip-anchor,
.clients-bills-product-name.app-instant-tip-anchor {
    cursor: help;
    border-bottom: 1px dotted currentColor;
}

.app-search-tip {
    display: flex;
    flex-direction: column;
}

.app-search-tip-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #eef2f7;
}

.app-search-tip-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.9rem;
}

.app-search-tip-avatar--client {
    background: #ecfeff;
    color: #0891b2;
}

.app-search-tip-avatar--ps {
    background: #fff7ed;
    color: #ea580c;
}

.app-search-tip-head-copy {
    min-width: 0;
}

.app-search-tip-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.app-search-tip-subtitle {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.app-search-tip-body {
    display: grid;
    gap: 6px;
    padding: 10px 14px 12px;
}

.app-search-tip-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #334155;
}

.app-search-tip-line i {
    width: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    color: #94a3b8;
    text-align: center;
}

.app-search-tip-section {
    padding: 0 14px 12px;
}

.app-search-tip-section-title {
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.app-search-tip-card + .app-search-tip-card {
    margin-top: 6px;
}

.app-search-tip-card {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.app-search-tip-card-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
}

.app-search-tip-card-subtitle {
    margin-top: 2px;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.app-main-search {
    padding: 20px 28px 28px;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 0;
}

.app-search-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(920px, 100%);
    margin: 0 auto;
    min-height: calc(100vh - 96px);
    max-height: calc(100vh - 96px);
}

.app-search-page--empty {
    min-height: auto;
    max-height: none;
    justify-content: center;
}

.app-search-page-empty-card {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    padding: 28px 24px;
}

.app-search-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 20px;
    flex-shrink: 0;
}

.app-search-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

.app-search-page-meta {
    margin: 6px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.app-search-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.app-search-page-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.app-global-search-results--page {
    padding: 6px 0;
}

.app-search-page-footer {
    flex-shrink: 0;
    padding-top: 4px;
}

.app-search-page-empty,
.app-search-page-alert {
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .app-global-search {
        padding-top: 12px;
        align-items: stretch;
    }

    .app-global-search-dialog {
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .app-global-search-footer {
        display: none;
    }
}

/* Главная — персональная статистика */
.app-shimmer {
    position: relative;
    overflow: hidden;
    background: #eef2f7;
    border-radius: 12px;
}

.app-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.55) 45%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.55) 55%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: app-global-search-shimmer 1.35s ease-in-out infinite;
}

.home-stats-presets {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--surface-muted, #f1f5f9);
}

.home-stats-preset {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.home-stats-preset:hover:not(:disabled) {
    color: var(--text);
}

.home-stats-preset.is-active {
    background: var(--accent-soft, #eef2ff);
    color: var(--accent, #4f46e5);
}

.home-stats-preset:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.home-stats-period-wrap {
    position: relative;
}

.home-stats-period-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-stats-period-btn:hover:not(:disabled) {
    border-color: #c5d4f5;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.home-stats-period-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.home-stats-period-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f4f8ff;
    color: #2563eb;
    flex-shrink: 0;
}

.home-stat-calendar-glyph {
    display: block;
    background-color: currentColor;
    -webkit-mask-image: url('stat-icons/stat-calendar.svg');
    mask-image: url('stat-icons/stat-calendar.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.home-stat-calendar-glyph--period {
    width: 18px;
    height: 18px;
}

.home-stat-calendar-glyph--today {
    width: 22px;
    height: 22px;
}

.home-stats-period-btn-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.home-stats-period-btn-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.home-stats-period-btn-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.home-stats-period-btn-chevron {
    color: var(--text-muted);
    font-size: 1rem;
}

.home-stats-period-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.home-stats-period-popover-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 650;
}

.home-stats-period-popover-copy {
    margin: 0 0 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.home-stats-period-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    margin-bottom: 16px;
}

.home-stats-period-field {
    flex: 1 1 140px;
    margin: 0;
}

.home-stats-period-sep {
    align-self: center;
    padding-bottom: 10px;
    color: var(--text-muted);
}

.home-stats-period-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 900px) {
    .home-stats-period-popover {
        left: 0;
        right: auto;
    }
}

@media (max-width: 640px) {
    .home-stats-period-wrap,
    .home-stats-period-btn {
        width: auto;
        max-width: 100%;
    }
}

/* Телефония */
.telephony-settings-page {
    max-width: 72rem;
}

.telephony-settings-form {
    max-width: none;
}

.telephony-module-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.telephony-module-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
}

.telephony-module-toggle-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.telephony-module-toggle-title {
    font-size: 0.98rem;
    color: var(--text, #0f172a);
}

.telephony-module-toggle-desc {
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-module-state {
    flex-shrink: 0;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.telephony-module-state.is-on {
    background: #dcfce7;
    color: #166534;
}

.telephony-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.telephony-provider-nav-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.telephony-provider-panels {
    min-height: 420px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.telephony-provider-panel {
    display: none;
}

.telephony-provider-panel.is-active {
    display: block;
    animation: telephony-panel-in 0.22s ease;
}

@keyframes telephony-panel-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.telephony-provider-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #e8edf5;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.telephony-provider-panel-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text, #0f172a);
}

.telephony-provider-panel-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.86rem;
    color: var(--text-muted, #64748b);
}

.telephony-provider-panel-enable {
    flex-shrink: 0;
    margin: 0;
    padding: 0.45rem 0.7rem;
    border: 1px solid #dbe3f0;
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    white-space: nowrap;
}

.telephony-provider-panel-body {
    padding: 1.15rem 1.25rem 1.25rem;
}

.telephony-provider-panel-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.telephony-provider-panel-note {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.telephony-provider-panel-note-text {
    margin: 0 0 0.75rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
}

.telephony-provider-panel-note--proxy {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.telephony-provider-panel-note-label {
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text, #0f172a);
}

.telephony-provider-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid #eef2f7;
}

.telephony-enabled-field {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.telephony-section-head {
    margin-bottom: 0.85rem;
}

.telephony-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #0f172a);
}

.telephony-section-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
}

.telephony-provider-section,
.telephony-credentials-section {
    margin-bottom: 1.5rem;
}

.telephony-credentials-section .app-field:first-of-type {
    margin-top: 0;
}

.telephony-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.telephony-provider-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 108px;
    margin: 0;
    padding: 0.9rem 0.95rem 0.85rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.telephony-provider-card:hover {
    border-color: #bfd0f6;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.telephony-provider-card.is-selected {
    border-color: #5b8def;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14), 0 10px 24px rgba(37, 99, 235, 0.1);
}

.telephony-provider-card.is-enabled:not(.is-selected) {
    border-color: #b9dfc8;
    background: linear-gradient(180deg, #fff 0%, #f6fcf8 100%);
}

.telephony-provider-card--soon {
    cursor: default;
    opacity: 0.72;
    background: #f8fafc;
}

.telephony-provider-card--soon:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--line, #e2e8f0);
}

.telephony-provider-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.telephony-provider-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: transparent;
    font-size: 0.85rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.telephony-provider-card.is-selected .telephony-provider-card-check {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.telephony-provider-card-logo {
    display: flex;
    align-items: center;
    min-height: 34px;
    margin-bottom: 0.55rem;
    padding-right: 1.5rem;
}

.telephony-provider-card-logo img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 32px;
    object-fit: contain;
    object-position: left center;
}

.telephony-provider-card-logo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    border-radius: 10px;
    background: #e8edf5;
    color: #64748b;
    font-size: 1.05rem;
}

.telephony-provider-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.telephony-provider-card-desc {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.telephony-provider-card-status {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 0.2rem;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.telephony-provider-card-status.is-on {
    background: #dcfce7;
    color: #166534;
}

.telephony-provider-card-status.is-pending {
    background: #fef3c7;
    color: #92400e;
}

.telephony-provider-card-status.is-off {
    background: #f1f5f9;
    color: #64748b;
}

.telephony-provider-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@media (max-width: 720px) {
    .telephony-provider-grid {
        grid-template-columns: 1fr;
    }

    .telephony-layout {
        grid-template-columns: 1fr;
    }

    .telephony-provider-panels {
        min-height: 0;
    }

    .telephony-provider-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .telephony-provider-panel-fields {
        grid-template-columns: 1fr;
    }

    .telephony-module-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

.telephony-settings-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 1.25rem;
}

.telephony-settings-status {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

.telephony-settings-status.is-ok {
    color: #15803d;
}

.telephony-settings-status.is-error {
    color: #b91c1c;
}

.telephony-provider-test-status {
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-provider-test-status.is-ok {
    color: #15803d;
}

.telephony-provider-test-status.is-error {
    color: #b91c1c;
}

.telephony-webhook-url {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.telephony-webhook-url code {
    font-size: 0.82rem;
    word-break: break-all;
}

.app-user-telephony {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.app-user-telephony-head {
    margin-bottom: 1rem;
}

.app-user-telephony-head h2 {
    margin: 0 0 0.35rem;
}

.app-user-telephony-head p {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 42rem;
}

.app-user-telephony-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.app-user-telephony-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.app-user-telephony-card--novofon {
    border-color: #c7d8fa;
    background: linear-gradient(180deg, #fff 0%, #f5f8ff 100%);
}

.app-user-telephony-card--yeastar {
    border-color: #c9e3d3;
    background: linear-gradient(180deg, #fff 0%, #f4fbf7 100%);
}

.app-user-telephony-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.app-user-telephony-card-brand {
    min-width: 0;
    flex: 1;
}

.app-user-telephony-card-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 30px;
    object-fit: contain;
    object-position: left center;
}

.app-user-telephony-card-logo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 30px;
    border-radius: 10px;
    background: #e8edf5;
    color: #64748b;
    font-size: 1rem;
}

.app-user-telephony-card-status {
    flex-shrink: 0;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.app-user-telephony-card-status.is-configured {
    background: #dcfce7;
    color: #166534;
}

.app-user-telephony-card--novofon .app-user-telephony-card-status.is-configured {
    background: #dbeafe;
    color: #1d4ed8;
}

.app-user-telephony-card-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted, #64748b);
}

.app-user-telephony-card-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.15rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.app-user-telephony-card-fields .app-field {
    margin: 0;
}

.app-user-telephony-card-fields label {
    font-size: 0.84rem;
}

.app-user-telephony-card-fields input {
    font-size: 0.92rem;
}

@media (max-width: 720px) {
    .app-user-telephony-grid {
        grid-template-columns: 1fr;
    }
}

.clients-contact-phone-field {
    position: relative;
}

.clients-contact-phone-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.35rem;
}

.clients-contact-phone-field .app-telephony-call-wrap {
    position: relative;
}

.ps-org-contact-phone-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}

.ps-org-contact-phone-row .app-telephony-call-wrap {
    position: relative;
}

.app-telephony-call-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.app-telephony-call-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.app-telephony-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--accent, #2563eb);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
}

.app-telephony-call-provider {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.app-telephony-call-wrap--multi .app-telephony-call-provider {
    background: #f1f5f9;
    color: #334155;
}

.app-telephony-call-btn:hover:not(:disabled) {
    border-color: var(--accent, #2563eb);
    background: #f8fafc;
}

.app-telephony-call-btn.is-disabled,
.app-telephony-call-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: #64748b;
}

.app-hint-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 140;
    display: none;
    width: max-content;
    max-width: 220px;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text, #0f172a);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    pointer-events: none;
    white-space: normal;
    text-align: center;
}

.app-hint-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #e2e8f0;
}

.app-hint-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -1px);
    border: 5px solid transparent;
    border-top-color: #fff;
}

.app-telephony-call-wrap:hover .app-hint-tooltip,
.app-telephony-call-wrap:focus-within .app-hint-tooltip {
    display: block;
}

.app-telephony-call-wrap--dynamic .app-hint-tooltip[hidden] {
    display: none !important;
}

.app-telephony-call-wrap--dynamic:hover .app-hint-tooltip:not([hidden]),
.app-telephony-call-wrap--dynamic:focus-within .app-hint-tooltip:not([hidden]) {
    display: block;
}

/* Payments page */
.ps-filter-period-slot {
    margin-top: 14px;
}

.ps-filter-check-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-theme-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0 18px 18px;
}

.app-theme-picker-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-theme-picker-option i {
    font-size: 1.25rem;
}

.app-theme-picker-option:hover {
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text);
}

.app-theme-picker-option.is-active {
    border-color: rgba(99, 102, 241, 0.55);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
}

.app-profile-card--appearance .app-profile-card-head {
    border-bottom: none;
    padding-bottom: 0;
}

.app-profile-theme-note {
    margin: 0;
    padding: 0 18px 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-muted);
}

@media (max-width: 520px) {
    .app-theme-picker {
        grid-template-columns: 1fr;
    }

    .app-theme-picker-option {
        flex-direction: row;
        min-height: 52px;
        justify-content: flex-start;
        padding: 12px 14px;
    }
}

/* --- In-app notifications (bottom-right cards) --- */
.app-notification-host {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 360;
    width: min(400px, calc(100vw - 40px));
    pointer-events: none;
}

.app-notification-stack-wrap {
    position: relative;
    max-height: 50vh;
    min-height: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 0 16px;
}

.app-notification-stack-viewport {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
}

.app-notification-fade {
    position: absolute;
    left: 0;
    right: 0;
    height: 48px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.app-notification-fade--top {
    top: 0;
    background: linear-gradient(
        180deg,
        var(--bg, #f4f6fb) 0%,
        color-mix(in srgb, var(--bg, #f4f6fb) 72%, transparent) 52%,
        transparent 100%
    );
}

.app-notification-fade--bottom {
    bottom: 0;
    background: linear-gradient(
        0deg,
        var(--bg, #f4f6fb) 0%,
        color-mix(in srgb, var(--bg, #f4f6fb) 72%, transparent) 52%,
        transparent 100%
    );
}

.app-notification-stack-viewport.show-top-fade .app-notification-fade--top,
.app-notification-stack-viewport.show-bottom-fade .app-notification-fade--bottom {
    opacity: 1;
}

.app-notification-stack {
    max-height: calc(50vh - 48px);
    min-height: 0;
    overflow-y: auto;
    display: block;
    padding: 8px 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.app-notification-stack::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-notification-stack > .app-notification-card + .app-notification-card {
    margin-top: 12px;
}

.app-notification-card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-left: 3px solid #64748b;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    animation: app-notification-enter 0.28s ease forwards;
    pointer-events: auto;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.app-notification-card--success {
    border-color: rgba(34, 197, 94, 0.16);
    border-left-color: #22c55e;
    background:
        linear-gradient(120deg, rgba(236, 253, 245, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%),
        #fff;
    box-shadow: 0 1px 0 rgba(34, 197, 94, 0.05), 0 3px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-notification-card--warning {
    border-color: rgba(245, 158, 11, 0.18);
    border-left-color: #f59e0b;
    background:
        linear-gradient(120deg, rgba(255, 251, 235, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%),
        #fff;
    box-shadow: 0 1px 0 rgba(245, 158, 11, 0.06), 0 3px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-notification-card--info {
    border-color: rgba(59, 130, 246, 0.16);
    border-left-color: #3b82f6;
    background:
        linear-gradient(120deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.58) 44%, rgba(255, 255, 255, 0) 100%),
        #fff;
    box-shadow: 0 1px 0 rgba(59, 130, 246, 0.05), 0 3px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-notification-card:hover {
    border-color: rgba(15, 23, 42, 0.14);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.app-notification-card--success:hover {
    border-color: rgba(34, 197, 94, 0.24);
    border-left-color: #22c55e;
}

.app-notification-card--warning:hover {
    border-color: rgba(245, 158, 11, 0.28);
    border-left-color: #f59e0b;
}

.app-notification-card--info:hover {
    border-color: rgba(59, 130, 246, 0.24);
    border-left-color: #3b82f6;
}

.app-notification-card.is-leaving {
    animation: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

@keyframes app-notification-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-notification-inner {
    flex: 1 1 auto;
    min-width: 0;
    padding: 14px 40px 14px 14px;
}

.app-notification-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.app-notification-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    font-size: 14px;
    color: #fff;
    background: #64748b;
}

.app-notification-card--success .app-notification-icon {
    background: #22c55e;
}

.app-notification-card--warning .app-notification-icon {
    background: #f59e0b;
}

.app-notification-card--info .app-notification-icon {
    background: #3b82f6;
}

.app-notification-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.app-notification-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.app-notification-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
}

.app-notification-time {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    flex: 0 0 auto;
}

.app-notification-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 44px;
}

.app-notification-line {
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
    word-break: break-word;
}

.app-notification-line--amount {
    font-size: 18px;
    font-weight: 700;
    color: #16a34a;
    margin-top: 2px;
}

.app-notification-line--muted {
    color: #64748b;
    font-size: 12px;
}

.app-notification-line--call-time {
    color: #d97706;
    font-weight: 600;
    margin-top: 2px;
}

.app-notification-line--admin-text {
    white-space: pre-wrap;
}

.app-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.app-notification-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}

.app-notification-clear-all {
    flex: 0 0 auto;
    width: 100%;
    margin: 8px 0 0;
    padding: 10px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    pointer-events: auto;
}

.app-notification-clear-all:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #c7d2e0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.app-notification-clear-all:disabled {
    opacity: 0.65;
    cursor: default;
}

.ps-date-notify-call {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    user-select: none;
}

.ps-date-notify-call.is-disabled {
    opacity: 0.55;
}

.ps-date-notify-call.is-disabled .ps-date-notify-toggle {
    pointer-events: none;
}

.ps-date-notify-call-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex: 0 0 24px;
    color: #64748b;
    font-size: 17px;
}

.ps-date-notify-call-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
}

.ps-date-notify-toggle {
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
}

.ps-date-notify-toggle input:focus-visible + .ps-date-notify-toggle-track {
    outline: 2px solid var(--accent, #4f46e5);
    outline-offset: 2px;
}

.ps-date-notify-toggle-track {
    display: block;
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
}

.ps-date-notify-toggle input:checked + .ps-date-notify-toggle-track {
    background: var(--accent, #4f46e5);
}

.ps-date-notify-toggle input:disabled + .ps-date-notify-toggle-track {
    cursor: not-allowed;
}

.ps-date-notify-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease;
}

.ps-date-notify-toggle input:checked + .ps-date-notify-toggle-track .ps-date-notify-toggle-thumb {
    transform: translateX(18px);
}

/* Модалка «Отправить сообщение» (список пользователей) */
body.app-user-notify-modal-open {
    overflow: hidden;
}

.app-user-notify-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.app-user-notify-modal[hidden] {
    display: none;
}

.app-user-notify-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.app-user-notify-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.app-user-notify-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.app-user-notify-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line, #e2e8f0);
    flex-shrink: 0;
}

.app-user-notify-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.app-user-notify-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
}

.app-user-notify-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.app-user-notify-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 22px;
    overflow: auto;
}

.app-user-notify-recipient {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.app-user-notify-recipient-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}

.app-user-notify-recipient-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.app-user-notify-datetime {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
}

.app-user-notify-modal-body .app-field {
    margin: 0;
}

.app-user-notify-modal-body .app-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text, #0f172a);
}

.app-user-notify-modal-body .app-field input,
.app-user-notify-modal-body .app-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text, #0f172a);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-user-notify-modal-body .app-field input::placeholder,
.app-user-notify-modal-body .app-field textarea::placeholder {
    color: #94a3b8;
}

.app-user-notify-modal-body .app-field input:hover,
.app-user-notify-modal-body .app-field textarea:hover {
    border-color: #c7d2e0;
}

.app-user-notify-modal-body .app-field input:focus,
.app-user-notify-modal-body .app-field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.app-user-notify-text-field textarea {
    min-height: 148px;
    resize: vertical;
    line-height: 1.5;
}

.app-user-notify-text-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.app-user-notify-text-head label {
    margin: 0 !important;
}

.app-user-notify-counter {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
}

.app-user-notify-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.88rem;
    line-height: 1.4;
}

.app-user-notify-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid var(--line, #e2e8f0);
    background: #fafbfd;
}

.app-user-notify-modal-actions .app-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 560px) {
    .app-user-notify-datetime {
        grid-template-columns: 1fr;
    }
}

/* Журнал звонков в карточке клиента / ПП */
.telephony-calls-empty {
    margin: 0;
    padding: 0.25rem 0;
}

.telephony-entity-calls-wrap {
    margin: 0;
}

.telephony-entity-calls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.telephony-entity-calls-table thead th {
    font-weight: 600;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    text-align: left;
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
    white-space: nowrap;
}

.telephony-entity-calls-table tbody td {
    padding: 0.7rem 0.55rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
    vertical-align: middle;
    color: var(--text, #0f172a);
}

.telephony-entity-calls-table tbody tr:last-child td {
    border-bottom: none;
}

.telephony-entity-col-dir {
    width: 2rem;
    text-align: center;
    padding-left: 0.25rem !important;
    padding-right: 0.15rem !important;
}

.telephony-entity-dir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
}

.telephony-entity-dir--out {
    color: #16a34a;
    background: #f0fdf4;
}

.telephony-entity-dir--in {
    color: #2563eb;
    background: #eff6ff;
}

.telephony-entity-dir--out .las {
    transform: rotate(45deg);
}

.telephony-entity-dir--in .las {
    transform: rotate(-45deg);
}

.telephony-entity-col-time {
    white-space: nowrap;
    color: var(--text, #0f172a);
}

.telephony-entity-col-manager {
    white-space: nowrap;
}

.telephony-entity-col-phone {
    white-space: nowrap;
}

.telephony-entity-col-phone .telephony-call-ps-chip {
    margin-left: 0.45rem;
    vertical-align: middle;
}

.telephony-entity-phone-link {
    color: var(--accent, #2563eb);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.telephony-entity-phone-link:hover {
    text-decoration: underline;
}

.telephony-call-ps-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 12rem;
    padding: 0.15rem 0.55rem 0.15rem 0.28rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    vertical-align: middle;
}

.telephony-call-ps-chip:hover {
    border-color: rgba(79, 70, 229, 0.35);
    color: #312e81;
    background: #fff;
}

.telephony-call-ps-chip-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: contain;
}

.telephony-call-ps-chip-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.7rem;
}

.telephony-call-ps-chip-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telephony-entity-col-duration {
    white-space: nowrap;
    color: var(--text-muted, #475569);
}

.telephony-entity-col-rec {
    min-width: 24rem;
}

.telephony-entity-col-rec .telephony-rec-player--compact .telephony-rec-audio {
    width: 320px;
}

.telephony-entity-col-line,
.telephony-entity-col-status {
    white-space: nowrap;
}

.telephony-entity-line {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.2;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telephony-entity-line--card {
    max-width: 10.5rem;
}

.telephony-entity-status {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.2;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telephony-entity-status--completed,
.telephony-entity-status--answered {
    border-color: #86efac;
    background: #dcfce7;
    color: #15803d;
}

.telephony-entity-status--no_answer,
.telephony-entity-status--busy,
.telephony-entity-status--cancel,
.telephony-entity-status--failed {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.telephony-entity-status--ringing,
.telephony-entity-status--initiated {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.telephony-entity-col-tx {
    white-space: nowrap;
}

.telephony-entity-col-comment {
    width: 2.4rem;
    text-align: center;
}

.telephony-entity-comment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
}

.telephony-entity-comment-btn i {
    font-size: 1.05rem;
}

.telephony-entity-comment-btn.is-filled {
    color: #475569;
}

.telephony-entity-comment-btn:hover:not(:disabled) {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.telephony-entity-comment-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.telephony-calls-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.telephony-call-item {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: #fff;
}

.telephony-call-item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.telephony-call-direction {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent, #2563eb);
    font-size: 0.82rem;
    font-weight: 600;
}

.telephony-call-phone {
    font-weight: 600;
    color: var(--text, #0f172a);
}

.telephony-call-status {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.telephony-call-item--completed .telephony-call-status,
.telephony-call-item--answered .telephony-call-status {
    color: #15803d;
}

.telephony-call-item--no_answer .telephony-call-status,
.telephony-call-item--busy .telephony-call-status,
.telephony-call-item--cancel .telephony-call-status,
.telephony-call-item--failed .telephony-call-status {
    color: #b45309;
}

.telephony-call-provider {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.telephony-call-item-meta {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
}

.telephony-call-sep {
    opacity: 0.55;
}

.telephony-call-ps-link {
    color: var(--accent, #2563eb);
    text-decoration: none;
}

.telephony-call-ps-link:hover {
    text-decoration: underline;
}

.telephony-call-comment {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    color: var(--text, #0f172a);
    white-space: pre-wrap;
}

.clients-org-calls-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ps-tab-calls {
    padding-top: 0.25rem;
}

.ps-tab-calls-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.telephony-calls-view-toggle {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
    gap: 2px;
}

.telephony-calls-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.telephony-calls-view-btn i {
    font-size: 1rem;
    line-height: 1;
}

.telephony-calls-view-btn:hover {
    color: var(--text, #0f172a);
    background: rgba(255, 255, 255, 0.85);
}

.telephony-calls-view-btn.is-active,
.telephony-calls-view-btn[aria-pressed="true"] {
    color: var(--accent, #4f46e5);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.telephony-entity-calls[data-view="cards"] [data-telephony-calls-panel="table"],
.telephony-entity-calls[data-view="table"] [data-telephony-calls-panel="cards"] {
    display: none;
}

.telephony-call-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.telephony-call-card {
    margin: 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(13, 148, 136, 0.16);
    border-left: 3px solid #0d9488;
    border-radius: 12px;
    background:
        linear-gradient(120deg, rgba(240, 253, 250, 0.98) 0%, rgba(255, 255, 255, 0.62) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(13, 148, 136, 0.05);
}

.telephony-call-card--in {
    border-color: rgba(37, 99, 235, 0.16);
    border-left-color: #2563eb;
    background:
        linear-gradient(120deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.62) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(37, 99, 235, 0.05);
}

.telephony-call-card--missed {
    border-color: rgba(185, 28, 28, 0.14);
    border-left-color: #dc2626;
    background:
        linear-gradient(120deg, rgba(254, 242, 242, 0.96) 0%, rgba(255, 255, 255, 0.62) 44%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 0 1px 0 rgba(185, 28, 28, 0.04);
}

.telephony-call-card-primary {
    display: flex;
    align-items: center;
    gap: 0.55rem 0.7rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.telephony-call-card-dir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    flex-shrink: 0;
    border-radius: 999px;
    font-size: 0.9rem;
}

.telephony-call-card-dir--out {
    color: #16a34a;
    background: rgba(220, 252, 231, 0.9);
}

.telephony-call-card-dir--in {
    color: #2563eb;
    background: rgba(219, 234, 254, 0.95);
}

.telephony-call-card-dir--out .las {
    transform: rotate(45deg);
}

.telephony-call-card-dir--in .las {
    transform: rotate(-45deg);
}

.telephony-call-card-when {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text, #0f172a);
    white-space: nowrap;
}

.telephony-call-card-manager {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text, #0f172a);
}

.telephony-call-card-primary .telephony-entity-line,
.telephony-call-card-primary .telephony-entity-status {
    flex-shrink: 0;
}

.telephony-call-card-duration {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted, #475569);
    white-space: nowrap;
}

.telephony-call-card-secondary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
    margin-top: 0.65rem;
    padding-left: 2rem;
    min-width: 0;
}

.telephony-call-card-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    white-space: nowrap;
}

.telephony-call-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.telephony-call-card-tx {
    display: inline-flex;
    align-items: center;
}

.telephony-call-card-recording {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.7rem;
    padding-left: 2rem;
    min-width: 0;
}

.telephony-call-card-recording .telephony-rec-player {
    width: 100%;
    max-width: 28rem;
}

.telephony-call-card-recording .telephony-rec-audio {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 720px) {
    .telephony-call-card-secondary,
    .telephony-call-card-recording {
        padding-left: 0;
    }

    .telephony-call-card-actions {
        margin-left: 0;
    }

    .telephony-call-card-recording .telephony-rec-player {
        max-width: none;
    }
}

.telephony-call-rec-link {
    color: var(--accent, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.telephony-call-rec-link:hover {
    text-decoration: underline;
}

.telephony-call-rec {
    margin-top: 0.55rem;
}

.telephony-call-rec--denied {
    margin-top: 0.45rem;
}

.telephony-call-rec-denied {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.telephony-call-rec-denied .las {
    font-size: 0.95rem;
    opacity: 0.85;
}

.telephony-rec-player {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
}

.telephony-rec-audio {
    display: block;
    width: 220px;
    max-width: 100%;
    height: 32px;
}

.telephony-rec-player--compact .telephony-rec-audio {
    width: 380px;
    height: 30px;
}

.telephony-rec-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 8px;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    flex-shrink: 0;
    background: #f1f5f9;
}

.telephony-rec-open:hover {
    color: var(--accent, #2563eb);
    background: #e2e8f0;
}

.telephony-admin-col-rec {
    min-width: 460px;
    vertical-align: middle;
}

.telephony-admin-calls-table .app-muted {
    padding-left: 8px;
}

.telephony-admin-col-tx {
    width: 12rem;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.telephony-admin-col-raw {
    width: 2.2rem;
    text-align: center;
    vertical-align: middle;
    padding-left: 0.25rem;
    padding-right: 0.35rem;
}

.telephony-admin-raw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    line-height: 1;
}

.telephony-admin-raw-btn i {
    font-size: 0.95rem;
}

.telephony-admin-raw-btn:hover {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.telephony-raw-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.telephony-raw-modal[hidden] {
    display: none;
}

.telephony-raw-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.telephony-raw-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(860px, calc(100vw - 2rem));
    max-height: min(84vh, 760px);
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.telephony-raw-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
    flex-shrink: 0;
}

.telephony-raw-modal-title {
    font-size: 0.95rem;
    color: var(--text, #0f172a);
}

.telephony-raw-modal-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.telephony-raw-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 7px;
    background: #f8fafc;
    color: var(--text, #0f172a);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.telephony-raw-copy:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.telephony-raw-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
}

.telephony-raw-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.telephony-raw-modal-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0.75rem 0.9rem 1rem;
    background: #0b1220;
}

.telephony-raw-json {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #e2e8f0;
}

.telephony-raw-error {
    margin: 0.5rem 0 0;
    color: #fca5a5;
    font-size: 0.85rem;
}

.telephony-tx-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}

.telephony-tx-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    max-width: 20rem;
}

.telephony-tx-pipeline-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.telephony-tx-icon--pipeline {
    width: auto;
    min-width: 1.85rem;
    padding: 0 0.4rem;
    color: #1d4ed8;
}

.telephony-tx-icon--pipeline-llm {
    color: #6d28d9;
}

.telephony-tx-icon--pipeline:hover {
    color: #1e40af;
    border-color: #93c5fd;
    background: #eff6ff;
}

.telephony-tx-icon--pipeline-llm:hover {
    color: #5b21b6;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.telephony-tx-icon--pipeline-diarize {
    color: #0f766e;
}

.telephony-tx-icon--pipeline-diarize:hover {
    color: #115e59;
    border-color: #5eead4;
    background: #f0fdfa;
}

.telephony-tx-icon--pipeline-gigaam {
    color: #c2410c;
}

.telephony-tx-icon--pipeline-gigaam:hover {
    color: #9a3412;
    border-color: #fdba74;
    background: #fff7ed;
}

.telephony-tx-icon--pipeline-cascade {
    color: #4338ca;
}

.telephony-tx-icon--pipeline-cascade:hover {
    color: #312e81;
    border-color: #a5b4fc;
    background: #eef2ff;
}

.telephony-tx-icon--insight {
    width: auto;
    min-width: 1.85rem;
    padding: 0 0.4rem;
    color: #6d28d9;
}

.telephony-tx-icon--insight:hover {
    color: #5b21b6;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.telephony-tx-icon i {
    font-size: 1.05rem;
}

.telephony-tx-icon:hover {
    color: var(--accent, #2563eb);
    border-color: #cbd5e1;
    background: #f8fafc;
}

.telephony-tx-icon:disabled {
    opacity: 0.55;
    cursor: wait;
}

.telephony-tx-icon--pending {
    cursor: default;
    color: #ca8a04;
    background: #fefce8;
    border-color: #fde68a;
}

.telephony-tx-icon--pending i {
    animation: telephony-tx-spin 0.9s linear infinite;
}

.telephony-tx-icon--done {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.telephony-tx-icon--done:hover {
    color: #14532d;
    background: #dcfce7;
}

.telephony-tx-icon--failed {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
    cursor: default;
}

.telephony-tx-icon--failed:hover {
    color: #991b1b;
    background: #fee2e2;
}

.telephony-tx-icon--start:hover {
    color: #1d4ed8;
}

.telephony-tx-icon--cancel {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.telephony-tx-icon--cancel:hover {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.telephony-tx-bubble {
    --telephony-tx-arrow-left: 24px;
    position: absolute;
    z-index: 10001;
    width: 440px;
    max-width: calc(100vw - 24px);
    max-height: min(78vh, 540px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}

.telephony-tx-bubble[hidden] {
    display: none;
}

.telephony-tx-bubble.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.telephony-tx-bubble.is-above {
    transform-origin: bottom center;
}

.telephony-tx-bubble-arrow {
    position: absolute;
    top: -6px;
    left: var(--telephony-tx-arrow-left);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid var(--line, #e2e8f0);
    border-top: 1px solid var(--line, #e2e8f0);
    transform: translateX(-50%) rotate(45deg);
}

.telephony-tx-bubble.is-above .telephony-tx-bubble-arrow {
    top: auto;
    bottom: -6px;
    border-left: 0;
    border-top: 0;
    border-right: 1px solid var(--line, #e2e8f0);
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.telephony-tx-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
    flex-shrink: 0;
}

.telephony-tx-bubble-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.telephony-tx-bubble-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    flex-shrink: 0;
}

.telephony-tx-bubble-close:hover {
    background: #f1f5f9;
    color: var(--text, #0f172a);
}

.telephony-tx-bubble-body {
    overflow: auto;
    padding: 0.75rem 0.8rem 0.9rem;
    min-height: 2.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 48px);
}

.telephony-tx-bubble-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem 0.7rem;
    border-top: 1px solid var(--line, #e2e8f0);
    flex-shrink: 0;
    background: #fff;
}

.telephony-tx-retry-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.telephony-tx-bubble-foot[hidden] {
    display: none;
}

.telephony-tx-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text, #0f172a);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.telephony-tx-retry i {
    font-size: 0.95rem;
    color: var(--text-muted, #64748b);
}

.telephony-tx-retry:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.telephony-tx-retry:hover i {
    color: #1d4ed8;
}

.telephony-tx-retry--llm:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.telephony-tx-retry--llm:hover i {
    color: #6d28d9;
}

.telephony-tx-retry--gigaam:hover {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.telephony-tx-retry--gigaam:hover i {
    color: #c2410c;
}

.telephony-tx-retry--cascade:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.telephony-tx-retry--cascade:hover i {
    color: #4338ca;
}

.telephony-tx-retry:disabled {
    opacity: 0.55;
    cursor: wait;
}

.telephony-tx-dialogue {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.telephony-tx-dialogue-loading,
.telephony-tx-dialogue-empty {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-tx-dialogue-plain {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text, #0f172a);
}

.telephony-tx-turn {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    max-width: 92%;
}

.telephony-tx-turn--continued {
    gap: 0;
    margin-top: -0.25rem;
}

.telephony-tx-turn--client {
    align-self: flex-start;
    align-items: flex-start;
}

.telephony-tx-turn--operator {
    align-self: flex-end;
    align-items: flex-end;
}

.telephony-tx-turn--other {
    align-self: stretch;
    align-items: stretch;
    max-width: 100%;
}

.telephony-tx-turn-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.2rem;
}

.telephony-tx-turn-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.telephony-tx-turn--client .telephony-tx-turn-label {
    color: #475569;
}

.telephony-tx-turn--operator .telephony-tx-turn-label {
    color: #1d4ed8;
}

.telephony-tx-turn-bubble {
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    font-size: 0.84rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text, #0f172a);
}

.telephony-tx-turn--client .telephony-tx-turn-bubble {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.telephony-tx-turn--operator .telephony-tx-turn-bubble {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-bottom-right-radius: 4px;
    color: #0f172a;
}

.telephony-tx-turn--other .telephony-tx-turn-bubble {
    background: #fff;
    border: 1px dashed #cbd5e1;
}

.telephony-tx-bubble-error {
    margin: 0;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.8rem;
}

@keyframes telephony-tx-spin {
    to { transform: rotate(360deg); }
}

/* Админ: телефония */
.telephony-admin-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0 0 1.25rem;
    padding: 0.4rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.telephony-admin-tabs--settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 28rem;
}

.telephony-admin-tab {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 64px;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.telephony-admin-tab:hover {
    color: var(--text, #0f172a);
    background: rgba(15, 23, 42, 0.04);
}

.telephony-admin-tab.is-active {
    color: var(--text, #0f172a);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.telephony-admin-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.telephony-admin-tab.is-active .telephony-admin-tab-icon {
    background: color-mix(in srgb, var(--accent, #2563eb) 16%, #fff);
    color: var(--accent, #2563eb);
}

.telephony-admin-tab-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.telephony-admin-tab-title {
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.2;
}

.telephony-admin-tab-hint {
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telephony-admin-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.telephony-admin-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 55%, #eef6ff 100%);
}

.telephony-admin-hero-title {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.telephony-admin-hero-text {
    margin: 0;
    max-width: 46rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
}

.telephony-admin-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.telephony-admin-hero-stat-value {
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.1;
    color: var(--text, #0f172a);
}

.telephony-admin-hero-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}

.telephony-admin-filters {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #fff;
}

.telephony-admin-filters-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(130px, 0.65fr)
        minmax(120px, 0.55fr)
        auto
        auto;
    gap: 0.75rem 0.85rem;
    align-items: end;
}

.telephony-admin-filters-grid--webhooks {
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr) auto;
}

.telephony-admin-field {
    margin: 0;
    min-width: 0;
}

.telephony-admin-field > label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--text, #0f172a);
}

.telephony-admin-field .sk-select {
    width: 100%;
}

.telephony-admin-field .sk-select-trigger {
    min-height: 44px;
    border-radius: 12px;
}

.telephony-admin-field input,
.telephony-admin-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    background: var(--input-bg, #fff);
    color: var(--text, #0f172a);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.telephony-admin-field input:hover,
.telephony-admin-field select:hover {
    border-color: #cbd5e1;
}

.telephony-admin-field input:focus,
.telephony-admin-field select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent, #2563eb) 55%, #94a3b8);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 18%, transparent);
}

.telephony-admin-field--check {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.55rem;
}

.telephony-admin-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.84rem;
    color: var(--text, #0f172a);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.telephony-admin-filter-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--accent, #2563eb);
}

.telephony-admin-filters-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    padding-bottom: 0;
}

.telephony-admin-filters-actions .app-button,
.telephony-admin-filters-actions .app-button-secondary {
    min-height: 44px;
    white-space: nowrap;
}

.telephony-admin-meta-inline,
.telephony-admin-pager-info {
    margin-left: auto;
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-admin-rebind-hint {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-admin-rebind-hint.is-ok {
    color: #166534;
}

.telephony-admin-rebind-hint.is-error {
    color: #b91c1c;
}

.telephony-admin-empty {
    border: 1px dashed var(--line, #e2e8f0);
    border-radius: 16px;
    background: #f8fafc;
}

.telephony-admin-table-card {
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.telephony-admin-table-card .app-table-wrap {
    margin: 0;
}

.telephony-admin-table {
    margin: 0;
}

.telephony-admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    border-bottom: 1px solid var(--line, #e2e8f0);
    white-space: nowrap;
}

.telephony-admin-table tbody tr:hover td {
    background: #f8fbff;
}

.telephony-admin-table td,
.telephony-admin-table th {
    padding: 0.85rem 1rem;
}

.telephony-admin-calls-table td {
    vertical-align: middle;
}

.telephony-admin-calls-table .telephony-entity-col-dir {
    width: 2.6rem;
    padding-left: 0.75rem !important;
}

.telephony-admin-phone {
    font-size: 0.86rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: var(--text, #0f172a);
    white-space: nowrap;
}

.telephony-admin-col-phone {
    white-space: nowrap;
    min-width: 9.5rem;
    width: 1%;
}

.telephony-admin-col-manager {
    max-width: 7.5rem;
    width: 7.5rem;
    font-size: 0.86rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telephony-admin-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 650;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}

.telephony-admin-status--completed,
.telephony-admin-status--answered {
    background: #dcfce7;
    color: #166534;
}

.telephony-admin-status--ringing,
.telephony-admin-status--initiated {
    background: #e0e7ff;
    color: #3730a3;
}

.telephony-admin-status--no_answer,
.telephony-admin-status--busy,
.telephony-admin-status--cancel,
.telephony-admin-status--failed {
    background: #ffedd5;
    color: #9a3412;
}

.telephony-admin-col-time,
.telephony-admin-col-session,
.telephony-admin-col-duration {
    white-space: nowrap;
    font-size: 0.86rem;
}

.telephony-admin-col-session code {
    display: inline-block;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
}

.telephony-admin-col-links {
    max-width: 280px;
    min-width: 160px;
}

.telephony-admin-binds {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.telephony-admin-bind {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.2rem 0.45rem 0.2rem 0.25rem;
    border-radius: 999px;
    text-decoration: none;
    background: #f1f5f9;
    color: var(--text, #0f172a);
    transition: background 0.12s ease, color 0.12s ease;
}

.telephony-admin-bind:hover {
    background: #e2e8f0;
    color: var(--accent, #2563eb);
}

.telephony-admin-bind-kind {
    flex-shrink: 0;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: #fff;
    color: #475569;
}

.telephony-admin-bind--client .telephony-admin-bind-kind {
    background: #dbeafe;
    color: #1d4ed8;
}

.telephony-admin-bind--ps .telephony-admin-bind-kind {
    background: #ede9fe;
    color: #6d28d9;
}

.telephony-admin-bind-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 700;
}

.telephony-admin-table .clients-link .telephony-admin-bind-name {
    white-space: normal;
    font-size: 0.76rem;
    font-weight: 700;
}

.telephony-admin-link {
    color: var(--accent, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.telephony-admin-link:hover {
    text-decoration: underline;
}

.telephony-admin-link-sep {
    opacity: 0.5;
    margin: 0 0.15rem;
}

.telephony-admin-unbound {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.2;
    font-weight: 500;
}

.telephony-admin-unbound-btn {
    border: 0;
    margin: 0;
    font-family: inherit;
    font-size: 0.76rem;
    line-height: 1.2;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.telephony-admin-unbound-btn:hover {
    background: #e2e8f0;
    color: var(--accent, #2563eb);
}

/* Bubble привязки звонка */
.telephony-bind-bubble {
    --telephony-bind-arrow-left: 24px;
    position: absolute;
    z-index: 10000;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 480px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.14s ease, transform 0.14s ease;
    pointer-events: none;
}

.telephony-bind-bubble[hidden] {
    display: none;
}

.telephony-bind-bubble.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.telephony-bind-bubble.is-above {
    transform-origin: bottom center;
}

.telephony-bind-bubble.is-above.is-open {
    transform: translateY(0) scale(1);
}

.telephony-bind-bubble-arrow {
    position: absolute;
    top: -6px;
    left: var(--telephony-bind-arrow-left);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid var(--line, #e2e8f0);
    border-top: 1px solid var(--line, #e2e8f0);
    transform: translateX(-50%) rotate(45deg);
}

.telephony-bind-bubble.is-above .telephony-bind-bubble-arrow {
    top: auto;
    bottom: -6px;
    border-left: 0;
    border-top: 0;
    border-right: 1px solid var(--line, #e2e8f0);
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.telephony-bind-bubble-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem 0.55rem;
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.telephony-bind-bubble-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text, #0f172a);
}

.telephony-bind-bubble-phone {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.telephony-bind-bubble-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    flex-shrink: 0;
}

.telephony-bind-bubble-close:hover {
    background: #f1f5f9;
    color: var(--text, #0f172a);
}

.telephony-bind-bubble-body {
    overflow: auto;
    padding: 0.7rem 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 2.5rem;
}

.telephony-bind-bubble-error {
    margin: 0 0.8rem 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.8rem;
}

.telephony-bind-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.telephony-bind-empty {
    margin: 0.15rem 0 0;
    font-size: 0.84rem;
    color: var(--text-muted, #64748b);
}

.telephony-bind-skeleton-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.telephony-bind-skeleton-title {
    display: block;
    width: 5.5rem;
    height: 0.72rem;
    border-radius: 999px;
}

.telephony-bind-skeleton-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: #f8fafc;
}

.telephony-bind-skeleton-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.telephony-bind-skeleton-line {
    display: block;
    height: 0.62rem;
    border-radius: 999px;
}

.telephony-bind-skeleton-line--inn {
    width: 42%;
}

.telephony-bind-skeleton-line--name {
    width: 78%;
    height: 0.72rem;
}

.telephony-bind-skeleton-line--addr {
    width: 92%;
}

.telephony-bind-skeleton-action {
    display: block;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.telephony-bind-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: var(--accent, #2563eb);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.telephony-bind-action:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.telephony-bind-action:disabled {
    opacity: 0.55;
    cursor: wait;
}

.telephony-bind-section-title {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #64748b);
}

.telephony-bind-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.telephony-bind-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: #f8fafc;
}

.telephony-bind-candidate-main {
    min-width: 0;
    flex: 1;
}

.telephony-bind-candidate-inn {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--text-muted, #64748b);
    font-variant-numeric: tabular-nums;
}

.telephony-bind-candidate-name {
    margin-top: 0.1rem;
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--text, #0f172a);
}

.telephony-bind-candidate-product {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
}

.telephony-bind-candidate-product .ps-list-product-icon,
.telephony-bind-candidate-product .ps-list-product-icon--empty {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}

.telephony-bind-candidate-product-link {
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--accent, #2563eb);
    text-decoration: none;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telephony-bind-candidate-product-link:hover {
    text-decoration: underline;
}

.telephony-bind-candidate-org {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    line-height: 1.3;
}

.telephony-bind-candidate-address {
    margin-top: 0.15rem;
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.telephony-bind-candidate-product + .telephony-bind-candidate-org + .telephony-bind-candidate-inn,
.telephony-bind-candidate-org + .telephony-bind-candidate-inn {
    margin-top: 0.18rem;
}

.telephony-admin-provider {
    display: inline-flex;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 650;
}

.telephony-admin-pager {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.15rem;
}

.telephony-admin-row-link {
    color: inherit;
    text-decoration: none;
}

.telephony-admin-row-link:hover {
    color: var(--accent, #2563eb);
}

.telephony-admin-notif-name {
    display: block;
    font-weight: 600;
}

.telephony-admin-direction {
    display: inline-flex;
    margin-top: 0.2rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
}

.telephony-admin-handle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.telephony-admin-call-id {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.telephony-webhook-note {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
    word-break: break-word;
}

.telephony-webhooks-layout {
    display: block;
}

.telephony-webhooks-layout.has-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.telephony-webhooks-detail {
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 16px;
    background: #fff;
    padding: 1rem 1.05rem 1.1rem;
    position: sticky;
    top: 0.75rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.telephony-webhooks-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.telephony-webhooks-detail-kicker {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
}

.telephony-webhooks-detail-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.telephony-webhooks-detail-meta {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #f8fafc;
}

.telephony-webhooks-detail-meta > div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.35rem;
    font-size: 0.86rem;
}

.telephony-webhooks-detail-meta dt {
    margin: 0;
    color: var(--text-muted, #64748b);
}

.telephony-webhooks-detail-meta dd {
    margin: 0;
    word-break: break-word;
}

.telephony-webhooks-json {
    margin: 0;
    max-height: 70vh;
    overflow: auto;
    padding: 0.85rem;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.telephony-admin-webhooks-table tr.is-active td {
    background: color-mix(in srgb, var(--accent, #2563eb) 8%, #fff);
}

.telephony-admin-webhooks-table tr.is-active:hover td {
    background: color-mix(in srgb, var(--accent, #2563eb) 12%, #fff);
}

@media (max-width: 1100px) {
    .telephony-admin-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .telephony-admin-field--search {
        grid-column: 1 / -1;
    }

    .telephony-admin-filters-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .telephony-webhooks-layout.has-detail {
        grid-template-columns: 1fr;
    }

    .telephony-webhooks-detail {
        position: static;
    }
}

@media (max-width: 720px) {
    .telephony-admin-tabs {
        grid-template-columns: 1fr;
    }

    .telephony-admin-hero {
        flex-direction: column;
    }

    .telephony-admin-hero-stat {
        align-items: flex-start;
        align-self: stretch;
    }

    .telephony-admin-filters-grid,
    .telephony-admin-filters-grid--webhooks {
        grid-template-columns: 1fr;
    }

    .telephony-admin-field--check {
        padding-bottom: 0;
    }

    .telephony-admin-meta-inline,
    .telephony-admin-pager-info {
        margin-left: 0;
        width: 100%;
    }
}

/* Bills admin list + drawer */
.app-drawer-panel--bill {
    width: min(1120px, calc(100vw - 16px));
    max-width: 100vw;
    display: flex;
    flex-direction: column;
}

.app-drawer--bill.is-sk-invoice .app-drawer-panel--bill {
    width: min(1300px, calc(100vw - 16px));
}

.app-drawer-body--bill {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.bills-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

.bills-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bills-head-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.bills-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

.bills-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    min-height: 28px;
    padding: 4px 11px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e8edf3;
    white-space: nowrap;
}

.bills-total-badge-count {
    font-size: 0.84rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #334155;
}

.bills-total-badge-word {
    font-size: 0.8rem;
    font-weight: 500;
    color: #94a3b8;
}

.bills-head-note {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.bills-empty {
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    background: #fff;
}

.bills-list-wrap {
    overflow: hidden;
}

.bills-list-header,
.bills-list-row {
    display: grid;
    grid-template-columns:
        minmax(88px, 0.85fr)
        minmax(88px, 0.7fr)
        minmax(110px, 0.85fr)
        minmax(72px, 0.65fr)
        minmax(0, 1.6fr)
        minmax(64px, 0.55fr)
        minmax(96px, 0.75fr);
    gap: 10px 14px;
    align-items: center;
}

.bills-list-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding: 11px 16px;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.bills-list-header > span {
    display: block;
    min-width: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bills-list-row {
    text-decoration: none;
    color: inherit;
}

.bills-list-cell--number {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bills-list-cell--amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #15803d;
    white-space: nowrap;
}

.bills-list-cell--product,
.bills-list-cell--partner,
.bills-list-cell--date {
    font-size: 0.9rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bills-list-cell--payer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bills-payer-name {
    font-size: 0.92rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bills-payer-inn {
    font-size: 0.78rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.bills-state-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bills-state-pill.is-paid {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.bills-state-pill.is-unpaid {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.bills-state-pill.is-new {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.bills-state-pill.is-autoship {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
}

.bills-state-pill.is-autoship-done {
    border-color: #86efac;
    background: #dcfce7;
    color: #15803d;
}

.bills-state-pill.is-conditional {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.bills-state-pill.is-act-accepted {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.clients-bills-table tbody td.clients-bills-cell-pdf {
    position: relative;
    width: 52px;
    max-width: 52px;
    padding: 0;
    vertical-align: top;
}

.clients-bills-filters-row th.clients-bills-cell-pdf {
    width: 52px;
    max-width: 52px;
    padding: 0;
}

.clients-bills-pdf-wrap {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 1px; /* не перекрывать горизонтальный border-bottom ячейки */
    left: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.clients-bills-pdf-api-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 1.05rem;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
}

.clients-bills-pdf-api-btn:hover,
.clients-bills-pdf-api-btn:focus-visible {
    background: var(--accent-soft);
    color: var(--accent-hover);
    outline: none;
}

.clients-bills-pdf-api-btn:disabled,
.clients-bills-pdf-api-btn.is-loading {
    cursor: wait;
    opacity: 0.85;
}

.clients-bills-pdf-api-btn.is-loading {
    color: var(--accent);
}

.clients-bills-shipping-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.clients-bills-act-accepted {
    font-size: 0.78rem;
    line-height: 1.25;
    color: #0f172a;
}

.bill-drawer {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: #f8fafc;
}

.bill-drawer-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 16px;
    row-gap: 16px;
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.bill-drawer-head-main {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}


.bill-drawer-head-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.bill-drawer-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.bill-drawer-product-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 10px 3px 6px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 500;
    color: #334155;
}

.bill-drawer-product-name {
    min-width: 0;
}

.bill-drawer-product-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 4px;
}

.bill-drawer-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bill-drawer-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    word-break: break-word;
}

.bill-drawer-copy-btn.clients-copy-btn {
    position: static;
    flex-shrink: 0;
    opacity: 1;
    width: 32px;
    height: 32px;
    top: auto;
    right: auto;
    transform: none;
}

.bill-drawer-amount-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.bill-drawer-amount-row .bill-drawer-amount {
    margin-top: 0;
}

.bill-drawer-amount {
    margin: 10px 0 0;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: #15803d;
    line-height: 1.15;
}

.bill-drawer-pill-edit,
.bill-drawer-paid-amount-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

.bill-drawer-edit-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
}

.bill-drawer-edit-btn:hover,
.bill-drawer-edit-btn:focus-visible {
    background: #f1f5f9;
    color: #334155;
    outline: none;
}

.bill-drawer-paid-amount.is-empty {
    color: #94a3b8;
    font-weight: 500;
}

.sk-pay-popover {
    position: fixed;
    z-index: 420;
    width: min(280px, calc(100vw - 16px));
    padding: 14px 14px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.sk-pay-popover[hidden] {
    display: none;
}

.sk-pay-popover-title {
    margin: 0 0 6px;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text);
}

.sk-pay-popover-hint {
    margin: 0 0 10px;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #64748b;
}

.sk-pay-popover-field {
    display: block;
    margin: 0 0 12px;
}

.sk-pay-popover-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    background: #fff;
}

.sk-pay-popover-input:focus {
    border-color: #16a34a;
    outline: none;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.sk-pay-popover-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.sk-pay-popover-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.sk-pay-popover-actions {
    display: flex;
    gap: 8px;
}

.sk-pay-popover-save,
.sk-pay-popover-cancel {
    appearance: none;
    border-radius: 8px;
    min-height: 32px;
    padding: 0 12px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
}

.sk-pay-popover-save {
    border: 0;
    background: #15803d;
    color: #fff;
}

.sk-pay-popover-save:hover,
.sk-pay-popover-save:focus-visible {
    background: #166534;
    outline: none;
}

.sk-pay-popover-save:disabled {
    cursor: wait;
    opacity: 0.7;
}

.sk-pay-popover-cancel {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
}

.sk-pay-popover-cancel:hover,
.sk-pay-popover-cancel:focus-visible {
    background: #f8fafc;
    outline: none;
}

.bill-drawer-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.bill-drawer-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.76rem;
    font-weight: 500;
    color: #64748b;
}

.bill-drawer-head-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.bill-drawer-head-meta-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.bill-drawer-head-meta-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.25;
}

.bill-drawer-head-meta-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.bill-drawer-paid-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: normal;
}

.bill-drawer-paid-amount {
    color: #15803d;
}

.bill-drawer-paid-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}

.bill-drawer-paid-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    white-space: normal;
}

.bill-drawer-paid-empty {
    color: #94a3b8;
    font-weight: 500;
}

.bill-drawer-mark-paid-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bill-drawer-mark-paid-btn:hover,
.bill-drawer-mark-paid-btn:focus-visible {
    background: rgba(22, 163, 74, 0.16);
    border-color: color-mix(in srgb, #16a34a 55%, transparent);
    color: #166534;
    outline: none;
}

.bill-drawer-mark-paid-btn:disabled,
.bill-drawer-mark-paid-btn.is-loading {
    cursor: wait;
    opacity: 0.75;
}

.bill-drawer-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.bill-drawer-head-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.bill-drawer-billing-link.clients-detail-billing-link {
    flex-shrink: 0;
}

.bill-drawer-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bill-drawer-download-btn i {
    font-size: 1.05rem;
}

.bill-drawer-download-btn:hover,
.bill-drawer-download-btn:focus-visible {
    color: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.14);
    outline: none;
    transform: translateY(-1px);
}

.bill-drawer-download-btn:disabled,
.bill-drawer-download-btn.is-loading {
    cursor: wait;
    opacity: 0.9;
    transform: none;
    box-shadow: none;
}

.bill-drawer-download-btn--export {
    border-color: transparent;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.28);
}

.bill-drawer-download-btn--export:hover,
.bill-drawer-download-btn--export:focus-visible {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.28);
}

.bill-drawer-download-btn--export .bill-drawer-onec-dot.is-pending {
    border-color: rgba(255, 255, 255, 0.85);
}

.bill-send-split {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
}

.bill-send-split .bill-drawer-download-btn {
    box-shadow: none;
}

.bill-send-split .bill-drawer-download-btn:hover,
.bill-send-split .bill-drawer-download-btn:focus-visible {
    transform: none;
}

.bill-drawer-download-btn--send {
    border-radius: 10px 0 0 10px;
}

.bill-drawer-download-btn--send-caret {
    width: 34px;
    padding: 0;
    margin-left: -1px;
    border-radius: 0 10px 10px 0;
    border-left-color: color-mix(in srgb, var(--accent) 18%, #fff);
}

.bill-drawer-download-btn--send-caret i {
    font-size: 0.95rem;
}

.bill-send-split.is-open .bill-drawer-download-btn--send-caret i {
    transform: rotate(180deg);
}

.bill-send-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 8;
    min-width: 232px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.bill-send-menu[hidden] {
    display: none !important;
}

.bill-send-menu button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.bill-send-menu button:hover,
.bill-send-menu button:focus-visible {
    background: var(--accent-soft);
    color: var(--accent-hover);
    outline: none;
}

.bill-send-menu button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: transparent;
}

.bill-send-menu-sep {
    height: 1px;
    margin: 6px 8px;
    background: var(--line);
}

.bill-drawer-doc-group {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
}

.bill-drawer-doc-group .bill-drawer-download-btn {
    position: relative;
    border-radius: 0;
    margin-left: -1px;
    box-shadow: none;
}

.bill-drawer-doc-group .bill-drawer-download-btn:first-child {
    margin-left: 0;
    border-radius: 10px 0 0 10px;
    padding-right: 12px;
    box-shadow: 0 0px 10px rgba(79, 70, 229, 0.28);
}

.bill-drawer-doc-group .bill-drawer-download-btn:last-child {
    border-radius: 0 10px 10px 0;
}

.bill-drawer-doc-group .bill-drawer-download-btn--icon {
    width: 38px;
    padding: 0;
    box-shadow: 0 0px 10px rgba(79, 70, 229, 0.28);
}

.bill-drawer-doc-group .bill-drawer-download-btn:hover,
.bill-drawer-doc-group .bill-drawer-download-btn:focus-visible {
    z-index: 1;
    transform: translateY(-1px);
    box-shadow: 0 0px 10px rgba(79, 70, 229, 0.28);
}

.bill-drawer-doc-group .bill-drawer-download-btn:disabled,
.bill-drawer-doc-group .bill-drawer-download-btn.is-loading {
    transform: none;
    box-shadow: 0 0px 10px rgba(79, 70, 229, 0.28);
}

.sk-invoice-template-menu {
    position: fixed;
    z-index: 420;
    width: min(320px, calc(100vw - 16px));
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    box-sizing: border-box;
}

.sk-invoice-template-menu[hidden] {
    display: none !important;
}

.sk-invoice-template-menu-title {
    margin: 0;
    padding: 6px 10px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sk-invoice-template-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-sizing: border-box;
}

.sk-invoice-template-menu-item:hover,
.sk-invoice-template-menu-item:focus-visible {
    background: var(--surface-muted);
    outline: none;
}

.sk-invoice-template-menu-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
}

.sk-invoice-template-menu-products {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.bill-drawer-close:hover {
    color: #0f172a;
}

.bill-drawer-body {
    padding: 20px 28px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bill-drawer-comments {
    margin: 0;
}

.bill-drawer-comments .ps-comment-create-block {
    margin-bottom: 0;
}

.bill-drawer-comments .ps-partner-comments-block {
    margin-top: 0;
}

.bill-drawer-card {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 16px 18px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.bill-drawer-card-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-drawer-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.bill-drawer-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

.bill-drawer-facts--issuer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bill-drawer-facts--payer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bill-drawer-fact {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bill-drawer-fact-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.2;
}

.bill-drawer-fact-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
    line-height: 1.35;
}

.bill-drawer-fact-value.is-empty {
    color: #94a3b8;
    font-weight: 400;
}

.bill-drawer-fact-value.is-mono,
.bill-drawer-table td.is-mono,
.bill-drawer-pkg-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 400;
    color: #64748b;
}

.bill-drawer-payer-name {
    display: inline-block;
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--accent);
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
}

.bill-drawer-payer-name:hover {
    text-decoration: underline;
}

.bill-drawer-payer-name.is-static {
    color: #0f172a;
}

.bill-drawer-comment {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #334155;
}

.bill-drawer-comment .md-body {
    color: inherit;
}

.bill-drawer-table--tariffs th:nth-child(2),
.bill-drawer-table--tariffs th:nth-child(3),
.bill-drawer-table--tariffs th:nth-child(4),
.bill-drawer-table--tariffs th:nth-child(5),
.bill-drawer-table--tariffs th:nth-child(6),
.bill-drawer-table--tariffs td.is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bill-drawer-table--tariffs th:first-child,
.bill-drawer-table--tariffs td:first-child {
    min-width: 220px;
}

.bill-drawer-tariff-title {
    font-size: 0.92rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.35;
}

.bill-drawer-tariff-service {
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.35;
}

.bill-drawer-tariffs-total td {
    border-bottom: 0;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 650;
    color: #0f172a;
    padding-top: 11px;
    padding-bottom: 11px;
}

.bill-drawer-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.bill-drawer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.bill-drawer-table th,
.bill-drawer-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.bill-drawer-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.74rem;
    white-space: nowrap;
}

.bill-drawer-table tr:last-child td {
    border-bottom: 0;
}

.bill-drawer-pkg-name {
    font-weight: 550;
    color: #0f172a;
}

.bill-drawer-pkg-id {
    margin-top: 2px;
}

@media (max-width: 900px) {
    .bill-drawer-facts,
    .bill-drawer-facts--issuer,
    .bill-drawer-facts--payer {
        grid-template-columns: 1fr;
    }

    .bill-drawer-head {
        grid-template-columns: 1fr;
    }

    .bill-drawer-head-actions {
        grid-column: 1;
        justify-content: flex-start;
    }

    .bill-drawer-head-meta {
        width: 100%;
    }

    .bill-drawer-head,
    .bill-drawer-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bills-list-header {
        display: none;
    }

    .bills-list-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }

    .bills-list-cell--payer {
        grid-column: 1 / -1;
    }
}

/* Режим «войти как пользователь» */
.app-impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 18px;
    background: linear-gradient(90deg, #7c2d12 0%, #9a3412 55%, #c2410c 100%);
    color: #fff7ed;
    box-shadow: 0 2px 10px rgba(124, 45, 18, 0.28);
}

.app-impersonation-banner-copy {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.35;
}

.app-impersonation-banner-copy .fa-user-secret {
    font-size: 1rem;
    opacity: 0.95;
}

.app-impersonation-banner-copy strong {
    font-weight: 700;
    color: #fff;
}

.app-impersonation-banner-form {
    margin: 0;
}

.app-impersonation-banner-exit {
    appearance: none;
    border: 1px solid rgba(255, 247, 237, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff7ed;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.app-impersonation-banner-exit:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 247, 237, 0.75);
}

.logistics-leftovers-filters-grid {
    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(140px, 0.7fr)
        minmax(140px, 0.7fr)
        minmax(180px, 0.9fr)
        auto;
}

.logistics-leftovers-copy {
    max-width: 62rem;
}

.logistics-leftovers-inn {
    font-weight: 650;
    letter-spacing: 0.01em;
}

.logistics-leftovers-org,
.logistics-leftovers-amount {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.logistics-leftovers-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

@media (max-width: 960px) {
    .logistics-leftovers-filters-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.app-nav-trigger--create .app-nav-icon {
    color: #a5b4fc;
}

.app-nav-trigger--create:hover .app-nav-icon,
.app-nav-trigger--create.is-active .app-nav-icon {
    color: currentColor;
}

body.app-create-client-open {
    overflow: hidden;
}

.app-create-client {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.app-create-client[hidden] {
    display: none;
}

.app-create-client-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.app-create-client-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    padding: 22px 24px 20px;
}

.app-create-client-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.app-create-client-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.app-create-client-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -6px -6px -6px 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.app-create-client-close:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.app-create-client-form {
    display: grid;
    gap: 14px;
}

.app-create-client-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 12px 16px;
}

.app-create-client-row[hidden] {
    display: none;
}

.app-create-client-row--name {
    align-items: start;
}

.app-create-client-row--name .app-create-client-label {
    padding-top: 12px;
}

.app-create-client-label {
    font-size: 0.92rem;
    color: var(--text);
}

.app-create-client-control {
    position: relative;
    max-width: 280px;
}

.app-create-client-row--name .app-create-client-control {
    max-width: 100%;
}

.app-create-client-input,
.app-create-client-select-trigger {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

.app-create-client-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.app-create-client-select-trigger i {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.app-create-client-select.is-open .app-create-client-select-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-create-client-input:focus,
.app-create-client-select-trigger:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-create-client-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 2;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.app-create-client-select-menu li {
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
}

.app-create-client-select-menu li:hover,
.app-create-client-select-menu li.is-selected {
    background: var(--accent-soft);
}

.app-create-client-suggest-list {
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    z-index: 3;
    width: min(420px, 70vw);
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow: auto;
}

.app-create-client-suggest-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.app-create-client-suggest-item:hover,
.app-create-client-suggest-item.is-active {
    background: var(--accent-soft);
}

.app-create-client-suggest-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.app-create-client-suggest-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.app-create-client-suggest-status {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 3;
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    color: var(--text-muted);
    font-size: 0.84rem;
}

.app-create-client-error {
    margin: 0 0 0 148px;
    color: var(--danger);
    font-size: 0.86rem;
}

.app-create-client-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.app-create-client-submit {
    min-width: 112px;
    min-height: 40px;
    box-shadow: none;
}

.app-create-client-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.app-create-client-cancel {
    min-height: 40px;
}

.app-create-client-hint {
    margin: 4px 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.app-create-client-hint.is-available {
    color: var(--success);
}

.app-create-client-hint a {
    font-weight: 600;
}

.app-create-client-hint-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.app-create-client-hint-list li + li {
    margin-top: 2px;
}

@media (max-width: 640px) {
    .app-create-client-row,
    .app-create-client-row--name {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .app-create-client-row--name .app-create-client-label {
        padding-top: 0;
    }

    .app-create-client-control,
    .app-create-client-row--name .app-create-client-control {
        max-width: none;
    }

    .app-create-client-error {
        margin-left: 0;
    }

    .app-create-client-suggest-list {
        width: 100%;
    }
}

.app-drawer-panel--sk-tariff {
    width: min(1100px, calc(100vw * 2 / 3));
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
}

.app-drawer-panel--sk-invoice {
    width: min(1080px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.app-drawer-body--sk-invoice {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sk-invoice-drawer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.sk-invoice-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.sk-invoice-drawer-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.sk-invoice-drawer-close {
    border: none;
    background: var(--surface-muted);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.sk-invoice-drawer-close:hover {
    color: var(--text);
    background: var(--line);
}

.sk-invoice-drawer-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sk-invoice-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: stretch;
    overflow: hidden;
}

.sk-invoice-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
}

.sk-invoice-picker-wrap {
    position: relative;
    z-index: 5;
    padding: 16px 20px 0;
    flex-shrink: 0;
}

.sk-invoice-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: text;
}

.sk-invoice-search:focus-within {
    border-color: var(--sk-brand);
    box-shadow: 0 0 0 3px var(--sk-brand-soft);
}

.sk-invoice-search-plus {
    color: var(--text-muted);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
}

.sk-invoice-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
}

.sk-invoice-picker {
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% + 6px);
    max-height: min(360px, 46vh);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    padding: 8px;
}

.sk-invoice-picker-empty {
    padding: 16px 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.sk-invoice-picker-folder {
    border: none;
    margin: 0;
}

.sk-invoice-picker-folder + .sk-invoice-picker-folder {
    margin-top: 4px;
}

.sk-invoice-picker-folder-title {
    list-style: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    user-select: none;
}

.sk-invoice-picker-folder-title::-webkit-details-marker {
    display: none;
}

.sk-invoice-picker-folder-title::before {
    content: "▾";
    display: inline-block;
    margin-right: 6px;
    transform: rotate(-90deg);
    transition: transform 0.12s ease;
}

.sk-invoice-picker-folder[open] > .sk-invoice-picker-folder-title::before {
    transform: rotate(0deg);
}

.sk-invoice-picker-folder-title:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.sk-invoice-picker-folder-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0 6px;
}

.sk-invoice-picker-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 9px 12px 9px 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    color: var(--text);
}

.sk-invoice-picker-item:hover {
    background: var(--sk-brand-soft);
}

.sk-invoice-picker-item-name {
    font-size: 0.92rem;
    font-weight: 550;
    line-height: 1.3;
}

.sk-invoice-picker-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sk-invoice-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 12px;
}

.sk-invoice-lines-empty {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sk-invoice-line-group + .sk-invoice-line-group {
    margin-top: 18px;
}

.sk-invoice-line-group-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
}

.sk-invoice-line {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 14px 16px;
}

.sk-invoice-line + .sk-invoice-line {
    margin-top: 10px;
}

.sk-invoice-line-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sk-invoice-line-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.sk-invoice-line-head-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sk-invoice-line-amount {
    font-size: 0.95rem;
    font-weight: 650;
    white-space: nowrap;
}

.sk-invoice-line-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sk-invoice-line-remove:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.08);
}

.sk-invoice-line-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sk-invoice-line-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sk-invoice-qty {
    display: inline-flex;
    align-items: stretch;
    width: 100%;
    max-width: 140px;
    min-height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sk-invoice-qty:focus-within {
    border-color: var(--sk-brand);
    box-shadow: 0 0 0 3px var(--sk-brand-soft);
}

.sk-invoice-qty-btn {
    flex: 0 0 34px;
    width: 34px;
    border: none;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease;
}

.sk-invoice-qty-btn:hover:not(:disabled) {
    background: var(--sk-brand-soft);
    color: var(--sk-brand);
}

.sk-invoice-qty-btn:active:not(:disabled) {
    background: rgba(54, 71, 97, 0.18);
}

.sk-invoice-qty-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.sk-invoice-qty-btn:first-child {
    border-right: 1px solid #e5e7eb;
}

.sk-invoice-qty-btn:last-child {
    border-left: 1px solid #e5e7eb;
}

.sk-invoice-qty-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    padding: 0 4px;
    outline: none;
    -moz-appearance: textfield;
}

.sk-invoice-qty-input::-webkit-outer-spin-button,
.sk-invoice-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sk-invoice-line-input,
.sk-invoice-discount-input {
    width: 100%;
    max-width: 120px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
}

.sk-invoice-line-input:focus,
.sk-invoice-discount-input:focus {
    outline: none;
    border-color: var(--sk-brand);
    box-shadow: 0 0 0 3px var(--sk-brand-soft);
}

.sk-invoice-line-readonly {
    min-height: 34px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 550;
}

.sk-invoice-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.sk-invoice-foot-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.sk-invoice-foot-label {
    font-size: 0.92rem;
    color: var(--text);
}

.sk-invoice-foot-sum {
    font-size: 1rem;
    font-weight: 700;
}

.sk-invoice-foot-discount {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.sk-invoice-discount-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sk-invoice-discount-block--foot {
    align-items: flex-end;
}

.sk-invoice-discount-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sk-invoice-foot-discount-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sk-invoice-discount-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 8px;
}

.sk-invoice-discount-block--foot .sk-invoice-discount-presets {
    justify-content: flex-end;
}

.sk-invoice-discount-preset {
    margin: 0;
    padding: 2px 7px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 550;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.sk-invoice-discount-preset:hover {
    border-color: var(--sk-brand);
    color: var(--sk-brand);
    background: var(--sk-brand-soft);
}

.sk-invoice-discount-preset.is-active {
    border-color: var(--sk-brand);
    background: var(--sk-brand);
    color: #fff;
}

.sk-invoice-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 18px 20px;
    background: #fff;
    min-height: 0;
    overflow: hidden;
}

.sk-invoice-payer {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 14px 16px;
}

.sk-invoice-payer-label {
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sk-invoice-payer-inn {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.sk-invoice-payer-name {
    margin-top: 2px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.sk-invoice-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 2px;
}

.sk-invoice-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text);
}

.sk-invoice-summary-row--total {
    margin-top: 4px;
    font-size: 1.05rem;
    font-weight: 700;
}

.sk-invoice-submit.app-button {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--sk-brand);
    color: #fff;
    font-weight: 650;
    box-shadow: 0 8px 18px rgba(54, 71, 97, 0.28);
}

.sk-invoice-submit.app-button:hover:not(:disabled) {
    background: var(--sk-brand-hover);
    color: #fff;
}

.sk-invoice-submit.app-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 900px) {
    .sk-invoice-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .sk-invoice-main {
        border-right: none;
        border-bottom: 1px solid var(--line);
        min-height: min(60vh, 520px);
    }

    .sk-invoice-aside {
        min-height: auto;
    }

    .sk-invoice-line-grid {
        grid-template-columns: 1fr;
    }

    .app-drawer-panel--sk-invoice {
        width: min(100vw - 8px, 1080px);
    }
}

.app-drawer-body--sk-tariff {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sk-select {
    position: relative;
}

.sk-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sk-select-trigger,
.sk-status-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 8px 12px 8px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sk-select-trigger:hover,
.sk-status-select-trigger:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.sk-select.is-open .sk-select-trigger,
.sk-status-select.is-open .sk-status-select-trigger,
.sk-select-trigger:focus-visible,
.sk-status-select-trigger:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

.sk-select-trigger i,
.sk-status-select-trigger > .fa-chevron-down {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.sk-select.is-open .sk-select-trigger i,
.sk-status-select.is-open .sk-status-select-trigger > .fa-chevron-down {
    transform: rotate(180deg);
}

.sk-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sk-select-value.is-placeholder {
    color: var(--text-muted);
}

.sk-select-menu,
.sk-status-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    min-width: 100%;
    max-height: min(280px, 50vh);
    overflow-y: auto;
    padding: 6px 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.sk-status-select-menu {
    min-width: 320px;
    max-height: none;
    overflow: visible;
}

.sk-select-menu[hidden],
.sk-status-select-menu[hidden] {
    display: none;
}

.sk-select-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}

.sk-select-option:hover,
.sk-select-option.is-selected {
    background: var(--surface-muted);
}

.sk-status-select {
    position: relative;
}

.sk-status-select-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}

.sk-status-select-option:hover,
.sk-status-select-option.is-selected {
    background: var(--surface-muted);
}

.sk-status-select-option-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sk-status-select-option-copy strong {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.sk-status-select-option-copy span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

@media (max-width: 1100px) {

    
.app-drawer-panel--sk-tariff {
        width: min(920px, calc(100vw - 16px));
    }
}

.sk-templates-form-error {
    margin: 0;
    color: #dc2626;
    font-size: 0.9rem;
}

.sk-templates-hint {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sk-templates-preview-sheet img {
    max-width: 100%;
    height: auto;
}

.sk-templates-preview-sheet img[data-sk-behind="1"],
.sk-templates-preview-sheet .sk-template-img--behind {
    position: absolute;
    z-index: 0;
    opacity: 0.88;
    pointer-events: none;
    margin: 0;
}

.sk-templates-preview-sheet .sk-templates-table-node,
.sk-templates-preview-sheet table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1em;
    table-layout: fixed;
}

.sk-templates-preview-sheet th,
.sk-templates-preview-sheet td {
    position: relative;
    border: 1px solid #cbd5e1;
    padding: 0;
    vertical-align: top;
    overflow: hidden;
    /* Иначе ширина колонки считается от чипа, и max-width: 100% не обрезает. */
    max-width: 0;
}

.sk-templates-preview-sheet th[data-sk-col-width],
.sk-templates-preview-sheet td[data-sk-col-width] {
    max-width: none;
}

.sk-templates-preview-sheet table.sk-template-table--borderless th,
.sk-templates-preview-sheet table.sk-template-table--borderless td {
    border: none;
}

.sk-templates-preview-sheet th {
    font-weight: 600;
}

.sk-templates-preview-sheet .sk-template-var {
    display: inline;
    margin: 0 1px;
    padding: 0.05em 0.45em;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    font-size: 0.86em;
    font-weight: 600;
    line-height: inherit;
    cursor: default;
    user-select: none;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.sk-templates-preview-sheet .sk-template-var-text {
    display: inline-block;
    max-width: 18em;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    vertical-align: baseline;
}

.sk-templates-preview-sheet td .sk-template-var-text,
.sk-templates-preview-sheet th .sk-template-var-text {
    max-width: 100%;
    vertical-align: baseline;
}

/* Modals */
.sk-templates-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Предпросмотр локального счёта открывается поверх bill/ps drawer (z-index: 300). */
#sk-invoice-preview-modal,
#sk-invoice-send-modal {
    z-index: 500;
}

.sk-send-label {
    margin: 14px 0 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sk-send-list,
.sk-send-formats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sk-send-formats {
    flex-direction: row;
    flex-wrap: wrap;
}

.sk-send-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.sk-send-formats .sk-send-choice {
    min-width: 120px;
}

.sk-send-choice input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.sk-send-choice-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sk-send-choice-address {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.sk-send-choice-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.sk-send-empty {
    margin: 0;
    color: var(--text-muted);
}

.sk-send-new {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sk-send-new input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

.sk-send-new input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

.sk-send-new .app-button-secondary {
    flex: 0 0 auto;
    min-height: 42px;
}

.sk-send-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sk-send-history-item {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.sk-send-history-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.sk-send-history-email {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.sk-send-history-status {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
}

.sk-send-history-status.is-ok {
    color: var(--success);
}

.sk-send-history-status.is-error {
    color: var(--danger);
}

.sk-send-history-meta,
.sk-send-history-error {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.sk-send-history-error {
    color: var(--danger);
}

.sk-templates-modal[hidden] {
    display: none !important;
}

.sk-templates-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.sk-templates-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    padding: 18px 20px 16px;
    box-sizing: border-box;
}

.sk-templates-modal-dialog--wide {
    width: min(920px, 100%);
}

.sk-templates-modal-dialog--numbering {
    width: min(520px, 100%);
}

.sk-numbering-form .sk-templates-modal-actions {
    margin-top: 2px;
}

.sk-templates-modal-dialog--preview {
    width: min(820px, 100%);
}

.sk-templates-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sk-templates-modal-title {
    margin: 0;
    font-size: 1.15rem;
}

.sk-templates-modal-close {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
}

.sk-templates-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.sk-templates-modal-actions .app-button [data-sk-preview-pdf-icon],
.sk-templates-modal-actions .app-button i {
    margin-right: 6px;
}

.sk-templates-preview-sheet {
    position: relative;
    min-height: 280px;
    max-height: min(70vh, 720px);
    overflow: auto;
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.sk-templates-preview-sheet p {
    margin: 0 0 0.75em;
}

.sk-templates-preview-sheet td > :last-child,
.sk-templates-preview-sheet th > :last-child {
    margin-bottom: 0;
}

.sk-templates-preview-sheet > *:not(img) {
    position: relative;
    z-index: 1;
}

body.sk-templates-modal-open {
    overflow: hidden;
}

.chrome-ext-page-head {
    margin-bottom: 1.25rem;
}
.chrome-ext-page-title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}
.chrome-ext-page-lead {
    margin: 0;
    color: var(--muted, #667589);
    max-width: 44rem;
}
.chrome-ext-steps {
    margin: 0 0 1.5rem;
    padding-left: 1.25rem;
}
.chrome-ext-steps li {
    margin-bottom: 1rem;
}
.chrome-ext-steps p {
    margin: 0.35rem 0 0;
}
.chrome-ext-notes h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}
.chrome-ext-notes ul {
    margin: 0;
    padding-left: 1.25rem;
}

.hotels-name {
    font-weight: 600;
}

.hotels-copy {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 100%;
}

.hotels-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.hotels-copy-btn:hover,
.hotels-copy-btn.is-copied {
    color: var(--accent);
}

.hotels-phones {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hotels-pp-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.telephony-admin-table tbody tr.is-ps-open,
.telephony-admin-table tbody tr.is-ps-open:hover,
.telephony-admin-table tbody tr.is-ps-open td,
.telephony-admin-table tbody tr.is-ps-open:hover td {
    background: var(--ps-row-open-bg);
}

.hotels-pp-info {
    color: var(--text-muted);
    cursor: help;
    line-height: 1;
}

.hotels-source-link {
    color: var(--accent);
    text-decoration: none;
}

.hotels-source-link:hover {
    color: var(--accent-hover);
}

.hotels-registry-footer {
    margin-top: 0.75rem;
}

.hotels-fms-export-grid {
    grid-template-columns: minmax(10rem, 12rem) minmax(10rem, 12rem) minmax(16rem, 1fr);
    align-items: end;
}

@media (max-width: 960px) {
    .hotels-fms-export-grid {
        grid-template-columns: 1fr;
    }
}

.app-kontur-resources {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 56px 16px 24px;
}

.app-kontur-resources[hidden] {
    display: none;
}

.app-kontur-resources-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.app-kontur-resources-dialog {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    outline: none;
    animation: app-kontur-resources-in 0.16s ease;
}

@keyframes app-kontur-resources-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-kontur-resources-dialog {
        animation: none;
    }
}

.app-kontur-resources-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 14px 14px 22px;
}

.app-kontur-resources-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

.app-kontur-resources-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.app-kontur-resources-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

.app-kontur-resources-list {
    list-style: none;
    margin: 0;
    padding: 6px 10px 12px;
    overflow: auto;
    border-top: 1px solid #f1f5f9;
}

.app-kontur-resources-link {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 56px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.app-kontur-resources-link:hover,
.app-kontur-resources-link:focus-visible,
.app-kontur-resources-link.is-active {
    background: rgba(99, 102, 241, 0.08);
    outline: none;
}

.app-kontur-resources-logo {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    height: auto;
    max-height: 32px;
    width: auto;
    max-width: 100%;
}

.app-kontur-resources-logo--dark {
    display: none;
}

[data-theme="dark"] .app-kontur-resources-logo--light {
    display: none;
}

[data-theme="dark"] .app-kontur-resources-logo--dark {
    display: block;
}

.app-kontur-resources-label {
    max-width: 100%;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #222;
}

.app-kontur-resources-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fcfdff;
}

.app-kontur-resources-page {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.app-kontur-resources-page-card {
    width: min(560px, 100%);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    padding: 28px 24px;
}

.app-kontur-resources-page-card p:last-child {
    margin-bottom: 0;
}

.call-commitments-form {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(180px, 1.6fr) 150px auto;
    gap: 12px 14px;
    align-items: end;
    margin: 0 0 18px;
}

.call-commitments-form-submit {
    padding-bottom: 1px;
}

.call-commitments-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.call-commitments-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.call-commitments-filter span {
    color: var(--text-muted);
    font-weight: 600;
}

.call-commitments-filter.is-active {
    border-color: transparent;
    background: var(--accent-soft);
    color: #4338ca;
}

.call-commitments-filter.is-active span {
    color: #4338ca;
}

.call-commitments-actions {
    white-space: nowrap;
}

.call-commitments-actions form {
    display: inline-block;
    margin: 0 6px 0 0;
}

.call-commitments-actions form:last-child {
    margin-right: 0;
}

.call-commitments-actions .app-button-secondary {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.call-commitments-overdue {
    display: block;
    margin-top: 2px;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .call-commitments-form {
        grid-template-columns: 1fr 1fr;
    }
}

.cc-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 180px);
}

.cc-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cc-filters,
.cc-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cc-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.cc-filter span {
    color: var(--text-muted);
}

.cc-filter.is-active {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.cc-filter.is-active span {
    color: var(--accent-hover);
}

.cc-search {
    flex: 1 1 240px;
    margin: 0;
}

.cc-search input,
.cc-form-grid input,
.cc-form-grid textarea {
    width: 100%;
}

.cc-select-field {
    flex: 0 1 220px;
    margin: 0;
    min-width: 180px;
}

.cc-split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
    gap: 14px;
    min-height: 0;
    flex: 1;
}

.cc-list-card,
.cc-detail-card,
.cc-modal-dialog {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.cc-list-card {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    overflow: hidden;
}

.cc-list-head,
.cc-row {
    display: grid;
    grid-template-columns: minmax(168px, 1.35fr) minmax(160px, 1.7fr) minmax(110px, 1fr) 108px 108px;
    gap: 10px;
    align-items: center;
}

.cc-list-head {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--line);
}

.cc-list-scroll {
    overflow: auto;
    flex: 1;
}

.cc-list-card > .app-list-footer {
    padding: 10px 14px 12px;
    border-top: 1px solid var(--line);
}

.cc-list-footer[hidden],
.cc-list-card .app-list-pagination[hidden] {
    display: none !important;
}

.cc-row {
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cc-row:hover {
    background: #f8fafc;
}

.cc-row.is-ps-open,
.cc-row.is-ps-open:hover {
    background: var(--ps-row-open-bg);
}

.cc-row-client,
.cc-row-manager,
.cc-row-due {
    font-size: 0.9rem;
    min-width: 0;
}

.cc-row-client .telephony-admin-binds {
    max-width: 100%;
}

.cc-row-client-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
}

.cc-detail-binds {
    margin: 0 0 14px;
}

.cc-row-action {
    color: var(--text);
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.cc-badge--new { color: #b45309; background: var(--warning-soft); }
.cc-badge--in_progress { color: var(--accent-hover); background: var(--accent-soft); }
.cc-badge--done { color: var(--success); background: var(--success-soft); }
.cc-badge--rejected { color: #475569; background: #f1f5f9; }
.cc-badge--overdue { color: #be123c; background: #ffe4e6; }

.cc-list-empty,
.cc-detail-empty,
.cc-muted {
    color: var(--text-muted);
}

.cc-list-empty,
.cc-detail-empty {
    padding: 28px 18px;
}

.cc-detail-card {
    padding: 18px 18px 20px;
    overflow: auto;
    max-height: calc(100vh - 220px);
}

.cc-detail-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cc-status-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.cc-detail-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    line-height: 1.3;
}

.cc-detail-summary {
    margin: 0 0 14px;
    color: var(--text);
    line-height: 1.45;
}

.cc-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin: 0 0 16px;
}

.cc-meta div {
    min-width: 0;
}

.cc-meta dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.cc-meta dd {
    margin: 0;
    font-weight: 600;
}

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.cc-block {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.cc-block h3,
.cc-transcript-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.cc-transcript-title {
    margin-top: 16px;
}

.cc-block-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.cc-call-link {
    font-size: 0.88rem;
    font-weight: 600;
}

.cc-call-meta {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.cc-player {
    display: grid;
    grid-template-columns: auto auto minmax(80px, 1fr) auto auto 72px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--surface-muted);
}

.cc-player-play {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.cc-player input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.cc-player audio {
    display: none;
}

.cc-transcript {
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-transcript .is-extra {
    display: none;
}

.cc-transcript.is-open {
    max-height: 460px;
}

.cc-transcript.is-open .is-extra {
    display: flex;
}

.cc-transcript .telephony-tx-turn.is-hit .telephony-tx-turn-bubble {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.cc-line-time {
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

span.cc-line-time {
    cursor: default;
}

.cc-hit-mark {
    color: var(--accent-hover);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.cc-transcript-toggle {
    margin-top: 8px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cc-modal[hidden] {
    display: none;
}

.cc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.cc-modal-dialog {
    position: relative;
    width: min(640px, 100%);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow);
}

.cc-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cc-modal-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.cc-modal-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

.cc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cc-form-wide {
    grid-column: 1 / -1;
}

.cc-form-error {
    margin: 0 0 10px;
    color: var(--danger);
}

.cc-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .cc-split {
        grid-template-columns: 1fr;
    }

    .cc-detail-card {
        max-height: none;
    }

    .cc-list-head {
        display: none;
    }

    .cc-row {
        grid-template-columns: 1fr 1fr;
    }

    .cc-row-client,
    .cc-row-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .cc-player {
        grid-template-columns: auto auto 1fr;
    }

    .cc-player-vol-icon,
    .cc-player [data-cc-vol] {
        display: none;
    }

    .cc-form-grid,
    .cc-meta {
        grid-template-columns: 1fr;
    }
}

.msg-panel-note,
.msg-empty,
.msg-settings-status,
.msg-inbox-phone {
    color: var(--text-muted);
    margin: 0 0 10px;
}

.msg-layout {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    min-height: 420px;
    max-height: 68vh;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}

.msg-chats {
    border-right: 1px solid var(--line);
    overflow: auto;
    background: var(--surface-muted);
}

.msg-chat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.msg-chat.is-active {
    background: var(--accent-soft);
}

.msg-chat-title {
    font-weight: 650;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-channel {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.msg-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.msg-thread-log {
    flex: 1;
    overflow: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-bubble {
    max-width: min(440px, 88%);
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--surface-muted);
}

.msg-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-bubble--out {
    align-self: flex-end;
    background: var(--accent-soft);
}

.msg-bubble.is-pending {
    opacity: 0.7;
}

.msg-bubble.is-error {
    background: var(--danger-soft);
}

.msg-bubble-note,
.msg-compose-error {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.msg-compose-error {
    margin: 6px 12px 8px;
    color: var(--danger);
}

.msg-compose {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--line);
}

.msg-compose textarea {
    flex: 1;
    min-height: 44px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    padding: 8px 10px;
}

.msg-send {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
}

.msg-send:disabled {
    opacity: 0.5;
    cursor: default;
}

.msg-write {
    position: relative;
    display: inline-flex;
}

.msg-write-btn,
.msg-write-channel,
.msg-inbox-hit {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 2px 10px;
    cursor: pointer;
}

.msg-write-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    min-width: 140px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.msg-write-channel,
.msg-inbox-hit {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 8px;
    text-align: left;
    padding: 8px 10px;
}

.msg-write-channel:hover,
.msg-inbox-hit:hover,
.msg-chat:hover {
    background: var(--surface-muted);
}

.msg-settings-form {
    margin: 12px 0 20px;
}

.msg-settings-actions {
    margin-top: 12px;
}

.msg-inbox-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 0 0 12px;
    background: var(--surface);
}

.msg-inbox-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.msg-inbox-search {
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    padding: 8px 10px;
}

@media (max-width: 800px) {
    .msg-layout {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .msg-chats {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 180px;
    }
}

