/* ============================================================
   ТЕМА КАБИНЕТА: shadcn/ui (палитра zinc) — боевой дизайн с 07-2026.
   Значения токенов живут в base.html (:root + html.dark); здесь —
   компонентные правила поверх утилит: карточки-бордеры, сайдбар,
   таблицы, бейджи, primary-кнопки, тултипы чартов.
   Класс skin-shadcn на <html> — якорь специфичности каскада
   (правила темы обязаны бить tailwind-утилиты, включая dark:-варианты).
   Бренд-синий #3da9fc (--hue-accent) сознательно не «зинкован»:
   графики, ссылки, активные состояния — фирменные.
   ============================================================ */

/* ---- Карточки: бордер вместо тени, спокойный ховер без подъёма ---- */
html.skin-shadcn main .shadow-card { border: 1px solid rgb(var(--line)); }
/* сводка MedScore: вернуть фирменную синюю полосу слева (убита shorthand'ом выше) */
html.skin-shadcn main .border-l-4 {
    border-left-width: 4px;
    border-left-color: rgb(var(--hue-accent));
}
/* ---- Типографика: без uppercase (kpi-* канон живёт в cabinet.css) ---- */
html.skin-shadcn main .uppercase { text-transform: none; letter-spacing: 0; }
html.skin-shadcn main h1 { font-weight: 600; letter-spacing: -0.025em; }
html.skin-shadcn main h3 { font-weight: 600; }
html.skin-shadcn main .font-extrabold { font-weight: 600; }

/* ---- Сайдбар: light-скин = светлый с бордером (канон shadcn dashboard) ---- */
html.skin-shadcn:not(.dark) #sidebar {
    background: #ffffff;
    border-right: 1px solid rgb(var(--line));
}
html.skin-shadcn:not(.dark) #sidebar [class*="text-hue-soft"] { color: #3f3f46; }
html.skin-shadcn:not(.dark) #sidebar [class*="text-hue-soft"]:hover {
    color: #09090b;
    background-color: #f4f4f5;
}
html.skin-shadcn:not(.dark) #sidebar .text-white { color: #09090b; }
html.skin-shadcn:not(.dark) #sidebar .border-t { border-color: rgb(var(--line)); }
/* активный пункт: canonical secondary-заливка + бренд-синий индикатор слева */
html.skin-shadcn #sidebar .sb-item.bg-hue-accent { position: relative; box-shadow: none; }
html.skin-shadcn #sidebar .sb-item.bg-hue-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    height: 56%;
    width: 3px;
    border-radius: 2px;
    background: rgb(var(--hue-accent));
}
html.skin-shadcn:not(.dark) #sidebar .sb-item.bg-hue-accent {
    background: #f4f4f5;
    color: #09090b;
}
html.skin-shadcn:not(.dark) #sidebar .sb-item.bg-hue-accent:hover { background: #e4e4e7; }
/* dark: пункты zinc-400, ховер мягкий */
html.skin-shadcn.dark #sidebar [class*="text-hue-soft"] { color: #a1a1aa; }
html.skin-shadcn.dark #sidebar [class*="text-hue-soft"]:hover {
    color: #fafafa;
    background-color: rgb(255 255 255 / 0.06);
}
html.skin-shadcn.dark #sidebar .sb-item.bg-hue-accent {
    background: rgb(255 255 255 / 0.08);
    color: #fafafa;
}
html.skin-shadcn.dark #sidebar .sb-item.bg-hue-accent:hover {
    background: rgb(255 255 255 / 0.12);
}

/* ---- Мобильная шапка под тон сайдбара ---- */
html.skin-shadcn:not(.dark) #mobile-topbar {
    background: #ffffff;
    color: #09090b;
    border-bottom: 1px solid rgb(var(--line));
    box-shadow: none;
}
html.skin-shadcn.dark #mobile-topbar {
    border-bottom: 1px solid rgb(var(--line));
    box-shadow: none;
}

/* ---- Чипы клиник: активный = primary (тёмный), ховер неактивных нейтральный ---- */
html.skin-shadcn main span.bg-hue-accent {
    background-color: rgb(var(--primary));
    color: rgb(var(--primary-fg));
}
html.skin-shadcn main button.bg-hue-soft:hover {
    background-color: #e4e4e7;
    color: rgb(var(--hue-ink));
}
html.skin-shadcn.dark main button.bg-hue-soft:hover {
    background-color: #3f3f46;
    color: rgb(var(--hue-dink));
}

/* ---- Инпуты/селекты фильтра: бордер zinc вместо голубого ---- */
html.skin-shadcn main select,
html.skin-shadcn main input[type="date"] {
    border-color: rgb(var(--line));
}

/* ============================================================
   ДОЖИМ ДО КАНОНА (раунд 2 после «разницы не вижу»): светофор и эмодзи —
   главные носители старого языка — глушатся, семантика уезжает в детали.
   ============================================================ */

/* ---- KPI-цифры: нейтральные (canon); семантика остаётся в мелких дельтах ---- */
html.skin-shadcn main .kpi-number { color: rgb(var(--hue-ink)); }
html.skin-shadcn.dark main .kpi-number { color: rgb(var(--hue-dink)); }

/* ---- Пилюли оценок операторов: цветная заливка → outline + статусная точка ---- */
html.skin-shadcn main .bg-emerald-100,
html.skin-shadcn main .bg-amber-100 {
    background: transparent;
    border: 1px solid rgb(var(--line));
    font-weight: 600;
}
html.skin-shadcn main .text-emerald-800,
html.skin-shadcn main .text-amber-800 { color: rgb(var(--hue-ink)); }
html.skin-shadcn.dark main .text-emerald-800,
html.skin-shadcn.dark main .text-amber-800 { color: rgb(var(--hue-dink)); }
html.skin-shadcn main .bg-emerald-100::before,
html.skin-shadcn main .bg-amber-100::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    margin-right: 6px;
    vertical-align: middle;
}
html.skin-shadcn main .bg-emerald-100::before { background: #10b981; }
html.skin-shadcn main .bg-amber-100::before { background: #f59e0b; }

/* ---- Danger-бейджи (оценки red + причины горячих): заливка → destructive outline.
   nowrap: бордер добавил 2px ширины, «без записи» начинал переноситься ---- */
html.skin-shadcn main [class*="bg-hue-danger/10"] {
    background: transparent;
    border: 1px solid rgb(var(--hue-danger) / 0.35);
    white-space: nowrap;
}

/* ---- Медали 🥇🥈🥉 → номера (текст подменяет skin-JS в base.html) ---- */
html.skin-shadcn main .text-lg.w-7 {
    font-size: 0.8125rem;
    color: rgb(var(--hue-muted));
    font-variant-numeric: tabular-nums;
}


/* ============================================================
   РАСКАТКА НА ВЕСЬ КАБИНЕТ (07-2026): паттерны остальных страниц —
   таблицы, формы, auth-карточки, primary-кнопки, мобильные t-cards.
   ============================================================ */

/* ---- Auth-страницы: карточка живёт вне <main> ---- */
html.skin-shadcn .min-h-full > .shadow-card { border: 1px solid rgb(var(--line)); }

/* ---- Primary-кнопки: сплошная бренд-синяя заливка → нейтральный primary.
   Бренд остаётся в ссылках/фокус-рингах/активных состояниях. ---- */
html.skin-shadcn button.bg-hue-accent,
html.skin-shadcn a.bg-hue-accent,
html.skin-shadcn input[type="submit"].bg-hue-accent {
    background-color: rgb(var(--primary));
    color: rgb(var(--primary-fg));
}

/* ---- Таблицы: бордеры рядов/шапки на line-токене ---- */
html.skin-shadcn main thead tr,
html.skin-shadcn main tbody tr { border-bottom-color: rgb(var(--line)); }
html.skin-shadcn main table + p.border-t,
html.skin-shadcn main .border-t { border-top-color: rgb(var(--line)); }

/* ---- Ховеры бордеров, убитые border-шортхендом карточек ---- */
html.skin-shadcn main [class*="hover:border-hue-accent"]:hover {
    border-color: rgb(var(--hue-accent));
}

/* ---- font-bold → semibold (канон); сайдбар-лого вне main не трогаем ---- */
html.skin-shadcn main .font-bold { font-weight: 600; }

/* ---- Статус-пилюля bg-green-100 («включена» и т.п.) — в один ряд с emerald ---- */
html.skin-shadcn main .bg-green-100 {
    background: transparent;
    border: 1px solid rgb(var(--line));
    font-weight: 600;
}
html.skin-shadcn main .bg-green-100::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    margin-right: 6px;
    vertical-align: middle;
    background: #10b981;
}

/* ---- Дарк-фиксы серых утилит без dark:-вариантов (QR-подложки, код, роли) ---- */
html.skin-shadcn.dark .bg-gray-50 { background-color: #18181b; }
html.skin-shadcn.dark .bg-gray-100 { background-color: #27272a; }
html.skin-shadcn.dark .bg-white { background-color: #18181b; }
html.skin-shadcn.dark .bg-red-50 { background-color: rgb(127 29 29 / 0.2); }
html.skin-shadcn.dark .text-red-700 { color: #f87171; }

/* ---- ApexCharts: тултипы в духе shadcn (белая/чёрная карточка с бордером) ---- */
html.skin-shadcn .apexcharts-tooltip {
    border: 1px solid rgb(var(--line)) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.08) !important;
}
html.skin-shadcn:not(.dark) .apexcharts-tooltip {
    background: #ffffff !important;
    color: #09090b !important;
}
html.skin-shadcn:not(.dark) .apexcharts-tooltip-title {
    background: #fafafa !important;
    border-bottom: 1px solid rgb(var(--line)) !important;
}
html.skin-shadcn.dark .apexcharts-tooltip {
    background: #09090b !important;
    color: #fafafa !important;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.4) !important;
}
html.skin-shadcn.dark .apexcharts-tooltip-title {
    background: #09090b !important;
    border-bottom: 1px solid rgb(var(--line)) !important;
}

/* ============================================================
   ЛЕНТА ЗВОНКОВ V5 (07-2026)
   Компактная геометрия под реальные поля warehouse: четыре типа,
   три результата, светофор вежливости и единая колонка нарушений.
   ============================================================ */

.calls-feed,
.calls-export-status {
    --cf-surface: #ffffff;
    --cf-soft: #f4f4f5;
    --cf-hover: #fafafa;
    --cf-ink: #18181b;
    --cf-text: #52525b;
    --cf-muted: #71717a;
    --cf-faint: #a1a1aa;
    --cf-line: #e4e4e7;
    --cf-line-strong: #d4d4d8;
    --cf-brand: #2e7ce6;
    --cf-brand-strong: #1d63bd;
    --cf-brand-soft: #eff6ff;
    --cf-success: #157a55;
    --cf-success-bg: #e9f7f0;
    --cf-success-line: #bce5d1;
    --cf-danger: #b94a36;
    --cf-kpi-failed: #e02424;
    --cf-danger-bg: #fff0ed;
    --cf-danger-line: #f1c4bb;
    --cf-warning: #956100;
    --cf-warning-bg: #fff7df;
    --cf-warning-line: #ead59a;
    color: var(--cf-ink);
    font-variant-numeric: tabular-nums;
}

html.dark .calls-feed,
html.dark .calls-export-status {
    --cf-surface: #111113;
    --cf-soft: #27272a;
    --cf-hover: #18181b;
    --cf-ink: #fafafa;
    --cf-text: #d4d4d8;
    --cf-muted: #a1a1aa;
    --cf-faint: #71717a;
    --cf-line: #27272a;
    --cf-line-strong: #3f3f46;
    --cf-brand: #68a8ff;
    --cf-brand-strong: #8dbdff;
    --cf-brand-soft: #172b47;
    --cf-success: #69d3a7;
    --cf-success-bg: #163329;
    --cf-success-line: #285743;
    --cf-danger: #ff9c88;
    --cf-kpi-failed: #ff5a45;
    --cf-danger-bg: #3a201f;
    --cf-danger-line: #67403a;
    --cf-warning: #f4ca69;
    --cf-warning-bg: #382f19;
    --cf-warning-line: #66552d;
}

.calls-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.calls-page-head h1 {
    margin: 0;
    color: var(--cf-ink);
    font-size: 1.7rem;
    line-height: 1.15;
    letter-spacing: -.04em;
}

.calls-page-head p {
    margin: 6px 0 0;
    color: var(--cf-muted);
    font-size: .75rem;
}

.calls-export {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--cf-brand);
    border-radius: 9px;
    background: var(--cf-brand);
    color: #ffffff;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.calls-export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calls-export-actions form {
    margin: 0;
}

.calls-export-actions .calls-export:not(.calls-export-full) {
    border-color: var(--cf-line);
    background: transparent;
    color: var(--cf-ink);
}

.calls-export-status {
    max-width: 720px;
    padding: 28px;
    border: 1px solid var(--cf-line);
    border-radius: 16px;
    background: var(--cf-card);
}

.calls-export-status h1 {
    margin: 16px 0 8px;
    color: var(--cf-ink);
    font-size: 1.7rem;
}

.calls-export-status p {
    margin: 8px 0 18px;
    color: var(--cf-muted);
}

.calls-export-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--cf-line);
}

.calls-export-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--cf-brand);
}

.calls-export-status .calls-export-headline {
    margin: 8px 0 4px;
    color: var(--cf-ink);
    font-size: 1.05rem;
    font-weight: 600;
}

.calls-export-status .calls-export-status-note {
    margin-top: 14px;
    font-size: .8rem;
}

.calls-export-status .calls-export-status-error {
    color: var(--cf-danger);
}

.calls-export:hover {
    border-color: var(--cf-brand-strong);
    background: var(--cf-brand-strong);
}

.calls-export svg,
.calls-filter-toggle svg,
.calls-search svg,
.calls-filter-dropdown svg,
.calls-open-cell svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calls-filter-card {
    position: relative;
    z-index: 10;
    margin-bottom: 14px;
    border: 1px solid var(--cf-line);
    border-radius: 12px;
    background: var(--cf-surface);
    box-shadow: var(--shadow-card);
}

.calls-filter-main {
    padding: 11px;
    display: grid;
    grid-template-columns: 146px 154px 134px minmax(210px, 1fr) 160px auto;
    gap: 8px;
    align-items: center;
}

.calls-filter-main select,
.calls-search,
.calls-filter-toggle {
    width: 100%;
    height: 36px;
    min-width: 0;
    border: 1px solid var(--cf-line);
    border-radius: 8px;
    background-color: var(--cf-surface);
    color: var(--cf-ink);
    box-shadow: none;
    font-size: .75rem;
    outline: none;
}

.calls-filter-main select {
    padding: 0 29px 0 10px;
}

.calls-filter-main select:focus,
.calls-search:focus-within,
.calls-filter-toggle:focus-visible {
    border-color: var(--cf-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cf-brand) 14%, transparent);
}

.calls-period {
    position: relative;
    min-width: 0;
}

.calls-period > select {
    width: 100%;
}

.calls-period .range-dates {
    position: absolute;
    top: 42px;
    left: 0;
    z-index: 35;
    width: 302px;
    padding: 8px;
    border: 1px solid var(--cf-line);
    border-radius: 9px;
    background: var(--cf-surface);
    box-shadow: var(--shadow-pop);
}

.calls-period .range-dates input {
    width: 132px;
    height: 34px;
    border-color: var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-ink);
    box-shadow: none;
    font-size: .68rem;
}

.calls-search {
    position: relative;
    display: flex;
    align-items: center;
}

.calls-search > svg {
    position: absolute;
    left: 10px;
    color: var(--cf-muted);
    pointer-events: none;
}

.calls-search input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 48px 0 34px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--cf-ink);
    font-size: .75rem;
    outline: 0;
}

.calls-search input::placeholder {
    color: var(--cf-muted);
    opacity: .85;
}

.calls-search button {
    position: absolute;
    right: 4px;
    height: 27px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: var(--cf-soft);
    color: var(--cf-muted);
    font-size: 0;
}

.calls-search button::before {
    content: "→";
    font-size: .75rem;
    font-weight: 800;
}

.calls-search button:hover {
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-filter-toggle {
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
    white-space: nowrap;
}

.calls-filter-toggle[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--cf-brand) 42%, var(--cf-line));
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-filter-toggle > span {
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--cf-brand);
    color: #ffffff;
    font-size: .56rem;
    font-weight: 800;
}

.calls-quick-row {
    min-height: 43px;
    padding: 6px 11px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    border-top: 1px solid var(--cf-line);
    scrollbar-width: none;
}

.calls-quick-row::-webkit-scrollbar {
    display: none;
}

.calls-quick {
    min-height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 7px;
    background: var(--cf-soft);
    color: var(--cf-text);
    font-size: .68rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.calls-quick:hover {
    border-color: var(--cf-line-strong);
    color: var(--cf-ink);
}

.calls-quick.is-active {
    border-color: color-mix(in srgb, var(--cf-brand) 32%, var(--cf-line));
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-quick b {
    color: var(--cf-muted);
    font-size: .61rem;
}

.calls-quick.is-active b {
    color: currentColor;
    opacity: .78;
}

.calls-view-row {
    min-height: 43px;
    padding: 6px 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-top: 1px solid var(--cf-line);
}

.calls-view-label {
    color: var(--cf-muted);
    font-size: .62rem;
    font-weight: 750;
}

.calls-view-filters {
    padding: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border-radius: 8px;
    background: var(--cf-soft);
}

.calls-view-filter {
    min-height: 26px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    color: var(--cf-muted);
    font-size: .65rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.calls-view-filter:hover {
    color: var(--cf-ink);
}

.calls-view-filter.is-active {
    background: var(--cf-surface);
    color: var(--cf-ink);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--cf-ink) 14%, transparent);
}

.calls-view-filter:focus-visible {
    outline: 2px solid var(--cf-brand);
    outline-offset: 1px;
}

.calls-view-help {
    margin-left: auto;
    color: var(--cf-muted);
    font-size: .58rem;
    line-height: 1.35;
    text-align: right;
}

.calls-filter-panel {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-top: 1px solid var(--cf-line);
    border-radius: 0 0 12px 12px;
    background: color-mix(in srgb, var(--cf-soft) 55%, var(--cf-surface));
}

.calls-filter-panel.is-open {
    display: flex;
}

.calls-filter-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.calls-filter-dropdown > summary {
    min-width: 136px;
    height: 32px;
    padding: 0 8px 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-text);
    font-size: .67rem;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.calls-filter-dropdown > summary::-webkit-details-marker {
    display: none;
}

.calls-filter-dropdown > summary:hover {
    border-color: var(--cf-line-strong);
}

.calls-filter-dropdown[open] > summary,
.calls-filter-dropdown.has-selection > summary {
    border-color: color-mix(in srgb, var(--cf-brand) 38%, var(--cf-line));
}

.calls-filter-dropdown[open] > summary {
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-filter-dropdown summary b {
    min-width: 17px;
    height: 17px;
    margin-left: auto;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--cf-brand);
    color: #ffffff;
    font-size: .55rem;
    font-weight: 800;
}

.calls-filter-dropdown summary svg {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: var(--cf-muted);
    transition: transform .16s ease;
}

.calls-filter-dropdown summary b + svg {
    margin-left: 0;
}

.calls-filter-dropdown[open] summary svg {
    transform: rotate(180deg);
}

.calls-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 226px;
    padding: 8px;
    display: grid;
    gap: 4px;
    border: 1px solid var(--cf-line);
    border-radius: 9px;
    background: var(--cf-surface);
    box-shadow: 0 14px 32px rgb(18 31 48 / .16);
}

.calls-check {
    position: relative;
    display: block;
}

.calls-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.calls-check span {
    width: 100%;
    min-height: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--cf-line);
    border-radius: 6px;
    background: var(--cf-surface);
    color: var(--cf-text);
    font-size: .65rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

.calls-check span::before {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 1px solid var(--cf-faint);
    border-radius: 2px;
    background: transparent;
    content: "";
}

.calls-check input:checked + span {
    border-color: color-mix(in srgb, var(--cf-brand) 38%, var(--cf-line));
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-check input:checked + span::before {
    border-color: var(--cf-brand);
    background: var(--cf-brand);
    box-shadow: inset 0 0 0 2px var(--cf-brand-soft);
}

.calls-check input:focus-visible + span {
    outline: 2px solid var(--cf-brand);
    outline-offset: 1px;
}

/* Мульти-выбор операторов в основной строке: выглядит как соседние select. */
.calls-operator-filter {
    min-width: 0;
}

.calls-operator-filter > summary {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 9px 0 10px;
    border-radius: 8px;
    color: var(--cf-ink);
    font-size: .75rem;
    font-weight: 400;
}

.calls-operator-filter > summary > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calls-operator-menu {
    width: min(300px, calc(100vw - 32px));
    gap: 6px;
}

.calls-operator-search {
    width: 100%;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-ink);
    font-size: .72rem;
    outline: none;
}

.calls-operator-search:focus {
    border-color: var(--cf-brand);
}

.calls-operator-options {
    max-height: min(320px, 50vh);
    display: grid;
    gap: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.calls-operator-options .calls-check span {
    font-size: .72rem;
}

.calls-operator-options .calls-check[hidden] {
    display: none;
}

.calls-operator-actions {
    padding-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--cf-line);
}

.calls-operator-actions a {
    color: var(--cf-muted);
    font-size: .72rem;
    font-weight: 600;
}

.calls-operator-actions a:hover {
    color: var(--cf-brand-strong);
}

.calls-operator-actions button {
    height: 30px;
    padding: 0 14px;
    border-radius: 7px;
    background: var(--cf-brand);
    color: #ffffff;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.calls-operator-actions button:hover {
    background: var(--cf-brand-strong);
}

.calls-contact-filter {
    min-width: 136px;
    height: 32px;
    display: flex;
    align-items: center;
}

.calls-contact-filter > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.calls-contact-filter select {
    width: 100%;
    height: 32px;
    padding: 0 28px 0 9px;
    border: 1px solid var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-text);
    font-size: .67rem;
    font-weight: 700;
}

.calls-filter-reset {
    margin-left: auto;
    padding: 7px 4px;
    color: var(--cf-muted);
    font-size: .67rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.calls-filter-reset:hover {
    color: var(--cf-danger);
}

.calls-active-filters {
    min-height: 27px;
    margin: -2px 2px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.calls-active-filters > span {
    flex: 0 0 auto;
    color: var(--cf-muted);
    font-size: .63rem;
    font-weight: 700;
}

.calls-active-filters a {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid var(--cf-line);
    border-radius: 6px;
    background: var(--cf-surface);
    color: var(--cf-text);
    font-size: .61rem;
    font-weight: 700;
    text-decoration: none;
}

.calls-active-filters a:hover {
    border-color: var(--cf-line-strong);
    color: var(--cf-danger);
}

.calls-table-shell {
    overflow: hidden;
    border: 1px solid var(--cf-line);
    border-radius: 12px;
    background: var(--cf-surface);
    box-shadow: var(--shadow-card);
}

.calls-table-meta {
    min-height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--cf-line);
}

.calls-found {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: .72rem;
    font-weight: 750;
}

.calls-found strong {
    color: var(--cf-ink);
    white-space: nowrap;
}

.calls-found span {
    color: var(--cf-muted);
    font-size: .64rem;
    font-weight: 600;
}

.calls-legend {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--cf-muted);
    font-size: .61rem;
    white-space: nowrap;
}

.calls-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.calls-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.calls-legend i.is-good {
    background: var(--cf-success);
}

.calls-legend i.is-mid {
    background: var(--cf-warning);
}

.calls-legend i.is-bad {
    background: var(--cf-danger);
}

.calls-table-scroll {
    overflow-x: auto;
}

.calls-table {
    width: 100%;
    min-width: 1150px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-variant-numeric: tabular-nums;
}

.calls-table .calls-col-date {
    width: 86px;
}

.calls-table .calls-col-history {
    width: 68px;
}

.calls-table .calls-col-operator {
    width: 136px;
}

.calls-table .calls-col-call {
    width: 136px;
}

.calls-table .calls-col-type,
.calls-table .calls-col-result {
    width: 124px;
}

.calls-table .calls-col-branch {
    width: 160px;
}

.calls-table .calls-col-polite {
    width: 52px;
}

.calls-table .calls-col-misses {
    width: 155px;
}

.calls-table .calls-col-summary {
    width: auto;
}

.calls-table .calls-col-open {
    width: 33px;
}

.calls-table thead th {
    height: 34px;
    padding: 0 8px;
    border-bottom: 1px solid var(--cf-line);
    background: color-mix(in srgb, var(--cf-soft) 46%, var(--cf-surface));
    color: var(--cf-muted);
    font-size: .54rem;
    font-weight: 800;
    letter-spacing: .065em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.calls-table thead th:first-child,
.calls-row td:first-child {
    padding-left: 14px;
}

.calls-table thead th:nth-child(3) {
    padding-left: 6px;
}

.calls-table thead th:nth-child(2),
.calls-table thead th:nth-child(5),
.calls-table thead th:nth-child(6),
.calls-table thead th:nth-child(7) {
    text-align: center;
}

.calls-call-heading,
.calls-call-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 0;
}

.calls-call-heading {
    font-size: .49rem;
    letter-spacing: .035em;
}

.calls-call-heading > span:last-child,
.calls-call-layout > strong {
    text-align: center;
}

.calls-row {
    cursor: pointer;
}

.calls-row td {
    height: 43px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--cf-line);
    color: var(--cf-text);
    font-size: .67rem;
    vertical-align: middle;
}

.calls-row:last-child td {
    border-bottom: 0;
}

.calls-row:hover td {
    background: var(--cf-hover);
}

.calls-date-cell {
    color: var(--cf-brand) !important;
    font-size: .64rem !important;
    font-weight: 750;
    white-space: nowrap;
}

.calls-date-cell a {
    color: inherit;
    text-decoration: none;
}

.calls-date-cell a:hover {
    text-decoration: underline;
}

.calls-date-cell a:focus-visible,
.calls-open-cell a:focus-visible {
    outline: 2px solid var(--cf-brand);
    outline-offset: 2px;
}

.calls-history-cell {
    text-align: center;
    white-space: nowrap;
}

.calls-history-badge {
    min-width: 42px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cf-line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--cf-muted);
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .01em;
}

.calls-history-badge.is-primary {
    border-color: #d6ecea;
    background: #eef8f7;
    color: #3d6664;
}

.calls-history-badge.is-repeat {
    border-color: #e2daf2;
    background: #f4f1fb;
    color: #665b7d;
}

html.dark .calls-history-badge.is-primary {
    border-color: #294949;
    background: #172a2a;
    color: #9ac3c0;
}

html.dark .calls-history-badge.is-repeat {
    border-color: #443d55;
    background: #272331;
    color: #b8afd0;
}

/* Разбор перепроверки готов и не прочитан. Метка намеренно не похожа на
   бейдж истории номера: это не свойство звонка, а личное «тебе ответили». */
.calls-review-ready {
    margin-left: 6px;
    padding: 1px 6px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfe3f6;
    border-radius: 999px;
    background: #eaf3fc;
    color: #2f5f8a;
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .01em;
    vertical-align: middle;
}

html.dark .calls-review-ready {
    border-color: #27415c;
    background: #16283a;
    color: #9cc3e6;
}

.calls-review-link {
    color: #2f5f8a;
    font-weight: 600;
    text-decoration: none;
}

.calls-review-link:hover { text-decoration: underline; }

html.dark .calls-review-link { color: #9cc3e6; }

.calls-operator-cell {
    overflow: hidden;
    color: var(--cf-ink) !important;
    font-weight: 700;
    white-space: nowrap;
}

td.calls-operator-cell {
    padding: 0;
}

.calls-operator-link,
.calls-operator-static {
    height: 100%;
    min-width: 0;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calls-operator-cell i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 2px;
}

.calls-operator-link > span,
.calls-operator-static > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calls-operator-link {
    color: inherit;
    text-decoration: none;
}

.calls-operator-link:hover,
.calls-operator-link:focus-visible {
    border-radius: 5px;
    background: var(--cf-brand-soft);
}

.calls-operator-link:hover > span,
.calls-operator-link:focus-visible > span {
    color: var(--cf-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.calls-operator-static {
    cursor: default;
}

.calls-row:has(.calls-operator-link:hover) td {
    background: transparent;
}

.calls-call-cell {
    color: var(--cf-muted) !important;
    white-space: nowrap;
}

.calls-call-layout > strong {
    color: var(--cf-text);
    font-weight: 750;
}

.calls-answer-delay {
    font-size: 9px;
    line-height: 1.1;
}

.calls-direction.is-in {
    color: var(--cf-brand);
}

.calls-direction.is-out {
    color: var(--cf-muted);
}

.calls-type-cell,
.calls-result-cell {
    padding-right: 6px !important;
    padding-left: 6px !important;
    text-align: center;
}

.calls-branch-cell {
    padding-right: 6px !important;
    padding-left: 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.calls-type-badge,
.calls-result-badge {
    width: 112px;
    height: 25px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Тип носит ту же форму, что и исход: рамка, мягкая заливка и точка
   слева. Палитра при этом своя — цвет говорит, какой это звонок, а не
   какой у него результат. */
.calls-type-badge {
    padding: 0 7px;
    gap: 6px;
    border: 1px solid;
    border-radius: 7px;
    font-size: .61rem;
    font-weight: 750;
    text-align: left;
}

.calls-type-badge::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.calls-type-badge.is-target {
    border-color: #e6b44c;
    background: #fff0c2;
    color: #6f4800;
}

.calls-type-badge.is-non-target {
    border-color: #cbd3dd;
    background: #edf1f5;
    color: #475569;
}

.calls-type-badge.is-care {
    border-color: #e6b7cf;
    background: #f9e5ef;
    color: #8d315e;
}

.calls-type-badge.is-confirmation {
    border-color: #a9ccea;
    background: #e1f1fd;
    color: #17628f;
}

html.dark .calls-type-badge.is-target {
    border-color: #755d2b;
    background: #3a2e16;
    color: #f6cf7a;
}

html.dark .calls-type-badge.is-non-target {
    border-color: #44505f;
    background: #29313b;
    color: #c4ced9;
}

html.dark .calls-type-badge.is-care {
    border-color: #75445e;
    background: #3b2532;
    color: #efafd0;
}

html.dark .calls-type-badge.is-confirmation {
    border-color: #315f7d;
    background: #203747;
    color: #a9d8f5;
}

.calls-result-badge {
    padding: 0 7px;
    gap: 6px;
    border: 1px solid;
    border-radius: 7px;
    font-size: .61rem;
    font-weight: 750;
    text-align: left;
}

.calls-result-badge::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    content: "";
}

.calls-result-badge.is-recorded,
.calls-result-badge.is-walkin {
    border-color: var(--cf-success-line);
    background: var(--cf-success-bg);
    color: var(--cf-success);
}

.calls-result-badge.is-recorded::before,
.calls-result-badge.is-walkin::before {
    background: var(--cf-success);
}

.calls-result-badge.is-lost {
    border-color: var(--cf-danger-line);
    background: var(--cf-danger-bg);
    color: var(--cf-danger);
}

.calls-result-badge.is-lost::before {
    background: var(--cf-danger);
}

.calls-polite-cell {
    color: var(--cf-ink) !important;
    font-weight: 750;
    text-align: center;
}

.calls-polite-cell > span:not(.calls-empty-value) {
    min-width: 30px;
    height: 25px;
    padding: 0 7px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    font-size: .61rem;
    font-weight: 750;
}

.calls-polite-cell .is-good {
    border-color: var(--cf-success-line);
    background: var(--cf-success-bg);
    color: var(--cf-success);
}

.calls-polite-cell .is-mid {
    border-color: var(--cf-warning-line);
    background: var(--cf-warning-bg);
    color: var(--cf-warning);
}

.calls-polite-cell .is-bad {
    border-color: #c73d49;
    background: #d94b57;
    color: #ffffff;
}

.calls-misses-cell {
    padding-right: 5px !important;
    padding-left: 5px !important;
}

.calls-misses {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}

.calls-miss {
    min-height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--cf-danger-line);
    border-radius: 6px;
    background: var(--cf-danger-bg);
    color: var(--cf-danger);
    font-size: .52rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.calls-miss.is-warning {
    border-color: var(--cf-warning-line);
    background: var(--cf-warning-bg);
    color: var(--cf-warning);
}

.calls-empty-value {
    color: var(--cf-faint);
    font-size: .64rem;
}

.calls-summary-cell {
    overflow: hidden;
    color: var(--cf-text) !important;
}

.calls-summary-layout {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calls-summary-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calls-row.is-viewed:not(.is-last-opened) td {
    background: var(--cf-brand-soft);
}

.calls-row.is-viewed:not(.is-last-opened):hover td,
.calls-row.is-viewed:not(.is-last-opened):has(.calls-operator-link:hover) td {
    background: var(--cf-brand-soft);
}

.calls-row.is-viewed:not(.is-last-opened) td:first-child {
    box-shadow: inset 2px 0 color-mix(in srgb, var(--cf-brand) 52%, var(--cf-line));
}

.calls-row.is-last-opened {
    background: var(--cf-brand-soft);
}

.calls-row.is-last-opened td,
.calls-row.is-last-opened:hover td,
.calls-row.is-last-opened:has(.calls-operator-link:hover) td {
    background: var(--cf-brand-soft);
}

.calls-row.is-last-opened td:first-child {
    box-shadow: inset 3px 0 var(--cf-brand);
}

.calls-open-cell {
    padding-right: 3px !important;
    padding-left: 3px !important;
    text-align: center;
}

.calls-open-cell a {
    width: 27px;
    height: 27px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--cf-muted);
}

.calls-open-cell a:hover {
    background: var(--cf-soft);
    color: var(--cf-ink);
}

.calls-open-cell svg {
    width: 15px;
    height: 15px;
}

.calls-empty-row td {
    height: 120px;
    padding: 24px;
    color: var(--cf-muted);
    font-size: .78rem;
    text-align: center;
}

.calls-pager {
    min-height: 48px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--cf-line);
}

.calls-pager-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calls-pager-info,
.calls-page-size {
    color: var(--cf-muted);
    font-size: .62rem;
    white-space: nowrap;
}

.calls-page-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
}

.calls-page-size select {
    height: 28px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-ink);
    font: inherit;
    font-weight: 750;
}

.calls-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calls-pages a,
.calls-pages > span:not(.calls-page-gap) {
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border: 1px solid var(--cf-line);
    border-radius: 7px;
    background: var(--cf-surface);
    color: var(--cf-muted);
    font-size: .62rem;
    font-weight: 700;
    text-decoration: none;
}

.calls-pages a:hover {
    border-color: var(--cf-line-strong);
    color: var(--cf-ink);
}

.calls-pages a.is-active {
    border-color: var(--cf-brand);
    background: var(--cf-brand-soft);
    color: var(--cf-brand-strong);
}

.calls-pages .is-disabled {
    opacity: .38;
}

.calls-page-gap {
    padding: 0 2px;
    color: var(--cf-muted);
}

.calls-view-notice {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 70;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 13px;
    border: 1px solid color-mix(in srgb, var(--cf-brand) 34%, var(--cf-line));
    border-radius: 9px;
    background: var(--cf-surface);
    color: var(--cf-text);
    box-shadow: 0 12px 30px rgb(18 31 48 / .18);
    font-size: .7rem;
    font-weight: 700;
}

.calls-view-notice[hidden] {
    display: none;
}

/* Tenant final: compact call row + fixed-position KPI matrix. */

.calls-kpi-matrix-view .calls-table {
    min-width: 1120px;
}

.calls-kpi-matrix-view .calls-col-date {
    width: 84px;
}

.calls-kpi-matrix-view .calls-col-phone {
    width: 124px;
}

.calls-kpi-matrix-view .calls-col-history {
    width: 50px;
}

.calls-kpi-matrix-view .calls-col-operator {
    width: 148px;
}

.calls-kpi-matrix-view .calls-col-call {
    width: 126px;
}

.calls-kpi-matrix-view .calls-col-type {
    width: 124px;
}

.calls-kpi-matrix-view .calls-col-result {
    width: 96px;
}

.calls-kpi-matrix-view .calls-col-branch {
    width: 120px;
}

.calls-kpi-matrix-view .calls-col-summary {
    width: auto;
}

.calls-kpi-matrix-view .calls-col-polite {
    width: 54px;
}

.calls-kpi-matrix-view .calls-col-kpi {
    /* Ширина держит до десяти показателей: сейчас их пять, новые
       включённые KPI просто встают в ряд и не двигают соседние колонки. */
    width: 82px;
}

.calls-kpi-matrix-view .calls-table thead th:nth-child(2),
.calls-kpi-matrix-view .calls-table thead th:nth-child(3),
.calls-kpi-matrix-view .calls-table thead th:nth-child(4),
.calls-kpi-matrix-view .calls-table thead th:nth-child(6),
.calls-kpi-matrix-view .calls-table thead th:nth-child(7),
.calls-kpi-matrix-view .calls-table thead th:nth-child(8),
.calls-kpi-matrix-view .calls-table thead th:nth-child(9),
.calls-kpi-matrix-view .calls-table thead th:nth-child(10),
.calls-kpi-matrix-view .calls-table thead th:nth-child(11) {
    text-align: center;
}

.calls-phone-cell {
    padding-right: 4px !important;
    padding-left: 4px !important;
    text-align: center;
    white-space: nowrap;
}

.calls-copy-phone {
    max-width: 100%;
    height: 28px;
    padding: 0 5px 0 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cf-ink);
    font: inherit;
    font-size: .64rem;
    font-weight: 750;
    letter-spacing: .005em;
    cursor: pointer;
}

.calls-copy-phone:hover,
.calls-copy-phone:focus-visible {
    background: var(--cf-soft);
    color: var(--cf-ink);
}

.calls-copy-phone:focus-visible {
    outline: 2px solid var(--cf-brand);
    outline-offset: 1px;
}

.calls-copy-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--cf-muted);
}

.calls-copy-icon svg {
    width: 14px;
    height: 14px;
    grid-area: 1 / 1;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.calls-copy-icon .is-check {
    opacity: 0;
}

.calls-copy-phone.is-copied .calls-copy-icon {
    color: var(--cf-success);
}

.calls-copy-phone.is-copied .is-copy {
    opacity: 0;
}

.calls-copy-phone.is-copied .is-check {
    opacity: 1;
}

/* ============================================================
   KPI-ПОЛОСКА В СТРОКЕ. Разворотки у звонка больше нет: каждый
   включённый показатель — свой штрих. Зелёный — выполнен,
   красный — не выполнен, жёлтый — пограничный (вежливость 6–8),
   серый — к этому звонку неприменим.
   ============================================================ */

.calls-kpi-cell {
    padding-left: 6px !important;
    padding-right: 6px !important;
    text-align: center;
}

.calls-kpi-strip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.calls-kpi-strip i {
    width: 4px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 1px;
    background: var(--cf-success);
}

.calls-kpi-strip i.is-failed {
    background: var(--cf-kpi-failed);
}

.calls-kpi-strip i.is-warning {
    background: var(--cf-warning);
}

.calls-kpi-strip i.is-na {
    background: var(--cf-line-strong);
    opacity: .55;
}

.calls-kpi-matrix-view .calls-type-badge {
    width: 112px;
}

.calls-kpi-matrix-view .calls-result-badge {
    width: auto;
    min-width: 78px;
    justify-content: center;
}

@media (max-width: 1200px) and (min-width: 768px) {
    .calls-filter-main {
        grid-template-columns: 146px 154px 134px minmax(190px, 1fr);
    }

    .calls-filter-main > select[name="sort"] {
        grid-column: 1 / 3;
    }

    .calls-filter-toggle {
        grid-column: 3;
    }

    .calls-filter-panel {
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .calls-page-head {
        align-items: center;
        margin-bottom: 13px;
    }

    .calls-page-head h1 {
        font-size: 1.45rem;
    }

    .calls-page-head p {
        margin-top: 4px;
        font-size: .65rem;
    }

    .calls-export {
        width: 36px;
        min-width: 36px;
        padding: 0;
        font-size: 0;
    }

    .calls-filter-main {
        padding: 9px;
        grid-template-columns: 136px minmax(0, 1fr);
    }

    .calls-filter-main > * {
        min-width: 0;
    }

    .calls-search {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .calls-period {
        grid-column: 1;
        grid-row: 2;
    }

    .calls-filter-toggle {
        grid-column: 2;
        grid-row: 2;
        padding: 0 7px;
    }

    .calls-filter-main > .calls-operator-filter {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .calls-filter-main > select[name="direction"] {
        grid-column: 1;
        grid-row: 4;
    }

    .calls-filter-main > select[name="sort"] {
        grid-column: 2;
        grid-row: 4;
    }

    .calls-quick-row {
        min-height: 40px;
        padding: 6px 9px;
    }

    .calls-view-row {
        padding: 7px 9px;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 6px 8px;
    }

    .calls-view-label {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }

    .calls-view-filters {
        max-width: 100%;
        overflow-x: auto;
    }

    .calls-view-filter {
        min-height: 30px;
    }

    .calls-view-help {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .calls-filter-panel.is-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 8px;
    }

    .calls-filter-dropdown {
        min-width: 0;
    }

    .calls-filter-dropdown > summary,
    .calls-contact-filter {
        width: 100%;
        min-width: 0;
    }

    .calls-dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
    }

    .calls-filter-reset {
        grid-column: 1 / -1;
        justify-self: start;
        margin-left: 0;
    }

    .calls-active-filters {
        margin-bottom: 9px;
    }

    .calls-table-meta {
        min-height: 42px;
        padding: 0 11px;
    }

    .calls-legend {
        display: none;
    }

    .calls-table-scroll {
        overflow: visible;
    }

    .calls-table,
    .calls-table tbody {
        width: 100%;
        min-width: 0;
        display: block;
    }

    .calls-table colgroup,
    .calls-table thead {
        display: none;
    }

    .calls-row {
        position: relative;
        width: 100%;
        min-width: 0;
        padding: 11px 40px 11px 12px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px 10px;
        border-bottom: 1px solid var(--cf-line);
    }

    .calls-row.is-last-opened {
        background: var(--cf-brand-soft);
        box-shadow: inset 3px 0 var(--cf-brand);
    }

    .calls-row.is-viewed:not(.is-last-opened) {
        background: var(--cf-brand-soft);
        box-shadow: inset 2px 0 color-mix(in srgb, var(--cf-brand) 52%, var(--cf-line));
    }

    .calls-row.is-viewed:not(.is-last-opened) td:first-child,
    .calls-row.is-last-opened td:first-child {
        box-shadow: none;
    }

    .calls-row td {
        height: auto;
        min-width: 0;
        padding: 0 !important;
        border: 0;
        background: transparent !important;
    }

    .calls-date-cell {
        grid-column: 1;
        grid-row: 1;
        font-size: .61rem !important;
    }

    .calls-history-cell {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        text-align: left;
    }

    .calls-history-badge {
        min-width: 39px;
        padding: 1px 5px;
        font-size: .55rem;
    }

    .calls-operator-cell {
        grid-column: 1 / 3;
        grid-row: 2;
        font-size: .7rem !important;
    }

    .calls-operator-link,
    .calls-operator-static {
        height: auto;
        padding: 0;
    }

    .calls-call-cell {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .calls-call-layout {
        width: auto;
        grid-template-columns: 82px 42px;
        gap: 5px;
    }

    .calls-type-cell {
        grid-column: 1 / 3;
        grid-row: 3;
        text-align: left;
    }

    .calls-result-cell {
        grid-column: 3;
        grid-row: 3;
        justify-self: end;
        text-align: right;
    }

    .calls-polite-cell {
        grid-column: 3;
        grid-row: 2;
        text-align: right;
    }

    .calls-summary-cell {
        grid-column: 1 / -1;
        grid-row: 4;
        padding-top: 3px !important;
        overflow: visible;
        color: var(--cf-ink) !important;
        font-size: .7rem !important;
        line-height: 1.4;
        text-overflow: clip;
        white-space: normal;
    }

    .calls-summary-layout {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px;
    }

    .calls-summary-text {
        flex-basis: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .calls-misses-cell {
        grid-column: 1 / -1;
        grid-row: 5;
        padding-top: 1px !important;
    }

    .calls-misses-cell:has(.calls-empty-value) {
        display: none;
    }

    .calls-open-cell {
        position: absolute;
        top: 50%;
        right: 7px;
        transform: translateY(-50%);
    }

    .calls-kpi-matrix-view .calls-kpi-row {
        padding-right: 12px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .calls-kpi-matrix-view .calls-phone-cell {
        grid-column: 1 / 3;
        grid-row: 2;
        justify-self: start;
    }

    .calls-kpi-matrix-view .calls-copy-phone {
        height: 24px;
        padding-left: 0;
    }

    .calls-kpi-matrix-view .calls-operator-cell {
        grid-column: 1 / 3;
        grid-row: 3;
    }

    .calls-kpi-matrix-view .calls-type-cell {
        grid-column: 1 / 3;
        grid-row: 4;
    }

    .calls-kpi-matrix-view .calls-result-cell {
        grid-column: 3;
        grid-row: 4;
    }

    .calls-kpi-matrix-view .calls-summary-cell {
        grid-row: 5;
    }

    .calls-kpi-matrix-view .calls-kpi-cell {
        grid-column: 3;
        grid-row: 2 / 4;
        align-self: center;
        justify-self: end;
    }

    .calls-empty-row {
        display: block;
    }

    .calls-empty-row td {
        display: block;
    }

    .calls-pager {
        padding: 9px 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .calls-pager-left {
        width: 100%;
        justify-content: center;
    }

    .calls-pager-info {
        display: none;
    }

    .calls-pages {
        width: 100%;
        justify-content: center;
    }

    .calls-view-notice {
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calls-filter-dropdown summary svg {
        transition: none;
    }
}
