﻿:root{
    --ob-primary: #2a67d8;
    --ob-hero: #dbe9f7;
    --ob-soft: #eef6ff;
    --ob-text: #1f2a37;
    --ob-text-strong: #111827;
    --ob-text-muted: rgba(31,42,55,.70);
    --ob-bg: #fff;
    --ob-surface: #fff;
    --ob-surface-translucent: rgba(255,255,255,.86);
    --ob-surface-raised: rgba(255,255,255,.92);
    --ob-surface-muted: #f8fafc;
    --ob-border: rgba(16,24,40,.10);
    --ob-border-subtle: rgba(16,24,40,.08);
    --ob-primary-soft: rgba(42,103,216,.08);
    --ob-primary-soft-strong: rgba(42,103,216,.12);
    --ob-shadow: rgba(15,23,42,.06);
    --ob-overlay: rgba(15,23,42,.22);
    --bs-body-bg: var(--ob-bg);
    --bs-body-color: var(--ob-text);
    --bs-emphasis-color: var(--ob-text-strong);
    --bs-secondary-color: var(--ob-text-muted);
    --bs-secondary-bg: var(--ob-surface-muted);
    --bs-tertiary-bg: var(--ob-soft);
    --bs-border-color: var(--ob-border);
    --bs-heading-color: var(--ob-text-strong);
    --bs-table-color: var(--ob-text);
    --bs-table-bg: var(--ob-surface);
}

/* База */
html, body { height: 100%; }
body{
    color: var(--ob-text);
    background: var(--ob-bg);
}

.page-main{
    padding: 0;
}

/* Фон приложения (в стиле лендинга) */
.app-bg{
    background: var(--ob-surface);
    min-height: 100vh;
}

/* Верхняя панель */
.app-topbar{
    background: var(--ob-surface-translucent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ob-border-subtle);
}

/* Лого-маркер */
.brand-mark{
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(42,103,216,.12);
    color: var(--ob-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Поиск */
.search-pill{
    background: var(--ob-surface-raised);
    border: 1px solid var(--ob-border);
    border-radius: 18px;
    box-shadow: 0 14px 36px var(--ob-shadow);
}

.search-input{
    background: transparent !important;
    border: 0 !important;
    color: var(--ob-text) !important;
    padding: 18px 18px 18px 52px !important;
    font-size: 20px;
}

.search-input::placeholder{
    color: rgba(31,42,55,.45);
}

.search-icon{
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(42,103,216,.55);
}

/* Карточки (бывш. card-dark — теперь светлая) */
.card-dark{
    background: var(--ob-surface-raised);
    border: 1px solid var(--ob-border);
    border-radius: 16px;
    box-shadow: 0 14px 36px var(--ob-shadow);
}

/* Сайдбар */
.sidebar{
    background: var(--ob-surface-translucent);
    border: 1px solid var(--ob-border);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15,23,42,.05);
}

.sidebar .nav-link{
    color: rgba(31,42,55,.75);
    border-radius: 12px;
    padding: 12px 14px;
}

.sidebar .nav-link:hover{
    background: rgba(42,103,216,.08);
    color: var(--ob-primary);
}

.sidebar .nav-link.active{
    background: rgba(42,103,216,.12);
    color: var(--ob-primary);
    font-weight: 600;
}

/* Бейджи/счётчики */
.badge-counter{
    background: rgba(42,103,216,.10);
    border: 1px solid rgba(42,103,216,.20);
    color: var(--ob-primary);
}

/* Индикатор */
.dot-green{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #29d17d;
    display: inline-block;
}

/* Плавный скролл + отступ под липкую шапку */
html{
    scroll-behavior: smooth;
    scroll-padding-top: 88px; /* под высоту header */
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Сделаем шапку липкой, чтобы было как на лендинге */
.app-topbar, .landing-header{
    position: sticky;
    top: 0;
    z-index: 1030;
}

.hero-img{
    max-width: 520px;
    filter: drop-shadow(0 18px 40px rgba(15,23,42,.10));
    border-radius: 18px;
}

.about-img{
    max-width: 420px;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15,23,42,.06);
}

.icon-circle--img{
    padding: 10px;
}
.icon-circle--img img{
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

/* ------------------------------
   Landing
--------------------------------*/

.landing-nav-link{
    color: var(--ob-primary);
    text-decoration: none;
    font-size: 14px;
}
.landing-nav-link:hover{
    color: rgba(31,42,55,.65);
}

.btn-auth{
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
    border: 1px solid rgba(42,103,216,.18);
    background: rgba(42,103,216,.10);
    color: var(--ob-primary);
}
.btn-auth:hover{
    background: rgba(42,103,216,.14);
    color: var(--ob-primary);
}

.landing-hero{
    background: var(--ob-hero);
    position: relative;
    overflow: hidden;
}
.landing-hero .container{
    padding-top: 72px;
    padding-bottom: 150px;
}
.landing-hero::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(219,233,247,0), #fff);
    pointer-events: none;
}

.hero-visual{
    display: flex;
    justify-content: center;
}

.hero-title{
    color: var(--ob-primary);
    font-weight: 700;
    font-size: 46px;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.hero-subtitle{
    color: rgba(31,42,55,.60);
    font-size: 14px;
    line-height: 1.65;
    max-width: 520px;
}

@media (max-width: 991.98px){
    .hero-title{ font-size: 34px; }
    .hero-visual{ justify-content: flex-start; }
}

.landing-section{ background: #fff; }

.section-kicker{
    color: var(--ob-primary);
    font-weight: 600;
    font-size: 14px;
}

.landing-carousel{
    position: relative;
}

.landing-card{
    background: #fff;
    border: 1px solid rgba(42,103,216,.16);
    border-radius: 18px;
    padding: 28px;
    max-width: 980px;
    margin: 0 auto;
    box-shadow: 0 20px 70px rgba(15,23,42,.06);
}

.landing-carousel-control{
    width: 44px;
    height: 44px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    opacity: 1;
    color: rgba(31,42,55,.45);
}
.landing-carousel-control:hover{
    color: rgba(31,42,55,.75);
}
.landing-carousel .carousel-control-prev{ left: -56px; }
.landing-carousel .carousel-control-next{ right: -56px; }
.landing-carousel-control i{ font-size: 24px; }

@media (max-width: 991.98px){
    .landing-carousel .carousel-control-prev{ left: 8px; }
    .landing-carousel .carousel-control-next{ right: 8px; }
}

/* Индикаторы каруселей — маленькие точки как на макете */
.carousel-indicators [data-bs-target]{
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(31,42,55,.25);
}
.carousel-indicators .active{
    background-color: rgba(31,42,55,.55);
}

.services-wrap{
    background: var(--ob-soft);
    border: 1px solid rgba(42,103,216,.12);
    box-shadow: 0 20px 60px rgba(15,23,42,.10);
}

.icon-circle{
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(42,103,216,.14);
    color: var(--ob-primary);
}
.icon-circle i{ font-size: 18px; }

.service-item .fw-semibold{ font-size: 13px; }
.service-item .fw-semibold::after{
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: rgba(42,103,216,.35);
}
.service-item .small{ line-height: 1.55; }

.landing-section--audience{
    background: var(--ob-soft);
}

.audience-title{
    color: var(--ob-primary);
    font-weight: 700;
    font-size: 34px;
    line-height: 1.15;
}

.audience-card{
    background: #fff;
    border: 1px solid rgba(42,103,216,.12);
    min-height: 128px;
    box-shadow: 0 24px 70px rgba(15,23,42,.08);
}

/* Плейсхолдеры как на слайде «О компании» */
.about-tiles{
    max-width: 420px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    padding: 16px;
    background: rgba(42,103,216,.04);
    border-radius: 16px;
}
.about-tiles .tile{
    background: rgba(42,103,216,.12);
    border-radius: 12px;
}
.about-tiles .tile-big{ grid-row: 1 / span 2; }

.ph-panels{
    max-width: 420px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    padding: 16px;
    background: rgba(42,103,216,.04);
    border-radius: 16px;
}
.ph{
    background: rgba(42,103,216,.10);
    border-radius: 12px;
}
.ph.big{ grid-row: 1 / span 2; }

.landing-footer{
    background: #1f5fcf;
}
.brand-mark--footer{
    background: rgba(255,255,255,.14);
    color: #fff;
}

/* ------------------------------
   Landing: Offcanvas авторизации
--------------------------------*/

/* Затемнение как в макете */
.offcanvas-backdrop.show{
    opacity: .58;
}

.auth-offcanvas{
    width: 420px;
    border-left: 1px solid rgba(16,24,40,.08);
}

.auth-offcanvas .offcanvas-body{
    padding: 28px 44px 48px;
}

.auth-offcanvas .offcanvas-header { padding: 40px 44px 0; border: 0; align-items: flex-start; }
.auth-offcanvas .auth-title { margin: 0; }

/* Страница входа вместо лендинга (Features:LoginAsHome) */
.login-home{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 32px 16px;
}
.login-home__card{
    width: 100%;
    max-width: 420px;
    padding: 32px 36px 36px;
    background: var(--ob-surface);
    border: 1px solid var(--ob-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--ob-shadow);
}
@media (max-width: 575.98px){
    .login-home__card{ padding: 24px 20px 28px; }
}
html[data-theme="dark"] .login-home__card{
    background: var(--ob-surface);
    border-color: var(--ob-border);
    color: var(--ob-text);
}
.auth-field label { display: block; margin-bottom: 6px; color: var(--ob-text); font-weight: 600; }

.auth-title{
    font-size: 26px;
    line-height: 1.2;
    font-weight: 500;
    margin: 0 0 28px 0;
    color: rgba(31,42,55,.95);
}

.auth-form{
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field{
    position: relative;
}

.auth-control{
    height: 52px;
    border-radius: 12px;
    border: 0;
    background: rgba(42,103,216,.18);
    padding-right: 42px;
    padding-left: 18px;
    font-weight: 500;
    color: rgba(31,42,55,.92);
    box-shadow: none !important;
}

.auth-control::placeholder{
    color: rgba(31,42,55,.70);
}

.auth-control:focus{
    background: rgba(42,103,216,.22);
}

.auth-control:focus-visible,
.search-history-card:focus-visible {
    outline: 3px solid rgba(42,103,216,.28);
    outline-offset: 2px;
}

.auth-clear{
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: rgba(31,42,55,.75);
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 1;
    transition: opacity .12s ease;
}

.auth-clear:hover{
    color: rgba(31,42,55,.95);
}

.auth-submit{
    align-self: flex-start;
    border-radius: 10px;
    padding: 10px 28px;
    font-weight: 600;
}

@media (max-width: 575.98px){
    .auth-offcanvas{ width: 100vw; }
    .auth-offcanvas .offcanvas-header{ padding: 30px 22px 0; }
    .auth-offcanvas .offcanvas-body{ padding: 24px 22px 36px; }
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* ===== Header: как на макете (flat, light-blue) ===== */

.app-topbar--flat{
    background: #d9ecff;              /* светло-голубой как на скрине */
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: none;
}

.topbar-flat{
    height: 72px;                      /* примерно как на скрине */
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 24px;
}

/* Бренд слева */
.brand-flat{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #0f172a;
    min-width: 210px;                  /* чтобы центр меню был “ровнее” */
}

.brand-flat .brand-logo{
    width: 38px;                       /* иконку сайта НЕ меняем, только размер */
    height: 38px;
    object-fit: contain;
}

.brand-flat .brand-icon{
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    color: var(--ob-primary, #2a67d8);
}

.brand-name{
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cabinet-page { max-width: 1040px; padding-top: 32px; padding-bottom: 48px; }
.cabinet-page > h1 { font-size:28px; font-weight:650; letter-spacing:-.02em; margin-bottom:20px; }
.cabinet-tabs { display:flex; gap:8px; border-bottom:1px solid var(--ob-border-subtle); margin-bottom:28px; }
.cabinet-tabs a { min-height:44px; padding:10px 14px; color:inherit; text-decoration:none; border-bottom:2px solid transparent; }
.cabinet-tabs a[aria-current="page"] { color:var(--ob-primary); border-color:var(--ob-primary); font-weight:600; }
.cabinet-section { margin:28px 0 36px; }
.cabinet-section h2 { font-size:20px; font-weight:650; margin-bottom:16px; }
.cabinet-details { display:grid; grid-template-columns:minmax(150px, 240px) minmax(0,1fr); gap:12px 20px; padding:20px; border-radius:12px; background:var(--ob-surface-muted); }
.cabinet-details dt { color:var(--ob-text-muted); font-weight:500; }
.cabinet-details dd { margin:0; overflow-wrap:anywhere; font-weight:550; }
.cabinet-filters { display:grid; grid-template-columns:2fr 1fr 1fr 1fr auto; gap:12px; align-items:end; margin:20px 0; }
.cabinet-filters label { display:grid; gap:6px; font-size:14px; }
.cabinet-filter-actions { display:flex; gap:8px; }
.cabinet-filter-actions > .btn { min-height:var(--ob-control-h); display:inline-flex; align-items:center; justify-content:center; }
.cabinet-query { min-width:200px; max-width:440px; overflow-wrap:anywhere; }
.cabinet-count { font-variant-numeric:tabular-nums; }
.cabinet-table { --bs-table-bg:transparent; --bs-table-border-color:var(--ob-border-subtle); }
.cabinet-table td { padding-top:12px; padding-bottom:12px; }
.cabinet-table tbody tr:hover > * { background-color:var(--ob-primary-soft); }
.cabinet-table th { color:var(--ob-text-muted); font-size:13px; font-weight:550; }
@media(max-width:767.98px) { .cabinet-filters { grid-template-columns:1fr 1fr; } .cabinet-filter-actions { grid-column:1/-1; } .cabinet-details { grid-template-columns:1fr; gap:4px; } .cabinet-details dd { margin-bottom:12px; } }
@media(max-width:480px) { .cabinet-filter-actions > .btn { flex:1 1 0; } }
@media(max-width:539.98px) { .brand-flat { min-width:0; gap:6px; } .brand-flat .brand-logo { width:32px; height:32px; } .brand-flat .brand-icon { width:32px; height:32px; font-size:26px; } .brand-name { font-size:17px; } }

/* Центр-меню */
.nav-flat{
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    gap: 72px;                         /* большие расстояния как на скрине */
    white-space: nowrap;
    overflow-x: auto;
}

.primary-nav { flex:1; min-width:0; display:flex; justify-content:center; align-items:center; gap:12px; white-space:nowrap; }
.primary-nav a { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:12px 22px; border:0; border-radius:12px; background:transparent; color:var(--ob-text); font-size:16px; font-weight:600; text-decoration:none; transition:background-color .16s ease-out,color .16s ease-out; }
.primary-nav a[aria-current="page"] { background:var(--ob-primary-soft-strong); color:var(--ob-primary); }
.primary-nav a:hover { background:var(--ob-primary-soft); color:var(--ob-primary); }
.primary-nav a:focus-visible { outline:none; box-shadow:0 0 0 3px rgba(42,103,216,.3); }

@media (max-width: 991.98px){
    .topbar-flat { height: auto; min-height: 72px; flex-wrap: wrap; padding: 8px 0 0; gap: 0 12px; }
    .nav-flat { order: 0; flex: 1 1 auto; min-width: 0; justify-content: flex-start; gap: 16px 24px; display: none; }
    .nav-flat a, .nav-flat .landing-nav-link { white-space: nowrap; font-size: 14px; }
    .primary-nav { order:3; flex:0 0 100%; justify-content:flex-start; gap:28px; overflow-x:auto; }
    .primary-nav { justify-content:flex-start; gap:8px; padding-bottom:8px; }
    .primary-nav a { min-height:48px; padding:12px 18px; font-size:16px; }
    .topbar-right { margin-left: auto; min-width: 0; flex-wrap: nowrap; }
}

/* Подстройка под твои ссылки (если у тебя landing-nav-link — отлично) */
.nav-flat a,
.nav-flat .landing-nav-link{
    color: rgba(15, 23, 42, .85);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    transition: opacity .12s ease;
}

.nav-flat a:hover,
.nav-flat .landing-nav-link:hover{
    opacity: .7;                       /* на макете hover очень мягкий */
}

@media (max-width: 991.98px){
    .nav-flat a,
    .nav-flat .landing-nav-link{
        font-size: 14px;
    }
}

/* Правый блок */
.topbar-right{
    min-width: 210px;                  /* симметрия с брендом */
    margin-left: auto;                 /* всегда у правого края, даже без основной навигации */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
}

/* Кнопка “Авторизация” как пилюля */
.btn-auth--flat{
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: #b9d9ff;               /* светло-синий как на скрине */
    color: #2563eb;                    /* синий текст */
    font-weight: 700;
    box-shadow: none;
}

.btn-auth--flat:hover{
    background: #a9d0ff;
    color: #1d4ed8;
}

/* На узких экранах уменьшим разнос пунктов */
@media (min-width: 992px) and (max-width: 1200px){
    .nav-flat{ gap: 42px; }
}


/* ------------------------------
   Report page tweaks
--------------------------------*/
.report-toc-btn{
    border-radius: 14px;
    padding: 12px 14px;
}

.report-toc{
    width: min(92vw, 420px);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(16,24,40,.10);
}

.report-toc .offcanvas-header{
    border-bottom: 1px solid rgba(16,24,40,.08);
}

.report-toc .offcanvas-title{
    color: rgba(31,42,55,.95);
    font-weight: 700;
}

/* Accordion in Report: make it light and readable */
.report-acc-btn{
    background: transparent !important;
    color: var(--ob-text) !important;
    border-radius: 14px !important;
    padding: 14px 16px;
    box-shadow: none !important;
}

.report-acc-btn:hover{
    background: rgba(42,103,216,.06) !important;
}

.accordion-button:not(.collapsed).report-acc-btn{
    background: rgba(42,103,216,.10) !important;
    color: var(--ob-primary) !important;
}

/* Accordion item container */
.accordion-item.card-dark{
    overflow: hidden;
}

/* Table inside Report accordions */
.report-table{
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(42,103,216,.04);
    --bs-table-hover-bg: rgba(42,103,216,.06);
    color: var(--ob-text);
    margin-bottom: 0;
}

.report-table td{
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: top;
}

.report-table-key{
    width: 35%;
    color: rgba(31,42,55,.70);
    font-weight: 600;
    word-break: break-word;
}

/* Make scrollspy active link clearer */
.sidebar .nav-link.active{
    box-shadow: 0 10px 24px rgba(42,103,216,.12);
}


/* =========================
   Report cards (no accordion)
   ========================= */
.report-card{
    overflow: hidden;
}
.report-card-header{
    padding: 14px 16px;
    border-bottom: 1px solid rgba(16,24,40,.10);
}
.report-card-title{
    font-weight: 700;
    color: var(--bs-body-color, var(--ob-text));
}
.report-card-body{
    padding: 16px;
}

.report-kv-list{
    display: flex;
    flex-direction: column;
    gap: 0;
}
.report-kv-row{
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(16,24,40,.10);
}
.report-kv-row:last-child{
    border-bottom: 0;
}
.report-kv-key{
    flex: 0 0 34%;
    min-width: 140px;
    font-weight: 600;
    color: var(--bs-secondary-color, rgba(31,42,55,.70));
    word-break: break-word;
}
.report-kv-val{
    flex: 1 1 auto;
    text-align: left;
    padding-left: 18px; /* приятный оффсет от ключа */
    color: var(--bs-body-color, var(--ob-text));
    word-break: break-word;
}

.report-link{
    color: var(--ob-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.report-link:hover{
    text-decoration-thickness: 2px;
}

/* Improve readability for all report text on any surface */
.report-page, .report-page *{
    text-shadow: none;
}
.report-page .text-secondary{
    color: var(--bs-secondary-color, rgba(31,42,55,.70)) !important;
}

/* Active link styling (desktop + mobile offcanvas) */
.report-nav .nav-link{
    color: var(--bs-body-color, var(--ob-text));
}
.report-nav .nav-link:hover{
    background: rgba(42,103,216,.10);
}
.report-nav .nav-link.active{
    background: rgba(42,103,216,.14);
    color: var(--ob-primary);
    font-weight: 700;
    border: 1px solid rgba(42,103,216,.25);
}
.report-nav .nav-link.active .badge-counter{
    background: rgba(42,103,216,.16);
    color: var(--ob-primary);
}

/* Mobile: make active item more obvious */
.offcanvas.report-toc .report-nav .nav-link.active{
    box-shadow: 0 10px 24px rgba(42,103,216,.12);
}
@media (max-width: 575.98px){
    .report-kv-row{
        flex-direction: column;
        align-items: flex-start;
    }
    .report-kv-key{
        flex-basis: auto;
        min-width: 0;
    }
    .report-kv-val{
        text-align: left;
        width: 100%;
        padding-left: 0;
    }
}



/* =========================
   Report / Topbar actions
   ========================= */
.topbar-right{
    min-width: auto;
    gap: 12px;
}

.topbar-actions{
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.btn-topbar-icon{
    width: var(--ob-control-h);
    height: var(--ob-control-h);
    flex: 0 0 var(--ob-control-h);
    border-radius: var(--ob-control-radius);
    border: 1px solid var(--ob-control-border);
    background: #fff;
    color: var(--ob-control-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-topbar-icon:hover{
    background: var(--ob-control-hover-bg);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

.{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    color: rgba(15,23,42,.86);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    line-height: 1;
}

.topbar-chip i{
    font-size: 16px;
    opacity: .8;
}

.topbar-chip__text{
    font-variant-numeric: tabular-nums;
}

.topbar-title{
    margin-left: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15,23,42,.04);
    color: rgba(15,23,42,.80);
    font-weight: 700;
    white-space: nowrap;
}

.topbar-auth{
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* На очень узких экранах чуть компактнее */
@media (max-width: 380px){
    .topbar-chip{ padding: 8px 10px; }
}



/* =========================
   Unified buttons & icons
   ========================= */
:root{
    --ob-control-radius: 12px;
    --ob-control-h: 44px;
    --ob-control-border: rgba(15,23,42,.12);
    --ob-control-text: rgba(15,23,42,.82);
    --ob-control-hover-bg: rgba(42,103,216,.06);
    --ob-control-hover-border: rgba(42,103,216,.22);
    --ob-control-hover-text: rgba(42,103,216,.95);
}

/* Base button polish (keeps Bootstrap semantics, unifies feel) */
.btn{
    border-radius: var(--ob-control-radius);
    font-weight: 600;
}

/* Icon-only buttons */
.btn-topbar-icon,
.btn-icon,
.offcanvas .btn-close{
    width: var(--ob-control-h);
    height: var(--ob-control-h);
    border-radius: var(--ob-control-radius);
    border: 1px solid var(--ob-control-border);
    background: #fff;
    color: var(--ob-control-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 6px 18px rgba(15,23,42,.05);
}

.btn-topbar-icon,
.btn-icon{
    flex: 0 0 var(--ob-control-h);
}

.btn-topbar-icon:hover,
.btn-icon:hover,
.offcanvas .btn-close:hover{
    background: var(--ob-control-hover-bg);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

/* Make Bootstrap's btn-close look like our icon button */
.offcanvas .btn-close{
    opacity: 1;
    background-image: none;
}
.offcanvas .btn-close::before{
    content: "\F62A"; /* bootstrap-icons 'x-lg' */
    font-family: "bootstrap-icons";
    font-size: 18px;
    line-height: 1;
}

/* Icons sizing/alignment */
.bi{
    line-height: 1;
    vertical-align: -0.125em;
}
.btn .bi,
.btn-topbar-icon .bi,
.btn-icon .bi{
    font-size: 18px;
}
.topbar-chip .bi{
    font-size: 16px;
}

/* Primary / secondary buttons – consistent height & hover */
.btn-primary{
    box-shadow: 0 10px 24px rgba(42,103,216,.12);
}
.btn-primary:hover{
    box-shadow: 0 12px 28px rgba(42,103,216,.16);
}
.btn-lg{
    border-radius: calc(var(--ob-control-radius) + 2px);
}

/* Auth button aligns with other controls */
.btn-auth--flat{
    height: var(--ob-control-h);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Chips mimic controls to match icon buttons */
.topbar-chip{
    min-height: var(--ob-control-h);
    border-radius: var(--ob-control-radius);
    border: 1px solid var(--ob-control-border);
    background: #fff;
    color: var(--ob-control-text);
    box-shadow: 0 6px 18px rgba(15,23,42,.05);
}
.topbar-chip:hover{
    background: var(--ob-control-hover-bg);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}
.topbar-chip__text{
    color: inherit;
}

/* Nav links: unified focus/active look in both sidebar and offcanvas */
.report-nav .nav-link,
.report-toc .nav-link{
    border-radius: var(--ob-control-radius);
}
.report-nav .nav-link.active,
.report-toc .nav-link.active{
    background: rgba(42,103,216,.12);
    color: var(--ob-primary);
    font-weight: 700;
}

/* Focus ring for all controls */
.btn:focus,
.btn-topbar-icon:focus,
.btn-icon:focus,
.topbar-chip:focus,
.nav-link:focus{
    box-shadow: 0 0 0 .22rem rgba(42,103,216,.16);
}


/* =========================
   Search input + button (merged)
   ========================= */
.search-pill { padding: 10px !important; }

.search-group{
    border-radius: 14px;
    overflow: hidden;
}

.search-group .search-input{
    border-radius: 14px 0 0 14px !important;
    padding-right: 14px !important; /* keep text away from edge */
}

.search-group .search-btn{
    border-radius: 0 14px 14px 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    height: 56px;            /* sync with input visual height */
    white-space: nowrap;
}

.search-group .search-btn i{
    font-size: 18px;
    line-height: 1;
}

/* Mobile: button becomes icon-only, still same height */
@media (max-width: 575.98px){
    .search-group .search-btn{ padding: 0 14px; }
}

/* Report: search row - single line, unified */
.report-search { width: 100%; }

.report-search__group{
    width: 100%;
    flex-wrap: nowrap;          /* не переносить */
    align-items: stretch;
}

.report-search__addon{
    background: #fff;
    border-color: rgba(0,0,0,.12);
    color: #3a4656;
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.report-search__input{
    min-width: 0;               /* критично для nowrap в flex */
    border-color: rgba(0,0,0,.12);
    color: #1f2a37;
}

.report-search__btn{
    white-space: nowrap;        /* не переносить текст кнопки */
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

/* на очень узких экранах оставляем кнопку компактной, но строка всё равно 1 ряд */
@media (max-width: 420px){
    .report-search__btn-text{ display:none; }
    .report-search__btn{ padding-left: .75rem; padding-right: .75rem; }
}

/* Report: search as info-card */
.report-search-card{
    background:#fff;
    border:1px solid rgba(0,0,0,.10);
    border-radius:16px;
    box-shadow:0 8px 22px rgba(17,24,39,.06);
    padding:12px 12px;
    width:100%;
}

.report-search-card__inner{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap;      /* строго 1 строка */
    width:100%;
}

.report-search-card__icon{
    flex:0 0 auto;
    width:40px;
    height:40px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    border:1px solid rgba(0,0,0,.10);
    background:#fff;
    color:#374151;
}

.report-search-card__input{
    flex:1 1 auto;
    min-width:0;           /* критично для nowrap */
    height:40px;
    border-radius:12px;
    border:1px solid rgba(0,0,0,.10);
    color:#111827;
}

.report-search-card__input::placeholder{ color:#6b7280; }

/* единый стиль кнопок/иконок (если уже есть report-btn — использует его, иначе добавит базу) */
.report-btn{
    height:40px;
    border-radius:12px;
    border:1px solid rgba(0,0,0,.10);
    background:#fff;
    color:#111827;
    display:inline-flex;
    align-items:center;
    gap:.45rem;
    padding:0 .9rem;
    white-space:nowrap;
}
.report-btn:hover{ background:rgba(17,24,39,.04); }
.report-btn:focus{ box-shadow:0 0 0 .2rem rgba(59,130,246,.15); }

.report-search-card__btn{
    flex:0 0 auto;
}

/* на очень узких — прячем текст, но строка не ломается */
@media (max-width: 420px){
    .report-search-card__btn.report-btn{ min-width: 68px; padding: 0 .65rem; }
    .report-btn{ padding:0 .75rem; }
}

/* =========================
   Search page (match Report card style)
   ========================= */

.search-page{
    background:#fff;
}

.search-page__content{
    max-width: 860px;
    margin: 0 auto;
    padding-top: 32px;
    padding-bottom: 32px;
}

.search-page__search{
    margin-bottom: 12px;
}

.search-page__hint{
    color:#6b7280;
    font-size: .95rem;
    padding-left: 4px;
}

.search-page__history{
    margin-top: 40px;
}

/* History item as a card/link */
.search-history-card{
    text-decoration:none;
    color:#111827;
    background:#fff;
    border:1px solid rgba(0,0,0,.10);
    border-radius:16px;
    box-shadow:0 8px 22px rgba(17,24,39,.06);
    padding: 12px 14px;

    display:flex;
    align-items:center;
    gap: 12px;
}

.search-history-card:hover{
    background: rgba(17,24,39,.02);
}

.search-history-card:focus{
    box-shadow: 0 0 0 .2rem rgba(59,130,246,.15), 0 8px 22px rgba(17,24,39,.06);
}

.search-history-card__icon{
    flex:0 0 auto;
    width:44px;
    height:44px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    border:1px solid rgba(0,0,0,.10);
    background:#fff;
    color:#374151;
    font-size: 1.15rem;
}

.search-history-card__body{
    flex: 1 1 auto;
    min-width: 0;
    display:flex;
    flex-direction:column;
}

.search-history-card__title{
    font-weight:600;
    font-size: 1.05rem;
    line-height: 1.25;
    color:#111827;
    overflow-wrap: anywhere;
}

.search-history-card__meta{
    color:#6b7280;
    font-size: .9rem;
}

.search-history-card__chev{
    flex:0 0 auto;
    color:#6b7280;
}

/* Responsive */
@media (max-width: 576px){
    .search-page__content{ padding-top: 20px; }
    .search-history-card{ padding: 11px 12px; }
    .search-history-card__icon{ width:40px; height:40px; }
}

.topbar-chip__label { color: inherit; }

.admin-page { max-width: 1440px; color: #1f2a37; }
.admin-form-errors a { color: inherit; text-decoration: underline; }
.admin-page .form-control.is-invalid { border-color: #b02a37; }
.admin-page .invalid-feedback { color: #b02a37; }
html[data-theme="dark"] .admin-form-errors { background: #3b2026; border-color: #a84b5a; color: #ffb4be; }
html[data-theme="dark"] .admin-page .invalid-feedback { color: #ffb4be; }
html[data-theme="dark"] .admin-page .form-control.is-invalid { border-color: #ffb4be; }
#adminConfirmModal .modal-header { border-bottom: 1px solid var(--ob-border-subtle); padding: 16px 20px; }
#adminConfirmModal .modal-body { padding: 20px; font-size: .9rem; overflow-wrap: anywhere; }
#adminConfirmModal .modal-footer { border-top: 1px solid var(--ob-border-subtle); padding: 14px 20px; gap: 8px; justify-content: flex-end; }
html[data-theme="dark"] #adminConfirmModal .modal-content { background: var(--ob-surface-raised); border-color: var(--ob-border); color: var(--ob-text); }
html[data-theme="dark"] #adminConfirmModal .btn-close { filter: invert(1) grayscale(1); }
.admin-page__hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-eyebrow { display: block; margin-bottom: 6px; color: var(--ob-primary); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-page__lead { color: rgba(31,42,55,.68); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-stat-card { padding: 18px 20px; border: 1px solid rgba(16,24,40,.08); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.05); }
.admin-stat-card__icon { display: block; width: 36px; height: 36px; margin-bottom: 14px; padding: 9px; border-radius: 11px; background: rgba(42,103,216,.10); color: var(--ob-primary); font-size: 18px; line-height: 18px; }
.admin-stat-card__icon--success { background: rgba(25,135,84,.11); color: var(--ob-success, #198754); }
.admin-stat-card__icon--danger { background: rgba(220,53,69,.11); color: var(--ob-danger, #dc3545); }
:root { --ob-success: #198754; --ob-danger: #dc3545; }
.admin-stat-card__label { display: block; color: rgba(31,42,55,.64); font-size: .82rem; }
.admin-stat-card__value { display: block; margin-top: 6px; color: #111827; font-size: 1.65rem; line-height: 1; }
.admin-card { overflow: hidden; border: 1px solid rgba(16,24,40,.08); background: #fff; box-shadow: 0 12px 32px rgba(15,23,42,.06); }
.admin-card-body { padding: 20px; }
.admin-card .form-control {
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid rgba(16,24,40,.15);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #1f2a37;
}
.admin-card .form-control:focus {
    border-color: var(--ob-primary, #2a67d8);
    box-shadow: 0 0 0 3px rgba(42,103,216,.15);
    outline: none;
}
.admin-card .form-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background-color: #fff;
    border: 1px solid rgba(16,24,40,.15);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #1f2a37;
}
.admin-card .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
}
.admin-card .card-header { background: #fff; border-bottom-color: rgba(16,24,40,.08); }
.admin-card__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-card__header > div:first-child { display: grid; gap: 4px; }
.admin-card__header strong { color: #111827; font-size: 1rem; }
.admin-card__header strong .bi { margin-right: 5px; color: var(--ob-primary); }
.admin-card__header span { color: rgba(31,42,55,.62); font-size: .82rem; font-weight: 400; }
.admin-list-tools { display: flex; flex: 0 1 440px; gap: 8px; }
.admin-list-tools .form-control { min-width: 180px; }
.admin-list-tools .form-select { max-width: 190px; }
.admin-search-field { position: relative; flex: 1 1 auto; min-width: 180px; }
.admin-search-field .bi { position: absolute; z-index: 1; top: 50%; left: 12px; color: rgba(31,42,55,.5); transform: translateY(-50%); }
.admin-search-field .form-control { width: 100%; padding-left: 34px; }
.admin-optional { color: rgba(31,42,55,.52); font-size: .78rem; font-weight: 400; }
.admin-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.admin-badge--neutral { background: rgba(31,42,55,.08); color: #344054; }
.admin-badge--success { background: rgba(25,135,84,.12); color: #146c43; }
.admin-badge--danger { background: rgba(220,53,69,.12); color: #b02a37; }
.admin-user-avatar { display: inline-grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(135deg, rgba(42,103,216,.18), rgba(42,103,216,.06)); color: var(--ob-primary); font-size: .95rem; font-weight: 800; text-transform: uppercase; }
.admin-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(16,24,40,.07); }
.admin-actions summary { width: fit-content; padding: 8px 12px; border: 1px solid rgba(42,103,216,.22); border-radius: 9px; color: var(--ob-primary); cursor: pointer; font-size: .82rem; font-weight: 700; list-style: none; }
.admin-actions summary::-webkit-details-marker { display: none; }
.admin-actions summary .bi { margin-right: 5px; }
.admin-actions summary::after { content: '＋'; margin-left: 6px; }
.admin-actions[open] summary::after { content: '−'; }
.admin-actions__body { display: grid; gap: 10px; padding-top: 12px; }
.admin-actions__body form { align-items: center; }
.admin-back-link { display: inline-flex; align-items: center; gap: 8px; }
.admin-card .form-control, .admin-card .btn { min-height: 44px; }

@media (max-width: 680px) {
    .admin-page__hero, .admin-card__header { align-items: stretch; flex-direction: column; }
    .admin-page__hero { gap: 16px; }
    .admin-page__hero .btn { align-self: flex-start; }
    .admin-stat-grid { grid-template-columns: 1fr; }
    .admin-list-tools { flex: 1 1 auto; max-width: none; }
    .admin-search-field { min-width: 0; }
    .admin-list-tools .form-control, .admin-list-tools .form-select { max-width: none; min-width: 0; flex: 1 1 0; }
}

@media (max-width: 420px) {
    .admin-list-tools { flex-direction: column; }
    .admin-list-tools .form-control, .admin-list-tools .form-select { width: 100%; }
}

/* ===============================
   Header: unified buttons + brand color
   Add to the END of site.css
================================= */

/* Brand name color */
.brand-flat .brand-name{
    color: var(--ob-primary, #2a67d8);
}

/* Make all actions on the right look identical (TopRight + Auth) */
.topbar-right{
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.topbar-actions{
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

/* Unified button style for ANY button/link placed in header right area */
.topbar-right .header-btn,
.topbar-right .topbar-actions .btn,
.topbar-right .topbar-actions a,
.topbar-right .topbar-actions button{
    width: var(--ob-control-h);
    height: var(--ob-control-h);
    flex: 0 0 var(--ob-control-h);
    border-radius: var(--ob-control-radius);
    border: 1px solid var(--ob-control-border);
    background: #ffffff;
    color: var(--ob-control-text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
    white-space: nowrap;
}

.topbar-auth .header-btn--label {
    width: auto;
    flex-basis: auto;
    gap: 8px;
    padding: 0 14px;
}

.topbar-right .header-btn:hover,
.topbar-right .topbar-actions .btn:hover,
.topbar-right .topbar-actions a:hover,
.topbar-right .topbar-actions button:hover{
    background: var(--ob-control-hover-bg);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

.topbar-right .header-btn:focus,
.topbar-right .topbar-actions .btn:focus,
.topbar-right .topbar-actions a:focus,
.topbar-right .topbar-actions button:focus{
    outline: none;
    box-shadow: 0 0 0 .2rem rgba(59,130,246,.18), 0 8px 20px rgba(15,23,42,.06);
}

/* Icon-only actions in header (square) */
.topbar-right .topbar-actions .btn.btn-icon,
.topbar-right .topbar-actions a.btn-icon,
.topbar-right .topbar-actions button.btn-icon{
    width: var(--ob-control-h);
    padding: 0;
}

/* Bootstrap Icons in header: same size/align */
.topbar-right .bi{
    font-size: 1.05rem;
    line-height: 1;
}

/* Ensure old auth pill doesn't override new unified style */
.btn-auth--flat{
    background: #fff;
    color: #111827;
    border: 1px solid rgba(15,23,42,.12);
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

/* Keep header compact on small screens */
@media (max-width: 575.98px){
    .topbar-flat{ gap: 8px; }
    .brand-flat{ min-width: 0; flex: 0 1 auto; gap: 6px; }
    .brand-name{ display: none; }
    .topbar-right{ min-width: 0; gap: 6px; }
    .topbar-actions{ gap: 6px; }
    .search-topbar-chip__label{ display: none; }
    .topbar-auth .header-btn--label { width: auto; flex-basis: auto; }
}

.skip-link {
    position: fixed;
    z-index: 2000;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: 8px;
    background: #fff;
    color: #1f2a37;
    box-shadow: 0 2px 12px rgba(15,23,42,.2);
}
.skip-link:focus { transform: translateY(0); }
.page-main:focus { outline: none; }

html[data-theme="dark"] .skip-link {
    background: var(--ob-surface-raised);
    color: var(--ob-text-strong);
}

/* =========================
   Header: unify chip with buttons + fix layout
   ========================= */

.topbar-right .topbar-actions .topbar-chip{
    width: auto;
    height: var(--ob-control-h);
    flex: 0 0 auto;
    border-radius: var(--ob-control-radius);
    border: 1px solid var(--ob-control-border);
    background: #ffffff;
    color: var(--ob-control-text);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0 .9rem;
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
    white-space: nowrap;
    line-height: 1;
}

.topbar-right .topbar-actions .topbar-chip:hover{
    background: var(--ob-control-hover-bg);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

.topbar-right .topbar-actions .topbar-chip i{
    font-size: 1.05rem;
    line-height: 1;
    opacity: .9;
}

.topbar-right .topbar-actions .topbar-chip__text{
    font-variant-numeric: tabular-nums;
}

/* Index: services list inside cards (same visual tone as landing cards) */
.service-item--card{
    height: 100%;
}

.service-list{
    list-style: none;
    padding-left: 0;
    margin: .5rem 0 0;
    text-align: left;
}

.service-list li{
    position: relative;
    padding-left: 1.1rem;
    margin-top: .4rem;
    font-size: .875rem;
    color: rgba(17,24,39,.72);
    line-height: 1.35;
}

.service-list li::before{
    content: "";
    position: absolute;
    left: .15rem;
    top: .55rem;
    width: .35rem;
    height: .35rem;
    border-radius: 999px;
    background: rgba(59,130,246,.7);
}

/* Audience carousel cards: keep text readable */
.audience-card .text-muted{ color: rgba(17,24,39,.72) !important; }

/* Uniform card heights */
.index-cards-row { align-items: stretch; }

.index-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.index-card__body { flex: 1 1 auto; }

.index-card__footer { margin-top: auto; }

.section-title { margin-bottom: 12px; }
.section-carousel { margin: 10px 0 22px; }
.section-content { margin-top: 0; }

.index-section { padding: 56px 0; }
@media (max-width: 768px){ .index-section { padding: 32px 0; } }

.index-section__head { margin-bottom: 18px; }
.index-section__grid { row-gap: 18px; }

.index-text {
    max-width: 760px;
    color: #334155;   /* читабельный текст */
}

/* Index: tweaks for new layout variant */

/* About: slight variation of tiles for the second card */
.about-tiles--alt .tile-big{ opacity:.92; transform: translateY(2px); }
.about-tiles--alt .tile-top{ opacity:.78; }
.about-tiles--alt .tile-bottom{ opacity:.78; }

/* Services: icon container */
.service-icon{
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.10);
    background: #fff;
    color: rgba(17,24,39,.78);
    margin-bottom: .75rem;
}
.service-icon i{ font-size: 1.15rem; }

/* Tasks: formatted list */
.task-list{ text-align: left; }
.task-li{
    padding: 12px 0;
    border-top: 1px solid rgba(0,0,0,.08);
}
.task-li:first-child{ border-top: 0; padding-top: 0; }
.task-li__title{
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}
.task-li__desc{
    color: rgba(17,24,39,.72);
    line-height: 1.35;
    font-size: .95rem;
}

.landing-footer__docs .landing-footer__link{
    display:inline-flex;
    align-items:center;
    gap:.5rem;
    padding:.55rem .8rem;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.16);
    background:rgba(255,255,255,.06);
    color:#fff;
    text-decoration:none;
    font-size:.95rem;
    line-height:1;
}

/* Task list: icon + text in one row */
.task-list { margin: 0; padding: 0; }

.task-li{
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
}

.task-li + .task-li{
    border-top: 1px solid rgba(0,0,0,.08);
}

.task-li__icon{
    flex: 0 0 40px;          /* фикс ширина под иконку */
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.10);
    background: #fff;
    color: #374151;
}

.task-li__icon i{
    font-size: 1.1rem;
    line-height: 1;
}

.task-li__content{
    flex: 1 1 auto;
    min-width: 0;            /* важно для корректного сжатия */
}

.task-li__title{
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.task-li__desc{
    color: #475569;
    margin-top: 4px;
    margin-bottom: 0;
}

/* На очень узких экранах всё равно остаётся в одну строку */
@media (max-width: 420px){
    .task-li{ gap: 10px; }
    .task-li__icon{ flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; }
}

/* Index: extended hero gradient, readable text */
.index-hero{
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg,
    rgba(214, 232, 252, 1) 0%,
    rgba(225, 238, 253, 0.92) 32%,
    rgba(238, 247, 255, 0.55) 62%,
    rgba(255, 255, 255, 1) 100%);
    padding-bottom: 56px; /* запас, чтобы белый начинался до основного текста */
}

/* Если где-то выше был общий фон/градиент на body или wrapper — убираем только для Index */
body.index-page,
.index-page .app-bg{
    background: #fff !important;
}

/* На больших экранах hero обычно выше — чуть растягиваем градиент */
@media (min-width: 992px){
    .index-hero{
        padding-bottom: 84px;
    }
}

/* Index: extended gradient backdrop without harming readability */
.index-page{
    position: relative;
    background:#fff;
}

/* Gradient "sheet" behind the top of the page (hero + a bit more), fades to white */
.index-page::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    right:0;
    height: 720px;
    background: linear-gradient(180deg,
    rgba(214,232,252,1) 0%,
    rgba(225,238,253,.92) 36%,
    rgba(238,247,255,.55) 70%,
    rgba(255,255,255,1) 100%);
    z-index:0;
    pointer-events:none;
}

/* Ensure content sits above the gradient */
.index-page > *{
    position: relative;
    z-index:1;
}

/* Give the hero enough space so the fade reaches white before long text begins */
.index-page .landing-hero{
    background: transparent;
    padding-bottom: 72px;
}

@media (min-width: 992px){
    .index-page::before{ height: 820px; }
    .index-page .landing-hero{ padding-bottom: 96px; }
}

.about-illustration{
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* mobile: кнопка "Авторизация" прижата к правому краю */
@media (max-width: 1000px){
    .topbar-right{
        margin-left: auto;
        justify-content: flex-end;
    }

    .topbar-auth{
        margin-left: auto;
    }
}

/* Footer: documents buttons */
.docs-links{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.docs-link{
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    width: 100%;
    max-width: 320px;
    justify-content: flex-start;
    padding: 0 16px;
    text-align: left;
}

.docs-link .bi{
    flex: 0 0 auto;
    font-size: 1rem;
}

.docs-link span{
    min-width: 0;
}

@media (max-width: 1000px){
    .docs-link{
        max-width: none;
        width: 100%;
    }
}

/* Support widget + modal */
.support-widget{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    background: var(--ob-primary);
    color: #fff;
    box-shadow: 0 12px 30px rgba(15,23,42,.18);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    width: auto;
}

.support-widgets{
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.support-widget i{
    font-size: 1.1rem;

}
.support-widget__label{
    font-weight: 700;
    letter-spacing: .02em;
}
.support-widget:hover{
    background: rgba(255,255,255,.98);
    border-color: rgba(42,103,216,.28);
    color: #1d4ed8;
}
.modal-dialog-bottom-left{
    position: fixed;
    left: 16px;
    bottom: 88px;
    margin: 0;
    width: min(420px, calc(100vw - 32px));
}
.support-modal{
    border: 1px solid rgba(16,24,40,.08);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15,23,42,.18);
}
.support-modal__header{
    border-bottom: 1px solid rgba(16,24,40,.08);
}
.support-modal__line + .support-modal__line{
    margin-top: 10px;
}
.support-modal a,
.footer-support__link{
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.support-modal a{
    color: var(--ob-primary);
}
.footer-support{
    padding-top: 4px;
}
@media (max-width: 575.98px) {
    .support-widgets {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .support-widget {
        width: 100%;
        justify-content: center;
    }
}

/* =========================
   Report: export to PDF / print
   ========================= */
@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    html,
    body {
        height: auto !important;
        background: #fff !important;
    }

    body {
        color: #111827 !important;
    }

    .app-topbar,
    .landing-header,
    .sidebar,
    .report-search-card,
    .report-toc,
    .offcanvas-backdrop,
    .support-widgets,
    [data-no-print] {
        display: none !important;
    }

    .page-main,
    .app-bg,
    .report-page {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    .report-page > .col-12,
    .report-page > [class*="col-lg-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .card-dark,
    .report-card {
        background: #fff !important;
        box-shadow: none !important;
        border: 1px solid #dbe3ee !important;
    }

    .report-page section,
    .report-page article,
    .report-card,
    .report-kv-row {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-page .text-secondary {
        color: #6b7280 !important;
    }

    .badge-counter {
        color: #1f2a37 !important;
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
    }

    .report-link,
    .report-link:visited {
        color: #111827 !important;
        text-decoration: none !important;
    }

    .report-link[href]::after {
        content: " (" attr(href) ")";
        font-size: 11px;
        color: #64748b;
        word-break: break-all;
    }
}

/* =========================
   Report PDF mode
   ========================= */

@page{
    size: A4;
    margin: 12mm 10mm 14mm;
}

.report-page--pdf{
    margin-top: 0 !important;
}

.report-page--pdf section,
.report-page--pdf article,
.report-page--pdf .report-kv-row{
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.report-page--pdf .report-records{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-page--pdf .report-card,
.report-page--pdf .card-dark{
    box-shadow: 0 14px 36px rgba(15,23,42,.06);
}

.report-page--pdf .report-kv-key{
    flex: 0 0 30%;
    min-width: 180px;
}

.report-page--pdf .report-kv-val{
    flex: 1 1 auto;
}

.report-page--pdf .badge-counter{
    white-space: normal;
    word-break: break-word;
}

/* =========================
   Report PDF export loading
   ========================= */

.report-export-overlay{
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.report-export-overlay.is-visible{
    opacity: 1;
    pointer-events: auto;
}

.report-export-overlay__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .22);
    backdrop-filter: blur(6px);
}

.report-export-overlay__dialog{
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    padding: 28px 24px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(15,23,42,.18);
}

.report-export-overlay__title{
    margin-top: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.report-export-overlay__text{
    margin-top: 8px;
    font-size: .96rem;
    line-height: 1.5;
}

.report-export-spinner{
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(42,103,216,.08);
    border: 1px solid rgba(42,103,216,.14);
}

.report-export-spinner span{
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(42,103,216,.18);
    border-top-color: var(--ob-primary);
    animation: report-export-spin .85s linear infinite;
}

@keyframes report-export-spin{
    to { transform: rotate(360deg); }
}

#reportExportPdfBtn.is-loading{
    opacity: .9;
    cursor: wait;
}

#reportExportPdfBtn.is-loading .report-export-btn__content{
    opacity: .82;
}

body.report-exporting{
    overflow: hidden;
}

/* =========================
   Footer: lawful use notice
   ========================= */
.footer-legal{
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    background: rgba(255,255,255,.06);
}

.footer-legal .brand-mark{
    margin-top: 2px;
}

.footer-legal .text-white-50{
    line-height: 1.55;
}

@media (max-width: 575.98px){
    .footer-legal{
        gap: 12px;
        padding: 14px;
    }
}

/* =========================
   Footer: unified information cards
   ========================= */
.footer-column-heading{
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-column-heading--compact{
    min-height: 48px;
}

.footer-card-list{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-card{
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    background: rgba(255,255,255,.07);
    color: #fff;
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.footer-card__icon{
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    color: #fff;
}

.footer-card__icon .bi{
    font-size: 1.05rem;
}

.footer-card__body{
    flex: 1 1 auto;
    min-width: 0;
}

.footer-card__title{
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
}

.footer-card__text{
    display: block;
    color: rgba(255,255,255,.72);
    font-size: .875rem;
    line-height: 1.55;
}

.footer-card__link,
.footer-card__link:visited{
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,.65);
    text-underline-offset: 3px;
}

.footer-card__link:hover{
    color: #fff;
    text-decoration-color: #fff;
}

.footer-card--link{
    position: relative;
    align-items: center;
    padding-right: 46px;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.footer-card--link:hover{
    transform: translateY(-2px);
    border-color: rgba(255,255,255,.30);
    background: rgba(255,255,255,.12);
    color: #fff;
    box-shadow: 0 16px 34px rgba(15,23,42,.14);
}

.footer-card--link:focus-visible{
    outline: none;
    box-shadow: 0 0 0 .22rem rgba(255,255,255,.22), 0 16px 34px rgba(15,23,42,.14);
}

.footer-card__arrow{
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.72);
    transition: transform .18s ease, color .18s ease;
}

.footer-card--link:hover .footer-card__arrow{
    color: #fff;
    transform: translate(2px, calc(-50% - 2px));
}

@media (max-width: 575.98px){
    .footer-card{
        gap: 12px;
        padding: 14px;
    }

    .footer-card__icon{
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
}



/* =========================
   Report: people + contacts cards
   ========================= */
.report-person-contact-list{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-person-contact-card{
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
}

.report-person-contact-card__header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(16,24,40,.10);
}

.report-person-contact-card__identity{
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.report-person-contact-card__icon{
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(42,103,216,.16);
    border-radius: 12px;
    background: rgba(42,103,216,.08);
    color: var(--ob-primary);
}

.report-person-contact-card__name{
    display: inline-block;
    max-width: 100%;
    color: var(--ob-text);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.report-person-contact-card__count{
    flex: 0 0 auto;
    white-space: nowrap;
}

.report-person-contact-card__body{
    padding: 18px 20px 20px;
}

.report-person-contact-card__contacts{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-person-contact-card__contact{
    padding: 14px 16px;
    border: 1px solid rgba(16,24,40,.10);
    border-radius: 14px;
    background: rgba(42,103,216,.025);
    break-inside: avoid;
    page-break-inside: avoid;
}

.report-person-contact-card__contact-head{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.report-person-contact-card__contact-type{
    margin-bottom: 3px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.report-person-contact-card__contact-value{
    font-size: 1rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.report-person-contact-card__meta-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(16,24,40,.08);
}

.report-person-contact-card__meta-block--wide{
    grid-column: 1 / -1;
}

.report-person-contact-card__section-title{
    margin-bottom: 6px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.report-person-contact-card__items{
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
}

.report-person-contact-card__items li{
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px){
    .report-person-contact-card__header,
    .report-person-contact-card__contact-head{
        flex-direction: column;
    }

    .report-person-contact-card__count{
        margin-left: 54px;
    }

    .report-person-contact-card__meta-grid{
        grid-template-columns: 1fr;
    }

    .report-person-contact-card__meta-block--wide{
        grid-column: auto;
    }
}

@media print{
    .report-person-contact-card__contact{
        background: #fff !important;
    }
}

/* Common data for people with the same name and different birth dates */
.report-person-contact-card--common{
    border-color: rgba(42,103,216,.22);
}

.report-person-contact-card--common .report-person-contact-card__header{
    background: rgba(42,103,216,.035);
}

.report-person-contact-card--common .report-person-contact-card__icon{
    background: rgba(42,103,216,.12);
}

.report-person-contact-card__badges{
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.report-person-contact-card__common-badge{
    color: #7c4a03;
    background: #fff7df;
    border: 1px solid rgba(180,115,12,.24);
    white-space: normal;
    text-align: left;
}

.report-person-contact-card__common-info{
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(42,103,216,.16);
    border-radius: 14px;
    background: var(--ob-primary-soft);
}

.report-person-contact-card__common-title{
    color: var(--ob-text);
    font-weight: 700;
    line-height: 1.4;
}

.report-person-contact-card__common-text{
    margin-top: 4px;
    line-height: 1.5;
}

.report-person-contact-card__related-persons{
    display: grid;
    gap: 5px;
    margin: 10px 0 0;
    padding-left: 20px;
}

.report-person-contact-card__related-persons li{
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px){
    .report-person-contact-card__badges{
        width: 100%;
        justify-content: flex-start;
        padding-left: 54px;
    }

    .report-person-contact-card__count{
        margin-left: 0;
    }
}

@media print{
    .report-person-contact-card__common-info{
        background: #fff !important;
        border-color: #cbd5e1 !important;
    }

    .report-person-contact-card__common-badge{
        color: #334155 !important;
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
    }
}

.report-export-overlay__close{
    margin-top: 18px;
    min-width: 120px;
}

.report-export-spinner[hidden],
.report-export-overlay__close[hidden]{
    display: none !important;
}

/* =========================
   Error page
   ========================= */
.error-page{
    min-height: calc(100vh - 74px);
    display: flex;
    align-items: center;
    padding: 48px 0;
    background:
        radial-gradient(circle at 50% 15%, rgba(42,103,216,.08), transparent 34%),
        #fff;
}

.error-page__content{
    width: min(100%, 680px);
    margin: 0 auto;
}

.error-card{
    padding: 40px 36px;
    text-align: center;
}

.error-card__icon{
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(42,103,216,.10);
    border: 1px solid rgba(42,103,216,.16);
    color: var(--ob-primary);
    font-size: 30px;
}

.error-card__title{
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 700;
    color: #111827;
}

.error-card__text{
    max-width: 520px;
    margin: 14px auto 0;
    line-height: 1.65;
}

.error-card__actions{
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.error-card__actions .btn{
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-card__request-id{
    margin-top: 28px;
    color: rgba(31,42,55,.55);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.error-card__request-id code{
    color: inherit;
}

@media (max-width: 575.98px){
    .error-page{
        padding: 24px 0;
    }

    .error-card{
        padding: 30px 20px;
    }

    .error-card__actions{
        flex-direction: column;
    }

    .error-card__actions .btn{
        width: 100%;
    }
}

html[data-theme="dark"]{
    color-scheme: dark;
    --ob-primary: #93c5fd;
    --ob-hero: #132a46;
    --ob-soft: #172b44;
    --ob-text: #e2e8f0;
    --ob-text-strong: #f8fafc;
    --ob-text-muted: rgba(226,232,240,.68);
    --ob-bg: #0b1220;
    --ob-surface: #101a2b;
    --ob-surface-translucent: rgba(16,26,43,.90);
    --ob-surface-raised: rgba(30,41,59,.96);
    --ob-surface-muted: #172033;
    --ob-border: rgba(226,232,240,.20);
    --ob-border-subtle: rgba(226,232,240,.16);
    --ob-primary-soft: rgba(96,165,250,.12);
    --ob-primary-soft-strong: rgba(96,165,250,.20);
    --ob-shadow: rgba(0,0,0,.36);
    --ob-overlay: rgba(2,6,23,.72);
    --bs-body-bg: var(--ob-bg);
    --bs-body-color: var(--ob-text);
    --bs-emphasis-color: var(--ob-text-strong);
    --bs-secondary-color: var(--ob-text-muted);
    --bs-secondary-bg: var(--ob-surface-muted);
    --bs-tertiary-bg: var(--ob-soft);
    --bs-border-color: var(--ob-border);
    --bs-heading-color: var(--ob-text-strong);
    --bs-table-color: var(--ob-text);
    --bs-table-bg: var(--ob-surface);
    --bs-table-striped-bg: var(--ob-surface-muted);
    --bs-table-hover-bg: var(--ob-primary-soft);
    --ob-control-border: var(--ob-border);
    --ob-control-text: rgba(241,245,249,.88);
    --ob-control-hover-bg: var(--ob-primary-soft);
    --ob-control-hover-border: rgba(147,197,253,.42);
    --ob-control-hover-text: #bfdbfe;
    --ob-success: #34d399;
    --ob-danger: #f87171;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-bg,
html[data-theme="dark"] .index-page,
html[data-theme="dark"] body.index-page,
html[data-theme="dark"] .index-page .app-bg{
    color: var(--ob-text);
    background: var(--ob-bg) !important;
}

html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .app-topbar--flat,
html[data-theme="dark"] .landing-section,
html[data-theme="dark"] .landing-card,
html[data-theme="dark"] .audience-card,
html[data-theme="dark"] .search-page,
html[data-theme="dark"] .search-history-card,
html[data-theme="dark"] .admin-stat-card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .admin-card .card-header,
html[data-theme="dark"] .btn-topbar-icon,
html[data-theme="dark"] .topbar-chip,
html[data-theme="dark"] .topbar-right .header-btn,
html[data-theme="dark"] .topbar-right .topbar-actions .btn,
html[data-theme="dark"] .topbar-right .topbar-actions a,
html[data-theme="dark"] .topbar-right .topbar-actions button,
html[data-theme="dark"] .btn-auth--flat,
html[data-theme="dark"] .icon-circle,
html[data-theme="dark"] .service-icon,
html[data-theme="dark"] .task-li__icon,
html[data-theme="dark"] .search-history-card__icon{
    background: var(--ob-surface-raised);
    border-color: var(--ob-border);
    color: var(--ob-text);
}

html[data-theme="dark"] .landing-hero,
html[data-theme="dark"] .index-hero{
    background: var(--ob-hero);
}

html[data-theme="dark"] .landing-hero::after,
html[data-theme="dark"] .index-page::before{
    background: linear-gradient(to bottom, rgba(19,42,70,0), var(--ob-bg));
}

html[data-theme="dark"] .index-page::before{
    background: linear-gradient(180deg, #132a46 0%, #172b44 38%, rgba(16,26,43,.72) 70%, var(--ob-bg) 100%);
}

html[data-theme="dark"] .brand-flat,
html[data-theme="dark"] .nav-flat a,
html[data-theme="dark"] .nav-flat .landing-nav-link,
html[data-theme="dark"] .primary-nav a,
html[data-theme="dark"] .admin-page,
html[data-theme="dark"] .admin-stat-card__value,
html[data-theme="dark"] .admin-card__header strong,
html[data-theme="dark"] .index-text,
html[data-theme="dark"] .task-li__title,
html[data-theme="dark"] .search-history-card,
html[data-theme="dark"] .search-history-card__title,
html[data-theme="dark"] .error-card__title{
    color: var(--ob-text-strong);
}

html[data-theme="dark"] .primary-nav a:focus-visible { box-shadow:0 0 0 3px rgba(147,197,253,.35); }

html[data-theme="dark"] .landing-nav-link:hover,
html[data-theme="dark"] .hero-subtitle,
html[data-theme="dark"] .landing-carousel-control,
html[data-theme="dark"] .admin-page__lead,
html[data-theme="dark"] .admin-card__header span,
html[data-theme="dark"] .admin-stat-card__label,
html[data-theme="dark"] .search-page__hint,
html[data-theme="dark"] .search-history-card__meta,
html[data-theme="dark"] .search-history-card__chev,
html[data-theme="dark"] .error-card__request-id,
html[data-theme="dark"] .task-li__desc,
html[data-theme="dark"] .service-list li{
    color: var(--ob-text-muted);
}

html[data-theme="dark"] .auth-offcanvas,
html[data-theme="dark"] .support-modal,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .dropdown-menu{
    background: var(--ob-surface);
    border-color: var(--ob-border);
    color: var(--ob-text);
}

html[data-theme="dark"] .auth-title{
    color: var(--ob-text-strong);
}

html[data-theme="dark"] .auth-control{
    background: var(--ob-primary-soft-strong);
    color: var(--ob-text) !important;
}

html[data-theme="dark"] .auth-control::placeholder,
html[data-theme="dark"] .search-input::placeholder{
    color: var(--ob-text-muted);
}

html[data-theme="dark"] .auth-clear,
html[data-theme="dark"] .auth-clear:hover{
    color: var(--ob-text);
}

html[data-theme="dark"] .admin-stat-card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .support-modal{
    border-color: var(--ob-border);
}

html[data-theme="dark"] .admin-card .card-header,
html[data-theme="dark"] .support-modal__header{
    border-bottom-color: var(--ob-border-subtle);
}

html[data-theme="dark"] .admin-actions,
html[data-theme="dark"] .task-li + .task-li{
    border-top-color: var(--ob-border-subtle);
}

html[data-theme="dark"] .admin-badge--neutral{
    background: var(--ob-primary-soft-strong);
    color: #dbeafe;
}

html[data-theme="dark"] .admin-badge--success{
    background: rgba(52,211,153,.18);
    color: #6ee7b7;
}

html[data-theme="dark"] .admin-badge--danger{
    background: rgba(248,113,113,.18);
    color: #fecaca;
}

html[data-theme="dark"] .admin-action-btn:focus-visible { outline-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96,165,250,.2); }
html[data-theme="dark"] .admin-quick-btn:focus-visible { outline-color: #60a5fa; }

html[data-theme="dark"] .support-widget:hover,
html[data-theme="dark"] .topbar-right .header-btn:hover,
html[data-theme="dark"] .topbar-right .topbar-actions .btn:hover,
html[data-theme="dark"] .topbar-right .topbar-actions a:hover,
html[data-theme="dark"] .topbar-right .topbar-actions button:hover,
html[data-theme="dark"] .topbar-right .topbar-actions .topbar-chip:hover,
html[data-theme="dark"] .btn-topbar-icon:hover,
html[data-theme="dark"] .search-history-card:hover{
    background: var(--ob-primary-soft);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

html[data-theme="dark"] .topbar-right .topbar-actions .topbar-chip{
    background: var(--ob-surface-raised);
    border-color: var(--ob-border);
    color: var(--ob-text);
}

html[data-theme="dark"] .topbar-right .topbar-actions .topbar-chip:hover{
    background: var(--ob-primary-soft);
    border-color: var(--ob-control-hover-border);
    color: var(--ob-control-hover-text);
}

/* =========================
   Admin User Card Redesign
   ========================= */

/* Remove avatar from cards */

/* Stats cells (enhanced) */
.admin-stat-cell {
    min-width: 0;
    padding: 12px 10px;
    border-radius: 12px;
    background: var(--ob-primary-soft);
    display: flex;
    flex-direction: column;
}
.admin-stat-cell__label {
    display: block;
    color: var(--ob-text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.admin-stat-cell__value {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #1f2a37;
    font-size: .95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.admin-stat-cell__value--success { color: #166a2f; }
.admin-stat-cell__value--muted { color: rgba(31,42,55,.44); font-weight: 500; }
.admin-stat-cell small {
    display: block;
    margin-top: 2px;
    color: var(--ob-text-muted);
    font-size: .73rem;
}

/* Extended meta row */

/* ========== Action Buttons (always visible) ========== */



/* Primary action buttons */
.admin-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .15s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
}
.admin-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,.1);
}
.admin-action-btn:focus { outline: none; }
.admin-action-btn:focus-visible { outline: 3px solid var(--ob-primary); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(42,103,216,.2); }
.admin-action-btn:active {
    transform: scale(0.97);
}
.admin-action-btn--primary {
    background: var(--ob-primary);
    color: #fff;
    border-color: var(--ob-primary);
}
.admin-action-btn--primary:hover { background: #1d4ed8; }
.admin-action-btn--danger {
    background: rgba(220,53,69,.1);
    color: #dc3545;
    border-color: rgba(220,53,69,.2);
}
.admin-action-btn--danger:hover { background: rgba(220,53,69,.2); }
.admin-action-btn--success {
    background: rgba(25,135,84,.1);
    color: #198754;
    border-color: rgba(25,135,84,.2);
}
.admin-action-btn--success:hover { background: rgba(25,135,84,.2); }
.admin-action-btn--neutral {
    background: rgba(31,42,55,.06);
    color: #344054;
    border-color: rgba(31,42,55,.12);
}
.admin-action-btn--neutral:hover { background: rgba(31,42,55,.12); }
.admin-action-btn--ghost {
    background: transparent;
    color: var(--ob-primary);
    border-color: rgba(42,103,216,.22);
}
.admin-action-btn--ghost:hover { background: var(--ob-primary-soft); }
.admin-action-btn .bi { font-size: 15px; }

/* Limit section — grid layout */
.admin-limit-section { display: flex; flex-direction: column; gap: 8px; }
.admin-limit-summary { padding: 4px 0; font-variant-numeric: tabular-nums; }
.admin-limit-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-limit-quick--row { display: flex; gap: 4px; flex-wrap: wrap; }

/* Mode toggle buttons (replaces radio buttons) */
.admin-limit-mode-btns { display: flex; gap: 2px; background: rgba(31,42,55,.06); border-radius: 8px; padding: 3px; }
.admin-limit-mode-btn {
    padding: 5px 12px; font-size: .75rem; font-weight: 600; border-radius: 6px;
    border: none; background: transparent; color: var(--ob-text-muted); cursor: pointer;
    min-height: 40px;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.admin-limit-mode-btn--active { background: #fff; color: var(--ob-text-strong); box-shadow: 0 1px 4px rgba(15,23,42,.1); }
.admin-limit-mode-btn:hover:not(.admin-limit-mode-btn--active) { color: var(--ob-text); }

/* Form layout */
.admin-limit-form { display: none; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-limit-form--absolute,
.admin-limit-form--relative { display: none; }
.admin-limit-form[data-limit-mode="absolute"].admin-limit-form--absolute { display: flex; }
.admin-limit-form[data-limit-mode="relative"].admin-limit-form--relative { display: flex; }
.admin-limit-form .form-control { width: 90px; }
.admin-limit-form .form-select { width: 60px; }
.admin-limit-remove { display: inline-flex; }

.admin-limit-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid rgba(42,103,216,.22);
    border-radius: 9px;
    overflow: hidden;
}
.admin-limit-toggle__btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--ob-primary);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    transition: background .15s;
}
.admin-limit-toggle__btn:hover { background: var(--ob-primary-soft); }
.admin-limit-toggle__btn--active { background: var(--ob-primary); color: #fff; }
.admin-limit-toggle__btn--active:hover { background: var(--ob-primary); }
html[data-theme="dark"] .admin-limit-toggle { border-color: rgba(96,165,250,.3); }
html[data-theme="dark"] .admin-limit-toggle__btn { color: #60a5fa; }
html[data-theme="dark"] .admin-limit-toggle__btn--active { background: #1e40af; color: #fff; }

/* Dark mode */
html[data-theme="dark"] .admin-limit-mode-btns { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .admin-limit-mode-btn--active { background: var(--ob-surface-raised); color: #e2e8f0; }
html[data-theme="dark"] .admin-limit-form .form-control { background: #374151; border-color: #4b5563; color: #e5e7eb; }
html[data-theme="dark"] .admin-limit-form .form-select { background: #374151; border-color: #4b5563; color: #e5e7eb; }

/* Dark mode: form elements in admin cards */
html[data-theme="dark"] .admin-card .form-control {
    background: #374151;
    border-color: rgba(255,255,255,.15);
    color: #e5e7eb;
}
html[data-theme="dark"] .admin-card .form-control:focus {
    background: #374151;
    border-color: var(--ob-primary, #3b82f6);
    color: #e5e7eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
html[data-theme="dark"] .admin-card .form-select {
    background-color: #374151;
    border-color: rgba(255,255,255,.15);
    color: #e5e7eb;
}
html[data-theme="dark"] .admin-card .form-check-input {
    background: #374151;
    border-color: #4b5563;
}
html[data-theme="dark"] .admin-card .form-check-input:checked {
    background-color: var(--ob-primary, #3b82f6);
    border-color: var(--ob-primary, #3b82f6);
}
html[data-theme="dark"] .admin-card .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    border-color: var(--ob-primary, #3b82f6);
}
html[data-theme="dark"] .admin-card .form-text {
    color: rgba(255, 255, 255, 0.55);
}
html[data-theme="dark"] .admin-card .input-group-text {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}
html[data-theme="dark"] .admin-card .text-danger {
    color: #f87171 !important;
}

/* Dark mode: search field icon */
html[data-theme="dark"] .admin-search-field .bi {
    color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .admin-list-tools .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
html[data-theme="dark"] .admin-card-body {
    background: var(--ob-surface-raised);
}

/* Admin user card disclosure (Manage button) */
.admin-user-details { margin-top: 12px; }
.admin-manage-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; border-radius: 9px;
    border: 1px solid rgba(42,103,216,.22); color: var(--ob-primary);
    font-size: .82rem; font-weight: 600; cursor: pointer;
    background: transparent; list-style: none;
}
.admin-manage-btn::-webkit-details-marker { display: none; }
.admin-manage-btn .bi-chevron-down { transition: transform .2s; }
.admin-user-details[open] .admin-manage-btn .bi-chevron-down { transform: rotate(180deg); }
.admin-user-details__body { padding-top: 12px; }
.admin-user-details__body > div.admin-limit-section { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--ob-border-subtle); }
html[data-theme="dark"] .admin-manage-btn { color: #60a5fa; border-color: rgba(96,165,250,.3); }
.admin-empty-state { text-align: center; padding: 60px 20px; color: var(--ob-text-muted); }
.admin-empty-state__icon { font-size: 3rem; color: var(--ob-primary); opacity: .5; margin-bottom: 16px; }
.admin-empty-state__title { font-size: 1.1rem; font-weight: 700; color: var(--ob-text-strong); margin-bottom: 8px; }
.admin-empty-state__desc { font-size: .85rem; margin-bottom: 20px; }
.admin-empty-state__clear { padding: 8px 20px; border-radius: 9px; border: 1px solid var(--ob-border); background: transparent; color: var(--ob-primary); cursor: pointer; font-weight: 600; }
.admin-empty-state__clear:hover { background: var(--ob-primary-soft); }
html[data-theme="dark"] .admin-empty-state { color: rgba(255,255,255,.6); }
html[data-theme="dark"] .admin-empty-state__title { color: #e2e8f0; }

.admin-limit-quick--row { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-limit-quick--row form { margin: 0; }
.admin-quick-btn {
    min-width: 52px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--ob-border);
    border-radius: 8px;
    background: var(--ob-surface);
    color: var(--ob-text);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.admin-quick-btn:focus-visible,
.admin-limit-mode-btn:focus-visible,
.admin-manage-btn:focus-visible {
    outline: 3px solid var(--ob-primary);
    outline-offset: 2px;
}
.cabinet-page .btn { min-height: 44px; }
.cabinet-page .page-link { min-height: 44px; display: inline-flex; align-items: center; }
.auth-clear { min-width: 40px; }
html[data-theme="dark"] .admin-quick-btn {
    background: var(--ob-surface-raised);
    border-color: var(--ob-border);
    color: var(--ob-text);
}
html[data-theme="dark"] .admin-action-btn--primary {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* ========== Admin users: filters and table ========== */
.admin-filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(130px, 1fr)); gap: 12px; align-items: end; margin-bottom: 20px; }
.admin-filters .form-label { margin-bottom: 4px; color: var(--ob-text-muted); font-size: .78rem; font-weight: 600; }
.admin-filters__actions { display: flex; grid-column: 1 / -1; gap: 8px; }
.admin-table-wrap { overflow-x: auto; }
.admin-users-table { --bs-table-bg: transparent; margin: 0; color: var(--ob-text); font-size: .9rem; font-variant-numeric: tabular-nums; }
.admin-users-table thead th { padding: 10px 12px; border-bottom: 1px solid var(--ob-border); color: var(--ob-text-muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.admin-users-table tbody td { padding: 12px; border-bottom: 1px solid var(--ob-border-subtle); vertical-align: middle; }
.admin-users-table tbody tr:hover { background: var(--ob-primary-soft); }
.admin-users-table tbody tr.is-selected { background: var(--ob-primary-soft-strong); box-shadow: inset 3px 0 0 var(--ob-primary); }
.admin-users-table__login { color: var(--ob-primary); font-weight: 700; overflow-wrap: anywhere; text-decoration: none; }
.admin-users-table__login:hover { text-decoration: underline; }
.admin-users-table__login:focus-visible { outline: 3px solid var(--ob-primary); outline-offset: 2px; border-radius: 4px; }
.admin-users-table__empty td { padding: 40px 12px; color: var(--ob-text-muted); text-align: center; }
.admin-user-panel { width: min(440px, 100vw); visibility: visible; background: var(--ob-surface); color: var(--ob-text); }
.admin-user-panel .offcanvas-header { align-items: flex-start; border-bottom: 1px solid var(--ob-border-subtle); }
.admin-user-panel__meta { color: var(--ob-text-muted); font-size: .85rem; }
.admin-panel-backdrop { cursor: default; }
.admin-panel-section { padding: 16px 0; border-bottom: 1px solid var(--ob-border-subtle); }
.admin-panel-section:last-child { border-bottom: 0; }
.admin-panel-section__title { margin: 0 0 10px; color: var(--ob-text-muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-panel-section__text { margin: 0 0 8px; }
.admin-panel-form { margin-top: 12px; }
.admin-api-key-value { display: block; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--ob-border); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.admin-api-key-value[hidden] { display: none; }
.admin-selected-user { margin-top: 0; }
.admin-selected-user__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.admin-selected-user__row form { margin: 0; }
.admin-selected-user .admin-limit-section + .admin-limit-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ob-border-subtle); }
html[data-theme="dark"] .admin-user-panel { background: var(--ob-surface-raised); color: var(--ob-text); }
/* Кнопка закрытия панели — ссылка с иконкой из ::before: без подчёркивания, в тёмной теме без инверсии фона */
.offcanvas .btn-close,
.offcanvas .btn-close:hover,
.offcanvas .btn-close:focus { text-decoration: none; }
html[data-theme="dark"] .offcanvas .btn-close { filter: none; background-color: var(--ob-surface-raised); border-color: var(--ob-border); color: var(--ob-text); }
html[data-theme="dark"] .offcanvas .btn-close:hover { background-color: var(--ob-primary-soft); border-color: var(--ob-control-hover-border); color: var(--ob-control-hover-text); }
/* Заголовок получает фокус программно при открытии панели — рамку вокруг него не рисуем */
.admin-user-panel .offcanvas-title:focus { outline: none; }
html[data-theme="dark"] .admin-users-table { color: var(--ob-text); }
html[data-theme="dark"] .admin-users-table thead th { border-bottom-color: var(--ob-border); }
html[data-theme="dark"] .admin-users-table tbody td { border-bottom-color: var(--ob-border-subtle); }
html[data-theme="dark"] .admin-users-table__login { color: #60a5fa; }
html[data-theme="dark"] .admin-users-table tbody tr.is-selected { background: rgba(96,165,250,.16); box-shadow: inset 3px 0 0 #60a5fa; }
html[data-theme="dark"] .admin-selected-user .admin-limit-section + .admin-limit-section { border-top-color: var(--ob-border-subtle); }

@media (max-width: 991.98px) {
    .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-filters__field--search { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
    .admin-filters { grid-template-columns: 1fr; }
    .admin-users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .admin-users-table, .admin-users-table tbody, .admin-users-table tr, .admin-users-table td { display: block; width: 100%; }
    .admin-users-table tbody tr { margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--ob-border); border-radius: 12px; }
    .admin-users-table tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ob-border-subtle); text-align: right; }
    .admin-users-table tbody td:last-child { border-bottom: 0; }
    .admin-users-table tbody td::before { content: attr(data-label); flex: 0 0 auto; color: var(--ob-text-muted); font-size: .75rem; font-weight: 700; text-align: left; text-transform: uppercase; }
    .admin-users-table__empty td { display: block; text-align: center; }
    .admin-users-table__empty td::before { content: none; }
}

/* ========== Admin users: toasts and one-time password ========== */
.admin-toasts { position: fixed; top: 72px; right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.admin-toast { border: 1px solid var(--ob-border); border-left-width: 4px; background: var(--ob-surface); color: var(--ob-text); box-shadow: 0 8px 24px rgba(15,23,42,.14); }
.admin-toast .toast-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
.admin-toast--success { border-left-color: #16a34a; }
.admin-toast--danger { border-left-color: #dc2626; }
.admin-password-reveal { margin-bottom: 20px; padding: 14px 16px; border: 1px solid #d97706; border-radius: 12px; background: rgba(217,119,6,.08); color: var(--ob-text); }
.admin-password-reveal__body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-password-reveal code { padding: 4px 8px; border: 1px solid var(--ob-border); border-radius: 8px; background: var(--ob-surface); color: var(--ob-text); font-size: 1rem; user-select: all; overflow-wrap: anywhere; }
.admin-password-reveal__warn { display: block; margin-top: 8px; color: #b45309; font-size: .85rem; }
html[data-theme="dark"] .admin-toast { background: var(--ob-surface-raised); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
html[data-theme="dark"] .admin-toast .btn-close { filter: invert(1) grayscale(1); }
html[data-theme="dark"] .admin-password-reveal__warn { color: #fbbf24; }
.admin-create-panel .offcanvas-body .col-md-6 { width: 100%; }
