/* King brand colors. Loaded after the shared template in every site layout.
   The template's original primary accent is #01a9ac; edit this palette here. */
:root {
    --kg-primary: #153b63;
    --kg-primary-hover: #102e4e;
    --kg-primary-light: #2a5684;
    --kg-primary-soft: #eaf0f7;
    --kg-primary-rgb: 21, 59, 99;
    --primary: var(--kg-primary);
}

.label-primary,
.badge-primary,
.label-success,
.badge-success {
    background: var(--kg-primary);
    color: #fff;
}

a.badge-primary:hover,
a.badge-primary:focus,
a.badge-success:hover,
a.badge-success:focus {
    background: var(--kg-primary-hover);
    color: #fff;
}

/* Existing status labels can carry the old brand/status green inline.
   Remap those greens while retaining explicitly chosen red/yellow/etc. */
:is(.label, .badge)[style*="#01a9ac" i],
:is(.label, .badge)[style*="#00ad62" i],
:is(.label, .badge)[style*="rgb(1, 169, 172)" i],
:is(.label, .badge)[style*="rgb(0, 173, 98)" i] {
    background: var(--kg-primary) !important;
    color: #fff;
}

.list-group-item.active,
.page-item.active .page-link,
.pagination > .active > a,
.pagination > .active > span,
.footable .pagination > .active > a,
.footable .pagination > .active > span,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: var(--kg-primary) !important;
    border-color: var(--kg-primary) !important;
    color: #fff !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link,
.md-tabs .nav-item.open .nav-link,
.md-tabs .nav-link.active,
.md-tabs .nav-link.active:hover,
.md-tabs .nav-link.active:focus {
    color: var(--kg-primary) !important;
}

.pcoded[layout-type="dark"] .nav-tabs .nav-link.active,
body.dark .nav-tabs .nav-link.active {
    color: #b1cae6 !important;
}

.nav-tabs .slide {
    background: var(--kg-primary);
}

#styleSelector .nav-tabs {
    border-bottom-color: var(--kg-primary);
}

#styleSelector .nav-tabs .nav-item a.active {
    background: var(--kg-primary);
    color: #fff !important;
}

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled,
.btn-primary.btn-mat,
.wizard > .actions a,
.sweet-alert button.confirm {
    background-color: var(--kg-primary) !important;
    border-color: var(--kg-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle,
.wizard > .actions a:hover,
.wizard > .actions a:focus,
.sweet-alert button.confirm:hover,
.sweet-alert button.confirm:focus {
    background-color: var(--kg-primary-hover) !important;
    border-color: var(--kg-primary-hover) !important;
}

.btn-outline-primary {
    color: var(--kg-primary);
    border-color: var(--kg-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle {
    background-color: var(--kg-primary) !important;
    border-color: var(--kg-primary) !important;
    color: #fff !important;
}

.btn-primary:focus,
.btn-outline-primary:focus,
.form-control:focus {
    box-shadow: 0 0 0 3px rgba(var(--kg-primary-rgb), 0.2) !important;
}

.btn-primary .badge,
.page-link,
.page-link:hover,
.text-primary,
a.text-primary:hover,
a.text-primary:focus {
    color: var(--kg-primary);
}

.text-primary,
.border-primary {
    color: var(--kg-primary) !important;
}

.bg-primary,
.progress-bar-primary {
    background-color: var(--kg-primary) !important;
    color: #fff;
}

a.bg-primary:hover,
a.bg-primary:focus {
    background-color: var(--kg-primary-hover) !important;
    color: #fff;
}

.border-primary,
.form-control:focus,
.checkbox-fade.fade-in-primary .cr,
.checkbox-fade.zoom-primary .cr,
.checkbox-zoom.fade-in-primary .cr,
.checkbox-zoom.zoom-primary .cr,
.radio.radiofill.radio-primary .helper::before,
.radio.radiofill.radio-primary .helper::after,
.radio.radio-outline.radio-primary .helper::before,
.radio.radio-outline.radio-primary .helper::after {
    border-color: var(--kg-primary) !important;
}

.checkbox-fade.fade-in-primary .cr .cr-icon,
.checkbox-fade.zoom-primary .cr .cr-icon,
.checkbox-zoom.fade-in-primary .cr .cr-icon,
.checkbox-zoom.zoom-primary .cr .cr-icon {
    color: var(--kg-primary) !important;
}

.checkbox-primary input[type="checkbox"]:checked + label::before,
.radio.radiofill.radio-primary .helper::after,
.radio.radio-matrial.radio-primary input ~ .helper::before,
.custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--kg-primary);
    border-color: var(--kg-primary);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    color: #fff;
}

/* Select2: the template colors the rendered value and chips separately. */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--kg-primary);
    color: #fff;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection,
.select2-container--default .select2-search__field:focus,
.select2-container--default:focus {
    border-color: var(--kg-primary);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.85);
}

.select2-container--default .select2-selection__choice__remove,
.select2-container--default .select2-selection__choice__remove:hover {
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    background-color: var(--kg-primary-soft);
    color: var(--kg-primary);
}

.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection__rendered,
.select2-container--default.select2-container--disabled .select2-selection__placeholder,
.select2-container--default.select2-container--disabled .select2-selection__choice {
    background-color: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.select2-container--default.select2-container--disabled .select2-selection__arrow b {
    border-top-color: #475569;
}

/* Shared tables and DataTables, including colored header rows and cells. */
.table-primary,
.table-primary > td,
.table-primary > th,
.table-primary > tr > td,
.table-primary > tr > th,
.table-styling .table-primary,
.table-styling.table-primary,
table.dataTable tbody > tr.selected,
table.dataTable tbody > tr > .selected {
    background-color: var(--kg-primary);
    border-color: var(--kg-primary);
    color: #fff;
}

.table-primary a,
table.dataTable tbody > tr.selected a {
    color: inherit;
}

.table-hover .table-primary:hover,
.table-hover .table-primary:hover > td,
.table-hover .table-primary:hover > th {
    background-color: var(--kg-primary-hover);
    color: #fff;
}

table thead .border-bottom-primary th,
table tbody .border-bottom-primary th,
table tbody .border-bottom-primary td {
    border-bottom-color: var(--kg-primary);
}

table.dataTable th.focus,
table.dataTable td.focus {
    outline-color: var(--kg-primary);
}

.card .table-card-header b {
    color: var(--kg-primary);
}

button.dt-button,
div.dt-button,
a.dt-button {
    background-color: var(--kg-primary);
    background-image: none;
    border-color: var(--kg-primary);
    color: #fff;
}

:is(button, div, a).dt-button:is(:hover, :focus, :active, .active):not(.disabled),
div.dt-button-collection :is(button, div, a).dt-button:is(:active, .active):not(.disabled) {
    background-color: var(--kg-primary-hover);
    background-image: none;
    border-color: var(--kg-primary-hover);
    color: #fff;
}

/* FullCalendar v3 is shared by scheduling, tasks and the subcontractor portal. */
.fc th {
    background: var(--kg-primary);
    border-color: var(--kg-primary);
    color: #fff;
}

.fc th a {
    color: inherit;
}

.fc .fc-state-default {
    background-color: #fff;
    background-image: none;
    border-color: #cbd5e1;
    color: var(--kg-primary);
    text-shadow: none;
    box-shadow: none;
}

.fc .fc-state-active,
.fc .fc-state-down {
    background-color: var(--kg-primary);
    border-color: var(--kg-primary);
    color: #fff;
}

.fc .fc-state-default:not(:disabled):not(.fc-state-disabled):hover,
.fc .fc-state-hover:not(:disabled):not(.fc-state-disabled) {
    background-color: var(--kg-primary-hover);
    border-color: var(--kg-primary-hover);
    color: #fff;
}

.fc .fc-state-default:focus {
    outline: none;
}

.fc .fc-state-default:focus-visible {
    outline: 2px solid var(--kg-primary);
    outline-offset: 2px;
}

.fc-unthemed td.fc-today,
.fc-highlight {
    background: var(--kg-primary-soft);
}

/* Inline event/status colors keep their meaning; these are only defaults. */
.fc-event,
.fc .fc-event:not([href]):not([tabindex]),
.fc-event:hover,
.fc-event:focus,
#external-events .fc-event {
    background-color: var(--kg-primary);
    border-color: var(--kg-primary);
    color: #fff;
}

/* The template forces black text on hover. Correct unstyled default events
   without overriding inline colors supplied by individual calendars. */
@media screen {
    .fc .fc-day-grid-event:not([style]):hover {
        color: #fff !important;
    }
}

/* Other shared accents that inherit the old primary color from the template. */
a:hover,
a:focus,
.form-control-primary,
.text-c-blue,
.text-c-lite-green,
.card .card-block a.dropdown-item:not(.active):hover {
    color: var(--kg-primary);
}

.form-control-primary,
.input-group-primary .form-control {
    border-color: var(--kg-primary);
}

.alert-primary {
    background-color: var(--kg-primary-soft);
    border-color: var(--kg-primary);
    color: var(--kg-primary);
}

.background-primary,
.bg-simple-c-blue,
.bg-simple-c-lite-green,
.ms-selectable .custom-header,
.ms-selection .custom-header,
.ms-container .ms-selectable li.ms-hover,
.ms-container .ms-selection li.ms-hover,
.dropdown-item.active,
.dropdown-item:active,
.card .card-block a.dropdown-item:active,
.card .card-block a.dropdown-item .active {
    background-color: var(--kg-primary);
    color: #fff;
}

.bg-c-blue,
.bg-c-lite-green {
    background: linear-gradient(to right, var(--kg-primary), var(--kg-primary-light));
}

.radio .helper::before,
.radio .helper::after,
.border-checkbox-section .border-checkbox-group:where(:not([class*="border-checkbox-group-"])) .border-checkbox-label::before,
.border-checkbox-section .border-checkbox-group:where(:not([class*="border-checkbox-group-"])) .border-checkbox:checked + .border-checkbox-label::after,
.border-checkbox-section .border-checkbox-group-primary .border-checkbox-label::before,
.border-checkbox-section .border-checkbox-group-primary .border-checkbox:checked + .border-checkbox-label::after,
.checkbox-fade .cr,
.checkbox-zoom .cr {
    border-color: var(--kg-primary);
}

.radio .helper::after,
.radio.radiofill .helper::after,
.radio.radio-matrial input:checked ~ .helper::before {
    background-color: var(--kg-primary);
}

.radio.radio-outline .helper::after {
    background-color: #fff;
    border-color: var(--kg-primary);
}

.radio label:hover .helper,
.radio input:checked ~ .helper::before,
.checkbox-fade .cr .cr-icon,
.checkbox-zoom .cr .cr-icon {
    color: var(--kg-primary);
}
