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: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,
tbody,
thead,
tr,
th,
td {
    border-color: var(--kpxc-table-border-color) !important;
}

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

.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 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;
}

.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;
    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);
}

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

    footer {
        display: block;
    }
}

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

    footer {
        display: block;
    }
}
