/* CHECKPLAY — global dark polish (loads after app.min.css on every portal)
   Colors reference checkplay-tokens.css — change colors there only. */

[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-body,
[data-bs-theme="dark"] .card.bg-white,
[data-bs-theme="dark"] .modal-content.bg-white {
    background-color: var(--cp-navy-card) !important;
}

[data-bs-theme="dark"] .bg-body-secondary {
    background-color: var(--cp-navy-surface) !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .badge.bg-light {
    background-color: var(--cp-blue-soft) !important;
    color: var(--cp-text) !important;
    border-color: var(--cp-navy-border) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--cp-text-on-dark) !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-body {
    background-color: var(--cp-navy-card) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text-on-dark);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-footer {
    background-color: var(--cp-navy-surface) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text);
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--cp-text-on-dark);
    border-color: rgba(154, 168, 199, 0.12);
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] thead.table-light th,
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light thead th,
[data-bs-theme="dark"] .table .table-light th {
    background-color: var(--cp-navy-surface) !important;
    color: var(--cp-muted) !important;
    border-color: var(--cp-navy-border) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(var(--cp-blue-rgb), 0.08) !important;
    color: var(--cp-text);
}

[data-bs-theme="dark"] #page-topbar .btn-topbar,
[data-bs-theme="dark"] #page-topbar .btn-topbar.bg-white,
[data-bs-theme="dark"] #page-topbar .btn-topbar.bg-body-secondary,
[data-bs-theme="dark"] #page-topbar .btn-ghost-secondary,
[data-bs-theme="dark"] #page-topbar .btn-ghost-dark,
[data-bs-theme="dark"] #page-topbar .topbar-user > .btn {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text) !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] #page-topbar .btn-topbar:hover,
[data-bs-theme="dark"] #page-topbar .btn-ghost-secondary:hover,
[data-bs-theme="dark"] #page-topbar .btn-ghost-dark:hover,
[data-bs-theme="dark"] #page-topbar .topbar-user > .btn:hover {
    background-color: rgba(var(--cp-blue-rgb), 0.14) !important;
    border-color: rgba(var(--cp-blue-rgb), 0.35) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-white,
[data-bs-theme="dark"] .btn.btn-white {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-white:hover {
    background-color: rgba(var(--cp-blue-rgb), 0.14) !important;
    border-color: rgba(var(--cp-blue-rgb), 0.35) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-dark {
    background-color: transparent !important;
    color: var(--cp-blue) !important;
    border-color: rgba(var(--cp-blue-rgb), 0.45) !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-dark:hover {
    background-color: var(--cp-blue) !important;
    color: var(--cp-text) !important;
    border-color: var(--cp-blue) !important;
}

[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu.show {
    background-color: var(--cp-navy-card) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text-on-dark);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--cp-text-on-dark);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item.active {
    background-color: rgba(var(--cp-blue-rgb), 0.14) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--cp-navy-card) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text-on-dark);
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    background-color: var(--cp-navy-surface) !important;
    border-color: var(--cp-navy-border) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--cp-navy-surface) !important;
    border-color: var(--cp-navy-border) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--cp-muted);
}

[data-bs-theme="dark"] .page-content,
[data-bs-theme="dark"] .main-content {
    background-color: var(--cp-navy-bg) !important;
}

[data-bs-theme="dark"] .doc-preview-wrapper,
[data-bs-theme="dark"] .client-preview-page {
    background: var(--cp-navy-bg) !important;
}

[data-bs-theme="dark"] .nav-tabs-custom .nav-link {
    color: var(--cp-muted);
}

[data-bs-theme="dark"] .nav-tabs-custom .nav-link.active {
    color: var(--cp-blue);
    border-bottom-color: var(--cp-blue);
}

[data-bs-theme="dark"] .mobile-table-card,
[data-bs-theme="dark"] .border.rounded-3.p-3.bg-white,
[data-bs-theme="dark"] .border.rounded.shadow-sm.bg-white {
    background-color: var(--cp-navy-card) !important;
}

[data-bs-theme="dark"] .btn-subtle-secondary {
    --tb-btn-color: #b8c4de !important;
    --tb-btn-bg: rgba(154, 168, 199, 0.18) !important;
    --tb-btn-border-color: rgba(154, 168, 199, 0.24) !important;
    --tb-btn-hover-color: var(--cp-text) !important;
    --tb-btn-hover-bg: rgba(154, 168, 199, 0.32) !important;
    --tb-btn-hover-border-color: rgba(154, 168, 199, 0.38) !important;
    --tb-btn-active-color: var(--cp-text) !important;
    --tb-btn-active-bg: rgba(154, 168, 199, 0.38) !important;
    background-color: rgba(154, 168, 199, 0.18) !important;
    border: 1px solid rgba(154, 168, 199, 0.24) !important;
    color: #b8c4de !important;
}

[data-bs-theme="dark"] .btn-subtle-secondary:hover,
[data-bs-theme="dark"] .btn-subtle-secondary:focus,
[data-bs-theme="dark"] .btn-subtle-secondary:active {
    background-color: rgba(154, 168, 199, 0.32) !important;
    border-color: rgba(154, 168, 199, 0.38) !important;
    color: var(--cp-text) !important;
}

[data-bs-theme="dark"] .btn-subtle-dark {
    --tb-btn-color: var(--cp-muted) !important;
    --tb-btn-bg: rgba(154, 168, 199, 0.14) !important;
    background-color: rgba(154, 168, 199, 0.14) !important;
    color: var(--cp-muted) !important;
}

[data-bs-theme="dark"] .btn-subtle-light {
    --tb-btn-color: var(--cp-text-on-dark) !important;
    --tb-btn-bg: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--cp-text-on-dark) !important;
}

[data-bs-theme="dark"] .btn-subtle-primary.btn-icon,
[data-bs-theme="dark"] .btn-subtle-secondary.btn-icon,
[data-bs-theme="dark"] .btn-subtle-success.btn-icon,
[data-bs-theme="dark"] .btn-subtle-info.btn-icon,
[data-bs-theme="dark"] .btn-subtle-warning.btn-icon,
[data-bs-theme="dark"] .btn-subtle-danger.btn-icon,
[data-bs-theme="dark"] .btn-subtle-dark.btn-icon,
[data-bs-theme="dark"] .btn-subtle-light.btn-icon {
    box-shadow: none !important;
}

.card > .card-header.border-bottom-dashed,
.card > .card-header.border-bottom.border-bottom-dashed,
.card > .card-header.border-bottom:not(.pb-0):not(.mb-0) {
    margin-bottom: 1rem !important;
}

.card > .card-header .row.mb-3:last-child,
.card > .card-header .row.g-2.mb-3:last-child,
.card > .card-header .row.g-2.mb-2:last-child {
    margin-bottom: 0 !important;
}
