/**
 * lk-webmaster.css — стили кабинета вебмастера (/wm/*).
 * Переиспользуем общие классы ЛК (.dash-card и т.п.), здесь — только специфика.
 */

/* ── Шрифт кабинета — Inter (класс spi-wm вешается на body в layouts/main.php) ── */

body.spi-wm {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Бейджи модерационных статусов лида (см. common\helpers\LeadsStatuses) ── */

.badge-wm-pending,
.badge-wm-confirmed,
.badge-wm-rejected,
.badge-wm-duplicate {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-wm-pending    { background: #fff3cd; color: #856404; }
.badge-wm-confirmed  { background: #d4edda; color: #155724; }
.badge-wm-rejected   { background: #f8d7da; color: #721c24; }
.badge-wm-duplicate  { background: #e9ecef; color: #6c757d; }

/* ── Вертикальные отступы между блоками дашборда ──
   .dash-card сам по себе без внешних отступов (в ЛК рекламодателя блоки
   разделяет .dash-row) — здесь блоки идут подряд, задаём отступ явно. */

.wm-dashboard > .dash-card { margin-bottom: 16px; }

/* ── KPI: 5 карточек в ряд (базовый .dash-kpi — 4 колонки) ── */

.wm-kpi { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1399px) {
    .wm-kpi .dash-kpi-card { padding: 16px 18px; gap: 12px; }
}

@media (max-width: 1199px) {
    .wm-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .wm-kpi { grid-template-columns: 1fr; }
}

/* ── Главная: генератор партнёрской ссылки ── */

.wm-gen-hint {
    color: #6c757d;
    font-size: 13px;
    margin: 0 0 14px;
}

.wm-gen-subs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 991px) {
    .wm-gen-subs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .wm-gen-subs { grid-template-columns: 1fr; }
}

.wm-gen-field .form-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.wm-gen-result-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.wm-gen-field-grow { flex: 1 1 auto; min-width: 0; }

.wm-gen-result {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 13px;
    background: #f8f9fa;
}

.wm-gen-copy { white-space: nowrap; }

@media (max-width: 575px) {
    .wm-gen-result-row { flex-direction: column; align-items: stretch; }
}

/* ── Главная: «С чего начать» ── */

.wm-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 991px) {
    .wm-steps { grid-template-columns: 1fr; }
}

.wm-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid #eceff3;
    border-radius: 10px;
    padding: 14px;
}

.wm-step-num {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffe6f0;
    color: #e6005a;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-step-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.wm-step-text {
    color: #6c757d;
    font-size: 13px;
}

/* ── Главная: экономика трафика ── */

.wm-econ-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 767px) {
    .wm-econ-grid { grid-template-columns: 1fr; }
}

.wm-econ-item {
    border: 1px solid #eceff3;
    border-radius: 10px;
    padding: 14px;
}

.wm-econ-label {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 6px;
}

.wm-econ-value {
    font-size: 22px;
    font-weight: 700;
}

.wm-econ-note {
    color: #adb5bd;
    font-size: 12px;
    margin-top: 10px;
}

/* ── Главная: строки офферов ── */

.wm-offer-rows { display: flex; flex-direction: column; }

.wm-offer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f5;
}

.wm-offer-row:last-child { border-bottom: 0; }

.wm-offer-row-logo img,
.wm-offer-row-logo-ph {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
}

.wm-offer-row-logo-ph {
    background: #ffe6f0;
    color: #e6005a;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-offer-row-body { flex: 1 1 auto; min-width: 0; }

.wm-offer-row-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wm-offer-row-meta {
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wm-offer-row-rate {
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
}

/* ── Офферы: инфо-алерт и поиск ── */

.wm-info-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ffe6f0;
    color: #b80049;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 16px;
}

.wm-info-alert .fa { margin-top: 2px; }

.wm-offers-search {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.wm-offers-search-input {
    position: relative;
    flex: 1 1 auto;
}

.wm-offers-search-input .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}

.wm-offers-search-input .form-control { padding-left: 34px; }

.wm-offers-search-reset { white-space: nowrap; }

/* ── Офферы: карточки ── */

.wm-offer-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wm-offer-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.wm-offer-card-logo img,
.wm-offer-card-logo .wm-offer-row-logo-ph {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.wm-offer-card-main { flex: 1 1 auto; min-width: 0; }

.wm-offer-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wm-offer-card-title {
    font-weight: 700;
    font-size: 15px;
}

.wm-offer-card-id {
    color: #adb5bd;
    font-size: 12px;
    font-family: var(--bs-font-monospace, monospace);
}

.wm-offer-card-badge {
    background: #ffe6f0;
    color: #e6005a;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.wm-offer-card-sub {
    color: #6c757d;
    font-size: 13px;
    margin-top: 2px;
}

.wm-offer-card-props {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 767px) {
    .wm-offer-card-props { grid-template-columns: 1fr; }
}

.wm-offer-prop-label {
    color: #adb5bd;
    font-size: 12px;
    margin-bottom: 2px;
}

.wm-offer-prop-value {
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 575px) {
    .wm-offer-card { flex-wrap: wrap; }
}

/* ── Статистика: KPI-карточки (пастельный градиент + водяная иконка) ── */

.wm-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    /* как у родного .stats-kpi-row: ровные зазоры сверху и снизу */
    margin-top: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1199px) {
    .wm-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .wm-kpi-row { grid-template-columns: 1fr; }
}

/* Пастельные тона: фон + акцент */
.wm-tone-indigo { --wm-bg: #eef2ff; --wm-accent: #4f46e5; }
.wm-tone-mint   { --wm-bg: #ecfdf5; --wm-accent: #059669; }
.wm-tone-amber  { --wm-bg: #fffbeb; --wm-accent: #d97706; }
.wm-tone-pink   { --wm-bg: #fdf2f8; --wm-accent: #db2777; }
.wm-tone-violet { --wm-bg: #f5f3ff; --wm-accent: #7c3aed; }

.wm-kpi-item {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--wm-bg) 0%, #fff 95%);
    border: 1px solid #f1f3f9;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0px 1px 1px 0px #ccc;
}

.wm-kpi-watermark {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 42px;
    color: var(--wm-accent);
    opacity: .12;
    pointer-events: none;
}

.wm-kpi-item .wm-kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--wm-accent);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}

.wm-kpi-item .wm-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #1f2430;
}

/* ── Статистика: подзаголовки секций (вне карточек-таблиц) ── */

.wm-stats-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: #2d3142;
    margin: 24px 0 10px;
}

/* ── Статистика: двухстрочные заголовки sub-колонок в ленте лидов ── */

.wm-th-subhint {
    font-weight: 400;
    font-size: 11px;
    color: #adb5bd;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
    margin-bottom: 2px;
}

/* ── Статистика: чипы sub-меток и id лидов ── */

.wm-sub-chip {
    display: inline-block;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 2px 8px;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 12px;
}

.wm-lead-id {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 12px;
    color: #6c757d;
}

/* ── Материалы ── */

.wm-soon-badge {
    background: #f1f3f5;
    color: #6c757d;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.wm-post-text {
    font-size: 14px;
    margin-bottom: 8px;
}

.wm-post-link {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 13px;
    color: #6c757d;
    word-break: break-all;
}

.wm-materials-note {
    color: #adb5bd;
    font-size: 12px;
}

.wm-banners {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 991px) {
    .wm-banners { grid-template-columns: 1fr; }
}

.wm-banner {
    border: 1px solid #eceff3;
    border-radius: 10px;
    overflow: hidden;
}

.wm-banner-preview {
    background: #ffe6f0;
    color: #e6005a;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
}

.wm-banner-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
}

.wm-banner-size { font-weight: 700; font-size: 14px; }

.wm-banner-purpose { color: #6c757d; font-size: 12px; }

/* ── Профиль ── */

.wm-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    border: 1px solid #eceff3;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #6c757d;
}

.wm-id-chip b {
    color: #212529;
    font-family: var(--bs-font-monospace, monospace);
    font-weight: 700;
}

.wm-profile-who {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 16px;
}

.wm-profile-ava {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffe6f0;
    color: #e6005a;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-profile-who-body { min-width: 0; }

.wm-profile-name {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wm-profile-meta {
    color: #6c757d;
    font-size: 13px;
}

.wm-profile-role {
    color: #e6005a;
    font-weight: 600;
}

/* ── Помощь ── */

.wm-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 767px) {
    .wm-faq-grid { grid-template-columns: 1fr; }
}

.wm-faq-q {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.wm-faq-a {
    color: #6c757d;
    font-size: 13px;
}

.wm-support {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #ffe6f0;
    border-radius: 12px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.wm-support-title {
    color: #b80049;
    font-weight: 700;
}

.wm-support-sub {
    color: #6c757d;
    font-size: 13px;
}
