body {
    background-color: var(--kpxc-background-color);
    color: var(--kpxc-text-color);
    font-size: 14px;
    max-width: 1440px;
}

a {
    color: var(--kpxc-link-color);
    text-decoration: none !important;
}

h1, span.menu-item {
    font-size: 0.65rem;
}

footer {
    font-size: 0.65rem !important;
}

a:hover {
    color: var(--kpxc-link-hover-color);
}

pre {
    background-color: var(--kpxc-background-color);
    color: var(--kpxc-text-color);
}

main {
    background: var(--kpxc-background-color);
}

input {
    background-color: var(--kpxc-background-color) !important;
    border-color: var(--kpxc-input-main-border-color) !important;
    color: var(--kpxc-text-color) !important;
}

input[type="range"] {
    background-color: var(--kpxc-card-background-color) !important;
    border-color: var(--kpxc-input-main-border-color) !important;
    color: var(--kpxc-text-color) !important;
}

input[type="range"]::-moz-range-thumb {
    background-color: green;
}

input[type="range"]::-webkit-slider-thumb {
    background-color: green;
}

input:active {
    border-color: var(--kpxc-input-active-border-color);
}

input:invalid {
    border: 2px solid red;
}

input:disabled {
    opacity: .3!important;
}

footer {
    display: none;
    bottom: 1rem;
}

select {
    background-color: var(--kpxc-input-background-color) !important;
    color: var(--kpxc-text-color) !important;
}

select option {
    background-color: var(--kpxc-input-background-color);
    color: var(--kpxc-text-color);
}

pre {
    white-space: pre-line;
}

.table > caption {
    color: var(--kpxc-text-color);
}

.table-sm>:not(caption)>*>* {
    padding: 0.25rem 0.5rem;
}

.table > thead,
tbody {
    color: var(--kpxc-text-color);
}

.table>:not(caption)>*>* {
    color: var(--kpxc-text-color);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: var(--kpxc-table-odd-color);
    background-color: var(--kpxc-table-odd-color);
    color: var(--kpxc-text-color);
}

.table-striped > tbody > tr:nth-of-type(odd) input[type="checkbox"] {
    background-color: var(--kpxc-card-background-color) !important;
    border-color: var(--kpxc-input-main-border-color) !important;
    color: var(--kpxc-text-color) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) .form-check-input:checked {
    background-color: var(--kpxc-checkbox-background-color) !important;
}

.table-striped > tbody > tr:nth-of-type(even) input[type="url"] {
    --bs-table-bg-type: var(--kpxc-card-background-color) !important;
    background-color: var(--bs-table-bg) !important;
    color: var(--kpxc-text-color) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) input[type="url"] {
    --bs-table-bg-type: var(--kpxc-table-odd-color) !important;
    background-color: var(--kpxc-table-odd-color) !important;
    color: var(--kpxc-text-color) !important;
}

.table tbody td {
    vertical-align: middle;
}

/* Hide the row saying that the table is empty when there are other rows */
table tbody tr.empty:not(:nth-last-child(2)) {
  display: none;
}

#tab-site-preferences td:nth-of-type(2),
#tab-site-preferences td:nth-of-type(2) select {
    width: 200px;
}

#tab-site-preferences td:nth-of-type(3),
#tab-site-preferences td:nth-of-type(4),
#tab-site-preferences td:nth-of-type(5),
table td:last-of-type {
    width: 1px;
}

.close {
    color: var(--kpxc-text-color);
}

.card {
    background-color: var(--kpxc-card-background-color);
    border-color: var(--kpxc-card-border-color);
    overflow: hidden; /* fix border radius looking fuzzy */
}

.card-header {
    background-color: var(--kpxc-card-header-color);
    color: var(--kpxc-text-color);
}

.card-body {
    background-color: var(--kpxc-card-background-color);
    color: var(--kpxc-text-color);
}

.form-check-input:checked {
    background-color: var(--kpxc-checkbox-color) !important;
}

.form-switch > .form-check-input:checked {
    background-color: green !important;
}

.help-text {
    margin-left: 1.725em;
}

.invalid-feedback {
    color: var(--kpxc-link-color);
}

.invalid-feedback code {
    color: var(--kpxc-link-hover-color) !important;
}

.fa {
    margin-right: 0.2rem;
}

.sidebar {
    background-color: var(--kpxc-sidebar-background-color) !important;
    height: 50px;
    bottom: 0;
    position: fixed;
    top: 0;
    z-index: 100;
}

.sidebar a {
    border: 1px solid transparent;
}

#sidebar {
    background-color: var(--kpxc-sidebar-background-color) !important;
}

.nav-item,
.sidebar-heading {
    font-size: .75rem;
}

.active > a {
    border-color: currentColor;
    border-radius: var(--bs-border-radius-sm);
    color: #a0a0a0 !important;
}

.collapse.show {
    display: block !important;
}

.invalid-feedback {
    font-size: 95% !important;
}

.modal-content {
    background: var(--kpxc-background-color);
    color: var(--kpxc-text-color);
}

.site-preferences-input {
    border: 0;
    border-bottom-right-radius: 4px !important;
    border-top-right-radius: 4px !important;
    padding-left: 0;
}

.site-preferences-input:disabled {
    opacity: 1 !important;
    pointer-events: none;
}

button#sitePreferencesEditUrl {
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
}

button#sitePreferencesCancelEdit {
    border-bottom-left-radius: 4px !important;
    border-top-left-radius: 4px !important;
}

.btn-success {
    --bs-btn-bg: green !important;
    --bs-btn-border-color: green !important;
    --bs-btn-hover-bg: green !important;
    --bs-btn-hover-border-color: green !important;
}

.btn-success:hover {
    filter: brightness(88%) !important;
}

@media (min-width: 768px) {
    .sidebar {
        height: auto;
    }

    footer {
        display: block;
    }
}

@media (min-width: 1440px) {
    .sidebar {
        width: 240px;
    }

    footer {
        display: block;
    }
}
