/* Страницы «Пульс отрасли ДМДК» и «Рейтинг ТОП-100» (assay_registry).
   Токены — из дизайн-системы uv-* (static/css/base.css); акцентные цвета
   градиентов (#6f42c1, #d63384) вне палитры uv заданы литералами. */

.ai-breadcrumb {
    display: flex; gap: 8px; align-items: center;
    padding: 16px 0 0; font-size: 14px; color: var(--uv-text-muted);
}
.ai-breadcrumb a { color: var(--uv-primary); text-decoration: none; }
.ai-breadcrumb a:hover { text-decoration: underline; }
.ai-breadcrumb .sep { color: var(--uv-text-hint); }

/* ── Шапка ── */
.ai-hero {
    margin-top: 16px; padding: 28px 32px;
    border-radius: var(--uv-radius-xl);
    background: linear-gradient(135deg, var(--uv-primary) 0%, #6f42c1 55%, #d63384 100%);
    color: var(--uv-text-inverse);
    box-shadow: var(--uv-shadow-md);
}
.ai-hero h1 { font-size: 34px; font-weight: var(--uv-fw-bold); letter-spacing: -0.01em; }
.ai-hero p { margin-top: 6px; max-width: 760px; opacity: 0.92; font-size: 16px; }
.ai-hero .ai-updated {
    margin-top: 12px; display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; background: rgba(255, 255, 255, 0.16);
    padding: 4px 12px; border-radius: var(--uv-radius-pill);
}
.ai-hero .ai-updated a { color: var(--uv-text-inverse); }

/* ── KPI-карточки ── */
.ai-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.ai-card {
    position: relative; border-radius: var(--uv-radius-xl);
    padding: 20px 22px 18px; background: var(--uv-text-inverse);
    border: 1px solid var(--uv-border-light);
    box-shadow: var(--uv-shadow-sm); overflow: hidden;
}
.ai-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; }
.ai-card-c1::before { background: linear-gradient(180deg, var(--uv-primary), #6ea8fe); }
.ai-card-c2::before { background: linear-gradient(180deg, var(--uv-success), #75d8a3); }
.ai-card-c3::before { background: linear-gradient(180deg, #d63384, #f0a3c4); }
.ai-card .ai-icon {
    width: 42px; height: 42px; border-radius: var(--uv-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; margin-bottom: 10px;
}
.ai-card-c1 .ai-icon { background: rgba(var(--uv-primary-rgb), 0.08); color: var(--uv-primary-dark); }
.ai-card-c2 .ai-icon { background: rgba(var(--uv-success-rgb), 0.08); color: var(--uv-success-dark); }
.ai-card-c3 .ai-icon { background: rgba(214, 51, 132, 0.1); color: #d63384; }
.ai-card .ai-label {
    font-size: 13px; font-weight: var(--uv-fw-semibold); text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--uv-text-muted);
}
.ai-card .ai-value {
    font-size: 38px; font-weight: var(--uv-fw-bold); line-height: var(--uv-lh-none);
    color: var(--uv-text-dark); font-variant-numeric: tabular-nums;
}

/* ── Дельты ── */
.ai-delta {
    margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: var(--uv-fw-semibold); padding: 3px 12px;
    border-radius: var(--uv-radius-pill); font-variant-numeric: tabular-nums;
}
.ai-delta .ai-since { font-weight: var(--uv-fw-normal); opacity: 0.75; }
.ai-delta-up { background: rgba(var(--uv-success-rgb), 0.12); color: var(--uv-success-dark); }
.ai-delta-down { background: rgba(var(--uv-danger-rgb), 0.12); color: var(--uv-danger-dark); }
.ai-delta-flat { background: var(--uv-border-light); color: var(--uv-text-muted); }

/* ── Секции ── */
.ai-section { margin-top: 32px; }
.ai-section h2 { font-size: 22px; font-weight: var(--uv-fw-bold); color: var(--uv-text-dark); }
.ai-note { margin-top: 10px; font-size: 13px; color: var(--uv-text-muted); }

/* ── Ротация за месяц ── */
.ai-churn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 14px; }
.ai-churn-tile {
    background: var(--uv-text-inverse); border: 1px solid var(--uv-border-light);
    border-radius: var(--uv-radius-lg); box-shadow: var(--uv-shadow-sm);
    padding: 14px 18px; display: flex; flex-direction: column; gap: 4px;
}
.ai-churn-label { font-size: 13px; color: var(--uv-text-muted); }
.ai-churn-value { font-size: 28px; font-weight: var(--uv-fw-bold); font-variant-numeric: tabular-nums; }
.ai-churn-value.pos { color: var(--uv-success); }
.ai-churn-value.neg { color: var(--uv-danger); }

/* ── Структура ЮЛ/ИП ── */
.ai-structure {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px;
}
.ai-structure-item {
    background: var(--uv-text-inverse); border: 1px solid var(--uv-border-light);
    border-radius: var(--uv-radius-lg); box-shadow: var(--uv-shadow-sm);
    padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ai-structure-value { font-size: 26px; font-weight: var(--uv-fw-bold); font-variant-numeric: tabular-nums; }

/* ── Бейджи типа ── */
.ai-kind {
    display: inline-block; font-size: 12px; font-weight: var(--uv-fw-bold);
    padding: 2px 10px; border-radius: var(--uv-radius-pill); white-space: nowrap;
}
.ai-kind-ul { background: rgba(var(--uv-primary-rgb), 0.1); color: #0b5ed7; }
.ai-kind-ip { background: rgba(214, 137, 16, 0.14); color: var(--uv-warning); }

/* ── Таблицы ── */
.ai-table-wrap {
    margin-top: 14px; background: var(--uv-text-inverse);
    border: 1px solid var(--uv-border-light);
    border-radius: var(--uv-radius-lg); box-shadow: var(--uv-shadow-sm); overflow-x: auto;
}
.ai-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 720px; }
.ai-table-tight { min-width: 0; }
.ai-table thead th {
    text-align: left; padding: 12px 14px; font-size: 12.5px;
    font-weight: var(--uv-fw-semibold);
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--uv-text-muted);
    background: var(--uv-bg-warm); border-bottom: 1px solid var(--uv-border);
    white-space: nowrap;
}
.ai-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--uv-border-light); vertical-align: top; }
.ai-table tbody tr:hover { background: var(--uv-bg-warm); }
.ai-table .ai-col-num { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.ai-rank { font-weight: var(--uv-fw-bold); color: var(--uv-text-secondary); width: 46px; }
.ai-org-name { font-weight: var(--uv-fw-semibold); color: var(--uv-text-dark); }
.ai-inn {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 14px; color: var(--uv-text-secondary); white-space: nowrap;
}
.ai-points { font-weight: var(--uv-fw-bold); font-size: 17px; color: var(--uv-text-dark); }
.ai-empty { text-align: center; color: var(--uv-text-muted); padding: 32px 14px; }

/* ── Регионы присутствия ── */
.ai-regions { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.ai-region {
    font-size: 12px; background: var(--uv-bg-warm);
    border: 1px solid var(--uv-border-light);
    padding: 1px 8px; border-radius: var(--uv-radius-pill);
    color: var(--uv-text-secondary); white-space: nowrap;
}

/* ── Размеры сетей ── */
.ai-networks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 14px; }
.ai-network-tile {
    background: var(--uv-text-inverse); border: 1px solid var(--uv-border-light);
    border-radius: var(--uv-radius-lg); box-shadow: var(--uv-shadow-sm);
    padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.ai-network-label { font-size: 13px; color: var(--uv-text-muted); }
.ai-network-value { font-size: 24px; font-weight: var(--uv-fw-bold); color: var(--uv-text-dark); }

/* ── География ── */
.ai-geo { margin-top: 14px; }
.ai-geo-value { font-size: 16px; }
.ai-geo-value strong { font-size: 26px; }
.ai-geo-bar { display: flex; height: 14px; border-radius: var(--uv-radius-pill); overflow: hidden; margin-top: 10px; }
.ai-geo-bar .up { background: var(--uv-success); }
.ai-geo-bar .flat { background: var(--uv-border); }
.ai-geo-bar .down { background: var(--uv-danger); }
.ai-geo-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; color: var(--uv-text-secondary); }

/* ── Ссылки-карточки ── */
.ai-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.ai-link-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--uv-text-inverse); border: 1px solid var(--uv-border-light);
    border-radius: var(--uv-radius-lg); box-shadow: var(--uv-shadow-sm);
    padding: 16px 18px; text-decoration: none; color: var(--uv-text);
}
.ai-link-card:hover { border-color: var(--uv-primary); }
.ai-link-card i:first-child { color: var(--uv-primary); font-size: 20px; }
.ai-link-card i:last-child { margin-left: auto; color: var(--uv-text-hint); }
.ai-footer-note { margin: 18px 0 40px; font-size: 13px; color: var(--uv-text-muted); }
.ai-footer-note a { color: var(--uv-primary); }

@media (max-width: 991.98px) {
    .ai-cards { grid-template-columns: 1fr 1fr; }
    .ai-churn { grid-template-columns: 1fr 1fr; }
    .ai-structure { grid-template-columns: 1fr; }
    .ai-networks { grid-template-columns: repeat(3, 1fr); }
    .ai-hero h1 { font-size: 26px; }
}
@media (max-width: 575.98px) {
    .ai-cards, .ai-churn, .ai-structure, .ai-networks { grid-template-columns: 1fr; }
    .ai-links { grid-template-columns: 1fr; }
}
