/* Shared controls used by both full pages and AJAX-loaded modals. */
html[data-app-theme] .btn-primary,
html[data-app-theme] .btn-action {
    background:var(--theme-header-gradient);border-color:var(--theme-brand);color:#fff;
}
html[data-app-theme] .btn-primary:hover,html[data-app-theme] .btn-primary:focus,
html[data-app-theme] .btn-action:hover,html[data-app-theme] .btn-action:focus {
    background:var(--theme-brand-deep);border-color:var(--theme-brand-deep);color:#fff;
}
html[data-app-theme] .form-control:focus {
    border-color:var(--theme-focus);box-shadow:0 0 0 3px var(--theme-page-input-ring);
}
html[data-app-theme] .modal-content {border-color:var(--theme-border-soft);background:var(--theme-surface);}
html[data-app-theme] .modal-header {background:var(--theme-surface-gradient);border-color:var(--theme-border-soft);color:var(--theme-heading);}
html[data-app-theme] .modal-body {background:linear-gradient(180deg,var(--theme-modal-body-top),var(--theme-modal-body-bottom));color:var(--theme-copy);}
html[data-app-theme] .modal-footer {background:var(--theme-modal-footer);border-color:var(--theme-border-soft);}
html[data-app-theme] .nav-tabs > li.active > a,
html[data-app-theme] .nav-tabs > li.active > a:hover,
html[data-app-theme] .nav-tabs > li.active > a:focus {background:var(--theme-soft-accent);border-color:var(--theme-border-soft);color:var(--theme-heading);}
html[data-app-theme] .pagination > .active > a,html[data-app-theme] .pagination > .active > span,
html[data-app-theme] .dropdown-menu > .active > a {background:var(--theme-brand);border-color:var(--theme-brand);color:#fff;}
html[data-app-theme] .dropdown-menu > li > a:hover,html[data-app-theme] .dropdown-menu > li > a:focus {background:var(--theme-soft-accent-alt);color:var(--theme-heading);}
html[data-app-theme] .checkbox input[type=checkbox]:checked + label:before,
html[data-app-theme] .radio input[type=radio]:checked + label:before {background:var(--theme-brand);border-color:var(--theme-brand);}
html[data-app-theme] input[type=checkbox],html[data-app-theme] input[type=radio] {accent-color:var(--theme-brand);}
html[data-app-theme] .datepicker td.active,html[data-app-theme] .datepicker td.active:hover,
html[data-app-theme] .daterangepicker td.active,html[data-app-theme] .daterangepicker td.active:hover {background:var(--theme-brand);color:#fff;}
html[data-app-theme] .select2-container--default .select2-results__option--highlighted[aria-selected] {background:var(--theme-brand);color:#fff;}
html[data-app-theme] .leaflet-popup-content-wrapper {background:var(--theme-surface);color:var(--theme-copy);}
html[data-app-theme] .leaflet-popup-tip {background:var(--theme-surface);}
.app-theme-preview {display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0 12px;}
.app-theme-preview span {display:inline-block;width:38px;height:26px;border:1px solid rgba(0,0,0,.15);border-radius:5px;}
html[data-app-theme] .checkbox-inline input[type=checkbox]:checked + label:before,
html[data-app-theme] .checkbox-inline input[type=radio]:checked + label:before {background:var(--theme-brand);border-color:var(--theme-brand);color:#fff;}
html[data-app-theme] .text-primary {color:var(--theme-brand);}
html[data-app-theme] .nav-pills > li.active > a,
html[data-app-theme] .nav-pills > li.active > a:hover,
html[data-app-theme] .list-group-item.active,
html[data-app-theme] .list-group-item.active:hover {background:var(--theme-brand);border-color:var(--theme-brand);color:#fff;}
html[data-app-theme] .bootstrap-select .dropdown-menu > li.selected > a {background:var(--theme-soft-accent);color:var(--theme-heading);}
html[data-app-theme] .checkbox input:checked:disabled + label:before,
html[data-app-theme] .checkbox-inline input:checked:disabled + label:before {opacity:.5;}
:root {--theme-text:var(--theme-copy);--theme-muted:var(--theme-text-muted);}
/* Success feedback follows company branding, including saved-setting banners. */
html[data-app-theme] .alert.alert-success {
    background:var(--theme-soft-accent-alt);
    border-color:var(--theme-action-border);
    color:var(--theme-heading);
}
html[data-app-theme] .alert.alert-success .alert-link,
html[data-app-theme] .alert.alert-success .close {color:var(--theme-heading);}
html[data-app-theme] .alert.alert-success hr {border-top-color:var(--theme-action-border);}
html[data-app-theme] #toast-container > .toast-success {
    background-color:var(--theme-brand);
    color:#fff;
}
