/*
    Agro Platform — единый визуальный слой MVP.
    Подключается после текущих inline-стилей и мягко унифицирует интерфейс:
    фон, контейнеры, кнопки, формы, таблицы, карточки, бейджи и фокус.
*/

:root {
    --ap-color-primary: #1f4b2c;
    --ap-color-primary-dark: #173820;
    --ap-color-primary-soft: #ecfdf5;

    --ap-color-blue: #2563eb;
    --ap-color-blue-dark: #1d4ed8;
    --ap-color-blue-soft: #eff6ff;

    --ap-color-purple: #7c3aed;
    --ap-color-purple-soft: #f5f3ff;

    --ap-color-danger: #dc2626;
    --ap-color-danger-dark: #b91c1c;
    --ap-color-danger-soft: #fef2f2;

    --ap-color-warning: #f59e0b;
    --ap-color-warning-soft: #fffbeb;

    --ap-color-success: #16a34a;
    --ap-color-success-dark: #15803d;
    --ap-color-success-soft: #f0fdf4;

    --ap-color-bg: #f3f6f4;
    --ap-color-surface: #ffffff;
    --ap-color-surface-soft: #f8fafc;

    --ap-color-text: #111827;
    --ap-color-text-muted: #6b7280;
    --ap-color-border: #e5e7eb;
    --ap-color-border-strong: #d1d5db;

    --ap-radius-sm: 10px;
    --ap-radius-md: 14px;
    --ap-radius-lg: 18px;
    --ap-radius-xl: 24px;

    --ap-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --ap-shadow-md: 0 10px 26px rgba(15, 23, 42, 0.10);
    --ap-shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);

    --ap-font-main: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

/* AA2.0-7C-FIX2B: company requisites lookup */
.ap-company-lookup {
    display: grid;
    gap: 12px;
    max-width: 100%;
    margin: 10px 0 18px;
    padding: 14px;
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    background: #f8fafb;
}

.ap-company-lookup-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    min-width: 0;
}

.ap-company-lookup-trigger,
.ap-company-lookup-select {
    flex: 0 0 auto;
    justify-content: center;
}

.ap-company-lookup-trigger:disabled {
    cursor: wait;
    opacity: .65;
}

.ap-company-lookup-status {
    min-width: 0;
    margin: 0;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ap-company-lookup-status[data-tone="error"] {
    color: #9f2d2d;
}

.ap-company-lookup-status[data-tone="success"] {
    color: #21683d;
}

.ap-company-lookup-results {
    display: grid;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.ap-company-lookup-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #dbe4ea;
    border-radius: 6px;
    background: #fff;
}

.ap-company-lookup-result-content {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.ap-company-lookup-result-title,
.ap-company-lookup-result-line strong,
.ap-company-lookup-result-warning {
    overflow-wrap: anywhere;
}

.ap-company-lookup-result-title {
    color: #17252e;
    font-size: 14px;
    line-height: 1.35;
}

.ap-company-lookup-result-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.ap-company-lookup-result-line span {
    color: #64748b;
}

.ap-company-lookup-result-line strong {
    min-width: 0;
    color: #334155;
    font-weight: 650;
}

.ap-company-lookup-result-warning {
    margin: 3px 0 0;
    color: #9f2d2d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .ap-company-lookup {
        gap: 10px;
        margin: 8px 0 16px;
        padding: 12px;
    }

    .ap-company-lookup-toolbar,
    .ap-company-lookup-result {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .ap-company-lookup .ap-company-lookup-trigger,
    .ap-company-lookup .ap-company-lookup-select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .ap-company-lookup-result {
        gap: 10px;
        align-items: stretch;
    }
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(31, 75, 44, 0.10), transparent 32rem),
        linear-gradient(180deg, #f6faf7 0%, var(--ap-color-bg) 100%);
}

body {
    min-height: 100%;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34rem),
        transparent !important;
    color: var(--ap-color-text) !important;
    font-family: var(--ap-font-main) !important;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--ap-color-primary); text-underline-offset: 3px; }
a:hover { color: var(--ap-color-primary-dark); }

header {
    background:
        linear-gradient(135deg, #163820 0%, var(--ap-color-primary) 58%, #2f6b43 100%) !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.15);
}

.brand a { letter-spacing: -0.02em; }
.header-user { color: rgba(255, 255, 255, 0.86); }

nav { gap: 8px !important; }

nav a,
.nav-summary,
.logout-btn {
    border-radius: 999px;
    padding: 8px 10px !important;
    min-height: 34px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

nav a:hover,
.nav-summary:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none !important;
}

.nav-dropdown-menu {
    border-radius: 16px !important;
    padding: 10px !important;
    box-shadow: var(--ap-shadow-lg) !important;
}

.nav-dropdown-menu a {
    border-radius: 12px !important;
    color: var(--ap-color-text) !important;
}

.nav-dropdown-menu a:hover {
    background: var(--ap-color-primary-soft) !important;
    color: var(--ap-color-primary-dark) !important;
}

main {
    max-width: 1240px !important;
    margin: 26px auto !important;
    padding: 28px !important;
    border: 1px solid rgba(229, 231, 235, 0.86);
    border-radius: var(--ap-radius-xl) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: var(--ap-shadow-sm);
}

.site-footer-inner {
    border-radius: 20px !important;
    box-shadow: var(--ap-shadow-sm);
}

h1, h2, h3 { letter-spacing: -0.025em; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
h2 { line-height: 1.2; }

.muted,
.ap-work-muted,
.dashboard-section-note,
.analytics-section-note,
.culture-section-note,
.ap-market-hero-text,
.ap-market-confidentiality,
.site-footer-text {
    color: var(--ap-color-text-muted) !important;
}

/* Кнопки */

.btn,
.ap-action-btn,
a.ap-action-btn,
button.ap-action-btn,
.ap-verification-needed-btn {
    border-radius: 12px !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
    box-shadow: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.btn:hover,
.ap-action-btn:hover,
.ap-verification-needed-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.btn:active,
.ap-action-btn:active,
.ap-verification-needed-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn {
    background: var(--ap-color-primary) !important;
    border-color: var(--ap-color-primary) !important;
}

.btn:hover {
    background: var(--ap-color-primary-dark) !important;
    border-color: var(--ap-color-primary-dark) !important;
}

.btn-secondary,
.ap-action-chat {
    background: var(--ap-color-blue) !important;
    border-color: var(--ap-color-blue) !important;
    color: #ffffff !important;
}

.btn-secondary:hover,
.ap-action-chat:hover {
    background: var(--ap-color-blue-dark) !important;
    border-color: var(--ap-color-blue-dark) !important;
}

.btn-muted,
.ap-action-neutral {
    background: #ffffff !important;
    border-color: var(--ap-color-border-strong) !important;
    color: #374151 !important;
}

.btn-muted:hover,
.ap-action-neutral:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
}

.ap-action-confirm {
    background: var(--ap-color-success) !important;
    border-color: var(--ap-color-success) !important;
}

.ap-action-confirm:hover {
    background: var(--ap-color-success-dark) !important;
    border-color: var(--ap-color-success-dark) !important;
}

.ap-action-dispute,
.ap-action-cancel {
    background: var(--ap-color-danger) !important;
    border-color: var(--ap-color-danger) !important;
    color: #ffffff !important;
}

.ap-action-dispute:hover,
.ap-action-cancel:hover {
    background: var(--ap-color-danger-dark) !important;
    border-color: var(--ap-color-danger-dark) !important;
}

.ap-action-moderation {
    background: var(--ap-color-warning) !important;
    border-color: var(--ap-color-warning) !important;
    color: #111827 !important;
}

/* Формы */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea,
.ap-input,
.ap-textarea {
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: var(--ap-color-text) !important;
    font-family: var(--ap-font-main) !important;
    font-size: 15px !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
.ap-input {
    min-height: 42px;
    padding: 9px 12px;
}

textarea,
.ap-textarea {
    min-height: 140px;
    padding: 12px 14px;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus,
.ap-input:focus,
.ap-textarea:focus {
    outline: none !important;
    border-color: var(--ap-color-primary) !important;
    box-shadow: 0 0 0 4px rgba(31, 75, 44, 0.12) !important;
}

label { color: #374151; }

/* Карточки и секции */

.ap-page-header,
.dashboard-hero,
.dashboard-section,
.analytics-hero,
.analytics-section,
.culture-hero,
.culture-section,
.ap-market-hero,
.ap-market-panel,
.ap-market-filter,
.ap-market-summary-card,
.ap-market-card,
.dashboard-stat-card,
.dashboard-access-card,
.dashboard-action-card,
.dashboard-mini-card,
.culture-metric-card,
.analytics-summary-card,
.analytics-culture-card,
.analytics-chart-card,
.culture-chart-card,
.ap-work-card {
    border-color: var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    box-shadow: var(--ap-shadow-sm);
}

.dashboard-hero,
.ap-market-hero,
.analytics-hero,
.culture-hero {
    border-radius: var(--ap-radius-xl) !important;
}

.dashboard-section,
.analytics-section,
.culture-section,
.ap-market-panel {
    background: var(--ap-color-surface) !important;
}

.dashboard-stat-card,
.dashboard-access-card,
.dashboard-action-card,
.dashboard-mini-card,
.ap-market-summary-card,
.ap-market-metric,
.analytics-metric,
.culture-metric-card {
    background: var(--ap-color-surface-soft) !important;
}

.click-card,
.ap-clickable-card,
.ap-work-card,
.dashboard-action-card,
.dashboard-mini-card,
.analytics-culture-card,
.ap-market-card {
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease,
        background-color 0.15s ease;
}

.click-card:hover,
.ap-clickable-card:hover,
.ap-work-card:hover,
.dashboard-action-card:hover,
.dashboard-mini-card:hover,
.analytics-culture-card:hover,
.ap-market-card:hover {
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

/* Таблицы */

.ap-table,
.analytics-table,
.culture-table,
.ap-market-quality-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--ap-color-border);
    border-radius: 16px;
    background: #ffffff;
}

.ap-table th,
.ap-table td,
.analytics-table th,
.analytics-table td,
.culture-table th,
.culture-table td,
.ap-market-quality-table th,
.ap-market-quality-table td {
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--ap-color-border) !important;
}

.ap-table th,
.analytics-table th,
.culture-table th,
.ap-market-quality-table th {
    background: #f8fafc !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
}

.ap-table tr:last-child td,
.analytics-table tr:last-child td,
.culture-table tr:last-child td,
.ap-market-quality-table tr:last-child td {
    border-bottom: none !important;
}

.ap-clickable-row {
    transition: background-color 0.15s ease;
}

.ap-clickable-row:hover {
    background: var(--ap-color-primary-soft) !important;
}

/* Бейджи и уведомления */

.ap-work-badge,
.dashboard-status-badge,
.ap-market-status,
.ap-market-hero-badge,
.analytics-chip,
.dashboard-object-pill,
.ap-market-quality-pill,
.ap-work-meta-pill,
.analytics-source-pill {
    border-radius: 999px !important;
    font-weight: 800 !important;
}

.message {
    border-radius: 14px !important;
    box-shadow: var(--ap-shadow-sm);
}

.dashboard-empty,
.ap-market-empty,
.analytics-empty,
.culture-empty {
    border-radius: 16px !important;
}

/* Унификация мобильной версии */

@media (max-width: 768px) {
    main {
        margin: 12px !important;
        padding: 18px !important;
        border-radius: 18px !important;
    }

    header {
        padding: 14px 16px !important;
    }

    nav a,
    .nav-summary,
    .logout-btn {
        padding: 8px 0 !important;
    }

    .ap-page-header {
        gap: 12px;
    }

    .btn,
    .ap-action-btn,
    a.ap-action-btn,
    button.ap-action-btn,
    .ap-verification-needed-btn {
        width: 100%;
        max-width: 100%;
    }
}

/* Доступность */

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35) !important;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}


/*
    Мягкая визуальная доработка раздела "Предложения".
    Не требует изменения HTML-шаблонов и не затрагивает фильтры, формы, URL и бизнес-логику.
*/

body:has(a[href*="/offers/"]) .offer-card,
body:has(form[action*="offer"]) .offer-card,
.offer-card {
    border: 1px solid var(--ap-color-border) !important;
    border-left: 6px solid var(--ap-color-blue) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.offer-card:hover {
    border-color: #bfdbfe !important;
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.offer-card a {
    text-decoration: none;
}

.offer-card a:hover {
    text-decoration: none;
}

.offer-card h2,
.offer-card h3,
.offer-card-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.offer-card p,
.offer-card .muted {
    color: var(--ap-color-text-muted) !important;
}

.offer-status,
.offer-direction,
.offer-badge,
.offer-card .badge,
.offer-card .status,
.offer-card [class*="status"],
.offer-card [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.offer-filters,
.offers-filters,
.offer-filter,
.filter-form,
.filters,
form.offer-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.offer-filters label,
.offers-filters label,
.offer-filter label,
.filter-form label,
.filters label,
form.offer-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.offer-detail,
.offer-detail-card,
.offer-main-card,
.offer-info-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.offer-actions,
.offer-card-actions,
.offer-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.offer-actions a,
.offer-card-actions a,
.offer-detail-actions a,
.offer-actions button,
.offer-card-actions button,
.offer-detail-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.offer-meta,
.offer-card-meta,
.offer-detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.offer-metric,
.offer-card-metric,
.offer-detail-metric {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
}

/* Страница формы предложения */

form input,
form select,
form textarea {
    max-width: 100%;
}

form .helptext {
    color: var(--ap-color-text-muted) !important;
    font-size: 13px;
}

.errorlist {
    margin: 6px 0 0 0 !important;
    padding-left: 18px !important;
    color: var(--ap-color-danger) !important;
    font-size: 13px !important;
}

/* Безопасное улучшение старых таблиц/списков в предложениях */

.offers-list,
.offer-list {
    display: grid;
    gap: 14px;
}

.offer-table,
.offers-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.offer-table th,
.offers-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

@media (max-width: 768px) {
    .offer-actions,
    .offer-card-actions,
    .offer-detail-actions {
        align-items: stretch;
    }

    .offer-actions a,
    .offer-card-actions a,
    .offer-detail-actions a,
    .offer-actions button,
    .offer-card-actions button,
    .offer-detail-actions button {
        width: 100%;
    }
}


/*
    Мягкая визуальная доработка раздела "Сделки".
    Не меняет HTML-шаблоны, маршруты, статусы, формы подтверждения, чат, спор и бизнес-логику.
*/

.deal-card,
.deal-detail,
.deal-detail-card,
.deal-main-card,
.deal-info-card,
.deal-status-card,
.deal-parties-card,
.deal-actions-card,
.deal-chat-card,
.deal-documents-card,
.deal-confirmation-card,
.deal-cancel-review-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.deal-card {
    border-left: 6px solid var(--ap-color-primary) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.deal-card:hover {
    border-color: #bbf7d0 !important;
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.deal-card a,
.deal-detail a {
    text-decoration: none;
}

.deal-card a:hover,
.deal-detail a:hover {
    text-decoration: none;
}

.deal-card h2,
.deal-card h3,
.deal-detail h2,
.deal-detail h3,
.deal-title,
.deal-card-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.deal-card p,
.deal-detail p,
.deal-meta,
.deal-card-meta,
.deal-detail-meta,
.deal-note,
.deal-muted {
    color: var(--ap-color-text-muted) !important;
}

.deal-status,
.deal-badge,
.deal-stage,
.deal-card .badge,
.deal-detail .badge,
.deal-card .status,
.deal-detail .status,
.deal-card [class*="status"],
.deal-detail [class*="status"],
.deal-card [class*="badge"],
.deal-detail [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.deals-list,
.deal-list {
    display: grid;
    gap: 14px;
}

.deal-filters,
.deals-filters,
.deal-filter,
.deal-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.deal-filters label,
.deals-filters label,
.deal-filter label,
.deal-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.deal-actions,
.deal-card-actions,
.deal-detail-actions,
.deal-confirm-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.deal-actions a,
.deal-card-actions a,
.deal-detail-actions a,
.deal-confirm-actions a,
.deal-actions button,
.deal-card-actions button,
.deal-detail-actions button,
.deal-confirm-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.deal-metrics,
.deal-card-metrics,
.deal-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.deal-metric,
.deal-card-metric,
.deal-detail-metric {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 11px 12px !important;
}

.deal-metric-label,
.deal-card-metric-label,
.deal-detail-metric-label {
    color: var(--ap-color-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.deal-metric-value,
.deal-card-metric-value,
.deal-detail-metric-value {
    color: var(--ap-color-text) !important;
    font-weight: 900 !important;
}

.deal-parties,
.deal-party-grid,
.deal-detail-grid {
    display: grid;
    gap: 14px;
}

.deal-party-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 14px !important;
}

.deal-warning,
.deal-attention,
.deal-confirmation-warning {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.deal-danger,
.deal-dispute-warning,
.deal-cancel-warning {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.deal-success,
.deal-completed,
.deal-confirmed {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.deal-table,
.deals-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.deal-table th,
.deals-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.deal-table td,
.deals-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

@media (max-width: 980px) {
    .deal-metrics,
    .deal-card-metrics,
    .deal-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .deal-actions,
    .deal-card-actions,
    .deal-detail-actions,
    .deal-confirm-actions {
        align-items: stretch;
    }

    .deal-actions a,
    .deal-card-actions a,
    .deal-detail-actions a,
    .deal-confirm-actions a,
    .deal-actions button,
    .deal-card-actions button,
    .deal-detail-actions button,
    .deal-confirm-actions button {
        width: 100%;
    }

    .deal-metrics,
    .deal-card-metrics,
    .deal-detail-metrics {
        grid-template-columns: 1fr;
    }
}


/*
    Мягкая визуальная доработка раздела "Поддержка".
    Не меняет HTML-шаблоны, маршруты, формы, вложения, закрытие обращений и менеджерские действия.
*/

.support-card,
.support-ticket-card,
.ticket-card,
.support-detail,
.support-detail-card,
.ticket-detail,
.ticket-detail-card,
.support-message-card,
.ticket-message-card,
.support-manager-card,
.manager-ticket-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.support-card,
.support-ticket-card,
.ticket-card,
.manager-ticket-card {
    border-left: 6px solid var(--ap-color-purple) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.support-card:hover,
.support-ticket-card:hover,
.ticket-card:hover,
.manager-ticket-card:hover {
    border-color: #ddd6fe !important;
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.support-card a,
.support-detail a,
.ticket-card a,
.ticket-detail a {
    text-decoration: none;
}

.support-card a:hover,
.support-detail a:hover,
.ticket-card a:hover,
.ticket-detail a:hover {
    text-decoration: none;
}

.support-card h2,
.support-card h3,
.ticket-card h2,
.ticket-card h3,
.support-detail h2,
.support-detail h3,
.ticket-detail h2,
.ticket-detail h3,
.support-title,
.ticket-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.support-card p,
.ticket-card p,
.support-detail p,
.ticket-detail p,
.support-meta,
.ticket-meta,
.support-muted,
.ticket-muted {
    color: var(--ap-color-text-muted) !important;
}

.support-status,
.ticket-status,
.support-category,
.ticket-category,
.support-badge,
.ticket-badge,
.support-card .badge,
.ticket-card .badge,
.support-detail .badge,
.ticket-detail .badge,
.support-card [class*="status"],
.ticket-card [class*="status"],
.support-detail [class*="status"],
.ticket-detail [class*="status"],
.support-card [class*="badge"],
.ticket-card [class*="badge"],
.support-detail [class*="badge"],
.ticket-detail [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.support-list,
.ticket-list,
.support-ticket-list,
.manager-ticket-list {
    display: grid;
    gap: 14px;
}

.support-filters,
.ticket-filters,
.support-filter,
.ticket-filter,
.support-filter-form,
.ticket-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.support-filters label,
.ticket-filters label,
.support-filter label,
.ticket-filter label,
.support-filter-form label,
.ticket-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.support-actions,
.ticket-actions,
.support-card-actions,
.ticket-card-actions,
.support-detail-actions,
.ticket-detail-actions,
.support-manager-actions,
.ticket-manager-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.support-actions a,
.ticket-actions a,
.support-card-actions a,
.ticket-card-actions a,
.support-detail-actions a,
.ticket-detail-actions a,
.support-manager-actions a,
.ticket-manager-actions a,
.support-actions button,
.ticket-actions button,
.support-card-actions button,
.ticket-card-actions button,
.support-detail-actions button,
.ticket-detail-actions button,
.support-manager-actions button,
.ticket-manager-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.support-message,
.ticket-message,
.support-thread-message,
.ticket-thread-message {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    padding: 14px !important;
    box-shadow: var(--ap-shadow-sm);
}

.support-message-user,
.ticket-message-user {
    border-left: 5px solid var(--ap-color-blue) !important;
    background: var(--ap-color-blue-soft) !important;
}

.support-message-staff,
.ticket-message-staff,
.support-message-manager,
.ticket-message-manager {
    border-left: 5px solid var(--ap-color-primary) !important;
    background: var(--ap-color-primary-soft) !important;
}

.support-message-system,
.ticket-message-system {
    border-left: 5px solid var(--ap-color-warning) !important;
    background: var(--ap-color-warning-soft) !important;
}

.support-thread,
.ticket-thread,
.support-messages,
.ticket-messages {
    display: grid;
    gap: 12px;
}

.support-attachment,
.ticket-attachment,
.support-file,
.ticket-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
}

.support-attachment:hover,
.ticket-attachment:hover,
.support-file:hover,
.ticket-file:hover {
    background: var(--ap-color-surface-soft) !important;
    color: var(--ap-color-primary-dark) !important;
}

.support-form,
.ticket-form,
.support-reply-form,
.ticket-reply-form,
.manager-ticket-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.support-form textarea,
.ticket-form textarea,
.support-reply-form textarea,
.ticket-reply-form textarea,
.manager-ticket-form textarea {
    min-height: 130px !important;
}

.support-warning,
.ticket-warning,
.support-attention,
.ticket-attention {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.support-success,
.ticket-success,
.support-closed,
.ticket-closed {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.support-danger,
.ticket-danger {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.support-table,
.ticket-table,
.manager-ticket-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.support-table th,
.ticket-table th,
.manager-ticket-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.support-table td,
.ticket-table td,
.manager-ticket-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

@media (max-width: 768px) {
    .support-actions,
    .ticket-actions,
    .support-card-actions,
    .ticket-card-actions,
    .support-detail-actions,
    .ticket-detail-actions,
    .support-manager-actions,
    .ticket-manager-actions {
        align-items: stretch;
    }

    .support-actions a,
    .ticket-actions a,
    .support-card-actions a,
    .ticket-card-actions a,
    .support-detail-actions a,
    .ticket-detail-actions a,
    .support-manager-actions a,
    .ticket-manager-actions a,
    .support-actions button,
    .ticket-actions button,
    .support-card-actions button,
    .ticket-card-actions button,
    .support-detail-actions button,
    .ticket-detail-actions button,
    .support-manager-actions button,
    .ticket-manager-actions button {
        width: 100%;
    }
}


/*
    Мягкая визуальная доработка раздела "Споры".
    Не меняет HTML-шаблоны, маршруты, формы, сообщения, вложения, решения менеджера и бизнес-логику.
*/

.dispute-card,
.dispute-detail,
.dispute-detail-card,
.dispute-main-card,
.dispute-info-card,
.dispute-status-card,
.dispute-parties-card,
.dispute-actions-card,
.dispute-message-card,
.dispute-manager-card,
.manager-dispute-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-card,
.manager-dispute-card {
    border-left: 6px solid var(--ap-color-danger) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dispute-card:hover,
.manager-dispute-card:hover {
    border-color: #fecaca !important;
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.dispute-card a,
.dispute-detail a,
.manager-dispute-card a {
    text-decoration: none;
}

.dispute-card a:hover,
.dispute-detail a:hover,
.manager-dispute-card a:hover {
    text-decoration: none;
}

.dispute-card h2,
.dispute-card h3,
.dispute-detail h2,
.dispute-detail h3,
.manager-dispute-card h2,
.manager-dispute-card h3,
.dispute-title,
.dispute-card-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.dispute-card p,
.dispute-detail p,
.manager-dispute-card p,
.dispute-meta,
.dispute-card-meta,
.dispute-detail-meta,
.dispute-note,
.dispute-muted {
    color: var(--ap-color-text-muted) !important;
}

.dispute-status,
.dispute-reason,
.dispute-badge,
.dispute-stage,
.dispute-card .badge,
.dispute-detail .badge,
.manager-dispute-card .badge,
.dispute-card .status,
.dispute-detail .status,
.manager-dispute-card .status,
.dispute-card [class*="status"],
.dispute-detail [class*="status"],
.manager-dispute-card [class*="status"],
.dispute-card [class*="badge"],
.dispute-detail [class*="badge"],
.manager-dispute-card [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.dispute-list,
.disputes-list,
.manager-dispute-list {
    display: grid;
    gap: 14px;
}

.dispute-filters,
.disputes-filters,
.dispute-filter,
.dispute-filter-form,
.manager-dispute-filter,
.manager-dispute-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-filters label,
.disputes-filters label,
.dispute-filter label,
.dispute-filter-form label,
.manager-dispute-filter label,
.manager-dispute-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.dispute-actions,
.dispute-card-actions,
.dispute-detail-actions,
.dispute-manager-actions,
.manager-dispute-actions,
.dispute-decision-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.dispute-actions a,
.dispute-card-actions a,
.dispute-detail-actions a,
.dispute-manager-actions a,
.manager-dispute-actions a,
.dispute-decision-actions a,
.dispute-actions button,
.dispute-card-actions button,
.dispute-detail-actions button,
.dispute-manager-actions button,
.manager-dispute-actions button,
.dispute-decision-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.dispute-metrics,
.dispute-card-metrics,
.dispute-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dispute-metric,
.dispute-card-metric,
.dispute-detail-metric {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 11px 12px !important;
}

.dispute-metric-label,
.dispute-card-metric-label,
.dispute-detail-metric-label {
    color: var(--ap-color-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.dispute-metric-value,
.dispute-card-metric-value,
.dispute-detail-metric-value {
    color: var(--ap-color-text) !important;
    font-weight: 900 !important;
}

.dispute-thread,
.dispute-messages,
.dispute-message-list,
.manager-dispute-thread {
    display: grid;
    gap: 12px;
}

.dispute-message,
.dispute-thread-message,
.dispute-message-item,
.manager-dispute-message {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    padding: 14px !important;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-message-initiator,
.dispute-initiator-message {
    border-left: 5px solid var(--ap-color-blue) !important;
    background: var(--ap-color-blue-soft) !important;
}

.dispute-message-respondent,
.dispute-respondent-message {
    border-left: 5px solid var(--ap-color-purple) !important;
    background: var(--ap-color-purple-soft) !important;
}

.dispute-message-manager,
.dispute-manager-message {
    border-left: 5px solid var(--ap-color-primary) !important;
    background: var(--ap-color-primary-soft) !important;
}

.dispute-message-system,
.dispute-system-message {
    border-left: 5px solid var(--ap-color-warning) !important;
    background: var(--ap-color-warning-soft) !important;
}

.dispute-attachment,
.dispute-file,
.dispute-message-file,
.manager-dispute-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
}

.dispute-attachment:hover,
.dispute-file:hover,
.dispute-message-file:hover,
.manager-dispute-file:hover {
    background: var(--ap-color-surface-soft) !important;
    color: var(--ap-color-primary-dark) !important;
}

.dispute-form,
.dispute-reply-form,
.dispute-message-form,
.dispute-manager-form,
.dispute-decision-form,
.manager-dispute-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-form textarea,
.dispute-reply-form textarea,
.dispute-message-form textarea,
.dispute-manager-form textarea,
.dispute-decision-form textarea,
.manager-dispute-form textarea {
    min-height: 130px !important;
}

.dispute-warning,
.dispute-attention,
.dispute-manager-warning {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.dispute-danger,
.dispute-critical,
.dispute-opened,
.dispute-escalated {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.dispute-success,
.dispute-resolved,
.dispute-closed {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.dispute-table,
.disputes-table,
.manager-dispute-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-table th,
.disputes-table th,
.manager-dispute-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.dispute-table td,
.disputes-table td,
.manager-dispute-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

@media (max-width: 980px) {
    .dispute-metrics,
    .dispute-card-metrics,
    .dispute-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dispute-actions,
    .dispute-card-actions,
    .dispute-detail-actions,
    .dispute-manager-actions,
    .manager-dispute-actions,
    .dispute-decision-actions {
        align-items: stretch;
    }

    .dispute-actions a,
    .dispute-card-actions a,
    .dispute-detail-actions a,
    .dispute-manager-actions a,
    .manager-dispute-actions a,
    .dispute-decision-actions a,
    .dispute-actions button,
    .dispute-card-actions button,
    .dispute-detail-actions button,
    .dispute-manager-actions button,
    .manager-dispute-actions button,
    .dispute-decision-actions button {
        width: 100%;
    }

    .dispute-metrics,
    .dispute-card-metrics,
    .dispute-detail-metrics {
        grid-template-columns: 1fr;
    }
}

/*
    Мягкая визуальная доработка раздела "Биллинг".
    Не меняет HTML-шаблоны, маршруты, тарифы, платежи, формы оплаты и бизнес-логику.
*/

.billing-card,
.billing-dashboard-card,
.billing-tariff-card,
.tariff-card,
.billing-payment-card,
.payment-card,
.billing-service-card,
.paid-service-card,
.billing-detail,
.payment-detail,
.billing-panel,
.billing-info-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.billing-tariff-card,
.tariff-card,
.billing-payment-card,
.payment-card,
.billing-service-card,
.paid-service-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.billing-tariff-card,
.tariff-card {
    border-left: 6px solid var(--ap-color-primary) !important;
}

.billing-payment-card,
.payment-card {
    border-left: 6px solid var(--ap-color-blue) !important;
}

.billing-service-card,
.paid-service-card {
    border-left: 6px solid var(--ap-color-purple) !important;
}

.billing-tariff-card:hover,
.tariff-card:hover,
.billing-payment-card:hover,
.payment-card:hover,
.billing-service-card:hover,
.paid-service-card:hover {
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.billing-card a,
.billing-dashboard-card a,
.billing-tariff-card a,
.tariff-card a,
.billing-payment-card a,
.payment-card a,
.billing-detail a,
.payment-detail a {
    text-decoration: none;
}

.billing-card a:hover,
.billing-dashboard-card a:hover,
.billing-tariff-card a:hover,
.tariff-card a:hover,
.billing-payment-card a:hover,
.payment-card a:hover,
.billing-detail a:hover,
.payment-detail a:hover {
    text-decoration: none;
}

.billing-card h2,
.billing-card h3,
.billing-dashboard-card h2,
.billing-dashboard-card h3,
.billing-tariff-card h2,
.billing-tariff-card h3,
.tariff-card h2,
.tariff-card h3,
.billing-detail h2,
.billing-detail h3,
.payment-detail h2,
.payment-detail h3,
.billing-title,
.tariff-title,
.payment-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.billing-card p,
.billing-dashboard-card p,
.billing-tariff-card p,
.tariff-card p,
.billing-payment-card p,
.payment-card p,
.billing-detail p,
.payment-detail p,
.billing-meta,
.tariff-meta,
.payment-meta,
.billing-muted,
.payment-muted {
    color: var(--ap-color-text-muted) !important;
}

.billing-price,
.tariff-price,
.payment-amount,
.billing-amount {
    color: var(--ap-color-primary-dark) !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em;
}

.billing-status,
.payment-status,
.subscription-status,
.tariff-status,
.billing-badge,
.payment-badge,
.billing-card .badge,
.payment-card .badge,
.tariff-card .badge,
.billing-detail .badge,
.payment-detail .badge,
.billing-card [class*="status"],
.payment-card [class*="status"],
.tariff-card [class*="status"],
.billing-detail [class*="status"],
.payment-detail [class*="status"],
.billing-card [class*="badge"],
.payment-card [class*="badge"],
.tariff-card [class*="badge"],
.billing-detail [class*="badge"],
.payment-detail [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.billing-list,
.payment-list,
.tariff-list,
.billing-tariff-list,
.billing-payment-list,
.paid-service-list {
    display: grid;
    gap: 14px;
}

.billing-grid,
.tariff-grid,
.payment-grid,
.billing-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.billing-summary-grid,
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.billing-summary-card,
.payment-summary-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 14px !important;
    box-shadow: var(--ap-shadow-sm);
}

.billing-actions,
.payment-actions,
.tariff-actions,
.billing-card-actions,
.payment-card-actions,
.billing-detail-actions,
.payment-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.billing-actions a,
.payment-actions a,
.tariff-actions a,
.billing-card-actions a,
.payment-card-actions a,
.billing-detail-actions a,
.payment-detail-actions a,
.billing-actions button,
.payment-actions button,
.tariff-actions button,
.billing-card-actions button,
.payment-card-actions button,
.billing-detail-actions button,
.payment-detail-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.billing-form,
.payment-form,
.tariff-form,
.billing-filter,
.payment-filter,
.billing-filter-form,
.payment-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.billing-form label,
.payment-form label,
.tariff-form label,
.billing-filter label,
.payment-filter label,
.billing-filter-form label,
.payment-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.billing-table,
.payment-table,
.tariff-table,
.subscription-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.billing-table th,
.payment-table th,
.tariff-table th,
.subscription-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.billing-table td,
.payment-table td,
.tariff-table td,
.subscription-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

.billing-warning,
.payment-warning,
.tariff-warning,
.subscription-warning {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.billing-success,
.payment-success,
.subscription-active,
.tariff-active {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.billing-danger,
.payment-danger,
.payment-error,
.subscription-expired {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.billing-info,
.payment-info,
.tariff-info {
    border: 1px solid #bfdbfe !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-blue-soft) !important;
    color: #1e40af !important;
}

.billing-feature-list,
.tariff-feature-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 0;
    list-style: none;
}

.billing-feature-list li,
.tariff-feature-list li {
    position: relative;
    padding-left: 22px;
    color: #374151;
}

.billing-feature-list li::before,
.tariff-feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--ap-color-success);
    font-weight: 900;
}

@media (max-width: 980px) {
    .billing-grid,
    .tariff-grid,
    .payment-grid,
    .billing-dashboard-grid,
    .billing-summary-grid,
    .payment-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .billing-grid,
    .tariff-grid,
    .payment-grid,
    .billing-dashboard-grid,
    .billing-summary-grid,
    .payment-summary-grid {
        grid-template-columns: 1fr;
    }

    .billing-actions,
    .payment-actions,
    .tariff-actions,
    .billing-card-actions,
    .payment-card-actions,
    .billing-detail-actions,
    .payment-detail-actions {
        align-items: stretch;
    }

    .billing-actions a,
    .payment-actions a,
    .tariff-actions a,
    .billing-card-actions a,
    .payment-card-actions a,
    .billing-detail-actions a,
    .payment-detail-actions a,
    .billing-actions button,
    .payment-actions button,
    .tariff-actions button,
    .billing-card-actions button,
    .payment-card-actions button,
    .billing-detail-actions button,
    .payment-detail-actions button {
        width: 100%;
    }
}

/*
    Мягкая визуальная доработка раздела "Уведомления".
    Не меняет HTML-шаблоны, маршруты, target_url, счётчик непрочитанных и бизнес-логику.
*/

.notification-card,
.notification-detail,
.notification-detail-card,
.notification-item,
.notification-row,
.notification-panel,
.notification-info-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.notification-card,
.notification-item,
.notification-row {
    border-left: 6px solid var(--ap-color-blue) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.notification-card:hover,
.notification-item:hover,
.notification-row:hover {
    border-color: #bfdbfe !important;
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.notification-unread,
.notification-card-unread,
.notification-item-unread,
.notification-row-unread,
.notification-card.is-unread,
.notification-item.is-unread,
.notification-row.is-unread {
    border-left-color: var(--ap-color-warning) !important;
    background: var(--ap-color-warning-soft) !important;
}

.notification-read,
.notification-card-read,
.notification-item-read,
.notification-row-read,
.notification-card.is-read,
.notification-item.is-read,
.notification-row.is-read {
    border-left-color: var(--ap-color-border-strong) !important;
}

.notification-card a,
.notification-detail a,
.notification-item a,
.notification-row a {
    text-decoration: none;
}

.notification-card a:hover,
.notification-detail a:hover,
.notification-item a:hover,
.notification-row a:hover {
    text-decoration: none;
}

.notification-card h2,
.notification-card h3,
.notification-detail h2,
.notification-detail h3,
.notification-item h2,
.notification-item h3,
.notification-title,
.notification-card-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.notification-card p,
.notification-detail p,
.notification-item p,
.notification-row p,
.notification-meta,
.notification-card-meta,
.notification-detail-meta,
.notification-muted {
    color: var(--ap-color-text-muted) !important;
}

.notification-type,
.notification-status,
.notification-badge,
.notification-card .badge,
.notification-detail .badge,
.notification-item .badge,
.notification-row .badge,
.notification-card [class*="type"],
.notification-detail [class*="type"],
.notification-item [class*="type"],
.notification-row [class*="type"],
.notification-card [class*="status"],
.notification-detail [class*="status"],
.notification-item [class*="status"],
.notification-row [class*="status"],
.notification-card [class*="badge"],
.notification-detail [class*="badge"],
.notification-item [class*="badge"],
.notification-row [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.notification-list,
.notifications-list {
    display: grid;
    gap: 14px;
}

.notification-filters,
.notifications-filters,
.notification-filter,
.notification-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.notification-filters label,
.notifications-filters label,
.notification-filter label,
.notification-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.notification-actions,
.notification-card-actions,
.notification-detail-actions,
.notification-list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.notification-actions a,
.notification-card-actions a,
.notification-detail-actions a,
.notification-list-actions a,
.notification-actions button,
.notification-card-actions button,
.notification-detail-actions button,
.notification-list-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.notification-summary,
.notifications-summary,
.notification-summary-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.notification-table,
.notifications-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.notification-table th,
.notifications-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.notification-table td,
.notifications-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

.notification-empty,
.notifications-empty {
    border: 1px dashed var(--ap-color-border-strong) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    color: var(--ap-color-text-muted) !important;
}

@media (max-width: 768px) {
    .notification-actions,
    .notification-card-actions,
    .notification-detail-actions,
    .notification-list-actions {
        align-items: stretch;
    }

    .notification-actions a,
    .notification-card-actions a,
    .notification-detail-actions a,
    .notification-list-actions a,
    .notification-actions button,
    .notification-card-actions button,
    .notification-detail-actions button,
    .notification-list-actions button {
        width: 100%;
    }
}

/*
    Мягкая визуальная доработка раздела "Модерация и рабочее пространство менеджера".
    Не меняет HTML-шаблоны, маршруты, счётчики, решения модерации, ценовое согласование и POST-действия менеджера.
*/

.moderation-card,
.moderation-entry-card,
.moderation-detail,
.moderation-detail-card,
.moderation-panel,
.moderation-info-card,
.price-approval-card,
.price-approval-detail,
.price-approval-panel,
.manager-workspace-card,
.manager-card,
.manager-panel,
.manager-task-card,
.admin-tool-card,
.audit-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.moderation-card,
.moderation-entry-card,
.manager-workspace-card,
.manager-card,
.price-approval-card,
.manager-task-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.moderation-card,
.moderation-entry-card {
    border-left: 6px solid var(--ap-color-blue) !important;
}

.price-approval-card {
    border-left: 6px solid var(--ap-color-warning) !important;
}

.manager-workspace-card,
.manager-card,
.manager-task-card {
    border-left: 6px solid var(--ap-color-primary) !important;
}

.moderation-card:hover,
.moderation-entry-card:hover,
.price-approval-card:hover,
.manager-workspace-card:hover,
.manager-card:hover,
.manager-task-card:hover {
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.moderation-card a,
.moderation-detail a,
.price-approval-card a,
.price-approval-detail a,
.manager-workspace-card a,
.manager-card a,
.manager-task-card a,
.admin-tool-card a,
.audit-card a {
    text-decoration: none;
}

.moderation-card a:hover,
.moderation-detail a:hover,
.price-approval-card a:hover,
.price-approval-detail a:hover,
.manager-workspace-card a:hover,
.manager-card a:hover,
.manager-task-card a:hover,
.admin-tool-card a:hover,
.audit-card a:hover {
    text-decoration: none;
}

.moderation-card h2,
.moderation-card h3,
.moderation-detail h2,
.moderation-detail h3,
.price-approval-card h2,
.price-approval-card h3,
.price-approval-detail h2,
.price-approval-detail h3,
.manager-workspace-card h2,
.manager-workspace-card h3,
.manager-card h2,
.manager-card h3,
.manager-title,
.moderation-title,
.price-approval-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.moderation-card p,
.moderation-detail p,
.price-approval-card p,
.price-approval-detail p,
.manager-workspace-card p,
.manager-card p,
.manager-meta,
.moderation-meta,
.price-approval-meta,
.manager-muted,
.moderation-muted {
    color: var(--ap-color-text-muted) !important;
}

.moderation-status,
.moderation-decision,
.moderation-type,
.price-approval-status,
.price-approval-decision,
.manager-task-status,
.manager-badge,
.moderation-badge,
.price-approval-badge,
.audit-badge,
.moderation-card .badge,
.moderation-detail .badge,
.price-approval-card .badge,
.price-approval-detail .badge,
.manager-card .badge,
.manager-workspace-card .badge,
.moderation-card [class*="status"],
.moderation-detail [class*="status"],
.price-approval-card [class*="status"],
.price-approval-detail [class*="status"],
.manager-card [class*="status"],
.manager-workspace-card [class*="status"],
.moderation-card [class*="badge"],
.moderation-detail [class*="badge"],
.price-approval-card [class*="badge"],
.price-approval-detail [class*="badge"],
.manager-card [class*="badge"],
.manager-workspace-card [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.moderation-list,
.moderation-entry-list,
.price-approval-list,
.manager-workspace-grid,
.manager-card-list,
.manager-task-list,
.audit-list {
    display: grid;
    gap: 14px;
}

.manager-workspace-grid,
.manager-dashboard-grid,
.moderation-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.moderation-filters,
.moderation-filter,
.moderation-filter-form,
.price-approval-filters,
.price-approval-filter,
.price-approval-filter-form,
.manager-filter,
.manager-filter-form,
.audit-filter,
.audit-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.moderation-filters label,
.moderation-filter label,
.moderation-filter-form label,
.price-approval-filters label,
.price-approval-filter label,
.price-approval-filter-form label,
.manager-filter label,
.manager-filter-form label,
.audit-filter label,
.audit-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.moderation-actions,
.moderation-card-actions,
.moderation-detail-actions,
.price-approval-actions,
.price-approval-card-actions,
.price-approval-detail-actions,
.manager-actions,
.manager-card-actions,
.manager-task-actions,
.audit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.moderation-actions a,
.moderation-card-actions a,
.moderation-detail-actions a,
.price-approval-actions a,
.price-approval-card-actions a,
.price-approval-detail-actions a,
.manager-actions a,
.manager-card-actions a,
.manager-task-actions a,
.audit-actions a,
.moderation-actions button,
.moderation-card-actions button,
.moderation-detail-actions button,
.price-approval-actions button,
.price-approval-card-actions button,
.price-approval-detail-actions button,
.manager-actions button,
.manager-card-actions button,
.manager-task-actions button,
.audit-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.manager-counter,
.manager-count,
.moderation-count,
.price-approval-count,
.manager-workspace-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--ap-color-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.manager-counter-warning,
.manager-count-warning,
.price-approval-count {
    background: var(--ap-color-warning);
    color: #111827;
}

.manager-counter-danger,
.manager-count-danger,
.dispute-attention-count {
    background: var(--ap-color-danger);
    color: #ffffff;
}

.moderation-metrics,
.price-approval-metrics,
.manager-metrics,
.audit-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.moderation-metric,
.price-approval-metric,
.manager-metric,
.audit-metric {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 11px 12px !important;
}

.moderation-metric-label,
.price-approval-metric-label,
.manager-metric-label,
.audit-metric-label {
    color: var(--ap-color-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.moderation-metric-value,
.price-approval-metric-value,
.manager-metric-value,
.audit-metric-value {
    color: var(--ap-color-text) !important;
    font-weight: 900 !important;
}

.moderation-document,
.price-approval-document,
.manager-document,
.audit-document,
.moderation-file,
.price-approval-file,
.manager-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
}

.moderation-document:hover,
.price-approval-document:hover,
.manager-document:hover,
.audit-document:hover,
.moderation-file:hover,
.price-approval-file:hover,
.manager-file:hover {
    background: var(--ap-color-surface-soft) !important;
    color: var(--ap-color-primary-dark) !important;
}

.moderation-form,
.moderation-decision-form,
.price-approval-form,
.price-approval-decision-form,
.manager-form,
.manager-task-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.moderation-form label,
.moderation-decision-form label,
.price-approval-form label,
.price-approval-decision-form label,
.manager-form label,
.manager-task-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.moderation-warning,
.price-approval-warning,
.manager-warning {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.moderation-success,
.price-approval-success,
.manager-success {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.moderation-danger,
.price-approval-danger,
.manager-danger {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.moderation-info,
.price-approval-info,
.manager-info {
    border: 1px solid #bfdbfe !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-blue-soft) !important;
    color: #1e40af !important;
}

.moderation-table,
.price-approval-table,
.manager-table,
.manager-task-table,
.audit-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.moderation-table th,
.price-approval-table th,
.manager-table th,
.manager-task-table th,
.audit-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.moderation-table td,
.price-approval-table td,
.manager-table td,
.manager-task-table td,
.audit-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

@media (max-width: 980px) {
    .manager-workspace-grid,
    .manager-dashboard-grid,
    .moderation-dashboard-grid,
    .moderation-metrics,
    .price-approval-metrics,
    .manager-metrics,
    .audit-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .manager-workspace-grid,
    .manager-dashboard-grid,
    .moderation-dashboard-grid,
    .moderation-metrics,
    .price-approval-metrics,
    .manager-metrics,
    .audit-metrics {
        grid-template-columns: 1fr;
    }

    .moderation-actions,
    .moderation-card-actions,
    .moderation-detail-actions,
    .price-approval-actions,
    .price-approval-card-actions,
    .price-approval-detail-actions,
    .manager-actions,
    .manager-card-actions,
    .manager-task-actions,
    .audit-actions {
        align-items: stretch;
    }

    .moderation-actions a,
    .moderation-card-actions a,
    .moderation-detail-actions a,
    .price-approval-actions a,
    .price-approval-card-actions a,
    .price-approval-detail-actions a,
    .manager-actions a,
    .manager-card-actions a,
    .manager-task-actions a,
    .audit-actions a,
    .moderation-actions button,
    .moderation-card-actions button,
    .moderation-detail-actions button,
    .price-approval-actions button,
    .price-approval-card-actions button,
    .price-approval-detail-actions button,
    .manager-actions button,
    .manager-card-actions button,
    .manager-task-actions button,
    .audit-actions button {
        width: 100%;
    }
}

/*
    Мягкая визуальная доработка разделов "Мои лоты" и "Мои заявки".
    Не меняет HTML-шаблоны, маршруты, формы создания, документы, качество, фильтры и бизнес-логику.
*/

.lot-card,
.lot-detail,
.lot-detail-card,
.lot-form-card,
.lot-info-card,
.lot-quality-card,
.lot-document-card,
.buy-request-card,
.buy-request-detail,
.buy-request-detail-card,
.buy-request-form-card,
.buy-request-info-card,
.buy-request-quality-card,
.buy-request-document-card,
.request-card,
.request-detail,
.request-detail-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.lot-card,
.buy-request-card,
.request-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lot-card {
    border-left: 6px solid var(--ap-color-success) !important;
}

.buy-request-card,
.request-card {
    border-left: 6px solid var(--ap-color-blue) !important;
}

.lot-card:hover,
.buy-request-card:hover,
.request-card:hover {
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

.lot-card a,
.lot-detail a,
.buy-request-card a,
.buy-request-detail a,
.request-card a,
.request-detail a {
    text-decoration: none;
}

.lot-card a:hover,
.lot-detail a:hover,
.buy-request-card a:hover,
.buy-request-detail a:hover,
.request-card a:hover,
.request-detail a:hover {
    text-decoration: none;
}

.lot-card h2,
.lot-card h3,
.lot-detail h2,
.lot-detail h3,
.buy-request-card h2,
.buy-request-card h3,
.buy-request-detail h2,
.buy-request-detail h3,
.request-card h2,
.request-card h3,
.request-detail h2,
.request-detail h3,
.lot-title,
.buy-request-title,
.request-title {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.lot-card p,
.lot-detail p,
.buy-request-card p,
.buy-request-detail p,
.request-card p,
.request-detail p,
.lot-meta,
.buy-request-meta,
.request-meta,
.lot-muted,
.buy-request-muted,
.request-muted {
    color: var(--ap-color-text-muted) !important;
}

.lot-status,
.lot-moderation-status,
.lot-price-status,
.buy-request-status,
.buy-request-moderation-status,
.buy-request-price-status,
.request-status,
.request-badge,
.lot-badge,
.buy-request-badge,
.lot-card .badge,
.lot-detail .badge,
.buy-request-card .badge,
.buy-request-detail .badge,
.request-card .badge,
.request-detail .badge,
.lot-card [class*="status"],
.lot-detail [class*="status"],
.buy-request-card [class*="status"],
.buy-request-detail [class*="status"],
.request-card [class*="status"],
.request-detail [class*="status"],
.lot-card [class*="badge"],
.lot-detail [class*="badge"],
.buy-request-card [class*="badge"],
.buy-request-detail [class*="badge"],
.request-card [class*="badge"],
.request-detail [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.lot-list,
.lots-list,
.buy-request-list,
.buy-requests-list,
.request-list,
.requests-list {
    display: grid;
    gap: 14px;
}

.lot-filters,
.lots-filters,
.lot-filter,
.lot-filter-form,
.buy-request-filters,
.buy-requests-filters,
.buy-request-filter,
.buy-request-filter-form,
.request-filters,
.request-filter-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.lot-filters label,
.lots-filters label,
.lot-filter label,
.lot-filter-form label,
.buy-request-filters label,
.buy-requests-filters label,
.buy-request-filter label,
.buy-request-filter-form label,
.request-filters label,
.request-filter-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.lot-actions,
.lot-card-actions,
.lot-detail-actions,
.lot-form-actions,
.buy-request-actions,
.buy-request-card-actions,
.buy-request-detail-actions,
.buy-request-form-actions,
.request-actions,
.request-card-actions,
.request-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.lot-actions a,
.lot-card-actions a,
.lot-detail-actions a,
.lot-form-actions a,
.buy-request-actions a,
.buy-request-card-actions a,
.buy-request-detail-actions a,
.buy-request-form-actions a,
.request-actions a,
.request-card-actions a,
.request-detail-actions a,
.lot-actions button,
.lot-card-actions button,
.lot-detail-actions button,
.lot-form-actions button,
.buy-request-actions button,
.buy-request-card-actions button,
.buy-request-detail-actions button,
.buy-request-form-actions button,
.request-actions button,
.request-card-actions button,
.request-detail-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.lot-metrics,
.lot-card-metrics,
.lot-detail-metrics,
.buy-request-metrics,
.buy-request-card-metrics,
.buy-request-detail-metrics,
.request-metrics,
.request-card-metrics,
.request-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.lot-metric,
.lot-card-metric,
.lot-detail-metric,
.buy-request-metric,
.buy-request-card-metric,
.buy-request-detail-metric,
.request-metric,
.request-card-metric,
.request-detail-metric {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 11px 12px !important;
}

.lot-metric-label,
.lot-card-metric-label,
.lot-detail-metric-label,
.buy-request-metric-label,
.buy-request-card-metric-label,
.buy-request-detail-metric-label,
.request-metric-label,
.request-card-metric-label,
.request-detail-metric-label {
    color: var(--ap-color-text-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.lot-metric-value,
.lot-card-metric-value,
.lot-detail-metric-value,
.buy-request-metric-value,
.buy-request-card-metric-value,
.buy-request-detail-metric-value,
.request-metric-value,
.request-card-metric-value,
.request-detail-metric-value {
    color: var(--ap-color-text) !important;
    font-weight: 900 !important;
}

.lot-quality,
.lot-quality-row,
.lot-quality-table,
.buy-request-quality,
.buy-request-quality-row,
.buy-request-quality-table,
.request-quality,
.request-quality-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.lot-quality-table th,
.buy-request-quality-table th,
.request-quality-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.lot-document,
.lot-file,
.lot-document-link,
.buy-request-document,
.buy-request-file,
.buy-request-document-link,
.request-document,
.request-file,
.request-document-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
}

.lot-document:hover,
.lot-file:hover,
.lot-document-link:hover,
.buy-request-document:hover,
.buy-request-file:hover,
.buy-request-document-link:hover,
.request-document:hover,
.request-file:hover,
.request-document-link:hover {
    background: var(--ap-color-surface-soft) !important;
    color: var(--ap-color-primary-dark) !important;
}

.lot-form,
.lot-create-form,
.lot-edit-form,
.buy-request-form,
.buy-request-create-form,
.buy-request-edit-form,
.request-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.lot-form label,
.lot-create-form label,
.lot-edit-form label,
.buy-request-form label,
.buy-request-create-form label,
.buy-request-edit-form label,
.request-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.lot-warning,
.lot-attention,
.buy-request-warning,
.buy-request-attention,
.request-warning,
.request-attention {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.lot-success,
.lot-published,
.buy-request-success,
.buy-request-published,
.request-success,
.request-published {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.lot-danger,
.lot-rejected,
.buy-request-danger,
.buy-request-rejected,
.request-danger,
.request-rejected {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.lot-info,
.buy-request-info,
.request-info {
    border: 1px solid #bfdbfe !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-blue-soft) !important;
    color: #1e40af !important;
}

.lot-table,
.lots-table,
.buy-request-table,
.buy-requests-table,
.request-table,
.requests-table {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.lot-table th,
.lots-table th,
.buy-request-table th,
.buy-requests-table th,
.request-table th,
.requests-table th {
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
    font-weight: 800 !important;
}

.lot-table td,
.lots-table td,
.buy-request-table td,
.buy-requests-table td,
.request-table td,
.requests-table td {
    border-bottom: 1px solid var(--ap-color-border) !important;
}

@media (max-width: 980px) {
    .lot-metrics,
    .lot-card-metrics,
    .lot-detail-metrics,
    .buy-request-metrics,
    .buy-request-card-metrics,
    .buy-request-detail-metrics,
    .request-metrics,
    .request-card-metrics,
    .request-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .lot-actions,
    .lot-card-actions,
    .lot-detail-actions,
    .lot-form-actions,
    .buy-request-actions,
    .buy-request-card-actions,
    .buy-request-detail-actions,
    .buy-request-form-actions,
    .request-actions,
    .request-card-actions,
    .request-detail-actions {
        align-items: stretch;
    }

    .lot-actions a,
    .lot-card-actions a,
    .lot-detail-actions a,
    .lot-form-actions a,
    .buy-request-actions a,
    .buy-request-card-actions a,
    .buy-request-detail-actions a,
    .buy-request-form-actions a,
    .request-actions a,
    .request-card-actions a,
    .request-detail-actions a,
    .lot-actions button,
    .lot-card-actions button,
    .lot-detail-actions button,
    .lot-form-actions button,
    .buy-request-actions button,
    .buy-request-card-actions button,
    .buy-request-detail-actions button,
    .buy-request-form-actions button,
    .request-actions button,
    .request-card-actions button,
    .request-detail-actions button {
        width: 100%;
    }

    .lot-metrics,
    .lot-card-metrics,
    .lot-detail-metrics,
    .buy-request-metrics,
    .buy-request-card-metrics,
    .buy-request-detail-metrics,
    .request-metrics,
    .request-card-metrics,
    .request-detail-metrics {
        grid-template-columns: 1fr;
    }
}

/*
    Мягкая визуальная доработка раздела "Чаты".
    Не меняет HTML-шаблоны, маршруты, отправку сообщений, вложения, запрет контактов и защищённое скачивание.
*/

.chat-card,
.chat-panel,
.chat-detail,
.chat-thread,
.chat-window,
.chat-container,
.chat-info-card,
.offer-chat-card,
.deal-chat-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.chat-header,
.chat-title-card,
.chat-context-card,
.chat-warning-card,
.chat-rules-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-surface-soft) !important;
    box-shadow: var(--ap-shadow-sm);
}

.chat-header h1,
.chat-header h2,
.chat-header h3,
.chat-title,
.chat-card h2,
.chat-card h3,
.chat-panel h2,
.chat-panel h3,
.chat-window h2,
.chat-window h3 {
    color: var(--ap-color-text) !important;
    letter-spacing: -0.02em;
}

.chat-header p,
.chat-card p,
.chat-panel p,
.chat-window p,
.chat-meta,
.chat-muted,
.chat-note,
.chat-context,
.chat-message-meta {
    color: var(--ap-color-text-muted) !important;
}

.chat-status,
.chat-badge,
.chat-role,
.chat-message-role,
.chat-card .badge,
.chat-panel .badge,
.chat-window .badge,
.chat-card [class*="status"],
.chat-panel [class*="status"],
.chat-window [class*="status"],
.chat-card [class*="badge"],
.chat-panel [class*="badge"],
.chat-window [class*="badge"] {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border: 1px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
    color: #374151 !important;
}

.chat-messages,
.chat-message-list,
.chat-thread-list {
    display: grid;
    gap: 12px;
}

.chat-message,
.chat-message-card,
.message-card,
.offer-chat-message,
.deal-chat-message {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    padding: 14px !important;
    box-shadow: var(--ap-shadow-sm);
}

.chat-message-own,
.chat-message-me,
.message-own,
.message-me,
.chat-message.is-own,
.chat-message.is-me {
    border-left: 5px solid var(--ap-color-primary) !important;
    background: var(--ap-color-primary-soft) !important;
}

.chat-message-other,
.chat-message-counterparty,
.message-other,
.message-counterparty {
    border-left: 5px solid var(--ap-color-blue) !important;
    background: var(--ap-color-blue-soft) !important;
}

.chat-message-manager,
.message-manager {
    border-left: 5px solid var(--ap-color-warning) !important;
    background: var(--ap-color-warning-soft) !important;
}

.chat-message-system,
.message-system {
    border-left: 5px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
}

.chat-message-text,
.message-text {
    color: var(--ap-color-text) !important;
    line-height: 1.55;
}

.chat-attachment,
.chat-file,
.chat-message-file,
.chat-attachment-link,
.message-attachment,
.message-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.chat-attachment:hover,
.chat-file:hover,
.chat-message-file:hover,
.chat-attachment-link:hover,
.message-attachment:hover,
.message-file:hover {
    background: var(--ap-color-surface-soft) !important;
    color: var(--ap-color-primary-dark) !important;
    text-decoration: none !important;
}

.chat-form,
.chat-message-form,
.message-form,
.offer-chat-form,
.deal-chat-form {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.chat-form label,
.chat-message-form label,
.message-form label,
.offer-chat-form label,
.deal-chat-form label {
    font-weight: 800 !important;
    color: #374151 !important;
}

.chat-form textarea,
.chat-message-form textarea,
.message-form textarea,
.offer-chat-form textarea,
.deal-chat-form textarea {
    min-height: 120px !important;
}

.chat-actions,
.chat-form-actions,
.chat-message-actions,
.offer-chat-actions,
.deal-chat-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.chat-actions a,
.chat-form-actions a,
.chat-message-actions a,
.offer-chat-actions a,
.deal-chat-actions a,
.chat-actions button,
.chat-form-actions button,
.chat-message-actions button,
.offer-chat-actions button,
.deal-chat-actions button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.chat-warning,
.chat-contact-warning,
.chat-rules-warning,
.chat-attachment-warning {
    border: 1px solid #fde68a !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-warning-soft) !important;
    color: #92400e !important;
}

.chat-danger,
.chat-error,
.chat-contact-error {
    border: 1px solid #fecaca !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-danger-soft) !important;
    color: #991b1b !important;
}

.chat-success {
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.chat-info {
    border: 1px solid #bfdbfe !important;
    border-radius: var(--ap-radius-lg) !important;
    background: var(--ap-color-blue-soft) !important;
    color: #1e40af !important;
}

.chat-participants,
.chat-context-grid,
.chat-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chat-participant-card,
.chat-context-item,
.chat-summary-card {
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 14px !important;
    background: var(--ap-color-surface-soft) !important;
    padding: 12px !important;
}

.chat-empty,
.chat-no-messages {
    border: 1px dashed var(--ap-color-border-strong) !important;
    border-radius: var(--ap-radius-lg) !important;
    background: #ffffff !important;
    color: var(--ap-color-text-muted) !important;
}

@media (max-width: 768px) {
    .chat-participants,
    .chat-context-grid,
    .chat-summary-grid {
        grid-template-columns: 1fr;
    }

    .chat-actions,
    .chat-form-actions,
    .chat-message-actions,
    .offer-chat-actions,
    .deal-chat-actions {
        align-items: stretch;
    }

    .chat-actions a,
    .chat-form-actions a,
    .chat-message-actions a,
    .offer-chat-actions a,
    .deal-chat-actions a,
    .chat-actions button,
    .chat-form-actions button,
    .chat-message-actions button,
    .offer-chat-actions button,
    .deal-chat-actions button {
        width: 100%;
    }
}

/* Коррективы интерфейса: кликабельные карточки без лишних ссылок-подсказок */
.ap-card-link-reset,
.ap-card-link-reset:hover {
    display: block;
    color: inherit !important;
    text-decoration: none !important;
}

.dashboard-access-link,
.dashboard-access-link:hover {
    display: block;
    color: inherit !important;
    text-decoration: none !important;
}

.analytics-summary-card.ap-card-link-reset,
.home-stat-card.ap-card-link-reset {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.analytics-summary-card.ap-card-link-reset:hover,
.home-stat-card.ap-card-link-reset:hover,
.dashboard-access-link:hover {
    box-shadow: var(--ap-shadow-md) !important;
    transform: translateY(-1px);
}

/*
    Единый вид кнопок по всей платформе.
    Основные действия — зелёные, вторичные — спокойные светлые, опасные — красные.
    Блок не меняет шаблоны, маршруты, формы и бизнес-логику.
*/

.btn,
button.btn,
a.btn,
input[type="submit"].btn,
.ap-action-btn,
button.ap-action-btn,
a.ap-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 40px !important;
    padding: 9px 15px !important;
    border-radius: 12px !important;
    border: 1px solid var(--ap-color-primary-dark) !important;
    background: linear-gradient(135deg, var(--ap-color-primary), var(--ap-color-primary-dark)) !important;
    color: #ffffff !important;
    font-weight: 850 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 7px rgba(22, 101, 52, 0.16) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover,
input[type="submit"].btn:hover,
.ap-action-btn:hover,
button.ap-action-btn:hover,
a.ap-action-btn:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(22, 101, 52, 0.24) !important;
}

.btn:focus-visible,
button.btn:focus-visible,
a.btn:focus-visible,
input[type="submit"].btn:focus-visible,
.ap-action-btn:focus-visible,
button.ap-action-btn:focus-visible,
a.ap-action-btn:focus-visible {
    outline: 3px solid rgba(34, 197, 94, 0.25) !important;
    outline-offset: 2px !important;
}

.btn-muted,
.btn-secondary,
.ap-action-neutral,
.ap-action-secondary,
a.btn-muted,
a.btn-secondary,
button.btn-muted,
button.btn-secondary {
    border-color: var(--ap-color-border-strong) !important;
    background: #f8fafc !important;
    color: var(--ap-color-primary-dark) !important;
    box-shadow: var(--ap-shadow-sm) !important;
}

.btn-muted:hover,
.btn-secondary:hover,
.ap-action-neutral:hover,
.ap-action-secondary:hover,
a.btn-muted:hover,
a.btn-secondary:hover,
button.btn-muted:hover,
button.btn-secondary:hover {
    border-color: var(--ap-color-primary) !important;
    background: var(--ap-color-primary-soft) !important;
    color: var(--ap-color-primary-dark) !important;
    box-shadow: var(--ap-shadow-md) !important;
}

.btn-danger,
.ap-action-danger,
button.btn-danger,
a.btn-danger,
button.ap-action-danger,
a.ap-action-danger {
    border-color: #b91c1c !important;
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 7px rgba(185, 28, 28, 0.16) !important;
}

.btn-danger:hover,
.ap-action-danger:hover,
button.btn-danger:hover,
a.btn-danger:hover,
button.ap-action-danger:hover,
a.ap-action-danger:hover {
    border-color: #991b1b !important;
    background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.24) !important;
}

.btn-warning,
.ap-action-warning,
button.btn-warning,
a.btn-warning {
    border-color: #d97706 !important;
    background: linear-gradient(135deg, #f59e0b, #b45309) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 7px rgba(217, 119, 6, 0.16) !important;
}

.btn-warning:hover,
.ap-action-warning:hover,
button.btn-warning:hover,
a.btn-warning:hover {
    border-color: #b45309 !important;
    background: linear-gradient(135deg, #d97706, #92400e) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.24) !important;
}

.btn[disabled],
button.btn[disabled],
input[type="submit"].btn[disabled],
.btn.disabled,
.ap-action-btn[disabled],
.ap-action-btn.disabled {
    opacity: 0.58 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.ap-actions,
.actions,
.form-actions,
.card-actions {
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .btn,
    button.btn,
    a.btn,
    input[type="submit"].btn,
    .ap-action-btn,
    button.ap-action-btn,
    a.ap-action-btn {
        width: 100%;
    }
}

/*
    Единая реакция кликабельных карточек.
    Карточка должна ощущаться кликабельной без отдельной кнопки.
*/

.ap-clickable-card,
.ap-card-link-reset,
.home-card,
.dashboard-card,
.market-card,
.analytics-card,
.billing-card[href],
.billing-tariff-card,
.tariff-settings-card,
.notification-card,
.notification-detail-card {
    cursor: pointer;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background-color 0.16s ease;
}

.ap-clickable-card:hover,
.ap-card-link-reset:hover,
.home-card:hover,
.dashboard-card:hover,
.market-card:hover,
.analytics-card:hover,
.billing-card[href]:hover,
.billing-tariff-card:hover,
.tariff-settings-card:hover,
.notification-card:hover,
.notification-detail-card:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.ap-clickable-card:focus-visible,
.ap-card-link-reset:focus-visible,
.home-card:focus-visible,
.dashboard-card:focus-visible,
.market-card:focus-visible,
.analytics-card:focus-visible,
.billing-card[href]:focus-visible,
.billing-tariff-card:focus-visible,
.tariff-settings-card:focus-visible,
.notification-card:focus-visible,
.notification-detail-card:focus-visible {
    outline: 3px solid rgba(34, 197, 94, 0.28);
    outline-offset: 3px;
}

.ap-clickable-card:hover,
.ap-card-link-reset:hover,
.home-card:hover,
.dashboard-card:hover,
.market-card:hover,
.analytics-card:hover {
    border-color: var(--ap-color-primary, #16a34a);
}

.billing-tariff-card:hover {
    border-color: #16a34a !important;
    box-shadow: 0 12px 28px rgba(22, 101, 52, 0.16) !important;
}

.tariff-settings-card:hover {
    border-color: #2563eb !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.14) !important;
}

.notification-card:hover,
.notification-detail-card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.ap-card-link-reset,
.ap-card-link-reset:hover,
.billing-card[href],
.billing-card[href]:hover,
.billing-tariff-card,
.billing-tariff-card:hover,
.tariff-settings-card,
.tariff-settings-card:hover {
    color: inherit;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .ap-clickable-card,
    .ap-card-link-reset,
    .home-card,
    .dashboard-card,
    .market-card,
    .analytics-card,
    .billing-card[href],
    .billing-tariff-card,
    .tariff-settings-card,
    .notification-card,
    .notification-detail-card {
        transition: none;
    }

    .ap-clickable-card:hover,
    .ap-card-link-reset:hover,
    .home-card:hover,
    .dashboard-card:hover,
    .market-card:hover,
    .analytics-card:hover,
    .billing-card[href]:hover,
    .billing-tariff-card:hover,
    .tariff-settings-card:hover,
    .notification-card:hover,
    .notification-detail-card:hover {
        transform: none;
    }
}


/*
    Демо-полировка кнопок.
    Текст на кнопках должен помещаться полностью: без фиксированной ширины, обрезки и многоточий.
*/
.btn,
button.btn,
a.btn,
input[type="submit"].btn,
.ap-action-btn,
button.ap-action-btn,
a.ap-action-btn,
.ap-verification-needed-btn {
    width: auto !important;
    min-width: max-content !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 42px !important;
    max-height: none !important;
    padding: 10px 16px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25 !important;
    text-align: center !important;
}

.ap-actions,
.ap-work-actions,
.ap-market-actions,
.home-actions,
.dashboard-actions,
.dashboard-actions-grid,
.form-actions,
.card-actions {
    align-items: stretch;
}

@media (max-width: 640px) {
    .btn,
    button.btn,
    a.btn,
    input[type="submit"].btn,
    .ap-action-btn,
    button.ap-action-btn,
    a.ap-action-btn,
    .ap-verification-needed-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/*
    Визуальная полировка рабочих разделов MVP.
    Предложения, сделки, переговоры, споры, поддержка, уведомления и рабочее пространство менеджера.
    Только внешний слой: бизнес-логика, формы, маршруты и права доступа не меняются.
*/

/* Общие страницы рабочих сценариев */
.deals-page,
.price-page,
.detail-page,
.notification-page,
.support-page,
.support-detail-page,
.dispute-page,
.offer-page,
.workflow-page,
.ap-workflow-page {
    width: 100%;
    max-width: 1180px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.ap-page-header,
.deal-card-top,
.price-header,
.detail-header,
.notification-header,
.support-header,
.dispute-header {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.ap-page-header h1,
.deals-title,
.price-header h1,
.detail-title,
.notification-header h1,
.support-header h1,
.dispute-header h1 {
    letter-spacing: -0.035em;
}

/* Фильтры и панели управления */
.deals-filter,
.price-filter,
.notification-filter,
.support-filter,
.dispute-filter,
.workflow-filter,
form[method="get"] {
    border-color: rgba(209, 213, 219, 0.78) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98)) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.deals-filter label,
.price-field label,
.notification-filter label,
.support-filter label,
.dispute-filter label,
.workflow-filter label,
form[method="get"] label {
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.deals-filter select,
.price-select,
.price-input,
.notification-filter select,
.notification-filter input,
.support-filter select,
.support-filter input,
.dispute-filter select,
.dispute-filter input,
.workflow-filter select,
.workflow-filter input,
form[method="get"] select,
form[method="get"] input[type="text"],
form[method="get"] input[type="search"] {
    min-height: 42px !important;
    border-radius: 12px !important;
    background-color: #ffffff !important;
}

/* Карточки рабочих объектов */
.deal-card,
.offer-card,
.dispute-card,
.support-ticket-card,
.notification-card,
.price-card,
.detail-card,
.notification-detail-card,
.support-message,
.detail-history-item,
.detail-document-item,
.ap-work-card {
    border-radius: 18px !important;
    border-color: rgba(229, 231, 235, 0.92) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045) !important;
}

.deal-card,
.offer-card,
.dispute-card,
.support-ticket-card,
.notification-card,
.price-card,
.ap-work-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.deal-card:hover,
.offer-card:hover,
.dispute-card:hover,
.support-ticket-card:hover,
.notification-card:hover,
.price-card:hover,
.ap-work-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
}

.deal-card-title,
.ap-work-card-title,
.detail-document-title,
.support-message-author {
    letter-spacing: -0.02em;
}

.deal-grid,
.ap-work-grid,
.detail-grid {
    gap: 12px !important;
}

.deal-info,
.ap-work-info,
.detail-info {
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.84) !important;
}

.deal-info-label,
.ap-work-info-label,
.detail-info-label {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 800 !important;
}

.deal-info-value,
.ap-work-info-value,
.detail-info-value {
    overflow-wrap: anywhere;
}

/* Переговоры: сообщения и форма */
#chat-history {
    gap: 14px !important;
}

#chat-history > div,
.support-message {
    border-radius: 16px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}

#offer-chat-form,
#deal-chat-form,
.support-reply-form,
.dispute-reply-form {
    padding: 18px !important;
    border: 1px solid rgba(229, 231, 235, 0.95) !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}

#offer-chat-form textarea,
#deal-chat-form textarea,
.support-reply-form textarea,
.dispute-reply-form textarea {
    min-height: 150px !important;
}

#offer-chat-form input[type="file"],
#deal-chat-form input[type="file"],
.support-reply-form input[type="file"],
.dispute-reply-form input[type="file"] {
    background: #ffffff !important;
}

/* Споры и поддержка */
.support-thread,
.dispute-thread,
.detail-history {
    gap: 14px !important;
}

.support-message-user,
.dispute-message-user {
    border-left: 6px solid var(--ap-color-blue, #2563eb) !important;
}

.support-message-manager,
.dispute-message-manager {
    border-left: 6px solid var(--ap-color-purple, #7c3aed) !important;
}

.support-attachment,
.dispute-attachment,
.detail-document-item a {
    min-height: 32px;
    border-radius: 999px;
    text-decoration: none !important;
}

.support-ticket-open-hint,
.notification-open-hint,
.dispute-open-hint {
    color: var(--ap-color-primary-dark, #173820) !important;
}

/* Менеджерское рабочее пространство */
.ap-work-card-moderation,
.ap-work-card-price,
.ap-work-card-manager,
.ap-work-card-dispute,
.ap-work-card-cancel-review,
.ap-work-card-notification,
.ap-work-card-support {
    position: relative;
    overflow: hidden;
}

.ap-work-card-moderation::before,
.ap-work-card-price::before,
.ap-work-card-manager::before,
.ap-work-card-dispute::before,
.ap-work-card-cancel-review::before,
.ap-work-card-notification::before,
.ap-work-card-support::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-left: inherit;
    pointer-events: none;
}

.ap-work-badge,
.deal-stage-badge,
.deal-role-badge,
.price-priority-badge {
    min-height: 28px !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
}

.ap-work-actions,
.ap-actions,
.price-filter-actions {
    display: flex;
    align-items: stretch !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

/* Детальные страницы */
.detail-layout {
    align-items: start;
}

.detail-card-header {
    background: rgba(255, 255, 255, 0.78) !important;
}

.detail-card-body,
.notification-detail-card,
.ap-work-description,
.detail-description {
    line-height: 1.55 !important;
}

/* Уведомления */
.notification-card,
.notification-detail-card {
    background: #ffffff !important;
}

.notification-card-unread,
.notification-unread,
.ap-work-card-notification.is-unread {
    border-left-color: var(--ap-color-primary, #1f4b2c) !important;
    background: linear-gradient(180deg, #ffffff, #f0fdf4) !important;
}

/* Широкие таблицы и длинные значения */
table,
.ap-work-info-value,
.deal-info-value,
.detail-info-value,
.notification-card,
.support-ticket-card,
.dispute-card {
    overflow-wrap: anywhere;
}

/* Адаптив рабочих разделов */
@media (max-width: 980px) {
    .deals-filter-grid,
    .deals-filter-grid-three,
    .price-filter-grid,
    .deal-grid,
    .ap-work-grid,
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .detail-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .deals-filter-grid,
    .deals-filter-grid-three,
    .price-filter-grid,
    .deal-grid,
    .ap-work-grid,
    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .ap-page-header,
    .deal-card-top,
    .price-header,
    .detail-header {
        align-items: stretch !important;
    }

    .ap-actions > *,
    .ap-work-actions > *,
    .price-filter-actions > * {
        width: 100% !important;
    }
}



/* Правки 03: рабочие фильтры, чаты и карточки */
.ap-chat-message-form {
    width: 100% !important;
    margin-bottom: 24px !important;
}

.ap-chat-message-form textarea,
#offer-chat-form textarea,
#deal-chat-form textarea {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    min-height: 210px !important;
    box-sizing: border-box !important;
}

.ap-chat-message-form input[type="file"] {
    width: 100% !important;
    max-width: 100% !important;
}

.support-ticket-open-hint,
.notification-detail-hint {
    display: none !important;
}

.workspace-grid .ap-work-card-company,
.ap-work-card-company {
    background: #ffffff !important;
    border-color: #fde68a !important;
    border-left-color: #f59e0b !important;
    border-left-width: 6px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

.workspace-grid .ap-work-card-company:hover,
.ap-work-card-company:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.11) !important;
    transform: translateY(-1px);
}

.ap-work-badge-company {
    background: #f59e0b !important;
    color: #111827 !important;
}

/* Единый стиль карточек рабочего пространства менеджера */
.workspace-grid .ap-work-card {
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    min-height: 178px !important;
    padding: 20px 22px !important;
    border: 1px solid rgba(229, 231, 235, 0.94) !important;
    border-left-width: 6px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07) !important;
    color: inherit !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease !important;
}

.workspace-grid .ap-work-card::after {
    content: "";
    position: absolute;
    top: -54px;
    right: -54px;
    width: 142px;
    height: 142px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.045;
    pointer-events: none;
}

.workspace-grid .ap-work-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13) !important;
    text-decoration: none !important;
}

.workspace-grid .ap-work-card-top {
    min-height: 58px !important;
    margin-bottom: 14px !important;
}

.workspace-grid .ap-work-card-title {
    margin-bottom: 7px !important;
    line-height: 1.25 !important;
}

.workspace-grid .ap-work-muted {
    color: #4b5563 !important;
}

.workspace-grid .ap-work-card-moderation {
    color: #166534 !important;
    border-left-color: #16a34a !important;
    border-color: #bbf7d0 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
}

.workspace-grid .ap-work-card-price {
    color: #1d4ed8 !important;
    border-left-color: #2563eb !important;
    border-color: #bfdbfe !important;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
}

.workspace-grid .ap-work-card-company {
    color: #92400e !important;
    border-left-color: #f59e0b !important;
    border-color: #fde68a !important;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
}

.workspace-grid .ap-work-card-manager {
    color: #7e22ce !important;
    border-left-color: #9333ea !important;
    border-color: #e9d5ff !important;
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%) !important;
}

.workspace-grid .ap-work-card-dispute {
    color: #be123c !important;
    border-left-color: #e11d48 !important;
    border-color: #fecdd3 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%) !important;
}

.workspace-grid .ap-work-card-support {
    color: #6d28d9 !important;
    border-left-color: #7c3aed !important;
    border-color: #ddd6fe !important;
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%) !important;
}

.workspace-grid .ap-work-card-task {
    color: #334155 !important;
    border-left-color: #475569 !important;
    border-color: #cbd5e1 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
}

.workspace-grid .ap-work-card-role {
    color: #0f766e !important;
    border-left-color: #14b8a6 !important;
    border-color: #99f6e4 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%) !important;
}

.workspace-grid .ap-work-card-audit {
    color: #3730a3 !important;
    border-left-color: #4f46e5 !important;
    border-color: #c7d2fe !important;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%) !important;
}

.workspace-grid .ap-work-card-cancel-review {
    color: #0e7490 !important;
    border-left-color: #0891b2 !important;
    border-color: #a5f3fc !important;
    background: linear-gradient(135deg, #ffffff 0%, #ecfeff 100%) !important;
}

.workspace-grid .ap-work-badge-task {
    background: #475569 !important;
    color: #ffffff !important;
}

.workspace-grid .ap-work-badge-role {
    background: #14b8a6 !important;
    color: #083344 !important;
}

.workspace-grid .ap-work-badge-audit {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

.workspace-grid .ap-work-meta-pill {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
}



/*
    Финальная унификация карточек рабочего пространства менеджера.
    Все карточки имеют одинаковую платформенную структуру, тень, рамку и фон.
    Различается только цветовой акцент сверху и цвет счётчика.
*/
.workspace-grid .ap-work-card {
    --workspace-accent: #1f4b2c;
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    min-height: 178px !important;
    padding: 22px 22px 20px 22px !important;
    border: 1px solid #e5e7eb !important;
    border-left: 1px solid #e5e7eb !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.075) !important;
    color: #111827 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease !important;
}

.workspace-grid .ap-work-card::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: 5px !important;
    border-left: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    background: var(--workspace-accent) !important;
    opacity: 0.92 !important;
    pointer-events: none !important;
}

.workspace-grid .ap-work-card::after {
    content: "" !important;
    position: absolute !important;
    top: -58px !important;
    right: -58px !important;
    width: 148px !important;
    height: 148px !important;
    border-radius: 999px !important;
    background: var(--workspace-accent) !important;
    opacity: 0.055 !important;
    pointer-events: none !important;
}

.workspace-grid .ap-work-card:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(148, 163, 184, 0.55) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13) !important;
    text-decoration: none !important;
}

.workspace-grid .ap-work-card-top {
    position: relative !important;
    z-index: 1 !important;
    min-height: 58px !important;
    margin-bottom: 14px !important;
}

.workspace-grid .ap-work-card-title {
    margin-bottom: 7px !important;
    color: #111827 !important;
    line-height: 1.25 !important;
}

.workspace-grid .ap-work-card p,
.workspace-grid .ap-work-muted {
    position: relative !important;
    z-index: 1 !important;
    color: #4b5563 !important;
}

.workspace-grid .ap-work-card-moderation { --workspace-accent: #16a34a; }
.workspace-grid .ap-work-card-price { --workspace-accent: #2563eb; }
.workspace-grid .ap-work-card-company { --workspace-accent: #f59e0b; }
.workspace-grid .ap-work-card-manager { --workspace-accent: #9333ea; }
.workspace-grid .ap-work-card-dispute { --workspace-accent: #e11d48; }
.workspace-grid .ap-work-card-support { --workspace-accent: #7c3aed; }
.workspace-grid .ap-work-card-task { --workspace-accent: #475569; }
.workspace-grid .ap-work-card-role { --workspace-accent: #14b8a6; }
.workspace-grid .ap-work-card-audit { --workspace-accent: #4f46e5; }
.workspace-grid .ap-work-card-cancel-review { --workspace-accent: #0891b2; }

.workspace-grid .ap-work-badge {
    position: relative !important;
    z-index: 1 !important;
    background: var(--workspace-accent) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10) !important;
}

.workspace-grid .ap-work-badge-company,
.workspace-grid .ap-work-card-company .ap-work-badge {
    color: #111827 !important;
}

.workspace-grid .ap-work-meta-row,
.workspace-grid .ap-work-meta-pill {
    position: relative !important;
    z-index: 1 !important;
}

.workspace-grid .ap-work-meta-pill {
    background: rgba(255, 255, 255, 0.86) !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
    color: #374151 !important;
}


/*
    Полировка форм рабочих сценариев.
    Создание лота, заявки, предложения, спора и обращения в поддержку.
    Только визуальный слой: бизнес-логика, маршруты и валидация форм не меняются.
*/
.ap-workflow-form-page,
.ap-form-page {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.ap-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.92);
}

.ap-form-header h1 {
    margin: 0 0 8px 0;
    color: var(--ap-color-text, #111827);
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.ap-form-header p {
    margin: 0;
    max-width: 720px;
    color: var(--ap-color-text-muted, #6b7280);
    line-height: 1.5;
}

.ap-form-helper,
.ap-form-context-card,
.ap-workflow-form {
    border: 1px solid var(--ap-color-border, #e5e7eb);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045);
}

.ap-form-helper {
    margin-bottom: 16px;
    padding: 15px 17px;
    color: #374151;
    line-height: 1.5;
}

.ap-form-helper-success {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #ffffff 0%, var(--ap-color-success-soft, #f0fdf4) 100%);
}

.ap-form-helper-blue {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #ffffff 0%, var(--ap-color-blue-soft, #eff6ff) 100%);
}

.ap-form-helper-warning {
    border-color: #fde68a;
    background: linear-gradient(135deg, #ffffff 0%, var(--ap-color-warning-soft, #fffbeb) 100%);
}

.ap-form-helper-danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #ffffff 0%, var(--ap-color-danger-soft, #fef2f2) 100%);
    color: #7f1d1d;
}

.ap-form-helper-purple {
    border-color: #ddd6fe;
    background: linear-gradient(135deg, #ffffff 0%, var(--ap-color-purple-soft, #f5f3ff) 100%);
}

.ap-form-context-card {
    margin-bottom: 16px;
    padding: 17px 18px;
    border-left-width: 6px;
}

.ap-form-context-card-success {
    border-left-color: var(--ap-color-success, #16a34a);
}

.ap-form-context-card-blue {
    border-left-color: var(--ap-color-blue, #2563eb);
}

.ap-form-context-card-danger {
    border-left-color: var(--ap-color-danger, #dc2626);
}

.ap-form-context-title {
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 900;
    color: var(--ap-color-text, #111827);
}

.ap-form-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ap-form-context-grid div,
.ap-form-text-list div {
    border: 1px solid rgba(209, 213, 219, 0.78);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.78);
    padding: 11px 12px;
}

.ap-form-context-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--ap-color-text-muted, #6b7280);
    font-size: 12px;
    font-weight: 800;
}

.ap-form-context-grid strong {
    color: var(--ap-color-text, #111827);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ap-form-text-list {
    display: grid;
    gap: 8px;
    color: #374151;
    line-height: 1.45;
}

.ap-workflow-form {
    padding: 22px;
}

.ap-form-grid {
    display: grid;
    gap: 16px;
}

.ap-form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap-form-field-wide {
    grid-column: 1 / -1;
}

.ap-form-field label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 14px;
    font-weight: 900;
}

.ap-required {
    color: var(--ap-color-danger, #dc2626);
    margin-left: 3px;
}

.ap-form-field input,
.ap-form-field select,
.ap-form-field textarea,
.ap-workflow-form input,
.ap-workflow-form select,
.ap-workflow-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #ffffff;
    color: var(--ap-color-text, #111827);
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
}

.ap-form-field input,
.ap-form-field select,
.ap-workflow-form input,
.ap-workflow-form select {
    min-height: 44px;
    padding: 10px 12px;
}

.ap-form-field textarea,
.ap-workflow-form textarea {
    min-height: 170px;
    padding: 13px 14px;
    resize: vertical;
}

.ap-form-field input[type="file"],
.ap-workflow-form input[type="file"] {
    min-height: auto;
    padding: 11px 12px;
    background: var(--ap-color-surface-soft, #f8fafc);
}

.ap-form-field input:focus,
.ap-form-field select:focus,
.ap-form-field textarea:focus,
.ap-workflow-form input:focus,
.ap-workflow-form select:focus,
.ap-workflow-form textarea:focus {
    outline: none;
    border-color: var(--ap-color-primary, #1f4b2c);
    box-shadow: 0 0 0 3px rgba(31, 75, 44, 0.13);
}

.ap-form-help {
    margin-top: 7px;
    color: var(--ap-color-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.45;
}

.ap-form-errors,
.ap-field-errors {
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    line-height: 1.45;
}

.ap-form-errors {
    margin-bottom: 16px;
    padding: 12px 14px;
}

.ap-field-errors {
    margin-top: 8px;
    padding: 9px 11px;
    font-size: 13px;
}

.ap-field-errors ul,
.ap-form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.ap-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(229, 231, 235, 0.92);
}

.ap-form-footer-note {
    max-width: 460px;
    color: var(--ap-color-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.45;
}

.ap-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Специальные сценарии */
.ap-dispute-form textarea,
.ap-support-ticket-form textarea,
.ap-offer-form textarea {
    min-height: 210px;
}

.ap-lot-form-page .ap-workflow-form,
.ap-buy-request-form-page .ap-workflow-form {
    border-top: 5px solid var(--ap-color-primary, #1f4b2c);
}

.ap-buy-request-form-page .ap-workflow-form {
    border-top-color: var(--ap-color-blue, #2563eb);
}

.ap-offer-form-page .ap-workflow-form {
    border-top: 5px solid var(--ap-color-warning, #f59e0b);
}

.ap-dispute-create-page .ap-workflow-form {
    border-top: 5px solid var(--ap-color-danger, #dc2626);
}

.ap-support-form-page .ap-workflow-form {
    border-top: 5px solid var(--ap-color-purple, #7c3aed);
}

@media (max-width: 860px) {
    .ap-form-grid-two,
    .ap-form-context-grid {
        grid-template-columns: 1fr;
    }

    .ap-form-header {
        align-items: stretch;
    }

    .ap-form-header > .btn,
    .ap-form-actions > * {
        width: 100% !important;
    }

    .ap-form-footer {
        align-items: stretch;
    }

    .ap-form-footer-note {
        max-width: none;
    }
}



/*
    Полировка формы создания лота и заявки: поля не должны слипаться.
    Бизнес-логика не меняется: правится только расстояние, визуальная группировка и читаемость.
*/
.ap-object-parameters-section {
    margin-top: 18px !important;
    margin-bottom: 22px !important;
    padding: 24px !important;
    border: 1px solid rgba(209, 213, 219, 0.82) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055) !important;
}

.ap-form-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.94) !important;
}

.ap-form-section-head h2 {
    margin: 0 0 6px 0 !important;
    color: #111827 !important;
    font-size: 21px !important;
    line-height: 1.25 !important;
    letter-spacing: -0.025em !important;
}

.ap-form-section-head p {
    margin: 0 !important;
    max-width: 760px !important;
    color: #6b7280 !important;
    line-height: 1.5 !important;
}

.ap-object-form-grid {
    gap: 26px 32px !important;
    align-items: start !important;
}

.ap-object-form .ap-form-field-card {
    min-height: 112px !important;
    padding: 16px 17px 18px 17px !important;
    border: 1px solid rgba(209, 213, 219, 0.88) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035) !important;
    box-sizing: border-box !important;
}

.ap-object-form .ap-form-field-card label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

.ap-object-form .ap-form-field-card input,
.ap-object-form .ap-form-field-card select,
.ap-object-form .ap-form-field-card textarea {
    min-height: 48px !important;
    border-radius: 13px !important;
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
    font-size: 15px !important;
}

.ap-object-form .ap-form-field-card textarea {
    min-height: 150px !important;
}

.ap-object-form .ap-form-field-comment {
    grid-column: 1 / -1;
    min-width: 0;
}

.ap-object-form .ap-form-field-comment textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.ap-object-additional-comment,
.ap-market-additional-comment {
    min-width: 0;
}

.ap-object-additional-comment-text,
.ap-market-additional-comment-text {
    color: #334155;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ap-object-form .ap-form-field-culture,
.ap-object-form .ap-form-field-region,
.ap-object-form .ap-form-field-delivery_basis {
    border-left: 5px solid #16a34a !important;
}

.ap-buy-request-form .ap-form-field-culture,
.ap-buy-request-form .ap-form-field-region,
.ap-buy-request-form .ap-form-field-delivery_basis {
    border-left-color: #2563eb !important;
}

.ap-object-form .ap-form-field-price,
.ap-object-form .ap-form-field-volume,
.ap-object-form .ap-form-field-available_from,
.ap-object-form .ap-form-field-needed_by,
.ap-object-form .ap-form-field-deadline {
    border-left: 5px solid #f59e0b !important;
}

.ap-object-form .ap-form-help {
    margin-top: 9px !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
}

.ap-object-form .ap-field-errors {
    margin-top: 10px !important;
}

@media (max-width: 820px) {
    .ap-object-parameters-section {
        padding: 18px !important;
    }

    .ap-object-form-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
}

/*
    Полировка профиля компании и верификации.
    Только визуальный слой: модели, права доступа, маршруты и бизнес-логика не меняются.
*/
.ap-company-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 0 28px 0;
}

.ap-company-page-narrow {
    max-width: 980px;
}

.ap-company-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 22px 24px;
    border: 1px solid #d1fae5;
    border-radius: 22px;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 58%, #eff6ff 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.ap-company-kicker {
    margin-bottom: 7px;
    color: #166534;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ap-company-title {
    margin: 0 0 8px 0;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.035em;
    color: #111827;
}

.ap-company-subtitle {
    margin: 0;
    max-width: 720px;
    color: #4b5563;
    line-height: 1.5;
}

.ap-company-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ap-company-actions-left {
    justify-content: flex-start;
    margin-top: 18px;
}

.ap-company-status-card,
.ap-company-card,
.ap-company-filter-card,
.ap-company-manager-card,
.ap-company-stat-card {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.ap-company-status-card {
    margin-bottom: 20px;
    padding: 20px 22px;
    border-left-width: 6px;
}

.ap-company-status-draft { border-left-color: #94a3b8; }
.ap-company-status-pending { border-left-color: #2563eb; }
.ap-company-status-verified { border-left-color: #16a34a; }
.ap-company-status-rejected { border-left-color: #dc2626; }
.ap-company-status-suspended { border-left-color: #f59e0b; }

.ap-company-status-main,
.ap-company-manager-top,
.ap-company-document-top,
.ap-company-history-top,
.ap-company-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.ap-company-status-main h2,
.ap-company-manager-top h2,
.ap-company-card-head h2,
.ap-company-card h2 {
    margin: 0;
    color: #111827;
    letter-spacing: -0.025em;
}

.ap-company-card-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.ap-company-card-head p {
    margin: 6px 0 0 0;
    color: #6b7280;
    line-height: 1.45;
}

.ap-company-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.ap-company-meta-row span,
.ap-company-history-meta span,
.ap-company-history-statuses span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
}

.ap-company-status-badge,
.ap-company-document-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    border: 1px solid transparent;
}

.ap-company-status-badge-draft { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.ap-company-status-badge-pending { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ap-company-status-badge-verified { background: #ecfdf5; color: #166534; border-color: #bbf7d0; }
.ap-company-status-badge-rejected { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ap-company-status-badge-suspended { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.ap-company-status-comment,
.ap-company-document-comment {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    color: #374151;
    line-height: 1.45;
}

.ap-company-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.ap-company-card {
    padding: 22px;
}

.ap-company-form,
.ap-company-document-form,
.ap-company-send-form,
.ap-company-document-review-form {
    display: grid;
    gap: 16px;
}

.ap-company-send-form {
    margin: 16px 0;
}

.ap-company-form-section {
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.ap-company-form-section h3 {
    margin: 0 0 14px 0;
    color: #111827;
    letter-spacing: -0.02em;
}

.ap-company-form-grid,
.ap-company-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.ap-company-field-full,
.ap-company-info-full {
    grid-column: 1 / -1;
}

.ap-company-field {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.035);
}

.ap-company-field-accent {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.ap-company-field label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

.ap-company-field input,
.ap-company-field select,
.ap-company-field textarea {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    box-sizing: border-box;
}

.ap-company-field textarea {
    min-height: 150px;
}

.ap-company-help,
.ap-company-document-meta,
.ap-company-history-date,
.ap-company-history-meta,
.ap-company-history-statuses {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

.ap-company-error {
    margin-top: 7px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.ap-company-documents-list,
.ap-company-manager-documents,
.ap-company-history-list,
.ap-company-manager-list {
    display: grid;
    gap: 14px;
}

.ap-company-document-card,
.ap-company-history-item {
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-left-width: 5px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.045);
}

.ap-company-document-pending { border-left-color: #2563eb; }
.ap-company-document-approved { border-left-color: #16a34a; }
.ap-company-document-rejected { border-left-color: #dc2626; }
.ap-company-document-needs_clarification { border-left-color: #f59e0b; }

.ap-company-document-title,
.ap-company-history-title {
    color: #111827;
    font-weight: 900;
}

.ap-company-document-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ap-company-small-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.ap-company-small-btn:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.ap-company-small-btn-danger {
    border-color: #fecaca;
    color: #991b1b;
}

.ap-company-small-btn-danger:hover {
    background: #fef2f2;
    color: #991b1b;
}

.ap-company-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    color: #6b7280;
    line-height: 1.45;
}

.ap-company-history-card,
.ap-company-docs-wide {
    margin-top: 20px;
}

.ap-company-history-item {
    border-left-color: #f59e0b;
}

.ap-company-history-description {
    margin-top: 8px;
    color: #374151;
    line-height: 1.5;
    white-space: pre-line;
}

.ap-company-history-meta,
.ap-company-history-statuses {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ap-company-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.ap-company-stat-card {
    display: block;
    padding: 15px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ap-company-stat-card:hover,
.ap-company-manager-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.11);
}

.ap-company-stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ap-company-stat-card strong {
    color: #111827;
    font-size: 28px;
    line-height: 1;
}

.ap-company-filter-card {
    margin-bottom: 18px;
    padding: 16px;
}

.ap-company-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.ap-company-manager-card {
    display: block;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    border-left-width: 6px;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ap-company-manager-draft { border-left-color: #94a3b8; }
.ap-company-manager-pending { border-left-color: #2563eb; }
.ap-company-manager-verified { border-left-color: #16a34a; }
.ap-company-manager-rejected { border-left-color: #dc2626; }
.ap-company-manager-suspended { border-left-color: #f59e0b; }

.ap-company-manager-metrics,
.ap-company-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.ap-company-manager-metrics div,
.ap-company-info-grid div {
    padding: 11px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.ap-company-manager-metrics span,
.ap-company-info-grid span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.ap-company-manager-metrics strong,
.ap-company-info-grid strong {
    color: #111827;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.ap-company-manager-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: #6b7280;
    font-size: 13px;
}

.ap-company-manager-footer strong {
    color: #166534;
}

.ap-company-document-review-form {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f9fafb;
}

@media (max-width: 1100px) {
    .ap-company-stats-grid,
    .ap-company-manager-metrics,
    .ap-company-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ap-company-layout,
    .ap-company-form-grid,
    .ap-company-filter-grid {
        grid-template-columns: 1fr;
    }

    .ap-company-field-full,
    .ap-company-info-full {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .ap-company-hero,
    .ap-company-card,
    .ap-company-status-card {
        padding: 16px;
    }

    .ap-company-stats-grid,
    .ap-company-manager-metrics,
    .ap-company-info-grid {
        grid-template-columns: 1fr;
    }

    .ap-company-actions > *,
    .ap-company-filter-actions > *,
    .ap-company-document-actions > * {
        width: 100%;
    }
}


/* Онбординг и личный кабинет нового пользователя */
.ap-auth-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px;
}

.ap-auth-page-wide {
    max-width: 660px;
}

.ap-auth-card {
    padding: 26px;
    border: 1px solid var(--ap-color-border, #e5e7eb);
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #f0fdf4 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.ap-auth-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 10px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
}

.ap-auth-title {
    margin: 0 0 8px 0;
    color: #111827;
    letter-spacing: -0.035em;
}

.ap-auth-subtitle {
    margin: 0 0 20px 0;
    color: #4b5563;
    line-height: 1.5;
}

.ap-auth-form {
    display: grid;
    gap: 16px;
}

.ap-auth-field {
    display: grid;
    gap: 7px;
}

.ap-auth-field label {
    color: #374151;
    font-weight: 900;
}

.ap-auth-field input,
.ap-auth-field select,
.ap-auth-field textarea,
.ap-auth-form input[type="text"],
.ap-auth-form input[type="password"],
.ap-auth-form input[type="email"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #ffffff;
    font: inherit;
    box-sizing: border-box;
}

.ap-auth-field input:focus,
.ap-auth-field select:focus,
.ap-auth-field textarea:focus,
.ap-auth-form input:focus {
    outline: 3px solid rgba(34, 197, 94, 0.18);
    border-color: #16a34a;
}

.ap-auth-next {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(229, 231, 235, 0.95);
}

.ap-auth-next h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #111827;
}

.ap-auth-next p {
    margin: 0 0 14px 0;
    color: #4b5563;
    line-height: 1.45;
}

.dashboard-onboarding-step .dashboard-onboarding-action + .dashboard-onboarding-action {
    margin-top: -6px;
}

@media (max-width: 640px) {
    .ap-auth-page {
        padding: 14px 0;
    }

    .ap-auth-card {
        padding: 20px;
        border-radius: 18px;
    }
}

/*
    Полная страница рейтинга компании.
    Визуальная полировка страницы /companies/reputation/ без изменения расчётов рейтинга.
*/
.ap-reputation-page {
    display: grid;
    gap: 20px;
}

.ap-reputation-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 20px;
    align-items: stretch;
    padding: 24px;
    border: 1px solid #d1fae5;
    border-radius: 24px;
    background:
        radial-gradient(circle at right top, rgba(37, 99, 235, 0.10), transparent 18rem),
        linear-gradient(135deg, #ecfdf5 0%, #ffffff 58%, #eff6ff 100%);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.ap-reputation-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ap-reputation-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ap-reputation-score-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    padding: 22px;
    border: 1px solid #bbf7d0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 22px rgba(22, 101, 52, 0.10);
}

.ap-reputation-score-label {
    color: #166534;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ap-reputation-score-value {
    margin-top: 8px;
    color: #14532d;
    font-size: clamp(46px, 6vw, 68px);
    font-weight: 950;
    line-height: 0.96;
    letter-spacing: -0.07em;
}

.ap-reputation-score-scale {
    margin-top: 6px;
    color: #374151;
    font-weight: 900;
}

.ap-reputation-score-company {
    margin-top: 16px;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.ap-reputation-score-note {
    margin-top: 7px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.ap-reputation-section {
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055);
}

.ap-reputation-section-main {
    border-color: #bbf7d0;
}

.ap-reputation-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.ap-reputation-section-head h2 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.ap-reputation-section-head p {
    margin: 7px 0 0 0;
    max-width: 740px;
    color: #6b7280;
    line-height: 1.45;
}

.ap-reputation-metric-grid {
    display: grid;
    gap: 12px;
}

.ap-reputation-metric-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ap-reputation-metric-grid-seven {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ap-reputation-metric-card {
    min-height: 132px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ap-reputation-metric-card span,
.ap-reputation-mini-grid span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;
}

.ap-reputation-metric-card strong {
    display: block;
    margin-top: 9px;
    color: #111827;
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.045em;
}

.ap-reputation-metric-card small {
    display: block;
    margin-top: 9px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.ap-reputation-metric-primary {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
}

.ap-reputation-date-value {
    font-size: 20px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.025em !important;
}

.ap-reputation-group-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ap-reputation-group-card {
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-left: 6px solid #16a34a;
    border-radius: 18px;
    background: #f8fafc;
}

.ap-reputation-group-card:nth-child(2) {
    border-left-color: #2563eb;
}

.ap-reputation-group-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.ap-reputation-group-title {
    margin-bottom: 12px;
    color: #111827;
    font-size: 17px;
    font-weight: 950;
    letter-spacing: -0.02em;
}

.ap-reputation-mini-grid {
    display: grid;
    gap: 10px;
}

.ap-reputation-mini-grid div {
    padding: 12px;
    border: 1px solid rgba(209, 213, 219, 0.85);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

.ap-reputation-mini-grid strong {
    display: block;
    margin-top: 6px;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    font-weight: 950;
}

.ap-reputation-filter-card {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
}

.ap-reputation-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.ap-reputation-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ap-reputation-timeline {
    position: relative;
    display: grid;
    gap: 14px;
}

.ap-reputation-event {
    position: relative;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
}

.ap-reputation-event-marker {
    width: 14px;
    height: 14px;
    margin: 18px auto 0 auto;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 2px #cbd5e1;
}

.ap-reputation-event-positive .ap-reputation-event-marker {
    background: #16a34a;
    box-shadow: 0 0 0 2px #bbf7d0;
}

.ap-reputation-event-negative .ap-reputation-event-marker {
    background: #dc2626;
    box-shadow: 0 0 0 2px #fecaca;
}

.ap-reputation-event-body {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.045);
}

.ap-reputation-event-positive .ap-reputation-event-body {
    border-left: 5px solid #16a34a;
}

.ap-reputation-event-negative .ap-reputation-event-body {
    border-left: 5px solid #dc2626;
}

.ap-reputation-event-neutral .ap-reputation-event-body {
    border-left: 5px solid #94a3b8;
}

.ap-reputation-event-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.ap-reputation-event-top h3 {
    margin: 0;
    color: #111827;
    font-size: 17px;
    font-weight: 950;
    letter-spacing: -0.02em;
}

.ap-reputation-event-role,
.ap-reputation-event-top time {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
}

.ap-reputation-event-description {
    margin: 11px 0 0 0;
    color: #374151;
    line-height: 1.5;
    white-space: pre-line;
}

.ap-reputation-event-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ap-reputation-event-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 850;
}

.ap-reputation-empty {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    color: #6b7280;
}

.ap-reputation-empty strong {
    color: #111827;
    font-size: 16px;
}

@media (max-width: 980px) {
    .ap-reputation-hero,
    .ap-reputation-group-grid {
        grid-template-columns: 1fr;
    }

    .ap-reputation-metric-grid-four,
    .ap-reputation-metric-grid-seven,
    .ap-reputation-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-reputation-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .ap-reputation-hero,
    .ap-reputation-metric-grid-four,
    .ap-reputation-metric-grid-seven,
    .ap-reputation-filter-grid {
        grid-template-columns: 1fr;
    }

    .ap-reputation-section,
    .ap-reputation-hero {
        padding: 18px;
    }

    .ap-reputation-event {
        grid-template-columns: 1fr;
    }

    .ap-reputation-event-marker {
        display: none;
    }
}

/*
    Навигационный центр уведомлений.
    Закрепляет единый hover, readable-карточки, заметное состояние непрочитанных и русские UI-метки без подсказок к действиям.
*/
.notifications-page .notification-card,
.notifications-page .notifications-summary-card,
.notifications-page .notifications-group,
.notification-detail-page .notification-detail-card {
    border-radius: 18px !important;
}

.notifications-page .notification-card {
    border-left-width: 6px !important;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.045) !important;
    transform: translateY(0);
}

.notifications-page .notification-card:hover,
.notifications-page .notification-card:focus-visible,
.notification-detail-page .notification-detail-card:hover,
.notification-detail-page .notification-detail-card:focus-visible {
    border-color: #bbf7d0 !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
    transform: translateY(-2px) !important;
}

.notifications-page .notification-unread,
.notifications-page .notification-card-unread {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-top-color: #bbf7d0 !important;
    border-right-color: #bbf7d0 !important;
    border-bottom-color: #bbf7d0 !important;
}

.notifications-page .notification-read,
.notifications-page .notification-card-read {
    opacity: 0.78;
    background: #fbfbfb !important;
}


.notifications-page .notification-pill-new {
    border-color: #bbf7d0 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
}


/*
    Диалоговый интерфейс поддержки.
    Карточки обращений кликабельны целиком; отдельные подсказки к действиям на карточках не используются.
*/

.support-page {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.support-manager-page {
    max-width: 1200px;
}

.support-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px;
    border: 1px solid #d1fae5;
    border-radius: var(--ap-radius-xl);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 58%, #ecfdf5 100%);
    box-shadow: var(--ap-shadow-sm);
}

.support-kicker {
    margin-bottom: 8px;
    color: var(--ap-color-primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.support-page-title {
    margin: 0 0 8px 0;
    color: var(--ap-color-text);
    line-height: 1.15;
}

.support-page-subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--ap-color-text-muted);
    line-height: 1.55;
}

.support-hero-actions,
.support-badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.support-back-row a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--ap-color-primary);
    font-weight: 800;
    text-decoration: none;
}

.support-back-row a:hover {
    color: var(--ap-color-primary-dark);
    text-decoration: none;
}

.support-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.support-summary-card {
    padding: 16px;
    border: 1px solid var(--ap-color-border);
    border-radius: var(--ap-radius-lg);
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.support-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--ap-color-text-muted);
    font-size: 13px;
    font-weight: 800;
}

.support-summary-card strong {
    color: var(--ap-color-text);
    font-size: 30px;
    line-height: 1;
    font-weight: 950;
}

.support-card-top,
.support-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.support-section-head {
    margin-bottom: 14px;
}

.support-section-head h2 {
    margin: 0 0 6px 0;
}

.support-section-head p {
    margin: 0;
    color: var(--ap-color-text-muted);
}

.support-card-title {
    margin: 0 0 6px 0;
    color: var(--ap-color-text);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 900;
}

.support-card-text {
    margin: 14px 0 0 0;
    color: #374151;
    line-height: 1.5;
}

.support-card-footer {
    display: flex;
    gap: 8px 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--ap-color-text-muted);
    font-size: 13px;
    font-weight: 700;
}

.support-ticket-card,
.manager-ticket-card {
    padding: 18px;
    cursor: pointer;
    color: inherit;
}

.support-ticket-card-open,
.manager-ticket-card.support-ticket-card-open {
    border-left-color: var(--ap-color-primary) !important;
}

.support-ticket-card-progress,
.manager-ticket-card.support-ticket-card-progress {
    border-left-color: var(--ap-color-blue) !important;
}

.support-ticket-card-answered,
.manager-ticket-card.support-ticket-card-answered {
    border-left-color: var(--ap-color-success) !important;
}

.support-ticket-card-closed,
.manager-ticket-card.support-ticket-card-closed {
    border-left-color: #94a3b8 !important;
    background: #f8fafc !important;
}

.support-status-open {
    border-color: #bbf7d0 !important;
    background: var(--ap-color-success-soft) !important;
    color: #166534 !important;
}

.support-status-progress {
    border-color: #bfdbfe !important;
    background: var(--ap-color-blue-soft) !important;
    color: #1d4ed8 !important;
}

.support-status-answered {
    border-color: #d1fae5 !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
}

.support-status-closed {
    border-color: #e5e7eb !important;
    background: #f8fafc !important;
    color: #475569 !important;
}

.support-priority-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.support-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.support-info-card {
    padding: 14px;
    border: 1px solid var(--ap-color-border);
    border-radius: 14px;
    background: var(--ap-color-surface-soft);
}

.support-info-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--ap-color-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.support-info-card strong {
    color: var(--ap-color-text);
    font-weight: 900;
}

.support-detail-card,
.support-thread-card,
.support-reply-card,
.support-form {
    padding: 20px;
}

.support-thread-card,
.support-reply-card {
    border: 1px solid var(--ap-color-border);
    border-radius: var(--ap-radius-lg);
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.support-message-text {
    white-space: pre-line;
    line-height: 1.55;
    color: var(--ap-color-text);
}

.support-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.support-form-field {
    display: grid;
    gap: 7px;
}

.support-form-field-wide {
    grid-column: 1 / -1;
}

.support-form-field label {
    color: #374151;
    font-weight: 900;
}

.support-form-note {
    color: var(--ap-color-text-muted);
    font-size: 13px;
}

.support-reply-form,
.manager-ticket-form {
    display: grid;
    gap: 14px;
}

.support-close-form {
    margin-top: 12px;
}

.support-empty-state {
    display: grid;
    gap: 8px;
    padding: 22px;
    border: 1px solid #dbeafe;
    border-radius: var(--ap-radius-lg);
    background: #eff6ff;
    color: #1e40af;
    line-height: 1.45;
}

.support-empty-state strong {
    color: #1e3a8a;
}

.support-filter {
    padding: 16px;
}

.support-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

@media (max-width: 980px) {
    .support-summary-grid,
    .support-info-grid,
    .support-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .support-hero,
    .support-card-top,
    .support-section-head {
        align-items: stretch;
    }

    .support-summary-grid,
    .support-info-grid,
    .support-form-grid,
    .support-filter-grid {
        grid-template-columns: 1fr;
    }

    .support-hero-actions,
    .support-badge-row {
        justify-content: flex-start;
    }
}

/*
    UI-полировка рабочего узла сделок.
    Спокойный рабочий вид: компактный список, читаемая карточка сделки, условия, стороны, подтверждения, переговоры и проблемы без изменения бизнес-логики.
*/

.deal-workflow-page,
.deal-workflow-detail {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.deal-workflow-header,
.deal-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 2px 2px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2px;
}

.deal-workflow-title,
.deal-detail-title {
    margin: 0 0 6px 0;
    color: #111827;
    letter-spacing: -0.025em;
}

.deal-workflow-subtitle,
.deal-detail-subtitle {
    max-width: 760px;
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.deal-workflow-counts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.deal-workflow-counts > div {
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
}

.deal-workflow-counts span,
.deal-workflow-info span,
.deal-workflow-parties span,
.deal-workflow-progress span,
.deal-party-card span,
.deal-detail-info span,
.deal-detail-text-block span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.deal-workflow-counts strong,
.deal-workflow-info strong,
.deal-workflow-parties strong,
.deal-workflow-progress strong,
.deal-party-card strong,
.deal-detail-info strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.deal-workflow-filter-compact {
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.deal-filter-checkbox-wrap {
    display: flex;
    align-items: end;
}

.deal-filter-actions,
.deal-detail-actions-inline,
.deal-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.deal-workflow-list {
    display: grid;
    gap: 12px;
}

.deal-workflow-card {
    padding: 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.deal-workflow-card:hover,
.deal-workflow-card:focus-within {
    transform: translateY(-2px);
    border-color: #bbf7d0 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.deal-workflow-card-main {
    display: grid;
    gap: 12px;
}

.deal-workflow-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.deal-workflow-card-title {
    margin: 0 0 6px 0 !important;
    font-size: 18px !important;
    font-weight: 850 !important;
}

.deal-workflow-card-meta,
.deal-workflow-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.deal-workflow-card-actions {
    justify-content: flex-end;
}

.deal-role-badge,
.deal-stage-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.deal-role-badge {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.deal-stage-alignment {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.deal-stage-action,
.deal-stage-broken,
.deal-stage-dispute {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.deal-stage-execution {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.deal-stage-completed {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.deal-stage-closed {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.deal-workflow-metrics,
.deal-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.deal-workflow-info,
.deal-detail-info,
.deal-party-card {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.deal-workflow-parties,
.deal-workflow-progress,
.deal-party-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.deal-workflow-parties,
.deal-workflow-progress {
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.deal-workflow-parties > div,
.deal-workflow-progress > div {
    min-width: 0;
}

.deal-workflow-empty {
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    color: #64748b;
}

.deal-detail-card {
    padding: 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.035) !important;
}

.deal-detail-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.deal-detail-section-head h2,
.deal-detail-card h2 {
    margin: 0 0 4px 0;
    color: #111827;
    font-size: 18px;
    letter-spacing: -0.015em;
}

.deal-detail-section-head p,
.deal-detail-card p,
.deal-detail-note {
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.deal-party-card small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.deal-actions-panel {
    border-color: #bbf7d0 !important;
    background: #fbfefc !important;
}

.deal-attention-card {
    border-left: 4px solid #2563eb !important;
}

.deal-warning-card {
    border-left: 4px solid #f59e0b !important;
}

.deal-success-card {
    border-left: 4px solid #16a34a !important;
}

.deal-problem-card {
    border-left: 4px solid #dc2626 !important;
}

.deal-detail-note-box {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
}

.deal-detail-text-block {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.deal-danger-text {
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.deal-detail-text-block p,
.deal-timeline-text {
    margin: 0;
    color: #111827;
    white-space: pre-line;
}

.deal-detail-strong-note {
    margin-top: 8px !important;
    color: #166534 !important;
    font-weight: 750;
}

.deal-timeline {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.deal-timeline-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.deal-timeline-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.deal-timeline-author {
    color: #111827;
    font-weight: 800;
    margin-bottom: 6px;
}

.deal-attachments {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.deal-attachments a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #d1fae5;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 13px;
    font-weight: 750;
}

.deal-actions-card .deal-detail-actions-inline form,
.deal-attention-card .deal-detail-actions-inline form {
    margin: 0;
}

@media (max-width: 900px) {
    .deal-workflow-header,
    .deal-detail-header,
    .deal-workflow-card-title-row {
        display: grid;
    }

    .deal-workflow-counts,
    .deal-workflow-metrics,
    .deal-detail-grid,
    .deal-party-grid,
    .deal-workflow-parties,
    .deal-workflow-progress {
        grid-template-columns: 1fr;
    }

    .deal-workflow-card-actions,
    .deal-detail-actions {
        justify-content: flex-start;
    }
}


/*
    Точечная полировка страницы сделок: светлые верхние плашки и более аккуратный фильтр.
    Бизнес-логика и структура данных не меняются.
*/
.deal-workflow-page .deal-workflow-header,
.deal-workflow-detail .deal-detail-header {
    padding: 18px 20px !important;
    border: 1px solid rgba(209, 213, 219, 0.78) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(circle at top left, rgba(236, 253, 245, 0.78), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #111827 !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07) !important;
    margin-bottom: 4px !important;
}

.deal-workflow-page .deal-workflow-title,
.deal-workflow-detail .deal-detail-title,
.deal-workflow-page .deals-title {
    color: #0f172a !important;
}

.deal-workflow-page .deal-workflow-subtitle,
.deal-workflow-detail .deal-detail-subtitle {
    color: #475569 !important;
}

.deal-workflow-page .deal-workflow-counts > div {
    border-color: rgba(187, 247, 208, 0.92) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;
}

.deal-workflow-page .deal-workflow-counts span,
.deal-workflow-page .deal-workflow-counts strong {
    color: #0f172a !important;
}

.deal-filter-panel.deal-workflow-filter-compact {
    display: grid !important;
    gap: 16px !important;
    padding: 20px !important;
    border: 1px solid rgba(187, 247, 208, 0.95) !important;
    border-radius: 22px !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07) !important;
}

.deal-filter-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.deal-filter-kicker {
    margin-bottom: 6px;
    color: #15803d;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.deal-filter-head h2 {
    margin: 0 0 6px 0;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.deal-filter-head p {
    max-width: 680px;
    margin: 0;
    color: #64748b;
    line-height: 1.45;
}

.deal-filter-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.deal-filter-section {
    display: grid;
    gap: 10px;
}

.deal-filter-section-title {
    color: #334155;
    font-size: 13px;
    font-weight: 850;
}

.deal-filter-grid-polished {
    gap: 12px !important;
}

.deal-filter-field {
    min-width: 0;
}

.deal-filter-field label:not(.deals-filter-checkbox) {
    display: block;
    margin-bottom: 7px;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 850 !important;
}

.deal-filter-field select {
    width: 100%;
    min-height: 44px !important;
    padding: 0 12px !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    border-radius: 14px !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.deal-filter-field select:focus {
    outline: none !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.13) !important;
}

.deal-filter-checkbox-wrap {
    display: flex !important;
    align-items: end !important;
}

.deal-filter-checkbox-polished {
    width: 100%;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(187, 247, 208, 0.95);
    border-radius: 14px;
    background: #f0fdf4;
    color: #166534 !important;
    font-weight: 800 !important;
    cursor: pointer;
}

.deal-filter-checkbox-polished input {
    width: 16px;
    height: 16px;
    accent-color: #16a34a;
}

@media (max-width: 860px) {
    .deal-filter-head,
    .deal-workflow-page .deal-workflow-header,
    .deal-workflow-detail .deal-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .deal-filter-head-actions,
    .deal-detail-actions,
    .deal-workflow-counts {
        justify-content: flex-start !important;
    }
}

/*
    Полировка карточек сделок: карточка открывается целиком, поэтому отдельная кнопка
    "Карточка" не нужна. Основные состояния отмечаются спокойным флажком и цветовым акцентом.
*/
.deal-workflow-card.deal-status-card {
    position: relative;
    overflow: hidden;
    padding-left: 18px !important;
    border-left-width: 5px !important;
}

.deal-status-card .deal-status-flag {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.deal-status-card-alignment {
    border-left-color: #f59e0b !important;
}

.deal-status-card-alignment .deal-status-flag {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.deal-status-card-action {
    border-left-color: #ef4444 !important;
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.78), #ffffff 18%) !important;
}

.deal-status-card-action .deal-status-flag {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.deal-status-card-execution {
    border-left-color: #3b82f6 !important;
}

.deal-status-card-execution .deal-status-flag {
    background: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.deal-status-card-completed {
    border-left-color: #10b981 !important;
}

.deal-status-card-completed .deal-status-flag {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.deal-status-card-dispute,
.deal-status-card-broken {
    border-left-color: #dc2626 !important;
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.82), #ffffff 18%) !important;
}

.deal-status-card-dispute .deal-status-flag,
.deal-status-card-broken .deal-status-flag {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.deal-status-card-closed {
    border-left-color: #94a3b8 !important;
}

.deal-status-card-closed .deal-status-flag {
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.deal-workflow-card.deal-status-card:hover,
.deal-workflow-card.deal-status-card:focus-within {
    border-left-width: 5px !important;
}

.deal-workflow-card-actions .ap-action-neutral[href*="deals"] {
    display: none !important;
}

@media (max-width: 720px) {
    .deal-status-card .deal-status-flag {
        top: 14px;
        right: 14px;
    }
}

/* Рабочий интерфейс предложений: список, фильтр, карточки, детализация */
.offer-workflow-page,
.offer-detail-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.offer-workflow-header,
.offer-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 20px;
    padding: 28px 30px;
    border: 1px solid rgba(187, 247, 208, 0.7);
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fcf8 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}

.offer-workflow-title,
.offer-detail-header h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.offer-workflow-subtitle {
    max-width: 720px;
    margin: 10px 0 0;
    color: #4b5563;
    line-height: 1.6;
}

.offer-detail-kicker,
.offer-filter-kicker {
    margin-bottom: 7px;
    color: #047857;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.offer-workflow-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
    min-width: min(360px, 100%);
}

.offer-workflow-counts > div {
    padding: 14px 16px;
    border: 1px solid rgba(187, 247, 208, 0.9);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.96);
}

.offer-workflow-counts span,
.offer-card-info span,
.offer-card-context span,
.offer-detail-info span,
.offer-detail-text-block span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.offer-workflow-counts strong,
.offer-card-info strong,
.offer-card-context strong,
.offer-detail-info strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.offer-filter-panel {
    margin-bottom: 22px;
    padding: 24px !important;
    border: 1px solid rgba(209, 213, 219, 0.78) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055) !important;
}

.offer-filter-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.offer-filter-heading h2,
.offer-filter-head h2 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.offer-filter-actions,
.offer-filter-head-actions,
.offer-detail-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.offer-filter-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(145px, 1fr));
    gap: 14px;
    align-items: end;
}

.offer-filter-field {
    min-width: 0;
}

.offer-filter-field label:not(.offer-filter-checkbox) {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

.offer-filter-field select,
.offer-filter-field input[type="text"],
.offer-filter-field input[type="search"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    color: #111827;
    font-weight: 700;
}

.offer-filter-field select:focus,
.offer-filter-field input:focus {
    border-color: #16a34a;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
    outline: none;
}

.offer-filter-checkbox-wrap {
    display: flex;
    align-items: end;
}

.offer-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    color: #374151;
    font-weight: 800;
}

.offer-filter-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: #16a34a;
}

.offer-workflow-list {
    display: grid;
    gap: 15px;
}

.offer-workflow-card {
    position: relative;
    display: block;
    padding: 24px 24px 24px 30px;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.95) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055) !important;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.offer-workflow-card:hover {
    transform: translateY(-2px);
    border-color: rgba(22, 163, 74, 0.34) !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10) !important;
}

.offer-status-flag {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: #94a3b8;
}

.offer-status-card-action .offer-status-flag { background: #f59e0b; }
.offer-status-card-negotiation .offer-status-flag { background: #16a34a; }
.offer-status-card-agreed .offer-status-flag { background: #0ea5e9; }
.offer-status-card-dispute .offer-status-flag { background: #dc2626; }
.offer-status-card-closed .offer-status-flag { background: #64748b; }
.offer-status-card-neutral .offer-status-flag { background: #94a3b8; }

.offer-card-title-row,
.offer-detail-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.offer-card-title {
    margin: 0 0 9px;
    color: #111827;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.offer-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-direction-badge,
.offer-stage-badge,
.offer-context-type {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    background: #f8fafc;
    color: #374151;
    font-size: 12px;
    font-weight: 900;
}

.offer-direction-received {
    border-color: rgba(22, 163, 74, 0.28);
    background: #f0fdf4;
    color: #047857;
}

.offer-direction-sent {
    border-color: rgba(14, 165, 233, 0.28);
    background: #f0f9ff;
    color: #0369a1;
}

.offer-stage-action { border-color: rgba(245, 158, 11, 0.35); background: #fffbeb; color: #92400e; }
.offer-stage-negotiation { border-color: rgba(22, 163, 74, 0.28); background: #f0fdf4; color: #047857; }
.offer-stage-agreed { border-color: rgba(14, 165, 233, 0.30); background: #f0f9ff; color: #0369a1; }
.offer-stage-dispute { border-color: rgba(220, 38, 38, 0.28); background: #fef2f2; color: #991b1b; }
.offer-stage-closed { border-color: rgba(100, 116, 139, 0.30); background: #f8fafc; color: #475569; }
.offer-stage-neutral { border-color: rgba(148, 163, 184, 0.30); background: #f8fafc; color: #475569; }

.offer-card-actions,
.offer-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.offer-card-metrics,
.offer-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.offer-card-info,
.offer-card-context > div,
.offer-detail-info {
    padding: 16px 17px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 17px;
    background: #f9fafb;
}

.offer-card-context {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.offer-detail-card {
    margin-bottom: 18px;
    padding: 26px 28px;
    border: 1px solid rgba(229, 231, 235, 0.95) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055) !important;
}

.offer-risk-card {
    padding: 24px 26px;
}

.offer-detail-section-head h2,
.offer-warning-card h2 {
    margin: 0;
    color: #111827;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.offer-warning-card p {
    margin: 8px 0 0;
    color: #92400e;
    line-height: 1.55;
}

.offer-detail-text-block {
    margin-top: 14px;
    padding: 17px 18px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 17px;
    background: #f9fafb;
}

.offer-detail-text-block p {
    margin: 6px 0 0;
    color: #111827;
    line-height: 1.58;
}

.offer-linked-deal-note,
.offer-warning-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 18px 19px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 18px;
    background: #f0f9ff;
    color: #075985;
    font-weight: 800;
}

.offer-warning-card {
    align-items: flex-start;
    flex-direction: column;
    border-color: rgba(245, 158, 11, 0.35) !important;
    background: #fffbeb !important;
    color: #92400e;
}

.offer-workflow-empty {
    padding: 24px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 20px;
    background: #ffffff;
    color: #6b7280;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 1080px) {
    .offer-filter-fields {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 960px) {
    .offer-workflow-header,
    .offer-detail-header,
    .offer-filter-top,
    .offer-card-title-row,
    .offer-detail-section-head,
    .offer-linked-deal-note {
        flex-direction: column;
        align-items: stretch;
    }

    .offer-filter-fields,
    .offer-card-metrics,
    .offer-detail-grid,
    .offer-card-context,
    .offer-workflow-counts {
        grid-template-columns: 1fr;
    }

    .offer-filter-actions,
    .offer-detail-header-actions,
    .offer-card-actions,
    .offer-detail-actions {
        justify-content: stretch;
    }

    .offer-filter-actions .ap-action-btn,
    .offer-detail-header-actions .ap-action-btn,
    .offer-card-actions .ap-action-btn,
    .offer-detail-actions .ap-action-btn,
    .offer-detail-actions form,
    .offer-detail-actions button {
        width: 100%;
    }
}


/* Финальная полировка предложений: светлая шапка, единая статусная полоса, без отдельного флажка */
.offer-workflow-page .offer-workflow-header,
.offer-detail-page .offer-detail-header,
.offers-page .offer-workflow-header,
.offer-page .offer-detail-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 55%, #f0fdf4 100%) !important;
    color: #111827 !important;
    border: 1px solid rgba(187, 247, 208, 0.85) !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

.offer-workflow-page .offer-workflow-header *,
.offer-detail-page .offer-detail-header *,
.offers-page .offer-workflow-header *,
.offer-page .offer-detail-header * {
    color: inherit;
}

.offer-workflow-page .offer-workflow-title,
.offer-detail-page .offer-detail-header h1,
.offers-page .offer-workflow-title,
.offer-page .offer-detail-header h1 {
    color: #111827 !important;
}

.offer-workflow-page .offer-workflow-subtitle,
.offers-page .offer-workflow-subtitle {
    color: #4b5563 !important;
}

.offer-detail-page .offer-detail-kicker,
.offer-page .offer-detail-kicker {
    color: #047857 !important;
}

.offer-workflow-card.offer-status-card {
    border-left-width: 7px !important;
    border-left-style: solid !important;
    border-left-color: #94a3b8 !important;
    padding-left: 24px !important;
}

.offer-status-card-action { border-left-color: #f59e0b !important; }
.offer-status-card-negotiation { border-left-color: #16a34a !important; }
.offer-status-card-agreed { border-left-color: #0ea5e9 !important; }
.offer-status-card-dispute { border-left-color: #dc2626 !important; }
.offer-status-card-closed { border-left-color: #64748b !important; }
.offer-status-card-neutral { border-left-color: #94a3b8 !important; }

.offer-status-flag {
    display: none !important;
}

.offer-detail-card.offer-actions-card {
    display: none !important;
}

.offer-filter-panel-clean .offer-filter-fields {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 16px !important;
}

.offer-filter-panel-clean .offer-filter-top {
    align-items: center !important;
}

.offer-detail-page .offer-detail-card,
.offer-workflow-page .offer-workflow-card,
.offer-workflow-page .offer-filter-panel {
    padding-top: 26px;
    padding-bottom: 26px;
}

/* Полноценная рабочая доработка раздела переговоров */
.chat-dialog-page {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.chat-dialog-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
    border: 1px solid rgba(31, 75, 44, 0.14);
    border-radius: var(--ap-radius-xl);
    background:
        linear-gradient(135deg, rgba(31, 75, 44, 0.08), rgba(255, 255, 255, 0.96) 42%, rgba(37, 99, 235, 0.05)) !important;
    box-shadow: var(--ap-shadow-sm) !important;
    color: var(--ap-color-text) !important;
}

.chat-hero-main {
    min-width: 0;
}

.chat-kicker {
    margin-bottom: 8px;
    color: var(--ap-color-primary-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-dialog-hero h1 {
    margin: 0;
    color: var(--ap-color-text) !important;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.chat-dialog-hero p {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--ap-color-text-muted) !important;
}

.chat-hero-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.chat-section-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.chat-section-head h2 {
    margin: 0;
    color: var(--ap-color-text) !important;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.chat-dialog-page .chat-card,
.chat-dialog-page .chat-form,
.chat-dialog-page .chat-context-card,
.chat-dialog-page .chat-history-card,
.chat-dialog-page .chat-compose-card {
    padding: 20px !important;
    border: 1px solid var(--ap-color-border) !important;
    border-radius: var(--ap-radius-xl) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm) !important;
}

.chat-dialog-page .chat-participants {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-dialog-page .chat-participant-card {
    display: grid;
    gap: 5px;
    padding: 14px !important;
    border-radius: 16px !important;
    background: var(--ap-color-surface-soft) !important;
}

.chat-dialog-page .chat-participant-card span {
    color: var(--ap-color-text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-dialog-page .chat-participant-card strong {
    color: var(--ap-color-text);
    font-size: 15px;
}

.chat-dialog-page .chat-info,
.chat-dialog-page .chat-contact-warning,
.chat-dialog-page .chat-success,
.chat-dialog-page .chat-error {
    padding: 14px 16px !important;
    border-radius: var(--ap-radius-lg) !important;
    line-height: 1.5;
    box-shadow: none !important;
}

.chat-dialog-page .chat-info p,
.chat-dialog-page .chat-success p,
.chat-dialog-page .chat-contact-warning p {
    margin: 6px 0 0;
}

.chat-dialog-page .chat-message-form {
    display: grid;
    gap: 14px;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.chat-form-field {
    display: grid;
    gap: 8px;
}

.chat-dialog-page .chat-message-form textarea {
    width: 100%;
    min-height: 132px !important;
    resize: vertical;
    border: 1px solid var(--ap-color-border-strong) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    padding: 13px 14px !important;
    color: var(--ap-color-text) !important;
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-dialog-page .chat-message-form textarea:focus {
    border-color: rgba(31, 75, 44, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(31, 75, 44, 0.10) !important;
}

.chat-dialog-page .chat-file-field input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--ap-color-border-strong);
    border-radius: 14px;
    background: var(--ap-color-surface-soft);
}

.chat-dialog-page .chat-note {
    color: var(--ap-color-text-muted) !important;
    font-size: 13px;
}

.chat-dialog-page .chat-field-error,
.chat-dialog-page .chat-error {
    color: #991b1b !important;
}

.chat-dialog-messages {
    gap: 14px;
}

.chat-dialog-page .chat-message {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px 18px !important;
    border-radius: 18px !important;
    border: 1px solid var(--ap-color-border) !important;
    box-shadow: var(--ap-shadow-sm) !important;
}

.chat-dialog-page .chat-message-own {
    margin-left: min(80px, 8vw);
    border-left: 5px solid var(--ap-color-primary) !important;
    background: var(--ap-color-primary-soft) !important;
}

.chat-dialog-page .chat-message-other {
    margin-right: min(80px, 8vw);
    border-left: 5px solid var(--ap-color-blue) !important;
    background: var(--ap-color-blue-soft) !important;
}

.chat-dialog-page .chat-message-manager {
    border-left: 5px solid var(--ap-color-warning) !important;
    background: var(--ap-color-warning-soft) !important;
}

.chat-dialog-page .chat-message-system {
    border-left: 5px solid var(--ap-color-border-strong) !important;
    background: var(--ap-color-surface-soft) !important;
}

.chat-message-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chat-message-author {
    color: var(--ap-color-text);
    font-weight: 900;
}

.chat-dialog-page .chat-message-meta {
    margin-top: 2px;
    color: var(--ap-color-text-muted) !important;
    font-size: 12px;
    font-weight: 700;
}

.chat-dialog-page .chat-message-text {
    white-space: pre-line;
    color: var(--ap-color-text) !important;
    line-height: 1.58;
}

.chat-attachments {
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.chat-attachments-title {
    color: var(--ap-color-text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chat-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-dialog-page .chat-attachment {
    max-width: 100%;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.78) !important;
}

.chat-dialog-page .chat-empty {
    padding: 18px !important;
    text-align: center;
}

@media (max-width: 768px) {
    .chat-dialog-hero {
        flex-direction: column;
        padding: 18px;
    }

    .chat-hero-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .chat-dialog-page .chat-participants {
        grid-template-columns: 1fr;
    }

    .chat-dialog-page .chat-message-own,
    .chat-dialog-page .chat-message-other {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Точечная доработка отступов в переговорах: блоки не должны прилипать друг к другу */
.chat-dialog-page {
    gap: 24px !important;
    padding-bottom: 28px;
}

.chat-dialog-page > section,
.chat-dialog-page > header {
    margin: 0 !important;
}

.chat-dialog-page .chat-card,
.chat-dialog-page .chat-form,
.chat-dialog-page .chat-context-card,
.chat-dialog-page .chat-history-card,
.chat-dialog-page .chat-compose-card {
    padding: 26px 28px !important;
}

.chat-dialog-page .chat-info,
.chat-dialog-page .chat-contact-warning,
.chat-dialog-page .chat-success,
.chat-dialog-page .chat-error {
    display: block;
    padding: 22px 24px !important;
    margin: 0 !important;
    border-radius: var(--ap-radius-xl) !important;
    line-height: 1.62 !important;
}

.chat-dialog-page .chat-manager-note {
    border: 1px solid rgba(217, 119, 6, 0.22) !important;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.98)) !important;
    color: var(--ap-color-text) !important;
}

.chat-dialog-page .chat-info strong,
.chat-dialog-page .chat-contact-warning strong,
.chat-dialog-page .chat-success strong,
.chat-dialog-page .chat-error strong {
    display: block;
    margin: 0 0 8px;
    color: var(--ap-color-text) !important;
    font-size: 16px;
    line-height: 1.35;
}

.chat-dialog-page .chat-info p,
.chat-dialog-page .chat-success p,
.chat-dialog-page .chat-contact-warning p,
.chat-dialog-page .chat-error p {
    margin: 0 !important;
    color: var(--ap-color-text-muted) !important;
    line-height: 1.62 !important;
}

.chat-dialog-page .chat-section-head {
    margin-bottom: 18px !important;
}

.chat-dialog-page .chat-participants {
    gap: 16px !important;
}

.chat-dialog-page .chat-participant-card {
    padding: 18px 20px !important;
}

.chat-dialog-page .chat-message-form {
    gap: 18px !important;
}

.chat-dialog-page .chat-form-field {
    gap: 10px !important;
}

.chat-dialog-page .chat-form-actions {
    padding-top: 4px;
}

.chat-dialog-messages {
    gap: 18px !important;
}

.chat-dialog-page .chat-message {
    padding: 20px 22px !important;
}

.chat-dialog-page .chat-message-text {
    line-height: 1.66 !important;
}

.chat-dialog-page .chat-attachments {
    padding-top: 8px !important;
}

@media (max-width: 768px) {
    .chat-dialog-page {
        gap: 18px !important;
    }

    .chat-dialog-page .chat-card,
    .chat-dialog-page .chat-form,
    .chat-dialog-page .chat-context-card,
    .chat-dialog-page .chat-history-card,
    .chat-dialog-page .chat-compose-card,
    .chat-dialog-page .chat-info,
    .chat-dialog-page .chat-contact-warning,
    .chat-dialog-page .chat-success,
    .chat-dialog-page .chat-error {
        padding: 18px !important;
    }
}

/* Финальная доработка отступов и порядка сообщений в переговорах */
body .chat-dialog-page {
    row-gap: 30px !important;
    gap: 30px !important;
    align-content: start !important;
}

body .chat-dialog-page > header,
body .chat-dialog-page > section {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .chat-dialog-page .chat-spacious-card,
body .chat-dialog-page .chat-context-card.chat-spacious-card,
body .chat-dialog-page .chat-compose-card.chat-spacious-card,
body .chat-dialog-page .chat-history-card.chat-spacious-card,
body .chat-dialog-page .chat-card.chat-spacious-card,
body .chat-dialog-page .chat-form.chat-spacious-card {
    padding: 34px 36px !important;
    border-radius: 24px !important;
    box-sizing: border-box !important;
}

body .chat-dialog-page .chat-section-head {
    margin: 0 0 22px !important;
    padding: 0 !important;
}

body .chat-dialog-page .chat-section-head h2 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.25 !important;
}

body .chat-dialog-page .chat-participants {
    display: grid !important;
    gap: 20px !important;
}

body .chat-dialog-page .chat-participant-card {
    padding: 24px 26px !important;
    min-height: 92px !important;
    align-content: center !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
}

body .chat-dialog-page .chat-notice-card,
body .chat-dialog-page .chat-info.chat-notice-card,
body .chat-dialog-page .chat-manager-note.chat-notice-card,
body .chat-dialog-page .chat-contact-warning.chat-notice-card,
body .chat-dialog-page .chat-success.chat-notice-card,
body .chat-dialog-page .chat-error.chat-notice-card {
    display: block !important;
    padding: 28px 32px !important;
    border-radius: 22px !important;
    line-height: 1.65 !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .chat-dialog-page .chat-manager-note.chat-notice-card {
    border: 1px solid rgba(217, 119, 6, 0.24) !important;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 255, 255, 0.98)) !important;
}

body .chat-dialog-page .chat-contact-warning.chat-notice-card {
    border: 1px solid rgba(180, 83, 9, 0.22) !important;
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(255, 255, 255, 0.98)) !important;
}

body .chat-dialog-page .chat-success.chat-notice-card {
    border: 1px solid rgba(31, 75, 44, 0.18) !important;
    background: linear-gradient(135deg, rgba(232, 245, 236, 0.98), rgba(255, 255, 255, 0.98)) !important;
}

body .chat-dialog-page .chat-notice-card strong {
    display: block !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    line-height: 1.35 !important;
}

body .chat-dialog-page .chat-notice-card p,
body .chat-dialog-page .chat-info.chat-notice-card p,
body .chat-dialog-page .chat-manager-note.chat-notice-card p,
body .chat-dialog-page .chat-contact-warning.chat-notice-card p,
body .chat-dialog-page .chat-success.chat-notice-card p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.65 !important;
}

body .chat-dialog-page .chat-message-form {
    gap: 22px !important;
}

body .chat-dialog-page .chat-form-field {
    gap: 12px !important;
}

body .chat-dialog-page .chat-message-form textarea {
    min-height: 150px !important;
    padding: 18px 20px !important;
    line-height: 1.6 !important;
    box-sizing: border-box !important;
}

body .chat-dialog-page .chat-file-field input[type="file"] {
    padding: 16px 18px !important;
    box-sizing: border-box !important;
}

body .chat-dialog-page .chat-note {
    margin-top: 2px !important;
    line-height: 1.45 !important;
}

body .chat-dialog-page .chat-form-actions {
    padding-top: 6px !important;
}

body .chat-dialog-messages.chat-newest-first,
body .chat-dialog-page .chat-dialog-messages.chat-newest-first {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}

body .chat-dialog-page .chat-message {
    padding: 24px 28px !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
}

body .chat-dialog-page .chat-message-head {
    margin-bottom: 2px !important;
}

body .chat-dialog-page .chat-message-text {
    line-height: 1.68 !important;
    padding: 0 !important;
}

body .chat-dialog-page .chat-attachments {
    margin-top: 4px !important;
    padding-top: 12px !important;
}

@media (max-width: 768px) {
    body .chat-dialog-page {
        gap: 22px !important;
    }

    body .chat-dialog-page .chat-spacious-card,
    body .chat-dialog-page .chat-context-card.chat-spacious-card,
    body .chat-dialog-page .chat-compose-card.chat-spacious-card,
    body .chat-dialog-page .chat-history-card.chat-spacious-card,
    body .chat-dialog-page .chat-card.chat-spacious-card,
    body .chat-dialog-page .chat-form.chat-spacious-card,
    body .chat-dialog-page .chat-notice-card,
    body .chat-dialog-page .chat-info.chat-notice-card,
    body .chat-dialog-page .chat-manager-note.chat-notice-card,
    body .chat-dialog-page .chat-contact-warning.chat-notice-card,
    body .chat-dialog-page .chat-success.chat-notice-card,
    body .chat-dialog-page .chat-error.chat-notice-card {
        padding: 22px !important;
        border-radius: 20px !important;
    }

    body .chat-dialog-page .chat-participant-card,
    body .chat-dialog-page .chat-message {
        padding: 20px !important;
    }
}

/*
    Рабочий UI раздела "Споры": список, фильтр, карточка спора и журнал событий.
    Слой не меняет маршруты, модели, права доступа, вложения, уведомления и бизнес-логику.
*/

.disputes-workflow-page,
.dispute-workflow-detail {
    max-width: 1120px;
    margin: 0 auto;
}

.disputes-platform-hero,
.dispute-detail-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 26px 28px;
    border: 1px solid var(--ap-color-border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 8% 12%, rgba(229, 57, 53, 0.08), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: var(--ap-shadow-sm);
}

.disputes-kicker,
.dispute-detail-kicker,
.disputes-filter-kicker {
    margin-bottom: 8px;
    color: var(--ap-color-danger, #dc2626);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.disputes-title,
.dispute-detail-title {
    margin: 0 0 8px 0;
    color: var(--ap-color-text);
    letter-spacing: -0.03em;
}

.disputes-subtitle,
.dispute-detail-subtitle {
    max-width: 720px;
    margin: 0;
    color: var(--ap-color-text-muted);
    line-height: 1.6;
}

.disputes-hero-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    gap: 10px;
    min-width: 250px;
}

.disputes-hero-stat {
    padding: 13px 14px;
    border: 1px solid var(--ap-color-border);
    border-radius: 16px;
    background: #ffffff;
}

.disputes-hero-stat span,
.disputes-info-box span,
.dispute-detail-info span {
    display: block;
    margin-bottom: 5px;
    color: var(--ap-color-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.disputes-hero-stat strong,
.disputes-info-box strong,
.dispute-detail-info strong {
    color: var(--ap-color-text);
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.disputes-filter-panel {
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid var(--ap-color-border);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.disputes-filter-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.disputes-filter-head h2 {
    margin: 0;
    color: var(--ap-color-text);
    font-size: 20px;
    letter-spacing: -0.02em;
}

.disputes-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.disputes-filter-grid {
    display: grid;
    grid-template-columns: minmax(170px, 0.85fr) minmax(210px, 0.95fr) minmax(280px, 1.4fr);
    gap: 14px;
    align-items: end;
}

.disputes-field label,
.dispute-form-field label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

.disputes-input,
.disputes-select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--ap-color-border-strong, #d1d5db);
    border-radius: 14px;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
}

.disputes-input:focus,
.disputes-select:focus {
    outline: 3px solid rgba(225, 29, 72, 0.13);
    border-color: #fb7185;
}

.disputes-list {
    display: grid;
    gap: 14px;
}

.disputes-card {
    position: relative;
    padding: 20px 22px 20px 24px;
    border: 1px solid var(--ap-color-border);
    border-left-width: 6px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.disputes-card:hover,
.disputes-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--ap-shadow-md);
}

.dispute-card-open {
    border-left-color: #ef4444;
}

.dispute-card-review {
    border-left-color: #f59e0b;
}

.dispute-card-waiting {
    border-left-color: #2563eb;
}

.dispute-card-closed {
    border-left-color: #16a34a;
}

.disputes-card-head,
.dispute-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.disputes-card-title-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.disputes-card-title,
.dispute-card-heading h2 {
    margin: 0;
    color: var(--ap-color-text);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.dispute-card-heading p {
    margin: 5px 0 0;
    color: var(--ap-color-text-muted);
    line-height: 1.55;
}

.disputes-card-meta {
    color: var(--ap-color-text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.dispute-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--ap-color-border);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.dispute-status-open {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.dispute-status-review {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.dispute-status-waiting {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.dispute-status-closed {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.disputes-card-grid,
.dispute-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.disputes-info-box,
.dispute-detail-info {
    padding: 13px 14px;
    border: 1px solid var(--ap-color-border);
    border-radius: 15px;
    background: var(--ap-color-surface-soft, #f9fafb);
}

.disputes-card-description {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ap-color-border);
    color: var(--ap-color-text-muted);
    line-height: 1.6;
}

.disputes-card-action {
    position: relative;
    z-index: 2;
}

.disputes-empty {
    padding: 28px;
    border: 1px solid var(--ap-color-border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
    color: var(--ap-color-text-muted);
    text-align: center;
}

.dispute-detail-hero {
    margin-bottom: 22px;
}

.dispute-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.dispute-detail-card,
.dispute-manager-panel {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--ap-color-border);
    border-left: 6px solid #e11d48;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-manager-panel {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 76%);
    border-left-color: #f59e0b;
}

.dispute-inline-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ap-color-border);
}

.dispute-manager-form {
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.dispute-manager-form-grid {
    display: grid;
    gap: 16px;
}

.dispute-form-field-wide {
    grid-column: 1 / -1;
}

.dispute-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.dispute-timeline {
    position: relative;
    display: grid;
    gap: 13px;
    padding-left: 22px;
}

.dispute-timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e5e7eb;
}

.dispute-timeline-item {
    position: relative;
    margin: 0 !important;
    padding: 17px 18px !important;
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm);
}

.dispute-timeline-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 21px;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: #64748b;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.dispute-timeline-item-opened::before {
    background: #ef4444;
}

.dispute-timeline-item-manager::before {
    background: #f59e0b;
}

.dispute-timeline-item-success::before {
    background: #16a34a;
}

.dispute-timeline-title {
    margin-bottom: 7px;
    color: var(--ap-color-text);
    font-weight: 900;
}

.dispute-timeline-meta {
    margin-bottom: 10px;
    color: var(--ap-color-text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.dispute-timeline-text {
    color: var(--ap-color-text);
    line-height: 1.65;
}

.dispute-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.dispute-attachment-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--ap-color-border-strong, #d1d5db);
    background: #ffffff;
    color: var(--ap-color-primary-dark, #1f4b2c);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.dispute-you-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 920px) {
    .disputes-filter-head,
    .disputes-card-head,
    .dispute-card-heading,
    .dispute-detail-hero {
        align-items: stretch;
    }

    .disputes-filter-grid,
    .disputes-card-grid,
    .dispute-detail-grid {
        grid-template-columns: 1fr;
    }

    .disputes-hero-summary {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .disputes-platform-hero,
    .dispute-detail-hero,
    .disputes-filter-panel,
    .disputes-card,
    .dispute-detail-card,
    .dispute-manager-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .dispute-detail-actions,
    .disputes-filter-actions {
        justify-content: flex-start;
    }
}

/* Disputes workflow compatibility: visible materials marker in dispute cards */
.disputes-card-materials {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(23, 122, 86, 0.07);
    border: 1px solid rgba(23, 122, 86, 0.14);
    color: var(--ap-text, #1f2933);
    font-size: 0.92rem;
    line-height: 1.45;
}

/*
    Final visual polish for disputes manager/user pages.
    Fixes readable light headers, spacing under manager navigation,
    clean manager filter, and calmer dispute cards.
*/
body .disputes-workflow-page,
body .dispute-workflow-detail {
    display: grid;
    gap: 22px;
}

body .disputes-workflow-page .disputes-platform-hero,
body .dispute-workflow-detail .dispute-detail-hero {
    margin-bottom: 0 !important;
    padding: 28px 30px !important;
    border: 1px solid #dbe7df !important;
    background: linear-gradient(135deg, #ffffff 0%, #f5fbf7 58%, #edf7f1 100%) !important;
    color: #111827 !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07) !important;
}

body .disputes-workflow-page .disputes-platform-hero *,
body .dispute-workflow-detail .dispute-detail-hero * {
    color: inherit;
}

body .disputes-workflow-page .disputes-title,
body .dispute-workflow-detail .dispute-detail-title,
body .disputes-workflow-page .disputes-hero-stat strong {
    color: #111827 !important;
}

body .disputes-workflow-page .disputes-subtitle,
body .dispute-workflow-detail .dispute-detail-subtitle,
body .disputes-workflow-page .disputes-hero-stat span {
    color: #4b5563 !important;
}

body .disputes-workflow-page .disputes-kicker,
body .dispute-workflow-detail .dispute-detail-kicker {
    color: #177a56 !important;
}

body .disputes-workflow-page .disputes-hero-stat {
    padding: 16px 18px !important;
    border-color: #dbe7df !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

body .disputes-manager-nav-wrap {
    margin: 4px 0 2px !important;
    padding: 4px 0 !important;
}

body .disputes-manager-nav-wrap > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .disputes-filter-panel-polished,
body .disputes-filter-panel.dispute-filter-form {
    margin: 0 !important;
    padding: 24px !important;
    border: 1px solid #dbe7df !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
}

body .disputes-filter-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 20px !important;
    align-items: start !important;
    margin-bottom: 22px !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #edf2ef !important;
}

body .disputes-filter-head h2 {
    margin: 0 !important;
    font-size: 21px !important;
    color: #111827 !important;
}

body .disputes-filter-kicker {
    color: #177a56 !important;
}

body .disputes-filter-note {
    margin: 7px 0 0 !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .disputes-filter-actions {
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

body .disputes-filter-grid {
    display: grid !important;
    grid-template-columns: minmax(190px, 0.9fr) minmax(230px, 1fr) minmax(320px, 1.4fr) !important;
    gap: 18px !important;
    align-items: end !important;
}

body .disputes-field {
    min-width: 0 !important;
}

body .disputes-field label {
    display: block !important;
    margin: 0 0 9px !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

body .disputes-input,
body .disputes-select {
    width: 100% !important;
    min-height: 48px !important;
    padding: 11px 14px !important;
    border: 1px solid #cfdad4 !important;
    border-radius: 14px !important;
    background: #fbfdfc !important;
    color: #111827 !important;
    box-shadow: none !important;
}

body .disputes-input:focus,
body .disputes-select:focus {
    outline: 3px solid rgba(23, 122, 86, 0.14) !important;
    border-color: #177a56 !important;
    background: #ffffff !important;
}

body .disputes-list.disputes-workflow-list {
    gap: 18px !important;
}

body .disputes-card-polished,
body .disputes-card {
    padding: 24px 26px 24px 28px !important;
    border: 1px solid #dbe7df !important;
    border-left-width: 6px !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

body .disputes-manager-card-polished {
    display: grid !important;
    gap: 18px !important;
}

body .disputes-card-head {
    margin-bottom: 0 !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #edf2ef !important;
}

body .disputes-card-title-row {
    gap: 12px !important;
    margin-bottom: 8px !important;
}

body .disputes-card-title {
    font-size: 19px !important;
    color: #111827 !important;
}

body .disputes-card-meta {
    color: #6b7280 !important;
}

body .disputes-card-grid.dispute-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

body .disputes-info-box.dispute-metric {
    min-height: 76px !important;
    padding: 15px 16px !important;
    border-color: #dbe7df !important;
    border-radius: 16px !important;
    background: #f8fbf9 !important;
}

body .disputes-info-box span,
body .dispute-detail-info span {
    margin-bottom: 7px !important;
    color: #6b7280 !important;
}

body .disputes-info-box strong,
body .dispute-detail-info strong {
    color: #111827 !important;
}

body .disputes-card-materials {
    margin-top: 0 !important;
    padding: 12px 14px !important;
    border-radius: 15px !important;
    background: #f5fbf7 !important;
    border: 1px solid #dbe7df !important;
    color: #374151 !important;
}

body .disputes-card-description {
    margin-top: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
    color: #4b5563 !important;
    line-height: 1.65 !important;
}

body .dispute-detail-card,
body .dispute-manager-panel {
    margin-bottom: 0 !important;
    padding: 24px 26px !important;
    border-color: #dbe7df !important;
    border-radius: 22px !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

body .dispute-manager-panel {
    background: #ffffff !important;
}

body .dispute-card-heading {
    margin-bottom: 18px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #edf2ef !important;
}

body .dispute-card-heading h2 {
    color: #111827 !important;
}

body .dispute-card-heading p {
    color: #6b7280 !important;
}

@media (max-width: 1040px) {
    body .disputes-card-grid.dispute-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    body .disputes-filter-head {
        grid-template-columns: 1fr !important;
    }

    body .disputes-filter-actions {
        justify-content: flex-start !important;
    }

    body .disputes-filter-grid,
    body .disputes-card-grid.dispute-metrics {
        grid-template-columns: 1fr !important;
    }

    body .disputes-workflow-page .disputes-platform-hero,
    body .dispute-workflow-detail .dispute-detail-hero,
    body .disputes-filter-panel-polished,
    body .disputes-card-polished,
    body .dispute-detail-card,
    body .dispute-manager-panel {
        padding: 20px !important;
        border-radius: 18px !important;
    }
}

/*
    Мягкая визуальная доработка рынка лотов и заявок.
    Спокойная рабочая версия: светлые плашки, ровные фильтры, единые карточки без декоративной перегрузки.
*/
body .market-workspace-page,
body .ap-market-polished-page,
body .market-clean-page {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

body .market-clean-header,
body .market-workspace-hero,
body .ap-market-hero-polished,
body .ap-market-page .ap-market-hero {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
    padding: 24px 26px !important;
    border: 1px solid #dfe8e2 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    color: #17211c !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045) !important;
}

body .market-clean-header h1,
body .market-workspace-hero h1,
body .ap-market-hero-polished h1,
body .ap-market-page .ap-market-hero h1 {
    margin: 0 !important;
    color: #17211c !important;
    font-size: 28px !important;
    line-height: 1.18 !important;
    letter-spacing: -0.02em !important;
}

body .market-clean-header p,
body .market-workspace-hero p,
body .ap-market-hero-polished p,
body .ap-market-page .ap-market-hero-text {
    max-width: 760px !important;
    margin: 8px 0 0 !important;
    color: #5b675f !important;
    line-height: 1.55 !important;
}

body .market-clean-kicker,
body .market-workspace-kicker,
body .market-filter-kicker,
body .ap-market-kicker {
    margin-bottom: 6px !important;
    color: #177a56 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
}

body .market-clean-header-side,
body .market-clean-actions,
body .market-workspace-hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

body .market-clean-note,
body .market-verification-note,
body .ap-market-note-polished,
body .ap-market-page .ap-market-note {
    padding: 16px 18px !important;
    border: 1px solid #f1d994 !important;
    border-radius: 14px !important;
    background: #fffbeb !important;
    color: #8a5a12 !important;
    line-height: 1.55 !important;
    box-shadow: none !important;
}

body .market-clean-note p,
body .market-verification-note p,
body .ap-market-note-polished p {
    margin: 7px 0 0 !important;
}

body .market-clean-summary,
body .ap-market-summary-polished {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .ap-market-summary-card {
    padding: 14px 16px !important;
    border: 1px solid #dfe8e2 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .035) !important;
}

body .ap-market-summary-label {
    margin: 0 0 5px !important;
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 750 !important;
}

body .ap-market-summary-value {
    margin: 0 !important;
    color: #17211c !important;
    font-size: 18px !important;
    font-weight: 850 !important;
}

body .market-clean-filter,
body .market-object-filter,
body .ap-market-filter-polished,
body .ap-market-page .ap-market-filter {
    padding: 18px 20px !important;
    border: 1px solid #dfe8e2 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.035) !important;
}

body .market-object-filter-compact {
    display: grid !important;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: end !important;
}

body .market-clean-filter-head,
body .ap-market-filter-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
    margin-bottom: 16px !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid #eef3f0 !important;
}

body .market-clean-filter h2,
body .market-object-filter h2,
body .ap-market-filter-head h2 {
    margin: 0 !important;
    color: #17211c !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
}

body .market-clean-filter-controls,
body .market-object-filter-controls,
body .market-clean-filter-grid,
body .ap-market-filter-grid-polished {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
    gap: 14px !important;
    align-items: end !important;
}

body .market-object-filter-compact .market-clean-filter-controls,
body .market-object-filter-compact .market-object-filter-controls {
    grid-template-columns: minmax(220px, 1fr) auto !important;
}

body .market-clean-filter label,
body .market-object-filter-controls label,
body .ap-market-filter-grid-polished label {
    display: grid !important;
    gap: 7px !important;
    margin: 0 !important;
    color: #39443e !important;
    font-size: 13px !important;
    font-weight: 760 !important;
}

body .market-clean-filter label span,
body .market-object-filter-controls label span,
body .ap-market-filter-grid-polished label span {
    color: #4b5563 !important;
    font-size: 13px !important;
}

body .market-clean-filter select,
body .market-object-filter select,
body .ap-market-filter-polished select,
body .ap-market-page .ap-market-filter select {
    width: 100% !important;
    min-height: 42px !important;
    padding: 9px 12px !important;
    border: 1px solid #cfdad4 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #17211c !important;
    box-sizing: border-box !important;
}

body .market-clean-filter small,
body .ap-market-filter-polished small {
    color: #6b7280 !important;
    line-height: 1.35 !important;
}

body .market-clean-filter select:focus,
body .market-object-filter select:focus,
body .ap-market-filter-polished select:focus {
    outline: 3px solid rgba(23, 122, 86, .12) !important;
    border-color: #177a56 !important;
}

body .market-clean-filter-actions,
body .market-object-filter-actions,
body .ap-market-filter-actions {
    display: flex !important;
    gap: 9px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

body .market-clean-list,
body .market-object-card-list,
body .ap-market-grid-polished {
    display: grid !important;
    gap: 14px !important;
}

body .market-clean-card,
body .market-object-card,
body .ap-market-card {
    position: relative !important;
    display: block !important;
    padding: 18px 20px !important;
    border: 1px solid #dfe8e2 !important;
    border-left-width: 5px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04) !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

body .market-clean-card:hover,
body .market-object-card:hover,
body .ap-market-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .08) !important;
    text-decoration: none !important;
}

body .market-object-card-lot,
body .ap-market-card-lot { border-left-color: #177a56 !important; }
body .market-object-card-request,
body .ap-market-card-request { border-left-color: #2563eb !important; }
body .market-object-status-draft { border-left-color: #9ca3af !important; }
body .market-object-status-moderation { border-left-color: #f59e0b !important; }
body .market-object-status-published { border-left-color: #177a56 !important; }
body .market-object-status-agreement { border-left-color: #2563eb !important; }
body .market-object-status-dispute { border-left-color: #dc2626 !important; }
body .market-object-status-completed { border-left-color: #059669 !important; }
body .market-object-status-archived { border-left-color: #6b7280 !important; }

body .market-clean-card-head,
body .market-object-card-head,
body .ap-market-card-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #edf2ef !important;
}

body .market-clean-card-head h2,
body .market-object-card-head h2,
body .ap-market-card-title {
    margin: 0 0 5px !important;
    color: #17211c !important;
    font-size: 19px !important;
    line-height: 1.25 !important;
}

body .market-clean-card-head p,
body .market-object-card-head p,
body .ap-market-card-subtitle {
    margin: 0 !important;
    color: #647067 !important;
    line-height: 1.45 !important;
}

body .market-object-badges {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

body .market-object-status-badge,
body .ap-market-status,
body .ap-market-hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 28px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: #f3faf6 !important;
    border: 1px solid #cae9d8 !important;
    color: #166534 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

body .market-clean-metrics,
body .market-object-metrics,
body .ap-market-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 0 14px !important;
}

body .market-object-metric,
body .ap-market-metric {
    min-height: auto !important;
    padding: 12px 13px !important;
    border: 1px solid #e4ece7 !important;
    border-radius: 12px !important;
    background: #fbfdfc !important;
}

body .market-object-metric span,
body .ap-market-metric-label {
    display: block !important;
    margin: 0 0 5px !important;
    color: #69746e !important;
    font-size: 12px !important;
    font-weight: 750 !important;
}

body .market-object-metric strong,
body .ap-market-metric-value {
    margin: 0 !important;
    color: #17211c !important;
    font-size: 15px !important;
    font-weight: 850 !important;
    line-height: 1.35 !important;
}

body .market-clean-quality,
body .ap-market-quality {
    display: flex !important;
    gap: 8px !important;
    margin: 12px 0 0 !important;
    flex-wrap: wrap !important;
}

body .ap-market-quality-pill {
    min-height: 28px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: #f8fbf9 !important;
    border: 1px solid #dfe8e2 !important;
    color: #39443e !important;
    font-size: 12px !important;
    font-weight: 760 !important;
}

body .market-clean-card-bottom,
body .ap-market-card-bottom {
    display: flex !important;
    justify-content: space-between !important;
    gap: 16px !important;
    align-items: flex-end !important;
    flex-wrap: wrap !important;
    margin-top: 14px !important;
    padding-top: 13px !important;
    border-top: 1px solid #edf2ef !important;
}

body .market-clean-card-actions,
body .market-object-actions,
body .ap-market-actions {
    display: flex !important;
    gap: 9px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

body .market-object-actions form {
    margin: 0 !important;
}

body .ap-market-confidentiality {
    margin-top: 8px !important;
    color: #6b7280 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

body .market-clean-empty,
body .ap-market-empty,
body .market-object-empty {
    padding: 20px 22px !important;
    border: 1px dashed #cfdad4 !important;
    border-radius: 15px !important;
    background: #ffffff !important;
    color: #6b7280 !important;
}

body .ap-market-price-locked {
    color: #8a5a12 !important;
}

body .ap-verification-needed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #f0c36a;
    background: #fffbeb;
    color: #8a5a12;
    font-size: 13px;
    font-weight: 780;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
}

body .ap-verification-needed-btn:hover {
    background: #fef3c7;
    color: #8a5a12;
    text-decoration: none;
}

@media (max-width: 980px) {
    body .market-object-filter-compact,
    body .market-clean-filter-controls,
    body .market-object-filter-controls,
    body .market-clean-filter-grid,
    body .ap-market-filter-grid-polished,
    body .market-clean-metrics,
    body .market-object-metrics,
    body .ap-market-metrics,
    body .market-clean-summary,
    body .ap-market-summary-polished {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    body .market-clean-header,
    body .market-workspace-hero,
    body .ap-market-hero-polished,
    body .market-object-filter-compact,
    body .market-clean-filter-controls,
    body .market-object-filter-controls,
    body .market-clean-filter-grid,
    body .ap-market-filter-grid-polished,
    body .market-clean-metrics,
    body .market-object-metrics,
    body .ap-market-metrics,
    body .market-clean-summary,
    body .ap-market-summary-polished {
        grid-template-columns: 1fr !important;
    }

    body .market-clean-header,
    body .market-workspace-hero,
    body .ap-market-hero-polished,
    body .market-clean-filter,
    body .market-object-filter,
    body .ap-market-filter-polished,
    body .market-clean-card,
    body .market-object-card,
    body .ap-market-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    body .market-clean-card-head,
    body .market-object-card-head,
    body .ap-market-card-top,
    body .market-clean-card-bottom,
    body .ap-market-card-bottom {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/*
    Пакет 9.8.1 — единый визуальный стандарт перед пилотом.
    Слой выравнивает шапки, карточки, кнопки, фильтры и рабочие страницы
    без изменения маршрутов, моделей и бизнес-логики.
*/

body main {
    max-width: 1280px !important;
    padding: 30px !important;
}

body .ap-section-hero,
body .ap-page-header,
body .home-hero,
body .public-hero,
body .dashboard-hero,
body .ap-form-header,
body .chat-dialog-hero,
body .manager-final-hero,
body .disputes-platform-hero,
body .dispute-detail-hero {
    border: 1px solid rgba(209, 250, 229, 0.96) !important;
    border-radius: 24px !important;
    padding: 28px 30px !important;
    background:
        radial-gradient(circle at 8% 14%, rgba(34, 197, 94, 0.10), transparent 30%),
        linear-gradient(135deg, #f0fdf4 0%, #ffffff 58%, #eff6ff 100%) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07) !important;
}

body .ap-section-title,
body .public-title,
body .home-title,
body .dashboard-title,
body .chat-dialog-hero h1,
body .ap-form-header h1,
body .ap-page-header h1,
body .manager-final-hero h1 {
    color: var(--ap-color-text) !important;
    font-size: clamp(28px, 2.8vw, 36px) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.04em !important;
    margin-top: 0 !important;
}

body .ap-section-subtitle,
body .public-subtitle,
body .home-subtitle,
body .dashboard-subtitle,
body .chat-dialog-hero p,
body .ap-form-header p,
body .ap-page-header .muted {
    max-width: 860px !important;
    color: var(--ap-color-text-muted) !important;
    font-size: 16px !important;
    line-height: 1.62 !important;
}

body .ap-section-actions,
body .ap-form-header-actions,
body .chat-hero-actions,
body .ap-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

body .ap-clickable-card,
body .home-card,
body .public-card,
body .dashboard-action-card,
body .dashboard-mini-card,
body .ap-work-card,
body .offer-workflow-card,
body .deal-workflow-card,
body .disputes-card,
body .support-card,
body .notification-card,
body .role-card,
body .ap-company-manager-card {
    min-height: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease,
        transform 0.16s ease !important;
}

body .ap-clickable-card:hover,
body .home-card:hover,
body .public-card:hover,
body .dashboard-action-card:hover,
body .dashboard-mini-card:hover,
body .ap-work-card:hover,
body .offer-workflow-card:hover,
body .deal-workflow-card:hover,
body .disputes-card:hover,
body .support-card:hover,
body .notification-card:hover,
body .role-card:hover,
body .ap-company-manager-card:hover {
    transform: translateY(-1px) !important;
    border-color: rgba(34, 197, 94, 0.34) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
}

body .dashboard-actions-grid {
    align-items: stretch !important;
}

body .dashboard-action-card {
    display: flex !important;
    min-height: 128px !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

body .dashboard-action-card:hover {
    transform: translateY(-1px) !important;
}

body .dashboard-action-title,
body .home-card-title,
body .public-card-title {
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
}

body .public-page,
body .dashboard-page,
body .chat-dialog-page,
body .ap-object-form-page,
body .ap-company-page,
body .ap-reputation-page,
body .support-page,
body .manager-final-page,
body .roles-page {
    width: 100% !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body .chat-dialog-page,
body .ap-object-form-page {
    max-width: 1240px !important;
}

body .chat-dialog-page .chat-spacious-card,
body .chat-dialog-page .chat-context-card,
body .chat-dialog-page .chat-compose-card,
body .chat-dialog-page .chat-history-card,
body .ap-object-form-page .ap-workflow-form,
body .ap-object-form-page .ap-form-helper {
    width: 100% !important;
}

body .ap-company-status-card-current {
    padding: 28px !important;
    background:
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
}

body .ap-company-status-card-current .ap-company-final-status-note {
    max-width: 850px !important;
    font-size: 15px !important;
    line-height: 1.58 !important;
    color: #475569 !important;
}

body .ap-company-status-card-current .ap-company-meta-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin-top: 18px !important;
    overflow: hidden !important;
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 18px !important;
    background: #ffffff !important;
}

body .ap-company-status-card-current .ap-company-final-metric {
    min-height: 88px !important;
    padding: 16px 18px !important;
    border: 0 !important;
    border-right: 1px solid var(--ap-color-border) !important;
    border-bottom: 1px solid var(--ap-color-border) !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

body .ap-company-status-card-current .ap-company-final-metric:nth-child(3n) {
    border-right: 0 !important;
}

body .ap-reputation-hero-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

body .ap-reputation-hero-actions {
    margin-top: 2px !important;
    justify-content: flex-start !important;
}

body .ap-reputation-formula-section .ap-reputation-section-head p {
    max-width: 960px !important;
    color: #475569 !important;
    line-height: 1.68 !important;
}

body .ap-reputation-formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

body .ap-reputation-formula-card {
    display: grid !important;
    gap: 8px !important;
    align-content: start !important;
    min-height: 132px !important;
}

body .ap-reputation-event {
    padding: 18px 20px !important;
}

body .ap-reputation-event-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

body .ap-reputation-event-metrics {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 12px !important;
}

body .ap-reputation-event-metrics span {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 30px !important;
    padding: 6px 10px !important;
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

body .company-verification-filter .offer-filter-actions,
body .support-filter-actions,
body .roles-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

body .support-filter {
    padding: 20px !important;
    border: 1px solid var(--ap-color-border) !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: var(--ap-shadow-sm) !important;
}

body .support-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(190px, 1fr)) minmax(220px, auto) !important;
    gap: 14px !important;
    align-items: end !important;
}

body .roles-page .ap-page-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 22px !important;
}

@media (max-width: 980px) {
    body main {
        padding: 22px !important;
    }

    body .home-grid-3,
    body .dashboard-actions-grid,
    body .ap-reputation-formula-grid,
    body .support-filter-grid {
        grid-template-columns: 1fr !important;
    }

    body .ap-company-status-card-current .ap-company-meta-row {
        grid-template-columns: 1fr !important;
    }

    body .ap-company-status-card-current .ap-company-final-metric,
    body .ap-company-status-card-current .ap-company-final-metric:nth-child(3n) {
        border-right: 0 !important;
    }
}

/* Пакет 9.8.1.3 — финальная доводка визуального follow-up */

/* Единый вертикальный ритм блоков: между крупными секциями всегда есть воздух. */
body .dashboard-page,
body .ap-company-page,
body .ap-reputation-page,
body .support-page,
body .manager-final-page,
body .roles-page,
body .public-page {
    display: grid !important;
    gap: 22px !important;
}

body .roles-page > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Dashboard: убрана зависимость от dashboard-access-link; карточки не двигаются и не сжимаются. */
html body .dashboard-onboarding-grid {
    display: grid !important;
    align-items: stretch !important;
}

html body .dashboard-onboarding-grid > .dashboard-onboarding-step {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 232px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    transform: none !important;
    translate: none !important;
    scale: 1 !important;
    flex: none !important;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease !important;
}

html body .dashboard-onboarding-grid > .dashboard-onboarding-step:hover,
html body .dashboard-onboarding-grid > .dashboard-onboarding-step:focus-visible,
html body .dashboard-onboarding-grid > .dashboard-onboarding-step:active {
    transform: none !important;
    translate: none !important;
    scale: 1 !important;
    min-height: 232px !important;
    height: 100% !important;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
    border-color: #bbf7d0 !important;
    background: #ffffff !important;
}

html body .dashboard-onboarding-grid > .dashboard-onboarding-step:hover *,
html body .dashboard-onboarding-grid > .dashboard-onboarding-step:focus-visible *,
html body .dashboard-onboarding-grid > .dashboard-onboarding-step:active * {
    transform: none !important;
    translate: none !important;
    scale: 1 !important;
}

html body .dashboard-onboarding-create-fixed {
    cursor: default !important;
}

html body .dashboard-onboarding-create-fixed .dashboard-onboarding-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: auto !important;
}

html body .dashboard-onboarding-create-fixed .dashboard-step-mini-btn {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Профиль компании: таблица с аккуратной единой разделительной линией между названием поля и значением. */
body .ap-company-final-status-head {
    align-items: flex-start !important;
}

body .ap-company-summary-table-wrap {
    margin-top: 18px !important;
    overflow: hidden !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 18px !important;
    background: #ffffff !important;
}

body .ap-company-summary-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

body .ap-company-summary-table th,
body .ap-company-summary-table td {
    padding: 13px 16px !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
    vertical-align: top !important;
    text-align: left !important;
    line-height: 1.45 !important;
}

body .ap-company-summary-table tr:last-child th,
body .ap-company-summary-table tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-company-summary-table th {
    width: 230px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    border-right: 1px solid rgba(203, 213, 225, 0.95) !important;
}

body .ap-company-summary-table td {
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    overflow-wrap: anywhere !important;
}

body .ap-company-verification-status-line {
    margin-top: 16px !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(187, 247, 208, 0.95) !important;
    border-radius: 14px !important;
    background: #f0fdf4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

body .ap-company-verification-status-line span {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

body .ap-company-verification-status-line strong {
    color: #166534 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

/* Рейтинг: нормальный отступ кнопки, обычный размер кнопки, компактная карточка рейтинга, видимые границы таблицы. */
body .ap-reputation-hero {
    align-items: flex-start !important;
}

body .ap-reputation-hero-content {
    display: block !important;
}

body .ap-reputation-hero-content .ap-section-subtitle {
    margin-bottom: 0 !important;
}

body .ap-reputation-hero-actions {
    margin-top: 24px !important;
}

body .ap-reputation-back-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    min-height: 38px !important;
    padding: 0 16px !important;
    align-self: flex-start !important;
    flex: 0 0 auto !important;
}

body .ap-reputation-score-card {
    align-self: flex-start !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 18px 20px !important;
    display: grid !important;
    gap: 4px !important;
}

body .ap-reputation-score-label {
    font-size: 13px !important;
}

body .ap-reputation-score-value {
    font-size: 38px !important;
    line-height: 1 !important;
}

body .ap-reputation-score-company,
body .ap-reputation-score-note {
    line-height: 1.35 !important;
}

body .ap-reputation-rule-table-wrap {
    overflow: hidden !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
}

body .ap-reputation-rule-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

body .ap-reputation-rule-table th,
body .ap-reputation-rule-table td {
    padding: 13px 15px !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    text-align: left !important;
    vertical-align: top !important;
    line-height: 1.45 !important;
}

body .ap-reputation-rule-table th:last-child,
body .ap-reputation-rule-table td:last-child {
    border-right: 0 !important;
}

body .ap-reputation-rule-table tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-reputation-rule-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

body .ap-reputation-rule-title {
    font-weight: 900 !important;
    color: #0f172a !important;
}

body .ap-reputation-rule-value {
    font-weight: 900 !important;
    color: #166534 !important;
}

body .ap-reputation-event-body {
    padding: 18px 20px !important;
}

body .ap-reputation-event-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
}

body .ap-reputation-event-title-wrap {
    min-width: 0 !important;
    display: block !important;
}

body .ap-reputation-event-top h3 {
    margin: 0 0 6px 0 !important;
    color: #0f172a !important;
    font-size: 17px !important;
    line-height: 1.3 !important;
}

body .ap-reputation-event-role {
    display: inline-flex !important;
    width: auto !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

body .ap-reputation-event-top time {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

body .ap-reputation-event-description {
    margin: 12px 0 0 0 !important;
    color: #475569 !important;
    line-height: 1.55 !important;
}

body .ap-reputation-event-metrics {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 13px !important;
}

body .ap-reputation-event-metrics span {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 30px !important;
    padding: 6px 10px !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

/* Фильтры менеджера: общий стандарт как на странице модерации. */
body .manager-unified-filter,
body .work-filter.manager-unified-filter,
body .roles-filter {
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #f9fafb !important;
    padding: 16px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

body .work-filter-head,
body .manager-unified-filter .work-filter-head {
    margin: 0 0 14px 0 !important;
}

body .work-filter-head h2 {
    margin: 0 0 4px 0 !important;
    color: #111827 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
}

body .work-filter-head p {
    margin: 0 !important;
    color: #6b7280 !important;
    line-height: 1.45 !important;
}

body .manager-unified-filter-grid,
body .work-filter-grid.manager-unified-filter-grid {
    display: grid !important;
    gap: 12px !important;
    align-items: end !important;
}

body .manager-unified-filter-grid-3 {
    grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.4fr) minmax(250px, auto) !important;
}

body .manager-unified-filter-grid-4 {
    grid-template-columns: minmax(165px, 0.75fr) minmax(165px, 0.75fr) minmax(280px, 1.35fr) minmax(250px, auto) !important;
}

body .work-field label {
    display: block !important;
    margin-bottom: 6px !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body .work-input,
body .work-select,
body .work-field input,
body .work-field select {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    font: inherit !important;
}

body .manager-unified-filter-actions,
body .work-filter-actions.manager-unified-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    min-width: 250px !important;
}

body .manager-unified-filter-actions .ap-action-btn {
    flex: 0 0 118px !important;
    min-width: 118px !important;
    white-space: nowrap !important;
}

@media (max-width: 980px) {
    body .ap-company-summary-table th {
        width: 180px !important;
    }

    body .ap-reputation-hero {
        grid-template-columns: 1fr !important;
    }

    body .ap-reputation-event-top {
        flex-direction: column !important;
    }

    body .manager-unified-filter-grid-3,
    body .manager-unified-filter-grid-4 {
        grid-template-columns: 1fr !important;
    }

    body .manager-unified-filter-actions,
    body .work-filter-actions.manager-unified-filter-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        min-width: 0 !important;
    }
}


/* Пакет 9.8.1.4 — фильтры, таблицы и история рейтинга */

/* Профиль компании: видимая разделительная линия и статус проверки под таблицей. */
body .ap-company-summary-table th {
    border-right: 1px solid #cbd5e1 !important;
}

body .ap-company-verification-status-line {
    margin-top: 16px !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(187, 247, 208, 0.95) !important;
    border-radius: 14px !important;
    background: #f0fdf4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

body .ap-company-verification-status-line span {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

body .ap-company-verification-status-line strong {
    color: #166534 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

/* Рейтинг: таблица с видимыми границами и нормальные строки в истории. */
body .ap-reputation-page .ap-reputation-rule-table-wrap {
    border: 1px solid #cbd5e1 !important;
}

body .ap-reputation-page .ap-reputation-rule-table th,
body .ap-reputation-page .ap-reputation-rule-table td {
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body .ap-reputation-page .ap-reputation-event,
body .ap-reputation-page .ap-reputation-event * {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

body .ap-reputation-page .ap-reputation-event-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 18px !important;
}

body .ap-reputation-page .ap-reputation-event-title-wrap {
    min-width: 0 !important;
    display: block !important;
}

body .ap-reputation-page .ap-reputation-event-top time {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

body .ap-reputation-page .ap-reputation-event-metrics {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

body .ap-reputation-page .ap-reputation-event-metrics span {
    display: inline-flex !important;
    width: auto !important;
    white-space: normal !important;
}

/* Единый стандарт фильтров как на модерации. */
body .manager-unified-page,
body .watch-page,
body .cancel-review-page,
body .price-page,
body .audit-page {
    display: grid !important;
    gap: 22px !important;
}

body .manager-unified-filter,
body .work-filter.manager-unified-filter {
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #f9fafb !important;
    padding: 16px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

body .work-filter-head {
    margin: 0 0 14px 0 !important;
}

body .work-filter-head h2 {
    margin: 0 0 4px 0 !important;
    color: #111827 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
}

body .work-filter-head p {
    margin: 0 !important;
    color: #6b7280 !important;
    line-height: 1.45 !important;
}

body .manager-unified-filter-grid {
    display: grid !important;
    gap: 12px !important;
    align-items: end !important;
}

body .manager-unified-filter-grid-3 {
    grid-template-columns: minmax(190px, 0.85fr) minmax(300px, 1.4fr) minmax(250px, auto) !important;
}

body .manager-unified-filter-grid-4 {
    grid-template-columns: minmax(165px, 0.75fr) minmax(165px, 0.75fr) minmax(300px, 1.35fr) minmax(250px, auto) !important;
}

body .manager-unified-filter-grid-5 {
    grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(250px, auto) !important;
}

body .audit-filter-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
}

body .work-field label {
    display: block !important;
    margin-bottom: 6px !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body .work-input,
body .work-select,
body .work-field input,
body .work-field select {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    font: inherit !important;
}

body .manager-unified-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    min-width: 250px !important;
}

body .manager-unified-filter-actions .ap-action-btn {
    flex: 0 0 118px !important;
    min-width: 118px !important;
    white-space: nowrap !important;
}

body .manager-pagination {
    margin-top: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    color: #475569 !important;
    font-weight: 800 !important;
}

@media (max-width: 1100px) {
    body .manager-unified-filter-grid-5,
    body .audit-filter-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    body .manager-unified-filter-grid-3,
    body .manager-unified-filter-grid-4,
    body .manager-unified-filter-grid-5,
    body .audit-filter-grid {
        grid-template-columns: 1fr !important;
    }

    body .manager-unified-filter-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        min-width: 0 !important;
    }
}


/* Пакет 9.8.1.5 — правки 05: единые фильтры и компактные карточки */
body .ap-company-profile-actions {
    display: grid !important;
    gap: 10px !important;
    justify-items: end !important;
    align-content: start !important;
}

body .ap-company-profile-actions-row {
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
}

body .ap-company-profile-status-line {
    width: 100% !important;
    max-width: 320px !important;
    margin-top: 0 !important;
    padding: 9px 12px !important;
    border-radius: 12px !important;
}

body .ap-reputation-event-compact {
    display: block !important;
    padding: 0 !important;
}

body .ap-reputation-event-compact .ap-reputation-event-body {
    padding: 12px 14px !important;
}

body .ap-reputation-event-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 14px !important;
    align-items: start !important;
}

body .ap-reputation-event-main {
    min-width: 0 !important;
    display: grid !important;
    gap: 8px !important;
}

body .ap-reputation-event-title-line {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

body .ap-reputation-event-title-line h3 {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
}

body .ap-reputation-event-time {
    white-space: nowrap !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

body .ap-reputation-event-compact .ap-reputation-event-description {
    margin: 0 !important;
    line-height: 1.38 !important;
    font-size: 13px !important;
    white-space: normal !important;
}

body .ap-reputation-event-compact .ap-reputation-event-metrics {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 0 !important;
    align-items: center !important;
}

body .ap-reputation-event-compact .ap-reputation-event-metrics span {
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    min-height: 24px !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body .support-summary-grid-compact {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

body .support-summary-grid-compact .support-summary-card {
    flex: 0 1 150px !important;
    min-width: 138px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
}

body .support-summary-grid-compact .support-summary-card span {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

body .support-summary-grid-compact .support-summary-card strong {
    font-size: 22px !important;
    line-height: 1.05 !important;
}

body .audit-list-compact {
    gap: 8px !important;
}

body .audit-list-compact .audit-card {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    border-left-width: 4px !important;
}

body .audit-list-compact .audit-card-top {
    margin-bottom: 8px !important;
    gap: 10px !important;
}

body .audit-list-compact .audit-title {
    margin-bottom: 3px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
}

body .audit-list-compact .audit-muted,
body .audit-list-compact .audit-source {
    font-size: 12px !important;
}

body .audit-list-compact .audit-grid,
body .audit-grid-compact {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin: 8px 0 !important;
}

body .audit-list-compact .audit-info {
    padding: 6px 8px !important;
    border-radius: 9px !important;
}

body .audit-list-compact .audit-info-label {
    margin-bottom: 2px !important;
    font-size: 11px !important;
}

body .audit-list-compact .audit-info-value {
    font-size: 12px !important;
    line-height: 1.25 !important;
}

body .audit-list-compact .ap-work-description {
    margin-top: 6px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

body .audit-list-compact .ap-work-actions {
    margin-top: 8px !important;
}

body .watch-unified-list {
    display: grid !important;
    gap: 14px !important;
    margin-top: 0 !important;
}

body .watch-section-title {
    display: none !important;
}

body .work-filter,
body .manager-unified-filter,
body .offer-workflow-filter,
body .support-filter,
body .audit-filter,
body .roles-filter,
body .ap-reputation-filter-card,
body .cancel-review-filter,
body .watch-filter,
body .company-verification-filter,
body .price-filter {
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #f9fafb !important;
    padding: 16px !important;
    box-shadow: none !important;
}

body .work-filter-grid,
body .manager-unified-filter-grid,
body .offer-filter-fields,
body .roles-filter-grid,
body .ap-reputation-filter-grid,
body .audit-filter-grid {
    display: grid !important;
    gap: 12px !important;
    align-items: end !important;
}

body .work-field label,
body .roles-filter label,
body .offer-workflow-filter label,
body .support-filter label,
body .audit-filter label,
body .ap-reputation-filter-card label {
    display: block !important;
    margin-bottom: 6px !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body .work-input,
body .work-select,
body .work-field input,
body .work-field select,
body .roles-filter input,
body .roles-filter select,
body .offer-workflow-filter input,
body .offer-workflow-filter select,
body .support-filter input,
body .support-filter select,
body .audit-filter input,
body .audit-filter select,
body .ap-reputation-filter-card input,
body .ap-reputation-filter-card select {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 40px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    font: inherit !important;
}

body .work-filter-actions,
body .manager-unified-filter-actions,
body .roles-filter-actions,
body .offer-filter-actions,
body .ap-reputation-filter-actions,
body .audit-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

body .work-filter-actions .ap-action-btn,
body .manager-unified-filter-actions .ap-action-btn,
body .roles-filter-actions .ap-action-btn,
body .offer-filter-actions .ap-action-btn,
body .ap-reputation-filter-actions .ap-action-btn,
body .audit-filter-actions .ap-action-btn {
    flex: 0 0 118px !important;
    min-width: 118px !important;
    white-space: nowrap !important;
}

body .nav-dropdown-menu a.is-active,
body .staff-work-nav a.is-active[data-work-nav-section="users_roles"] {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #14532d !important;
    font-weight: 900 !important;
}

@media (max-width: 980px) {
    body .ap-reputation-event-row {
        grid-template-columns: 1fr !important;
    }

    body .ap-reputation-event-time {
        white-space: normal !important;
    }

    body .audit-list-compact .audit-grid,
    body .audit-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    body .audit-list-compact .audit-grid,
    body .audit-grid-compact,
    body .roles-filter-grid,
    body .work-filter-grid,
    body .manager-unified-filter-grid {
        grid-template-columns: 1fr !important;
    }

    body .work-filter-actions,
    body .manager-unified-filter-actions,
    body .roles-filter-actions,
    body .offer-filter-actions,
    body .ap-reputation-filter-actions,
    body .audit-filter-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}


/* Пакет 9.8.1.6 — единый стандарт десяти фильтров и интервалы */
body .work-page,
body .price-page,
body .watch-page,
body .company-verification-manager-page,
body .support-page,
body .manager-tasks-page,
body .cancel-review-page,
body .roles-page,
body .audit-page,
body .disputes-manager-page {
    display: grid !important;
    gap: 22px !important;
}

body .work-page > *,
body .price-page > *,
body .watch-page > *,
body .company-verification-manager-page > *,
body .support-page > *,
body .manager-tasks-page > *,
body .cancel-review-page > *,
body .roles-page > *,
body .audit-page > *,
body .disputes-manager-page > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .work-filter,
body .manager-unified-filter,
body .manager-standard-filter,
body .moderation-unified-filter,
body .price-filter,
body .company-verification-filter,
body .watch-filter,
body .support-manager-filter,
body .manager-tasks-filter,
body .cancel-review-filter,
body .roles-filter,
body .audit-filter,
body .disputes-filter-panel {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 18px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    background: #f9fafb !important;
    box-shadow: none !important;
    margin: 0 !important;
}

body .work-filter-head,
body .disputes-filter-head,
body .offer-filter-top {
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    display: block !important;
}

body .work-filter-head h2,
body .disputes-filter-head h2,
body .offer-filter-heading h2 {
    margin: 0 0 4px 0 !important;
    color: #111827 !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
}

body .work-filter-head p,
body .disputes-filter-head p,
body .offer-filter-heading p,
body .work-filter .ap-work-muted {
    margin: 0 !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .work-filter-grid,
body .manager-unified-filter-grid,
body .price-filter-grid,
body .watch-filter-grid,
body .support-filter-grid,
body .manager-tasks-filter-grid,
body .roles-filter-grid,
body .audit-filter-grid,
body .disputes-filter-grid,
body .offer-filter-fields {
    display: grid !important;
    gap: 12px !important;
    align-items: end !important;
}

body .manager-unified-filter-grid-3,
body .company-verification-filter .work-filter-grid,
body .cancel-review-filter .work-filter-grid,
body .disputes-filter-grid {
    grid-template-columns: minmax(180px, 0.9fr) minmax(280px, 1.4fr) minmax(250px, auto) !important;
}

body .manager-unified-filter-grid-4,
body .support-manager-filter .work-filter-grid,
body .watch-filter .work-filter-grid,
body .roles-filter-grid {
    grid-template-columns: minmax(170px, 0.8fr) minmax(170px, 0.8fr) minmax(280px, 1.35fr) minmax(250px, auto) !important;
}

body .manager-unified-filter-grid-5,
body .moderation-unified-filter .work-filter-grid,
body .price-filter .work-filter-grid,
body .manager-tasks-filter .work-filter-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr)) minmax(250px, auto) !important;
}

body .audit-filter-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
}

body .work-field,
body .price-field,
body .watch-field,
body .offer-filter-field,
body .disputes-field,
body .roles-filter-grid > div,
body .audit-filter-grid > div,
body .manager-tasks-filter-grid > div,
body .support-filter-grid > div {
    min-width: 0 !important;
    display: grid !important;
    gap: 6px !important;
}

body .work-field label,
body .price-field label,
body .watch-field label,
body .offer-filter-field label,
body .disputes-field label,
body .roles-filter label,
body .audit-filter label,
body .manager-tasks-filter label,
body .support-filter label {
    display: block !important;
    margin: 0 !important;
    color: #374151 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
}

body .work-input,
body .work-select,
body .price-input,
body .price-select,
body .watch-input,
body .watch-select,
body .disputes-input,
body .disputes-select,
body .offer-filter-field input,
body .offer-filter-field select,
body .roles-filter input,
body .roles-filter select,
body .audit-filter input,
body .audit-filter select,
body .manager-tasks-filter input,
body .manager-tasks-filter select,
body .support-filter input,
body .support-filter select {
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font: inherit !important;
    line-height: 1.35 !important;
}

body .work-filter-actions,
body .manager-unified-filter-actions,
body .price-filter-actions,
body .watch-filter-actions,
body .support-filter-actions,
body .manager-filter-actions,
body .roles-filter-actions,
body .audit-filter-actions,
body .disputes-filter-actions,
body .offer-filter-actions,
body .market-clean-filter-actions,
body .billing-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    align-self: end !important;
    min-width: 240px !important;
}

body .work-filter-actions .ap-action-btn,
body .manager-unified-filter-actions .ap-action-btn,
body .price-filter-actions .ap-action-btn,
body .watch-filter-actions .ap-action-btn,
body .support-filter-actions .ap-action-btn,
body .manager-filter-actions .ap-action-btn,
body .roles-filter-actions .ap-action-btn,
body .audit-filter-actions .ap-action-btn,
body .disputes-filter-actions .ap-action-btn,
body .offer-filter-actions .ap-action-btn {
    flex: 1 1 0 !important;
    min-width: 112px !important;
    white-space: nowrap !important;
    justify-content: center !important;
}

body .work-summary,
body .price-summary,
body .audit-summary,
body .cancel-review-summary,
body .manager-summary-line {
    margin: 0 !important;
}

@media (max-width: 1100px) {
    body .manager-unified-filter-grid-5,
    body .moderation-unified-filter .work-filter-grid,
    body .price-filter .work-filter-grid,
    body .manager-tasks-filter .work-filter-grid,
    body .audit-filter-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    body .work-filter-grid,
    body .manager-unified-filter-grid,
    body .price-filter-grid,
    body .watch-filter-grid,
    body .support-filter-grid,
    body .manager-tasks-filter-grid,
    body .roles-filter-grid,
    body .audit-filter-grid,
    body .disputes-filter-grid,
    body .offer-filter-fields {
        grid-template-columns: 1fr !important;
    }

    body .work-filter-actions,
    body .manager-unified-filter-actions,
    body .price-filter-actions,
    body .watch-filter-actions,
    body .support-filter-actions,
    body .manager-filter-actions,
    body .roles-filter-actions,
    body .audit-filter-actions,
    body .disputes-filter-actions,
    body .offer-filter-actions {
        min-width: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

/* Пакет 9.8.1.7 — единый стандарт отступов и поддержка */

:root {
    --ap-standard-page-gap: 18px;
    --ap-standard-section-gap: 18px;
    --ap-standard-card-padding-y: 18px;
    --ap-standard-card-padding-x: 20px;
    --ap-standard-filter-padding: 16px;
    --ap-standard-field-gap: 7px;
    --ap-standard-grid-gap: 12px;
    --ap-standard-radius: 16px;
}

/* Базовый ритм рабочих страниц: одинаковый интервал между крупными блоками. */
body .ap-manager-standard-page,
body .manager-unified-page,
body .work-page,
body .support-page,
body .roles-page,
body .watch-page,
body .manager-final-page {
    display: grid !important;
    gap: var(--ap-standard-page-gap) !important;
}

body .ap-manager-standard-page > *,
body .manager-unified-page > *,
body .work-page > *,
body .support-page > *,
body .roles-page > *,
body .watch-page > *,
body .manager-final-page > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Единый отступ информации от края контейнера. */
body .ap-section-hero,
body .work-filter,
body .manager-unified-filter,
body .manager-standard-filter,
body .roles-filter,
body .support-card,
body .ticket-card,
body .ap-work-card,
body .audit-card,
body .audit-log-card {
    box-sizing: border-box !important;
}

/* Единый стандарт фильтра: фон, рамка, заголовок, поля и кнопки. */
body .work-filter,
body .manager-unified-filter,
body .manager-standard-filter,
body .roles-filter {
    padding: var(--ap-standard-filter-padding) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: var(--ap-standard-radius) !important;
    background: #f9fafb !important;
    box-shadow: none !important;
}

body .work-filter-head,
body .manager-unified-filter .work-filter-head,
body .manager-standard-filter .work-filter-head {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

body .work-filter-head h2,
body .manager-unified-filter .work-filter-head h2,
body .manager-standard-filter .work-filter-head h2 {
    margin: 0 0 4px 0 !important;
    color: #111827 !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
}

body .work-filter-head p,
body .manager-unified-filter .work-filter-head p,
body .manager-standard-filter .work-filter-head p {
    margin: 0 !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .work-field {
    display: grid !important;
    gap: var(--ap-standard-field-gap) !important;
    min-width: 0 !important;
}

body .work-field label {
    margin: 0 !important;
    color: #374151 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
}

body .work-input,
body .work-select,
body .work-field input,
body .work-field select {
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font: inherit !important;
}

body .manager-unified-filter-grid,
body .work-filter-grid.manager-unified-filter-grid {
    gap: var(--ap-standard-grid-gap) !important;
    align-items: end !important;
}

body .manager-unified-filter-actions,
body .work-filter-actions.manager-unified-filter-actions {
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

body .manager-unified-filter-actions .ap-action-btn,
body .work-filter-actions.manager-unified-filter-actions .ap-action-btn {
    min-height: 40px !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
}

/* Страница поддержки: верхний интервал меньше, три счётчика скрыты/не используются. */
body .support-manager-spacing-standard {
    gap: 14px !important;
}

body .support-manager-spacing-standard .ap-section-hero {
    padding: 20px 22px !important;
}

body .support-manager-spacing-standard .ap-staff-work-nav-wrap {
    margin: 0 !important;
}

body .support-manager-spacing-standard .support-manager-filter {
    margin-top: 0 !important;
}

body .support-manager-spacing-standard .support-ticket-list,
body .support-manager-spacing-standard .ticket-list {
    display: grid !important;
    gap: 12px !important;
}

body .support-manager-spacing-standard .support-card,
body .support-manager-spacing-standard .ticket-card,
body .support-manager-spacing-standard .support-ticket-card {
    padding: var(--ap-standard-card-padding-y) var(--ap-standard-card-padding-x) !important;
    border-radius: var(--ap-standard-radius) !important;
}

body .support-manager-spacing-standard .support-card-top {
    gap: 14px !important;
    margin-bottom: 10px !important;
}

body .support-manager-spacing-standard .support-card-title {
    margin: 0 0 5px 0 !important;
    line-height: 1.3 !important;
}

body .support-manager-spacing-standard .support-card-text {
    margin: 10px 0 0 0 !important;
    line-height: 1.5 !important;
}

body .support-manager-spacing-standard .support-card-footer {
    margin-top: 12px !important;
    gap: 8px !important;
}

body .support-manager-spacing-standard .support-summary-grid,
body .support-manager-spacing-standard .support-summary-grid-compact {
    display: none !important;
}

/* Единый стандарт расстояний для списков после фильтров. */
body .manager-unified-page .ap-work-list,
body .manager-unified-page .watch-list,
body .manager-unified-page .ticket-list,
body .manager-unified-page .audit-list,
body .manager-unified-page .roles-list,
body .ap-manager-standard-page .ap-work-list,
body .ap-manager-standard-page .watch-list,
body .ap-manager-standard-page .ticket-list,
body .ap-manager-standard-page .audit-list,
body .ap-manager-standard-page .roles-list {
    margin-top: 0 !important;
}

@media (max-width: 980px) {
    body .manager-unified-filter-actions,
    body .work-filter-actions.manager-unified-filter-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    body .support-manager-spacing-standard {
        gap: 12px !important;
    }
}

/* Пакет 9.8.2 — глобальная дизайн-система Agro Platform */

/*
    Design System 9.8.2:
    единый визуальный ритм всей платформы: страницы, hero, фильтры,
    карточки, таблицы, формы, текст, кнопки и смысловые цветовые акценты.
*/

:root {
    /* Базовая палитра */
    --ap-ds-bg: #f8fafc;
    --ap-ds-surface: #ffffff;
    --ap-ds-surface-soft: #f9fafb;
    --ap-ds-surface-muted: #f1f5f9;
    --ap-ds-text: #0f172a;
    --ap-ds-text-soft: #334155;
    --ap-ds-muted: #64748b;
    --ap-ds-border: #e2e8f0;
    --ap-ds-border-soft: #eef2f7;
    --ap-ds-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --ap-ds-shadow-md: 0 14px 34px rgba(15, 23, 42, 0.09);

    /* Основной бренд */
    --ap-ds-primary: #16a34a;
    --ap-ds-primary-hover: #15803d;
    --ap-ds-primary-soft: #dcfce7;

    /* Смысловые акценты */
    --ap-accent-market: #16a34a;
    --ap-accent-analytics: #0891b2;
    --ap-accent-deals: #2563eb;
    --ap-accent-offers: #4f46e5;
    --ap-accent-chat: #0284c7;
    --ap-accent-dispute: #dc2626;
    --ap-accent-moderation: #ea580c;
    --ap-accent-watch: #d97706;
    --ap-accent-support: #06b6d4;
    --ap-accent-billing: #7c3aed;
    --ap-accent-reputation: #059669;
    --ap-accent-admin: #475569;
    --ap-accent-legal: #334155;

    /* Размеры и отступы */
    --ap-ds-page-width: 1200px;
    --ap-ds-main-padding: 24px;
    --ap-ds-page-gap: 20px;
    --ap-ds-section-gap: 20px;
    --ap-ds-card-padding-y: 20px;
    --ap-ds-card-padding-x: 22px;
    --ap-ds-filter-padding: 18px;
    --ap-ds-field-gap: 7px;
    --ap-ds-grid-gap: 12px;
    --ap-ds-inline-gap: 10px;

    /* Радиусы */
    --ap-ds-radius-sm: 10px;
    --ap-ds-radius-md: 14px;
    --ap-ds-radius-card: 18px;
    --ap-ds-radius-hero: 22px;

    /* Типографика */
    --ap-ds-font-size-body: 15px;
    --ap-ds-line-height: 1.5;
    --ap-ds-line-height-tight: 1.28;
    --ap-ds-h1: 30px;
    --ap-ds-h2: 22px;
    --ap-ds-h3: 17px;

    /* Акцент по умолчанию */
    --ap-section-accent: var(--ap-ds-primary);
    --ap-section-accent-soft: var(--ap-ds-primary-soft);
}

/* База страницы */
html {
    background: var(--ap-ds-bg) !important;
}

body {
    background: var(--ap-ds-bg) !important;
    color: var(--ap-ds-text) !important;
    font-size: var(--ap-ds-font-size-body) !important;
    line-height: var(--ap-ds-line-height) !important;
}

body main {
    max-width: var(--ap-ds-page-width) !important;
    margin: 24px auto !important;
    padding: var(--ap-ds-main-padding) !important;
    border-radius: var(--ap-ds-radius-card) !important;
    background: var(--ap-ds-surface) !important;
    box-shadow: var(--ap-ds-shadow-sm) !important;
    box-sizing: border-box !important;
}

/* Универсальный ритм страниц */
body .home-page,
body .public-page,
body .dashboard-page,
body .analytics-page,
body .culture-page,
body .billing-page,
body .billing-payment-page,
body .billing-platform-requisites-page,
body .billing-tariff-settings-page,
body .tariff-settings-page,
body .ap-company-page,
body .ap-reputation-page,
body .ap-form-page,
body .ap-workflow-form-page,
body .ap-object-detail-page,
body .ap-object-form-page,
body .ap-market-page,
body .market-clean-page,
body .market-workspace-page,
body .ap-public-market-detail-page,
body .ap-public-lots-page,
body .ap-public-buy-requests-page,
body .lot-workspace-page,
body .buy-request-workspace-page,
body .offers-page,
body .offer-page,
body .offer-detail-page,
body .offer-workflow-page,
body .offer-deal-detail-page,
body .deals-page,
body .deal-workflow-page,
body .chat-page,
body .chat-dialog-page,
body .disputes-page,
body .dispute-page,
body .support-page,
body .support-user-page,
body .support-form-page,
body .support-detail-page,
body .support-manager-detail-page,
body .manager-final-page,
body .manager-unified-page,
body .ap-manager-standard-page,
body .manager-tasks-page,
body .watch-page,
body .watch-detail-page,
body .work-page,
body .price-page,
body .workspace-page,
body .cancel-review-page,
body .cancel-detail-page,
body .cancel-response-page,
body .roles-page,
body .audit-page,
body .audit-detail-page,
body .notifications-page,
body .notification-detail-page,
body .ap-auth-page,
body .ap-error-page {
    display: grid !important;
    gap: var(--ap-ds-page-gap) !important;
    max-width: var(--ap-ds-page-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body .home-page > *,
body .public-page > *,
body .dashboard-page > *,
body .analytics-page > *,
body .culture-page > *,
body .billing-page > *,
body .ap-company-page > *,
body .ap-reputation-page > *,
body .ap-market-page > *,
body .market-clean-page > *,
body .offers-page > *,
body .deals-page > *,
body .chat-page > *,
body .chat-dialog-page > *,
body .disputes-page > *,
body .support-page > *,
body .manager-final-page > *,
body .manager-unified-page > *,
body .ap-manager-standard-page > *,
body .roles-page > *,
body .audit-page > *,
body .notifications-page > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Смысловые акценты разделов */
body .market-clean-page,
body .ap-market-page,
body .lot-workspace-page,
body .buy-request-workspace-page,
body .ap-public-lots-page,
body .ap-public-buy-requests-page {
    --ap-section-accent: var(--ap-accent-market);
    --ap-section-accent-soft: #dcfce7;
}

body .analytics-page,
body .culture-page {
    --ap-section-accent: var(--ap-accent-analytics);
    --ap-section-accent-soft: #cffafe;
}

body .deals-page,
body .deal-workflow-page,
body .offer-deal-detail-page {
    --ap-section-accent: var(--ap-accent-deals);
    --ap-section-accent-soft: #dbeafe;
}

body .offers-page,
body .offer-page,
body .offer-detail-page,
body .offer-workflow-page {
    --ap-section-accent: var(--ap-accent-offers);
    --ap-section-accent-soft: #e0e7ff;
}

body .chat-page,
body .chat-dialog-page {
    --ap-section-accent: var(--ap-accent-chat);
    --ap-section-accent-soft: #e0f2fe;
}

body .disputes-page,
body .dispute-page,
body .ap-dispute-create-page {
    --ap-section-accent: var(--ap-accent-dispute);
    --ap-section-accent-soft: #fee2e2;
}

body .manager-final-page,
body .price-page,
body .workspace-page,
body .company-verification-manager-page {
    --ap-section-accent: var(--ap-accent-moderation);
    --ap-section-accent-soft: #ffedd5;
}

body .watch-page,
body .watch-detail-page {
    --ap-section-accent: var(--ap-accent-watch);
    --ap-section-accent-soft: #fef3c7;
}

body .support-page,
body .support-user-page,
body .support-form-page,
body .support-detail-page,
body .support-manager-detail-page {
    --ap-section-accent: var(--ap-accent-support);
    --ap-section-accent-soft: #cffafe;
}

body .billing-page,
body .billing-payment-page,
body .billing-platform-requisites-page,
body .billing-tariff-settings-page,
body .tariff-settings-page {
    --ap-section-accent: var(--ap-accent-billing);
    --ap-section-accent-soft: #ede9fe;
}

body .ap-reputation-page {
    --ap-section-accent: var(--ap-accent-reputation);
    --ap-section-accent-soft: #d1fae5;
}

body .roles-page,
body .audit-page,
body .audit-detail-page {
    --ap-section-accent: var(--ap-accent-admin);
    --ap-section-accent-soft: #e2e8f0;
}

body .public-page {
    --ap-section-accent: var(--ap-accent-legal);
    --ap-section-accent-soft: #e2e8f0;
}

/* Hero */
body .ap-section-hero,
body .ap-workflow-hero,
body .ap-object-hero,
body .ap-object-form-hero,
body .ap-market-hero,
body .chat-hero,
body .chat-dialog-hero,
body .ap-company-trust-hero,
body .offer-deal-detail-hero,
body .manager-final-hero,
body .roles-hero,
body .culture-hero,
body .analytics-hero,
body .ap-reputation-hero,
body .home-hero,
body .public-hero,
body .support-hero,
body .notification-hero,
body .billing-hero {
    position: relative !important;
    overflow: hidden !important;
    padding: 24px 26px !important;
    border: 1px solid var(--ap-ds-border) !important;
    border-radius: var(--ap-ds-radius-hero) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: var(--ap-ds-shadow-sm) !important;
    box-sizing: border-box !important;
}

body .ap-section-hero::before,
body .ap-workflow-hero::before,
body .ap-object-hero::before,
body .ap-object-form-hero::before,
body .ap-market-hero::before,
body .chat-hero::before,
body .chat-dialog-hero::before,
body .ap-company-trust-hero::before,
body .offer-deal-detail-hero::before,
body .manager-final-hero::before,
body .roles-hero::before,
body .culture-hero::before,
body .analytics-hero::before,
body .ap-reputation-hero::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 auto 0 0 !important;
    width: 4px !important;
    background: var(--ap-section-accent) !important;
}

body .ap-section-title,
body .ap-workflow-title,
body .home-title,
body .public-title,
body .dashboard-title,
body .support-page-title,
body .notifications-title,
body .notification-detail-title {
    margin: 0 0 8px 0 !important;
    color: var(--ap-ds-text) !important;
    font-size: var(--ap-ds-h1) !important;
    line-height: var(--ap-ds-line-height-tight) !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
}

body .ap-section-subtitle,
body .ap-workflow-subtitle,
body .home-subtitle,
body .public-subtitle,
body .dashboard-subtitle,
body .support-page-subtitle,
body .notifications-subtitle,
body .notification-detail-subtitle {
    margin: 0 !important;
    max-width: 920px !important;
    color: var(--ap-ds-muted) !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
}

body .ap-section-actions,
body .ap-actions,
body .ap-form-actions,
body .ap-card-actions-row,
body .ap-document-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: var(--ap-ds-inline-gap) !important;
    flex-wrap: wrap !important;
}

/* Фильтры */
body .work-filter,
body .manager-unified-filter,
body .manager-standard-filter,
body .roles-filter,
body .market-clean-filter,
body .market-object-filter,
body .market-final-filter,
body .ap-market-filter,
body .offer-workflow-filter,
body .deal-filter,
body .disputes-filter-panel,
body .support-filter,
body .notification-filter,
body .billing-filter,
body .audit-filter {
    padding: var(--ap-ds-filter-padding) !important;
    border: 1px solid var(--ap-ds-border) !important;
    border-radius: var(--ap-ds-radius-card) !important;
    background: var(--ap-ds-surface-soft) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

body .work-filter-head,
body .market-clean-filter-head,
body .ap-market-filter-head,
body .manager-filter-head,
body .support-filter-head,
body .billing-filter-head,
body .audit-filter-head,
body .roles-filter-head {
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
}

body .work-filter-head h2,
body .market-clean-filter-head h2,
body .ap-market-filter-head h2,
body .manager-filter-head h2,
body .support-filter-head h2,
body .billing-filter-head h2,
body .audit-filter-head h2,
body .roles-filter-head h2 {
    margin: 0 0 4px 0 !important;
    color: var(--ap-ds-text) !important;
    font-size: 18px !important;
    line-height: 1.28 !important;
    font-weight: 900 !important;
}

body .work-filter-head p,
body .market-clean-filter-head p,
body .ap-market-filter-head p,
body .manager-filter-head p,
body .support-filter-head p,
body .billing-filter-head p,
body .audit-filter-head p,
body .roles-filter-head p {
    margin: 0 !important;
    color: var(--ap-ds-muted) !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .work-filter-grid,
body .manager-unified-filter-grid,
body .market-clean-filter-grid,
body .market-final-filter-controls,
body .market-object-filter-controls,
body .ap-market-filter-grid,
body .offer-filter-fields,
body .deal-filter-grid,
body .disputes-filter-grid,
body .support-filter-panel,
body .billing-filter-grid,
body .audit-filter-grid,
body .roles-filter-grid {
    display: grid !important;
    gap: var(--ap-ds-grid-gap) !important;
    align-items: end !important;
}

body .work-field,
body .market-final-filter-field,
body .market-clean-filter-field,
body .ap-market-filter-field,
body .offer-filter-field,
body .deal-filter-field,
body .disputes-field,
body .support-filter-field,
body .billing-field,
body .audit-field,
body .roles-field,
body .ap-form-field,
body .detail-form-field,
body .support-form-field {
    display: grid !important;
    gap: var(--ap-ds-field-gap) !important;
    min-width: 0 !important;
}

body .work-field label,
body .market-final-filter-field label,
body .market-clean-filter-field label,
body .ap-market-filter-field label,
body .offer-filter-field label,
body .deal-filter-field label,
body .disputes-field label,
body .support-filter-field label,
body .billing-field label,
body .audit-field label,
body .roles-field label,
body .ap-form-field label,
body .detail-form-field label,
body .support-form-field label {
    margin: 0 !important;
    color: var(--ap-ds-text-soft) !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
}

body input,
body select,
body textarea,
body .work-input,
body .work-select,
body .ap-input,
body .ap-select {
    box-sizing: border-box !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--ap-ds-radius-sm) !important;
    background: var(--ap-ds-surface) !important;
    color: var(--ap-ds-text) !important;
    font: inherit !important;
    line-height: 1.35 !important;
}

body input,
body select,
body .work-input,
body .work-select,
body .ap-input,
body .ap-select {
    min-height: 40px !important;
    padding: 8px 10px !important;
}

body textarea {
    min-height: 108px !important;
    padding: 10px 12px !important;
    line-height: 1.5 !important;
    resize: vertical !important;
}

body input:focus,
body select:focus,
body textarea:focus {
    border-color: var(--ap-section-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ap-section-accent) 18%, transparent) !important;
    outline: none !important;
}

/* Кнопки */
body .ap-action-btn,
body .btn,
body button[type="submit"],
body .dashboard-step-mini-btn,
body .logout-btn {
    box-sizing: border-box !important;
    border-radius: var(--ap-ds-radius-sm) !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
}

body .ap-action-btn {
    min-height: 40px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

body .ap-action-confirm,
body .btn,
body .ap-action-primary {
    border: 1px solid var(--ap-ds-primary) !important;
    background: var(--ap-ds-primary) !important;
    color: #ffffff !important;
}

body .ap-action-confirm:hover,
body .btn:hover,
body .ap-action-primary:hover {
    border-color: var(--ap-ds-primary-hover) !important;
    background: var(--ap-ds-primary-hover) !important;
    color: #ffffff !important;
}

body .ap-action-neutral,
body .btn-muted {
    border: 1px solid var(--ap-ds-border) !important;
    background: var(--ap-ds-surface) !important;
    color: var(--ap-ds-text-soft) !important;
}

body .ap-action-neutral:hover,
body .btn-muted:hover {
    border-color: var(--ap-section-accent) !important;
    color: var(--ap-section-accent) !important;
    background: var(--ap-section-accent-soft) !important;
}

/* Карточки */
body .ap-work-card,
body .home-card,
body .dashboard-stat-card,
body .dashboard-action-card,
body .dashboard-mini-card,
body .ap-object-card,
body .ap-market-summary-card,
body .ap-company-card,
body .ap-reputation-metric-card,
body .deal-detail-card,
body .detail-card,
body .detail-card-white,
body .support-info-card,
body .support-card,
body .ticket-card,
body .audit-card,
body .audit-log-card,
body .notification-card,
body .billing-card,
body .billing-panel,
body .tariff-card,
body .dispute-card,
body .disputes-card,
body .ap-empty-card {
    box-sizing: border-box !important;
    padding: var(--ap-ds-card-padding-y) var(--ap-ds-card-padding-x) !important;
    border: 1px solid var(--ap-ds-border) !important;
    border-radius: var(--ap-ds-radius-card) !important;
    background: var(--ap-ds-surface) !important;
    box-shadow: var(--ap-ds-shadow-sm) !important;
}

body .ap-work-card,
body .home-card,
body .dashboard-action-card,
body .ap-object-card,
body .ap-market-summary-card,
body .ap-company-card,
body .support-card,
body .ticket-card,
body .billing-card,
body .dispute-card,
body .disputes-card,
body .notification-card {
    box-shadow: inset 3px 0 0 var(--ap-section-accent), var(--ap-ds-shadow-sm) !important;
}

body .ap-clickable-card,
body .click-card,
body .home-card,
body .dashboard-action-card,
body .ap-work-card,
body .ap-card-link-reset {
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background-color 0.14s ease !important;
}

body .ap-clickable-card:hover,
body .click-card:hover,
body .home-card:hover,
body .dashboard-action-card:hover,
body .ap-work-card:hover,
body .ap-card-link-reset:hover {
    transform: translateY(-1px) !important;
    border-color: color-mix(in srgb, var(--ap-section-accent) 35%, var(--ap-ds-border)) !important;
    box-shadow: inset 3px 0 0 var(--ap-section-accent), var(--ap-ds-shadow-md) !important;
    text-decoration: none !important;
}

body .ap-work-card-title,
body .home-card-title,
body .dashboard-section-title,
body .dashboard-mini-title,
body .dashboard-action-title,
body .billing-panel-title,
body .billing-section-title,
body .support-card-title,
body .detail-card-header h2,
body .ap-object-card-head h2 {
    margin: 0 0 6px 0 !important;
    color: var(--ap-ds-text) !important;
    font-size: var(--ap-ds-h3) !important;
    line-height: var(--ap-ds-line-height-tight) !important;
    font-weight: 900 !important;
}

body .ap-work-muted,
body .home-card-text,
body .support-card-text,
body .detail-subtitle,
body .ap-form-helper,
body .ap-form-help {
    color: var(--ap-ds-muted) !important;
    line-height: 1.5 !important;
}

/* Таблицы */
body .ap-table-wrap,
body .culture-table-wrap,
body .ap-company-summary-table-wrap,
body .ap-reputation-rule-table-wrap,
body .billing-table-wrap {
    overflow: hidden !important;
    border: 1px solid var(--ap-ds-border) !important;
    border-radius: var(--ap-ds-radius-card) !important;
    background: var(--ap-ds-surface) !important;
}

body table,
body .ap-table,
body .culture-table,
body .ap-company-summary-table,
body .ap-reputation-rule-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
}

body th,
body td,
body .ap-table th,
body .ap-table td,
body .culture-table th,
body .culture-table td,
body .ap-company-summary-table th,
body .ap-company-summary-table td,
body .ap-reputation-rule-table th,
body .ap-reputation-rule-table td {
    padding: 13px 15px !important;
    border-bottom: 1px solid var(--ap-ds-border) !important;
    line-height: 1.45 !important;
    vertical-align: top !important;
    text-align: left !important;
}

body th,
body .ap-table th,
body .culture-table th,
body .ap-company-summary-table th,
body .ap-reputation-rule-table th {
    background: var(--ap-ds-surface-soft) !important;
    color: var(--ap-ds-text-soft) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
}

/* Формы */
body .ap-form-header,
body .ap-form-section,
body .ap-company-form-section,
body .ap-object-form,
body .ap-workflow-form,
body .support-form,
body .detail-form,
body .watch-manager-form {
    box-sizing: border-box !important;
}

body .ap-form-grid,
body .ap-form-grid-two,
body .ap-company-form-grid,
body .ap-object-form-grid,
body .ap-document-form-grid,
body .billing-settings-fields-grid,
body .support-form-grid {
    display: grid !important;
    gap: 14px !important;
}

body .ap-form-errors,
body .errorlist,
body .field-error,
body .ap-auth-error {
    margin-top: 6px !important;
    color: #b91c1c !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

body .ap-form-footer,
body .ap-form-actions,
body .dispute-form-actions {
    margin-top: var(--ap-ds-section-gap) !important;
    padding-top: 14px !important;
    border-top: 1px solid var(--ap-ds-border-soft) !important;
}

/* Списки и пустые состояния */
body .ap-workflow-list,
body .ap-work-list,
body .market-clean-list,
body .market-object-card-list,
body .deals-list,
body .offers-list,
body .disputes-list,
body .support-ticket-list,
body .ticket-list,
body .notifications-list,
body .notification-list,
body .audit-list,
body .audit-list-compact,
body .roles-list,
body .watch-list {
    display: grid !important;
    gap: 14px !important;
}

body .ap-system-empty,
body .dashboard-empty,
body .ap-empty-card,
body .disputes-empty,
body .watch-empty {
    padding: 18px 20px !important;
    border: 1px solid color-mix(in srgb, var(--ap-section-accent) 28%, var(--ap-ds-border)) !important;
    border-radius: var(--ap-ds-radius-card) !important;
    background: linear-gradient(135deg, var(--ap-ds-surface) 0%, var(--ap-section-accent-soft) 100%) !important;
    color: var(--ap-ds-text-soft) !important;
    line-height: 1.5 !important;
}

/* Типографика внутри контента */
body p {
    line-height: var(--ap-ds-line-height) !important;
}

body h1,
body h2,
body h3 {
    line-height: var(--ap-ds-line-height-tight) !important;
}

body h1 {
    font-size: var(--ap-ds-h1) !important;
}

body h2 {
    font-size: var(--ap-ds-h2) !important;
}

body h3 {
    font-size: var(--ap-ds-h3) !important;
}

/* Мобильная плотность */
@media (max-width: 980px) {
    :root {
        --ap-ds-main-padding: 18px;
        --ap-ds-page-gap: 16px;
        --ap-ds-card-padding-y: 16px;
        --ap-ds-card-padding-x: 16px;
        --ap-ds-h1: 25px;
        --ap-ds-h2: 20px;
    }

    body main {
        margin: 16px auto !important;
        border-radius: 0 !important;
    }

    body .ap-section-hero,
    body .ap-workflow-hero,
    body .ap-object-hero,
    body .ap-object-form-hero,
    body .ap-market-hero,
    body .chat-hero,
    body .chat-dialog-hero,
    body .ap-company-trust-hero,
    body .offer-deal-detail-hero,
    body .manager-final-hero,
    body .roles-hero,
    body .culture-hero,
    body .analytics-hero,
    body .ap-reputation-hero {
        padding: 20px !important;
    }

    body .ap-action-btn {
        white-space: normal !important;
    }
}

/* Пакет 9.8.2.1.1 — восстановление CSS и фиксация верхних блоков */

/*
    Правки 012:
    - восстановлен полный CSS 9.8.2, чтобы не потерять слои 9.8.1.6 / 9.8.1.7 / 9.8.2;
    - у всех верхних блоков страниц принудительно убрана левая цветная полоса;
    - для верхних блоков страниц принудительно задан зелёно-белый градиент;
    - действия в профиле компании выровнены вправо;
    - пользовательские фильтры закреплены в общем стандарте.
*/

/* Верхний блок страницы: единый зелёно-белый фон. */
body .ap-section-hero,
body header.ap-section-hero,
body section.ap-section-hero,
body .ap-workflow-hero,
body .ap-object-hero,
body .ap-object-form-hero,
body .ap-market-hero,
body .chat-hero,
body .chat-dialog-hero,
body .ap-company-trust-hero,
body .offer-deal-detail-hero,
body .manager-final-hero,
body .roles-hero,
body .culture-hero,
body .analytics-hero,
body .ap-reputation-hero,
body .home-hero,
body .public-hero,
body .support-hero,
body .notification-hero,
body .billing-hero {
    background: linear-gradient(90deg, #dcfce7 0%, #f0fdf4 42%, #ffffff 100%) !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 1px solid #bbf7d0 !important;
    box-shadow: 0 10px 24px rgba(22, 101, 52, 0.07) !important;
}

/* Основные страницы — более выраженный зелёный вход слева. */
body .home-page > .ap-section-hero,
body .dashboard-page > .ap-section-hero,
body .workspace-page > .ap-section-hero,
body .manager-final-page > .ap-section-hero:first-child,
body .analytics-page > .ap-section-hero,
body .billing-page > .ap-section-hero,
body .market-clean-page > .ap-section-hero:first-child {
    background: linear-gradient(90deg, #bbf7d0 0%, #dcfce7 36%, #ffffff 100%) !important;
}

/* Второстепенные страницы — спокойнее, но всё равно выделены. */
body .support-page > .ap-section-hero,
body .public-page > .ap-section-hero,
body .ap-object-detail-page > .ap-section-hero,
body .ap-object-form-page > .ap-section-hero,
body .chat-dialog-page > .ap-section-hero,
body .audit-detail-page > .ap-section-hero,
body .notification-detail-page > .ap-section-hero {
    background: linear-gradient(90deg, #e8fbe9 0%, #f7fff9 48%, #ffffff 100%) !important;
}

/* Жёстко убираем левую цветную полосу/тень именно у верхних блоков страниц. */
body .ap-section-hero::before,
body header.ap-section-hero::before,
body section.ap-section-hero::before,
body .ap-workflow-hero::before,
body .ap-object-hero::before,
body .ap-object-form-hero::before,
body .ap-market-hero::before,
body .chat-hero::before,
body .chat-dialog-hero::before,
body .ap-company-trust-hero::before,
body .offer-deal-detail-hero::before,
body .manager-final-hero::before,
body .roles-hero::before,
body .culture-hero::before,
body .analytics-hero::before,
body .ap-reputation-hero::before,
body .home-hero::before,
body .public-hero::before,
body .support-hero::before,
body .notification-hero::before,
body .billing-hero::before,
body .ap-section-hero::after,
body header.ap-section-hero::after,
body section.ap-section-hero::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* Защита от старых border-left на верхних блоках. */
body .ap-section-hero,
body header.ap-section-hero,
body section.ap-section-hero,
body .ap-company-trust-hero,
body .ap-workflow-hero,
body .support-hero,
body .manager-final-hero {
    border-left-width: 1px !important;
}

/* Профиль компании: кнопки и статус проверки справа. */
body .ap-company-profile-actions {
    margin-left: auto !important;
    flex: 0 0 auto !important;
    min-width: 300px !important;
    display: grid !important;
    justify-items: end !important;
    align-content: start !important;
    gap: 10px !important;
    text-align: right !important;
}

body .ap-company-profile-actions-row {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

body .ap-company-profile-status-line {
    width: max-content !important;
    min-width: 240px !important;
    max-width: 360px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 14px !important;
    background: #f0fdf4 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    box-sizing: border-box !important;
}

body .ap-company-profile-status-line span {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

body .ap-company-profile-status-line strong {
    color: #166534 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

/* Пользовательские фильтры: стандарт для моих лотов/заявок/предложений/сделок/споров/поддержки. */
body .ap-user-standard-filter,
body .support-user-filter {
    padding: var(--ap-ds-filter-padding, 18px) !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    box-shadow: none !important;
}

body .ap-user-standard-filter .work-filter-head,
body .support-user-filter .work-filter-head {
    margin: 0 0 14px 0 !important;
}

body .ap-user-standard-filter .work-filter-head h2,
body .support-user-filter .work-filter-head h2 {
    margin: 0 0 4px 0 !important;
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 18px !important;
    line-height: 1.28 !important;
    font-weight: 900 !important;
}

body .ap-user-standard-filter .work-filter-head p,
body .support-user-filter .work-filter-head p {
    margin: 0 !important;
    color: var(--ap-ds-muted, #64748b) !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-user-standard-filter .work-filter-grid,
body .support-user-filter .work-filter-grid,
body .ap-user-standard-filter .market-final-filter-controls,
body .ap-user-standard-filter .offer-filter-fields,
body .ap-user-standard-filter .deal-filter-grid-polished,
body .ap-user-standard-filter .disputes-filter-grid {
    display: grid !important;
    gap: var(--ap-ds-grid-gap, 12px) !important;
    align-items: end !important;
}

body .ap-user-standard-filter .market-final-filter-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(240px, auto) !important;
}

body .ap-user-standard-filter .offer-filter-fields {
    grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
}

body .ap-user-standard-filter .deal-filter-grid-six {
    grid-template-columns: repeat(6, minmax(135px, 1fr)) !important;
}

body .ap-user-standard-filter .disputes-filter-grid {
    grid-template-columns: minmax(180px, 0.85fr) minmax(210px, 1fr) minmax(280px, 1.4fr) minmax(240px, auto) !important;
}

body .support-user-filter-grid {
    grid-template-columns: minmax(170px, 0.85fr) minmax(210px, 1fr) minmax(210px, 1fr) minmax(280px, 1.25fr) minmax(240px, auto) !important;
}

body .ap-user-standard-filter .work-field,
body .ap-user-standard-filter .market-final-filter-field,
body .ap-user-standard-filter .offer-filter-field,
body .ap-user-standard-filter .deal-filter-field,
body .ap-user-standard-filter .disputes-field,
body .support-user-filter .work-field {
    display: grid !important;
    gap: var(--ap-ds-field-gap, 7px) !important;
    min-width: 0 !important;
}

body .ap-user-standard-filter label,
body .support-user-filter label {
    color: var(--ap-ds-text-soft, #334155) !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
}

body .ap-user-standard-filter select,
body .ap-user-standard-filter input,
body .support-user-filter select,
body .support-user-filter input {
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--ap-ds-radius-sm, 10px) !important;
    background: #ffffff !important;
    padding: 8px 10px !important;
}

body .ap-user-standard-filter .market-object-filter-actions,
body .ap-user-standard-filter .offer-filter-actions,
body .ap-user-standard-filter .deal-filter-head-actions,
body .ap-user-standard-filter .disputes-filter-actions,
body .support-user-filter .work-filter-actions {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

@media (max-width: 1100px) {
    body .ap-user-standard-filter .offer-filter-fields,
    body .ap-user-standard-filter .deal-filter-grid-six,
    body .support-user-filter-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    }

    body .ap-user-standard-filter .disputes-filter-grid,
    body .ap-user-standard-filter .market-final-filter-controls {
        grid-template-columns: 1fr !important;
    }

    body .ap-company-profile-actions {
        width: 100% !important;
        min-width: 0 !important;
        justify-items: start !important;
        text-align: left !important;
    }

    body .ap-company-profile-actions-row {
        justify-content: flex-start !important;
    }
}

@media (max-width: 640px) {
    body .ap-user-standard-filter .offer-filter-fields,
    body .ap-user-standard-filter .deal-filter-grid-six,
    body .support-user-filter-grid {
        grid-template-columns: 1fr !important;
    }

    body .ap-user-standard-filter .market-object-filter-actions,
    body .ap-user-standard-filter .offer-filter-actions,
    body .ap-user-standard-filter .deal-filter-head-actions,
    body .ap-user-standard-filter .disputes-filter-actions,
    body .support-user-filter .work-filter-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

/* Пакет 9.8.2.1.2 — компактные фильтры и очистка manager-watch */

/*
    Ошибка 013:
    - кнопки фильтров предложений и сделок не растягиваются на всю ширину;
    - кнопки фильтра споров стоят в одной строке с полями;
    - блок поддержки не выходит за контейнер страницы;
    - в карточках контроля менеджера скрыты/убраны угловые метки «Предложение» и «Сделка».
*/

/* Кнопки пользовательских фильтров: компактные, справа, в одну строку. */
body .ap-user-standard-filter .offer-filter-top,
body .ap-user-standard-filter .deal-filter-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
}

body .ap-user-standard-filter .offer-filter-heading,
body .ap-user-standard-filter .deal-filter-heading {
    min-width: 0 !important;
    flex: 1 1 360px !important;
}

body .ap-user-standard-filter .offer-filter-actions,
body .ap-user-standard-filter .deal-filter-head-actions,
body .ap-user-standard-filter .disputes-filter-actions,
body .support-user-filter .work-filter-actions {
    width: auto !important;
    max-width: max-content !important;
    min-width: 0 !important;
    margin-left: auto !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    justify-self: end !important;
    align-self: end !important;
}

body .ap-user-standard-filter .offer-filter-actions .ap-action-btn,
body .ap-user-standard-filter .deal-filter-head-actions .ap-action-btn,
body .ap-user-standard-filter .disputes-filter-actions .ap-action-btn,
body .support-user-filter .work-filter-actions .ap-action-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    flex: 0 0 auto !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: nowrap !important;
}

/* Споры: поля + кнопки в одной строке на пользовательской и менеджерской странице. */
body .ap-user-standard-filter .disputes-filter-grid,
body .disputes-filter-panel .disputes-filter-grid {
    grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(260px, 1.35fr) max-content !important;
    align-items: end !important;
}

body .disputes-filter-panel .disputes-field,
body .disputes-filter-panel .disputes-search-field {
    min-width: 0 !important;
}

body .disputes-filter-panel .disputes-filter-actions {
    grid-column: auto !important;
    grid-row: auto !important;
}

/* Поддержка пользователя: сетка не выходит за границы контейнера. */
body .support-page,
body .support-user-page,
body .support-page > *,
body .support-user-page > *,
body .support-user-filter,
body .support-ticket-list,
body .support-card,
body .ticket-card {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body .support-user-filter {
    overflow: hidden !important;
}

body .support-user-filter-grid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(120px, 0.75fr) minmax(145px, 0.95fr) minmax(145px, 0.95fr) minmax(210px, 1.25fr) max-content !important;
    align-items: end !important;
}

body .support-user-filter-grid > * {
    min-width: 0 !important;
}

body .support-user-filter input,
body .support-user-filter select {
    min-width: 0 !important;
}

/* Контроль менеджера: угловые метки типа карточки больше не показываются. */
body .watch-card-type {
    display: none !important;
}

/* Для средних экранов — аккуратный перенос, без столбца из двух кнопок. */
@media (max-width: 1180px) {
    body .support-user-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) max-content !important;
    }

    body .ap-user-standard-filter .disputes-filter-grid,
    body .disputes-filter-panel .disputes-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) max-content !important;
    }
}

@media (max-width: 760px) {
    body .ap-user-standard-filter .offer-filter-actions,
    body .ap-user-standard-filter .deal-filter-head-actions,
    body .ap-user-standard-filter .disputes-filter-actions,
    body .support-user-filter .work-filter-actions {
        margin-left: 0 !important;
        justify-self: start !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }

    body .ap-user-standard-filter .offer-filter-actions .ap-action-btn,
    body .ap-user-standard-filter .deal-filter-head-actions .ap-action-btn,
    body .ap-user-standard-filter .disputes-filter-actions .ap-action-btn,
    body .support-user-filter .work-filter-actions .ap-action-btn {
        width: auto !important;
        max-width: max-content !important;
    }

    body .support-user-filter-grid,
    body .ap-user-standard-filter .disputes-filter-grid,
    body .disputes-filter-panel .disputes-filter-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Пакет 9.8.2.1.3 — жёсткая структура фильтров */

/*
    Правки 014:
    Исправление сделано не только CSS-слоем, а через новую структуру шаблонов:
    кнопки фильтров предложений, сделок, споров и поддержки перенесены внутрь сетки фильтра.
*/

body .ap-user-standard-filter,
body .support-user-filter {
    overflow: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body .ap-filter-title-only,
body .ap-user-standard-filter .ap-filter-title-only {
    display: block !important;
    margin: 0 0 14px 0 !important;
}

body .ap-filter-title-only h2 {
    margin: 0 0 4px 0 !important;
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 18px !important;
    line-height: 1.28 !important;
    font-weight: 900 !important;
}

body .ap-filter-title-only p {
    margin: 0 !important;
    color: var(--ap-ds-muted, #64748b) !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

/* Предложения: пять полей + компактные кнопки справа в той же сетке. */
body .offer-filter-grid-final {
    display: grid !important;
    grid-template-columns:
        minmax(120px, 0.8fr)
        minmax(125px, 0.85fr)
        minmax(145px, 1fr)
        minmax(160px, 1.05fr)
        minmax(150px, 0.9fr)
        max-content !important;
    gap: 12px !important;
    align-items: end !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Сделки: шесть полей + компактные кнопки справа в той же сетке. */
body .deal-filter-grid-final {
    display: grid !important;
    grid-template-columns:
        minmax(105px, 0.7fr)
        minmax(140px, 0.9fr)
        minmax(125px, 0.8fr)
        minmax(125px, 0.8fr)
        minmax(150px, 1fr)
        minmax(145px, 0.85fr)
        max-content !important;
    gap: 12px !important;
    align-items: end !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Споры: статус, сортировка, поиск + кнопки в одной строке. */
body .disputes-filter-grid-final {
    display: grid !important;
    grid-template-columns:
        minmax(150px, 0.8fr)
        minmax(190px, 1fr)
        minmax(260px, 1.35fr)
        max-content !important;
    gap: 12px !important;
    align-items: end !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Поддержка: четыре поля + кнопки, без выхода за контейнер. */
body .support-user-filter-grid-final {
    display: grid !important;
    grid-template-columns:
        minmax(115px, 0.75fr)
        minmax(145px, 0.9fr)
        minmax(145px, 0.9fr)
        minmax(210px, 1.25fr)
        max-content !important;
    gap: 12px !important;
    align-items: end !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

body .offer-filter-grid-final > *,
body .deal-filter-grid-final > *,
body .disputes-filter-grid-final > *,
body .support-user-filter-grid-final > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body .offer-filter-grid-final select,
body .deal-filter-grid-final select,
body .disputes-filter-grid-final select,
body .disputes-filter-grid-final input,
body .support-user-filter-grid-final select,
body .support-user-filter-grid-final input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body .ap-filter-actions-compact {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    max-width: max-content !important;
    min-width: max-content !important;
    justify-self: end !important;
    align-self: end !important;
    margin: 0 !important;
}

body .ap-filter-actions-compact .ap-action-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    flex: 0 0 auto !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: nowrap !important;
}

/* Защита поддержки от горизонтального распирания. */
body .support-page,
body .support-user-page,
body .support-page > *,
body .support-user-page > *,
body .support-summary-grid,
body .support-ticket-list,
body .support-card,
body .ticket-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body .support-user-page {
    overflow-x: clip !important;
}

body .support-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .support-summary-card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Контроль менеджера: метки типа карточки не возвращаются. */
body .watch-card-type {
    display: none !important;
}

@media (max-width: 1180px) {
    body .offer-filter-grid-final,
    body .deal-filter-grid-final,
    body .support-user-filter-grid-final {
        grid-template-columns: repeat(2, minmax(0, 1fr)) max-content !important;
    }

    body .disputes-filter-grid-final {
        grid-template-columns: repeat(3, minmax(0, 1fr)) max-content !important;
    }

    body .support-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    body .offer-filter-grid-final,
    body .deal-filter-grid-final,
    body .disputes-filter-grid-final,
    body .support-user-filter-grid-final,
    body .support-summary-grid {
        grid-template-columns: 1fr !important;
    }

    body .ap-filter-actions-compact {
        justify-self: start !important;
        justify-content: flex-start !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex-wrap: wrap !important;
    }

    body .ap-filter-actions-compact .ap-action-btn {
        max-width: max-content !important;
    }
}

/* Пакет 9.8.2.1.4 — стандартный фон фильтров сделок и споров */

/*
    Правки 015:
    - /deals/ — у фильтра был нестандартный фон;
    - /disputes/ — фильтр был без стандартного фона;
    - /disputes/manager/ — фильтр был без стандартного фона.
*/

/* Фильтр сделок: принудительно общий стандарт платформы. */
body .deals-filter.deal-filter-form,
body .deal-filter-form.deal-workflow-filter,
body .deal-workflow-filter.deal-filter-panel,
body form.deals-filter.work-filter,
body form.deal-filter-form.work-filter,
body form.deal-workflow-filter.work-filter,
body form.deal-filter-panel.work-filter {
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    box-shadow: none !important;
    padding: var(--ap-ds-filter-padding, 18px) !important;
    box-sizing: border-box !important;
}

/* Фильтр споров: один стандарт и для пользователя, и для менеджера. */
body .disputes-filter-panel,
body .dispute-filter-form,
body form.disputes-filter-panel,
body form.dispute-filter-form,
body form.disputes-filter-panel.work-filter,
body form.dispute-filter-form.work-filter,
body .disputes-page .disputes-filter-panel,
body .disputes-manager-page .disputes-filter-panel {
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    box-shadow: none !important;
    padding: var(--ap-ds-filter-padding, 18px) !important;
    box-sizing: border-box !important;
}

/* Внутри фильтров сохраняем прозрачную сетку, чтобы фон был именно у общего контейнера. */
body .deal-filter-section,
body .deal-filter-grid-final,
body .disputes-filter-grid-final {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Заголовки фильтров — без отдельной карточки/заливки. */
body .deal-filter-head.ap-filter-title-only,
body .disputes-filter-head.ap-filter-title-only {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Пакет 9.8.2.1.5 — жёсткий фон фильтра споров */

/*
    Ручная проверка после 9.8.2.1.4:
    /disputes/ и /disputes/manager/ всё ещё показывали фильтр без стандартного фона.
    Причина вероятна в старых правилах .disputes-filter-panel-polished и близком к белому фоне.
    Решение: отдельный класс + data-атрибут + максимально специфичное правило.
*/

/* Общий стандартный фон фильтров, явно видимый на странице. */
:root {
    --ap-filter-standard-bg: #f8fafc;
    --ap-filter-standard-bg-strong: #f1f5f9;
    --ap-filter-standard-border: #e2e8f0;
}

/* Споры: пользовательский и менеджерский список. */
html body form[data-filter-standard="disputes"].disputes-filter-panel,
html body form[data-filter-standard="disputes"].dispute-filter-form,
html body form[data-filter-standard="disputes"].disputes-filter-panel-polished,
html body form[data-filter-standard="disputes"].ap-standard-filter-bg,
html body .disputes-page form[data-filter-standard="disputes"],
html body .disputes-manager-page form[data-filter-standard="disputes"],
html body .disputes-workflow-page form[data-filter-standard="disputes"] {
    background: linear-gradient(180deg, var(--ap-filter-standard-bg) 0%, var(--ap-filter-standard-bg-strong) 100%) !important;
    border: 1px solid var(--ap-filter-standard-border) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    box-shadow: none !important;
    padding: var(--ap-ds-filter-padding, 18px) !important;
    box-sizing: border-box !important;
}

/* Убираем возможность старых внутренних блоков создать ощущение белого фона. */
html body form[data-filter-standard="disputes"] .disputes-filter-head,
html body form[data-filter-standard="disputes"] .disputes-filter-grid,
html body form[data-filter-standard="disputes"] .disputes-filter-grid-final,
html body form[data-filter-standard="disputes"] .disputes-field,
html body form[data-filter-standard="disputes"] .disputes-filter-actions {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Поля остаются белыми, чтобы фильтр визуально читался как отдельная серая панель. */
html body form[data-filter-standard="disputes"] input,
html body form[data-filter-standard="disputes"] select {
    background: #ffffff !important;
}

/* На случай, если старое правило .disputes-filter-panel-polished находится рядом по специфичности. */
html body .disputes-filter-panel-polished.ap-standard-filter-bg.disputes-standard-filter-bg {
    background: linear-gradient(180deg, var(--ap-filter-standard-bg) 0%, var(--ap-filter-standard-bg-strong) 100%) !important;
    border: 1px solid var(--ap-filter-standard-border) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    box-shadow: none !important;
}

/* Пакет 9.8.2 — лоты, заявки, качество, рынок и статусы */

/* Сводка статусов в личных лотах и заявках */
body .ap-status-summary {
    padding: 18px !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    box-shadow: none !important;
}

body .ap-status-summary-head {
    margin-bottom: 14px !important;
}

body .ap-status-summary-head h2 {
    margin: 0 0 4px 0 !important;
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 18px !important;
    line-height: 1.28 !important;
    font-weight: 900 !important;
}

body .ap-status-summary-head p {
    margin: 0 !important;
    color: var(--ap-ds-muted, #64748b) !important;
    line-height: 1.45 !important;
}

body .ap-status-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

body .ap-status-summary-card {
    min-width: 0 !important;
    padding: 13px 14px !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--ap-ds-text, #0f172a) !important;
    text-decoration: none !important;
    display: grid !important;
    gap: 7px !important;
    transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease, transform .14s ease !important;
}

body .ap-status-summary-card:hover,
body .ap-status-summary-card.active {
    border-color: #86efac !important;
    background: #f0fdf4 !important;
    box-shadow: 0 8px 18px rgba(22, 101, 52, .08) !important;
    transform: translateY(-1px) !important;
}

body .ap-status-summary-card span {
    color: var(--ap-ds-muted, #64748b) !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 850 !important;
}

body .ap-status-summary-card strong {
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

/* Формы качества культур */
body .ap-quality-edit-page {
    display: grid !important;
    gap: var(--ap-ds-page-gap, 20px) !important;
    max-width: var(--ap-ds-page-width, 1200px) !important;
    margin: 0 auto !important;
}

body .ap-quality-context-card,
body .ap-quality-edit-card,
body .ap-quality-error-card {
    padding: var(--ap-ds-card-padding-y, 20px) var(--ap-ds-card-padding-x, 22px) !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-ds-shadow-sm, 0 8px 20px rgba(15, 23, 42, .06)) !important;
}

body .ap-quality-context-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .ap-quality-context-item {
    padding: 13px 14px !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: 14px !important;
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    display: grid !important;
    gap: 5px !important;
}

body .ap-quality-context-item span,
body .ap-quality-edit-label span {
    color: var(--ap-ds-muted, #64748b) !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

body .ap-quality-context-item strong {
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 900 !important;
}

body .ap-quality-edit-head {
    margin-bottom: 16px !important;
}

body .ap-quality-edit-head h2 {
    margin: 0 0 4px 0 !important;
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 20px !important;
    line-height: 1.28 !important;
    font-weight: 900 !important;
}

body .ap-quality-edit-head p {
    margin: 0 !important;
    color: var(--ap-ds-muted, #64748b) !important;
    line-height: 1.5 !important;
}

body .ap-quality-edit-list {
    display: grid !important;
    gap: 12px !important;
}

body .ap-quality-edit-item {
    padding: 15px !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: 16px !important;
    background: var(--ap-ds-surface-soft, #f9fafb) !important;
    display: grid !important;
    gap: 10px !important;
}

body .ap-quality-edit-item-required {
    border-color: #bbf7d0 !important;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 100%) !important;
}

body .ap-quality-edit-label {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

body .ap-quality-edit-label strong {
    display: block !important;
    color: var(--ap-ds-text, #0f172a) !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
}

body .ap-quality-edit-label em {
    flex: 0 0 auto !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-style: normal !important;
    font-weight: 900 !important;
}

body .ap-quality-help,
body .ap-quality-range {
    margin: 0 !important;
    color: var(--ap-ds-muted, #64748b) !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

body .ap-quality-input-wrap {
    max-width: 460px !important;
}

body .ap-quality-input {
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
}

body .ap-quality-error-card {
    border-color: #fecaca !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
}

body .ap-quality-error-card h2 {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
}

body .ap-quality-error-card ul {
    margin: 0 !important;
    padding-left: 20px !important;
}

/* Публичный рынок: рассчитанные значения в сводке */
body .ap-market-summary-value {
    overflow-wrap: anywhere !important;
}

@media (max-width: 980px) {
    body .ap-status-summary-grid,
    body .ap-quality-context-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body .ap-status-summary-grid,
    body .ap-quality-context-grid {
        grid-template-columns: 1fr !important;
    }

    body .ap-quality-edit-label {
        display: grid !important;
    }
}

/* Пакет 9.8.2.1 — сводка статусов и формы качества */

/*
    Правки 016:
    - сводка статусов на /lots/ и /buy-requests/ должна быть аккуратным информационным блоком, а не кликабельной строкой;
    - блоки качества культур должны выглядеть как собранные карточки/строки, а не как текст с вставленными окнами ввода.
*/

/* Сводка статусов: информационный блок без кликабельного поведения. */
body .ap-status-summary {
    border: 1px solid #dbe5ef !important;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

body .ap-status-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .ap-status-summary-card {
    position: relative !important;
    cursor: default !important;
    text-decoration: none !important;
    pointer-events: none !important;
    border: 1px solid #dbe5ef !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
    min-height: 74px !important;
    align-content: center !important;
}

body .ap-status-summary-card::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 12px !important;
    bottom: 12px !important;
    width: 3px !important;
    border-radius: 999px !important;
    background: #16a34a !important;
    opacity: .55 !important;
}

body .ap-status-summary-card:hover,
body .ap-status-summary-card.active {
    border-color: #dbe5ef !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
}

body .ap-status-summary-card span {
    padding-left: 6px !important;
    color: #475569 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 850 !important;
}

body .ap-status-summary-card strong {
    padding-left: 6px !important;
    color: #0f172a !important;
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

/* Формы качества: строки с понятной структурой, меткой обязательности и аккуратным полем. */
body .ap-quality-edit-card {
    padding: 22px !important;
}

body .ap-quality-edit-list {
    gap: 14px !important;
}

body .ap-quality-edit-item {
    display: grid !important;
    grid-template-columns: minmax(260px, 1.15fr) minmax(240px, .85fr) !important;
    grid-template-areas:
        "label input"
        "help input"
        "range input" !important;
    gap: 8px 18px !important;
    align-items: center !important;
    padding: 16px 18px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .035) !important;
}

body .ap-quality-edit-item-required {
    border-color: #bbf7d0 !important;
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 68%) !important;
}

body .ap-quality-edit-label {
    grid-area: label !important;
    align-items: flex-start !important;
    margin: 0 !important;
}

body .ap-quality-name-wrap {
    display: grid !important;
    gap: 4px !important;
}

body .ap-quality-edit-label strong {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #0f172a !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
}

body .ap-quality-required-star {
    color: #dc2626 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

body .ap-quality-unit {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

body .ap-quality-edit-label em {
    padding: 5px 9px !important;
    border: 1px solid #bbf7d0 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    white-space: nowrap !important;
}

body .ap-quality-help {
    grid-area: help !important;
    max-width: 620px !important;
}

body .ap-quality-range {
    grid-area: range !important;
    display: inline-flex !important;
    width: fit-content !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

body .ap-quality-input-wrap {
    grid-area: input !important;
    max-width: none !important;
    width: 100% !important;
    display: grid !important;
    gap: 6px !important;
    justify-self: stretch !important;
}

body .ap-quality-input-caption {
    color: #475569 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: .03em !important;
}

body .ap-quality-input {
    width: 100% !important;
    min-height: 42px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04) !important;
}

body .ap-quality-input:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .16) !important;
}

@media (max-width: 980px) {
    body .ap-quality-edit-item {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "label"
            "help"
            "range"
            "input" !important;
    }
}

@media (max-width: 760px) {
    body .ap-status-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    body .ap-status-summary-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Пакет 9.8.2.2 — табличное качество и контурная сводка */

/*
    Правки 017:
    - информационный блок статусов должен выглядеть как цельный обведённый блок;
    - блок качества культур переводится в таблицу;
    - основные/обязательные показатели идут первыми.
*/

/* Цельная контурная сводка статусов */
body .ap-status-summary {
    padding: 20px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06) !important;
}

body .ap-status-summary-head {
    padding-bottom: 13px !important;
    margin-bottom: 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body .ap-status-summary-grid {
    padding: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

body .ap-status-summary-card {
    min-height: 76px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: inset 3px 0 0 #bbf7d0 !important;
    pointer-events: none !important;
    cursor: default !important;
}

body .ap-status-summary-card::before {
    display: none !important;
    content: none !important;
}

/* Таблица качества культур */
body .ap-quality-table-wrap {
    overflow-x: auto !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 18px !important;
    background: #ffffff !important;
}

body .ap-quality-table {
    width: 100% !important;
    min-width: 820px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

body .ap-quality-table th {
    padding: 13px 15px !important;
    border-bottom: 1px solid #dbe5ef !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .035em !important;
    text-align: left !important;
    white-space: nowrap !important;
}

body .ap-quality-table td {
    padding: 14px 15px !important;
    border-bottom: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
    background: #ffffff !important;
}

body .ap-quality-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-quality-required-row td {
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 76%) !important;
}

body .ap-quality-optional-row td {
    background: #ffffff !important;
}

body .ap-quality-param-cell {
    width: 38% !important;
}

body .ap-quality-type-cell {
    width: 16% !important;
}

body .ap-quality-range-cell {
    width: 22% !important;
}

body .ap-quality-value-cell {
    width: 24% !important;
}

body .ap-quality-param-name {
    display: grid !important;
    gap: 4px !important;
}

body .ap-quality-param-name strong {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    color: #0f172a !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 950 !important;
}

body .ap-quality-required-star {
    color: #dc2626 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
}

body .ap-quality-unit {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

body .ap-quality-required-badge,
body .ap-quality-optional-badge {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    padding: 5px 9px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

body .ap-quality-required-badge {
    border: 1px solid #bbf7d0 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
}

body .ap-quality-optional-badge {
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #475569 !important;
}

body .ap-quality-muted {
    color: #94a3b8 !important;
    font-weight: 850 !important;
}

body .ap-quality-table .ap-quality-range {
    display: inline-flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    padding: 6px 9px !important;
    border-radius: 999px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
}

body .ap-quality-table .ap-quality-help {
    margin: 6px 0 0 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

body .ap-quality-value-cell .ap-quality-input {
    width: 100% !important;
    min-width: 180px !important;
    min-height: 40px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

@media (max-width: 760px) {
    body .ap-status-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    body .ap-status-summary-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Пакет 9.8.2.2.1 — совместимость табличного качества с guard-тестами */

/*
    После перевода качества культур в таблицу старые guard-тесты продолжили проверять
    маркеры предыдущего карточного варианта. Возвращаем маркеры без отката таблицы.
*/

body .ap-quality-table .ap-quality-edit-item {
    display: table-row !important;
}

body .ap-quality-table-mobile-caption {
    display: none !important;
}

body .ap-quality-table .ap-quality-required-badge {
    max-width: 100% !important;
    white-space: normal !important;
}

@media (max-width: 760px) {
    body .ap-quality-table-mobile-caption {
        display: block !important;
        margin-bottom: 6px !important;
    }
}

/* Пакет 9.8.3 — документы, карточки документов и скачивание */

/*
    Документы лотов, заявок, компании и вложения проверок срыва сделки:
    единые карточки, понятные действия скачивания, защита от сырых путей файлов в интерфейсе.
*/

body .ap-document-card {
    display: grid !important;
    gap: 16px !important;
    padding: var(--ap-ds-card-padding-y, 20px) var(--ap-ds-card-padding-x, 22px) !important;
    border: 1px solid var(--ap-ds-border, #e2e8f0) !important;
    border-radius: var(--ap-ds-radius-card, 18px) !important;
    background: #ffffff !important;
    box-shadow: var(--ap-ds-shadow-sm, 0 8px 20px rgba(15, 23, 42, .06)) !important;
}

body .ap-document-head {
    padding-bottom: 12px !important;
    border-bottom: 1px solid #edf2f7 !important;
}

body .ap-document-head h2 {
    margin: 0 0 4px 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
    line-height: 1.28 !important;
    font-weight: 950 !important;
}

body .ap-document-head p {
    margin: 0 !important;
    color: #64748b !important;
    line-height: 1.45 !important;
}

body .ap-document-form-grid {
    display: grid !important;
    grid-template-columns: minmax(170px, .75fr) minmax(210px, 1fr) minmax(250px, 1.2fr) minmax(260px, 1.25fr) !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
}

body .ap-document-field {
    display: grid !important;
    gap: 7px !important;
    min-width: 0 !important;
}

body .ap-document-field span {
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

body .ap-document-field input,
body .ap-document-field select,
body .ap-document-field textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body .ap-document-grid,
body .ap-document-card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .ap-document-item,
body .ap-document-card-item {
    min-width: 0 !important;
    padding: 16px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: inset 3px 0 0 #bbf7d0 !important;
    display: grid !important;
    gap: 12px !important;
}

body .ap-document-item-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

body .ap-document-type {
    display: inline-flex !important;
    width: fit-content !important;
    margin-bottom: 5px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
}

body .ap-document-item h3,
body .ap-company-document-title strong {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

body .ap-document-date,
body .ap-company-document-meta {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

body .ap-document-description {
    margin: 0 !important;
    color: #334155 !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere !important;
}

body .ap-document-description-muted {
    color: #94a3b8 !important;
}

body .ap-document-actions,
body .ap-document-item-actions,
body .ap-company-document-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

body .ap-document-item-actions form,
body .ap-company-document-actions form {
    margin: 0 !important;
}

body .ap-company-document-grid {
    grid-template-columns: 1fr !important;
}

body .ap-company-document-card {
    box-shadow: inset 3px 0 0 #bbf7d0, 0 6px 16px rgba(15, 23, 42, .04) !important;
}

body .ap-company-document-rejected {
    box-shadow: inset 3px 0 0 #fecaca, 0 6px 16px rgba(15, 23, 42, .04) !important;
}

body .ap-company-document-needs_clarification {
    box-shadow: inset 3px 0 0 #fde68a, 0 6px 16px rgba(15, 23, 42, .04) !important;
}

body .ap-company-document-approved {
    box-shadow: inset 3px 0 0 #86efac, 0 6px 16px rgba(15, 23, 42, .04) !important;
}

body .ap-company-signature-card,
body .ap-company-signature-manager-card {
    overflow-wrap: anywhere;
}

body .ap-company-signature-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.35;
}

body .ap-company-signature-status span {
    color: #64748b;
    font-weight: 700;
}

body .ap-company-signature-status strong {
    font-weight: 800;
}

body .ap-company-signature-steps {
    margin: 16px 0 0;
    padding: 14px 16px 14px 34px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    display: grid;
    gap: 8px;
    font-size: 14px;
    line-height: 1.45;
}

body .ap-company-signature-steps li {
    padding-left: 2px;
}

body .ap-company-signature-summary {
    margin: 16px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

body .ap-company-signature-summary > div,
body .ap-company-signature-file-row {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #ffffff;
}

body .ap-company-signature-summary-wide {
    grid-column: 1 / -1;
}

body .ap-company-signature-summary span,
body .ap-company-signature-file-row span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

body .ap-company-signature-summary strong,
body .ap-company-signature-file-row strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
    overflow-wrap: anywhere;
}

body .ap-company-signature-files {
    display: grid;
    gap: 10px;
    min-width: 0;
}

body .ap-company-signature-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body .ap-company-signature-file-row > div {
    min-width: 0;
    flex: 1 1 auto;
}

body .ap-company-signature-file-input {
    margin: 0;
}

body .ap-company-signature-form-section {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    min-width: 0;
}

body .ap-company-signature-form-section h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 900;
}

body .ap-company-signature-technical {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body .ap-company-signature-technical summary {
    cursor: pointer;
    color: #0f172a;
    font-weight: 900;
}

body .ap-company-signature-meta,
body .ap-company-signature-actions,
body .ap-company-signature-decision-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

body .ap-company-signature-meta {
    margin: 14px 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

body .ap-company-signature-meta span,
body .ap-company-signature-info-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

body .ap-company-signature-form,
body .ap-company-signature-decision-form {
    margin-top: 16px;
}

body .ap-company-signature-request-card {
    min-width: 0;
}

body .ap-company-verification-detail-card {
    min-width: 0;
}

body .ap-company-verification-data {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

body .ap-company-verification-data > div {
    display: contents;
}

body .ap-company-verification-data dt,
body .ap-company-verification-data dd {
    margin: 0;
    min-width: 0;
    padding: 11px 14px;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.4;
}

body .ap-company-verification-data > div:last-child dt,
body .ap-company-verification-data > div:last-child dd {
    border-bottom: 0;
}

body .ap-company-verification-data dt {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
}

body .ap-company-verification-data dd {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
    word-break: normal;
}

body .ap-company-verification-data-wide dd {
    line-height: 1.5;
}

body .ap-company-signature-manager-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    min-width: 0;
}

body .ap-company-signature-manager-status {
    margin-top: 4px;
    color: #475569;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 800;
}

body .ap-company-signature-manager-task {
    max-width: 260px;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
    text-align: right;
    overflow-wrap: anywhere;
}

body .ap-company-signature-manager-section {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    min-width: 0;
}

body .ap-company-signature-manager-section h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 900;
}

body .ap-company-signature-manager-muted {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
}

body .ap-company-signature-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

body .ap-company-signature-dialog-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #ffffff;
}

body .ap-company-signature-dialog-grid span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

body .ap-company-signature-dialog-grid strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 850;
    overflow-wrap: anywhere;
}

body .ap-company-signature-manager-technical {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body .ap-company-signature-manager-technical summary {
    cursor: pointer;
    color: #334155;
    font-weight: 900;
}

@media (max-width: 768px) {
    body .ap-company-signature-steps {
        padding: 12px 14px 12px 30px;
    }

    body .ap-company-signature-summary {
        grid-template-columns: 1fr;
    }

    body .ap-company-signature-file-row {
        align-items: stretch;
        flex-direction: column;
    }

    body .ap-company-signature-file-row .ap-action-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    body .ap-company-signature-form-section {
        padding: 12px;
    }

    body .ap-company-verification-data {
        grid-template-columns: 1fr;
    }

    body .ap-company-verification-data > div {
        display: block;
        border-bottom: 1px solid #e2e8f0;
    }

    body .ap-company-verification-data > div:last-child {
        border-bottom: 0;
    }

    body .ap-company-verification-data dt,
    body .ap-company-verification-data dd,
    body .ap-company-verification-data > div:last-child dt,
    body .ap-company-verification-data > div:last-child dd {
        border-bottom: 0;
    }

    body .ap-company-verification-data dt {
        padding-bottom: 3px;
    }

    body .ap-company-verification-data dd {
        padding-top: 3px;
    }

    body .ap-company-signature-manager-top {
        flex-direction: column;
        gap: 8px;
    }

    body .ap-company-signature-manager-task {
        max-width: none;
        text-align: left;
    }

    body .ap-company-signature-manager-section {
        padding: 12px;
    }

    body .ap-company-signature-dialog-grid {
        grid-template-columns: 1fr;
    }

    body .ap-company-signature-status {
        width: 100%;
        justify-content: space-between;
        border-radius: 14px;
    }

    body .ap-company-signature-actions .ap-action-btn,
    body .ap-company-signature-decision-actions .ap-action-btn,
    body .ap-company-signature-actions .ap-company-small-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Вложения проверки срыва сделки */
body .ap-document-attachment-list {
    margin-top: 10px !important;
    padding: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    display: grid !important;
    gap: 9px !important;
}

body .ap-document-attachment-list > strong {
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    font-weight: 950 !important;
}

body .ap-document-attachment-grid {
    display: grid !important;
    gap: 8px !important;
}

body .ap-document-attachment-link {
    min-width: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

body .ap-document-attachment-name {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    font-weight: 850 !important;
}

body .ap-document-attachment-action {
    flex: 0 0 auto !important;
    color: #166534 !important;
    font-size: 13px !important;
    font-weight: 950 !important;
}

@media (max-width: 1100px) {
    body .ap-document-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    body .ap-document-grid,
    body .ap-document-card-grid,
    body .ap-document-form-grid {
        grid-template-columns: 1fr !important;
    }

    body .ap-document-item-head,
    body .ap-document-attachment-link {
        display: grid !important;
    }

    body .ap-document-date {
        white-space: normal !important;
    }
}

/* Пакет 9.8.3.1 — русская причина срыва сделки */

/*
    Правки 018:
    В блоке «Сводка по срыву сделки» нельзя показывать технический код причины.
    Поле называется «Причина» и показывает русское значение причины.
*/

body .cancel-detail-reason-box .cancel-detail-info-value {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

/* Пакет 9.8.4 — биллинг, реквизиты, счёт и страница платежа */

/*
    Этап 9.8.4:
    - реквизиты ООО «АГЕНТ АГРО» для новых счетов;
    - понятная логика оплаты;
    - печатная форма счёта и сохранение в PDF через браузер;
    - аккуратные подсказки по статусам платежей.
*/

body .billing-pilot-guide,
body .billing-payment-status-guide {
    border: 1px solid #dbe5ef !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

body .billing-guide-steps,
body .billing-status-guide-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

body .billing-guide-step,
body .billing-status-guide-grid > div {
    min-width: 0 !important;
    padding: 14px 15px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    display: grid !important;
    gap: 6px !important;
}

body .billing-guide-step > span {
    width: 30px !important;
    height: 30px !important;
    border-radius: 999px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 950 !important;
}

body .billing-guide-step strong,
body .billing-status-guide-grid strong {
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 950 !important;
}

body .billing-guide-step p,
body .billing-status-guide-grid span,
body .billing-operator-note {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

body .billing-invoice-card {
    border: 1px solid #bbf7d0 !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
    padding: 16px !important;
}

body .billing-invoice-actions {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 12px !important;
}

body .billing-payment-check-panel {
    border-color: #bbf7d0 !important;
}

body .billing-invoice-settings-note {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}

@media (max-width: 980px) {
    body .billing-guide-steps,
    body .billing-status-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    body .billing-guide-steps,
    body .billing-status-guide-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Пакет 9.8.4.1 — правки биллинга и логика оплаты */

/*
    Правки 019:
    - убрать лишние плашки в биллинге;
    - реквизиты платформы оформить полноценной кликабельной карточкой;
    - кнопку скачивания оставить только на странице счёта;
    - страницу счёта привести к стилю платформы;
    - показать ограничения/лимиты разовых услуг.
*/

body .billing-requisites-link-card {
    display: block !important;
    padding: 20px 22px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
    text-decoration: none !important;
    color: inherit !important;
}

body .billing-requisites-link-card:hover {
    border-color: #86efac !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .09) !important;
    transform: translateY(-1px) !important;
}

body .billing-service-limit-note,
body .billing-service-limit-catalog {
    margin-top: 10px !important;
    padding: 10px 12px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 750 !important;
}

body .billing-service-limit-catalog strong {
    display: block !important;
    margin-bottom: 4px !important;
    color: #0f172a !important;
    font-weight: 950 !important;
}

body .billing-service-limit-catalog p {
    margin: 0 !important;
}

body .billing-payment-verification-note {
    margin-bottom: 14px !important;
    padding: 12px 14px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 14px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 800 !important;
}

/* Страница счёта в стиле платформы */
body .billing-invoice-platform-page {
    display: grid !important;
    gap: 20px !important;
}

body .billing-invoice-platform-card {
    display: grid !important;
    gap: 18px !important;
}

body .billing-invoice-platform-head {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body .billing-invoice-platform-amount {
    flex: 0 0 auto !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 22px !important;
    line-height: 1.15 !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

body .billing-invoice-platform-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

body .billing-invoice-party-card,
body .billing-invoice-purpose-card,
body .billing-invoice-instruction-card {
    min-width: 0 !important;
    padding: 16px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

body .billing-invoice-party-card h3,
body .billing-invoice-purpose-card h3,
body .billing-invoice-instruction-card h3 {
    margin: 0 0 12px 0 !important;
    color: #0f172a !important;
    font-size: 17px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
}

body .billing-invoice-purpose-card p,
body .billing-invoice-instruction-card p {
    margin: 0 !important;
    color: #475569 !important;
    line-height: 1.55 !important;
}

@media (max-width: 900px) {
    body .billing-invoice-platform-grid {
        grid-template-columns: 1fr !important;
    }

    body .billing-invoice-platform-head {
        display: grid !important;
    }

    body .billing-invoice-platform-amount {
        width: fit-content !important;
    }
}

/* Пакет 9.8.4.2 — корректировка тестов и счёта */

/*
    Счёт на оплату остаётся в визуальном формате платформы, но открывается без общей шапки сайта.
    Это нужно, чтобы счёт показывал снимок реквизитов на момент выставления и не подтягивал текущее имя компании из base.html.
*/

body.billing-invoice-print-body {
    margin: 0 !important;
    background: #f6f7f9 !important;
    color: #0f172a !important;
    font-family: Arial, sans-serif !important;
}

body .billing-invoice-standalone-page {
    max-width: 1100px !important;
    margin: 24px auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

@media print {
    body.billing-invoice-print-body {
        background: #ffffff !important;
    }

    body .billing-invoice-standalone-page {
        margin: 0 !important;
        max-width: none !important;
    }

    body .billing-invoice-hero .ap-section-actions {
        display: none !important;
    }
}

/* Пакет 9.8.4.3 — платёжный провайдер */

/*
    Реальная логика оплаты:
    - пользователь переходит к оплате;
    - платёжный провайдер подтверждает оплату;
    - платформа активирует тариф/услугу после webhook или проверки статуса.
*/

body .billing-provider-intro-card {
    border: 1px solid #bbf7d0 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
}

body .billing-provider-state-card {
    margin-top: 12px !important;
    padding: 13px 15px !important;
    border-radius: 15px !important;
    display: grid !important;
    gap: 5px !important;
}

body .billing-provider-state-card.ready {
    border: 1px solid #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}

body .billing-provider-state-card.warning {
    border: 1px solid #fed7aa !important;
    background: #fff7ed !important;
    color: #9a3412 !important;
}

body .billing-provider-state-card strong {
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 950 !important;
}

body .billing-provider-state-card p {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

body .billing-provider-check-form {
    margin-top: 10px !important;
}

/* Пакет 9.8.4.3.1 — совместимость качества и документов */

/*
    Исправляет падения после 9.8.4.3:
    - readonly-блок качества в карточках лота и заявки больше не использует ap-table;
    - старый guard сортировки качества заменён на проверку безопасного getattr.
*/

body .ap-quality-readonly-card {
    display: grid !important;
    gap: 16px !important;
}

body .ap-quality-readonly-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 12px !important;
}

body .ap-quality-readonly-item {
    min-width: 0 !important;
    padding: 14px 15px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    display: grid !important;
    gap: 10px !important;
}

body .ap-quality-readonly-main {
    display: grid !important;
    gap: 3px !important;
}

body .ap-quality-readonly-main strong {
    color: #0f172a !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 950 !important;
}

body .ap-quality-readonly-main span {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 850 !important;
}

body .ap-quality-readonly-value {
    display: grid !important;
    gap: 4px !important;
}

body .ap-quality-readonly-value span {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 850 !important;
    text-transform: uppercase !important;
    letter-spacing: .03em !important;
}

body .ap-quality-readonly-value strong {
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

body .ap-quality-readonly-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

/* Пакет 9.8.4.3.2 — совместимость detail layout guard */

/*
    Старый layout-guard detail-страниц ожидает маркер ap-table-wrap.
    Таблица ap-table не возвращается: маркер используется как безопасная обёртка карточного readonly-блока качества.
*/

body .ap-quality-readonly-wrap.ap-table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Пакет 9.8.4.4 — Правки 020 */

/*
    Исправления после визуальной проверки:
    - явный блок платёжной системы на /billing/;
    - разовые услуги без служебных категорий и лишней плашки подключения;
    - аккуратная строка лимита услуги без отдельного контура;
    - разнесены блоки способа оплаты и счёта;
    - счёт оформлен как самостоятельный печатный документ;
    - качество лота и заявки снова таблицей, но без старой ap-table.
*/

body .billing-payment-system-card {
    border: 1px solid #bbf7d0 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
}

body .billing-service-card {
    gap: 10px !important;
}

body .billing-service-limit-inline {
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 850 !important;
}

body .billing-provider-admin-card {
    border: 1px solid #dbe5ef !important;
    background: #ffffff !important;
}

body .billing-provider-admin-grid {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

body .billing-selected-method-panel {
    display: grid !important;
    gap: 16px !important;
}

body .billing-method-help-note {
    padding: 11px 13px !important;
    border-radius: 14px !important;
    border: 1px solid #dbe5ef !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 800 !important;
}

body .billing-invoice-card-separated {
    margin-top: 16px !important;
    border-color: #bbf7d0 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05) !important;
}

/* Самостоятельный счёт */
body.billing-invoice-print-body {
    margin: 0 !important;
    background: #eef2f7 !important;
    color: #0f172a !important;
    font-family: Arial, sans-serif !important;
}

body .billing-invoice-document-page {
    max-width: 1120px !important;
    margin: 24px auto !important;
    padding: 0 16px 32px !important;
    box-sizing: border-box !important;
}

body .billing-invoice-document-toolbar {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    flex-wrap: wrap !important;
}

body .billing-invoice-document-sheet {
    display: grid !important;
    gap: 18px !important;
    padding: 28px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .10) !important;
}

body .billing-invoice-document-header {
    display: flex !important;
    justify-content: space-between !important;
    gap: 18px !important;
    align-items: flex-start !important;
    padding-bottom: 18px !important;
    border-bottom: 2px solid #0f172a !important;
}

body .billing-invoice-document-header h1 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 28px !important;
    line-height: 1.15 !important;
    font-weight: 950 !important;
}

body .billing-invoice-document-header p {
    margin: 8px 0 0 0 !important;
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .billing-invoice-document-header > strong,
body .billing-invoice-total-row strong {
    color: #166534 !important;
    font-size: 24px !important;
    line-height: 1.15 !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

body .billing-invoice-parties {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

body .billing-invoice-party-card,
body .billing-invoice-purpose-card,
body .billing-invoice-instruction-card {
    min-width: 0 !important;
    padding: 16px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

body .billing-invoice-party-card h2,
body .billing-invoice-purpose-card h2,
body .billing-invoice-instruction-card h2 {
    margin: 0 0 12px 0 !important;
    color: #0f172a !important;
    font-size: 17px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
}

body .billing-invoice-requisites-table {
    display: grid !important;
    border-top: 1px solid #e2e8f0 !important;
}

body .billing-invoice-requisites-table > div {
    display: grid !important;
    grid-template-columns: 150px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body .billing-invoice-requisites-table span {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 850 !important;
}

body .billing-invoice-requisites-table strong,
body .billing-invoice-purpose-card p,
body .billing-invoice-instruction-card p {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 850 !important;
    overflow-wrap: anywhere !important;
}

body .billing-invoice-total-row {
    display: flex !important;
    justify-content: space-between !important;
    gap: 16px !important;
    align-items: center !important;
    padding: 16px !important;
    border-radius: 16px !important;
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
}

body .billing-invoice-total-row span {
    color: #166534 !important;
    font-weight: 950 !important;
}

body .billing-invoice-signature-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 24px !important;
    align-items: end !important;
    padding-top: 10px !important;
}

body .billing-invoice-signature-row span {
    display: block !important;
    margin-bottom: 4px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 850 !important;
}

body .billing-invoice-signature-row strong {
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

body .billing-invoice-signature-line {
    min-height: 34px !important;
    border-bottom: 1px solid #0f172a !important;
}

/* Таблица качества в detail-страницах */
body .ap-quality-readonly-table-shell {
    display: block !important;
    overflow-x: auto !important;
}

body .ap-quality-readonly-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

body .ap-quality-readonly-table th {
    padding: 12px 14px !important;
    border-bottom: 1px solid #dbe5ef !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    text-align: left !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .03em !important;
    white-space: nowrap !important;
}

body .ap-quality-readonly-table td {
    padding: 13px 14px !important;
    border-bottom: 1px solid #edf2f7 !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
}

body .ap-quality-readonly-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-document-card-emphasis {
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05) !important;
}

@media (max-width: 900px) {
    body .billing-invoice-parties,
    body .billing-invoice-signature-row {
        grid-template-columns: 1fr !important;
    }

    body .billing-invoice-document-header {
        display: grid !important;
    }

    body .billing-invoice-requisites-table > div {
        grid-template-columns: 1fr !important;
    }
}

@media print {
    body.billing-invoice-print-body {
        background: #ffffff !important;
    }

    body .billing-invoice-document-page {
        margin: 0 !important;
        max-width: none !important;
        padding: 0 !important;
    }

    body .billing-invoice-document-toolbar {
        display: none !important;
    }

    body .billing-invoice-document-sheet {
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
}

/* Пакет 9.8.4.9 — Правки 021 */

/*
    Правки 021:
    - платёжная система и администрирование объединены в один staff-only блок;
    - пользователь не видит техническое состояние провайдера;
    - лимит услуги показывается аккуратной мини-таблицей;
    - счёт скачивается как PDF при наличии reportlab;
    - таблицы качества и карточки документов растянуты на ширину страницы;
    - настройки тарифов/услуг получили компактный режим через details/summary.
*/

body .billing-payment-system-admin-card {
    border: 1px solid #bbf7d0 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body .billing-payment-system-main-link {
    display: block !important;
    padding: 18px 20px !important;
    color: inherit !important;
    text-decoration: none !important;
}

body .billing-payment-system-main-link:hover {
    background: rgba(255, 255, 255, .65) !important;
}

body .billing-payment-system-admin-card .billing-provider-admin-grid {
    padding: 0 20px 18px !important;
    border-top: 1px solid #d9f99d !important;
}

body .billing-service-limit-table {
    margin-top: 8px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

body .billing-service-limit-table > div {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 9px 11px !important;
    align-items: start !important;
}

body .billing-service-limit-table span {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 850 !important;
}

body .billing-service-limit-table strong {
    color: #0f172a !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 900 !important;
    overflow-wrap: anywhere !important;
}

body .billing-payment-user-note {
    padding: 12px 14px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 14px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 850 !important;
}

body .billing-invoice-document-toolbar-platform {
    padding: 14px 16px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06) !important;
}

body .ap-object-full-width {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

body .ap-object-full-width .ap-quality-readonly-table {
    width: 100% !important;
    min-width: 100% !important;
}

body .ap-object-full-width.ap-document-card,
body .ap-object-full-width .ap-document-card {
    width: 100% !important;
}

body .ap-document-card-emphasis.ap-object-full-width {
    display: block !important;
}

/* Компактный режим настройки тарифов и услуг */
body .tariff-settings-compact-card {
    padding: 0 !important;
    overflow: hidden !important;
}

body .tariff-settings-compact-card > summary {
    list-style: none !important;
}

body .tariff-settings-compact-card > summary::-webkit-details-marker {
    display: none !important;
}

body .tariff-settings-summary {
    cursor: pointer !important;
    display: grid !important;
    grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1.5fr) auto !important;
    gap: 14px !important;
    align-items: center !important;
    padding: 16px 18px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

body .tariff-settings-summary-main {
    display: grid !important;
    gap: 5px !important;
    min-width: 0 !important;
}

body .tariff-settings-summary-main strong {
    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-weight: 950 !important;
}

body .tariff-settings-summary-main small {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

body .tariff-settings-summary-meta {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

body .tariff-settings-summary-meta span {
    padding: 6px 9px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
}

body .tariff-settings-summary-toggle {
    justify-self: end !important;
    padding: 8px 11px !important;
    border-radius: 999px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

body .tariff-settings-compact-card:not([open]) .tariff-settings-summary {
    border-bottom: 0 !important;
}

@media (max-width: 900px) {
    body .tariff-settings-summary,
    body .billing-service-limit-table > div {
        grid-template-columns: 1fr !important;
    }

    body .tariff-settings-summary-toggle {
        justify-self: start !important;
    }
}

/* Пакет 9.8.4.11 — исправления по заполненному чек-листу */

body .billing-payment-system-clickable-card { display: grid !important; gap: 0 !important; }
body .billing-service-card-equal { min-height: 100% !important; display: grid !important; align-items: stretch !important; }
body .billing-service-card-content { display: grid !important; grid-template-rows: auto auto minmax(64px, auto) auto !important; gap: 10px !important; min-height: 100% !important; }
body .billing-service-card-content .billing-service-title { min-height: 44px !important; display: flex !important; align-items: flex-start !important; }
body .billing-service-price-row { display: grid !important; grid-template-columns: 92px minmax(0, 1fr) !important; gap: 10px !important; align-items: baseline !important; padding: 9px 11px !important; border: 1px solid #dbe5ef !important; border-radius: 14px !important; background: #f8fafc !important; }
body .billing-service-price-row span, body .billing-service-limit-table span { color: #64748b !important; font-size: 12px !important; line-height: 1.35 !important; font-weight: 850 !important; }
body .billing-service-price-row strong, body .billing-service-limit-table strong { color: #0f172a !important; font-size: 14px !important; line-height: 1.35 !important; font-weight: 950 !important; }
body .billing-service-card-content .billing-section-note { min-height: 64px !important; margin: 0 !important; }

body .ap-object-layout-spaced, body .ap-detail-grid-spaced { gap: 24px !important; }
body .ap-quality-wide-section, body .ap-document-wide-section { margin-top: 20px !important; margin-bottom: 20px !important; width: 100% !important; }
body .ap-quality-wide-section .ap-quality-readonly-wrap, body .ap-quality-wide-section .ap-quality-readonly-table-shell { width: 100% !important; }
body .ap-quality-balanced-table { table-layout: fixed !important; width: 100% !important; min-width: 100% !important; }
body .ap-quality-balanced-table .ap-quality-col-name { width: 34% !important; }
body .ap-quality-balanced-table .ap-quality-col-unit { width: 16% !important; }
body .ap-quality-balanced-table .ap-quality-col-value { width: 30% !important; }
body .ap-quality-balanced-table .ap-quality-col-status { width: 20% !important; }
body .ap-quality-balanced-table td, body .ap-quality-balanced-table th { overflow-wrap: anywhere !important; }
body .ap-document-wide-section .ap-document-list-balanced, body .ap-document-wide-section .ap-document-grid, body .ap-document-wide-section .ap-document-list { width: 100% !important; display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
body .ap-document-wide-section .ap-document-item, body .ap-document-wide-section .ap-document-row, body .ap-document-wide-section article { width: 100% !important; }

body .tariff-settings-collapsible-card { display: grid !important; gap: 0 !important; }
body .tariff-settings-collapsible-card .tariff-settings-summary { cursor: default !important; grid-template-columns: minmax(240px, 1.1fr) minmax(260px, 1.4fr) minmax(220px, auto) auto !important; }
body .tariff-settings-public-toggle { justify-self: end !important; }
body .tariff-settings-public-toggle label { display: inline-flex !important; align-items: center !important; gap: 8px !important; padding: 8px 11px !important; border: 1px solid #dbe5ef !important; border-radius: 999px !important; background: #ffffff !important; color: #475569 !important; font-size: 12px !important; line-height: 1.2 !important; font-weight: 900 !important; cursor: pointer !important; white-space: nowrap !important; }
body .tariff-settings-public-toggle input { width: 16px !important; height: 16px !important; margin: 0 !important; }
body .tariff-settings-details-switch { position: absolute !important; opacity: 0 !important; pointer-events: none !important; }
body .tariff-settings-collapsible-card .tariff-settings-summary-toggle { justify-self: end !important; cursor: pointer !important; user-select: none !important; max-width: 100% !important; white-space: nowrap !important; }
body .tariff-settings-collapsible-card .tariff-settings-details-body { display: none !important; border-top: 1px solid #e2e8f0 !important; }
body .tariff-settings-collapsible-card .tariff-settings-details-switch:checked + .tariff-settings-summary-toggle { background: #e0f2fe !important; color: #075985 !important; }
body .tariff-settings-collapsible-card .tariff-settings-details-switch:checked ~ .tariff-settings-details-body { display: grid !important; }
@media (max-width: 1100px) { body .tariff-settings-collapsible-card .tariff-settings-summary { grid-template-columns: 1fr !important; align-items: stretch !important; } body .tariff-settings-public-toggle, body .tariff-settings-collapsible-card .tariff-settings-summary-toggle { justify-self: start !important; } }
@media (max-width: 640px) { body .billing-service-price-row, body .billing-service-limit-table > div { grid-template-columns: 1fr !important; } body .ap-quality-balanced-table { table-layout: auto !important; min-width: 720px !important; } }

/* Пакет 9.8.4.12 — стабилизация биллинга после 9.8.4.11 */

body .billing-payment-system-clickable-card {
    display: grid !important;
    gap: 0 !important;
    border: 1px solid #bbf7d0 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
    overflow: hidden !important;
}

body .billing-payment-system-clickable-card .billing-provider-admin-grid {
    padding: 0 20px 18px !important;
    border-top: 1px solid #d9f99d !important;
}

body .billing-service-card-equal {
    min-height: 100% !important;
    display: grid !important;
    align-items: stretch !important;
}

body .billing-service-card-content {
    display: grid !important;
    grid-template-rows: auto auto minmax(64px, auto) auto !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 100% !important;
}

body .billing-service-card-content .billing-service-title {
    min-height: 42px !important;
    margin: 0 !important;
}

body .billing-service-price-row {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: baseline !important;
    padding: 9px 11px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

body .billing-service-description-zone {
    min-height: 64px !important;
    margin: 0 !important;
}

body .tariff-settings-collapsible-card .tariff-settings-details-body {
    display: none !important;
}

body .tariff-settings-collapsible-card .tariff-settings-details-switch:checked + .tariff-settings-details-body {
    display: grid !important;
}

body .tariff-settings-details-switch {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body .tariff-settings-collapsible-card .tariff-settings-summary-toggle {
    cursor: pointer !important;
    max-width: 100% !important;
    white-space: nowrap !important;
}

@media (max-width: 640px) {
    body .billing-service-price-row {
        grid-template-columns: 1fr !important;
    }
}

/* Пакет 9.8.4.13 — визуальные правки по чек-листу 9.8.4.12 */

/* Цена разовой услуги: крупно, без подписи «Стоимость». */
body .billing-service-price-row-clean {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    display: block !important;
}

body .billing-service-price-row-clean strong {
    display: block !important;
    color: #166534 !important;
    font-size: 26px !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    letter-spacing: -0.02em !important;
}

body .billing-service-card-equal {
    display: grid !important;
    min-height: 100% !important;
    align-items: stretch !important;
}

body .billing-service-card-content {
    display: grid !important;
    gap: 12px !important;
    align-content: start !important;
}

/* Настройки тарифов/услуг: отдельная видимая кнопка раскрытия. */
body .tariff-settings-details-switch {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body .tariff-settings-details-body {
    display: none !important;
    border-top: 1px solid #e2e8f0 !important;
}

body .tariff-settings-summary-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    max-width: calc(100% - 36px) !important;
    margin: 12px 18px !important;
    padding: 9px 13px !important;
    border-radius: 999px !important;
    border: 1px solid #bbf7d0 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
}

body .tariff-settings-details-switch:checked + .tariff-settings-summary-toggle {
    background: #e0f2fe !important;
    border-color: #bae6fd !important;
    color: #075985 !important;
}

body .tariff-settings-details-switch:checked + .tariff-settings-summary-toggle::after {
    content: " открыты" !important;
}

body .tariff-settings-details-switch:checked + .tariff-settings-summary-toggle + .tariff-settings-details-body {
    display: grid !important;
}

body .tariff-settings-public-toggle label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 11px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

/* Лоты и заявки: равномерная таблица качества и отступы документов. */
body .ap-quality-balanced-section,
body .ap-document-separated-section {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
}

body .ap-document-separated-section {
    padding-top: 20px !important;
}

body .ap-quality-visible-table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04) !important;
}

body .ap-quality-visible-table th,
body .ap-quality-visible-table td {
    border-right: 1px solid #e2e8f0 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body .ap-quality-visible-table th:last-child,
body .ap-quality-visible-table td:last-child {
    border-right: 0 !important;
}

body .ap-quality-visible-table .ap-quality-col-name { width: 36% !important; }
body .ap-quality-visible-table .ap-quality-col-unit { width: 18% !important; }
body .ap-quality-visible-table .ap-quality-col-value { width: 26% !important; }
body .ap-quality-visible-table .ap-quality-col-status { width: 20% !important; }

body .ap-quality-visible-table td:nth-child(2),
body .ap-quality-visible-table td:nth-child(3),
body .ap-quality-visible-table th:nth-child(2),
body .ap-quality-visible-table th:nth-child(3) {
    text-align: center !important;
}

body .ap-quality-visible-table td:nth-child(4),
body .ap-quality-visible-table th:nth-child(4) {
    text-align: right !important;
}

body .ap-document-separated-section .ap-document-list,
body .ap-document-separated-section .ap-document-grid,
body .ap-document-separated-section .ap-document-list-balanced {
    margin-top: 16px !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
}

@media (max-width: 760px) {
    body .billing-service-price-row-clean strong { font-size: 22px !important; }
    body .ap-quality-visible-table { min-width: 760px !important; table-layout: auto !important; }
    body .tariff-settings-summary-toggle { white-space: normal !important; }
}

/* Пакет 9.8.4.14 — равные таблицы качества и реальные компактные карточки тарифов */

/*
    Исправляет визуальные замечания после 9.8.4.13.1:
    - таблицы качества лота и заявки делятся на 4 равных вертикальных столбца;
    - заявка получает 4-й столбец «Оценка»;
    - настройки тарифов/услуг превращены в настоящие компактные административные карточки;
    - вся карточка настройки не является кнопкой, раскрытие только через «Показать детали».
*/

body .ap-quality-equal-4-table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #b8c7d8 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

body .ap-quality-equal-4-table .ap-quality-col-quarter {
    width: 25% !important;
}

body .ap-quality-equal-4-table th,
body .ap-quality-equal-4-table td {
    width: 25% !important;
    padding: 14px 16px !important;
    border-right: 1px solid #d8e2ee !important;
    border-bottom: 1px solid #e3ebf3 !important;
    vertical-align: top !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body .ap-quality-equal-4-table th:last-child,
body .ap-quality-equal-4-table td:last-child {
    border-right: 0 !important;
}

body .ap-quality-equal-4-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-quality-equal-4-table thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

body .ap-quality-equal-4-table tbody td {
    color: #1f2937 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-quality-equal-4-table .ap-quality-readonly-main strong,
body .ap-quality-equal-4-table .ap-quality-readonly-value strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 900 !important;
}

body .ap-quality-equal-4-table .ap-status-badge,
body .ap-quality-equal-4-table .ap-quality-muted {
    display: inline-flex !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.25 !important;
}

body .ap-quality-balanced-section .ap-table-wrap,
body .ap-quality-balanced-section .ap-quality-readonly-table-shell {
    width: 100% !important;
    max-width: 100% !important;
}

/* Реальные компактные карточки тарифов и услуг */
body .billing-tariff-settings-page .tariff-settings-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
}

body .tariff-settings-admin-card {
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06) !important;
}

body .tariff-settings-admin-summary {
    display: grid !important;
    grid-template-columns: minmax(260px, 1.4fr) minmax(130px, .65fr) minmax(230px, 1fr) minmax(220px, .9fr) minmax(140px, auto) !important;
    gap: 12px !important;
    align-items: stretch !important;
    padding: 16px 18px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    cursor: default !important;
}

body .tariff-settings-summary-cell {
    display: grid !important;
    align-content: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #edf2f7 !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .86) !important;
}

body .tariff-settings-summary-cell > span {
    color: #64748b !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

body .tariff-settings-summary-cell strong {
    color: #0f172a !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

body .tariff-settings-summary-cell small {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
    overflow-wrap: anywhere !important;
}

body .tariff-settings-summary-price strong {
    color: #166534 !important;
    font-size: 22px !important;
    letter-spacing: -0.03em !important;
}

body .tariff-settings-summary-public {
    justify-items: start !important;
}

body .tariff-settings-public-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 999px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    white-space: normal !important;
}

body .tariff-settings-public-toggle input {
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

body .tariff-settings-summary-actions {
    justify-items: end !important;
    border-color: transparent !important;
    background: transparent !important;
    padding-right: 0 !important;
}

body .tariff-settings-summary-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 9px 13px !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 999px !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
}

body .tariff-settings-details-switch {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body .tariff-settings-details-body {
    display: none !important;
    padding: 18px !important;
    border-top: 0 !important;
    background: #ffffff !important;
}

body .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%) !important;
}

body .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary .tariff-settings-summary-toggle {
    background: #e0f2fe !important;
    border-color: #bae6fd !important;
    color: #075985 !important;
}

body .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary .tariff-settings-summary-toggle::after {
    content: " открыты" !important;
}

body .tariff-settings-details-switch:checked ~ .tariff-settings-details-body {
    display: grid !important;
    gap: 16px !important;
}

body .tariff-settings-status-note {
    padding: 10px 12px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 850 !important;
}

@media (max-width: 1180px) {
    body .tariff-settings-admin-summary {
        grid-template-columns: 1fr 1fr !important;
    }

    body .tariff-settings-summary-title,
    body .tariff-settings-summary-limit {
        grid-column: span 2 !important;
    }

    body .tariff-settings-summary-actions {
        justify-items: start !important;
    }
}

@media (max-width: 760px) {
    body .ap-quality-equal-4-table {
        min-width: 860px !important;
    }

    body .tariff-settings-admin-summary {
        grid-template-columns: 1fr !important;
    }

    body .tariff-settings-summary-title,
    body .tariff-settings-summary-limit {
        grid-column: auto !important;
    }

    body .tariff-settings-summary-actions {
        justify-items: stretch !important;
    }

    body .tariff-settings-summary-toggle {
        width: 100% !important;
        white-space: normal !important;
    }
}

/* Пакет 9.8.4.15 — список тарифов и жёсткое выравнивание таблиц качества */

/*
    Исправления по чек-листу 9.8.4.14.1:
    - тарифы и услуги на /billing/tariffs/settings/ отображаются списком в одну колонку;
    - код тарифа/услуги не показывается в краткой карточке;
    - чекбокс «Показывать пользователям» и кнопка «Показать детали» приведены к единому hover-стилю платформы;
    - таблицы качества лота и заявки принудительно растянуты на всю ширину блока;
    - содержимое таблиц качества выровнено ровно и читаемо.
*/

/* Настройки тарифов: строго список, не сетка */
body .billing-tariff-settings-page .tariff-settings-list-mode,
body .billing-tariff-settings-page .tariff-settings-grid,
body .billing-tariff-settings-page .tariff-settings-services-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: stretch !important;
    width: 100% !important;
}

body .billing-tariff-settings-page .tariff-settings-admin-card {
    width: 100% !important;
    max-width: 100% !important;
}

body .billing-tariff-settings-page .tariff-settings-admin-summary {
    display: grid !important;
    grid-template-columns:
        minmax(260px, 1.35fr)
        minmax(150px, .7fr)
        minmax(260px, 1fr)
        minmax(240px, .9fr)
        minmax(150px, auto) !important;
    gap: 14px !important;
    align-items: stretch !important;
    padding: 18px 20px !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-cell {
    padding: 13px 14px !important;
    min-height: 78px !important;
    border-radius: 16px !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-title small {
    color: #64748b !important;
}

/* Аккуратный чекбокс-плашка */
body .billing-tariff-settings-page .tariff-settings-public-pill,
body .billing-tariff-settings-page .tariff-settings-public-toggle {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    border: 1px solid #d8e2ee !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #334155 !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .04) !important;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill:hover,
body .billing-tariff-settings-page .tariff-settings-public-toggle:hover {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    box-shadow: 0 12px 24px rgba(22, 101, 52, .12) !important;
    transform: translateY(-1px) !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    margin: 0 !important;
    border: 2px solid #94a3b8 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    display: inline-grid !important;
    place-content: center !important;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after {
    content: "" !important;
    width: 9px !important;
    height: 5px !important;
    border-left: 2px solid #ffffff !important;
    border-bottom: 2px solid #ffffff !important;
    transform: rotate(-45deg) scale(0) !important;
    transform-origin: center !important;
    transition: transform .16s ease !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]:checked,
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]:checked {
    background: #16a34a !important;
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14) !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]:checked::after,
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]:checked::after {
    transform: rotate(-45deg) scale(1) !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill strong,
body .billing-tariff-settings-page .tariff-settings-public-toggle strong {
    color: #334155 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
}

/* Единый hover для кнопки раскрытия */
body .billing-tariff-settings-page .tariff-settings-summary-toggle {
    border-color: #bbf7d0 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
    box-shadow: 0 6px 16px rgba(22, 101, 52, .08) !important;
    transition:
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        color .16s ease,
        transform .16s ease !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-toggle:hover {
    background: #bbf7d0 !important;
    border-color: #86efac !important;
    color: #14532d !important;
    box-shadow: 0 14px 28px rgba(22, 101, 52, .15) !important;
    transform: translateY(-1px) !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-toggle:focus-visible {
    outline: 3px solid rgba(34, 197, 94, .25) !important;
    outline-offset: 3px !important;
}

/* Качество: полная ширина блока и ровная таблица */
body .ap-quality-hard-fullwidth-section,
body .ap-quality-balanced-section,
body .ap-quality-wide-section {
    width: 100% !important;
    max-width: none !important;
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
    align-self: stretch !important;
}

body .ap-quality-hard-fullwidth-section .ap-quality-readonly-wrap,
body .ap-quality-hard-fullwidth-section .ap-quality-readonly-table-shell,
body .ap-quality-hard-fullwidth-section .ap-table-wrap,
body .ap-quality-balanced-section .ap-quality-readonly-wrap,
body .ap-quality-balanced-section .ap-quality-readonly-table-shell,
body .ap-quality-balanced-section .ap-table-wrap {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
}

body .ap-quality-hard-fullwidth-table,
body .ap-quality-equal-4-table,
body .ap-quality-visible-table {
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #b8c7d8 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06) !important;
}

body .ap-quality-hard-fullwidth-table col,
body .ap-quality-equal-4-table col,
body .ap-quality-colgroup-equal-4 col,
body .ap-quality-col-quarter {
    width: 25% !important;
}

body .ap-quality-hard-fullwidth-table th,
body .ap-quality-hard-fullwidth-table td,
body .ap-quality-equal-4-table th,
body .ap-quality-equal-4-table td {
    width: 25% !important;
    min-width: 0 !important;
    padding: 14px 16px !important;
    border-right: 1px solid #d8e2ee !important;
    border-bottom: 1px solid #e3ebf3 !important;
    vertical-align: top !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
}

body .ap-quality-hard-fullwidth-table th:last-child,
body .ap-quality-hard-fullwidth-table td:last-child,
body .ap-quality-equal-4-table th:last-child,
body .ap-quality-equal-4-table td:last-child {
    border-right: 0 !important;
}

body .ap-quality-hard-fullwidth-table tbody tr:last-child td,
body .ap-quality-equal-4-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

body .ap-quality-hard-fullwidth-table thead th,
body .ap-quality-equal-4-table thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

body .ap-quality-hard-fullwidth-table tbody td,
body .ap-quality-equal-4-table tbody td {
    background: #ffffff !important;
    color: #1f2937 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-quality-hard-fullwidth-table tbody tr:nth-child(even) td,
body .ap-quality-equal-4-table tbody tr:nth-child(even) td {
    background: #fbfdff !important;
}

body .ap-quality-hard-fullwidth-table td:nth-child(1),
body .ap-quality-equal-4-table td:nth-child(1) {
    font-weight: 850 !important;
}

body .ap-quality-hard-fullwidth-table td:nth-child(2),
body .ap-quality-hard-fullwidth-table td:nth-child(3),
body .ap-quality-hard-fullwidth-table td:nth-child(4),
body .ap-quality-equal-4-table td:nth-child(2),
body .ap-quality-equal-4-table td:nth-child(3),
body .ap-quality-equal-4-table td:nth-child(4) {
    text-align: left !important;
}

body .ap-quality-hard-fullwidth-table .ap-status-badge,
body .ap-quality-equal-4-table .ap-status-badge {
    max-width: 100% !important;
    white-space: normal !important;
    justify-content: flex-start !important;
}

@media (max-width: 1180px) {
    body .billing-tariff-settings-page .tariff-settings-admin-summary {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    body .billing-tariff-settings-page .tariff-settings-summary-title,
    body .billing-tariff-settings-page .tariff-settings-summary-limit {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 760px) {
    body .billing-tariff-settings-page .tariff-settings-admin-summary {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .billing-tariff-settings-page .tariff-settings-summary-cell {
        min-height: auto !important;
    }

    body .ap-quality-hard-fullwidth-table,
    body .ap-quality-equal-4-table {
        min-width: 860px !important;
    }
}

/* Пакет 9.8.4.16 — финальная чистка тарифов и таблиц качества */

/*
    Исправления по чек-листу 9.8.4.15:
    - краткая карточка тарифа/услуги не показывает код;
    - раскрытая карточка не показывает разделы «Статус» и «Код тарифа/услуги»;
    - кнопка раскрытия меняет текст на «Скрыть детали»;
    - плашка «Показывать пользователям» уменьшена по высоте примерно в 2 раза;
    - таблицы качества принудительно занимают всю ширину и получают ровные 25% колонки.
*/

body .billing-tariff-settings-page .tariff-settings-admin-summary {
    grid-template-columns:
        minmax(220px, 1.5fr)
        minmax(120px, .65fr)
        minmax(210px, 1fr)
        minmax(150px, auto) !important;
    gap: 12px !important;
    align-items: stretch !important;
    padding: 16px 18px !important;
    box-sizing: border-box !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-cell {
    min-width: 0 !important;
    min-height: 62px !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-title strong,
body .billing-tariff-settings-page .tariff-settings-summary-limit strong,
body .billing-tariff-settings-page .tariff-settings-summary-price strong {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-actions {
    grid-column: 1 / -1 !important;
    justify-items: start !important;
    align-items: center !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill,
body .billing-tariff-settings-page .tariff-settings-public-toggle {
    min-height: 20px !important;
    height: auto !important;
    padding: 3px 8px !important;
    gap: 6px !important;
    border-radius: 999px !important;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .035) !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill:hover,
body .billing-tariff-settings-page .tariff-settings-public-toggle:hover {
    box-shadow: 0 8px 18px rgba(22, 101, 52, .10) !important;
    transform: translateY(-1px) !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
    border-width: 1.5px !important;
    border-radius: 4px !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after {
    width: 6px !important;
    height: 3px !important;
    border-left-width: 1.5px !important;
    border-bottom-width: 1.5px !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill strong,
body .billing-tariff-settings-page .tariff-settings-public-toggle strong {
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
}

body .billing-tariff-settings-page .tariff-settings-summary-toggle {
    min-width: 126px !important;
    min-height: 32px !important;
    padding: 7px 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

body .billing-tariff-settings-page .tariff-settings-toggle-hide {
    display: none !important;
}

body .billing-tariff-settings-page .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary .tariff-settings-toggle-show {
    display: none !important;
}

body .billing-tariff-settings-page .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary .tariff-settings-toggle-hide {
    display: inline !important;
}

body .billing-tariff-settings-page .tariff-settings-details-switch:checked ~ .tariff-settings-admin-summary .tariff-settings-summary-toggle::after {
    content: none !important;
}

body .billing-tariff-settings-page .tariff-settings-hidden-admin-field {
    display: none !important;
}

body .ap-object-detail-page .ap-quality-final-table-section,
body .ap-object-detail-page .ap-quality-hard-fullwidth-section,
body .ap-object-detail-page .ap-quality-balanced-section,
body .ap-object-detail-page .ap-quality-wide-section {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    box-sizing: border-box !important;
}

body .ap-object-detail-page .ap-quality-final-table-section .ap-quality-readonly-wrap,
body .ap-object-detail-page .ap-quality-final-table-section .ap-quality-readonly-grid,
body .ap-object-detail-page .ap-quality-final-table-section .ap-quality-readonly-table-shell,
body .ap-object-detail-page .ap-quality-final-table-section .ap-table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
}

body .ap-object-detail-page .ap-quality-final-four-table,
body .ap-object-detail-page .ap-quality-hard-fullwidth-table,
body .ap-object-detail-page .ap-quality-equal-4-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

body .ap-object-detail-page .ap-quality-final-four-table col,
body .ap-object-detail-page .ap-quality-final-four-table .ap-quality-col-quarter,
body .ap-object-detail-page .ap-quality-colgroup-equal-4 col {
    width: 25% !important;
    min-width: 25% !important;
    max-width: 25% !important;
}

body .ap-object-detail-page .ap-quality-final-four-table th,
body .ap-object-detail-page .ap-quality-final-four-table td {
    width: 25% !important;
    min-width: 0 !important;
    max-width: 25% !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    border: 1px solid #d8e2ee !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body .ap-object-detail-page .ap-quality-final-four-table thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

body .ap-object-detail-page .ap-quality-final-four-table tbody td {
    color: #1f2937 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-object-detail-page .ap-quality-final-four-table tbody tr:nth-child(even) td {
    background: #fbfdff !important;
}

body .ap-object-detail-page .ap-quality-final-four-table tbody tr:hover td {
    background: #f8fafc !important;
}

body .ap-object-detail-page .ap-quality-final-four-table td:nth-child(1) {
    text-align: left !important;
}

body .ap-object-detail-page .ap-quality-final-four-table td:nth-child(2),
body .ap-object-detail-page .ap-quality-final-four-table td:nth-child(3),
body .ap-object-detail-page .ap-quality-final-four-table td:nth-child(4) {
    text-align: center !important;
}

body .ap-object-detail-page .ap-quality-final-four-table .ap-quality-readonly-main strong,
body .ap-object-detail-page .ap-quality-final-four-table .ap-quality-readonly-value strong {
    display: inline-block !important;
    max-width: 100% !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 900 !important;
}

body .ap-object-detail-page .ap-quality-final-four-table .ap-status-badge {
    display: inline-flex !important;
    justify-content: center !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    white-space: normal !important;
    text-align: center !important;
}

body .ap-object-detail-page .ap-quality-final-four-table .ap-quality-muted {
    display: block !important;
    max-width: 100% !important;
    text-align: center !important;
}

@media (max-width: 1180px) {
    body .billing-tariff-settings-page .tariff-settings-admin-summary {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    body .billing-tariff-settings-page .tariff-settings-summary-title,
    body .billing-tariff-settings-page .tariff-settings-summary-limit,
    body .billing-tariff-settings-page .tariff-settings-summary-actions {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 760px) {
    body .billing-tariff-settings-page .tariff-settings-admin-summary {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .ap-object-detail-page .ap-quality-final-four-table {
        min-width: 760px !important;
    }
}

/* Пакет 9.8.4.17 — чистая таблица качества без старой конфликтующей структуры */

/*
    Главное изменение:
    - таблица качества в лотах и заявках больше не строится на старых ap-quality-readonly-* обёртках;
    - используется новая простая структура: section -> table-card -> table;
    - таблица имеет 4 физических col по 25%;
    - старые guard-маркеры оставлены только в HTML-комментарии и не влияют на визуал.
*/

body .ap-object-detail-page .agro-quality-table-section {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    box-sizing: border-box !important;
    margin: 24px 0 !important;
    padding: 20px !important;
    border: 1px solid #dbe5ef !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .055) !important;
    overflow: hidden !important;
}

body .ap-object-detail-page .agro-quality-table-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin: 0 0 16px 0 !important;
}

body .ap-object-detail-page .agro-quality-table-header h2 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
}

body .ap-object-detail-page .agro-quality-table-header p {
    margin: 6px 0 0 0 !important;
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-object-detail-page .agro-quality-table-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

body .ap-object-detail-page table.agro-quality-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 760px !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
}

body .ap-object-detail-page table.agro-quality-table col,
body .ap-object-detail-page table.agro-quality-table .agro-quality-col {
    width: 25% !important;
    min-width: 25% !important;
    max-width: 25% !important;
}

body .ap-object-detail-page table.agro-quality-table th,
body .ap-object-detail-page table.agro-quality-table td {
    width: 25% !important;
    min-width: 0 !important;
    max-width: 25% !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    border: 1px solid #dbe5ef !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body .ap-object-detail-page table.agro-quality-table thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    text-align: center !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: .045em !important;
}

body .ap-object-detail-page table.agro-quality-table tbody td {
    background: #ffffff !important;
    color: #1f2937 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

body .ap-object-detail-page table.agro-quality-table tbody tr:nth-child(even) td {
    background: #fbfdff !important;
}

body .ap-object-detail-page table.agro-quality-table tbody tr:hover td {
    background: #f8fafc !important;
}

body .ap-object-detail-page table.agro-quality-table .agro-quality-name {
    text-align: left !important;
}

body .ap-object-detail-page table.agro-quality-table .agro-quality-unit,
body .ap-object-detail-page table.agro-quality-table .agro-quality-value,
body .ap-object-detail-page table.agro-quality-table .agro-quality-status {
    text-align: center !important;
}

body .ap-object-detail-page table.agro-quality-table .agro-quality-name strong,
body .ap-object-detail-page table.agro-quality-table .agro-quality-value strong {
    display: inline-block !important;
    max-width: 100% !important;
    color: #0f172a !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 900 !important;
}

body .ap-object-detail-page .agro-quality-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 100% !important;
    min-height: 26px !important;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: normal !important;
}

body .ap-object-detail-page .agro-quality-badge-ok {
    background: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
}

body .ap-object-detail-page .agro-quality-badge-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
}

body .ap-object-detail-page .agro-quality-muted {
    display: inline-block !important;
    max-width: 100% !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    text-align: center !important;
}

/* Только размер самого квадрата галочки. Плашку "Показывать пользователям" не трогаем. */
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    border-radius: 3px !important;
}

body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after {
    width: 6px !important;
    height: 3px !important;
    border-left-width: 1.5px !important;
    border-bottom-width: 1.5px !important;
}

@media (max-width: 820px) {
    body .ap-object-detail-page table.agro-quality-table {
        min-width: 760px !important;
    }

    body .ap-object-detail-page .agro-quality-table-section {
        padding: 16px !important;
    }
}

/* Пакет 9.8.4.19 — уменьшаем только квадрат галочки */

/*
    Исправление после 9.8.4.18:
    - НЕ меняем плашку «Показывать пользователям»;
    - НЕ уменьшаем текст плашки;
    - НЕ меняем отступы, высоту, hover и общий вид плашки;
    - уменьшаем только само окно/квадрат checkbox, в котором появляется/пропадает галочка;
    - немного увеличиваем шрифт названий тарифов и услуг в краткой карточке.
*/

/* Только квадрат/окно checkbox внутри плашки публикации */
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-grid !important;
    place-content: center !important;
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    flex: 0 0 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 1.5px !important;
    border-radius: 3px !important;
    box-sizing: border-box !important;
}

/* Только сама галочка внутри уменьшенного квадрата */
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after {
    content: "" !important;
    width: 6px !important;
    height: 3px !important;
    border-left: 1.5px solid #ffffff !important;
    border-bottom: 1.5px solid #ffffff !important;
    transform: rotate(-45deg) scale(0) !important;
    transform-origin: center !important;
    transition: transform .16s ease !important;
}

body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]:checked::after,
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]:checked::after {
    transform: rotate(-45deg) scale(1) !important;
}

/* Немного крупнее названия тарифов и услуг */
body .billing-tariff-settings-page .tariff-settings-summary-title strong {
    font-size: 17px !important;
    line-height: 1.28 !important;
}

/* Пакет 9.8.4.20 — чуть крупнее только квадрат галочки */

/*
    Уточнение после 9.8.4.19:
    - общий вид плашки «Показывать пользователям» не меняем;
    - размер текста плашки не меняем;
    - padding, hover, высоту и фон плашки не меняем;
    - чуть увеличиваем только окно/квадрат checkbox: с 12px до 14px;
    - галочку внутри увеличиваем пропорционально.
*/

body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex: 0 0 14px !important;
    border-width: 1.5px !important;
    border-radius: 4px !important;
}

body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after {
    width: 7px !important;
    height: 3.5px !important;
    border-left-width: 1.5px !important;
    border-bottom-width: 1.5px !important;
}

/* Пакет 9.8.4.21 — увеличиваем плашку, checkbox возвращаем 12x12 */

/*
    Уточнение после 9.8.4.20:
    - теперь увеличиваем именно плашку-контейнер «Показывать пользователям»;
    - окно/квадрат checkbox возвращаем к 12px x 12px;
    - таблицы качества лота и заявки не трогаем;
    - кнопку «Показать детали / Скрыть детали» не трогаем.
*/

/* Плашка публикации: крупнее именно контейнер */
body .billing-tariff-settings-page .tariff-settings-public-toggle,
body .billing-tariff-settings-page .tariff-settings-public-pill {
    min-height: 34px !important;
    padding: 7px 13px !important;
    gap: 8px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
}

/* Текст плашки оставляем читаемым и нормального размера */
body .billing-tariff-settings-page .tariff-settings-public-toggle strong,
body .billing-tariff-settings-page .tariff-settings-public-pill strong {
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
}

/* Само окно/квадрат checkbox возвращаем к 12x12 */
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"],
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"] {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    flex: 0 0 12px !important;
    border-width: 1.5px !important;
    border-radius: 3px !important;
}

/* Галочка внутри 12x12 */
body .billing-tariff-settings-page .tariff-settings-public-toggle input[type="checkbox"]::after,
body .billing-tariff-settings-page .tariff-settings-public-pill input[type="checkbox"]::after {
    width: 6px !important;
    height: 3px !important;
    border-left-width: 1.5px !important;
    border-bottom-width: 1.5px !important;
}


/* Патч 9.8.9.1 — финальная семантическая система цветов кнопок */

/*
    Смысл цветов:
    - основное и подтверждающее действие — зелёный;
    - переход/дополнительное действие — синий;
    - нейтральное действие, сброс и возврат — серый, не белый;
    - опасное действие, отмена и спор — красный;
    - модерация/предупреждение — янтарный.
*/

body .btn,
body button.btn,
body a.btn,
body input[type="submit"].btn,
body .ap-action-btn,
body button.ap-action-btn,
body a.ap-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 40px !important;
    padding: 9px 15px !important;
    border-radius: 12px !important;
    border: 1px solid var(--ap-color-primary-dark) !important;
    background: linear-gradient(135deg, var(--ap-color-primary), var(--ap-color-primary-dark)) !important;
    color: #ffffff !important;
    font-weight: 850 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 7px rgba(22, 101, 52, 0.16) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

body .btn:hover,
body button.btn:hover,
body a.btn:hover,
body input[type="submit"].btn:hover,
body .ap-action-btn:hover,
body button.ap-action-btn:hover,
body a.ap-action-btn:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 18px rgba(22, 101, 52, 0.24) !important;
}

body .btn:active,
body button.btn:active,
body a.btn:active,
body input[type="submit"].btn:active,
body .ap-action-btn:active,
body button.ap-action-btn:active,
body a.ap-action-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.12) !important;
}

body .btn:focus-visible,
body button.btn:focus-visible,
body a.btn:focus-visible,
body input[type="submit"].btn:focus-visible,
body .ap-action-btn:focus-visible,
body button.ap-action-btn:focus-visible,
body a.ap-action-btn:focus-visible {
    outline: 3px solid rgba(34, 197, 94, 0.25) !important;
    outline-offset: 2px !important;
}

body .btn-secondary,
body a.btn-secondary,
body button.btn-secondary,
body .ap-action-secondary,
body a.ap-action-secondary,
body button.ap-action-secondary,
body .ap-action-chat,
body a.ap-action-chat,
body button.ap-action-chat {
    border-color: var(--ap-color-blue-dark) !important;
    background: linear-gradient(135deg, var(--ap-color-blue), var(--ap-color-blue-dark)) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 7px rgba(37, 99, 235, 0.16) !important;
}

body .btn-secondary:hover,
body a.btn-secondary:hover,
body button.btn-secondary:hover,
body .ap-action-secondary:hover,
body a.ap-action-secondary:hover,
body button.ap-action-secondary:hover,
body .ap-action-chat:hover,
body a.ap-action-chat:hover,
body button.ap-action-chat:hover {
    border-color: var(--ap-color-blue-dark) !important;
    background: linear-gradient(135deg, var(--ap-color-blue-dark), #1e40af) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24) !important;
}

body .btn-muted,
body a.btn-muted,
body button.btn-muted,
body .ap-action-neutral,
body a.ap-action-neutral,
body button.ap-action-neutral {
    border-color: #9ca3af !important;
    background: #e5e7eb !important;
    color: #374151 !important;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08) !important;
}

body .btn-muted:hover,
body a.btn-muted:hover,
body button.btn-muted:hover,
body .ap-action-neutral:hover,
body a.ap-action-neutral:hover,
body button.ap-action-neutral:hover {
    border-color: #6b7280 !important;
    background: #d1d5db !important;
    color: #111827 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14) !important;
}

body .btn-danger,
body a.btn-danger,
body button.btn-danger,
body .ap-action-danger,
body a.ap-action-danger,
body button.ap-action-danger,
body .ap-action-dispute,
body a.ap-action-dispute,
body button.ap-action-dispute,
body .ap-action-cancel,
body a.ap-action-cancel,
body button.ap-action-cancel {
    border-color: var(--ap-color-danger-dark) !important;
    background: linear-gradient(135deg, var(--ap-color-danger), #991b1b) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 7px rgba(185, 28, 28, 0.16) !important;
}

body .btn-danger:hover,
body a.btn-danger:hover,
body button.btn-danger:hover,
body .ap-action-danger:hover,
body a.ap-action-danger:hover,
body button.ap-action-danger:hover,
body .ap-action-dispute:hover,
body a.ap-action-dispute:hover,
body button.ap-action-dispute:hover,
body .ap-action-cancel:hover,
body a.ap-action-cancel:hover,
body button.ap-action-cancel:hover {
    border-color: #991b1b !important;
    background: linear-gradient(135deg, var(--ap-color-danger-dark), #7f1d1d) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.24) !important;
}

body .btn-warning,
body a.btn-warning,
body button.btn-warning,
body .ap-action-warning,
body a.ap-action-warning,
body button.ap-action-warning,
body .ap-action-moderation,
body a.ap-action-moderation,
body button.ap-action-moderation {
    border-color: #d97706 !important;
    background: linear-gradient(135deg, #f59e0b, #b45309) !important;
    color: #111827 !important;
    box-shadow: 0 2px 7px rgba(217, 119, 6, 0.16) !important;
}

body .btn-warning:hover,
body a.btn-warning:hover,
body button.btn-warning:hover,
body .ap-action-warning:hover,
body a.ap-action-warning:hover,
body button.ap-action-warning:hover,
body .ap-action-moderation:hover,
body a.ap-action-moderation:hover,
body button.ap-action-moderation:hover {
    border-color: #b45309 !important;
    background: linear-gradient(135deg, #d97706, #92400e) !important;
    color: #111827 !important;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.24) !important;
}

body .ap-section-actions,
body .notification-actions,
body .notifications-filter-actions,
body .billing-section-head .ap-action-btn,
body .billing-provider-admin-grid,
body .offer-actions,
body .deal-actions,
body .dispute-actions,
body .support-actions,
body .moderation-actions,
body .manager-actions {
    align-items: center !important;
}

/* Патч 9.8.9.2 — единая геометрия кнопок */

/*
    Единый геометрический контракт для кнопок:
    - стандартная высота — 42px;
    - стандартная минимальная ширина — 112px;
    - компактные служебные кнопки и пагинация сохраняют меньший формат;
    - фильтры получают одинаковую ширину кнопок применения/сброса;
    - строки действий выравниваются по центру и используют единый отступ.
*/

:root {
    --ap-button-height: 42px;
    --ap-button-compact-height: 36px;
    --ap-button-min-width: 112px;
    --ap-button-filter-min-width: 118px;
    --ap-button-padding-x: 16px;
    --ap-button-compact-padding-x: 12px;
    --ap-button-radius: 12px;
    --ap-button-gap: 10px;
}

body .btn,
body button.btn,
body a.btn,
body input[type="submit"].btn,
body .ap-action-btn,
body button.ap-action-btn,
body a.ap-action-btn {
    min-height: var(--ap-button-height) !important;
    height: auto !important;
    min-width: var(--ap-button-min-width) !important;
    padding: 0 var(--ap-button-padding-x) !important;
    border-radius: var(--ap-button-radius) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

body .btn.btn-sm,
body button.btn.btn-sm,
body a.btn.btn-sm,
body .ap-action-btn.ap-action-compact,
body button.ap-action-btn.ap-action-compact,
body a.ap-action-btn.ap-action-compact,
body .ap-filter-actions-compact .ap-action-btn,
body .pagination .btn,
body .pagination .ap-action-btn {
    min-height: var(--ap-button-compact-height) !important;
    min-width: 0 !important;
    padding: 0 var(--ap-button-compact-padding-x) !important;
    border-radius: 10px !important;
    font-size: 13px !important;
}

body .ap-auth-full-action {
    width: 100% !important;
    min-width: 0 !important;
}

body .ap-section-actions,
body .page-actions,
body .form-actions,
body .filter-actions,
body .ap-filter-actions,
body .work-filter-actions,
body .manager-unified-filter-actions,
body .roles-filter-actions,
body .offer-filter-actions,
body .deal-filter-head-actions,
body .disputes-filter-actions,
body .support-filter-actions,
body .support-user-filter .work-filter-actions,
body .price-filter-actions,
body .watch-filter-actions,
body .manager-filter-actions,
body .audit-filter-actions,
body .notifications-head-actions,
body .notification-actions,
body .notifications-filter-actions,
body .billing-actions,
body .offer-actions,
body .deal-actions,
body .dispute-actions,
body .support-actions,
body .moderation-actions,
body .manager-actions,
body .company-actions,
body .ap-company-actions,
body .ap-company-filter-actions,
body .ap-company-document-actions {
    display: flex !important;
    align-items: center !important;
    gap: var(--ap-button-gap) !important;
    flex-wrap: wrap !important;
}

body .work-filter-actions .ap-action-btn,
body .manager-unified-filter-actions .ap-action-btn,
body .roles-filter-actions .ap-action-btn,
body .offer-filter-actions .ap-action-btn,
body .deal-filter-head-actions .ap-action-btn,
body .disputes-filter-actions .ap-action-btn,
body .support-filter-actions .ap-action-btn,
body .support-user-filter .work-filter-actions .ap-action-btn,
body .price-filter-actions .ap-action-btn,
body .watch-filter-actions .ap-action-btn,
body .manager-filter-actions .ap-action-btn,
body .audit-filter-actions .ap-action-btn,
body .notifications-filter-actions .ap-action-btn {
    flex: 0 0 var(--ap-button-filter-min-width) !important;
    min-width: var(--ap-button-filter-min-width) !important;
}

body .ap-filter-actions-compact .ap-action-btn {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
}

@media (max-width: 640px) {
    body .ap-section-actions,
    body .page-actions,
    body .form-actions,
    body .filter-actions,
    body .ap-filter-actions,
    body .work-filter-actions,
    body .manager-unified-filter-actions,
    body .roles-filter-actions,
    body .offer-filter-actions,
    body .deal-filter-head-actions,
    body .disputes-filter-actions,
    body .support-filter-actions,
    body .price-filter-actions,
    body .watch-filter-actions,
    body .manager-filter-actions,
    body .audit-filter-actions,
    body .notifications-filter-actions,
    body .billing-actions,
    body .offer-actions,
    body .deal-actions,
    body .dispute-actions,
    body .support-actions,
    body .moderation-actions,
    body .manager-actions,
    body .company-actions,
    body .ap-company-actions,
    body .ap-company-filter-actions,
    body .ap-company-document-actions {
        align-items: stretch !important;
    }

    body .ap-section-actions .btn,
    body .ap-section-actions .ap-action-btn,
    body .page-actions .btn,
    body .page-actions .ap-action-btn,
    body .form-actions .btn,
    body .form-actions .ap-action-btn,
    body .filter-actions .btn,
    body .filter-actions .ap-action-btn,
    body .work-filter-actions .ap-action-btn,
    body .manager-unified-filter-actions .ap-action-btn,
    body .roles-filter-actions .ap-action-btn,
    body .offer-filter-actions .ap-action-btn,
    body .deal-filter-head-actions .ap-action-btn,
    body .disputes-filter-actions .ap-action-btn,
    body .support-filter-actions .ap-action-btn,
    body .price-filter-actions .ap-action-btn,
    body .watch-filter-actions .ap-action-btn,
    body .manager-filter-actions .ap-action-btn,
    body .audit-filter-actions .ap-action-btn,
    body .notifications-filter-actions .ap-action-btn,
    body .billing-actions .ap-action-btn,
    body .offer-actions .ap-action-btn,
    body .deal-actions .ap-action-btn,
    body .dispute-actions .ap-action-btn,
    body .support-actions .ap-action-btn,
    body .moderation-actions .ap-action-btn,
    body .manager-actions .ap-action-btn,
    body .company-actions .ap-action-btn,
    body .ap-company-actions .ap-action-btn,
    body .ap-company-filter-actions .ap-action-btn,
    body .ap-company-document-actions .ap-action-btn {
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Патч 9.8.9.2.1 — мягкая палитра кнопок в стиле платформы */

/*
    Цвета кнопок смягчены после выравнивания геометрии:
    - сохраняем высоту, ширину и отступы из 9.8.9.2;
    - убираем резкие заливки и тяжёлые градиенты с кнопок;
    - оставляем читаемый контраст текста;
    - палитра ближе к основному светлому зелёному стилю Agro Platform.
*/

:root {
    --ap-button-soft-primary-bg: #e8f7ee;
    --ap-button-soft-primary-bg-hover: #d9f0e3;
    --ap-button-soft-primary-border: #9fd3b1;
    --ap-button-soft-primary-text: #14532d;

    --ap-button-soft-secondary-bg: #eef6ff;
    --ap-button-soft-secondary-bg-hover: #dbeafe;
    --ap-button-soft-secondary-border: #bdd7f4;
    --ap-button-soft-secondary-text: #1e4f8a;

    --ap-button-soft-neutral-bg: #f7f9fb;
    --ap-button-soft-neutral-bg-hover: #eef2f6;
    --ap-button-soft-neutral-border: #d5dde8;
    --ap-button-soft-neutral-text: #334155;

    --ap-button-soft-danger-bg: #fff1f2;
    --ap-button-soft-danger-bg-hover: #ffe4e6;
    --ap-button-soft-danger-border: #fecdd3;
    --ap-button-soft-danger-text: #9f1239;

    --ap-button-soft-warning-bg: #fff8e6;
    --ap-button-soft-warning-bg-hover: #fef0c7;
    --ap-button-soft-warning-border: #f7d98b;
    --ap-button-soft-warning-text: #854d0e;

    --ap-button-soft-shadow: 0 2px 7px rgba(15, 23, 42, 0.055);
    --ap-button-soft-shadow-hover: 0 8px 18px rgba(15, 23, 42, 0.105);
}

body .btn,
body button.btn,
body a.btn,
body input[type="submit"].btn,
body .ap-action-btn,
body button.ap-action-btn,
body a.ap-action-btn,
body .ap-action-primary,
body a.ap-action-primary,
body button.ap-action-primary,
body .ap-action-confirm,
body a.ap-action-confirm,
body button.ap-action-confirm,
body .ap-action-approve,
body a.ap-action-approve,
body button.ap-action-approve,
body .btn-primary,
body a.btn-primary,
body button.btn-primary {
    border-color: var(--ap-button-soft-primary-border) !important;
    background: var(--ap-button-soft-primary-bg) !important;
    color: var(--ap-button-soft-primary-text) !important;
    box-shadow: var(--ap-button-soft-shadow) !important;
}

body .btn:hover,
body button.btn:hover,
body a.btn:hover,
body input[type="submit"].btn:hover,
body .ap-action-btn:hover,
body button.ap-action-btn:hover,
body a.ap-action-btn:hover,
body .ap-action-primary:hover,
body a.ap-action-primary:hover,
body button.ap-action-primary:hover,
body .ap-action-confirm:hover,
body a.ap-action-confirm:hover,
body button.ap-action-confirm:hover,
body .ap-action-approve:hover,
body a.ap-action-approve:hover,
body button.ap-action-approve:hover,
body .btn-primary:hover,
body a.btn-primary:hover,
body button.btn-primary:hover {
    border-color: #86c69c !important;
    background: var(--ap-button-soft-primary-bg-hover) !important;
    color: var(--ap-button-soft-primary-text) !important;
    box-shadow: var(--ap-button-soft-shadow-hover) !important;
}

body .btn-secondary,
body a.btn-secondary,
body button.btn-secondary,
body .ap-action-secondary,
body a.ap-action-secondary,
body button.ap-action-secondary,
body .ap-action-chat,
body a.ap-action-chat,
body button.ap-action-chat {
    border-color: var(--ap-button-soft-secondary-border) !important;
    background: var(--ap-button-soft-secondary-bg) !important;
    color: var(--ap-button-soft-secondary-text) !important;
    box-shadow: var(--ap-button-soft-shadow) !important;
}

body .btn-secondary:hover,
body a.btn-secondary:hover,
body button.btn-secondary:hover,
body .ap-action-secondary:hover,
body a.ap-action-secondary:hover,
body button.ap-action-secondary:hover,
body .ap-action-chat:hover,
body a.ap-action-chat:hover,
body button.ap-action-chat:hover {
    border-color: #9ec5ea !important;
    background: var(--ap-button-soft-secondary-bg-hover) !important;
    color: var(--ap-button-soft-secondary-text) !important;
    box-shadow: var(--ap-button-soft-shadow-hover) !important;
}

body .btn-muted,
body a.btn-muted,
body button.btn-muted,
body .ap-action-neutral,
body a.ap-action-neutral,
body button.ap-action-neutral,
body .ap-action-archive,
body a.ap-action-archive,
body button.ap-action-archive {
    border-color: var(--ap-button-soft-neutral-border) !important;
    background: var(--ap-button-soft-neutral-bg) !important;
    color: var(--ap-button-soft-neutral-text) !important;
    box-shadow: var(--ap-button-soft-shadow) !important;
}

body .btn-muted:hover,
body a.btn-muted:hover,
body button.btn-muted:hover,
body .ap-action-neutral:hover,
body a.ap-action-neutral:hover,
body button.ap-action-neutral:hover,
body .ap-action-archive:hover,
body a.ap-action-archive:hover,
body button.ap-action-archive:hover {
    border-color: #c4cedb !important;
    background: var(--ap-button-soft-neutral-bg-hover) !important;
    color: #1f2937 !important;
    box-shadow: var(--ap-button-soft-shadow-hover) !important;
}

body .btn-danger,
body a.btn-danger,
body button.btn-danger,
body .ap-action-danger,
body a.ap-action-danger,
body button.ap-action-danger,
body .ap-action-cancel,
body a.ap-action-cancel,
body button.ap-action-cancel,
body .ap-action-dispute,
body a.ap-action-dispute,
body button.ap-action-dispute {
    border-color: var(--ap-button-soft-danger-border) !important;
    background: var(--ap-button-soft-danger-bg) !important;
    color: var(--ap-button-soft-danger-text) !important;
    box-shadow: var(--ap-button-soft-shadow) !important;
}

body .btn-danger:hover,
body a.btn-danger:hover,
body button.btn-danger:hover,
body .ap-action-danger:hover,
body a.ap-action-danger:hover,
body button.ap-action-danger:hover,
body .ap-action-cancel:hover,
body a.ap-action-cancel:hover,
body button.ap-action-cancel:hover,
body .ap-action-dispute:hover,
body a.ap-action-dispute:hover,
body button.ap-action-dispute:hover {
    border-color: #fda4af !important;
    background: var(--ap-button-soft-danger-bg-hover) !important;
    color: var(--ap-button-soft-danger-text) !important;
    box-shadow: var(--ap-button-soft-shadow-hover) !important;
}

body .btn-warning,
body a.btn-warning,
body button.btn-warning,
body .ap-action-warning,
body a.ap-action-warning,
body button.ap-action-warning,
body .ap-action-moderation,
body a.ap-action-moderation,
body button.ap-action-moderation,
body .ap-action-unpublish,
body a.ap-action-unpublish,
body button.ap-action-unpublish {
    border-color: var(--ap-button-soft-warning-border) !important;
    background: var(--ap-button-soft-warning-bg) !important;
    color: var(--ap-button-soft-warning-text) !important;
    box-shadow: var(--ap-button-soft-shadow) !important;
}

body .btn-warning:hover,
body a.btn-warning:hover,
body button.btn-warning:hover,
body .ap-action-warning:hover,
body a.ap-action-warning:hover,
body button.ap-action-warning:hover,
body .ap-action-moderation:hover,
body a.ap-action-moderation:hover,
body button.ap-action-moderation:hover,
body .ap-action-unpublish:hover,
body a.ap-action-unpublish:hover,
body button.ap-action-unpublish:hover {
    border-color: #f2ca70 !important;
    background: var(--ap-button-soft-warning-bg-hover) !important;
    color: var(--ap-button-soft-warning-text) !important;
    box-shadow: var(--ap-button-soft-shadow-hover) !important;
}

body .btn:focus-visible,
body button.btn:focus-visible,
body a.btn:focus-visible,
body input[type="submit"].btn:focus-visible,
body .ap-action-btn:focus-visible,
body button.ap-action-btn:focus-visible,
body a.ap-action-btn:focus-visible {
    outline: 3px solid rgba(22, 101, 52, 0.18) !important;
    outline-offset: 2px !important;
}

body .manager-workspace .ap-action-btn,
body .manager-workspace-card .ap-action-btn,
body .manager-card .ap-action-btn,
body .admin-tool-card .ap-action-btn,
body .moderation-card .ap-action-btn,
body .price-approval-card .ap-action-btn,
body .staff-work-nav .ap-action-btn {
    font-weight: 850 !important;
    text-shadow: none !important;
}

/* Патч 9.8.9.3 — финальная зачистка карточек и фильтров
   Цель: выровнять карточки, фильтры и пустые состояния без изменения бизнес-логики и шаблонов.
   Слой намеренно мягкий: он не ломает уже принятые цвета кнопок 9.8.9.2.1 и геометрию 9.8.9.2. */
:root {
    --ap-final-card-radius: 18px;
    --ap-final-card-border: #dfe9e3;
    --ap-final-card-bg: #ffffff;
    --ap-final-card-bg-soft: #f8fcf9;
    --ap-final-card-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
    --ap-final-card-shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.075);
    --ap-final-filter-bg: linear-gradient(135deg, #f8fcf9 0%, #ffffff 100%);
    --ap-final-filter-border: #d8eee0;
    --ap-final-section-gap: 18px;
    --ap-final-inner-gap: 12px;
}

body .ap-card,
body .ap-panel,
body .ap-section-card,
body .ap-clickable-card,
body .workspace-card,
body .manager-workspace-card,
body .manager-card,
body .admin-tool-card,
body .billing-card,
body .billing-panel,
body .billing-staff-settings-card,
body .tariff-card,
body .paid-service-card,
body .notification-card,
body .notifications-group,
body .support-ticket-card,
body .deal-card,
body .offer-card,
body .dispute-card,
body .lot-card,
body .buy-request-card,
body .document-card {
    border-radius: var(--ap-final-card-radius) !important;
    border-color: var(--ap-final-card-border) !important;
    background-color: var(--ap-final-card-bg);
    box-shadow: var(--ap-final-card-shadow) !important;
    box-sizing: border-box;
}

body .ap-clickable-card,
body a.ap-clickable-card,
body .workspace-card,
body .manager-workspace-card,
body .manager-card,
body .admin-tool-card,
body .billing-staff-settings-card,
body .tariff-card,
body .paid-service-card,
body .notification-card,
body .support-ticket-card,
body .deal-card,
body .offer-card,
body .dispute-card,
body .lot-card,
body .buy-request-card {
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease !important;
}

body .ap-clickable-card:hover,
body a.ap-clickable-card:hover,
body .workspace-card:hover,
body .manager-workspace-card:hover,
body .manager-card:hover,
body .admin-tool-card:hover,
body .billing-staff-settings-card:hover,
body .tariff-card:hover,
body .paid-service-card:hover,
body .notification-card:hover,
body .support-ticket-card:hover,
body .deal-card:hover,
body .offer-card:hover,
body .dispute-card:hover,
body .lot-card:hover,
body .buy-request-card:hover {
    border-color: #b7dec4 !important;
    background: var(--ap-final-card-bg-soft) !important;
    box-shadow: var(--ap-final-card-shadow-hover) !important;
    transform: translateY(-1px) !important;
}

body .ap-clickable-card:focus-visible,
body a.ap-clickable-card:focus-visible,
body .workspace-card:focus-visible,
body .manager-workspace-card:focus-visible,
body .manager-card:focus-visible,
body .admin-tool-card:focus-visible,
body .billing-staff-settings-card:focus-visible,
body .tariff-card:focus-visible,
body .paid-service-card:focus-visible,
body .notification-card:focus-visible,
body .support-ticket-card:focus-visible,
body .deal-card:focus-visible,
body .offer-card:focus-visible,
body .dispute-card:focus-visible,
body .lot-card:focus-visible,
body .buy-request-card:focus-visible {
    outline: 3px solid rgba(22, 101, 52, 0.16) !important;
    outline-offset: 3px !important;
}

body .ap-grid,
body .workspace-grid,
body .manager-workspace-grid,
body .billing-grid,
body .tariff-grid,
body .notifications-list,
body .notification-list,
body .support-list,
body .deal-list,
body .offer-list,
body .dispute-list,
body .lot-list,
body .buy-request-list,
body .documents-grid {
    gap: var(--ap-final-section-gap) !important;
}

body .work-filter,
body .manager-unified-filter,
body .manager-standard-filter,
body .moderation-unified-filter,
body .price-filter,
body .manager-tasks-filter,
body .company-verification-filter,
body .cancel-review-filter,
body .support-manager-filter,
body .support-user-filter,
body .ap-user-standard-filter,
body .notifications-filter,
body .notification-filter-form,
body .billing-filter,
body .payment-filter,
body .market-filter,
body .lot-filter,
body .buy-request-filter,
body .deal-filter-form,
body .deal-workflow-filter,
body .dispute-filter-form,
body .disputes-filter-panel,
body .offer-filter-form {
    border: 1px solid var(--ap-final-filter-border) !important;
    border-radius: var(--ap-final-card-radius) !important;
    background: var(--ap-final-filter-bg) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035) !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

body .work-filter-grid,
body .manager-unified-filter-grid,
body .notifications-filter,
body .notifications-filters,
body .billing-filter-grid,
body .market-filter-grid,
body .filter-grid,
body .ap-filter-grid {
    gap: var(--ap-final-inner-gap) !important;
    align-items: end !important;
}

body .work-filter label,
body .manager-unified-filter label,
body .manager-standard-filter label,
body .notifications-filter label,
body .notification-filter-form label,
body .billing-filter label,
body .payment-filter label,
body .market-filter label,
body .lot-filter label,
body .buy-request-filter label,
body .deal-filter-form label,
body .dispute-filter-form label,
body .offer-filter-form label {
    color: #334155 !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.25 !important;
    margin-bottom: 6px !important;
}

body .work-filter input,
body .work-filter select,
body .work-filter textarea,
body .manager-unified-filter input,
body .manager-unified-filter select,
body .manager-standard-filter input,
body .manager-standard-filter select,
body .notifications-filter input,
body .notifications-filter select,
body .billing-filter input,
body .billing-filter select,
body .payment-filter input,
body .payment-filter select,
body .market-filter input,
body .market-filter select,
body .lot-filter input,
body .lot-filter select,
body .buy-request-filter input,
body .buy-request-filter select,
body .deal-filter-form input,
body .deal-filter-form select,
body .dispute-filter-form input,
body .dispute-filter-form select,
body .offer-filter-form input,
body .offer-filter-form select {
    border-color: #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #111827 !important;
    min-height: 42px !important;
}

body .work-filter input:focus,
body .work-filter select:focus,
body .work-filter textarea:focus,
body .manager-unified-filter input:focus,
body .manager-unified-filter select:focus,
body .manager-standard-filter input:focus,
body .manager-standard-filter select:focus,
body .notifications-filter input:focus,
body .notifications-filter select:focus,
body .billing-filter input:focus,
body .billing-filter select:focus,
body .payment-filter input:focus,
body .payment-filter select:focus,
body .market-filter input:focus,
body .market-filter select:focus,
body .lot-filter input:focus,
body .lot-filter select:focus,
body .buy-request-filter input:focus,
body .buy-request-filter select:focus,
body .deal-filter-form input:focus,
body .deal-filter-form select:focus,
body .dispute-filter-form input:focus,
body .dispute-filter-form select:focus,
body .offer-filter-form input:focus,
body .offer-filter-form select:focus {
    border-color: #86c59b !important;
    box-shadow: 0 0 0 4px rgba(22, 101, 52, 0.08) !important;
    outline: none !important;
}

body .empty-state,
body .ap-empty-state,
body .notifications-empty,
body .notification-empty,
body .support-empty,
body .billing-empty,
body .workflow-empty,
body .market-empty,
body .list-empty {
    border: 1px dashed #cbd5e1 !important;
    border-radius: var(--ap-final-card-radius) !important;
    background: #f8fafc !important;
    color: #64748b !important;
    padding: 22px !important;
    text-align: center !important;
    line-height: 1.45 !important;
    box-sizing: border-box !important;
}

@media (max-width: 760px) {
    body .work-filter,
    body .manager-unified-filter,
    body .manager-standard-filter,
    body .notifications-filter,
    body .notification-filter-form,
    body .billing-filter,
    body .payment-filter,
    body .market-filter,
    body .lot-filter,
    body .buy-request-filter,
    body .deal-filter-form,
    body .dispute-filter-form,
    body .offer-filter-form {
        padding: 14px !important;
    }

    body .ap-grid,
    body .workspace-grid,
    body .manager-workspace-grid,
    body .billing-grid,
    body .tariff-grid,
    body .notifications-list,
    body .notification-list,
    body .support-list,
    body .deal-list,
    body .offer-list,
    body .dispute-list,
    body .lot-list,
    body .buy-request-list,
    body .documents-grid {
        gap: 14px !important;
    }
}


/* STEP17_FULL_UI_BUTTON_LOGIC_CLEANUP
   Единое правило: кликабельная карточка сама является переходом.
   На карточках списков не держим дублирующие кнопки «Открыть/Перейти/Переговоры/Решение».
   Действия выполняются внутри детальной страницы объекта, где виден контекст и статус.
*/
body .offers-list,
body .deals-list,
body .market-clean-list,
body .disputes-list,
body .notifications-list,
body .support-page .support-ticket-list,
body .support-page .ticket-list,
body .manager-tasks-list,
body .manager-watch-list,
body .workspace-grid,
body .manager-final-card-grid,
body .moderation-list,
body .price-approval-list {
    gap: 18px !important;
}

body .click-card,
body .ap-clickable-card,
body .ap-work-card,
body .market-clean-card,
body .offer-workflow-card,
body .deal-workflow-card,
body .disputes-card,
body .notification-card,
body .support-card,
body .manager-task-card {
    display: block;
    min-width: 0;
    box-sizing: border-box;
}

body .deal-workflow-card-title-row,
body .offer-card-title-row,
body .market-clean-card-head,
body .disputes-card-head,
body .notification-card-top,
body .support-card-top,
body .manager-task-card-top,
body .ap-work-card-top {
    align-items: flex-start !important;
    gap: 14px !important;
}

body .deal-workflow-metrics,
body .offer-card-metrics,
body .market-final-metrics,
body .market-clean-metrics,
body .disputes-card-grid,
body .notification-card-grid,
body .support-info-grid,
body .manager-task-grid {
    gap: 12px !important;
    margin-top: 14px !important;
}

body .deal-workflow-parties,
body .deal-workflow-progress,
body .offer-card-context {
    gap: 12px !important;
    margin-top: 14px !important;
}

body .ap-clean-actions-panel {
    border-color: #cdebd7 !important;
    background: linear-gradient(135deg, #f7fdf9 0%, #ffffff 100%) !important;
}

body .ap-clean-actions-row {
    gap: 10px !important;
    justify-content: flex-start !important;
}

body .ap-clean-state-note {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

body .ap-clean-state-note h2 {
    margin: 0 0 8px 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
}

body .ap-clean-state-note p {
    margin: 0 !important;
    line-height: 1.55 !important;
}

body .deal-detail-card,
body .offer-detail-card,
body .dispute-detail-card,
body .chat-card,
body .chat-spacious-card,
body .support-card,
body .support-detail-card,
body .ap-object-card,
body .ap-form-card,
body .ap-document-card,
body .ap-quality-card,
body .ap-history-card,
body .ap-status-card {
    margin: 0 !important;
}

body .deal-workflow-detail,
body .offer-detail-page,
body .dispute-workflow-detail,
body .chat-dialog-page,
body .support-page,
body .ap-object-detail-page,
body .ap-object-form-page {
    gap: 22px !important;
}

/* STEP20-SUPPORT-UI-CLEANUP: поддержка — единая сетка, кнопки и отступы */
body .support-ui-clean-page {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body .support-ui-clean-page > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .support-ui-hero,
body .support-ui-filter,
body .support-ui-summary-grid,
body .support-ui-ticket-list,
body .support-ui-thread-card,
body .support-ui-reply-card,
body .support-ui-close-card,
body .support-ui-detail-hero,
body .support-ui-form,
body .support-ui-empty-state,
body .support-ui-closed {
    width: 100% !important;
    box-sizing: border-box !important;
}

body .support-ui-hero {
    align-items: flex-start !important;
}

body .support-ui-hero-actions {
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
}

body .support-ui-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

body .support-summary-card {
    min-width: 0 !important;
    padding: 16px !important;
    border: 1px solid #dbe7df !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045) !important;
}

body .support-ui-filter {
    padding: 18px !important;
    border: 1px solid #d8eee0 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #f7fdf9 0%, #ffffff 100%) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04) !important;
}

body .support-ui-filter-head {
    margin-bottom: 16px !important;
}

body .support-ui-filter-head h2 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
}

body .support-ui-filter-head p {
    margin: 6px 0 0 0 !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

body .support-ui-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: end !important;
}

body .support-ui-filter-grid-manager {
    grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 0.9fr) minmax(260px, 1.3fr) auto !important;
}

body .support-ui-filter-actions {
    justify-content: flex-end !important;
    align-self: end !important;
    min-width: 260px !important;
    flex-wrap: nowrap !important;
}

body .support-ui-filter-actions .ap-action-btn {
    min-width: 118px !important;
    flex: 0 0 118px !important;
}

body .support-ui-ticket-list {
    display: grid !important;
    gap: 16px !important;
}

body .support-card.support-ticket-card {
    position: relative !important;
    display: block !important;
    padding: 20px !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 6px solid #16a34a !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055) !important;
    color: inherit !important;
    text-decoration: none !important;
    cursor: pointer !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body .support-card.support-ticket-card:hover,
body .support-card.support-ticket-card:focus-visible {
    border-color: #bbf7d0 !important;
    border-left-color: #16a34a !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09) !important;
    transform: translateY(-1px) !important;
    outline: none !important;
}

body .support-card-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 12px !important;
}

body .support-card-main {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

body .support-card-title {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 19px !important;
    line-height: 1.28 !important;
    font-weight: 850 !important;
}

body .support-meta,
body .support-muted,
body .support-form-note {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

body .support-card-text {
    margin: 12px 0 0 0 !important;
    color: #334155 !important;
    line-height: 1.55 !important;
}

body .support-card-footer,
body .support-card-meta-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
    border-top: 1px solid #e2e8f0 !important;
}

body .support-card-footer .btn,
body .support-card-footer .ap-action-btn,
body .support-card-actions,
body .support-ticket-card .support-card-actions {
    display: none !important;
}

body .support-status,
body .support-priority-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 28px !important;
    padding: 0 11px !important;
    border-radius: 999px !important;
    border: 1px solid #bbf7d0 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
}

body .support-priority-badge {
    border-color: #fde68a !important;
    background: #fffbeb !important;
    color: #92400e !important;
}

body .support-ui-back-row {
    display: flex !important;
    justify-content: flex-start !important;
}

body .support-ui-back-row a {
    color: #166534 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

body .support-ui-back-row a:hover {
    text-decoration: underline !important;
}

body .support-ui-detail-hero,
body .support-ui-thread-card,
body .support-ui-reply-card,
body .support-ui-close-card,
body .support-ui-form,
body .support-ui-closed,
body .support-ui-empty-state {
    padding: 22px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055) !important;
}

body .support-ui-detail-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 18px !important;
    align-items: start !important;
}

body .support-ui-detail-hero .support-status {
    justify-self: end !important;
}

body .support-ui-info-grid {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 0 !important;
}

body .support-info-card {
    min-width: 0 !important;
    padding: 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    box-sizing: border-box !important;
}

body .support-info-card span,
body .support-form-field label {
    display: block !important;
    margin-bottom: 7px !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 850 !important;
}

body .support-info-card strong {
    display: block !important;
    color: #0f172a !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

body .support-section-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
}

body .support-section-head h2,
body .support-ui-close-card h2 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
    line-height: 1.25 !important;
    font-weight: 850 !important;
}

body .support-section-head p,
body .support-ui-close-card p {
    margin: 6px 0 0 0 !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

body .support-ui-thread {
    display: grid !important;
    gap: 14px !important;
}

body .support-message {
    margin: 0 !important;
    padding: 16px 18px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035) !important;
}

body .support-message-user {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}

body .support-message-manager {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
}

body .support-message-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 10px !important;
}

body .support-message-text {
    color: #334155 !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
}

body .support-attachments {
    margin-top: 12px !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

body .support-attachment {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 32px !important;
    padding: 0 11px !important;
    border-radius: 999px !important;
    background: #eef2ff !important;
    color: #3730a3 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

body .support-ui-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

body .support-ui-form-grid-create,
body .support-ui-form-grid-manager,
body .support-ui-form-grid-one {
    display: grid !important;
    gap: 14px !important;
}

body .support-ui-form-grid-create,
body .support-ui-form-grid-manager {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body .support-ui-form-grid-one {
    grid-template-columns: 1fr !important;
}

body .support-form-field-wide {
    grid-column: 1 / -1 !important;
}

body .support-form-field input,
body .support-form-field select,
body .support-form-field textarea {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font: inherit !important;
    box-sizing: border-box !important;
}

body .support-form-field textarea {
    min-height: 160px !important;
    resize: vertical !important;
    line-height: 1.5 !important;
}

body .support-form-field input[type="file"] {
    padding: 11px 12px !important;
    background: #f8fafc !important;
}

body .support-ui-actions {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 0 !important;
}

body .support-ui-close-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%) !important;
}

body .support-ui-close-form {
    margin: 0 !important;
    flex: 0 0 auto !important;
}

body .support-ui-empty-state,
body .support-ui-closed {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    color: #334155 !important;
    line-height: 1.5 !important;
}

@media (max-width: 980px) {
    body .support-ui-summary-grid,
    body .support-ui-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .support-ui-filter-grid,
    body .support-ui-filter-grid-manager {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body .support-ui-filter-actions {
        grid-column: 1 / -1 !important;
        justify-content: flex-end !important;
        min-width: 0 !important;
    }
}

@media (max-width: 640px) {
    body .support-ui-summary-grid,
    body .support-ui-info-grid,
    body .support-ui-filter-grid,
    body .support-ui-filter-grid-manager,
    body .support-ui-form-grid-create,
    body .support-ui-form-grid-manager {
        grid-template-columns: 1fr !important;
    }

    body .support-card-top,
    body .support-card-footer,
    body .support-message-top,
    body .support-ui-close-card,
    body .support-ui-detail-hero {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body .support-ui-hero-actions,
    body .support-ui-filter-actions,
    body .support-ui-actions {
        justify-content: flex-start !important;
    }

    body .support-ui-filter-actions .ap-action-btn,
    body .support-ui-actions .ap-action-btn,
    body .support-ui-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
    }
}

/* STEP 22 VISUAL POLISH: global spacing, public docs/FAQ and mobile stability */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

pre,
code,
.ap-table-wrap,
.ap-table,
.public-card,
.ap-work-card,
.market-clean-card,
.offer-workflow-card,
.deal-workflow-card,
.disputes-card,
.chat-card,
.support-card,
.support-detail-card,
.billing-card,
.billing-panel,
.ap-company-final-card,
.ap-object-card,
.ap-form-section {
    overflow-wrap: anywhere;
}

/* Единый воздух между крупными блоками, чтобы карточки не склеивались */
.ap-object-detail-page,
.ap-object-form-page,
.offer-deal-detail-page,
.offer-workflow-page,
.deal-workflow-page,
.disputes-workflow-page,
.chat-dialog-page,
.support-page,
.billing-page-final,
.billing-payment-page,
.ap-company-final-page,
.ap-reputation-final-page,
.manager-final-page,
.workspace-page,
.price-page,
.detail-page,
.manager-tasks-page,
.audit-page,
.audit-detail-page,
.market-workspace-page,
.market-clean-page,
.public-page,
.cms-page {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

.ap-section-hero,
.ap-workflow-hero,
.offer-workflow-header,
.deal-workflow-header,
.disputes-platform-hero,
.chat-dialog-hero,
.support-hero,
.support-detail-hero,
.billing-page-final > .ap-section-hero,
.ap-form-header,
.ap-object-hero,
.ap-company-trust-hero,
.ap-reputation-final-hero,
.workspace-header,
.manager-final-hero,
.price-header,
.detail-header,
.manager-tasks-header,
.audit-header,
.audit-detail-header {
    margin-bottom: 0 !important;
}

.ap-form-section,
.ap-object-card,
.ap-document-card,
.ap-quality-card,
.ap-history-card,
.ap-status-card,
.offer-detail-card,
.deal-detail-card,
.offer-deal-risk-card,
.offer-deal-context-card,
.dispute-detail-card,
.chat-card,
.chat-spacious-card,
.chat-notice-card,
.support-card,
.support-detail-card,
.support-thread-card,
.support-reply-card,
.billing-card,
.billing-panel,
.billing-payment-card,
.billing-method-card,
.billing-service-card,
.billing-summary-card,
.ap-company-final-status,
.ap-company-final-card,
.ap-company-final-doc-card,
.ap-company-final-history,
.ap-reputation-final-section,
.ap-reputation-final-filter,
.ap-reputation-final-event,
.ap-reputation-final-score,
.public-section,
.cms-section {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.ap-form-section + .ap-form-section,
.ap-object-card + .ap-object-card,
.offer-detail-card + .offer-detail-card,
.deal-detail-card + .deal-detail-card,
.dispute-detail-card + .dispute-detail-card,
.chat-card + .chat-card,
.support-card + .support-card,
.billing-panel + .billing-panel,
.public-section + .public-section,
.cms-section + .cms-section {
    margin-top: 0 !important;
}

.ap-form-grid,
.ap-object-form-grid,
.ap-object-summary-grid,
.ap-document-form-grid,
.ap-quality-grid,
.offer-deal-detail-grid,
.offer-detail-grid,
.deal-detail-grid,
.deal-party-grid,
.offer-deal-party-grid,
.ap-form-context-grid,
.market-final-metrics,
.market-clean-metrics,
.offer-card-metrics,
.deal-workflow-metrics,
.disputes-card-grid,
.billing-dashboard-grid,
.billing-payment-layout,
.billing-method-grid,
.billing-service-grid,
.billing-tariff-columns,
.tariff-settings-grid,
.ap-company-final-metrics,
.ap-reputation-final-metrics,
.ap-reputation-final-groups,
.ap-reputation-final-detail-grid,
.workspace-grid,
.manager-final-card-grid {
    gap: 14px !important;
}

.ap-actions,
.ap-section-actions,
.ap-form-actions,
.ap-object-actions-row,
.ap-card-actions-row,
.ap-work-actions,
.offer-filter-actions,
.deal-filter-head-actions,
.disputes-filter-actions,
.chat-actions,
.chat-form-actions,
.deal-detail-actions,
.deal-detail-actions-inline,
.offer-detail-header-actions,
.dispute-detail-actions,
.support-actions,
.billing-filter-actions,
.audit-filter-actions,
.manager-filter-actions,
.price-filter-actions {
    gap: 10px !important;
}

/* Статусный вид публичных страниц, документации и FAQ */
.public-page {
    max-width: 1160px;
    margin: 0 auto;
}

.public-hero-status {
    border: 1px solid #cdebd7;
    border-radius: 26px;
    padding: 30px;
    background:
        radial-gradient(circle at 0 0, rgba(187, 247, 208, 0.62) 0%, rgba(187, 247, 208, 0) 36%),
        linear-gradient(135deg, #f0fdf4 0%, #ffffff 54%, #eff6ff 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.075);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, max-content);
    gap: 20px;
    align-items: start;
}

.public-hero-copy {
    min-width: 0;
}

.public-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    margin-bottom: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #ffffff;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.public-title {
    margin: 0;
    color: #102018;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.public-subtitle {
    margin: 14px 0 0 0;
    max-width: 840px;
    color: #425466;
    font-size: 16px;
    line-height: 1.65;
}

.public-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    min-width: 240px;
}

.public-hero-action {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.public-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.public-trust-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid #d1fae5;
    background: rgba(255, 255, 255, 0.82);
    color: #166534;
    font-size: 12px;
    font-weight: 800;
}

.public-section-elevated {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
}

.public-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.public-section-title {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 900;
}

.public-section-lead {
    margin: 8px 0 0 0;
    max-width: 860px;
    color: #64748b;
    line-height: 1.6;
}

.public-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.public-grid-docs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-card {
    display: block;
    min-width: 0;
    min-height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.public-card-clickable:hover,
.public-card-clickable:focus-visible {
    border-color: #86efac;
    box-shadow: 0 14px 30px rgba(22, 101, 52, 0.105);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.public-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.public-card-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    font-size: 13px;
    font-weight: 900;
}

.public-card-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 800;
}

.public-card-title {
    margin: 0 0 8px 0;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 900;
}

.public-card-text {
    margin: 0;
    color: #475569;
    line-height: 1.58;
}

.public-faq-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.public-faq-list {
    display: grid;
    gap: 12px;
}

.public-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.public-faq-item[open] {
    border-color: #bbf7d0;
    box-shadow: 0 12px 26px rgba(22, 101, 52, 0.08);
}

.public-faq-question {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    gap: 12px;
    align-items: center;
    padding: 17px 18px;
    color: #0f172a;
    font-weight: 900;
}

.public-faq-question::-webkit-details-marker {
    display: none;
}

.public-faq-question::after {
    content: "+";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #166534;
    font-weight: 900;
}

.public-faq-item[open] .public-faq-question::after {
    content: "–";
    background: #dcfce7;
}

.public-faq-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #f0fdf4;
    color: #166534;
    font-size: 13px;
    font-weight: 900;
}

.public-faq-answer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 18px 18px 64px;
    color: #475569;
    line-height: 1.65;
}

.public-faq-answer p {
    margin: 0;
}

/* Старые CMS-страницы без inline-хаоса */
.cms-page {
    max-width: 1100px;
    margin: 0 auto;
}

.cms-section {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.cms-hero {
    padding: 34px;
    border-color: #cdebd7;
    background: radial-gradient(circle at 0 0, rgba(187, 247, 208, 0.55) 0%, rgba(187, 247, 208, 0) 36%), linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.cms-hero-title,
.cms-section-title {
    margin: 0;
    color: #102018;
    line-height: 1.2;
    font-weight: 900;
}

.cms-hero-title {
    font-size: clamp(28px, 4vw, 40px);
}

.cms-section-title {
    font-size: 24px;
}

.cms-hero-text,
.cms-section-text {
    margin: 12px 0 0 0;
    color: #475569;
    line-height: 1.65;
}

.cms-feature-block {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.cms-cta-block {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #102018 0%, #1f4b2c 100%);
    color: #ffffff;
}

.cms-cta-block .cms-section-title,
.cms-cta-block .cms-section-text {
    color: #ffffff;
}

/* Мобильная устойчивость */
@media (max-width: 980px) {
    main {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        margin: 12px auto !important;
        padding: 18px !important;
    }

    .public-hero-status {
        grid-template-columns: 1fr;
    }

    .public-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        width: 100%;
    }

    .public-grid,
    .public-grid-docs,
    .billing-dashboard-grid-wide,
    .billing-dashboard-grid,
    .billing-payment-layout,
    .tariff-settings-grid,
    .ap-company-final-layout,
    .ap-reputation-final-hero,
    .workspace-grid,
    .manager-final-card-grid {
        grid-template-columns: 1fr !important;
    }

    .ap-work-grid,
    .market-final-metrics,
    .market-clean-metrics,
    .offer-card-metrics,
    .deal-workflow-metrics,
    .disputes-card-grid,
    .ap-object-summary-grid,
    .ap-document-form-grid,
    .ap-quality-grid,
    .offer-deal-detail-grid,
    .offer-detail-grid,
    .deal-detail-grid,
    .deal-party-grid,
    .offer-deal-party-grid,
    .ap-form-context-grid,
    .ap-company-final-metrics,
    .ap-reputation-final-metrics,
    .ap-reputation-final-groups,
    .ap-reputation-final-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    header {
        padding: 14px 16px !important;
    }

    .header-top {
        align-items: flex-start !important;
    }

    .brand {
        font-size: 18px !important;
    }

    .header-user {
        width: 100%;
        line-height: 1.45;
    }

    nav {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    nav a,
    .nav-summary,
    .logout-btn {
        min-height: 38px;
        align-items: center;
    }

    .nav-dropdown-menu {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        box-shadow: none !important;
    }

    main {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        margin: 8px auto !important;
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .public-page,
    .cms-page,
    .ap-object-detail-page,
    .ap-object-form-page,
    .offer-deal-detail-page,
    .offer-workflow-page,
    .deal-workflow-page,
    .disputes-workflow-page,
    .chat-dialog-page,
    .support-page,
    .billing-page-final,
    .ap-company-final-page,
    .ap-reputation-final-page,
    .manager-final-page,
    .workspace-page,
    .market-workspace-page,
    .market-clean-page {
        gap: 16px !important;
    }

    .public-hero-status,
    .public-section-elevated,
    .cms-section,
    .ap-section-hero,
    .ap-workflow-hero,
    .ap-form-header,
    .offer-workflow-header,
    .deal-workflow-header,
    .disputes-platform-hero,
    .chat-dialog-hero,
    .support-hero,
    .support-detail-hero,
    .billing-page-final > .ap-section-hero,
    .workspace-header,
    .manager-final-hero {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .public-hero-actions {
        grid-template-columns: 1fr;
    }

    .public-trust-row {
        flex-direction: column;
        align-items: stretch;
    }

    .public-trust-row span {
        justify-content: center;
        text-align: center;
    }

    .public-section-head,
    .ap-page-header,
    .ap-form-footer,
    .offer-card-title-row,
    .deal-workflow-card-title-row,
    .disputes-card-head,
    .offer-detail-section-head,
    .deal-detail-section-head,
    .dispute-card-heading,
    .chat-section-head,
    .support-card-top,
    .support-card-footer {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .ap-actions,
    .ap-section-actions,
    .ap-form-actions,
    .ap-object-actions-row,
    .ap-card-actions-row,
    .ap-work-actions,
    .offer-filter-actions,
    .deal-filter-head-actions,
    .disputes-filter-actions,
    .chat-actions,
    .chat-form-actions,
    .deal-detail-actions,
    .deal-detail-actions-inline,
    .offer-detail-header-actions,
    .dispute-detail-actions,
    .support-actions,
    .billing-filter-actions,
    .audit-filter-actions,
    .manager-filter-actions,
    .price-filter-actions,
    .public-hero-actions {
        width: 100% !important;
        justify-content: stretch !important;
    }

    .ap-actions .ap-action-btn,
    .ap-section-actions .ap-action-btn,
    .ap-form-actions .ap-action-btn,
    .ap-object-actions-row .ap-action-btn,
    .ap-card-actions-row .ap-action-btn,
    .ap-work-actions .ap-action-btn,
    .offer-filter-actions .ap-action-btn,
    .deal-filter-head-actions .ap-action-btn,
    .disputes-filter-actions .ap-action-btn,
    .chat-actions .ap-action-btn,
    .chat-form-actions .ap-action-btn,
    .deal-detail-actions .ap-action-btn,
    .deal-detail-actions-inline .ap-action-btn,
    .offer-detail-header-actions .ap-action-btn,
    .dispute-detail-actions .ap-action-btn,
    .support-actions .ap-action-btn,
    .billing-filter-actions .ap-action-btn,
    .audit-filter-actions .ap-action-btn,
    .manager-filter-actions .ap-action-btn,
    .price-filter-actions .ap-action-btn,
    .public-hero-actions .ap-action-btn,
    .ap-actions .btn,
    .ap-form-actions .btn,
    .support-actions .btn,
    .billing-filter-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .ap-work-grid,
    .market-final-metrics,
    .market-clean-metrics,
    .offer-card-metrics,
    .deal-workflow-metrics,
    .disputes-card-grid,
    .ap-object-summary-grid,
    .ap-document-form-grid,
    .ap-quality-grid,
    .offer-deal-detail-grid,
    .offer-detail-grid,
    .deal-detail-grid,
    .deal-party-grid,
    .offer-deal-party-grid,
    .ap-form-context-grid,
    .ap-company-final-metrics,
    .ap-reputation-final-metrics,
    .ap-reputation-final-groups,
    .ap-reputation-final-detail-grid,
    .ap-form-grid-two,
    .ap-object-form-grid,
    .billing-method-grid,
    .billing-service-grid,
    .billing-metric-grid,
    .tariff-settings-fields,
    .tariff-settings-checks,
    .public-grid,
    .public-grid-docs {
        grid-template-columns: 1fr !important;
    }

    .public-faq-question {
        grid-template-columns: 30px minmax(0, 1fr) 22px;
        gap: 10px;
        padding: 15px;
    }

    .public-faq-answer {
        padding: 14px 15px 16px 55px;
    }

    .public-card,
    .cms-section,
    .ap-form-section,
    .ap-object-card,
    .offer-detail-card,
    .deal-detail-card,
    .dispute-detail-card,
    .chat-card,
    .support-card,
    .billing-panel,
    .ap-company-final-card {
        padding: 16px !important;
        border-radius: 16px !important;
    }
}


/* STEP22B_BUSINESS_DOCS_MOBILE_START */
:root {
    --ap-business-ink: #102018;
    --ap-business-muted: #526173;
    --ap-business-line: #dbe3ea;
    --ap-business-soft: #f7f9fb;
    --ap-business-accent: #1f4b2c;
}

.public-page-business { display: flex; flex-direction: column; gap: 18px; max-width: 1120px; margin: 0 auto; }
.public-business-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 28px; border: 1px solid var(--ap-business-line); border-radius: 18px; background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055); box-sizing: border-box; }
.public-business-hero-main { min-width: 0; }
.public-business-kicker { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; margin-bottom: 12px; border-radius: 999px; border: 1px solid #cfdad2; background: #ffffff; color: var(--ap-business-accent); font-size: 12px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.public-business-title { margin: 0; color: var(--ap-business-ink); font-size: 32px; line-height: 1.15; font-weight: 850; letter-spacing: -0.02em; }
.public-business-subtitle { margin: 12px 0 0 0; max-width: 820px; color: var(--ap-business-muted); font-size: 15px; line-height: 1.6; }
.public-business-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.public-business-meta-row span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #eef4f0; color: #315242; border: 1px solid #d6e5dc; font-size: 12px; font-weight: 750; }
.public-business-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: flex-start; min-width: 280px; }
.public-business-action { width: 154px !important; min-width: 154px !important; max-width: 154px !important; }
.public-business-section { padding: 22px; border: 1px solid var(--ap-business-line); border-radius: 18px; background: #ffffff; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045); box-sizing: border-box; }
.public-business-section-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.public-business-section-title { margin: 0; color: var(--ap-business-ink); font-size: 22px; line-height: 1.2; font-weight: 850; }
.public-business-section-lead { margin: 8px 0 0 0; max-width: 860px; color: var(--ap-business-muted); font-size: 14px; line-height: 1.6; }
.public-business-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.public-business-grid-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.public-business-card { display: block; min-width: 0; padding: 17px; border: 1px solid #e1e7ed; border-radius: 14px; background: var(--ap-business-soft); color: inherit; text-decoration: none; box-sizing: border-box; }
.public-business-card-clickable { transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease; }
.public-business-card-clickable:hover, .public-business-card-clickable:focus-visible { color: inherit; text-decoration: none; border-color: #b9d2c2; background: #ffffff; box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.public-business-card-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #6b7684; font-size: 11px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.public-business-card-title { margin: 0; color: var(--ap-business-ink); font-size: 17px; line-height: 1.3; font-weight: 850; }
.public-business-card-text { margin: 8px 0 0 0; color: var(--ap-business-muted); font-size: 14px; line-height: 1.55; }
.public-business-faq-list { display: grid; gap: 10px; }
.public-business-faq-item { border: 1px solid #dfe7ee; border-radius: 14px; background: #ffffff; overflow: hidden; }
.public-business-faq-question { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 54px; padding: 0 16px; cursor: pointer; color: var(--ap-business-ink); font-size: 15px; font-weight: 850; list-style: none; }
.public-business-faq-question::-webkit-details-marker { display: none; }
.public-business-faq-index { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; background: #eef4f0; color: var(--ap-business-accent); border: 1px solid #d6e5dc; font-size: 12px; font-weight: 900; }
.public-business-faq-answer { padding: 0 16px 16px 62px; color: var(--ap-business-muted); line-height: 1.6; }
.public-business-faq-answer p { margin: 0; }
.public-business-rich-text { color: var(--ap-business-muted); font-size: 15px; line-height: 1.65; }
.public-business-rich-text p { margin: 0 0 12px 0; }
.public-business-cta-section { border-color: #c7d9ce; background: #f6faf7; }

.ap-form-page, .ap-object-detail-page, .ap-object-form-page, .offer-deal-detail-page, .deal-workflow-detail, .dispute-detail-page, .chat-dialog-page, .support-page, .billing-page-final, .manager-final-page, .workspace-page, .market-clean-page { gap: 20px !important; }
.ap-form-section, .ap-object-card, .ap-form-card, .offer-detail-card, .deal-detail-card, .dispute-detail-card, .chat-card, .chat-spacious-card, .support-card, .support-detail-card, .billing-panel, .billing-card, .manager-final-card, .ap-work-card { margin-bottom: 0; }
.ap-card-actions-row, .ap-form-actions, .ap-object-actions-row, .offer-deal-detail-actions, .deal-detail-actions, .dispute-detail-actions, .chat-form-actions, .support-actions, .billing-filter-actions, .manager-filter-actions { row-gap: 10px !important; }

@media (max-width: 760px) {
    body { overflow-x: hidden; }
    header { position: sticky; top: 0; z-index: 90; padding: 9px 10px 8px 10px !important; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18); }
    .header-top { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important; min-width: 0; }
    .brand { flex: 0 0 auto; font-size: 17px !important; line-height: 1.1; white-space: nowrap; }
    .header-user { flex: 1 1 auto; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 11px !important; line-height: 1.25; opacity: 0.82; }
    nav { margin-top: 8px !important; display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 6px !important; overflow-x: auto !important; overflow-y: visible !important; padding: 0 2px 4px 0 !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    nav::-webkit-scrollbar { display: none; }
    nav a, .nav-summary, .logout-btn { flex: 0 0 auto !important; min-height: 30px !important; padding: 0 10px !important; margin: 0 !important; border-radius: 999px; background: rgba(255, 255, 255, 0.10); color: #ffffff !important; font-size: 13px !important; line-height: 30px !important; white-space: nowrap !important; text-decoration: none !important; }
    .logout-form { flex: 0 0 auto !important; display: inline-flex !important; margin: 0 !important; }
    .nav-dropdown { position: relative !important; display: inline-flex !important; flex: 0 0 auto !important; width: auto !important; min-width: auto !important; flex-direction: row !important; align-items: center !important; }
    .nav-dropdown-menu { position: fixed !important; top: 82px !important; left: 10px !important; right: 10px !important; width: auto !important; min-width: 0 !important; max-height: min(68vh, 520px) !important; overflow-y: auto !important; padding: 8px !important; border-radius: 14px !important; box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28) !important; }
    .nav-dropdown-menu a { min-height: 40px !important; padding: 0 12px !important; border-radius: 10px !important; background: transparent !important; color: #111827 !important; line-height: 40px !important; font-size: 14px !important; }
    main { width: auto !important; max-width: none !important; margin: 10px !important; padding: 14px !important; border-radius: 14px !important; }
    .site-footer { margin: 0 10px 10px 10px !important; padding: 0 !important; }
    .site-footer-inner { padding: 14px !important; border-radius: 14px !important; }
    .public-business-hero { grid-template-columns: 1fr; gap: 14px; padding: 18px; border-radius: 16px; }
    .public-business-title { font-size: 25px; }
    .public-business-actions { min-width: 0; width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
    .public-business-action { width: auto !important; min-width: 128px !important; max-width: none !important; flex: 0 0 auto !important; }
    .public-business-section { padding: 16px; border-radius: 16px; }
    .public-business-grid, .public-business-grid-docs { grid-template-columns: 1fr; }
    .public-business-faq-question { grid-template-columns: 30px minmax(0, 1fr); min-height: 50px; padding: 0 12px; font-size: 14px; }
    .public-business-faq-answer { padding: 0 12px 14px 54px; }
    .ap-action-btn, a.ap-action-btn, button.ap-action-btn { min-width: 118px; }
    .ap-table-wrap, .ap-table, table { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 420px) {
    .header-user { display: none; }
    .brand { font-size: 16px !important; }
    .nav-dropdown-menu { top: 76px !important; }
    nav a, .nav-summary, .logout-btn { font-size: 12px !important; min-height: 29px !important; line-height: 29px !important; padding: 0 9px !important; }
}

/* Service pages polish: deal cancel, deal chat, deal dispute panel */
.deal-cancel-page,
.deal-chat-page {
    display: grid;
    gap: 18px;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
}

.deal-cancel-page {
    max-width: 820px;
}

.deal-cancel-hero,
.deal-chat-hero {
    padding: 22px 24px;
    border: 1px solid #dbe7df;
    border-left: 5px solid #1f4b2c;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
}

.deal-cancel-hero h1,
.deal-chat-hero h1 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    line-height: 1.18;
    font-weight: 900;
}

.deal-cancel-alert,
.deal-chat-alert,
.deal-dispute-panel-note {
    padding: 14px 16px;
    border: 1px solid #fde68a;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    line-height: 1.55;
    box-sizing: border-box;
}

.deal-chat-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.deal-cancel-form-card,
.deal-chat-form-card,
.deal-chat-participants-card,
.deal-chat-history-card,
.deal-dispute-panel {
    border: 1px solid #dbe7df;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
    box-sizing: border-box;
}

.deal-cancel-form-card,
.deal-chat-form-card,
.deal-chat-history-card {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.deal-cancel-field,
.deal-chat-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.deal-cancel-field label {
    color: #24332b;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 850;
}

.deal-cancel-field input,
.deal-cancel-field select,
.deal-cancel-field textarea,
.deal-chat-field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.deal-cancel-field input[type="file"] {
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.deal-cancel-help,
.deal-chat-message-meta,
.deal-dispute-panel-muted {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

.deal-cancel-error,
.deal-chat-error {
    color: #991b1b;
    font-size: 13px;
    line-height: 1.4;
}

.deal-cancel-actions,
.deal-chat-actions,
.deal-dispute-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.deal-chat-participants-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.deal-chat-participant {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.deal-chat-participant span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.deal-chat-participant strong {
    min-width: 0;
    color: #111827;
    overflow-wrap: anywhere;
}

.deal-chat-messages {
    display: grid;
    gap: 12px;
}

.deal-chat-page .deal-chat-message {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px;
    background: #ffffff !important;
    box-sizing: border-box;
}

.deal-chat-page .deal-chat-message-own {
    border: 1px solid #bbf7d0 !important;
    background: #f0fdf4 !important;
}

.deal-chat-page .deal-chat-message-system {
    border: 1px solid #bfdbfe !important;
    background: #eff6ff !important;
}

.deal-chat-message-author {
    color: #17211c;
    font-weight: 850;
}

.deal-chat-message-text {
    color: #24332b;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.deal-chat-empty {
    padding: 14px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #6b7280;
}

.deal-chat-field textarea {
    min-height: 132px;
    resize: vertical;
}

.deal-dispute-panel {
    margin: 22px 0;
    overflow: hidden;
}

.deal-dispute-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.deal-dispute-panel-title {
    color: #17211c;
    font-weight: 850;
}

.deal-dispute-panel-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.deal-dispute-panel-status-active {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.deal-dispute-panel-status-available {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.deal-dispute-panel-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.deal-dispute-panel-line,
.deal-dispute-panel-text,
.deal-dispute-panel-muted {
    margin: 0;
    line-height: 1.55;
}

.deal-dispute-panel-note-response {
    border-color: #e5e7eb;
    background: #f8fafc;
    color: #374151;
}

.deal-dispute-panel-note-decision {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.deal-dispute-panel-note-body {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .deal-cancel-page,
    .deal-chat-page {
        gap: 14px;
    }

    .deal-cancel-hero,
    .deal-chat-hero,
    .deal-cancel-form-card,
    .deal-chat-form-card,
    .deal-chat-history-card,
    .deal-chat-participants-card,
    .deal-dispute-panel-body {
        padding: 16px;
    }

    .deal-cancel-hero h1,
    .deal-chat-hero h1 {
        font-size: 24px;
        overflow-wrap: anywhere;
    }

    .deal-chat-participants-card {
        grid-template-columns: 1fr;
    }

    .deal-cancel-actions,
    .deal-chat-actions,
    .deal-dispute-panel-actions {
        align-items: stretch;
    }

    .deal-cancel-actions .ap-action-btn,
    .deal-chat-actions .ap-action-btn,
    .deal-dispute-panel-actions .ap-action-btn {
        width: 100%;
    }

    .deal-dispute-panel-head {
        align-items: flex-start;
        padding: 14px 16px;
    }
}

/* visual_polish_2_1_mobile_header_and_badges */
@media (max-width: 768px) {
    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 10px !important;
        min-height: 0 !important;
        padding: 14px 16px !important;
        margin-bottom: 0 !important;
    }

    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero .offer-deal-detail-hero-text {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero .deal-detail-title {
        margin: 0 0 4px 0 !important;
        font-size: 24px !important;
        line-height: 1.15 !important;
        overflow-wrap: anywhere !important;
    }

    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero .deal-detail-subtitle {
        margin: 0 !important;
        max-width: 100% !important;
        line-height: 1.35 !important;
    }

    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero .deal-detail-actions {
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 8px !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    .deal-workflow-detail .deal-detail-header.offer-deal-detail-hero .deal-detail-actions .ap-action-btn {
        width: auto !important;
        max-width: 100% !important;
    }

    .offer-deal-risk-card {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .offer-deal-risk-card > section {
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .offer-deal-risk-card section,
    .offer-deal-risk-card div,
    .offer-deal-risk-card strong,
    .offer-deal-risk-card summary,
    .offer-deal-risk-card span {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
    }

    .offer-deal-risk-card div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .offer-deal-risk-card span[style*="border-radius:999px"] {
        align-self: flex-start !important;
        flex: 0 1 auto !important;
        height: auto !important;
        min-height: 28px !important;
        padding: 6px 10px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        text-align: center !important;
        word-break: normal !important;
    }

    .offer-deal-risk-card summary {
        line-height: 1.35 !important;
        white-space: normal !important;
    }
}

/* Small visual polish: status badge geometry and dashboard mini facts */
.market-object-status-badge,
.offer-stage-badge,
.deal-stage-badge,
.dispute-status-badge,
.support-status,
.billing-status-badge,
.notification-pill,
.notification-status,
.notification-pill-new {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 28px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.dashboard-mini-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin: 7px 0 0;
}

.dashboard-mini-fact {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid #d8e0dc;
    border-radius: 999px;
    background: #ffffff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: normal;
    box-sizing: border-box;
}

.dashboard-mini-fact-status {
    font-weight: 850;
}

@media (max-width: 640px) {
    .dashboard-mini-facts {
        gap: 5px;
    }

    .dashboard-mini-fact {
        min-height: 23px;
        padding: 0 7px;
    }
}

/* Mobile-only collapsible list cards */
.ap-mobile-card-toggle,
.ap-mobile-card-summary {
    display: none;
}

@media (max-width: 768px) {
    .ap-mobile-collapsible-card {
        position: relative;
    }

    body .ap-mobile-collapsible-card:not(.is-mobile-expanded) {
        min-height: 0 !important;
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    .ap-mobile-collapsible-card .ap-mobile-card-toggle-zone {
        cursor: pointer;
        padding-left: 30px !important;
    }

    .ap-mobile-card-toggle {
        position: absolute;
        top: 18px;
        left: 14px;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #166534;
        cursor: pointer;
    }

    .ap-mobile-card-toggle::before {
        content: "";
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-left: 8px solid currentColor;
        transition: transform 0.16s ease;
    }

    .ap-mobile-collapsible-card.is-mobile-expanded .ap-mobile-card-toggle::before {
        transform: rotate(90deg);
    }

    .ap-mobile-collapsible-card:not(.is-mobile-expanded) .ap-mobile-card-toggle-zone {
        display: none !important;
    }

    .ap-mobile-collapsible-card:not(.is-mobile-expanded) .ap-mobile-card-summary {
        display: -webkit-box;
        min-width: 0;
        min-height: 22px;
        margin: 0;
        padding: 1px 0 1px 30px;
        color: #17211c;
        font-size: 14px;
        line-height: 1.35;
        font-weight: 850;
        cursor: pointer;
        overflow-wrap: anywhere;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    .ap-mobile-collapsible-card.is-mobile-expanded .ap-mobile-card-summary {
        display: none;
    }

    .ap-mobile-collapsible-card:not(.is-mobile-expanded) .ap-mobile-collapse-body {
        display: none !important;
    }

    .ap-mobile-collapsible-card.is-mobile-expanded .ap-mobile-collapse-body {
        display: block;
        margin-top: 12px;
    }
}

/* STEP22B_BUSINESS_DOCS_MOBILE_END */

/* AA2.0-1: mobile quality forms hotfix */
@media (max-width: 768px) {
    body .ap-quality-edit-page,
    body .ap-lot-quality-edit-page,
    body .ap-buy-request-quality-edit-page,
    body .ap-quality-edit-page .ap-quality-edit-form,
    body .ap-quality-edit-page .ap-workflow-form,
    body .ap-quality-edit-page .ap-quality-context-card,
    body .ap-quality-edit-page .ap-quality-context-grid,
    body .ap-quality-edit-page .ap-quality-context-item,
    body .ap-quality-edit-page .ap-quality-error-card,
    body .ap-quality-edit-page .ap-quality-edit-card,
    body .ap-quality-edit-page .ap-quality-edit-head,
    body .ap-quality-edit-page .ap-quality-table-wrap,
    body .ap-quality-edit-page .ap-quality-table,
    body .ap-quality-edit-page .ap-quality-edit-item,
    body .ap-quality-edit-page .ap-quality-param-cell,
    body .ap-quality-edit-page .ap-quality-type-cell,
    body .ap-quality-edit-page .ap-quality-range-cell,
    body .ap-quality-edit-page .ap-quality-value-cell {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body .ap-quality-edit-page,
    body .ap-quality-edit-page .ap-quality-edit-form {
        width: 100% !important;
    }

    body .ap-quality-edit-page .ap-quality-context-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .ap-quality-edit-page .ap-quality-context-item,
    body .ap-quality-edit-page .ap-quality-context-item span,
    body .ap-quality-edit-page .ap-quality-context-item strong,
    body .ap-quality-edit-page .ap-quality-edit-head,
    body .ap-quality-edit-page .ap-quality-edit-head h2,
    body .ap-quality-edit-page .ap-quality-edit-head p,
    body .ap-quality-edit-page .ap-quality-param-cell,
    body .ap-quality-edit-page .ap-quality-type-cell,
    body .ap-quality-edit-page .ap-quality-range-cell,
    body .ap-quality-edit-page .ap-quality-value-cell,
    body .ap-quality-edit-page .ap-quality-param-name,
    body .ap-quality-edit-page .ap-quality-param-name strong,
    body .ap-quality-edit-page .ap-quality-help,
    body .ap-quality-edit-page .ap-quality-range,
    body .ap-quality-edit-page .ap-quality-table-mobile-caption {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    body .ap-quality-edit-page .ap-quality-table-wrap {
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    body .ap-quality-edit-page .ap-quality-table {
        width: max-content !important;
        min-width: 680px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body .ap-quality-edit-page .ap-quality-table th,
    body .ap-quality-edit-page .ap-quality-table td {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    body .ap-quality-edit-page .ap-quality-param-cell {
        width: 34% !important;
    }

    body .ap-quality-edit-page .ap-quality-type-cell {
        width: 20% !important;
    }

    body .ap-quality-edit-page .ap-quality-range-cell {
        width: 20% !important;
    }

    body .ap-quality-edit-page .ap-quality-value-cell {
        width: 26% !important;
    }

    body .ap-quality-edit-page .ap-quality-param-name strong {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        min-width: 0 !important;
    }

    body .ap-quality-edit-page .ap-quality-required-badge,
    body .ap-quality-edit-page .ap-quality-optional-badge,
    body .ap-quality-edit-page .ap-quality-table .ap-quality-range {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.25 !important;
        text-align: center !important;
    }

    body .ap-quality-edit-page .ap-quality-value-cell .ap-quality-input,
    body .ap-quality-edit-page .ap-quality-input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

@media (max-width: 520px) {
    body .ap-quality-edit-page .ap-quality-table {
        min-width: 600px !important;
    }

    body .ap-quality-edit-page .ap-quality-table th,
    body .ap-quality-edit-page .ap-quality-table td {
        padding: 12px 10px !important;
    }

    body .ap-quality-edit-page .ap-quality-required-badge,
    body .ap-quality-edit-page .ap-quality-optional-badge,
    body .ap-quality-edit-page .ap-quality-table .ap-quality-range {
        padding: 6px 8px !important;
    }
}

/* AA2.0-1.1: compact mobile quality table */
body .ap-quality-edit-page .ap-quality-input-caption,
body .ap-quality-edit-page .ap-quality-table-mobile-caption {
    display: none !important;
}

@media (max-width: 768px) {
    body .ap-quality-edit-page .ap-quality-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    body .ap-quality-edit-page .ap-quality-table th:nth-child(2),
    body .ap-quality-edit-page .ap-quality-table th:nth-child(3),
    body .ap-quality-edit-page .ap-quality-table td.ap-quality-type-cell,
    body .ap-quality-edit-page .ap-quality-table td.ap-quality-range-cell,
    body .ap-quality-edit-page .ap-quality-table col:nth-child(2),
    body .ap-quality-edit-page .ap-quality-table col:nth-child(3) {
        display: none !important;
    }

    body .ap-quality-edit-page .ap-quality-table th:nth-child(1),
    body .ap-quality-edit-page .ap-quality-table td:nth-child(1) {
        width: 58% !important;
    }

    body .ap-quality-edit-page .ap-quality-table th:nth-child(4),
    body .ap-quality-edit-page .ap-quality-table td.ap-quality-value-cell {
        width: 42% !important;
    }
}

/* AA2.0-1.2: mobile quality table actual structure fix */
@media (max-width: 768px) {
    body .ap-quality-edit-page table.ap-quality-table col.ap-quality-col-type,
    body .ap-quality-edit-page table.ap-quality-table col.ap-quality-col-range {
        visibility: collapse !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }

    body .ap-quality-edit-page table.ap-quality-table th.ap-quality-type-head,
    body .ap-quality-edit-page table.ap-quality-table th.ap-quality-range-head,
    body .ap-quality-edit-page table.ap-quality-table td.ap-quality-type-cell,
    body .ap-quality-edit-page table.ap-quality-table td.ap-quality-range-cell {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    body .ap-quality-edit-page table.ap-quality-table col.ap-quality-col-param {
        width: 64% !important;
    }

    body .ap-quality-edit-page table.ap-quality-table col.ap-quality-col-value {
        width: 36% !important;
    }

    body .ap-quality-edit-page table.ap-quality-table th.ap-quality-param-head,
    body .ap-quality-edit-page table.ap-quality-table td.ap-quality-param-cell {
        width: 64% !important;
    }

    body .ap-quality-edit-page table.ap-quality-table th.ap-quality-value-head,
    body .ap-quality-edit-page table.ap-quality-table td.ap-quality-value-cell {
        width: 36% !important;
    }

    body .ap-quality-edit-page table.ap-quality-table td.ap-quality-value-cell .ap-quality-input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/* AA2.0-2B: action buttons alignment */
body .ap-lot-detail-page .ap-object-actions-row form,
body .ap-buy-request-detail-page .ap-object-actions-row form,
body .ap-lot-detail-page form.ap-card-actions-row,
body .ap-buy-request-detail-page form.ap-card-actions-row,
body .ap-lot-detail-page .ap-card-actions-row form,
body .ap-buy-request-detail-page .ap-card-actions-row form {
    display: inline-flex !important;
    align-items: stretch !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body .ap-lot-detail-page .ap-object-actions-row form .ap-action-btn,
body .ap-buy-request-detail-page .ap-object-actions-row form .ap-action-btn,
body .ap-lot-detail-page form.ap-card-actions-row .ap-action-btn,
body .ap-buy-request-detail-page form.ap-card-actions-row .ap-action-btn,
body .ap-lot-detail-page .ap-card-actions-row form .ap-action-btn,
body .ap-buy-request-detail-page .ap-card-actions-row form .ap-action-btn {
    min-height: var(--ap-button-height, 42px) !important;
    height: auto !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    body .ap-lot-detail-page .ap-object-actions-row form,
    body .ap-buy-request-detail-page .ap-object-actions-row form,
    body .ap-lot-detail-page form.ap-card-actions-row,
    body .ap-buy-request-detail-page form.ap-card-actions-row,
    body .ap-lot-detail-page .ap-card-actions-row form,
    body .ap-buy-request-detail-page .ap-card-actions-row form {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
}

/* AA2.0-3B — price approval decision summary */
body .price-approval-decision-summary {
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 0 18px;
    padding: 18px;
    display: grid;
    gap: 16px;
    border: 1px solid #bfdbfe;
    border-left: 6px solid #2563eb;
    border-radius: 18px;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    overflow-wrap: anywhere;
}

body .price-approval-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    min-width: 0;
}

body .price-approval-summary-title-block {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body .price-approval-summary-eyebrow {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
}

body .price-approval-summary-title {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

body .price-approval-summary-subtitle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

body .price-approval-summary-chip,
body .price-approval-summary-status {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

body .price-approval-summary-status {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

body .price-approval-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

body .price-approval-summary-card {
    box-sizing: border-box;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

body .price-approval-summary-card-price {
    border-color: #bfdbfe;
    background: #f8fbff;
}

body .price-approval-summary-card h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: 0;
}

body .price-approval-summary-facts {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body .price-approval-summary-fact {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.35;
}

body .price-approval-summary-fact span,
body .price-approval-summary-fact strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

body .price-approval-summary-fact strong {
    color: #111827;
    font-weight: 900;
    text-align: right;
}

body .price-approval-summary-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
    body .price-approval-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body .price-approval-decision-summary {
        padding: 14px;
        border-radius: 14px;
    }

    body .price-approval-summary-title {
        font-size: 20px;
    }

    body .price-approval-summary-grid {
        grid-template-columns: 1fr;
    }

    body .price-approval-summary-card {
        padding: 12px;
    }

    body .price-approval-summary-fact {
        display: grid;
        gap: 3px;
    }

    body .price-approval-summary-fact strong {
        text-align: left;
    }
}

/* AA2.0-3C — moderation entry decision summary and quick action */
body .moderation-entry-decision-summary {
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 0 18px;
    padding: 18px;
    display: grid;
    gap: 16px;
    border: 1px solid #bbf7d0;
    border-left: 6px solid #16a34a;
    border-radius: 18px;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    overflow-wrap: anywhere;
}

body .moderation-entry-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    min-width: 0;
}

body .moderation-entry-summary-title-block {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body .moderation-entry-summary-eyebrow {
    color: #15803d;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
}

body .moderation-entry-summary-title {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

body .moderation-entry-summary-subtitle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

body .moderation-entry-summary-chip,
body .moderation-entry-summary-status {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #dcfce7;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

body .moderation-entry-summary-status {
    border-color: #16a34a;
    background: #16a34a;
    color: #ffffff;
}

body .moderation-entry-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

body .moderation-entry-summary-card {
    box-sizing: border-box;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

body .moderation-entry-summary-card-price {
    border-color: #bbf7d0;
    background: #f8fff9;
}

body .moderation-entry-summary-card h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: 0;
}

body .moderation-entry-summary-facts {
    display: grid;
    gap: 8px;
    min-width: 0;
}

body .moderation-entry-summary-fact {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.35;
}

body .moderation-entry-summary-fact span,
body .moderation-entry-summary-fact strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

body .moderation-entry-summary-fact strong {
    color: #111827;
    font-weight: 900;
    text-align: right;
}

body .moderation-entry-summary-note {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

body .moderation-entry-summary-note + .moderation-entry-summary-note {
    margin-top: 10px;
}

body .moderation-entry-summary-note-secondary {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

body .moderation-entry-quick-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}

body .moderation-entry-quick-action-form {
    display: inline-flex;
    margin: 0;
    min-width: 0;
}

body .moderation-entry-quick-approve {
    min-height: 38px;
    white-space: normal;
}

@media (max-width: 1180px) {
    body .moderation-entry-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body .moderation-entry-decision-summary {
        padding: 14px;
        border-radius: 14px;
    }

    body .moderation-entry-summary-title {
        font-size: 20px;
    }

    body .moderation-entry-summary-grid {
        grid-template-columns: 1fr;
    }

    body .moderation-entry-summary-card {
        padding: 12px;
    }

    body .moderation-entry-summary-fact {
        display: grid;
        gap: 3px;
    }

    body .moderation-entry-summary-fact strong {
        text-align: left;
    }

    body .moderation-entry-quick-actions,
    body .moderation-entry-quick-action-form,
    body .moderation-entry-quick-approve {
        width: 100%;
    }
}

/* AA2.0-3D — business style moderation decision summary */
body .moderation-entry-decision-summary {
    padding: 22px;
    gap: 18px;
    border: 1px solid #d8dee8;
    border-left: 5px solid #475569;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
    color: #111827;
}

body .moderation-entry-decision-summary,
body .moderation-entry-decision-summary * {
    word-break: normal;
    overflow-wrap: break-word;
}

body .moderation-entry-summary-head {
    display: block;
}

body .moderation-entry-summary-title-block {
    gap: 6px;
}

body .moderation-entry-summary-eyebrow {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

body .moderation-entry-summary-title {
    max-width: 880px;
    color: #0f172a;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.18;
}

body .moderation-entry-summary-table {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    overflow: hidden;
}

body .moderation-entry-summary-table-item {
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid #e2e8f0;
    background: #ffffff;
}

body .moderation-entry-summary-table-item:last-child {
    border-right: 0;
}

body .moderation-entry-summary-table-item dt {
    margin: 0 0 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

body .moderation-entry-summary-table-item dd {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

body .moderation-entry-summary-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
}

body .moderation-entry-summary-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

body .moderation-entry-summary-card-price {
    border-color: #d8dee8;
    background: #fbfdff;
}

body .moderation-entry-summary-card h3 {
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}

body .moderation-entry-summary-facts {
    gap: 10px;
}

body .moderation-entry-summary-fact {
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
    color: #64748b;
    font-size: 13px;
}

body .moderation-entry-summary-fact:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

body .moderation-entry-summary-fact span {
    flex: 0 0 42%;
    font-weight: 700;
}

body .moderation-entry-summary-fact strong {
    flex: 1 1 auto;
    color: #0f172a;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body .moderation-entry-summary-note {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 900px) {
    body .moderation-entry-summary-table {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .moderation-entry-summary-table-item {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    body .moderation-entry-summary-table-item:nth-child(odd) {
        border-right: 1px solid #e2e8f0;
    }

    body .moderation-entry-summary-table-item:nth-last-child(-n+1) {
        border-bottom: 0;
    }

    body .moderation-entry-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body .moderation-entry-decision-summary {
        padding: 16px;
        border-radius: 14px;
    }

    body .moderation-entry-summary-title {
        font-size: 21px;
    }

    body .moderation-entry-summary-table {
        grid-template-columns: 1fr;
    }

    body .moderation-entry-summary-table-item,
    body .moderation-entry-summary-table-item:nth-child(odd) {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    body .moderation-entry-summary-table-item:last-child {
        border-bottom: 0;
    }

    body .moderation-entry-summary-table-item dd {
        font-size: 15px;
    }

    body .moderation-entry-summary-fact {
        display: grid;
        gap: 4px;
    }

body .moderation-entry-summary-fact span,
    body .moderation-entry-summary-fact strong {
        flex: none;
        text-align: left;
    }
}

/* AA2.0-6F-2: document view for public legal pages */
body .ap-legal-document-page {
    display: grid;
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
}

body .ap-legal-document-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    background: #f8fafc !important;
    border: 1px solid #dbe5ef !important;
    box-shadow: none !important;
    color: #0f172a;
}

body .ap-legal-document-hero::before,
body .ap-legal-document-hero::after {
    content: none !important;
    display: none !important;
}

body .ap-legal-document-hero .ap-section-title {
    color: #0f172a;
}

body .ap-legal-document-hero .ap-section-subtitle {
    color: #475569;
}

body .ap-legal-document-actions,
body .ap-legal-document-footer,
body .ap-legal-document-pdf-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    row-gap: 12px !important;
    column-gap: 14px !important;
    align-items: center !important;
    justify-content: flex-start;
}

body .ap-legal-document-actions .ap-action-btn,
body .ap-legal-document-footer .ap-action-btn,
body .ap-legal-document-pdf-actions .ap-action-btn {
    flex: 0 1 auto !important;
    margin: 0 !important;
    min-height: 42px !important;
}

body .ap-legal-document-sheet {
    display: grid;
    gap: 26px;
    padding: 28px;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    overflow: hidden;
}

body .ap-legal-document-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 18px;
    align-items: start;
    padding: 16px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #f8fafc !important;
    box-shadow: none !important;
}

body .ap-legal-document-header h2,
body .ap-legal-document-section h3,
body .ap-legal-document-item h4 {
    margin: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

body .ap-legal-document-header h2 {
    font-size: 24px;
    line-height: 1.25;
}

body .ap-legal-document-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    align-self: start;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    min-width: 0;
}

body .ap-legal-document-meta-item {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-bottom: 7px;
    border-bottom: 1px solid #e2e8f0;
}

body .ap-legal-document-meta-item-operator {
    grid-column: 1 / -1;
    padding-bottom: 0;
    border-bottom: 0;
}

body .ap-legal-document-meta-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

body .ap-legal-document-meta-value {
    margin: 0;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body .ap-legal-document-section,
body .ap-legal-document-items {
    display: grid;
    gap: 16px;
}

body .ap-legal-document-section h3 {
    font-size: 21px;
    line-height: 1.3;
}

body .ap-legal-document-lead,
body .ap-legal-document-item p {
    margin: 0;
    color: #334155;
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

body .ap-legal-document-item {
    display: grid;
    gap: 8px;
}

body .ap-legal-document-item h4 {
    font-size: 16px;
    line-height: 1.35;
}

body .ap-legal-document-footer {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

body .ap-legal-document-pdf-section,
body .ap-legal-document-missing-pdf {
    display: grid;
    gap: 0;
    min-width: 0;
}

body .ap-legal-document-pdf-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid #dbe5ef;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: #f8fafc;
}

body .ap-legal-document-pdf-head h3,
body .ap-legal-document-missing-pdf h3 {
    margin: 0;
    color: #0f172a;
    font-size: 21px;
    line-height: 1.3;
}

body .ap-legal-document-pdf-head p,
body .ap-legal-document-missing-pdf p {
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

body .ap-legal-document-pdf-frame {
    display: block;
    width: 100%;
    min-width: 0;
    height: min(76vh, 820px);
    min-height: 560px;
    border: 1px solid #dbe5ef;
    border-radius: 0 0 16px 16px;
    background: #f1f5f9;
}

body .ap-legal-document-missing-pdf {
    gap: 8px;
    padding: 20px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #f8fafc;
}

body .ap-legal-document-download-note {
    flex: 1 1 100%;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

@media (max-width: 768px) {
    body .ap-legal-document-page {
        gap: 16px;
    }

    body .ap-legal-document-hero,
    body .ap-legal-document-header {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body .ap-legal-document-header {
        padding: 14px;
    }

    body .ap-legal-document-meta {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body .ap-legal-document-meta-item {
        padding-bottom: 8px;
    }

    body .ap-legal-document-meta-item-operator {
        padding-bottom: 0;
    }

    body .ap-legal-document-actions,
    body .ap-legal-document-footer,
    body .ap-legal-document-pdf-actions {
        justify-content: stretch !important;
        gap: 10px !important;
    }

    body .ap-legal-document-actions .ap-action-btn,
    body .ap-legal-document-footer .ap-action-btn,
    body .ap-legal-document-pdf-actions .ap-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    body .ap-legal-document-download-note {
        width: 100%;
    }

    body .ap-legal-document-pdf-frame {
        height: 58vh;
        min-height: 360px;
        max-height: 420px;
        border-radius: 0 0 12px 12px;
    }

    body .ap-legal-document-pdf-head {
        display: grid;
        gap: 12px;
        padding: 14px;
        border-radius: 12px 12px 0 0;
    }

    body .ap-legal-document-missing-pdf {
        padding: 14px;
    }

    body .ap-legal-document-sheet {
        gap: 20px;
        padding: 16px;
        border-radius: 14px;
    }

    body .ap-legal-document-header h2 {
        font-size: 20px;
    }

    body .ap-legal-document-section h3 {
        font-size: 18px;
    }
}

body .ap-account-legal-page {
    display: grid;
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
}

body .ap-required-legal-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    margin: 0 auto 18px;
    padding: 14px 16px;
    border: 1px solid #d7b66c;
    border-radius: 10px;
    background: #fffbeb;
    color: #713f12;
}

body .ap-required-legal-warning p {
    min-width: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body .ap-required-legal-warning-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #8a5a13;
    border-radius: 8px;
    background: #ffffff;
    color: #713f12;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
    text-align: center;
}

body .ap-account-legal-hero,
body .ap-account-legal-card {
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

body .ap-account-legal-hero {
    padding: 24px;
    background: #f8fafc;
}

body .ap-account-legal-hero h1,
body .ap-account-legal-card-head h2 {
    margin: 0;
    color: #0f172a;
    overflow-wrap: anywhere;
}

body .ap-account-legal-hero h1 {
    font-size: 30px;
    line-height: 1.2;
}

body .ap-account-legal-hero p {
    margin: 8px 0 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.55;
}

body .ap-account-legal-card {
    display: grid;
    gap: 0;
    overflow: hidden;
}

body .ap-account-legal-card-head {
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

body .ap-account-legal-card-head h2 {
    font-size: 22px;
    line-height: 1.25;
}

body .ap-account-legal-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

body .ap-account-legal-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    table-layout: fixed;
}

body .ap-account-legal-table th,
body .ap-account-legal-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e7edf4;
    color: #334155;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

body .ap-account-legal-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

body .ap-account-legal-table th:first-child,
body .ap-account-legal-table td:first-child {
    width: 34%;
}

body .ap-account-legal-table th:nth-child(2),
body .ap-account-legal-table td:nth-child(2) {
    width: 15%;
}

body .ap-account-legal-table th:nth-child(3),
body .ap-account-legal-table td:nth-child(3) {
    width: 18%;
}

body .ap-account-legal-table th:nth-child(4),
body .ap-account-legal-table td:nth-child(4) {
    width: 18%;
}

body .ap-account-legal-table th:last-child,
body .ap-account-legal-table td:last-child {
    width: 15%;
}

body .ap-account-legal-table tr:last-child td {
    border-bottom: 0;
}

body .ap-account-legal-title {
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
}

body .ap-account-legal-title {
    color: #0f172a;
    font-weight: 700;
}

body .ap-account-legal-status-text {
    display: inline;
    max-width: 100%;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

body .ap-account-legal-status-text.is-accepted {
    color: #166534;
}

body .ap-account-legal-status-text.is-missing {
    color: #92400e;
}

body .ap-account-legal-status-text.is-outdated {
    color: #9f1239;
}

body .ap-account-legal-status-text.is-revoked {
    color: #475569;
}

body .ap-account-legal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

body .ap-account-legal-actions .ap-account-legal-action {
    min-height: 32px;
    margin: 0;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
}

body .ap-account-legal-confirm-form,
body .ap-account-legal-revoke-form {
    display: inline-flex;
    margin: 0;
}

body .ap-account-legal-actions .ap-account-legal-revoke-action {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

body .ap-account-legal-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

body .ap-account-legal-empty {
    padding: 20px;
    color: #475569;
    font-size: 15px;
    line-height: 1.55;
}

body .ap-account-legal-configuration-message {
    padding: 16px 18px;
    border: 1px solid #d7b66c;
    border-radius: 12px;
    background: #fffbeb;
    color: #713f12;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

body .ap-account-legal-pending {
    display: grid;
    gap: 14px;
}

body .ap-account-legal-pending-head h2,
body .ap-account-legal-pending-copy h3 {
    margin: 0;
    color: #17231c;
    overflow-wrap: anywhere;
}

body .ap-account-legal-pending-head h2 {
    font-size: 22px;
    line-height: 1.3;
}

body .ap-account-legal-pending-head p,
body .ap-account-legal-pending-copy p {
    margin: 5px 0 0;
    color: #526158;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body .ap-account-legal-pending-list {
    display: grid;
    gap: 10px;
}

body .ap-account-legal-pending-item {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(300px, auto);
    align-items: center;
    gap: 18px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid #c9d8ce;
    border-left: 4px solid #2f6f4e;
    border-radius: 8px;
    background: #ffffff;
}

body .ap-account-legal-pending-copy,
body .ap-account-legal-pending-actions {
    min-width: 0;
}

body .ap-account-legal-pending-copy h3 {
    font-size: 16px;
    line-height: 1.35;
}

body .ap-account-legal-pending-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

body .ap-account-legal-pending-actions form {
    margin: 0;
}

body .ap-account-legal-pending-actions .ap-account-legal-action {
    min-height: 36px;
    margin: 0;
    padding: 8px 11px;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

body .ap-account-legal-reaccept-form {
    display: grid;
    width: 100%;
    gap: 8px;
}

body .ap-account-legal-reaccept-confirmation {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    width: 100%;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

body .ap-account-legal-reaccept-confirmation input {
    width: 18px;
    height: 18px;
    margin: 0;
}

body .ap-account-legal-reaccept-confirmation span,
body .ap-account-legal-pdf-pending {
    min-width: 0;
    overflow-wrap: anywhere;
}

body .ap-account-legal-pdf-pending {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    body .ap-required-legal-warning {
        display: grid;
        gap: 12px;
        margin-bottom: 14px;
        padding: 13px;
    }

    body .ap-required-legal-warning-action {
        width: 100%;
        white-space: normal;
    }

    body .ap-account-legal-page {
        gap: 16px;
    }

    body .ap-account-legal-hero {
        padding: 18px;
        border-radius: 14px;
    }

    body .ap-account-legal-hero h1 {
        font-size: 24px;
    }

    body .ap-account-legal-card {
        border-radius: 14px;
    }

    body .ap-account-legal-pending-item {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 12px;
        padding: 14px;
    }

    body .ap-account-legal-pending-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        width: 100%;
    }

    body .ap-account-legal-pending-actions form,
    body .ap-account-legal-pending-actions .ap-account-legal-action {
        width: 100%;
        max-width: 100%;
    }

    body .ap-account-legal-card-head,
    body .ap-account-legal-empty {
        padding: 16px;
    }

    body .ap-account-legal-table-wrap {
        overflow-x: visible;
    }

    body .ap-account-legal-table {
        display: block;
        min-width: 0;
    }

    body .ap-account-legal-table thead {
        display: none;
    }

    body .ap-account-legal-table tbody,
    body .ap-account-legal-table tr,
    body .ap-account-legal-table td {
        display: block;
        width: 100%;
    }

    body .ap-account-legal-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid #e7edf4;
    }

    body .ap-account-legal-table tr:last-child {
        border-bottom: 0;
    }

    body .ap-account-legal-table td {
        display: grid;
        grid-template-columns: minmax(106px, 34%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 7px 0;
        border-bottom: 0;
        font-size: 13px;
    }

    body .ap-account-legal-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .02em;
        line-height: 1.35;
        text-transform: uppercase;
    }

    body .ap-account-legal-status-text,
    body .ap-account-legal-actions .ap-account-legal-action,
    body .ap-account-legal-confirm-form,
    body .ap-account-legal-revoke-form {
        width: 100%;
    }

    body .ap-account-legal-actions {
        display: grid;
        justify-content: stretch;
        gap: 10px;
    }

    body .ap-account-legal-reaccept-confirmation {
        font-size: 13px;
    }
}
/* AA2.0-7C-FIX4A: one persistent notice for current legal documents. */
body .ap-global-legal-update-card {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #b8c9bd;
    border-left: 4px solid #2f6f4e;
    border-radius: 8px;
    background: #f7faf8;
    color: #17231c;
    text-decoration: none;
}

body .ap-global-legal-update-card:hover {
    border-color: #7fa18d;
    background: #f0f6f2;
    color: #17231c;
}

body .ap-global-legal-update-message {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body .ap-global-legal-update-action {
    flex: 0 0 auto;
    color: #23583d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body .ap-account-legal-continue-form {
    margin: 0;
}

@media (max-width: 768px) {
    body .ap-global-legal-update-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px;
    }

    body .ap-global-legal-update-action {
        max-width: 100%;
        white-space: normal;
    }
}

/* AA2.0-7D-R1: scoped prelaunch fixes confirmed by local responsive review. */
body .ap-secondary-details {
    overflow: hidden;
}

body .ap-secondary-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    cursor: pointer;
    list-style: none;
}

body .ap-secondary-summary::-webkit-details-marker {
    display: none;
}

body .ap-secondary-summary::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 3px;
    border-right: 2px solid #476154;
    border-bottom: 2px solid #476154;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

body .ap-secondary-details[open] > .ap-secondary-summary::after {
    transform: rotate(225deg);
}

body .ap-secondary-summary > div,
body .ap-secondary-content {
    min-width: 0;
}

body .ap-secondary-content {
    padding-top: 14px;
}

@media (max-width: 900px) {
    body .ap-manager-standard-page {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .ap-manager-standard-page > *,
    body .ap-manager-standard-page .ap-staff-work-nav-wrap,
    body .ap-manager-standard-page .staff-work-nav {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body .ap-manager-standard-page .staff-work-nav a,
    body .manager-final-page .staff-work-nav a {
        color: #24503a !important;
    }

    body .ap-manager-standard-page .staff-work-nav a.is-active,
    body .manager-final-page .staff-work-nav a.is-active {
        color: #166534 !important;
    }

    body .ap-manager-standard-page .work-filter-grid,
    body .ap-manager-standard-page .manager-unified-filter-grid,
    body .ap-manager-standard-page .watch-filter-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body .ap-manager-standard-page .work-filter-actions,
    body .ap-manager-standard-page .manager-unified-filter-actions,
    body .ap-manager-standard-page .watch-filter-actions,
    body .ap-manager-standard-page .support-filter-actions {
        width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 768px) {
    body .billing-page-final .billing-status-badge {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 28px !important;
        padding: 6px 10px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    body .ap-account-legal-table td,
    body .ap-account-legal-table td:first-child,
    body .ap-account-legal-table td:nth-child(2),
    body .ap-account-legal-table td:nth-child(3),
    body .ap-account-legal-table td:nth-child(4),
    body .ap-account-legal-table td:last-child {
        width: 100% !important;
        min-width: 0 !important;
    }

    body .ap-account-legal-table td {
        grid-template-columns: minmax(92px, 32%) minmax(0, 1fr);
    }

    body .ap-account-legal-title,
    body .ap-account-legal-status-text,
    body .ap-account-legal-actions {
        min-width: 0;
        overflow-wrap: break-word;
    }

    body .ap-secondary-summary {
        gap: 12px;
    }

    body .ap-secondary-content {
        padding-top: 12px;
    }
}

/* AA2.0-7D-R2: scoped navigation, legal registry and verification cleanup. */
body .staff-work-nav {
    align-items: center !important;
    padding: 10px 12px !important;
}

body .staff-work-nav .staff-work-nav-link,
body .staff-work-nav .staff-work-nav-link:visited,
body .staff-work-nav .staff-work-nav-link:active {
    color: #24503a !important;
}

body .staff-work-nav .staff-work-nav-link:hover,
body .staff-work-nav .staff-work-nav-link:focus-visible {
    border-color: #86cfa0 !important;
    background: #eef9f1 !important;
    color: #173f2a !important;
}

body .staff-work-nav .staff-work-nav-link.is-active,
body .staff-work-nav .staff-work-nav-link.is-active:visited,
body .staff-work-nav .staff-work-nav-link.is-active:hover,
body .staff-work-nav .staff-work-nav-link.is-active:focus-visible {
    border-color: #86efac !important;
    background: #dcfce7 !important;
    color: #14532d !important;
}

body [data-summary-attention-target] {
    position: relative;
}

body .ap-attention-count-badge {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    max-width: 100%;
    margin-left: 2px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

body [data-account-legal-marketing] .ap-account-legal-actions,
body [data-account-legal-marketing] .ap-account-legal-pending-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

body [data-account-legal-marketing] .ap-account-legal-confirm-form,
body [data-account-legal-marketing] .ap-account-legal-revoke-form,
body [data-account-legal-marketing] .ap-account-legal-continue-form {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 0;
}

body [data-account-legal-marketing] .ap-account-legal-action {
    width: auto;
    max-width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
}

body .ap-info-legal-links {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

body .ap-info-legal-link-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

body .ap-info-legal-link-row a {
    min-width: 0;
    color: #24503a;
    font-weight: 800;
    overflow-wrap: break-word;
}

body .ap-info-legal-link-row .ap-info-legal-download {
    flex: 0 0 auto;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

body .ap-info-document-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

body .ap-info-document-actions .ap-action-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.25;
}

body .ap-info-empty {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    line-height: 1.5;
}

body .company-verification-filter .manager-standard-filter-form {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media (max-width: 900px) {
    body .staff-work-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 10px !important;
        scroll-padding-inline: 10px;
    }

    body .staff-work-nav .staff-work-nav-link {
        flex: 0 0 auto !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding: 7px 11px !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 768px) {
    body [data-account-legal-marketing] .ap-account-legal-actions,
    body [data-account-legal-marketing] .ap-account-legal-pending-actions {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    body [data-account-legal-marketing] .ap-account-legal-confirm-form,
    body [data-account-legal-marketing] .ap-account-legal-revoke-form,
    body [data-account-legal-marketing] .ap-account-legal-continue-form,
    body [data-account-legal-marketing] .ap-account-legal-action {
        width: auto !important;
        max-width: 100% !important;
    }

    body .ap-info-legal-link-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    body .ap-info-document-actions,
    body .ap-info-document-actions .ap-action-btn {
        width: 100%;
    }
}

/* AA2.0-7D-R3: one attention badge and balanced legal file actions. */
body .ap-legal-file-actions {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

body .ap-legal-file-actions.ap-legal-file-actions-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .ap-legal-file-actions > .ap-action-btn {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    height: 100%;
    margin: 0 !important;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: normal !important;
}

body .ap-info-document-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

body .ap-info-document-actions > .ap-action-btn {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    height: 100%;
    margin: 0 !important;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: normal !important;
}

body .ap-info-document-actions > .ap-action-btn:only-child {
    grid-column: 1 / -1;
}

body .ap-legal-document-pdf-actions {
    display: grid !important;
    flex: 0 1 420px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch !important;
    width: min(100%, 420px);
    min-width: 0;
    gap: 10px !important;
}

body .ap-legal-document-pdf-actions > .ap-action-btn {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    width: 100% !important;
    min-width: 0 !important;
    height: 100%;
    margin: 0 !important;
    justify-content: center;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: normal !important;
}

@media (min-width: 769px) {
    body .ap-account-legal-table th:last-child,
    body .ap-account-legal-table td:last-child {
        width: 260px;
        min-width: 260px;
    }
}

@media (max-width: 768px) {
    body .ap-account-legal-table td[data-label="Действия"] {
        grid-template-columns: minmax(0, 1fr);
    }

    body [data-account-legal-marketing] .ap-legal-file-actions > .ap-account-legal-action {
        width: 100% !important;
    }

    body .ap-legal-document-pdf-actions {
        width: 100%;
    }
}

/* AA2.0-7E-R3: clear group hierarchy and compact mobile offers */
@media (min-width: 769px) {
    body main:has(> .ap-offer-comparison-page--wide) {
        width: min(1360px, calc(100% - 48px)) !important;
        max-width: 1360px !important;
        overflow-x: visible;
    }
}

.ap-offer-comparison-page {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.ap-offer-comparison-hero {
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
}

body .ap-offer-comparison-page .ap-offer-comparison-hero {
    padding: 18px 20px !important;
    border-radius: 8px !important;
}

body .ap-offer-comparison-page .ap-offer-comparison-hero .ap-section-title {
    font-size: 30px !important;
    letter-spacing: 0 !important;
}

.ap-offer-comparison-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ap-offer-comparison-all-link {
    color: var(--ap-color-primary);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    text-underline-offset: 3px;
}

body .ap-offer-comparison-page .ap-action-btn {
    width: auto;
    min-width: 118px;
    max-width: none;
    height: auto;
    min-height: 34px;
    max-height: none;
    overflow: visible;
    white-space: normal;
}

.ap-offer-comparison-filter {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #d9e2dc;
    border-radius: 8px;
    background: #ffffff;
}

.ap-offer-comparison-filter-details,
.ap-offer-comparison-filter-body {
    min-width: 0;
}

.ap-offer-comparison-filter-summary {
    color: #26372e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
}

.ap-offer-comparison-filter-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.ap-offer-comparison-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(110px, 0.72fr)
        minmax(145px, 1fr)
        minmax(120px, 0.78fr)
        minmax(120px, 0.78fr)
        minmax(190px, 1.32fr);
    gap: 9px;
    align-items: end;
    min-width: 0;
}

.ap-offer-comparison-filter-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.ap-offer-comparison-filter-field label {
    color: #415249;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
}

.ap-offer-comparison-filter-field select,
.ap-offer-comparison-filter-field input {
    width: 100%;
    min-width: 0;
}

.ap-offer-comparison-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.ap-offer-comparison-groups {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.ap-offer-comparison-group {
    min-width: 0;
    border: 1px solid #d9e2dc;
    border-left-width: 5px;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.ap-offer-comparison-group--lot {
    --ap-offer-comparison-accent: var(--ap-color-primary);
    --ap-offer-comparison-accent-strong: var(--ap-color-primary-dark);
    --ap-offer-comparison-head-bg: var(--ap-color-primary-soft);
    border-left-color: var(--ap-color-primary);
}

.ap-offer-comparison-group--request {
    --ap-offer-comparison-accent: #526579;
    --ap-offer-comparison-accent-strong: #334155;
    --ap-offer-comparison-head-bg: #f1f5f9;
    border-left-color: #64748b;
}

.ap-offer-comparison-group-head {
    display: grid;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e4eae6;
    background: var(--ap-offer-comparison-head-bg) !important;
    background-image: none !important;
    box-shadow: none;
}

.ap-offer-comparison-group-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 10px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.ap-offer-comparison-group-title,
.ap-offer-comparison-source-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
}

.ap-offer-comparison-group-title {
    gap: 0;
}

.ap-offer-comparison-group-marker {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid var(--ap-offer-comparison-accent);
    border-radius: 4px;
    background: var(--ap-offer-comparison-accent);
    color: #ffffff;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
}

.ap-offer-comparison-group--request .ap-offer-comparison-group-marker {
    border-color: #526579;
    background: #526579;
    color: #ffffff;
}

.ap-offer-comparison-group-title h2 {
    margin: 0;
    color: #17211c;
    font-size: 17px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ap-offer-comparison-group-reference {
    flex: 0 0 auto;
    color: #52645a;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.3;
}

.ap-offer-comparison-group-reference::before {
    content: "·";
    display: inline-block;
    margin: 0 7px;
    color: #87968e;
}

.ap-offer-comparison-group-count {
    flex: 0 0 auto;
    color: var(--ap-offer-comparison-accent-strong);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
    white-space: nowrap;
}

.ap-offer-comparison-source-meta {
    gap: 3px 0;
    color: #52645a;
    font-size: 13px;
    line-height: 1.35;
}

.ap-offer-comparison-source-meta span {
    min-width: 0;
    white-space: nowrap;
}

.ap-offer-comparison-source-region {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.ap-offer-comparison-source-meta span + span::before {
    content: "·";
    display: inline-block;
    margin: 0 7px;
    color: #93a099;
}

.ap-offer-comparison-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.ap-offer-comparison-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    table-layout: fixed;
}

.ap-offer-comparison-table th {
    padding: 9px 10px;
    border-bottom: 1px solid #d9e2dc;
    background: #f2f6f3;
    color: #425249;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
    vertical-align: bottom;
}

.ap-offer-comparison-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #e7ece9;
    color: #27342d;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    vertical-align: top;
    overflow-wrap: normal;
    word-break: normal;
}

.ap-offer-comparison-table tr:last-child td {
    border-bottom: 0;
}

.ap-offer-comparison-table td strong,
.ap-offer-comparison-table td span {
    display: block;
}

.ap-offer-comparison-table td span {
    margin-top: 3px;
    color: #627168;
    font-size: 12px;
}

.ap-offer-comparison-table th:nth-child(1) {
    width: 20%;
}

.ap-offer-comparison-table th:nth-child(2) {
    width: 12%;
}

.ap-offer-comparison-table th:nth-child(3) {
    width: 15%;
}

.ap-offer-comparison-table th:nth-child(4) {
    width: 10%;
}

.ap-offer-comparison-table th:nth-child(5) {
    width: 8%;
}

.ap-offer-comparison-table th:nth-child(6) {
    width: 17%;
}

.ap-offer-comparison-table th:nth-child(7) {
    width: 18%;
}

.ap-offer-comparison-reliability strong {
    overflow-wrap: anywhere;
}

.ap-offer-comparison-deviation,
.ap-offer-comparison-basis,
.ap-offer-comparison-status span {
    white-space: nowrap;
}

.ap-offer-comparison-open-action {
    width: 100%;
    max-width: 180px;
    white-space: normal;
    text-align: center;
}

.ap-offer-comparison-mobile-list {
    display: none;
}

.ap-offer-comparison-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.ap-offer-comparison-pagination span {
    color: #52645a;
    font-size: 13px;
    font-weight: 700;
}

.ap-offer-comparison-empty {
    display: grid;
    justify-items: start;
    gap: 8px;
    min-width: 0;
    padding: 22px;
    border: 1px solid #d9e2dc;
    border-radius: 8px;
    background: #ffffff;
}

.ap-offer-comparison-empty h2,
.ap-offer-comparison-empty p {
    margin: 0;
}

.ap-offer-comparison-empty h2 {
    color: #17211c;
    font-size: 19px;
}

.ap-offer-comparison-empty p {
    color: #627168;
    font-size: 14px;
}

@media (min-width: 769px) {
    .ap-offer-comparison-filter-details {
        display: none;
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .ap-offer-comparison-filter-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .ap-offer-comparison-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ap-offer-comparison-filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .ap-offer-comparison-page {
        gap: 12px;
    }

    .ap-offer-comparison-hero {
        gap: 9px;
        padding: 14px;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-hero {
        padding: 14px !important;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-hero .ap-section-title {
        font-size: 24px !important;
        line-height: 1.2 !important;
    }

    .ap-offer-comparison-hero-actions,
    .ap-offer-comparison-filter-actions,
    body .ap-offer-comparison-page .ap-offer-comparison-filter-actions .ap-action-btn {
        width: 100%;
    }

    .ap-offer-comparison-filter {
        padding: 0;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-filter {
        padding: 0 !important;
        border-radius: 8px !important;
    }

    .ap-offer-comparison-filter-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 11px 14px;
        list-style-position: inside;
    }

    .ap-offer-comparison-filter-details:not([open]) + .ap-offer-comparison-filter-body {
        display: none;
    }

    .ap-offer-comparison-filter-details[open] + .ap-offer-comparison-filter-body {
        display: grid;
    }

    .ap-offer-comparison-filter-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 0 14px 14px;
    }

    .ap-offer-comparison-filter-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ap-offer-comparison-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ap-offer-comparison-group-head {
        gap: 8px;
        padding: 10px 11px;
    }

    .ap-offer-comparison-group-primary {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 7px;
        align-items: center;
    }

    .ap-offer-comparison-group-title {
        min-width: 0;
    }

    .ap-offer-comparison-group-title h2 {
        font-size: 15px;
    }

    .ap-offer-comparison-group-reference {
        margin-left: 7px;
    }

    .ap-offer-comparison-group-reference::before {
        display: none;
    }

    .ap-offer-comparison-group-count {
        align-self: center;
        font-size: 12px;
    }

    .ap-offer-comparison-source-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 12px;
        align-items: baseline;
        font-size: 12px;
    }

    .ap-offer-comparison-source-meta span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ap-offer-comparison-source-meta span + span::before {
        display: none;
    }

    .ap-offer-comparison-source-volume,
    .ap-offer-comparison-source-date {
        text-align: right;
    }

    .ap-offer-comparison-source-region {
        grid-column: 1 / -1;
    }

    .ap-offer-comparison-table-wrap {
        display: none;
    }

    .ap-offer-comparison-mobile-list {
        display: grid;
        gap: 0;
        min-width: 0;
    }

    .ap-offer-comparison-mobile-card {
        min-width: 0;
        padding: 10px 11px;
        border-bottom: 1px solid #e4eae6;
        background: #ffffff;
    }

    .ap-offer-comparison-mobile-card:last-child {
        border-bottom: 0;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-mobile-card:not(.is-mobile-expanded) {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .ap-offer-comparison-mobile-card .ap-mobile-card-toggle {
        top: 10px;
        right: 9px;
        left: auto;
        color: var(--ap-color-primary);
    }

    .ap-offer-comparison-mobile-card .ap-mobile-card-toggle:focus-visible {
        outline: 2px solid var(--ap-color-primary);
        outline-offset: 2px;
    }

    .ap-offer-comparison-mobile-card:not(.is-mobile-expanded) .ap-mobile-card-summary,
    .ap-offer-comparison-mobile-card.is-mobile-expanded .ap-mobile-card-summary {
        display: grid;
        gap: 3px;
        min-width: 0;
        margin: 0;
        padding: 0 32px 0 0;
        color: #17211c;
        cursor: pointer;
        overflow: visible;
        -webkit-box-orient: initial;
        -webkit-line-clamp: unset;
    }

    .ap-offer-comparison-mobile-counterparty-row,
    .ap-offer-comparison-mobile-status-row,
    .ap-offer-comparison-mobile-price-row,
    .ap-offer-comparison-mobile-reliability-row {
        min-width: 0;
    }

    .ap-offer-comparison-mobile-counterparty-row {
        padding-right: 2px;
    }

    .ap-offer-comparison-mobile-counterparty-name {
        display: block;
        min-width: 0;
        color: #17211c;
        font-size: 14px;
        font-weight: 850;
        line-height: 1.3;
        white-space: normal;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .ap-offer-comparison-mobile-status-row {
        color: #52645a;
        font-size: 12px;
        font-weight: 750;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ap-offer-comparison-mobile-price-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: baseline;
        color: #26372e;
        font-size: 12px;
        line-height: 1.3;
    }

    .ap-offer-comparison-mobile-price-row strong,
    .ap-offer-comparison-mobile-price-row span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .ap-offer-comparison-mobile-price-row strong {
        font-size: 13px;
        font-weight: 850;
    }

    .ap-offer-comparison-mobile-price-row span {
        flex: 0 0 auto;
        color: #52645a;
        font-size: 12px;
        font-weight: 750;
        text-align: right;
    }

    .ap-offer-comparison-mobile-reliability-row {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        color: #52645a;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.3;
    }

    .ap-offer-comparison-mobile-reliability-row span + span::before {
        content: "·";
        display: inline-block;
        margin: 0 5px;
        color: #87968e;
    }

    .ap-offer-comparison-mobile-details {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
        min-width: 0;
        margin: 0 0 12px;
    }

    .ap-offer-comparison-mobile-detail {
        min-width: 0;
    }

    .ap-offer-comparison-mobile-detail--deadline {
        grid-column: 1 / -1;
    }

    .ap-offer-comparison-mobile-details dt {
        margin: 0 0 2px;
        color: #627168;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.35;
    }

    .ap-offer-comparison-mobile-details dd {
        margin: 0;
        color: #17211c;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-mobile-card .ap-offer-comparison-open-action {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 430px) {
    .ap-offer-comparison-pagination {
        display: grid;
        grid-template-columns: 1fr;
        text-align: center;
    }

    body .ap-offer-comparison-page .ap-offer-comparison-pagination .ap-action-btn {
        width: 100%;
    }
}

@media (max-width: 370px) {
    .ap-offer-comparison-source-basis,
    .ap-offer-comparison-source-date {
        grid-column: 1 / -1;
        text-align: left;
    }

    .ap-offer-comparison-mobile-details {
        grid-template-columns: 1fr;
    }

    .ap-offer-comparison-mobile-detail--deadline {
        grid-column: auto;
    }
}
