/**
 * строй.онлайн — Visual v2 (концепт 2026)
 * Кирпичный SVG-фон, pill-кнопки, glass-карточки, плавающая навигация.
 * Подключать после style.css и theme-dark.css.
 *
 * Архитектура стилей (единый источник правды):
 * 1. :root / [data-theme="dark"] — design tokens (--text-*, --surface-*, --btn-*)
 * 2. BUTTON DESIGN SYSTEM — все .btn в .site-body
 * 3. TYPOGRAPHY SYSTEM — заголовки, labels, muted
 * 4. CANONICAL OVERRIDES — перекрывает legacy style.css (таблицы, карточки, формы, чат, пагинация)
 * 5. COMPACT TABLE SYSTEM + CABINET DENSITY — плотные таблицы и личный кабинет
 */

:root {
    /* —— Design tokens (единый источник) —— */
    --primary: #d97706;
    --primary-dark: #b45309;
    --primary-light: #fef3c7;
    --primary-soft: rgba(217, 119, 6, 0.1);
    --secondary: #64748b;
    --secondary-dark: #475569;
    --accent: #10b981;
    /* Текст — канонические токены (меняются в [data-theme="dark"]) */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-label: #334155;
    --text-muted: #526277;
    --body-text: var(--text-body);
    --heading-text: var(--text-heading);
    --text-muted-accessible: var(--text-muted);
    --dark: var(--text-heading);
    --dark-soft: #1e293b;
    --gray: var(--text-muted);
    --light: #f3f0eb;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.68);
    --surface-glass-strong: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(15, 23, 42, 0.06);
    --surface-border-strong: rgba(15, 23, 42, 0.1);
    --shadow-surface: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 22px rgba(15, 23, 42, 0.05);
    --shadow-surface-hover: 0 10px 32px rgba(15, 23, 42, 0.08);
    --footer-bg: rgba(248, 245, 240, 0.96);
    --footer-fg: #526277;
    --footer-title: #0f172a;
    --footer-border: rgba(15, 23, 42, 0.07);
    --brick-opacity: 1;
    --brick-saturate: 0.7;
    --brick-contrast: 1.1;
    --line: rgba(15, 23, 42, 0.08);
    --border-radius: 14px;
    --border-radius-lg: 20px;
    --btn-radius: 999px;
    --btn-height: 36px;
    --btn-height-sm: 32px;
    --btn-height-xs: 28px;
    --btn-height-lg: 40px;
    --btn-icon-size: 32px;
    --btn-back-bg: rgba(255, 255, 255, 0.96);
    --btn-back-border: rgba(15, 23, 42, 0.18);
    --btn-back-color: var(--text-body);
    --btn-back-hover-bg: #fff;
    --btn-back-hover-border: rgba(15, 23, 42, 0.24);
    --btn-back-hover-color: var(--text-heading);
    --stage-row-hover-bg: transparent;
    --stage-row-active-bg: transparent;
    --table-row-hover-bg: transparent;
    --pagination-link-bg: rgba(255, 255, 255, 0.72);
    --pagination-link-border: var(--surface-border-strong);
    --pagination-link-color: var(--text-body);
    --pagination-link-hover-bg: var(--primary-soft);
    --pagination-link-hover-color: var(--primary-dark);
    --pagination-summary-color: var(--text-body);
    /* Таблицы — плотность строк */
    --table-cell-py: 0.3rem;
    --table-cell-px: 0.5rem;
    --table-head-py: 0.35rem;
    --table-head-px: 0.5rem;
    --table-font-size: 0.8125rem;
    --table-head-font-size: 0.75rem;
    --table-badge-py: 0.1rem;
    --table-badge-px: 0.38rem;
    --table-badge-font: 0.625rem;
    --table-action-size: 26px;
    /* Личный кабинет — вертикальные отступы */
    --cabinet-section-gap: 0.75rem;
    --cabinet-card-py: 0.65rem;
    --cabinet-card-px: 0.85rem;
    --box-shadow: var(--shadow-surface);
    --box-shadow-lg: var(--shadow-surface-hover);
    --bs-primary: var(--primary);
    /* Typography + spacing (sb-sans.css — шрифты; здесь — масштаб и safe-area) */
    --font-size-body: 16px;
    --line-height-body: 1.5;
    --font-size-caption: 14px;
    --font-weight-regular: 400;
    --font-weight-semibold: 600;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --border-subtle: 1px solid rgba(15, 23, 42, 0.08);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --tender-header-gradient: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
    --progress: 0%;
    --input-placeholder: #64748b;
}

/* ——— Фон: кирпичи + лёгкая вуаль ——— */
.site-body {
    background: var(--light);
    color: var(--text-body);
}

.site-body::before {
    background-image: url("/static/images/bg-brick-light.svg");
    background-repeat: repeat;
    background-size: 100px 54px;
    opacity: var(--brick-opacity);
    filter: saturate(var(--brick-saturate)) contrast(var(--brick-contrast));
}

.site-body::after {
    background: linear-gradient(
        180deg,
        rgba(243, 240, 235, 0.62) 0%,
        rgba(248, 246, 242, 0.82) 100%
    );
}

/* ——— Навигация: плавающая pill-шапка ——— */
.site-navbar {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding-top: max(0.5rem, var(--safe-top));
    padding-bottom: 0.35rem;
    /* Выше foreman-fab (1050), чтобы меню профиля не перекрывалось */
    z-index: 1085;
}

.site-navbar .site-navbar-inner {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border-strong);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    box-shadow: var(--box-shadow);
}

.site-brand--navbar .site-brand__name {
    font-size: 1.15rem;
}

.nav-link {
    color: var(--gray) !important;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 999px;
    padding: 0.35rem 0.65rem !important;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--primary) !important;
    background: var(--primary-soft);
    text-decoration: none;
}

.site-nav-links > .nav-link--active,
.site-nav-links > .nav-link.active {
    color: var(--primary-dark) !important;
    background: var(--primary-soft) !important;
    font-weight: 600;
}

.site-nav-links .nav-user-block__profile.nav-link--active .nav-user-block__name {
    color: var(--primary-dark) !important;
}

.nav-link-cta {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 0.35rem 0.85rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.22);
}

.nav-link-cta:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
}

.nav-notify-bell {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(217, 119, 6, 0.16);
    border-radius: 999px;
    width: 36px;
    height: 36px;
}

.nav-notify-bell:hover,
.nav-notify-bell[aria-expanded="true"] {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-user-block__name,
.nav-user-block__logout {
    color: var(--gray) !important;
}

.site-nav-toggler {
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-glass-strong);
}

/* ——— Кнопки: см. BUTTON DESIGN SYSTEM в конце файла ——— */
.btn:not(.btn-close):not(.btn-link),
.btn-sm:not(.btn-close):not(.btn-link),
.btn-lg:not(.btn-close):not(.btn-link) {
    border-radius: var(--btn-radius) !important;
    font-weight: 600;
    box-shadow: none !important;
    transform: none !important;
    letter-spacing: 0.01em;
}

.btn {
    min-height: var(--btn-height);
    padding: 0 0.95rem;
    line-height: 1;
    font-size: 0.875rem;
}

.btn-sm {
    min-height: var(--btn-height-sm);
    padding: 0 0.75rem;
    line-height: 1;
    font-size: 0.8125rem;
}

.btn-xs {
    min-height: var(--btn-height-xs);
    padding: 0 0.6rem;
    line-height: 1;
    font-size: 0.75rem;
    border-radius: var(--btn-radius) !important;
}

.btn-lg {
    min-height: var(--btn-height-lg);
    padding: 0 1.15rem;
    line-height: 1;
    font-size: 0.9375rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: rgba(217, 119, 6, 0.28);
    background: rgba(255, 255, 255, 0.85);
}

.btn-outline-primary:hover {
    background: var(--primary-soft);
    color: var(--primary-dark) !important;
    border-color: rgba(217, 119, 6, 0.4);
}

.btn-outline-secondary {
    color: var(--gray) !important;
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.75);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark) !important;
    border-color: rgba(15, 23, 42, 0.18);
}

.btn-warning,
.btn-success {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-warning:hover,
.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

/* ——— Карточки и панели: glass ——— */
.card,
.content-panel,
.list-group-item,
.home-guest-hero__content,
.home-guest-hero__panel,
.home-role-card,
.home-mikhalych-band,
.home-demo-board,
.home-open-tenders,
.home-action-panel,
.home-info-grid > article,
.home-faq-grid > article,
.home-dashboard-stat,
.auth-card,
.role-pick__box,
.home-demo-card,
.home-tender-card,
.project-card,
.tender-type-card {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface);
}

.card:hover,
.project-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--line) !important;
}

.card-accent {
    border-left: 3px solid var(--primary) !important;
}

/* ——— Формы ——— */
.form-control,
.form-select {
    min-height: 38px;
    border-radius: 10px;
    border-color: var(--surface-border-strong);
    background: rgba(255, 255, 255, 0.72);
    color: var(--body-text);
    font-size: 0.9375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--input-placeholder);
    opacity: 1;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-label);
}

/* ——— Бейджи ——— */
.badge {
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.badge.bg-primary,
.badge.text-bg-primary {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
}

.badge.bg-success,
.badge.text-bg-success {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #047857 !important;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background: rgba(100, 116, 139, 0.12) !important;
    color: #475569 !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #b91c1c !important;
}

/* ——— Главная (гость) ——— */
.home-guest-hero__content {
    background:
        radial-gradient(circle at 12% 8%, rgba(217, 119, 6, 0.06), transparent 14rem),
        var(--surface-glass) !important;
}

.home-guest-hero__content h1 {
    letter-spacing: -0.03em;
    font-weight: 700;
}

.home-guest-eyebrow {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    background: var(--primary-soft);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.home-guest-hero__panel {
    background: var(--surface-glass) !important;
    color: var(--dark);
    border: 1px solid var(--surface-border-strong) !important;
}

.home-flow-step {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
}

.home-flow-step strong {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    background: var(--primary-soft);
    color: var(--primary);
}

.home-role-card__icon {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 10px;
}

.home-demo-card {
    border-style: solid;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.5) !important;
}

.home-guest-actions .btn-lg {
    min-height: var(--btn-height);
    font-size: 0.875rem;
}

.home-guest-partner-hint {
    margin-top: 0.85rem;
    font-size: 0.8125rem;
}

.home-guest-partner-hint a {
    font-weight: 600;
    color: var(--primary-dark);
}

.home-customer-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-customer-benefit {
    padding: 1.15rem;
    border-radius: var(--border-radius-lg);
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface);
}

.home-customer-benefit--highlight {
    border-color: rgba(217, 119, 6, 0.35) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 119, 6, 0.08), transparent 55%),
        var(--surface-glass) !important;
}

.home-customer-benefit__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.home-customer-benefit h2 {
    font-size: 1.05rem;
    margin: 0 0 0.45rem;
}

.home-customer-benefit p {
    margin: 0;
    color: var(--text-muted-accessible, #64748b);
    font-size: 0.9rem;
    line-height: 1.45;
}

.home-demo-grid--customer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-demo-card--accent {
    border-color: rgba(217, 119, 6, 0.3) !important;
}

.home-partner-strip,
.landing-partner-strip__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: var(--border-radius-lg);
    background: rgba(100, 116, 139, 0.06);
    border: 1px dashed var(--surface-border-strong);
}

.home-partner-strip {
    margin-bottom: 0.5rem;
}

.home-partner-strip__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 36rem;
}

.home-partner-strip__text strong {
    font-size: 0.95rem;
}

.home-partner-strip__text span {
    font-size: 0.8125rem;
    color: var(--text-muted-accessible, #64748b);
}

.hero-partner-link a {
    font-weight: 600;
    color: var(--primary-dark);
}

.landing-step-card {
    padding: 1.25rem;
    border-radius: var(--border-radius-lg);
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface);
}

.landing-step-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
}

.landing-step-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.nav-link-partner {
    font-size: 0.875rem;
    opacity: 0.92;
}

@media (max-width: 991.98px) {
    .home-customer-benefits,
    .home-demo-grid--customer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .home-partner-strip,
    .landing-partner-strip__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .home-partner-strip .btn,
    .landing-partner-strip__inner .btn {
        width: 100%;
    }
}

/* ——— Auth ——— */
.page-auth .auth-card {
    border-radius: var(--border-radius-lg);
}

.role-pick__box {
    border-radius: 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.role-pick input:checked + .role-pick__box,
.role-pick__box:hover {
    border-color: var(--primary) !important;
    background: var(--primary-soft) !important;
}

/* Регистрация: две роли в одну линию — одинаковая высота и стиль */
.role-pick-grid--single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.75rem;
}

.role-pick-grid--single .role-pick {
    display: flex;
    min-height: 100%;
}

.role-pick-grid--single .role-pick__box {
    flex: 1 1 auto;
    width: 100%;
    min-height: 8.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 1rem 1rem 0.9rem;
    text-align: left;
    border: 2px solid var(--surface-border-strong) !important;
    background: var(--surface-glass) !important;
    box-sizing: border-box;
}

.role-pick-grid--single .role-pick__box img {
    flex-shrink: 0;
}

.role-pick-grid--single .role-pick__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    hyphens: auto;
}

.role-pick-grid--single .role-pick__desc {
    display: block;
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-muted-accessible, #64748b);
}

.role-pick-grid--single .role-pick input:checked + .role-pick__box,
.role-pick-grid--single .role-pick--active .role-pick__box {
    border-color: var(--primary) !important;
    background: var(--primary-soft) !important;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.12);
}

.role-pick-grid--single .role-pick input:checked + .role-pick__box .role-pick__desc,
.role-pick-grid--single .role-pick--active .role-pick__box .role-pick__desc {
    color: var(--primary-dark);
    opacity: 0.85;
}

@media (max-width: 479.98px) {
    .role-pick-grid--single {
        grid-template-columns: 1fr;
    }

    .role-pick-grid--single .role-pick__box {
        min-height: 7.5rem;
    }
}

.register-mode-banner {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--surface-border-strong);
    background: var(--surface-glass);
}

/* ——— Таблицы и списки ——— */
.site-table-wrap,
.table-scroll {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    border-radius: 12px;
    box-shadow: var(--shadow-surface);
    overflow: hidden;
}

.table-scroll .site-data-table,
.site-table-wrap .site-data-table,
.mobile-data-card {
    background: transparent !important;
}

.site-list-filters {
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface) !important;
}

.site-data-table thead th {
    border-bottom-color: var(--surface-border-strong) !important;
}

.list-group-item {
    border-color: var(--line) !important;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.78) !important;
}

[data-theme="dark"] .list-group-item:hover {
    background: rgba(39, 52, 73, 0.5) !important;
}

[data-theme="dark"] .list-group-item-action:hover,
[data-theme="dark"] .list-group-item-action:focus {
    color: var(--text-body) !important;
}

[data-theme="dark"] .list-group-item-action:hover .text-muted,
[data-theme="dark"] .list-group-item-action:focus .text-muted {
    color: var(--text-muted-accessible) !important;
}

/* ——— Footer ——— */
.site-footer {
    margin-top: auto;
    flex-shrink: 0;
    background: var(--footer-bg) !important;
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--footer-border) !important;
    color: var(--footer-fg) !important;
}

.site-footer__inner {
    padding-top: 0.65rem !important;
    padding-bottom: 0.45rem !important;
}

.site-footer__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.site-footer__brand-col {
    flex: 1 1 12rem;
    min-width: 0;
}

.site-footer__meta-col {
    flex: 1 1 18rem;
    min-width: 0;
    text-align: right;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.15rem 0.75rem;
}

.site-footer strong,
.site-footer .site-brand--footer .site-brand__name {
    color: var(--footer-title) !important;
}

.site-footer .footer-link {
    color: var(--footer-fg) !important;
    text-decoration: none;
    margin-left: 0 !important;
    font-size: 0.8125rem;
    line-height: 1.35;
    white-space: nowrap;
}

.site-footer .footer-link:hover {
    color: var(--primary-dark) !important;
}

.site-footer-contacts {
    margin-top: 0.45rem;
    padding-top: 0;
    border-top: none !important;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--footer-fg) !important;
}

.site-footer-contacts__label {
    margin-right: 0.25rem;
}

.site-brand--footer .site-brand__name {
    font-size: 0.9375rem;
}

.site-brand--footer .footer-tagline {
    color: var(--footer-fg) !important;
    font-size: 0.75rem;
    line-height: 1.3;
    opacity: 0.92;
}

@media (max-width: 767.98px) {
    .site-footer__grid {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .site-footer__meta-col {
        text-align: center;
    }

    .site-footer__nav {
        justify-content: center;
        gap: 0.2rem 0.55rem;
    }

    .site-footer-contacts {
        text-align: center;
    }

    .site-footer .footer-link {
        min-height: 0 !important;
        padding: 0 !important;
        line-height: 1.35 !important;
    }
}

/* ——— Bottom nav ——— */
.site-bottom-nav {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--surface-border-strong);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.site-bottom-nav__item {
    border-radius: 999px;
    font-size: 0.625rem;
}

.site-bottom-nav__item--active {
    color: var(--primary);
    background: var(--primary-soft);
}

/* ——— Welcome banner (рабочий стол) ——— */
.flow-screen-head.page-welcome,
.page-welcome {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border-strong) !important;
    border-left: 3px solid var(--primary) !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-surface) !important;
    padding: 0.75rem 1rem !important;
    color: var(--dark) !important;
}

.flow-screen-head.page-welcome h1,
.flow-screen-head.page-welcome h2,
.flow-screen-head.page-welcome h3,
.page-welcome h2 {
    color: var(--dark) !important;
    text-shadow: none !important;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.15rem !important;
}

.flow-screen-head.page-welcome p,
.flow-screen-head.page-welcome .text-muted,
.page-welcome p {
    color: var(--gray) !important;
    opacity: 1 !important;
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0 !important;
}

.flow-screen-head.page-welcome img,
.flow-screen-head.page-welcome .hero-feature-icon {
    width: 56px;
    height: 56px;
    opacity: 1;
}

.hero-feature-icon--dashboard {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.hero-feature-icon--dashboard svg {
    display: block;
    width: 100%;
    height: 100%;
}

.welcome-icon__plate {
    fill: rgba(217, 119, 6, 0.08);
    stroke: rgba(217, 119, 6, 0.2);
    stroke-width: 1;
}

.welcome-icon__row {
    fill: rgba(100, 116, 139, 0.32);
}

.welcome-icon__row--active {
    fill: rgba(217, 119, 6, 0.42);
}

.welcome-icon__check {
    fill: var(--primary);
}

.welcome-icon__check-mark {
    stroke: #fff;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-theme="dark"] .welcome-icon__plate {
    fill: rgba(232, 160, 84, 0.1);
    stroke: rgba(232, 160, 84, 0.28);
}

[data-theme="dark"] .welcome-icon__row {
    fill: rgba(148, 163, 184, 0.38);
}

[data-theme="dark"] .welcome-icon__row--active {
    fill: rgba(232, 160, 84, 0.52);
}

[data-theme="dark"] .welcome-icon__check-mark {
    stroke: #1e293b;
}

.site-body--cabinet .flow-screen-head.page-welcome {
    margin-bottom: var(--cabinet-section-gap) !important;
}

[data-theme="dark"] .flow-screen-head.page-welcome,
[data-theme="dark"] .page-welcome,
[data-theme="dark"] .flow-screen-head[style*="linear-gradient"] {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
    border-left-color: var(--primary) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .flow-screen-head.page-welcome h1,
[data-theme="dark"] .flow-screen-head.page-welcome h2,
[data-theme="dark"] .flow-screen-head.page-welcome h3,
[data-theme="dark"] .page-welcome h2,
[data-theme="dark"] .flow-screen-head[style*="linear-gradient"] h2 {
    color: #f1f5f9 !important;
    text-shadow: none !important;
}

[data-theme="dark"] .flow-screen-head.page-welcome p,
[data-theme="dark"] .flow-screen-head.page-welcome .text-muted,
[data-theme="dark"] .page-welcome p,
[data-theme="dark"] .flow-screen-head[style*="linear-gradient"] p {
    color: #94a3b8 !important;
}

.alert {
    border-radius: 12px;
    backdrop-filter: blur(6px);
}

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

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    font-size: 0 !important;
    color: transparent !important;
    min-width: 2px;
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, var(--secondary), var(--secondary-dark)) !important;
}

.site-main h1,
.site-main h2,
.site-main .h1,
.site-main .h2 {
    letter-spacing: -0.02em;
}

.flow-screen-head h2,
.flow-screen-head .h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ——— Тёмная тема ——— */
[data-theme="dark"] {
    --primary: #e8a054;
    --primary-dark: #f0c88a;
    --primary-light: rgba(232, 160, 84, 0.14);
    --primary-soft: rgba(232, 160, 84, 0.1);
    --secondary: #94a3b8;
    --secondary-dark: #cbd5e1;
    --text-heading: #f1f5f9;
    --text-body: #cbd5e1;
    --text-label: #cbd5e1;
    --text-muted: #94a3b8;
    --body-text: var(--text-body);
    --heading-text: var(--text-heading);
    --text-muted-accessible: #b8c5d6;
    --dark: var(--text-heading);
    --dark-soft: #cbd5e1;
    --gray: var(--text-muted);
    --light: #0f172a;
    --surface: #1e293b;
    --surface-raised: #273449;
    --surface-glass: rgba(30, 41, 59, 0.72);
    --surface-glass-strong: rgba(30, 41, 59, 0.88);
    --surface-border: rgba(71, 85, 105, 0.14);
    --surface-border-strong: rgba(71, 85, 105, 0.2);
    --btn-back-bg: #273449;
    --btn-back-border: rgba(148, 163, 184, 0.42);
    --btn-back-color: #e2e8f0;
    --btn-back-hover-bg: #334155;
    --btn-back-hover-border: rgba(232, 160, 84, 0.45);
    --btn-back-hover-color: #f8fafc;
    --shadow-surface: none;
    --shadow-surface-hover: none;
    --footer-bg: rgba(15, 23, 42, 0.94);
    --footer-fg: #94a3b8;
    --footer-title: #e2e8f0;
    --footer-border: rgba(71, 85, 105, 0.24);
    --brick-opacity: 0.97;
    --brick-saturate: 1;
    --brick-contrast: 1;
    --line: rgba(148, 163, 184, 0.12);
    --stage-row-hover-bg: transparent;
    --stage-row-active-bg: transparent;
    --table-row-hover-bg: transparent;
    --pagination-link-bg: rgba(15, 23, 42, 0.45);
    --pagination-link-border: var(--surface-border-strong);
    --pagination-link-color: var(--text-body);
    --pagination-link-hover-bg: var(--primary-soft);
    --pagination-link-hover-color: var(--primary);
    --pagination-summary-color: var(--text-body);
    --input-placeholder: #94a3b8;
}

[data-theme="dark"] .site-body::before {
    background-image: url("/static/images/bg-brick-dark.svg");
    opacity: var(--brick-opacity);
    filter: saturate(var(--brick-saturate)) contrast(var(--brick-contrast));
}

[data-theme="dark"] .site-body::after {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.28) 0%,
        rgba(15, 23, 42, 0.58) 100%
    );
}

[data-theme="dark"] .site-navbar .site-navbar-inner {
    background: var(--surface-glass-strong);
    border-color: var(--surface-border-strong);
}

[data-theme="dark"] .nav-link {
    color: #94a3b8 !important;
}

[data-theme="dark"] .nav-link:hover {
    color: #fef3c7 !important;
    background: var(--primary-soft);
}

[data-theme="dark"] .site-nav-links > .nav-link--active,
[data-theme="dark"] .site-nav-links > .nav-link.active {
    color: var(--primary) !important;
    background: rgba(232, 160, 84, 0.16) !important;
    font-weight: 600;
}

[data-theme="dark"] .site-nav-links .nav-user-block__profile.nav-link--active .nav-user-block__name {
    color: var(--primary) !important;
}

[data-theme="dark"] .nav-link-cta {
    background: var(--primary) !important;
    color: #fff !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .content-panel,
[data-theme="dark"] .home-guest-hero__content,
[data-theme="dark"] .home-guest-hero__panel,
[data-theme="dark"] .home-role-card,
[data-theme="dark"] .home-mikhalych-band,
[data-theme="dark"] .home-demo-board,
[data-theme="dark"] .home-open-tenders,
[data-theme="dark"] .home-tender-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .list-group-item {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .auth-visual--brand {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface) !important;
}

[data-theme="dark"] .page-auth .auth-mobile-hero__text {
    color: var(--text-muted);
}

[data-theme="dark"] .home-flow-step {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--surface-border-strong);
}

[data-theme="dark"] .home-guest-hero__panel {
    color: #f1f5f9;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--surface-border-strong);
    color: var(--dark);
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
    color: var(--input-placeholder);
    opacity: 1;
}

[data-theme="dark"] .btn-outline-primary {
    color: #e8c9a0 !important;
    border-color: rgba(232, 160, 84, 0.4);
    background: rgba(15, 23, 42, 0.4);
}

[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #475569;
    background: rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .site-bottom-nav {
    background: var(--surface-glass-strong);
    border-top-color: var(--surface-border-strong);
}

[data-theme="dark"] .site-nav-toggler {
    background: rgba(30, 41, 59, 0.9);
    border-color: #475569;
    color: #e2e8f0;
}

/* ——— Чат, каталог, тендеры ——— */
.tender-card,
.directory-card,
.mobile-data-card,
.notify-drawer__panel {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface);
    backdrop-filter: blur(10px);
}

.foreman-panel {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: var(--box-shadow-lg);
}

.foreman-fab {
    border-radius: 999px;
    box-shadow: var(--box-shadow);
}

.chat-compose {
    background: var(--surface-glass-strong);
    border: 1px solid var(--surface-border-strong);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.chat-compose-send {
    border-radius: 999px;
    min-height: var(--btn-height-sm);
}

.directory-role-group .directory-role-btn {
    border-radius: 999px;
    min-height: var(--btn-height-sm);
    font-size: 0.8125rem;
}

.directory-role-group .btn-check:checked + .directory-role-btn {
    background: var(--primary);
    border-color: var(--primary);
}

.notify-drawer__panel {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

[data-theme="dark"] .tender-card,
[data-theme="dark"] .directory-card,
[data-theme="dark"] .notify-drawer__panel,
[data-theme="dark"] .foreman-panel,
[data-theme="dark"] .chat-compose {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

@media (max-width: 991.98px) {
    .site-navbar .site-navbar-inner {
        border-radius: 16px;
        padding: 0.4rem 0.65rem;
    }

    #navbarNav {
        margin-top: 0.5rem;
        padding: 0.5rem;
        background: var(--surface-glass-strong);
        border: 1px solid var(--surface-border-strong);
        border-radius: 14px;
        backdrop-filter: blur(12px);
    }

    [data-theme="dark"] #navbarNav {
        background: var(--surface-glass-strong);
        border-color: rgba(71, 85, 105, 0.45);
    }
}

/* ——— v2.2: дизайн-система, чаты-мессенджер, тёмная тема ——— */

/* Кнопки: единые стандарты (перекрывают touch-target 48px из style.css) */
.touch-target:not(.btn-close):not(.btn-link):not(.btn-icon-action) {
    min-height: var(--btn-height-sm) !important;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--btn-height-sm) !important;
    min-height: var(--btn-height-sm) !important;
    max-height: var(--btn-height-sm) !important;
    padding: 0.25rem !important;
}

.chat-list-actions > .btn,
.page-back-nav .btn,
.btn-back {
    min-height: var(--btn-height-sm) !important;
    padding: 0 0.85rem !important;
    line-height: 1 !important;
    font-size: 0.8125rem !important;
}

.nav-chat-badge,
.chat-unread-dot {
    background: var(--primary) !important;
}

.chat-list-item--unread {
    background-color: var(--primary-soft) !important;
    box-shadow: inset 3px 0 0 var(--primary) !important;
}

.chat-list-item--unread:hover {
    background-color: rgba(217, 119, 6, 0.14) !important;
}

[data-theme="dark"] .chat-list-item--unread {
    background-color: rgba(232, 160, 84, 0.08) !important;
}

[data-theme="dark"] .chat-list-item--unread:hover {
    background-color: rgba(232, 160, 84, 0.12) !important;
}

/* Главная: компактные выровненные CTA */
.hero-cta-row,
.landing-mikhalych-fold__actions,
.home-action-panel__buttons,
.home-guest-actions {
    align-items: center !important;
    gap: 0.4rem !important;
}

.hero-cta-row > .btn,
.landing-mikhalych-fold__actions > .btn,
.home-action-panel__buttons > .btn,
.home-action-panel__buttons > a.btn,
.home-guest-actions > .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: var(--btn-height-sm) !important;
    max-height: var(--btn-height-sm) !important;
    height: var(--btn-height-sm) !important;
    padding: 0 0.75rem !important;
    line-height: 1 !important;
    font-size: 0.8125rem !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

.home-action-panel__buttons > .btn .icon,
.home-action-panel__buttons > a.btn .icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.home-action-panel__buttons > .btn,
.home-action-panel__buttons > a.btn {
    gap: 0.35rem;
}

.home-action-panel__buttons > .btn-primary {
    box-shadow: none !important;
}

.home-action-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
}

.home-action-panel > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.home-action-panel__buttons {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: none;
    margin-top: 0 !important;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.home-action-panel h3,
.home-info-grid h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem !important;
    color: var(--text-heading);
}

.home-action-panel p.text-muted,
.home-info-grid p {
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0 !important;
}

.home-action-panel h3 {
    margin-bottom: 0.15rem;
}

@media (max-width: 991.98px) {
    .home-action-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .home-action-panel__buttons {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Список диалогов: одна рамка, без внутренних «квадратов» */
.chat-list-item {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    border-radius: var(--border-radius) !important;
    margin-bottom: 0.45rem;
    padding: 0.65rem 0.75rem !important;
}

.chat-list-link {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}

.chat-list-item:hover {
    background: rgba(255, 255, 255, 0.92) !important;
}

[data-theme="dark"] .chat-list-item {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .chat-list-item:hover {
    background: rgba(39, 52, 73, 0.92) !important;
}

/* Тёмная тема: читаемые заголовки */
[data-theme="dark"] .hero-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .hero-lead,
[data-theme="dark"] .hero-checklist li,
[data-theme="dark"] .scope-card h3,
[data-theme="dark"] .home-action-panel h3,
[data-theme="dark"] .home-info-grid h3,
[data-theme="dark"] .home-dashboard-stat strong,
[data-theme="dark"] .site-brand--hero .site-brand__name,
[data-theme="dark"] .site-brand--hero .site-brand__name--hero,
[data-theme="dark"] .landing-mikhalych-fold h2,
[data-theme="dark"] .card h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .card h4,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3:not(.text-muted),
[data-theme="dark"] .form-label,
[data-theme="dark"] label.form-label,
[data-theme="dark"] span.form-label {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .roles-strip .role-card,
[data-theme="dark"] .features-grid .feature-card,
[data-theme="dark"] .scope-card {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
}

[data-theme="dark"] .roles-strip .role-card h5 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .roles-strip .role-card .text-muted,
[data-theme="dark"] .features-grid .feature-card .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .hero-subtitle {
    color: #e8c9a0 !important;
}

[data-theme="dark"] .text-dark,
[data-theme="dark"] a.text-dark,
[data-theme="dark"] .chat-list-link,
[data-theme="dark"] .chat-list-link.text-dark,
[data-theme="dark"] .mobile-data-card.text-dark {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .chat-list-title,
[data-theme="dark"] .chat-list-preview,
[data-theme="dark"] .chat-list-meta {
    color: #cbd5e1 !important;
}

/* Чаты: мессенджер — капсула только у текста сообщения */
.chat-thread-card .chat-messages > .chat-bubble,
.support-chat-card .chat-messages > .chat-bubble {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.65rem;
    width: fit-content;
    max-width: min(92%, 34rem);
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    color: inherit !important;
}

.chat-thread-card .chat-messages > .chat-bubble:not(.chat-bubble--mine),
.support-chat-card .chat-messages > .chat-bubble:not(.chat-bubble--mine) {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-thread-card .chat-messages > .chat-bubble--mine,
.support-chat-card .chat-messages > .chat-bubble--mine {
    align-self: flex-end;
    align-items: flex-end;
    max-width: min(88%, 30rem);
}

.chat-thread-card .chat-bubble-inner,
.support-chat-card .chat-bubble-inner {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.chat-thread-card .chat-bubble--mine .chat-bubble-inner,
.support-chat-card .chat-bubble--mine .chat-bubble-inner {
    align-items: flex-end;
}

.chat-bubble-head {
    margin-bottom: 0.12rem;
    padding: 0 0.25rem;
}

.chat-bubble-head .chat-sender-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray);
}

.chat-bubble--mine .chat-bubble-head {
    text-align: right;
}

.chat-bubble--mine .chat-bubble-head .chat-sender-name,
.chat-bubble--mine .chat-bubble-head .chat-sender-role,
.chat-bubble--mine .chat-bubble-head .text-muted {
    color: var(--gray) !important;
}

.chat-bubble-body {
    display: flex;
    flex-direction: column;
    align-items: inherit;
    gap: 0.35rem;
    width: auto;
    max-width: 100%;
    padding-right: 0;
}

.chat-bubble-text {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0 !important;
    padding: 0.48rem 0.95rem;
    border-radius: 999px;
    font-size: 0.875rem;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(212, 196, 176, 0.35);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.chat-bubble--mine .chat-bubble-text {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.chat-bubble--unread:not(.chat-bubble--mine) .chat-bubble-inner {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.chat-bubble--unread:not(.chat-bubble--mine) .chat-bubble-text {
    background: #fef3c7;
    border-color: rgba(217, 119, 6, 0.35);
}

.chat-reply-quote {
    border-radius: 10px;
    padding: 0.35rem 0.65rem;
    align-self: stretch;
    max-width: 100%;
}

.chat-msg-foot {
    margin-top: 0.1rem;
    padding: 0 0.25rem;
}

.chat-thread-card,
.support-chat-card {
    background: var(--surface-glass) !important;
}

.chat-thread-card .card-body,
.support-chat-card .card-body {
    background: transparent !important;
}

[data-theme="dark"] .chat-thread-card,
[data-theme="dark"] .support-chat-card,
[data-theme="dark"] .list-group-item-action {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .chat-bubble-text {
    background: rgba(51, 65, 85, 0.88) !important;
    border-color: #64748b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .chat-bubble-head .chat-sender-name,
[data-theme="dark"] .chat-bubble-head .chat-sender-role,
[data-theme="dark"] .chat-bubble-head .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .chat-bubble--mine .chat-bubble-text {
    background: var(--primary) !important;
    color: #fff !important;
    border: none !important;
}

[data-theme="dark"] .chat-bubble--unread:not(.chat-bubble--mine) .chat-bubble-text {
    background: rgba(232, 160, 84, 0.18) !important;
    border-color: rgba(232, 160, 84, 0.45) !important;
}

[data-theme="dark"] .chat-compose-input {
    color: #f1f5f9 !important;
}

/* Михалыч: мессенджер + оранжевый акцент */
.foreman-panel-header {
    background: linear-gradient(135deg, #92400e 0%, var(--primary) 100%) !important;
}

.foreman-panel {
    border-radius: 1.1rem !important;
    overflow: hidden;
}

.foreman-messages {
    background: #faf8f5;
    gap: 0.55rem;
    padding: 0.75rem;
}

.foreman-msg {
    align-items: flex-end;
}

.foreman-msg-assistant {
    align-items: flex-start;
}

.foreman-msg-user {
    flex-direction: row-reverse;
}

.foreman-msg-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: min(88%, 30rem);
}

.foreman-msg-user .foreman-msg-body {
    align-items: flex-end;
}

.foreman-bubble {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.52rem 0.95rem;
    font-size: 0.8125rem;
    line-height: 1.48;
}

.foreman-msg-assistant .foreman-bubble {
    background: #fff;
    border: 1px solid rgba(212, 196, 176, 0.45);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.foreman-msg-user .foreman-bubble {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.foreman-msg-meta,
.foreman-msg-meta .small {
    color: #64748b !important;
    font-size: 0.72rem;
    margin-bottom: 0.12rem;
    padding: 0 0.25rem;
}

.foreman-panel-form,
.foreman-panel-footer,
.page-mikhalych-chat .foreman-thread-compose {
    background: rgba(255, 255, 255, 0.92) !important;
    border-top: 1px solid var(--line) !important;
    border-left: none !important;
    border-right: none !important;
    padding: 0.65rem 0.75rem !important;
}

.foreman-panel-form--thread,
.page-mikhalych-chat .foreman-panel-form--thread {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.foreman-compose {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.foreman-compose-input {
    border-radius: 999px !important;
    background: #fff !important;
    color: #0f172a !important;
    border-color: rgba(212, 196, 176, 0.55) !important;
    font-size: 0.8125rem;
    min-height: 2.35rem;
}

.foreman-compose-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
}

.foreman-compose-input::placeholder {
    color: #94a3b8;
}

.foreman-compose-send {
    border-radius: 999px !important;
    min-width: var(--btn-height-sm) !important;
    min-height: var(--btn-height-sm) !important;
}

.page-mikhalych-chat .foreman-thread-messages {
    background: rgba(250, 248, 245, 0.72);
}

/* Михалыч: тёмная тема */
[data-theme="dark"] .foreman-messages,
[data-theme="dark"] .page-mikhalych-chat .foreman-thread-messages {
    background: rgba(15, 23, 42, 0.55);
}

[data-theme="dark"] .foreman-msg-assistant .foreman-bubble,
[data-theme="dark"] .page-mikhalych-chat .foreman-msg-assistant .foreman-bubble {
    background: rgba(51, 65, 85, 0.88) !important;
    border-color: #64748b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .foreman-msg-user .foreman-bubble,
[data-theme="dark"] .page-mikhalych-chat .foreman-msg-user .foreman-bubble {
    background: var(--primary) !important;
    color: #fff !important;
}

[data-theme="dark"] .foreman-msg-meta,
[data-theme="dark"] .foreman-msg-meta .small,
[data-theme="dark"] .foreman-msg-time {
    color: #94a3b8 !important;
}

[data-theme="dark"] .foreman-panel-form,
[data-theme="dark"] .foreman-panel-footer,
[data-theme="dark"] .foreman-compose,
[data-theme="dark"] .page-mikhalych-chat .foreman-thread-compose {
    background: rgba(15, 23, 42, 0.55) !important;
    border-top-color: rgba(71, 85, 105, 0.45) !important;
}

[data-theme="dark"] .foreman-compose-input {
    background: rgba(15, 23, 42, 0.55) !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

[data-theme="dark"] .foreman-panel-header {
    background: linear-gradient(135deg, #78350f 0%, #b45309 100%) !important;
}

[data-theme="dark"] .guest-mikhalych-home .foreman-msg-assistant .foreman-bubble {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .foreman-panel-alert {
    background: rgba(232, 160, 84, 0.15) !important;
    color: #e8c9a0 !important;
}

.page-mikhalych-chat .foreman-msg-user .foreman-bubble {
    background: var(--primary) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2) !important;
}

.chat-compose-send,
.page-mikhalych-chat .foreman-compose-send {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.chat-compose-send:hover,
.page-mikhalych-chat .foreman-compose-send:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.chat-compose-input:focus,
.page-mikhalych-chat .foreman-compose-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1) !important;
}

/* ——— v2.3: бейджи, кнопки, теги, футер, виджет ——— */

/* Центрирование текста во всех кнопках */
.btn:not(.btn-close):not(.btn-link) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    gap: 0.35rem;
}

/* Счётчик уведомлений и диалогов — оранжевый, не синий */
.notify-badge,
.notify-badge--bell,
.nav-chat-badge {
    background: var(--primary) !important;
    color: #fff !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 1.1rem;
    padding: 0.12rem 0.35rem;
}

/* Кнопки «Назад» — отдельный контрастный стиль навигации */
.btn-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    background: var(--btn-back-bg) !important;
    color: var(--btn-back-color) !important;
    border-color: var(--btn-back-border) !important;
    box-shadow: none !important;
}

.btn-back:hover,
.btn-back:focus-visible {
    background: var(--btn-back-hover-bg) !important;
    color: var(--btn-back-hover-color) !important;
    border-color: var(--btn-back-hover-border) !important;
}

/* Тёмная тема: приглушённые поверхности (токены --surface-border*) */
[data-theme="dark"] .card,
[data-theme="dark"] .content-panel,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .chat-list-item,
[data-theme="dark"] .home-guest-hero__content,
[data-theme="dark"] .home-guest-hero__panel,
[data-theme="dark"] .home-role-card,
[data-theme="dark"] .home-mikhalych-band,
[data-theme="dark"] .home-demo-board,
[data-theme="dark"] .home-demo-card,
[data-theme="dark"] .home-open-tenders,
[data-theme="dark"] .home-tender-card,
[data-theme="dark"] .home-action-panel,
[data-theme="dark"] .home-info-grid > article,
[data-theme="dark"] .home-faq-grid > article,
[data-theme="dark"] .home-dashboard-stat,
[data-theme="dark"] .home-trust-strip > div,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .tender-card,
[data-theme="dark"] .directory-card,
[data-theme="dark"] .mobile-data-card,
[data-theme="dark"] .scope-card,
[data-theme="dark"] .roles-strip .role-card,
[data-theme="dark"] .features-grid .feature-card,
[data-theme="dark"] .site-table-wrap,
[data-theme="dark"] .site-list-filters,
[data-theme="dark"] .table-scroll,
[data-theme="dark"] .table-scroll .site-data-table,
[data-theme="dark"] .foreman-panel,
[data-theme="dark"] .notify-drawer__panel,
[data-theme="dark"] .chat-thread-card,
[data-theme="dark"] .support-chat-card {
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface) !important;
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .project-card:hover,
[data-theme="dark"] .home-tender-card:hover,
[data-theme="dark"] .roles-strip .role-card:hover,
[data-theme="dark"] .features-grid .feature-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-surface-hover) !important;
    border-color: var(--surface-border-strong) !important;
}

.home-tender-card:hover {
    border-color: rgba(217, 119, 6, 0.35) !important;
}

[data-theme="dark"] .home-tender-card:hover {
    border-color: rgba(232, 160, 84, 0.28) !important;
}

[data-theme="dark"] .site-data-table thead th,
[data-theme="dark"] .table thead th {
    background: var(--surface-raised) !important;
    color: var(--dark) !important;
    border-bottom-color: var(--line) !important;
}

[data-theme="dark"] .site-data-table td,
[data-theme="dark"] .site-data-table th,
[data-theme="dark"] .site-table-wrap .table > :not(caption) > * > *,
[data-theme="dark"] .table-scroll .table > :not(caption) > * > * {
    border-color: var(--line) !important;
}

[data-theme="dark"] .site-table-wrap .site-data-table,
[data-theme="dark"] .table-scroll .site-data-table {
    background: transparent !important;
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-body);
    --bs-table-border-color: rgba(71, 85, 105, 0.22);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.35);
    --bs-table-hover-bg: transparent;
    --bs-table-active-bg: transparent;
}

[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--text-body);
}

[data-theme="dark"] .table thead.table-light > tr > th,
[data-theme="dark"] .table thead.table-light > tr > td,
[data-theme="dark"] .table tfoot.table-light > tr > th,
[data-theme="dark"] .table tfoot.table-light > tr > td,
[data-theme="dark"] .table > thead > tr > th,
[data-theme="dark"] .table > tfoot > tr > th,
[data-theme="dark"] .table > tfoot > tr > td {
    background-color: rgba(51, 65, 85, 0.55) !important;
    color: #e8edf4 !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] tr.table-success > td,
[data-theme="dark"] tr.table-success > th {
    background-color: rgba(16, 185, 129, 0.14) !important;
    color: #d1fae5 !important;
}

[data-theme="dark"] .list-group-item-success {
    background: rgba(16, 185, 129, 0.14) !important;
    color: var(--text-body) !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
}

[data-theme="dark"] .badge.bg-light.text-dark {
    background: rgba(148, 163, 184, 0.22) !important;
    color: #e8edf4 !important;
}

[data-theme="dark"] .project-list-row:hover,
[data-theme="dark"] .tenders-hub-row:hover,
[data-theme="dark"] .site-clickable-row:hover {
    --bs-table-accent-bg: transparent;
    background-color: transparent !important;
}

/* Теги ролей и типов — адаптируются к теме */
.badge-object-type,
.directory-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
    border: 1px solid rgba(217, 119, 6, 0.18) !important;
    font-weight: 600;
    line-height: 1.2;
}

[data-theme="dark"] .badge-object-type,
[data-theme="dark"] .directory-role-badge {
    background: rgba(232, 160, 84, 0.12) !important;
    color: #f0d4a8 !important;
    border-color: rgba(232, 160, 84, 0.22) !important;
}

/* Пагинация — см. PAGINATION SYSTEM в CANONICAL OVERRIDES */

/* Уведомления: выровненные кнопки */
.notify-drawer__toolbar {
    align-items: center;
}

.notify-drawer__toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.notify-item__actions {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

.notify-item__actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--btn-height-sm) !important;
    min-width: var(--btn-height-sm);
    line-height: 1;
    padding: 0.3rem 0.65rem !important;
}

.notify-item__actions .notify-mark-read {
    padding: 0.25rem !important;
}

.notify-item--unread {
    background: var(--primary-soft) !important;
    border-color: rgba(217, 119, 6, 0.18) !important;
}

[data-theme="dark"] .notify-item--unread {
    background: rgba(232, 160, 84, 0.1) !important;
    border-color: rgba(232, 160, 84, 0.22) !important;
}

/* Мобильная нижняя навигация: без дублирующего футера */
.site-body--bottom-nav {
    padding-bottom: 0 !important;
}

.site-body--bottom-nav .site-main {
    padding-bottom: 0.5rem !important;
}

@media (max-width: 991.98px) {
    .site-body--bottom-nav .site-footer {
        display: none !important;
    }

    .site-body--bottom-nav .site-main {
        padding-bottom: calc(3.1rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .page-mikhalych-chat .mikhalych-thread-card {
        height: min(78dvh, calc(100dvh - 4.75rem - env(safe-area-inset-bottom, 0px)));
        max-height: min(78dvh, calc(100dvh - 4.75rem - env(safe-area-inset-bottom, 0px)));
    }
}

.site-body:not(.site-body--bottom-nav) .site-footer {
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px)) !important;
}

/* Виджет Михалыча — стиль зависит от темы */
.foreman-fab {
    background: linear-gradient(135deg, #fef3c7 0%, var(--primary) 100%) !important;
    color: #1e293b !important;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.22) !important;
    border: 1px solid rgba(217, 119, 6, 0.15) !important;
}

.foreman-fab-label {
    line-height: 1.2;
}

[data-theme="dark"] .foreman-fab {
    background: linear-gradient(135deg, rgba(232, 160, 84, 0.92) 0%, rgba(180, 83, 9, 0.95) 100%) !important;
    color: #fff !important;
    border-color: rgba(232, 160, 84, 0.25) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32) !important;
}

[data-theme="dark"] .foreman-fab-label {
    color: #fff !important;
}


.foreman-widget-root:not(.foreman-widget-root--dragging) .foreman-fab:hover {
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.26) !important;
}

[data-theme="dark"] .hero-subtitle {
    color: #e8c9a0 !important;
}

[data-theme="dark"] .btn-outline-primary {
    color: #e8c9a0 !important;
    border-color: rgba(232, 160, 84, 0.35) !important;
}

[data-theme="dark"] .site-bottom-nav__item--active {
    color: var(--primary) !important;
    background: var(--primary-soft) !important;
}

/* ——— Лендинг / публичные блоки (светлая тема, v2-токены) ——— */
.hero-badge--apt {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.hero-badge--house {
    background: #ffedd5;
    color: #c2410c;
}

/* Hero: фото дом / квартира — вписаны в glass-панель, светлая и тёмная тема */
.hero-split .row {
    align-items: stretch;
}

.hero-visual-panel {
    width: 100%;
    padding: 0.65rem;
    border-radius: var(--border-radius-lg);
    background: var(--surface-glass-strong);
    border: 1px solid var(--surface-border-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-surface);
}

.hero-split .hero-visual-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 100%;
}

.hero-split .hero-visual-card {
    position: relative;
    height: 100%;
    min-height: 11.5rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--surface-border-strong);
    background: var(--icon-tile-bg, rgba(15, 23, 42, 0.06));
    box-shadow: none;
    aspect-ratio: 4 / 5;
}

.hero-visual-card__media {
    position: absolute;
    inset: 0;
}

.hero-visual-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 42%,
        rgba(15, 23, 42, 0.38) 100%
    );
    pointer-events: none;
}

.hero-split .hero-visual-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.88) brightness(0.96);
}

.hero-split .hero-visual-label {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-heading);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--surface-border-strong);
}

.hero-split .hero-visual-label .icon {
    color: currentColor;
}

@media (min-width: 992px) {
    .hero-visual-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100%;
        padding: 0.85rem;
    }

    .hero-split .hero-visual-duo {
        min-height: 18rem;
        grid-auto-rows: 1fr;
    }

    .hero-split .hero-visual-card {
        min-height: 0;
        aspect-ratio: auto;
    }
}

[data-theme="dark"] .hero-visual-panel {
    background: var(--surface-glass);
    box-shadow: var(--shadow-surface);
}

[data-theme="dark"] .hero-visual-card__media::after {
    background: linear-gradient(
        165deg,
        rgba(15, 23, 42, 0.2) 0%,
        transparent 38%,
        rgba(15, 23, 42, 0.78) 100%
    );
}

[data-theme="dark"] .hero-split .hero-visual-card img {
    filter: brightness(0.78) saturate(0.72) contrast(1.04);
}

[data-theme="dark"] .hero-split .hero-visual-label {
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-heading);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .hero-badge--house {
    background: rgba(217, 119, 6, 0.18);
    color: #fbbf24;
}

[data-theme="dark"] .hero-badge--apt {
    background: rgba(100, 116, 139, 0.22);
    color: #cbd5e1;
}

.hero-cta-row .hero-cta-primary {
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.calculator-section .calc-tab-btn.active,
.calculator-section .calc-tab-btn.active:hover {
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.28);
}

.features-grid .feature-card {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
}

.tender-card-header {
    background: var(--tender-header-gradient);
    color: #fff;
    border: none;
}

.tender-row-best {
    background: var(--primary-soft);
}

.progress-bar {
    width: var(--progress, 0%);
}

.foreman-icon {
    color: var(--primary);
}

.foreman-icon__jacket-top {
    color: var(--primary-dark);
}

/* ——— Skeleton списков (SSR: контент уже в HTML, pane скрыт) ——— */
[data-table-list-skeleton] .table-list-skeleton-pane {
    display: none !important;
}

.table-skeleton {
    display: grid;
    gap: 0.55rem;
}

.table-skeleton__row {
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.06) 0%,
        rgba(15, 23, 42, 0.1) 50%,
        rgba(15, 23, 42, 0.06) 100%
    );
    background-size: 200% 100%;
    animation: table-skeleton-shimmer 1.2s linear infinite;
}

@keyframes table-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] .table-skeleton__row {
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0.08) 0%,
        rgba(148, 163, 184, 0.16) 50%,
        rgba(148, 163, 184, 0.08) 100%
    );
    background-size: 200% 100%;
}

@media (prefers-reduced-motion: reduce) {
    .table-skeleton__row {
        animation: none;
    }
}

/* ===================================================================
   BUTTON DESIGN SYSTEM — единый стандарт (канонический слой)
   Все .btn на сайте наследуют эти параметры. Перекрывает legacy 44/48px.
   =================================================================== */

.site-body .btn:not(.btn-close):not(.btn-link),
.site-body a.btn:not(.btn-close):not(.btn-link),
.site-body button.btn:not(.btn-close):not(.btn-link) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem;
    line-height: 1 !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--btn-radius) !important;
    border-width: 1px;
    box-shadow: none !important;
    transform: none !important;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.site-body .btn .icon,
.site-body .btn > svg {
    flex-shrink: 0;
    align-self: center;
    vertical-align: 0;
    margin: 0;
    display: block;
    width: auto;
    height: auto;
}

.site-body .btn .btn__glyph,
.site-body .btn .btn__text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.site-body .btn .btn__glyph .icon,
.site-body .btn .btn__glyph > svg {
    display: block;
    flex-shrink: 0;
}

/* Размеры — вертикальное выравнивание через flex + min-height, без padding по Y */
.site-body .btn:not(.btn-sm):not(.btn-xs):not(.btn-lg):not(.btn-close):not(.btn-link),
.site-body a.btn:not(.btn-sm):not(.btn-xs):not(.btn-lg) {
    min-height: var(--btn-height) !important;
    padding: 0 0.95rem !important;
    font-size: 0.875rem !important;
}

.site-body .btn-sm:not(.btn-close):not(.btn-link),
.site-body a.btn.btn-sm {
    min-height: var(--btn-height-sm) !important;
    padding: 0 0.75rem !important;
    font-size: 0.8125rem !important;
}

.site-body .btn-xs:not(.btn-close):not(.btn-link) {
    min-height: var(--btn-height-xs) !important;
    padding: 0 0.6rem !important;
    font-size: 0.75rem !important;
}

.site-body .btn-lg:not(.btn-close):not(.btn-link) {
    min-height: var(--btn-height-lg) !important;
    padding: 0 1.15rem !important;
    font-size: 0.9375rem !important;
}

/* Icon-only */
.site-body .btn-icon-action,
.site-body .btn-icon-only {
    min-width: var(--btn-icon-size) !important;
    min-height: var(--btn-icon-size) !important;
    max-width: var(--btn-icon-size);
    max-height: var(--btn-icon-size);
    padding: 0.25rem !important;
}

/* Варианты */
.site-body .btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.site-body .btn-primary:hover,
.site-body .btn-primary:focus,
.site-body .btn-primary:focus-visible {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff !important;
}

.site-body .btn-outline-primary {
    color: var(--primary) !important;
    border-color: rgba(217, 119, 6, 0.32) !important;
    background: rgba(255, 255, 255, 0.88) !important;
}

.site-body .btn-outline-primary:hover,
.site-body .btn-outline-primary:focus-visible {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
}

.site-body .btn-outline-secondary {
    color: var(--gray) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    background: rgba(255, 255, 255, 0.88) !important;
}

.site-body .btn-back {
    color: var(--btn-back-color) !important;
    border-color: var(--btn-back-border) !important;
    background: var(--btn-back-bg) !important;
    font-weight: 600 !important;
}

.site-body .btn-outline-secondary:hover,
.site-body .btn-outline-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.98) !important;
    color: var(--dark) !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
}

.site-body .btn-back:hover,
.site-body .btn-back:focus-visible {
    background: var(--btn-back-hover-bg) !important;
    color: var(--btn-back-hover-color) !important;
    border-color: var(--btn-back-hover-border) !important;
}

.site-body .btn-outline-info,
.site-body .btn-outline-success,
.site-body .btn-outline-warning {
    color: var(--gray) !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.72) !important;
}

.site-body .btn-outline-info:hover,
.site-body .btn-outline-info:focus-visible,
.site-body .btn-outline-success:hover,
.site-body .btn-outline-success:focus-visible,
.site-body .btn-outline-warning:hover,
.site-body .btn-outline-warning:focus-visible {
    color: var(--primary-dark) !important;
    border-color: rgba(217, 119, 6, 0.28) !important;
    background: var(--primary-soft) !important;
}

.site-body .btn-success {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.site-body .btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

.site-body .btn-warning {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.site-body .btn-danger {
    border-width: 1px;
}

.site-body .btn-link {
    font-weight: 600;
    min-height: auto !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Toolbars — одна высота */
.site-body .projects-page-toolbar .btn,
.site-body .tenders-hub-toolbar .btn,
.site-body .tenders-hub-page-toolbar .btn,
.site-body .chats-page-toolbar .btn,
.site-body .projects-page-toolbar__actions .btn,
.site-body .chats-page-toolbar__actions .btn,
.site-body #projects-edit-toolbar .btn,
.site-body #tenders-edit-toolbar .btn,
.site-body #chats-edit-toolbar .btn,
.site-body #stages-edit-toolbar .btn,
.site-body #chat-msg-edit-toolbar .btn,
.site-body .hero-cta-row .btn,
.site-body .landing-mikhalych-fold__actions .btn,
.site-body .home-action-panel__buttons .btn,
.site-body .home-guest-actions .btn,
.site-body .project-detail-actions .btn,
.site-body .foreman-thread-header__actions .btn,
.site-body .foreman-guest-cta .btn,
.site-body .foreman-task-panel__actions .btn,
.site-body .foreman-page-toolbar .btn,
.site-body .chat-list-actions .btn,
.site-body .page-back-nav .btn,
.site-body .notify-drawer__toolbar .btn,
.site-body .notify-item__actions .btn,
.site-body .scope-card .btn,
.site-body .calc-result-box .btn,
.site-body .flow-empty-state .btn,
.site-body .site-col-filter-popover__actions .btn {
    min-height: var(--btn-height-sm) !important;
}

.site-body .touch-target:not(.btn-close):not(.btn-link):not(.btn-icon-action) {
    min-height: var(--btn-height-sm) !important;
}

/* Тёмная тема — кнопки */
[data-theme="dark"] .site-body .btn-outline-primary {
    color: #e8c9a0 !important;
    border-color: rgba(232, 160, 84, 0.35) !important;
    background: rgba(15, 23, 42, 0.45) !important;
}

[data-theme="dark"] .site-body .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(30, 41, 59, 0.72) !important;
}

[data-theme="dark"] .site-body .btn-back {
    color: var(--btn-back-color) !important;
    border-color: var(--btn-back-border) !important;
    background: var(--btn-back-bg) !important;
}

[data-theme="dark"] .site-body .btn-outline-secondary:hover,
[data-theme="dark"] .site-body .btn-outline-secondary:focus-visible {
    background: rgba(39, 52, 73, 0.88) !important;
    color: #f8fafc !important;
    border-color: rgba(100, 116, 139, 0.5) !important;
}

[data-theme="dark"] .site-body .btn-back:hover,
[data-theme="dark"] .site-body .btn-back:focus-visible {
    background: var(--btn-back-hover-bg) !important;
    color: var(--btn-back-hover-color) !important;
    border-color: var(--btn-back-hover-border) !important;
}

[data-theme="dark"] .site-body .btn-outline-primary:hover {
    background: rgba(232, 160, 84, 0.12) !important;
    color: #f0d4a8 !important;
}

[data-theme="dark"] .site-body .btn-outline-info,
[data-theme="dark"] .site-body .btn-outline-success,
[data-theme="dark"] .site-body .btn-outline-warning {
    color: #94a3b8 !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(15, 23, 42, 0.4) !important;
}

[data-theme="dark"] .site-body .btn-outline-info:hover,
[data-theme="dark"] .site-body .btn-outline-success:hover,
[data-theme="dark"] .site-body .btn-outline-warning:hover {
    color: #f0d4a8 !important;
    border-color: rgba(232, 160, 84, 0.24) !important;
    background: rgba(232, 160, 84, 0.1) !important;
}

/* Специальные: role-pick, directory filters — pill как кнопки */
.site-body .directory-role-group .directory-role-btn {
    min-height: var(--btn-height-sm) !important;
    border-radius: var(--btn-radius) !important;
    font-size: 0.8125rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.site-body .directory-role-group .btn-check:checked + .directory-role-btn {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* Pagination — см. PAGINATION SYSTEM */

/* ——— LANDING: контраст в тёмной теме ——— */
[data-theme="dark"] .landing-partner-pill {
    background: var(--surface-glass) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .landing-partner-pill__name,
[data-theme="dark"] a.landing-partner-pill,
[data-theme="dark"] a.landing-partner-pill:hover,
[data-theme="dark"] a.landing-partner-pill:focus-visible {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .feature-card__text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .calculator-section .calc-tabs {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid var(--surface-border-strong) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .calculator-section .calc-tab-btn:not(.active) {
    background: transparent !important;
    color: #cbd5e1 !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .calculator-section .calc-tab-btn:not(.active):hover {
    background: rgba(30, 41, 59, 0.55) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .calculator-section .calc-tab-btn.active,
[data-theme="dark"] .calculator-section .calc-tab-btn.active:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

[data-theme="dark"] .landing-reviews-carousel__nav {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--primary) !important;
}

[data-theme="dark"] .landing-review-card {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .landing-review-card__foot,
[data-theme="dark"] .landing-review-card__foot a {
    color: #94a3b8 !important;
}

[data-theme="dark"] .landing-review-card__foot a:hover {
    color: var(--primary) !important;
}

[data-theme="dark"] .landing-reviews-dot {
    background: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .landing-reviews-dot--active {
    background: var(--primary);
}

[data-theme="dark"] .calc-card,
[data-theme="dark"] .calc-card .card-header {
    border-color: var(--surface-border-strong) !important;
}

/* ===================================================================
   TYPOGRAPHY SYSTEM — цвета текста только через токены
   =================================================================== */

.site-body,
.site-main,
.card-body,
.card-body p {
    color: var(--text-body);
}

.site-main h1,
.site-main h2,
.site-main h3,
.site-main h4,
.site-main h5,
.site-main h6,
.site-main .h1,
.site-main .h2,
.site-main .h3,
.site-main .h4,
.site-main .h5,
.site-main .h6,
.flow-screen-head h2,
.card-header,
.card-body > :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6),
.form-label,
label.form-label,
span.form-label,
legend,
.progress-block__head .form-label,
.site-list-filters__grid .form-label {
    color: var(--text-label);
}

.site-main strong,
.site-main .fw-semibold,
.site-main .fw-bold,
.card-body strong {
    color: var(--text-heading);
}

.site-main .text-muted,
.site-main small.text-muted,
.site-main .card-body .text-muted,
.site-main p.text-muted,
.text-muted,
.form-text,
small.text-muted {
    color: var(--text-muted-accessible) !important;
}

.site-main small:not(.text-muted),
.card-body small:not(.text-muted) {
    color: var(--text-body);
}

/* ===================================================================
   PROGRESS BLOCK — процент снаружи полосы
   =================================================================== */

.progress-block + .progress-block,
.progress-block {
    margin-bottom: 0.75rem;
}

.progress-block__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.progress-block__value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.progress-block__value--muted {
    color: var(--text-muted);
}

[data-theme="dark"] .progress {
    background: rgba(15, 23, 42, 0.55);
}

[data-theme="dark"] .progress-block__value--muted {
    color: var(--text-muted);
}

/* ===================================================================
   BADGES — тёмная тема (soft pills)
   =================================================================== */

[data-theme="dark"] .badge.bg-success,
[data-theme="dark"] .badge.text-bg-success {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge.bg-primary,
[data-theme="dark"] .badge.text-bg-primary {
    background: var(--primary-soft) !important;
    color: #f0d4a8 !important;
}

[data-theme="dark"] .badge.bg-secondary,
[data-theme="dark"] .badge.text-bg-secondary {
    background: rgba(100, 116, 139, 0.18) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.text-bg-warning {
    background: var(--primary-soft) !important;
    color: #f0d4a8 !important;
}

[data-theme="dark"] .badge.bg-danger,
[data-theme="dark"] .badge.text-bg-danger {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #fca5a5 !important;
}

/* ===================================================================
   ТАБЛИЦЫ — нейтральные action-кнопки, ссылки этапов
   =================================================================== */

.stage-pick-link {
    color: var(--text-heading);
    text-decoration: none;
    font-weight: 600;
}

.stage-pick-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

[data-theme="dark"] .stage-pick-link,
[data-theme="dark"] a.stage-pick-link {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .stage-pick-link:hover,
[data-theme="dark"] a.stage-pick-link:hover {
    color: var(--primary) !important;
}

.site-body .site-data-table .btn-icon-only,
.site-body .site-table-wrap .btn-icon-only,
.site-body .site-data-table .btn-outline-info.btn-sm,
.site-body .site-data-table .btn-outline-success.btn-sm,
.site-body .site-data-table .btn-outline-warning.btn-sm,
.site-body .site-data-table .btn-outline-primary.btn-icon-only {
    color: var(--gray) !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    box-shadow: none !important;
}

.site-body .site-data-table .btn-icon-only:hover,
.site-body .site-table-wrap .btn-icon-only:hover,
.site-body .site-data-table .btn-outline-info.btn-sm:hover,
.site-body .site-data-table .btn-outline-success.btn-sm:hover,
.site-body .site-data-table .btn-outline-warning.btn-sm:hover,
.site-body .site-data-table .btn-outline-primary.btn-icon-only:hover {
    color: var(--primary-dark) !important;
    border-color: rgba(217, 119, 6, 0.28) !important;
    background: var(--primary-soft) !important;
}

[data-theme="dark"] .site-body .site-data-table .btn-icon-only,
[data-theme="dark"] .site-body .site-table-wrap .btn-icon-only,
[data-theme="dark"] .site-body .site-data-table .btn-outline-info.btn-sm,
[data-theme="dark"] .site-body .site-data-table .btn-outline-success.btn-sm,
[data-theme="dark"] .site-body .site-data-table .btn-outline-warning.btn-sm,
[data-theme="dark"] .site-body .site-data-table .btn-outline-primary.btn-icon-only {
    color: #94a3b8 !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(15, 23, 42, 0.35) !important;
}

[data-theme="dark"] .site-body .site-data-table .btn-icon-only:hover,
[data-theme="dark"] .site-body .site-table-wrap .btn-icon-only:hover,
[data-theme="dark"] .site-body .site-data-table .btn-outline-info.btn-sm:hover,
[data-theme="dark"] .site-body .site-data-table .btn-outline-success.btn-sm:hover,
[data-theme="dark"] .site-body .site-data-table .btn-outline-warning.btn-sm:hover,
[data-theme="dark"] .site-body .site-data-table .btn-outline-primary.btn-icon-only:hover {
    color: #f0d4a8 !important;
    border-color: rgba(232, 160, 84, 0.24) !important;
    background: rgba(232, 160, 84, 0.1) !important;
}

.site-data-table .form-select-sm,
.stage-payment-quick .form-select {
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.8125rem;
    min-height: var(--btn-height-sm);
}

[data-theme="dark"] .site-data-table .form-select-sm,
[data-theme="dark"] .stage-payment-quick .form-select {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--dark) !important;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] tr.table-light,
[data-theme="dark"] tr.table-light > * {
    --bs-table-bg: rgba(15, 23, 42, 0.22);
    --bs-table-color: var(--dark);
    background-color: rgba(15, 23, 42, 0.22) !important;
    color: var(--dark) !important;
}

.site-body .site-data-table .btn-outline-secondary.btn-sm {
    color: var(--gray) !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .site-body .site-data-table .btn-outline-secondary.btn-sm {
    color: #94a3b8 !important;
    border-color: var(--surface-border-strong) !important;
    background: rgba(15, 23, 42, 0.35) !important;
}

/* Кнопка отчёта PDF — компактная, без растягивания */
.project-report-btn {
    flex: 0 0 auto !important;
    align-self: flex-start;
}

/* Счётчик тендеров — иконка + цифра без pill-фона */
.stage-tender-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.stage-tender-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.stage-tender-link .icon {
    flex-shrink: 0;
}

.stage-tender-count {
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stage-tender-link--mobile {
    font-size: 0.875rem;
}

[data-theme="dark"] .stage-tender-link {
    color: #94a3b8;
}

[data-theme="dark"] .stage-tender-link:hover {
    color: var(--primary);
}

[data-theme="dark"] .stage-tender-count {
    color: #cbd5e1;
}

/* ===================================================================
   ТАБЛИЦА ЭТАПОВ — лаконичное выделение (размеры — COMPACT TABLE SYSTEM)
   =================================================================== */

#project-stages-page .stage-row.table-light > td {
    background-color: rgba(15, 23, 42, 0.025) !important;
}

[data-theme="dark"] #project-stages-page .stage-row.table-light > td {
    background-color: rgba(15, 23, 42, 0.12) !important;
}

/* Без заливки — только тонкий акцент слева */
#project-stages-page .site-data-table {
    --bs-table-hover-bg: transparent;
    --bs-table-active-bg: transparent;
}

#project-stages-page .site-data-table tbody .stage-row {
    --bs-table-accent-bg: transparent;
    background-color: transparent !important;
}

#project-stages-page .site-data-table tbody .stage-row > td {
    background-color: transparent !important;
    transition: box-shadow 0.12s ease;
}

#project-stages-page .table tbody tr.stage-row:hover {
    background-color: transparent !important;
}

#project-stages-page .site-data-table.table-hover tbody .stage-row:hover > *,
#project-stages-page .site-data-table tbody .stage-row.table-active > * {
    --bs-table-bg-state: transparent !important;
    --bs-table-color-state: inherit;
    background-color: transparent !important;
    box-shadow: none;
}

#project-stages-page .site-data-table tbody .stage-row:hover > td:first-child,
#project-stages-page .site-data-table tbody .stage-row.table-active > td:first-child {
    box-shadow: inset 2px 0 0 var(--primary);
}

#project-stages-page.project-stages-editing .stage-row.table-active > td:first-child {
    box-shadow: inset 3px 0 0 var(--primary);
}

#project-stages-page.project-stages-editing .stage-row.table-active {
    border-color: transparent !important;
    box-shadow: none !important;
}

/* ===================================================================
   ТАБЛИЦА ПРОЕКТОВ — выделение выбранных строк
   =================================================================== */

#projects-page .site-data-table {
    --bs-table-hover-bg: transparent;
    --bs-table-active-bg: transparent;
}

#projects-page .site-data-table tbody .project-list-row > td {
    background-color: transparent !important;
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

#projects-page .site-data-table tbody .project-list-row:hover > td {
    background-color: var(--table-row-hover-bg, rgba(15, 23, 42, 0.03)) !important;
}

#projects-page .site-data-table tbody .project-list-row:hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--primary);
}

#projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td,
#projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td {
    background-color: var(--primary-soft) !important;
    --bs-table-bg-state: var(--primary-soft) !important;
}

#projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td:first-child,
#projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td:first-child {
    box-shadow: inset 4px 0 0 var(--primary);
}

#projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td,
#projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td {
    border-top-color: rgba(217, 119, 6, 0.22) !important;
    border-bottom-color: rgba(217, 119, 6, 0.22) !important;
}

[data-theme="dark"] #projects-page .site-data-table tbody .project-list-row:hover > td {
    background-color: rgba(148, 163, 184, 0.08) !important;
}

[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td {
    background-color: rgba(232, 160, 84, 0.16) !important;
    color: var(--text-primary, #f1f5f9) !important;
}

[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td:first-child,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td:first-child {
    box-shadow: inset 4px 0 0 var(--primary);
}

[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td {
    border-top-color: rgba(232, 160, 84, 0.28) !important;
    border-bottom-color: rgba(232, 160, 84, 0.28) !important;
}

#projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td.text-muted,
#projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td .text-muted,
#projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td.text-muted,
#projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td .text-muted {
    color: var(--text-body) !important;
}

[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td.text-muted,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.is-selected > td .text-muted,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td.text-muted,
[data-theme="dark"] #projects-page.projects-editing .site-data-table tbody .project-list-row.table-active > td .text-muted {
    color: var(--text-heading, #f1f5f9) !important;
}

#projects-page .projects-table.site-table--fixed th.site-col--date,
#projects-page .projects-table.site-table--fixed th.site-col--budget,
#projects-page .projects-table.site-table--fixed td.site-col--date,
#projects-page .projects-table.site-table--fixed td.site-col--budget {
    white-space: nowrap;
}

/* ===================================================================
   CANONICAL OVERRIDES — единый слой поверх legacy style.css / theme-dark.css
   Все компоненты .site-body используют только токены v2.
   =================================================================== */

.site-col--pick { width: 2.5rem; }
.site-col--num { width: 3rem; }
.site-col--name { width: 14%; }
.site-col--address { width: 26%; }
.site-col--type { width: 11.5rem; }
.site-col--date { width: 5.75rem; }
.site-col--budget { width: 6.75rem; }
.site-col--actions-md { min-width: 10rem; }
.form-select--payment { min-width: 7.5rem; }
.form-control--w-8 { max-width: 8rem; }
.form-control--w-12 { max-width: 120px; }
.form-control--w-lg { max-width: 280px; }
.text-truncate--desc { max-width: 280px; }
.flex-min-12 { min-width: 12rem; }
.photo-thumb--sm { max-height: 120px; }
.photo-thumb--md { max-height: 150px; }
.hero-feature-icon { opacity: 1; }

/* Аватары — без светлой обводки */
.site-body .user-avatar--img {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

[data-theme="dark"] .site-body .user-avatar--img {
    border: none !important;
    box-shadow: none !important;
}

/* --- Таблицы --- */
.site-body .table {
    background: transparent !important;
    box-shadow: none !important;
}

.site-body .table thead th {
    background: rgba(248, 250, 252, 0.55) !important;
    border-bottom-color: var(--surface-border-strong) !important;
    color: var(--text-label) !important;
}

.site-body .table tbody tr:hover {
    background-color: var(--table-row-hover-bg, transparent) !important;
}

.site-body .table.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: var(--table-row-hover-bg, transparent) !important;
    background-color: var(--table-row-hover-bg, transparent) !important;
}

.site-body .project-list-row:hover > td:first-child,
.site-body .tenders-hub-row:hover > td:first-child,
.site-body .site-clickable-row:hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--primary);
}

[data-theme="dark"] .site-body .table {
    --bs-table-hover-bg: transparent;
    --bs-table-active-bg: transparent;
}

[data-theme="dark"] .site-body .table thead th {
    background: var(--surface-raised) !important;
}

[data-theme="dark"] .site-body .project-list-row:hover,
[data-theme="dark"] .site-body .tenders-hub-row:hover,
[data-theme="dark"] .site-body .site-clickable-row:hover {
    background-color: transparent !important;
}

/* --- Карточки --- */
.site-body .card {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface) !important;
}

.site-body .card:hover {
    transform: none !important;
}

.site-body .card-header {
    background: transparent !important;
    border-bottom-color: var(--line) !important;
    color: var(--text-heading) !important;
}

/* --- Формы --- */
.site-body .form-control,
.site-body .form-select {
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: var(--text-body) !important;
}

.site-body .form-control:focus,
.site-body .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
}

[data-theme="dark"] .site-body .form-control,
[data-theme="dark"] .site-body .form-select {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--text-body) !important;
}

[data-theme="dark"] .site-body .form-control::placeholder,
[data-theme="dark"] .site-body .form-select::placeholder {
    color: var(--input-placeholder) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .site-body .form-control:-webkit-autofill,
[data-theme="dark"] .site-body .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.55) inset !important;
    -webkit-text-fill-color: var(--text-body) !important;
    caret-color: var(--text-body);
}

/* --- Чат --- */
.site-body .chat-compose {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

.site-body .chat-compose-attach,
.site-body .chat-compose-send {
    width: var(--btn-icon-size) !important;
    height: var(--btn-icon-size) !important;
    min-width: var(--btn-icon-size) !important;
    min-height: var(--btn-icon-size) !important;
    max-width: var(--btn-icon-size);
    max-height: var(--btn-icon-size);
    border-color: var(--surface-border-strong) !important;
    background: rgba(255, 255, 255, 0.55) !important;
}

[data-theme="dark"] .site-body .chat-compose {
    background: var(--surface-glass) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .site-body .chat-compose-attach,
[data-theme="dark"] .site-body .chat-compose-attach--active,
[data-theme="dark"] .site-body .chat-compose-attach:hover {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .site-body .chat-compose-attach--active,
[data-theme="dark"] .site-body .chat-compose-attach:hover {
    background: var(--primary-soft) !important;
    border-color: rgba(232, 160, 84, 0.28) !important;
    color: var(--primary) !important;
}

[data-theme="dark"] .site-body .chat-compose-input {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--surface-border-strong) !important;
    color: var(--text-body) !important;
}

[data-theme="dark"] .site-body .chat-bubble--selected {
    outline-color: var(--primary) !important;
    background: var(--primary-soft) !important;
}

[data-theme="dark"] .site-body .chat-thread-header,
[data-theme="dark"] .site-body .support-chat-card,
[data-theme="dark"] .site-body .support-chat-card__footer,
[data-theme="dark"] .site-body .chat-pinned-strip {
    border-color: var(--surface-border-strong) !important;
}

/* --- Бейджи legacy --- */
.site-body .badge.bg-light.text-dark {
    background: var(--surface-raised) !important;
    color: var(--text-body) !important;
    border: 1px solid var(--surface-border-strong);
}

/* --- Фильтры / popover --- */
.site-body .site-col-filter-popover__panel {
    background: var(--surface-glass-strong) !important;
    border-color: var(--surface-border-strong) !important;
    box-shadow: var(--shadow-surface-hover) !important;
}

.site-body .site-col-filter-popover__title {
    color: var(--text-label) !important;
}

.site-body .site-list-filters {
    border-color: var(--surface-border-strong) !important;
    background: var(--surface-glass) !important;
}

.site-body .site-list-filters .row.align-items-end {
    align-items: flex-end;
}

.site-body .site-list-filters .form-label {
    margin-bottom: 0.25rem;
    color: var(--text-label);
}

.site-body .site-list-filters .form-control-sm,
.site-body .site-list-filters .form-select-sm {
    min-height: 34px;
}

.site-body .site-list-filters .btn-sm {
    min-height: 34px;
}

/* --- Pagination --- */
.site-body .site-list-pagination .pagination {
    gap: 0.25rem;
}

.site-body .site-list-pagination .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: var(--btn-height-sm) !important;
    min-height: var(--btn-height-sm) !important;
    padding: 0.25rem 0.55rem !important;
    line-height: 1 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    border-radius: var(--btn-radius) !important;
    background: var(--pagination-link-bg) !important;
    border-color: var(--pagination-link-border) !important;
    color: var(--pagination-link-color) !important;
    box-shadow: none !important;
}

.site-body .site-list-pagination .page-link:hover {
    background: var(--pagination-link-hover-bg) !important;
    border-color: rgba(217, 119, 6, 0.28) !important;
    color: var(--pagination-link-hover-color) !important;
}

.site-body .site-list-pagination .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.site-body .site-list-pagination .page-item.disabled .page-link {
    background: var(--pagination-link-bg) !important;
    border-color: var(--pagination-link-border) !important;
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.site-body .site-list-pagination__summary,
.site-body .site-list-pagination .site-list-pagination__summary {
    color: var(--pagination-summary-color) !important;
    font-size: 0.8125rem;
    font-weight: 500;
}

.site-body .site-list-pagination__summary strong {
    color: var(--text-heading);
    font-weight: 600;
}

/* ===================================================================
   COMPACT TABLE SYSTEM — все site-data-table на сайте
   =================================================================== */

.site-body .site-data-table {
    font-size: var(--table-font-size);
}

.site-body .site-data-table.site-table--fixed {
    table-layout: fixed;
    width: 100%;
}

.site-body .site-data-table tbody td {
    color: var(--text-body);
}

.site-body .site-data-table tbody td.fw-semibold,
.site-body .site-data-table tbody td .fw-semibold {
    color: var(--text-heading);
}

.site-cell-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}

.site-body .site-data-table .badge-object-type.site-cell-truncate {
    display: inline-block;
    vertical-align: middle;
}

.site-body .site-data-table td.site-col--name,
.site-body .site-data-table td.site-col--address,
.site-body .site-data-table td.site-col--type,
.site-body .site-data-table th.site-col--name,
.site-body .site-data-table th.site-col--address,
.site-body .site-data-table th.site-col--type {
    overflow: hidden;
}

.site-body .site-data-table thead th,
.site-body .site-table-wrap .site-data-table thead th,
.site-body .table-scroll .site-data-table thead th {
    padding: var(--table-head-py) var(--table-head-px) !important;
    font-size: var(--table-head-font-size) !important;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
}

.site-body .site-data-table thead th.site-col--actions,
.site-body .site-data-table tbody td.site-col--actions {
    text-align: right;
}

.site-body .site-data-table thead th.site-col--sort .site-th-sort__link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.site-body .site-data-table tbody td,
.site-body .site-data-table tbody th,
.site-body .site-table-wrap .site-data-table td,
.site-body .table-scroll .site-data-table td {
    padding: var(--table-cell-py) var(--table-cell-px) !important;
    font-size: var(--table-font-size);
    line-height: 1.3;
    vertical-align: middle;
}

.site-body .site-data-table .badge {
    padding: var(--table-badge-py) var(--table-badge-px);
    font-size: var(--table-badge-font);
    line-height: 1.2;
}

.site-body .site-data-table .btn-icon-only {
    min-width: var(--table-action-size) !important;
    min-height: var(--table-action-size) !important;
    max-width: var(--table-action-size);
    max-height: var(--table-action-size);
    padding: 0.1rem !important;
}

.site-body .site-data-table .btn-sm,
.site-body .site-data-table .btn-outline-secondary.btn-sm,
.site-body .site-data-table .btn-outline-primary.btn-sm {
    min-height: var(--table-action-size) !important;
    padding: 0.1rem 0.4rem !important;
    font-size: 0.75rem !important;
}

.site-body .site-data-table .form-select-sm,
.site-body .site-data-table .form-control-sm {
    min-height: var(--table-action-size);
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    font-size: 0.75rem;
}

.site-body .site-data-table .small.text-muted,
.site-body .site-data-table .stage-row .small.text-muted {
    font-size: 0.6875rem;
    margin-top: 0.05rem !important;
    line-height: 1.2;
}

.site-body .site-table-wrap,
.site-body .table-scroll {
    margin-bottom: var(--cabinet-section-gap);
}

.site-body .site-col-filter-btn__badge {
    font-size: 0.6rem;
    padding: 0 0.3rem;
}

/* ===================================================================
   CABINET DENSITY — .site-body--cabinet (авторизованная зона)
   =================================================================== */

.site-body--cabinet .site-container.py-3,
.site-body--cabinet .site-container.py-md-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 1rem !important;
}

.site-body--cabinet .flow-screen-head {
    margin-bottom: var(--cabinet-section-gap) !important;
}

.site-body--cabinet .flow-screen-head h2 {
    font-size: 1.125rem;
    margin-bottom: 0.15rem !important;
}

.site-body--cabinet .flow-screen-head p {
    font-size: 0.8125rem;
}

.site-body--cabinet .page-back-nav {
    margin-bottom: 0.65rem !important;
}

.site-body--cabinet .site-container > .btn-back {
    margin-bottom: 0.65rem;
}

.site-body--cabinet h3.mb-0 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.site-body--cabinet .card-body {
    padding: var(--cabinet-card-py) var(--cabinet-card-px) !important;
}

.site-body--cabinet .card-header {
    padding: 0.55rem var(--cabinet-card-px) !important;
    font-size: 0.9375rem;
}

.site-body--cabinet .card.mb-3,
.site-body--cabinet .card.mb-4,
.site-body--cabinet .mb-4,
.site-body--cabinet .mb-3:not(.flow-screen-head):not(.page-back-nav) {
    margin-bottom: var(--cabinet-section-gap) !important;
}

.site-body--cabinet .site-list-filters .card-body,
.site-body--cabinet .site-table-form .card-body {
    padding: 0.55rem 0.75rem !important;
}

.site-body--cabinet .site-list-filters__hint {
    margin-bottom: 0.35rem !important;
    font-size: 0.75rem;
}

.site-body--cabinet .home-dashboard-grid {
    gap: 0.5rem !important;
    margin-bottom: var(--cabinet-section-gap) !important;
}

.site-body--cabinet .home-dashboard-stat {
    padding: 0.55rem 0.75rem !important;
}

.site-body--cabinet .home-dashboard-stat span {
    font-size: 0.75rem;
    line-height: 1.3;
}

.site-body--cabinet .home-dashboard-stat strong {
    font-size: 1.25rem;
    line-height: 1.1;
}

.site-body--cabinet .home-action-panel,
.site-body--cabinet .project-stages-card {
    padding: var(--cabinet-card-py) var(--cabinet-card-px) !important;
}

.site-body--cabinet .projects-page-toolbar,
.site-body--cabinet .tenders-hub-toolbar,
.site-body--cabinet .chats-page-toolbar,
.site-body--cabinet .tenders-hub-page-toolbar {
    margin-bottom: 0.65rem !important;
}

/* Чаты: заголовок + панель «Новый диалог» и «Выбрать» в одну линию */
.chats-page-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.chats-page-head .flow-screen-head {
    margin-bottom: 0 !important;
}

.chats-page-head .chats-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0;
}

.chats-page-head .chats-page-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.site-body--cabinet .chats-page-head {
    gap: 0.55rem;
}

@media (max-width: 575.98px) {
    .chats-page-head .chats-page-toolbar .btn {
        width: auto !important;
    }

    .chats-page-head .chats-page-toolbar .btn-primary {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Тендеры (открытые): секции активных откликов и новых заказов */
.tenders-open-section {
    border: 1px solid var(--surface-border-strong);
    border-radius: var(--border-radius-lg);
    background: var(--surface-glass);
    padding: 0.85rem 0.95rem 0.95rem;
}

.tenders-open-section--active,
.tenders-open-section--new {
    border-color: var(--surface-border-strong);
    background: rgba(51, 65, 85, 0.22);
}

.tenders-open-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.tenders-open-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.tenders-open-list {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.tenders-open-list-item__bid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted-accessible);
}

.tenders-open-list .tenders-open-list-item:hover,
.tenders-open-list .tenders-open-list-item:focus {
    color: var(--text-body);
}

.tenders-open-list .tenders-open-list-item:hover .tenders-open-list-item__title,
.tenders-open-list .tenders-open-list-item:focus .tenders-open-list-item__title {
    color: var(--text-body);
}

.tenders-open-list .tenders-open-list-item:hover .tenders-open-list-item__bid,
.tenders-open-list .tenders-open-list-item:focus .tenders-open-list-item__bid {
    color: var(--text-muted-accessible);
}

.tenders-open-list .tenders-open-list-item:hover strong,
.tenders-open-list .tenders-open-list-item:focus strong {
    color: var(--text-body);
}

.tenders-open-section__empty {
    padding: 0.65rem 0.75rem;
    border-radius: var(--border-radius);
    background: rgba(15, 23, 42, 0.18);
}

[data-theme="dark"] .tenders-open-section--active,
[data-theme="dark"] .tenders-open-section--new {
    background: rgba(30, 41, 59, 0.55);
    border-color: var(--surface-border-strong);
}

.tenders-open-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tenders-open-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--surface-border-strong);
    background: var(--surface-glass);
    color: var(--text-body);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tenders-open-status-chip:hover {
    border-color: var(--primary);
    color: var(--text-body);
    background: var(--primary-soft);
}

.tenders-open-status-chip--active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.tenders-open-status-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.75rem;
    font-weight: 600;
}

.tenders-open-status-chip--active .tenders-open-status-chip__count {
    background: rgba(217, 119, 6, 0.18);
}

.tenders-open-list-item__status-new {
    background: rgba(217, 119, 6, 0.16);
    color: var(--primary);
    border: 1px solid rgba(217, 119, 6, 0.35);
    font-size: 0.68rem;
    font-weight: 600;
}

.tenders-open-list-item__status-active {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.35);
    font-size: 0.68rem;
    font-weight: 600;
}

[data-theme="dark"] .tenders-open-status-chip__count {
    background: rgba(15, 23, 42, 0.45);
}

.site-body--cabinet .mobile-data-card {
    padding: 0.5rem 0.65rem !important;
    margin-bottom: 0.4rem !important;
}

.site-body--cabinet .mobile-data-card-list {
    gap: 0.4rem;
    margin-bottom: var(--cabinet-section-gap) !important;
}

.site-body--cabinet .alert {
    padding: 0.4rem 0.65rem !important;
    margin-bottom: var(--cabinet-section-gap) !important;
}

.site-body--cabinet .list-group-item {
    padding: 0.5rem 0.65rem !important;
}

.site-body--cabinet .chat-list-item {
    padding: 0.5rem 0.65rem !important;
    margin-bottom: 0.35rem !important;
}

.site-body--cabinet .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.site-body--cabinet .form-control,
.site-body--cabinet .form-select {
    min-height: 34px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.875rem;
}

.site-body--cabinet .progress-block {
    margin-bottom: 0.5rem;
}

.site-body--cabinet .progress-block__head {
    margin-bottom: 0.25rem;
}

.site-body--cabinet .home-action-panel h3,
.site-body--cabinet .home-info-grid h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem !important;
    color: var(--text-heading);
}

.site-body--cabinet .home-action-panel p.text-muted,
.site-body--cabinet .home-info-grid p {
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0 !important;
}

.site-body--cabinet .card-body .h6 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem !important;
}

/* Карточки на главной — читаемый текст */
.site-body--cabinet .project-card .card-body {
    padding: 0.9rem 1rem !important;
}

.site-body--cabinet a .project-card.h-100 {
    height: auto !important;
}

.site-body--cabinet .project-card .card-body .d-flex {
    align-items: flex-start;
}

.site-body--cabinet .project-card .card-title {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.25rem !important;
}

.site-body--cabinet .project-card .text-muted.small {
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0.4rem !important;
}

.site-body--cabinet .project-card .badge-object-type {
    font-size: 0.8125rem;
    padding: 0.18rem 0.5rem;
}

.site-body--cabinet .home-tender-card {
    padding: 0.85rem 0.95rem !important;
    line-height: 1.45;
}

.site-body--cabinet .home-tender-card__type {
    font-size: 0.6875rem;
    margin-bottom: 0.35rem;
}

.site-body--cabinet .home-tender-card strong {
    font-size: 1rem;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.2rem;
}

.site-body--cabinet .home-tender-card span,
.site-body--cabinet .home-tender-card small {
    font-size: 0.875rem;
    line-height: 1.4;
}

.site-body--cabinet .home-info-grid > article {
    padding: 0.85rem 1rem !important;
}

.site-body--cabinet .home-info-grid p {
    color: var(--text-muted) !important;
}

/* Каталог — чуть больше воздуха в таблице, чем глобальный compact */
.site-body.page-directory {
    --table-cell-py: 0.55rem;
    --table-cell-px: 0.7rem;
    --table-head-py: 0.55rem;
    --table-head-px: 0.7rem;
    --table-font-size: 0.875rem;
    --table-head-font-size: 0.8125rem;
    --table-badge-font: 0.6875rem;
    --table-badge-py: 0.15rem;
    --table-badge-px: 0.45rem;
}

.site-body.page-directory .site-data-table tbody td,
.site-body.page-directory .site-data-table tbody td.small {
    font-size: var(--table-font-size) !important;
    line-height: 1.45 !important;
}

.site-body.page-directory .site-data-table .directory-role-badge {
    white-space: nowrap;
}

.site-body.page-directory .site-data-table .rating-stars {
    white-space: nowrap;
    margin-right: 0.15rem;
}

.site-body.page-directory .directory-filter-row {
    align-items: end;
}

.site-body.page-directory .directory-filter-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
}

.site-body.page-directory .directory-filter-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .site-body.page-directory .directory-filter-actions .btn {
        flex: 0 0 auto;
        min-width: 6.25rem;
    }
}

.site-body.page-directory .site-table-form .card-body .row {
    align-items: end;
}

/* ===================================================================
   TENDER DETAIL — контраст текста (светлая и тёмная тема)
   =================================================================== */

.tender-detail-desc {
    color: var(--text-body);
}

.tender-detail-muted {
    color: var(--text-muted-accessible) !important;
}

.tender-compare-table caption {
    color: var(--text-muted-accessible);
    padding-bottom: 0.35rem;
}

.tender-bid-item__name,
.tender-bid-item__price {
    color: var(--text-heading);
}

.tender-bid-item__comment {
    color: var(--text-body);
}

.tender-bid-item__date {
    color: var(--text-muted-accessible);
    font-size: 0.8125rem;
}

.tender-compare-table__foot td {
    color: var(--text-muted-accessible);
    font-weight: 600;
}

[data-theme="dark"] .tender-detail-page .flow-screen-head .text-muted {
    color: var(--text-muted-accessible) !important;
}

[data-theme="dark"] .tender-detail-page .tender-compare-table tbody td {
    color: var(--text-body) !important;
}

[data-theme="dark"] .tender-detail-page .tender-compare-table tbody td.small {
    color: #c5d0de !important;
}

[data-theme="dark"] .tender-bid-list .tender-bid-item {
    color: var(--text-body);
}

.tender-bidder-link {
    color: var(--text-heading);
    font-weight: 600;
}

.tender-bidder-link:hover,
.tender-bidder-link:focus-visible {
    color: var(--primary);
}

[data-theme="dark"] .tender-bidder-link {
    color: #f1f5f9;
}

[data-theme="dark"] .tender-bidder-link:hover,
[data-theme="dark"] .tender-bidder-link:focus-visible {
    color: var(--primary);
}

.tender-bid-item .tender-bidder-link.tender-bid-item__name {
    font-weight: 600;
}

/* ===================================================================
   STAGE DETAIL — панели бюджета/оплаты (не белые на тёмном фоне)
   =================================================================== */

.stage-summary-panel {
    padding: 1rem 1.1rem;
    border: 1px solid var(--surface-border-strong);
    border-radius: 12px;
    background: var(--surface-glass);
    color: var(--text-body);
}

.stage-summary-panel__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

.stage-summary-panel .d-flex > span:first-child {
    color: var(--text-muted-accessible);
}

.stage-summary-panel strong {
    color: var(--text-heading);
    font-variant-numeric: tabular-nums;
}

.stage-summary-panel hr {
    border-color: var(--surface-border-strong);
    opacity: 1;
    margin: 0.75rem 0;
}

.stage-summary-panel p.small {
    color: var(--text-muted-accessible);
}

[data-theme="dark"] .stage-summary-panel {
    background: rgba(51, 65, 85, 0.55);
    border-color: var(--surface-border-strong);
}

/* bg-light на панелях в тёмной теме — не оставлять белый фон со светлым текстом */
[data-theme="dark"] div.bg-light:not(.badge),
[data-theme="dark"] td.bg-light,
[data-theme="dark"] .card.bg-light {
    background-color: rgba(51, 65, 85, 0.55) !important;
    color: var(--text-body) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] div.bg-light:not(.badge) strong,
[data-theme="dark"] div.bg-light:not(.badge) h5,
[data-theme="dark"] td.bg-light strong {
    color: var(--text-heading) !important;
}

[data-theme="dark"] div.bg-light:not(.badge) .small,
[data-theme="dark"] td.bg-light .small,
[data-theme="dark"] div.bg-light:not(.badge) p {
    color: var(--text-muted-accessible) !important;
}

/* ===================================================================
   PROFILE — аватар, file input, роли
   =================================================================== */

.profile-avatar-block {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem 1.5rem;
}

.profile-avatar-block__preview {
    flex-shrink: 0;
    padding: 0.35rem;
    border-radius: 50%;
    border: 2px solid var(--surface-border-strong);
    background: rgba(15, 23, 42, 0.2);
}

.profile-avatar-block__preview .user-avatar {
    display: block;
}

.profile-avatar-block__picker {
    flex: 1 1 280px;
    min-width: 0;
    max-width: 100%;
}

.avatar-picker__label {
    margin-bottom: 0.5rem;
    color: var(--text-label);
}

.avatar-picker__grid {
    display: grid;
    grid-template-columns: repeat(8, 48px);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 575px) {
    .avatar-picker__grid {
        grid-template-columns: repeat(4, 48px);
    }
}

.avatar-picker__item {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    margin: 0;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.avatar-picker__item:hover {
    transform: scale(1.04);
}

.avatar-picker__item:has(.avatar-picker__input:checked),
.avatar-picker__item:has(.avatar-picker__input:focus-visible) {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.avatar-picker__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.avatar-picker__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-raised);
}

.avatar-picker__thumb img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.avatar-picker__actions {
    margin-top: 0.25rem;
}

.profile-avatar-upload .form-label {
    color: var(--text-label);
    font-size: 0.875rem;
}

.site-body input[type="file"].form-control.profile-file-input,
.site-body input[type="file"].form-control {
    padding: 0.35rem 0.5rem;
    line-height: 1.4;
}

.site-body input[type="file"].form-control::file-selector-button {
    margin-right: 0.65rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--surface-border-strong);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--text-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

[data-theme="dark"] .site-body input[type="file"].form-control {
    color: var(--text-muted-accessible) !important;
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .site-body input[type="file"].form-control::file-selector-button {
    background: rgba(71, 85, 105, 0.85) !important;
    color: #f1f5f9 !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

[data-theme="dark"] .site-body input[type="file"].form-control::file-selector-button:hover {
    background: rgba(100, 116, 139, 0.9) !important;
}

[data-theme="dark"] .role-pick__box {
    background: rgba(51, 65, 85, 0.45) !important;
    color: var(--text-body) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .role-pick__box span {
    color: var(--text-body) !important;
}

[data-theme="dark"] .role-pick input:checked + .role-pick__box,
[data-theme="dark"] .role-pick--active .role-pick__box {
    color: var(--primary) !important;
    border-color: rgba(232, 160, 84, 0.55) !important;
    background: rgba(217, 119, 6, 0.12) !important;
    box-shadow: 0 0 0 1px rgba(232, 160, 84, 0.15);
}

[data-theme="dark"] .role-pick-grid--single .role-pick__box {
    background: rgba(51, 65, 85, 0.45) !important;
    border-color: var(--surface-border-strong) !important;
}

[data-theme="dark"] .role-pick-grid--single .role-pick__desc {
    color: #94a3b8 !important;
}

[data-theme="dark"] .role-pick-grid--single .role-pick input:checked + .role-pick__box .role-pick__desc,
[data-theme="dark"] .role-pick-grid--single .role-pick--active .role-pick__box .role-pick__desc {
    color: #fcd34d !important;
    opacity: 0.9;
}

[data-theme="dark"] .profile-avatar-block__preview {
    background: rgba(51, 65, 85, 0.35);
    border-color: var(--surface-border-strong);
}

.page-profile .card-header,
.page-public-profile .card-header {
    color: var(--text-heading);
}

.profile-tabs-wrap {
    margin-top: 0.5rem;
}

.profile-tabs {
    border-bottom-color: var(--surface-border-strong);
    gap: 0.15rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}

.profile-tabs .nav-link {
    color: var(--text-muted-accessible);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    white-space: nowrap;
    padding: 0.55rem 0.85rem;
    font-weight: 500;
    box-shadow: none;
}

.profile-tabs .nav-link:hover {
    color: var(--text-heading);
    border-bottom-color: rgba(232, 160, 84, 0.35);
}

.profile-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.profile-tab-pane {
    animation: profile-tab-in 0.18s ease;
}

@keyframes profile-tab-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-accordion .accordion-item {
    background: var(--surface);
    border-color: var(--surface-border);
}

.profile-accordion .accordion-button {
    background: var(--surface-raised);
    color: var(--text-heading);
    box-shadow: none;
}

.profile-accordion .accordion-button:not(.collapsed) {
    background: var(--surface-raised);
    color: var(--primary);
}

.profile-accordion .accordion-body {
    background: var(--surface);
}

.page-profile .profile-role-block {
    padding: 1rem 1.1rem;
    border: 1px solid var(--surface-border-strong);
    border-radius: 12px;
    background: var(--surface-raised);
}

.page-profile .profile-role-block__title {
    margin-bottom: 0.75rem;
    color: var(--text-heading);
    font-weight: 600;
}

.page-profile .contractor-cat-wizard__box {
    border: 2px solid var(--surface-border-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-body);
    min-height: 5.5rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.page-profile .contractor-cat-wizard__label {
    color: var(--text-body);
    font-size: 0.8rem;
    font-weight: 600;
}

.page-profile .contractor-cat-wizard__icon {
    color: var(--primary);
}

.page-profile .contractor-cat-wizard:has(.contractor-cat-input:checked) .contractor-cat-wizard__box {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}

.page-profile .contractor-cat-wizard:focus-within .contractor-cat-wizard__box {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

[data-theme="dark"] .page-profile .contractor-cat-wizard__box {
    background: rgba(51, 65, 85, 0.45);
    border-color: var(--surface-border-strong);
}

[data-theme="dark"] .page-profile .contractor-cat-wizard:has(.contractor-cat-input:checked) .contractor-cat-wizard__box {
    background: rgba(232, 160, 84, 0.12);
    border-color: rgba(232, 160, 84, 0.45);
}

[data-theme="dark"] .page-profile .profile-role-block {
    background: rgba(30, 41, 59, 0.55);
    border-color: var(--surface-border-strong);
}

/* Navbar user dropdown (вариант B) */
.nav-user-block--menu {
    margin-left: 0.35rem;
}

.nav-user-dropdown {
    position: relative;
}

.nav-user-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: inherit;
    max-width: 13rem;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-user-dropdown__toggle::after {
    margin-left: 0.15rem;
    vertical-align: middle;
    opacity: 0.65;
}

.nav-user-dropdown__toggle:hover,
.nav-user-dropdown__toggle:focus-visible {
    background: var(--primary-soft);
    border-color: rgba(217, 119, 6, 0.2);
}

.nav-user-dropdown__toggle.show,
.nav-user-dropdown__toggle[aria-expanded="true"] {
    background: var(--surface);
    border-color: var(--surface-border-strong);
    box-shadow: var(--shadow-surface);
}

.nav-user-dropdown__toggle.nav-link--active .nav-user-dropdown__name {
    color: var(--primary);
}

.nav-user-dropdown__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.2;
}

.nav-user-dropdown__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
    max-width: 10.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-dropdown__role {
    font-size: 0.7rem;
    color: var(--text-muted-accessible);
    max-width: 10.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Панель меню — непрозрачный фон, чёткая граница, выше FAB прораба */
.nav-user-dropdown .dropdown-menu.nav-user-dropdown__menu {
    --nav-user-menu-bg: #ffffff;
    margin-top: 0.5rem;
    padding: 0.4rem 0;
    min-width: 15rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: var(--radius-md);
    background-color: var(--nav-user-menu-bg) !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.08),
        0 18px 42px rgba(15, 23, 42, 0.18);
    z-index: 1090 !important;
    isolation: isolate;
}

.nav-user-dropdown__menu .dropdown-item {
    color: var(--text-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.48rem 0.9rem;
    border-radius: 0;
}

.nav-user-dropdown__menu .dropdown-item.text-danger {
    color: #dc2626 !important;
    font-weight: 600;
}

.nav-user-dropdown__menu .dropdown-divider {
    border-top-color: rgba(15, 23, 42, 0.1);
    opacity: 1;
    margin: 0.35rem 0;
}

.nav-user-dropdown__menu .dropdown-item:hover,
.nav-user-dropdown__menu .dropdown-item:focus,
.nav-user-dropdown__menu .dropdown-item:focus-visible {
    background: var(--primary-soft);
    color: var(--text-heading);
}

.nav-user-dropdown__menu .dropdown-item.text-danger:hover,
.nav-user-dropdown__menu .dropdown-item.text-danger:focus {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c !important;
}

/* При открытом меню — прораб не перекрывает пункты */
body:has(.nav-user-dropdown .dropdown-menu.show) .foreman-widget-root {
    z-index: 1020;
}

[data-theme="dark"] .nav-user-dropdown__toggle.show,
[data-theme="dark"] .nav-user-dropdown__toggle[aria-expanded="true"] {
    background: var(--surface-raised);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .nav-user-dropdown .dropdown-menu.nav-user-dropdown__menu {
    --nav-user-menu-bg: #1e293b;
    border-color: rgba(148, 163, 184, 0.38);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 16px 40px rgba(0, 0, 0, 0.55),
        0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item {
    color: #e2e8f0;
}

[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item.text-danger {
    color: #f87171 !important;
}

[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item.text-danger:hover,
[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item.text-danger:focus {
    color: #fca5a5 !important;
    background: rgba(248, 113, 113, 0.12);
}

[data-theme="dark"] .nav-user-dropdown__menu .dropdown-divider {
    border-top-color: rgba(148, 163, 184, 0.28);
}

[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item:hover,
[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item:focus,
[data-theme="dark"] .nav-user-dropdown__menu .dropdown-item:focus-visible {
    color: #f8fafc;
}

@media (max-width: 991.98px) {
    .nav-user-dropdown__toggle {
        max-width: 100%;
    }

    .nav-user-dropdown .dropdown-menu.nav-user-dropdown__menu {
        min-width: min(15rem, calc(100vw - 1.5rem));
    }
}

/* ===================================================================
   Лендинг: баннер Михалыча (логин на главной)
   =================================================================== */

.ai-foreman-banner {
    border-color: var(--surface-border-strong);
}

[data-theme="dark"] .ai-foreman-banner {
    background: linear-gradient(145deg, #1e293b 0%, #273449 48%, #172033 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.34) !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.25),
        0 14px 40px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .ai-foreman-banner__title {
    color: #f8fafc !important;
}

[data-theme="dark"] .ai-foreman-banner__text {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-foreman-banner__badge {
    background: rgba(217, 119, 6, 0.24) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(232, 160, 84, 0.35);
}

[data-theme="dark"] .ai-pill {
    background: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(148, 163, 184, 0.38) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .ai-pill .icon {
    color: var(--primary) !important;
    opacity: 0.95;
}

/* Автоскрытие flash-уведомлений */
.alert-auto-hide--out {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        max-height 0.35s ease,
        margin 0.35s ease,
        padding 0.35s ease;
}

.alert-undo-flash--compact {
    padding: 0.45rem 0.75rem;
    justify-content: flex-end;
}

/* Каталог: кликабельные строки без колонки «Открыть по клику» */
.page-directory .directory-row__name {
    color: var(--text-heading);
}

.page-directory .site-clickable-row:hover .directory-row__name {
    color: var(--primary);
}

.page-directory .mobile-data-card--directory.site-clickable-card {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.page-directory .mobile-data-card--directory.site-clickable-card:hover {
    background: var(--primary-soft);
    border-color: rgba(217, 119, 6, 0.25);
    box-shadow: var(--shadow-surface);
}

/* Новый диалог: списки участников */
.new-chat-participant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.new-chat-participant-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface-glass);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.new-chat-participant-row:hover {
    background: var(--primary-soft);
    border-color: rgba(217, 119, 6, 0.2);
}

.new-chat-participant-row__main {
    flex: 1 1 auto;
    min-width: 0;
}

.new-chat-participant-row__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.15rem;
}

.new-chat-participant-row__name {
    font-weight: 600;
    color: var(--text-heading);
    text-decoration: none;
}

.new-chat-participant-row__name:hover {
    color: var(--primary);
}

.new-chat-participant-row__bio {
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.2rem;
}

.new-chat-participant-row__context {
    margin-top: 0.15rem;
    font-style: italic;
}

.new-chat-participant-row__action {
    flex: 0 0 auto;
    align-self: center;
}

.directory-role-badge--supplier {
    /* базовый directory-role-badge */
}

.directory-role-badge--contractor {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #047857 !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
}

[data-theme="dark"] .directory-role-badge--contractor {
    background: rgba(52, 211, 153, 0.12) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52, 211, 153, 0.22) !important;
}

[data-theme="dark"] .new-chat-participant-row {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--surface-border-strong);
}

[data-theme="dark"] .new-chat-participant-row:hover {
    background: rgba(232, 160, 84, 0.08);
    border-color: rgba(232, 160, 84, 0.22);
}

/* Публичная страница — компактный layout */
.page-public-profile .site-main .container {
    max-width: 52rem;
}

.user-public-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--surface-border);
}

.user-public-hero__main {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
}

.user-public-hero__title {
    color: var(--text-heading);
}

.user-public-hero__meta {
    color: var(--text-muted);
}

.user-public-hero__action {
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    padding-top: 0.15rem;
}

.user-public-hero__action:hover {
    text-decoration: underline;
}

.user-public-hero__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    text-align: right;
}

.user-public-hero__preview-badge {
    color: var(--text-muted);
    line-height: 1.3;
}

.public-profile-notice {
    color: var(--primary);
}

.public-profile-notice--muted {
    color: var(--text-muted);
}

.public-profile-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.public-profile-manage-bar {
    padding: 0.65rem 0.75rem;
    border-radius: var(--border-radius);
    background: var(--surface-raised, rgba(15, 23, 42, 0.04));
    border: 1px solid var(--surface-border);
}

.public-profile-manage-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.public-profile-manage-form__row .form-control,
.public-profile-manage-form__row .form-select {
    flex: 1 1 8rem;
    min-width: 0;
}

.public-profile-manage-form__row .btn {
    flex-shrink: 0;
}

.public-profile-price-input {
    max-width: 6.5rem;
    text-align: right;
}

.public-profile-price-unit-input {
    max-width: 4.5rem;
}

.public-profile-inline-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.public-profile-price-table th,
.public-profile-price-table td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.public-profile-price-table__actions {
    width: 4.5rem;
}

.public-profile-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 200px));
    gap: 0.75rem;
}

.public-profile-gallery__item {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--surface-border-strong);
    box-shadow: var(--shadow-surface);
    max-width: 200px;
}

.public-profile-gallery__media {
    overflow: hidden;
    background: var(--line);
    line-height: 0;
}

.public-profile-gallery__item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    max-width: 100%;
    height: auto;
}

.public-profile-gallery__caption {
    padding: 0.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.public-profile-gallery__delete {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 1;
}

.public-profile-gallery__delete button {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.public-profile-project {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius);
    background: var(--surface);
}

.public-profile-project__cover {
    width: 4rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.public-profile-project__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-profile-reviews-list .list-group-item {
    border-color: var(--surface-border);
}

.public-profile-review-reply {
    padding: 0.45rem 0.6rem;
    border-left: 2px solid var(--primary);
    background: var(--primary-soft);
    border-radius: 0 6px 6px 0;
}

.public-profile-reply-details summary {
    cursor: pointer;
    list-style: none;
}

.public-profile-reply-details summary::-webkit-details-marker {
    display: none;
}

.public-profile-file-input {
    max-width: 14rem;
}

.page-public-profile .public-profile-reviews-list .review-thumb {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: cover;
    border-radius: 6px;
}

.page-public-profile .public-profile-reviews-list .review-video {
    max-width: 10rem;
    max-height: 5.5rem;
    border-radius: 6px;
}

.page-public-profile .user-public-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-raised, rgba(15, 23, 42, 0.06));
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    line-height: 1.4;
}

[data-theme="dark"] .page-public-profile .user-public-role {
    background: rgba(255, 255, 255, 0.08);
}

.page-public-profile .profile-tabs-wrap {
    margin-bottom: 0.25rem;
}

.page-public-profile .profile-tabs {
    border-bottom: 1px solid var(--surface-border-strong);
}

.page-public-profile .profile-tab-pane {
    padding-top: 0.75rem;
}

.page-public-profile .profile-tabs .nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: transparent;
    box-shadow: none;
}

/* Партнёрский кабинет: чеклист и витрина */
.partner-onboarding-list__item--done .partner-onboarding-list__check {
    color: var(--accent);
}

.partner-onboarding-list__check {
    flex-shrink: 0;
    width: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.partner-showcase-card__preview {
    position: relative;
    display: block;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
}

.partner-showcase-card__preview img {
    display: block;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.partner-showcase-card__count {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
}

.site-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.site-breadcrumbs__item:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.site-breadcrumbs__item a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-breadcrumbs__item a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

.site-breadcrumbs__item--active {
    color: var(--text-primary);
    font-weight: 600;
}
