/* RankWizard LK — поверх Bootstrap 5 */
:root {
    --lk-emerald: #10b981;
    --lk-emerald-dark: #059669;
    --lk-blue: #3b82f6;
    --lk-indigo: #6366f1;
}

.lk-brand {
    color: var(--lk-emerald-dark);
}

.lk-guest .lk-brand {
    color: var(--lk-emerald-dark);
}

.lk-topbar {
    background: linear-gradient(135deg, var(--lk-emerald-dark) 0%, var(--lk-blue) 55%, var(--lk-indigo) 100%);
    min-height: 56px;
}

.lk-topbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.lk-sidebar .nav-link {
    color: #334155;
}

.lk-sidebar .nav-link:hover {
    background: rgba(16, 185, 129, 0.08);
    color: var(--lk-emerald-dark);
}

.lk-sidebar .nav-link.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--lk-emerald-dark);
}

.lk-hero-gradient {
    background: linear-gradient(135deg, var(--lk-emerald-dark) 0%, var(--lk-blue) 50%, var(--lk-indigo) 100%);
}

.btn-primary {
    --bs-btn-bg: var(--lk-emerald);
    --bs-btn-border-color: var(--lk-emerald);
    --bs-btn-hover-bg: var(--lk-emerald-dark);
    --bs-btn-hover-border-color: var(--lk-emerald-dark);
}

/* Онбординг wizard */
.lk-wizard-badge {
    background: linear-gradient(135deg, var(--lk-emerald) 0%, var(--lk-blue) 100%);
}

.lk-wizard-card {
    border-radius: 1.25rem;
}

.lk-progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.lk-progress-bar__fill {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lk-emerald) 0%, var(--lk-blue) 50%, var(--lk-indigo) 100%);
    transition: width 0.35s ease;
}

.lk-step-dot {
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
}

.lk-step-dot--done {
    background: rgba(16, 185, 129, 0.2);
    color: var(--lk-emerald-dark);
}

.lk-step-dot--current {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
    background: var(--lk-blue);
    color: #fff;
}

.lk-radio-card {
    cursor: pointer;
}

.lk-radio-card .form-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lk-radio-card__body {
    display: block;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lk-radio-card:hover .lk-radio-card__body {
    border-color: rgba(16, 185, 129, 0.35);
}

.lk-radio-card .form-check-input:checked + .lk-radio-card__body {
    border-color: var(--lk-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.lk-radio-card .form-check-input:focus-visible + .lk-radio-card__body {
    outline: 2px solid var(--lk-blue);
    outline-offset: 2px;
}

.lk-warning-legal {
    border-radius: 1rem;
    border-left: 4px solid #f59e0b !important;
}

.lk-input-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
}

.lk-url-break {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* —— Dashboard (CRM / analytics) —— */
.lk-dashboard-shell {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

.lk-panel {
    border-radius: 1rem;
    overflow: hidden;
}

.lk-kpi-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lk-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1) !important;
}

.lk-kpi-card--balance {
    background: linear-gradient(135deg, #059669 0%, #3b82f6 55%, #6366f1 100%);
}

.lk-kpi-card--light .lk-kpi-card__label {
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}

.lk-kpi-card__value {
    line-height: 1.2;
}

.lk-balance-dl dt {
    font-weight: 500;
    font-size: 0.875rem;
}

.lk-balance-dl dd {
    margin-bottom: 0.65rem;
}

.lk-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom-width: 1px;
}

.lk-table tbody td {
    font-size: 0.9rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.lk-project-card {
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.lk-link-muted {
    color: #64748b;
}

.lk-link-muted:hover {
    color: var(--lk-blue);
}

.lk-alert-item {
    border-radius: 0.75rem;
}

.lk-fade-in {
    animation: lk-fade 0.35s ease;
}

@keyframes lk-fade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

/* Статусы проектов / счетов */
.lk-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lk-badge--muted {
    background: #e2e8f0;
    color: #475569;
}

.lk-badge--warning {
    background: #fef3c7;
    color: #b45309;
}

.lk-badge--info {
    background: #dbeafe;
    color: #1d4ed8;
}

.lk-badge--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.lk-badge--payment {
    background: #fecaca;
    color: #991b1b;
}

.lk-badge--paid {
    background: #cffafe;
    color: #0e7490;
}

.lk-badge--active {
    background: #d1fae5;
    color: #047857;
}

.lk-badge--paused {
    background: #fef08a;
    color: #854d0e;
}

.lk-badge--stopped {
    background: #e2e8f0;
    color: #1e293b;
}

/* Страница проекта (SEO analytics) */
.lk-project-page {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.lk-project-head {
    z-index: 1010;
    top: 56px;
}

@media (max-width: 991.98px) {
    .lk-project-head {
        position: relative !important;
        top: auto !important;
    }
}

.lk-kpi-seo {
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.lk-kpi-seo--t3 .fs-4 { color: #059669; }
.lk-kpi-seo--t10 .fs-4 { color: #3b82f6; }
.lk-kpi-seo--t50 .fs-4 { color: #6366f1; }
.lk-kpi-seo--avg .fs-4 { color: #0f172a; }
.lk-kpi-seo--ch .fs-4 { color: #d97706; }

.lk-tile-card {
    border-radius: 1rem;
}

.lk-tile-bar {
    min-height: 8px;
}

.lk-kw-table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.lk-chat-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.lk-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lk-emerald), var(--lk-blue));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lk-chat-card {
    border-radius: 1rem;
}

.lk-chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1080;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.lk-chat-fab__badge {
    position: absolute;
    top: -0.1rem;
    right: -0.1rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
}

.lk-chat-drawer {
    width: min(420px, calc(100vw - 1rem)) !important;
}

.lk-seo-ramp {
    border-radius: 1rem;
}

.lk-filter-card,
.lk-table-card {
    border-radius: 1rem;
}

.lk-pos-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 3.2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.6rem;
    font-weight: 700;
    line-height: 1;
}

.lk-pos-pill--up {
    background: #dcfce7;
    color: #166534;
}

.lk-pos-pill--down {
    background: #fee2e2;
    color: #b91c1c;
}

.lk-pos-pill--flat {
    background: #f3f4f6;
    color: #374151;
}

.lk-pos-pill--muted {
    background: #f8fafc;
    color: #94a3b8;
}

.lk-pos-pill__delta {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Backoffice (manager / admin) */
.lk-admin-page .lk-admin-kpi {
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.lk-admin-kpi--mod .fs-5 { color: #b45309; }
.lk-admin-kpi--pay .fs-5 { color: #991b1b; }
.lk-admin-kpi--bal .fs-5 { color: #047857; }
.lk-admin-kpi--api .fs-5 { color: #b91c1c; }

.lk-admin-mod-card {
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

/* AI Visibility / AEO (premium) */
.lk-nav-pro-badge {
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
    color: #fff !important;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
}

.lk-aeo-page {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.lk-aeo-badge {
    display: inline-block;
    letter-spacing: 0.12em;
    color: #7c3aed;
}

.lk-aeo-formula {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(79, 70, 229, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.lk-aeo-kpi {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.lk-aeo-kpi--score {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #4f46e5 100%);
}

.lk-aeo-kpi--cover .lk-aeo-kpi__value,
.lk-aeo-kpi--rank .lk-aeo-kpi__value {
    color: #1e1b4b;
}

.lk-aeo-kpi--meta .lk-aeo-kpi__value {
    color: #4338ca;
}

.lk-aeo-compare {
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.lk-aeo-compare--us {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

.lk-aeo-compare__num {
    color: #4f46e5;
}

.lk-aeo-compare--us .lk-aeo-compare__num {
    color: #7c3aed;
}

.lk-aeo-chart-card,
.lk-aeo-table-card {
    border-radius: 1.25rem;
}

.lk-aeo-engine {
    background: rgba(79, 70, 229, 0.12);
    color: #4338ca;
    font-weight: 600;
}
