/* Shared color theme. Geometry belongs to the existing CRM styles. */
.crm-theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.crm-theme-toggle:focus-visible { outline: 3px solid #69b3ff; outline-offset: 2px; }
.crm-theme-toggle svg { flex-shrink: 0; color: inherit; }
.crm-theme-sun, html[data-crm-theme="dark"] .crm-theme-moon { display: none; }
html[data-crm-theme="dark"] .crm-theme-sun { display: block; }
.crm-login-theme { position: absolute; right: 20px; top: 20px; z-index: 10; }
@media (max-width: 991.98px) { .crm-theme-caption { display: none; } }
@media screen {
html[data-crm-theme="dark"] {
    color-scheme: dark;
    --crm-bg: #111827; --crm-surface: #1b2535; --crm-soft: #253247;
    --crm-text: #e5eaf3; --crm-muted: #acb8ca; --crm-border: #3a4960;
    --crm-link: #79b9ff; --crm-modal-border: #3a4960; --crm-modal-muted: #acb8ca;
    background: var(--crm-bg);
}
html[data-crm-theme="dark"] body { background: var(--crm-bg); color: var(--crm-text); }
html[data-crm-theme="dark"] :is(.card, .card-header, .card-footer, .modal-content, .offcanvas, .dropdown-menu, .popover, .popover-header, .popover-body, .crm-home-link, .list-group-item) { background-color: var(--crm-surface); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(#kt_header, #kt_footer, .bg-white, .bg-light, .bg-gray-100, .bg-gray-200) { background-color: var(--crm-surface) !important; }
html[data-crm-theme="dark"] :is(.border, .border-top, .border-bottom, .border-left, .border-right, .separator, .modal-header, .modal-footer, hr) { border-color: var(--crm-border) !important; }
html[data-crm-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.modal-title,.card-title,.text-dark,.text-dark-25,.text-dark-50,.text-dark-65,.text-dark-75,.text-gray-900,.text-gray-800,.text-gray-700) { color: var(--crm-text) !important; }
html[data-crm-theme="dark"] :is(.text-muted,.text-gray-500,.text-gray-600,.form-text,.crm-search-status) { color: var(--crm-muted) !important; }
html[data-crm-theme="dark"] :is(a:not(.btn):not(.menu-link):not(.billing-channel-option):not(.nav-link), .text-primary, .text-hover-primary:hover) { color: var(--crm-link); }
html[data-crm-theme="dark"] .table { color: var(--crm-text) !important; }
html[data-crm-theme="dark"] :is(.table th,.table td,.table thead th,.table.table-head-custom thead th,.table.table-head-custom thead tr) { color: inherit; border-color: var(--crm-border); }
html[data-crm-theme="dark"] .table.table-head-custom thead :is(th,tr) { color: var(--crm-muted) !important; }
html[data-crm-theme="dark"] :is(.table-striped tbody tr:nth-of-type(odd),.table-active,.table-active > td,.table-active > th) { background-color: var(--crm-soft); }
html[data-crm-theme="dark"] :is(.table-hover tbody tr:hover,.table-hover tbody tr:hover td,#reportTable tbody tr:hover td,th.sortable:hover,#reportTable tbody td.sorted) { background-color: var(--crm-soft) !important; color: var(--crm-text); }
html[data-crm-theme="dark"] :is(.table .thead-light th,.table .thead-dark th) { background: var(--crm-soft); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.form-control,.custom-select,.input-group-text,.form-control.form-control-solid,.bootstrap-select > .dropdown-toggle,.select2-container--default .select2-selection--single,.select2-container--default .select2-selection--multiple,.select2-dropdown,.select2-search__field,.dropdown-item,.dropdown-header) { background-color: var(--crm-soft); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.form-control,.custom-select):focus { border-color: var(--crm-link); box-shadow: 0 0 0 2px #79b9ff33; }
html[data-crm-theme="dark"] :is(.form-control:disabled,.form-control[readonly]) { background: var(--crm-bg); color: var(--crm-muted); }
html[data-crm-theme="dark"] :is(input,textarea)::placeholder { color: var(--crm-muted); opacity: 1; }
html[data-crm-theme="dark"] :is(.select2-container--default .select2-selection__rendered,.select2-container--default .select2-selection__placeholder,.select2-results__option,.bootstrap-select .filter-option) { color: var(--crm-text); }
html[data-crm-theme="dark"] :is(.dropdown-item:hover,.dropdown-item:focus,.select2-results__option[aria-selected=true]) { background: #344762; color: white; }
html[data-crm-theme="dark"] :is(.checkbox > span,.radio > span) { background-color: var(--crm-soft); border: 1px solid var(--crm-border); }
html[data-crm-theme="dark"] :is(.checkbox > input:checked ~ span,.radio > input:checked ~ span) { background-color: #3699ff; border-color: #3699ff; }
html[data-crm-theme="dark"] :is(.btn-light,.btn-clean,.btn-secondary,.btn-default,.page-link,.nav-tabs .nav-link) { background-color: var(--crm-soft); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.btn-light-primary,.label-light-primary,.bg-light-primary) { background-color: #203f60 !important; color: #9aceff !important; }
html[data-crm-theme="dark"] :is(.btn-light-info,.label-light-info,.bg-light-info) { background-color: #3b2e61 !important; color: #d6baff !important; }
html[data-crm-theme="dark"] :is(.btn-light-success,.label-light-success,.bg-light-success) { background-color: #153f3b !important; color: #72e1cf !important; }
html[data-crm-theme="dark"] :is(.btn-light-warning,.label-light-warning,.bg-light-warning) { background-color: #4b391c !important; color: #ffcd75 !important; }
html[data-crm-theme="dark"] :is(.btn-light-danger,.label-light-danger,.bg-light-danger) { background-color: #502936 !important; color: #ff9dac !important; }
html[data-crm-theme="dark"] :is(.text-danger,.invalid-feedback,.crm-field-error) { color: #ff98ab !important; }
html[data-crm-theme="dark"] .text-success { color: #66ddc6 !important; }
html[data-crm-theme="dark"] .text-warning { color: #ffce7b !important; }
html[data-crm-theme="dark"] .text-info { color: #c8a9ff !important; }
html[data-crm-theme="dark"] :is(.btn:disabled,.btn.disabled) { opacity: .55; }
html[data-crm-theme="dark"] :is(.nav-tabs .nav-link.active,.page-item.active .page-link) { background-color: #285e9b; color: white; border-color: #5089c9; }
html[data-crm-theme="dark"] :is(.nav-tabs,.nav-line-tabs) { border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.alert-light,.alert-secondary,.alert-custom.alert-light-primary) { background: var(--crm-soft); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.alert-danger,.alert-custom.alert-light-danger) { background: #502936; color: #ffd4dd; }
html[data-crm-theme="dark"] :is(.alert-warning,.alert-custom.alert-light-warning) { background: #4b391c; color: #ffe0a7; }
html[data-crm-theme="dark"] :is(.alert-success,.alert-custom.alert-light-success) { background: #153f3b; color: #a1efdf; }
html[data-crm-theme="dark"] :is(.close,.btn i) { color: inherit; }
html[data-crm-theme="dark"] .billing-hub { --billing-surface: var(--crm-surface); --billing-soft: var(--crm-soft); --billing-muted: var(--crm-muted); --billing-border: var(--crm-border); }
html[data-crm-theme="dark"] :is(.billing-summary-card,.billing-detail-card,.billing-breakdown-section) { background: var(--crm-surface); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.billing-filter-form,.billing-breakdown-row > td,#billingDraftModal .billing-kaspi-bulk-toolbar,#billingDraftModal .billing-kaspi-client-list thead th) { background: var(--crm-soft); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.billing-summary-card strong,.billing-detail-card strong,.billing-month-field .form-control) { color: var(--crm-text); }
html[data-crm-theme="dark"] :is(.billing-summary-card span,.billing-detail-card span,.billing-table th) { color: var(--crm-muted); }
html[data-crm-theme="dark"] .billing-summary-danger strong { color: #ff98ab; }
html[data-crm-theme="dark"] .billing-summary-success strong { color: #66ddc6; }
html[data-crm-theme="dark"] :is(.billing-status-neutral,.billing-status-muted) { background: var(--crm-soft); color: var(--crm-muted); }
html[data-crm-theme="dark"] .billing-status-success { background: #153f3b; color: #72e1cf; }
html[data-crm-theme="dark"] .billing-status-warning { background: #4b391c; color: #ffcd75; }
html[data-crm-theme="dark"] .billing-status-danger { background: #502936; color: #ff9dac; }
html[data-crm-theme="dark"] .crm-home-link span { color: var(--crm-muted); }
html[data-crm-theme="dark"] :is(.datepicker,.daterangepicker,.flatpickr-calendar,.dt-button-collection,.swal2-popup) { background: var(--crm-surface); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] :is(.daterangepicker .calendar-table,.daterangepicker td.off,.datepicker table tr td.day:hover,.datepicker table tr td.active,.swal2-title,.swal2-content) { background: var(--crm-soft); color: var(--crm-text); }
html[data-crm-theme="dark"] :is(.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_paginate) { color: var(--crm-muted); }
html[data-crm-theme="dark"] :is(label,.billing-definition dd) { color: var(--crm-text); }
html[data-crm-theme="dark"] .modal :is(.modal-header,.modal-footer) { background: var(--crm-surface); }
html[data-crm-theme="dark"] .modal .form-group label { color: var(--crm-text); }
html[data-crm-theme="dark"] .bootstrap-select > .dropdown-toggle.btn-light { background-color: var(--crm-soft) !important; color: var(--crm-text) !important; border-color: var(--crm-border) !important; }
html[data-crm-theme="dark"] .bootstrap-select > .dropdown-toggle .filter-option { color: var(--crm-text) !important; }
html[data-crm-theme="dark"] .crm-theme-toggle.btn { background-color: var(--crm-soft) !important; color: var(--crm-text) !important; border-color: var(--crm-border) !important; }
html[data-crm-theme="dark"] .tt-menu { background: var(--crm-surface); color: var(--crm-text); border-color: var(--crm-border); }
html[data-crm-theme="dark"] .tt-suggestion:hover { background: var(--crm-soft); }
html[data-crm-theme="dark"] .login-aside { background-color: #263349 !important; }
html[data-crm-theme="dark"] .login-aside h3 { color: #e5eaf3 !important; }
}
@media print { .crm-theme-toggle { display: none !important; } }
