/* ==========================================================================
   Reklam CRM Late Design Overrides v1
   Загружается после локальных <style> страниц.
   Цель: единые заголовки, карточки, кнопки, поля, таблицы и отступы.
   ========================================================================== */

:root {
    --rk-bg: #f3f7f5;
    --rk-surface: #ffffff;
    --rk-text: #10231d;
    --rk-text-strong: #071b14;
    --rk-muted: #5f6f68;
    --rk-line: rgba(19, 35, 29, .10);
    --rk-line-strong: rgba(19, 35, 29, .16);
    --rk-green: #0f9f68;
    --rk-green-dark: #087f55;
    --rk-green-soft: #e4f7ee;
    --rk-yellow: #f5c400;
    --rk-radius: 20px;
    --rk-shadow: 0 18px 45px rgba(16,35,28,.07);
    --rk-shadow-soft: 0 10px 24px rgba(16,35,28,.05);
}

/* Единая рабочая зона */
html:not(.dark) .fi-main,
html:not(.dark) .fi-page,
html:not(.dark) .fi-page-content,
html:not(.dark) .fi-main-ctn {
    background: var(--rk-bg) !important;
    color: var(--rk-text) !important;
}

/* Единая ширина/поведение страниц */
html:not(.dark) .fi-main .fi-page-content,
html:not(.dark) .fi-main .fi-page > section,
html:not(.dark) .fi-main .fi-page > div {
    max-width: none !important;
}

/* Стандартные Filament-заголовки */
html:not(.dark) .fi-main .fi-header-heading {
    color: var(--rk-text-strong) !important;
    font-size: 32px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
    font-weight: 950 !important;
    margin: 0 !important;
}

html:not(.dark) .fi-main .fi-header-subheading {
    color: var(--rk-muted) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 650 !important;
}

/* Наши кастомные заголовки */
html:not(.dark) .fi-main .rk-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin: 0 0 18px 0 !important;
}

html:not(.dark) .fi-main .rk-kicker {
    color: var(--rk-green) !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    margin: 0 0 8px 0 !important;
}

html:not(.dark) .fi-main .rk-title,
html:not(.dark) .fi-main .rk-page-title,
html:not(.dark) .fi-main .rk-head h1 {
    color: var(--rk-text-strong) !important;
    font-size: 32px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.045em !important;
    font-weight: 950 !important;
    margin: 0 !important;
}

html:not(.dark) .fi-main .rk-sub,
html:not(.dark) .fi-main .rk-head p {
    color: var(--rk-muted) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 650 !important;
    margin-top: 8px !important;
}

/* Заголовки внутри карточек */
html:not(.dark) .fi-main .rk-panel-title,
html:not(.dark) .fi-main .rk-form-title,
html:not(.dark) .fi-main .rk-section-title,
html:not(.dark) .fi-main .rk-profile-title {
    color: var(--rk-text-strong) !important;
    font-weight: 950 !important;
    letter-spacing: -0.025em !important;
}

/* Карточки / панели / таблицы */
html:not(.dark) .fi-main .rk-card,
html:not(.dark) .fi-main .rk-panel,
html:not(.dark) .fi-main .rk-kpi,
html:not(.dark) .fi-main .rk-stat,
html:not(.dark) .fi-main .rk-widget,
html:not(.dark) .fi-main .fi-section,
html:not(.dark) .fi-main .fi-ta,
html:not(.dark) .fi-main .fi-ta-content,
html:not(.dark) .fi-main .fi-wi-stats-overview-stat {
    background: var(--rk-surface) !important;
    border: 1px solid var(--rk-line) !important;
    border-radius: var(--rk-radius) !important;
    box-shadow: var(--rk-shadow) !important;
    color: var(--rk-text) !important;
}

/* Основной текст */
html:not(.dark) .fi-main h1,
html:not(.dark) .fi-main h2,
html:not(.dark) .fi-main h3,
html:not(.dark) .fi-main h4,
html:not(.dark) .fi-main h5,
html:not(.dark) .fi-main h6,
html:not(.dark) .fi-main p,
html:not(.dark) .fi-main label,
html:not(.dark) .fi-main th,
html:not(.dark) .fi-main td,
html:not(.dark) .fi-main .rk-name,
html:not(.dark) .fi-main .rk-value,
html:not(.dark) .fi-main .rk-meta-value,
html:not(.dark) .fi-main .rk-line span:last-child {
    color: var(--rk-text) !important;
    opacity: 1 !important;
}

/* Второстепенный текст */
html:not(.dark) .fi-main .rk-muted,
html:not(.dark) .fi-main .rk-label,
html:not(.dark) .fi-main .rk-meta-label,
html:not(.dark) .fi-main .rk-line span:first-child,
html:not(.dark) .fi-main .fi-breadcrumbs,
html:not(.dark) .fi-main .fi-breadcrumbs *,
html:not(.dark) .fi-main .text-gray-400,
html:not(.dark) .fi-main .text-gray-500,
html:not(.dark) .fi-main .text-gray-600,
html:not(.dark) .fi-main .text-slate-400,
html:not(.dark) .fi-main .text-slate-500,
html:not(.dark) .fi-main .text-slate-600 {
    color: var(--rk-muted) !important;
    opacity: 1 !important;
}

/* Защита от старого белого текста */
html:not(.dark) .fi-main .text-white:not(.rk-avatar):not(.rk-avatar *):not(.rk-btn):not(.rk-btn *):not(.fi-btn):not(.fi-btn *):not(.rk-pill-dark):not(.rk-pill-dark *),
html:not(.dark) .fi-main [class*="text-white"]:not(.rk-avatar):not(.rk-avatar *):not(.rk-btn):not(.rk-btn *):not(.fi-btn):not(.fi-btn *):not(.rk-pill-dark):not(.rk-pill-dark *) {
    color: var(--rk-text) !important;
}

/* Кнопки */
html:not(.dark) .fi-main .rk-btn,
html:not(.dark) .fi-main .fi-btn {
    min-height: 38px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    box-shadow: var(--rk-shadow-soft) !important;
}

html:not(.dark) .fi-main .rk-btn-green,
html:not(.dark) .fi-main .rk-edit-btn,
html:not(.dark) .fi-main .rk-contact-edit-btn,
html:not(.dark) .fi-main .rk-btn-open,
html:not(.dark) .fi-main .fi-btn-color-primary,
html:not(.dark) .fi-main .fi-btn.fi-color-primary,
html:not(.dark) .fi-main [class*="fi-color-primary"] {
    background: linear-gradient(135deg, var(--rk-green), var(--rk-green-dark)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

html:not(.dark) .fi-main .rk-btn-green *,
html:not(.dark) .fi-main .rk-edit-btn *,
html:not(.dark) .fi-main .rk-contact-edit-btn *,
html:not(.dark) .fi-main .rk-btn-open *,
html:not(.dark) .fi-main .fi-btn-color-primary *,
html:not(.dark) .fi-main .fi-btn.fi-color-primary *,
html:not(.dark) .fi-main [class*="fi-color-primary"] * {
    color: #ffffff !important;
}

/* Обычные кнопки */
html:not(.dark) .fi-main .rk-btn:not(.rk-btn-green):not(.rk-btn-dark):not(.rk-btn-orange):not(.rk-edit-btn):not(.rk-btn-open):not(.rk-contact-edit-btn),
html:not(.dark) .fi-main .fi-btn:not(.fi-btn-color-primary):not(.fi-color-primary) {
    background: #ffffff !important;
    border: 1px solid var(--rk-line-strong) !important;
    color: var(--rk-text) !important;
}

/* Активные табы/переключатели */
html:not(.dark) .fi-main .rk-btn.is-active,
html:not(.dark) .fi-main .rk-btn-dark {
    background: var(--rk-text) !important;
    border-color: var(--rk-text) !important;
    color: #ffffff !important;
}

/* Формы */
html:not(.dark) .fi-main input,
html:not(.dark) .fi-main textarea,
html:not(.dark) .fi-main select,
html:not(.dark) .fi-main .fi-input,
html:not(.dark) .fi-main .fi-select-input,
html:not(.dark) .fi-main .fi-textarea,
html:not(.dark) .fi-main .fi-input-wrp {
    background: #ffffff !important;
    color: var(--rk-text) !important;
    border-color: var(--rk-line-strong) !important;
}

html:not(.dark) .fi-main input::placeholder,
html:not(.dark) .fi-main textarea::placeholder {
    color: #8b9892 !important;
    opacity: 1 !important;
}

/* Checkbox/radio */
html:not(.dark) .fi-main input[type="checkbox"],
html:not(.dark) .fi-main input[type="radio"] {
    background-color: #ffffff !important;
    border: 1px solid rgba(19,35,29,.24) !important;
    color: var(--rk-green) !important;
}

html:not(.dark) .fi-main input[type="checkbox"]:checked,
html:not(.dark) .fi-main input[type="radio"]:checked {
    background-color: var(--rk-green) !important;
    border-color: var(--rk-green) !important;
}

/* Табличные строки */
html:not(.dark) .fi-main .fi-ta table,
html:not(.dark) .fi-main .fi-ta thead,
html:not(.dark) .fi-main .fi-ta tbody,
html:not(.dark) .fi-main .fi-ta tr,
html:not(.dark) .fi-main .fi-ta th,
html:not(.dark) .fi-main .fi-ta td {
    background: #ffffff !important;
    color: var(--rk-text) !important;
    border-color: rgba(19,35,29,.08) !important;
}

html:not(.dark) .fi-main .fi-ta-row:hover,
html:not(.dark) .fi-main .fi-ta tr:hover {
    background: #f8faf9 !important;
}

/* Аватары */
html:not(.dark) .fi-main .rk-avatar,
html:not(.dark) .fi-main .rk-avatar * {
    background: var(--rk-text) !important;
    color: #ffffff !important;
}

/* Скролл */
html:not(.dark) .fi-main ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html:not(.dark) .fi-main ::-webkit-scrollbar-track {
    background: rgba(19,35,29,.05);
    border-radius: 999px;
}

html:not(.dark) .fi-main ::-webkit-scrollbar-thumb {
    background: rgba(15,159,104,.34);
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.82);
}

/* Адаптив */
@media (max-width: 760px) {
    html:not(.dark) .fi-main .rk-head {
        display: block !important;
    }

    html:not(.dark) .fi-main .rk-actions {
        justify-content: flex-start !important;
        margin-top: 14px !important;
    }

    html:not(.dark) .fi-main .rk-title,
    html:not(.dark) .fi-main .fi-header-heading {
        font-size: 28px !important;
    }
}


/* === REKLAM HEADING RHYTHM V1 START ===
   Централизация типографики:
   - обычные h1/h2/h3 на кастомных страницах;
   - стандартные заголовки Filament;
   - наши rk-title/rk-panel-title.
========================================================================== */

html:not(.dark) .fi-main {
    --rk-page-title-size: 32px;
    --rk-section-title-size: 24px;
    --rk-card-title-size: 18px;
    --rk-title-line-height: 1.08;
    --rk-title-letter-spacing: -0.045em;
}

/* Общий заголовок страницы: Filament + наши кастомные + обычные h1 */
html:not(.dark) .fi-main .fi-header-heading,
html:not(.dark) .fi-main .rk-title,
html:not(.dark) .fi-main .rk-page-title,
html:not(.dark) .fi-main .rk-head h1,
html:not(.dark) .fi-main .fi-page-content > h1,
html:not(.dark) .fi-main .fi-page-content > div > h1,
html:not(.dark) .fi-main .fi-page-content > section > h1,
html:not(.dark) .fi-main .fi-page-content h1:first-child {
    color: var(--rk-text-strong, #071b14) !important;
    font-size: var(--rk-page-title-size) !important;
    line-height: var(--rk-title-line-height) !important;
    letter-spacing: var(--rk-title-letter-spacing) !important;
    font-weight: 950 !important;
    margin: 0 0 14px 0 !important;
}

/* Подзаголовок страницы / описание */
html:not(.dark) .fi-main .fi-header-subheading,
html:not(.dark) .fi-main .rk-sub,
html:not(.dark) .fi-main .rk-head p,
html:not(.dark) .fi-main .fi-page-content > p,
html:not(.dark) .fi-main .fi-page-content > div > p:first-of-type,
html:not(.dark) .fi-main .fi-page-content > section > p:first-of-type {
    color: var(--rk-muted, #5f6f68) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 650 !important;
    margin-top: 0 !important;
    margin-bottom: 18px !important;
}

/* Заголовки секций: например "Ссылки на XML-фиды", "Подключение каталога к сайту" */
html:not(.dark) .fi-main .fi-page-content h2,
html:not(.dark) .fi-main .rk-section-title {
    color: var(--rk-text-strong, #071b14) !important;
    font-size: var(--rk-section-title-size) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.035em !important;
    font-weight: 950 !important;
    margin: 0 0 12px 0 !important;
}

/* Заголовки карточек и внутренних блоков */
html:not(.dark) .fi-main .fi-page-content h3,
html:not(.dark) .fi-main .rk-panel-title,
html:not(.dark) .fi-main .rk-form-title,
html:not(.dark) .fi-main .rk-card-title {
    color: var(--rk-text-strong, #071b14) !important;
    font-size: var(--rk-card-title-size) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    font-weight: 950 !important;
    margin: 0 0 10px 0 !important;
}

/* Убираем разный верхний отступ у кастомных страниц */
html:not(.dark) .fi-main .fi-page-content {
    padding-top: 26px !important;
}

/* Карточки с обычными h2/h3 внутри не должны раздуваться */
html:not(.dark) .fi-main .rk-card h2,
html:not(.dark) .fi-main .rk-panel h2,
html:not(.dark) .fi-main .fi-section h2 {
    font-size: 22px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 10px !important;
}

html:not(.dark) .fi-main .rk-card h3,
html:not(.dark) .fi-main .rk-panel h3,
html:not(.dark) .fi-main .fi-section h3 {
    font-size: 18px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    margin-bottom: 8px !important;
}

/* Единый стиль текста под h2/h3 внутри информационных блоков */
html:not(.dark) .fi-main .rk-card p,
html:not(.dark) .fi-main .rk-panel p,
html:not(.dark) .fi-main .fi-section p {
    color: var(--rk-text, #10231d) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Приводим крупные кастомные контейнеры к одному внутреннему ритму */
html:not(.dark) .fi-main .rk-card,
html:not(.dark) .fi-main .rk-panel,
html:not(.dark) .fi-main .fi-section {
    padding-top: 18px !important;
}

/* Мобильная версия */
@media (max-width: 760px) {
    html:not(.dark) .fi-main {
        --rk-page-title-size: 28px;
        --rk-section-title-size: 22px;
        --rk-card-title-size: 17px;
    }

    html:not(.dark) .fi-main .fi-page-content {
        padding-top: 18px !important;
    }
}

/* === REKLAM HEADING RHYTHM V1 END === */
