/**
 * Общий оформление страниц с формами (синий hero, крошки, быстрые ссылки).
 * Классы .invoices-add-* оставлены для совместимости со страницами счетов/документов.
 */

.crm-form-page-doc-shell,
.invoices-add-doc-shell {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.crm-form-page-hero,
.invoices-add-hero {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(15, 60, 100, 0.12);
    background: linear-gradient(135deg, #1e5f99 0%, #2d8bc9 48%, #3aa8e0 100%);
    color: #fff;
}

.crm-form-page-hero__inner,
.invoices-add-hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.5rem 1.25rem;
}

.crm-form-page-hero__text,
.invoices-add-hero__text {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex: 1 1 280px;
    min-width: 0;
}

.crm-form-page-hero__icon,
.invoices-add-hero__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(6px);
}

.crm-form-page-hero__title,
.invoices-add-hero__title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
}

.crm-form-page-hero__lead,
.invoices-add-hero__lead {
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    max-width: 52ch;
}

.crm-form-page-hero__actions,
.invoices-add-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.crm-form-page-hero__actions .btn-light,
.invoices-add-hero__actions .btn-light {
    color: #1a4d7a;
    font-weight: 600;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.crm-form-page-hero__actions .btn-light:hover,
.invoices-add-hero__actions .btn-light:hover {
    background: #fff;
    color: #143d63;
}

.crm-form-page-hero__actions .btn-outline-light,
.invoices-add-hero__actions .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.crm-form-page-hero__actions .btn-outline-light:hover,
.invoices-add-hero__actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.crm-form-page-quick-links,
.invoices-add-quick-links {
    background: rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.85rem 1.25rem 1.1rem;
}

.crm-form-page-quick-links__label,
.invoices-add-quick-links__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.65rem;
}

.crm-form-page-quick-links__grid,
.invoices-add-quick-links__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

@media (min-width: 992px) {
    .crm-form-page-quick-links__grid,
    .invoices-add-quick-links__grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

.crm-form-page-quick-links__item,
.invoices-add-quick-links__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #1a4d7a;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.crm-form-page-quick-links__item:hover,
.invoices-add-quick-links__item:hover {
    background: #fff;
    color: #0f3558;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crm-form-page-quick-links__item i,
.invoices-add-quick-links__item i {
    font-size: 0.95rem;
    opacity: 0.9;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.crm-form-page-form-card,
.invoices-add-form-card {
    border-radius: 12px;
    overflow: hidden;
}

.crm-form-page-form-card__head,
.invoices-add-form-card__head {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

[data-bs-theme="dark"] .crm-form-page-hero,
[data-bs-theme="dark"] .invoices-add-hero {
    background: linear-gradient(135deg, #1a3a52 0%, #245a78 50%, #2d6f8f 100%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .crm-form-page-hero__actions .btn-light,
[data-bs-theme="dark"] .invoices-add-hero__actions .btn-light,
[data-bs-theme="dark"] .crm-form-page-hero__actions .btn-light:hover,
[data-bs-theme="dark"] .invoices-add-hero__actions .btn-light:hover {
    color: #7c8995;
}

[data-bs-theme="dark"] .crm-form-page-quick-links__item,
[data-bs-theme="dark"] .invoices-add-quick-links__item {
    background: rgba(30, 40, 50, 0.92);
    color: #e8eef4;
}

[data-bs-theme="dark"] .crm-form-page-quick-links__item:hover,
[data-bs-theme="dark"] .invoices-add-quick-links__item:hover {
    background: rgba(40, 52, 64, 0.98);
    color: #fff;
}

[data-bs-theme="dark"] .crm-form-page-form-card__head,
[data-bs-theme="dark"] .invoices-add-form-card__head {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- Подписи полей: единая типографика во всех формах ---------- */
.main-content {
    --crm-form-label-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --crm-form-label-size: 0.9375rem;
    --crm-form-label-weight: 600;
    --crm-form-label-tracking: -0.01em;
    --crm-form-label-leading: 1.35;
    --crm-form-label-color: #334155;
}

[data-bs-theme="dark"] .main-content {
    --crm-form-label-color: #cbd5e1;
}

.main-content .form-label:not(.form-check-label) {
    font-family: var(--crm-form-label-font);
    font-size: var(--crm-form-label-size);
    font-weight: var(--crm-form-label-weight);
    letter-spacing: var(--crm-form-label-tracking);
    line-height: var(--crm-form-label-leading);
    color: var(--crm-form-label-color);
    margin-bottom: 0.5rem;
}

/* Страница входа (без .main-content) */
.auth-full-page-content {
    --crm-form-label-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --crm-form-label-size: 0.9375rem;
    --crm-form-label-weight: 600;
    --crm-form-label-tracking: -0.01em;
    --crm-form-label-leading: 1.35;
    --crm-form-label-color: #334155;
}

[data-bs-theme="dark"] .auth-full-page-content {
    --crm-form-label-color: #cbd5e1;
}

.auth-full-page-content .form-label:not(.form-check-label) {
    font-family: var(--crm-form-label-font);
    font-size: var(--crm-form-label-size);
    font-weight: var(--crm-form-label-weight);
    letter-spacing: var(--crm-form-label-tracking);
    line-height: var(--crm-form-label-leading);
    color: var(--crm-form-label-color);
    margin-bottom: 0.5rem;
}

/* ---------- Современные поля ввода (crm-form-modern-inputs на main-content) ---------- */
.crm-form-modern-inputs {
    --crm-fi-radius: 0.75rem;
    --crm-fi-bg: #f1f4fb;
    --crm-fi-bg-hover: #e8ecf7;
    --crm-fi-text: #1e293b;
    --crm-fi-placeholder: #64748b;
    --crm-fi-focus-ring: 0.085rem solid rgba(85, 110, 230, 0.45);
    --crm-fi-min-h: 3.7rem;
    --crm-fi-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.crm-form-modern-inputs form .form-label:not(.form-check-label) {
    font-family: var(--crm-form-label-font);
    font-size: var(--crm-form-label-size);
    font-weight: var(--crm-form-label-weight);
    letter-spacing: var(--crm-form-label-tracking);
    line-height: var(--crm-form-label-leading);
    color: var(--crm-form-label-color);
    margin-bottom: 0.5rem;
}

.crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.crm-form-modern-inputs form .form-select {
    border: none;
    background-color: var(--crm-fi-bg);
    color: var(--crm-fi-text);
    border-radius: var(--crm-fi-radius);
    min-height: var(--crm-fi-min-h);
    padding: 0.65rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    box-shadow: var(--crm-fi-shadow);
    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.crm-form-modern-inputs form textarea.form-control {
    min-height: 7.5rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    resize: vertical;
}

.crm-form-modern-inputs form .form-control-lg {
    min-height: 3.35rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1.02rem;
}

.crm-form-modern-inputs form .form-control::placeholder {
    color: var(--crm-fi-placeholder);
    opacity: 0.88;
}

.crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
.crm-form-modern-inputs form .form-select:hover {
    background-color: var(--crm-fi-bg-hover);
}

.crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
.crm-form-modern-inputs form .form-select:focus {
    background-color: #fff;
    box-shadow:
        0 0 0 var(--crm-fi-focus-ring),
        0 4px 14px rgba(85, 110, 230, 0.12);
    outline: none;
}

.crm-form-modern-inputs form .form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.75rem;
    -webkit-appearance: none;
    appearance: none;
}

/* Воронка: сумма и вероятность */
.crm-form-modern-inputs .funnel-add-deal__amount-group {
    border-radius: var(--crm-fi-radius);
    overflow: hidden;
    box-shadow: var(--crm-fi-shadow);
}

.crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__amount-input,
.crm-form-modern-inputs .funnel-add-deal__amount-group .input-group-text {
    border: none;
    min-height: var(--crm-fi-min-h);
    border-radius: 0;
}

.crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__amount-input {
    background-color: var(--crm-fi-bg);
    font-size: 0.9375rem;
    padding-left: 1rem;
}

.crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__amount-input:hover {
    background-color: var(--crm-fi-bg-hover);
}

.crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__amount-input:focus {
    background-color: #fff;
    box-shadow: none;
    outline: none;
    z-index: 1;
}

.crm-form-modern-inputs .funnel-add-deal__amount-group:focus-within {
    box-shadow:
        0 0 0 var(--crm-fi-focus-ring),
        0 4px 14px rgba(85, 110, 230, 0.12);
}

.crm-form-modern-inputs .funnel-add-deal__amount-group .input-group-text {
    background: linear-gradient(180deg, #eef1f8 0%, #e3e8f4 100%);
    color: #405189;
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup .form-control,
.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup .input-group-text {
    border: none;
    background-color: var(--crm-fi-bg);
    min-height: 2.5rem;
}

.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup .input-group-text {
    background: #e3e8f4;
    color: #405189;
    font-weight: 600;
    border-radius: 0 var(--crm-fi-radius) var(--crm-fi-radius) 0;
}

.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup .form-control {
    border-radius: var(--crm-fi-radius) 0 0 var(--crm-fi-radius);
    max-width: 8rem;
}

.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup:focus-within {
    box-shadow: 0 0 0 var(--crm-fi-focus-ring);
    border-radius: var(--crm-fi-radius);
}

.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup:focus-within .form-control,
.crm-form-modern-inputs .funnel-add-deal__probability-inputgroup:focus-within .input-group-text {
    background-color: #fff;
}

/* Select2 (документы, счета) */
.crm-form-modern-inputs .select2-container--default .select2-selection--single {
    border: none !important;
    background-color: var(--crm-fi-bg) !important;
    border-radius: var(--crm-fi-radius) !important;
    min-height: var(--crm-fi-min-h) !important;
    padding: 0.45rem 0.75rem;
    box-shadow: var(--crm-fi-shadow);
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.crm-form-modern-inputs .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--crm-fi-text);
    line-height: calc(var(--crm-fi-min-h) - 1.1rem);
    padding-left: 0.25rem;
}

.crm-form-modern-inputs .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--crm-fi-min-h) - 2px);
    right: 0.65rem;
}

.crm-form-modern-inputs .select2-container--default.select2-container--focus .select2-selection--single,
.crm-form-modern-inputs .select2-container--default.select2-container--open .select2-selection--single {
    background-color: #fff !important;
    box-shadow:
        0 0 0 var(--crm-fi-focus-ring),
        0 4px 14px rgba(85, 110, 230, 0.12) !important;
}

.crm-form-modern-inputs .select2-dropdown {
    border: none;
    border-radius: var(--crm-fi-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .crm-form-modern-inputs {
    --crm-fi-bg: #2a2f38;
    --crm-fi-bg-hover: #323845;
    --crm-fi-text: #e8ecf4;
    --crm-fi-placeholder: #94a3b8;
    --crm-fi-focus-ring: 0.085rem solid rgba(139, 159, 247, 0.55);
    --crm-fi-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Фокус: в светлой теме фон #fff; в тёмной оставляем тёмный фон и светлый текст */
[data-bs-theme="dark"] .crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
[data-bs-theme="dark"] .crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus-visible,
[data-bs-theme="dark"] .crm-form-modern-inputs form .form-select:focus,
[data-bs-theme="dark"] .crm-form-modern-inputs form .form-select:focus-visible {
    background-color: #3a414c;
    color: var(--crm-fi-text);
    box-shadow:
        0 0 0 var(--crm-fi-focus-ring),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):-webkit-autofill,
[data-bs-theme="dark"] .crm-form-modern-inputs form .form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):-webkit-autofill:focus {
    -webkit-text-fill-color: var(--crm-fi-text);
    caret-color: var(--crm-fi-text);
    box-shadow: 0 0 0 1000px #3a414c inset;
    transition: background-color 99999s ease-out;
}

[data-bs-theme="dark"] .crm-form-modern-inputs form .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__amount-input:focus {
    background-color: #343a44;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__amount-group .input-group-text {
    background: linear-gradient(180deg, #363c48 0%, #2f3540 100%);
    color: #c5cde0;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__amount-group .funnel-add-deal__currency {
    background: #2c3138;
    border-color: rgba(255, 255, 255, 0.08);
    color: #bfc7d5;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__probability-inputgroup .input-group-text {
    background: #363c48;
    color: #c5cde0;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__probability-inputgroup:focus-within .form-control,
[data-bs-theme="dark"] .crm-form-modern-inputs .funnel-add-deal__probability-inputgroup:focus-within .input-group-text {
    background-color: #343a44;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .select2-container--default .select2-selection--single {
    background-color: var(--crm-fi-bg) !important;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .select2-container--default.select2-container--focus .select2-selection--single,
[data-bs-theme="dark"] .crm-form-modern-inputs .select2-container--default.select2-container--open .select2-selection--single {
    background-color: #343a44 !important;
}

[data-bs-theme="dark"] .crm-form-modern-inputs .select2-dropdown {
    background-color: #2a2f38;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Тёмная тема: выпадающий список нативного <select> на Windows/Chrome часто со
 * светлым фоном, а option наследуют светлый --bs-body-color — текст не виден
 * до наведения. Явно задаём тёмный текст и светлый фон для option/optgroup. */
body[data-bs-theme="dark"] select option {
    color: #1a1d24;
    background-color: #ffffff;
}

body[data-bs-theme="dark"] select optgroup {
    color: #111318;
    background-color: #eef1f6;
}

/* ---------- Единый UI контента: кнопки и таблицы модулей ---------- */
.main-content {
    --crm-ui-accent: #4f6bdf;
    --crm-ui-accent-soft: rgba(79, 107, 223, 0.12);
    --crm-ui-accent-strong: #3730a3;
    --crm-ui-table-head: #f1f5ff;
    --crm-ui-table-head-2: #e8edff;
    --crm-ui-table-border: rgba(148, 163, 184, 0.12);
    --crm-ui-table-row-alt: rgba(79, 107, 223, 0.025);
    --crm-ui-table-row-hover: rgba(79, 107, 223, 0.045);
    --crm-ui-table-hover-bar: rgba(79, 107, 223, 0.12);
}

.main-content .btn {
    border-radius: 0.5rem;
    font-weight: 600;
}

.main-content .btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--crm-ui-accent) 0%, #6366f1 100%);
    box-shadow: 0 2px 10px rgba(79, 107, 223, 0.26);
}

.main-content .btn-primary:hover,
.main-content .btn-primary:focus {
    background: linear-gradient(135deg, #4561d0 0%, #5558e6 100%);
    box-shadow: 0 4px 16px rgba(79, 107, 223, 0.34);
}

.main-content .btn-outline-primary,
.main-content .btn-outline-secondary {
    border-color: rgba(79, 107, 223, 0.35);
}

.main-content .btn-outline-primary {
    color: var(--crm-ui-accent);
}

.main-content .btn-outline-secondary {
    color: var(--crm-ui-accent);
    background: #fff;
}

.main-content .btn-outline-primary:hover,
.main-content .btn-outline-secondary:hover {
    border-color: rgba(79, 107, 223, 0.5);
    background: var(--crm-ui-accent-soft);
    color: var(--crm-ui-accent-strong);
}

.main-content .table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 107, 223, 0.35) transparent;
}

.main-content .table-responsive > .table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
}

.main-content .table-responsive > .table thead th {
    padding: 0.7rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: #334155;
    background: linear-gradient(180deg, var(--crm-ui-table-head) 0%, var(--crm-ui-table-head-2) 100%);
    border-bottom: 2px solid rgba(79, 107, 223, 0.11);
    white-space: normal;
    vertical-align: middle;
}  
.crm-cleaning-sess-acc .table-responsive:not(.main-clients .table-responsive) {
    padding-bottom: 30px;
}

/* Клининг · итоги моб. чек-листа: узкие колонки — явный перенос длинных подписей */
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-table thead th,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table thead th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
    vertical-align: bottom;
}

.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-table thead th.crm-cleaning-acc-col-work,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-table tbody td.crm-cleaning-acc-col-work,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-table thead th.crm-cleaning-acc-col-200,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-table tbody td.crm-cleaning-acc-col-200,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table thead th.crm-cleaning-acc-col-employee,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table tbody td.crm-cleaning-acc-col-employee,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table thead th.crm-cleaning-acc-col-200,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table tbody td.crm-cleaning-acc-col-200,
.main-content .crm-cleaning-sess-acc .table-responsive > .table.crm-cleaning-acc-labor-table tfoot th.crm-cleaning-acc-col-200 {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    box-sizing: border-box;
}

.main-content .table-responsive > .table thead th:first-child {
    border-radius: 0.5rem 0 0 0;
}

.main-content .table-responsive > .table thead th:last-child {
    border-radius: 0 0.5rem 0 0;
}

.main-content .table-responsive > .table tbody td,
.main-content .table-responsive > .table tbody th[scope="row"] {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--crm-ui-table-border);
}

.main-content .table-responsive > .table tbody tr:not(.table-primary):not(.table-secondary):not(.table-success):not(.table-danger):not(.table-warning):not(.table-info):not(.table-light):not(.table-dark):nth-child(even) td,
.main-content .table-responsive > .table tbody tr:not(.table-primary):not(.table-secondary):not(.table-success):not(.table-danger):not(.table-warning):not(.table-info):not(.table-light):not(.table-dark):nth-child(even) th[scope="row"] {
    background-color: var(--crm-ui-table-row-alt);
}

.main-content .table-responsive > .table tbody tr:not(.table-primary):not(.table-secondary):not(.table-success):not(.table-danger):not(.table-warning):not(.table-info):not(.table-light):not(.table-dark):hover td,
.main-content .table-responsive > .table tbody tr:not(.table-primary):not(.table-secondary):not(.table-success):not(.table-danger):not(.table-warning):not(.table-info):not(.table-light):not(.table-dark):hover th[scope="row"] {
    background: var(--crm-ui-table-row-hover) !important;
    box-shadow: inset 3px 0 0 var(--crm-ui-table-hover-bar);
}

/* Клининг → объекты: широкая таблица во flex-контенте без min-width может «схлопнуть» текстовые колонки; дубликаты id у nonce ломали разбор DOM */
.main-content .table-responsive > .table.crm-cleaning-objects-index-table {
    width: 100%;
    min-width: 920px;
}

.main-content .table-responsive > .table.crm-cleaning-objects-index-table tbody td {
    word-break: break-word;
    vertical-align: top;
}

[data-bs-theme="dark"] .main-content {
    --crm-ui-table-head: #2d3340;
    --crm-ui-table-head-2: #252a32;
    --crm-ui-table-border: rgba(255, 255, 255, 0.05);
    --crm-ui-table-row-alt: rgba(129, 140, 248, 0.06);
    --crm-ui-table-row-hover: rgba(129, 140, 248, 0.08);
    --crm-ui-table-hover-bar: rgba(165, 180, 252, 0.32);
}

[data-bs-theme="dark"] .main-content .btn-outline-primary,
[data-bs-theme="dark"] .main-content .btn-outline-secondary {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(30, 34, 40, 0.6);
}

[data-bs-theme="dark"] .main-content .btn-outline-primary:hover,
[data-bs-theme="dark"] .main-content .btn-outline-secondary:hover {
    background: rgba(51, 65, 85, 0.85);
    color: #fff;
}

/* Тёмная тема CRM: контраст .btn-soft-primary (белый текст на #5156be). */
[data-bs-theme="dark"] .btn.btn-soft-primary {
    color: #fff;
    background-color: #5156be;
    border-color: #5156be;
}

[data-bs-theme="dark"] .btn.btn-soft-primary:hover,
[data-bs-theme="dark"] .btn.btn-soft-primary:focus {
    color: #fff;
    background-color: #676bd4;
    border-color: #676bd4;
}

[data-bs-theme="dark"] .btn.btn-soft-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(81, 86, 190, 0.45);
}

[data-bs-theme="dark"] .main-content .table-responsive > .table thead th {
    color: #cbd5e1;
    border-bottom-color: rgba(129, 140, 248, 0.15);
}
