/*
 * App rules that Tabler does not cover.
 * Rewrite Tabler CSS as needed.
 */

/* Fonts */

:root {
    --tblr-font-sans-serif: 'Inter', sans-serif;
    --tblr-line-height-h6: 1rem;
    --tblr-info: var(--tblr-purple);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.border-0 {
    box-shadow: none;
}

/* Forms */

.col-auto .form-check:last-child {
    margin-bottom: 0;
}

.form-check.form-check-inline {
    margin-bottom: 0;
}

.form-control-color {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border-radius: .25rem;
}

legend {
    font-size: var(--tblr-font-size-h2);
    margin-bottom: 1rem;
}

/* Code block with a copy button inside the pre */

.clipboard-snippet {
    white-space: normal;
}

.clipboard-snippet > code {
    min-width: 0;
    white-space: pre;
}

/* Tables */

.table thead th {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.table thead th:first-child {
    border-top-left-radius: var(--tblr-border-radius);
}

.table thead th:last-child {
    border-top-right-radius: var(--tblr-border-radius);
}

.table thead a {
    color: var(--tblr-body-color);
}

.table thead a:hover {
    text-decoration: none;
}

.table thead th a.asc,
.table thead th a.desc {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.table thead th a.asc::after,
.table thead th a.desc::after {
    opacity: .25;
    font-size: .5rem;
}

.table thead th a.asc::after {
    content: ' ▲';
    margin-left: .25rem;
}

.table thead th a.desc::after {
    content: ' ▼';
    margin-left: .25rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .w-1 {
    width: 1%;
}


/* Description lists */

dt {
    margin-bottom: 0.25rem;
    font-size: var(--tblr-font-size-h5);
    font-weight: var(--tblr-font-weight-normal);
    color: var(--tblr-muted);
}

dd {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {

    dl.dl-horizontal {
        display: flex;
        flex-wrap: wrap;
    }

    dl.dl-horizontal dt {
        width: 9rem;
        margin-right: 1rem;
        margin-bottom: 1rem;
        padding-top: 0.125rem;
    }

    dl.dl-horizontal dd {
        width: calc(100% - 10rem);
    }
}

/* Navs */

.nav-bordered .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    padding-left: .75rem;
    padding-right: .75rem;
}

.nav-bordered .nav-item + .nav-item {
    margin-inline-start: 0;
}

/* Cards */

.card {
    --tblr-card-cap-padding-y: 1rem;
    --tblr-card-cap-bg: var(--tblr-bg-surface);
}

.card-title {
    font-size: var(--tblr-font-size-h3);
}

/* Breadcrumb */

.breadcrumb {
    --tblr-breadcrumb-link-color: var(--tblr-body-color);
    --tblr-breadcrumb-font-size: var(--tblr-font-size-h5);
    --tblr-breadcrumb-item-active-color: var(--tblr-secondary-color);
    --tblr-breadcrumb-item-active-font-weight: var(--tblr-font-weight-normal);
}

/* Page header */

.page-title {
    font-size: var(--tblr-font-size-h1);
}

/* Collapsible filters card */

.filters-card-chevron {
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

.filters-card:has(.collapse.show) .filters-card-chevron {
    transform: rotate(-180deg);
}

/* Sortable trees (modules, option groups, compliance) */

.sortable-row {
    border-bottom: var(--tblr-border-width) solid var(--tblr-border-color);
}

.sortable-row:hover:not(.sortable-head) {
    background-color: var(--tblr-hover-bg);
}

.sortable-handle {
    cursor: grab;
}

.sortable-handle:active {
    cursor: grabbing;
}

.sortable-handle-space {
    width: calc(1em + 0.5rem);
}

.sortable-tick {
    flex: 0 0 4.5rem;
    text-align: center;
    hyphens: auto;
}

.sortable-head .sortable-tick {
    font-size: 0.75rem;
    line-height: 1.2;
}

.sortable-status {
    flex: 0 0 6rem;
    text-align: center;
}

.sortable-actions {
    flex: 0 0 7rem;
}

.sortable-ghost {
    opacity: 0.5;
    background-color: var(--tblr-secondary-bg);
}

/* Folded rail is 4rem wide. Show the mark at the start of the wordmark. */

.navbar-brand-image {
    filter: none !important;
}

@media (min-width: 992px) {
    html[data-bs-sidebar^="folded"] .navbar-vertical .navbar-brand-image {
        width: 2rem;
        height: 1.5rem;
        object-fit: cover;
        object-position: left center;
    }
}

/* Mobile sidenav backdrop. The hidden attribute hides it when the menu is closed. */

.sidenav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1020;
    background-color: rgba(0, 0, 0, 0.45);
}

.sidenav-close {
    display: none;
}

body.sidenav-open .sidenav-close {
    position: absolute;
    top: .5rem;
    left: .5rem;
}

@media (max-width: 991.98px) {
    #app-sidebar {
        position: relative;
        z-index: 1030;
    }

    body.sidenav-open .sidenav-close {
        display: inline-flex;
    }
}

body.sidenav-open {
    overflow: hidden;
}

/* Coloris picker */

.clr-picker {
    z-index: 1020 !important;
}

.clr-field button {
    width: 25px !important;
    height: 25px !important;
    border-radius: 3px !important;
}
