:root {
    /* Height of the sticky header; main.js overwrites it with the measured value.
       The side menu sticks right under it (see the #side-menu block below). */
    --tp-navbar-h: 3.25rem;
    --tp-menu-w: 12.5rem;
    --tp-shade-1: #0f1321;
    --tp-shade-2: #1c223c;
    --tp-shade-3: #283256;
    --tp-shade-4: #354171;
    --tp-shade-5: #42508c;
    --tp-shade-6: #4e60a6;
    --tp-shade-7: #6575b7;
    --tp-shade-8: #808dc3;
    --tp-shade-9: #a8b1d6;
    --tp-shade-10: #c2c9e3;
}

.btn-menu {
    margin: 0.2rem 0.2rem;
}
header.navbar {
    background-color: white;
}

.navbar-nav .btn-logout:hover,
.navbar-nav .btn-dashboard {
    color: var(--bs-white);
}


.navbar-nav .btn-admin:hover {
    color: var(--bs-white);
}

.navbar-nav .btn-login {
    color: var(--bs-white);
}

.template {
    display: none !important;
}

.transparent,
.m-transparent {
    opacity: 0 !important;
}


.toast .toast-countdown {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: inline-block;
}

.toast .toast-countdown circle {
    fill: none !important;
    stroke: #fff !important;
    stroke-width: 2.5 !important;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;

    stroke-dasharray: 56.55;
    stroke-dashoffset: 0;

    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.toast .toast-countdown circle.animate {
    animation-name: toast-countdown;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes toast-countdown {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: 56.55;
    }
}

@font-face {
    font-family: AvianoSans;
    src: url(/static/fonts/AvianoSans.eot);
    src: url(/static/fonts/AvianoSans.ttf);
    src: url(/static/fonts/AvianoSans.woff);
}

@font-face {
    font-family: AvianoSansLight;
    src: url(/static/fonts/AvianoSansLight.eot);
    src: url(/static/fonts/AvianoSansLight.ttf);
    src: url(/static/fonts/AvianoSansLight.woff);
}

.btn-primary,
.btn-danger {
    color: var(--bs-white);
}

.table .btn-success {
    background-color: var(--bs-success);
    color: var(--bs-white);
}

.table .btn-success:hover {
    background-color: var(--bs-white) !important;
    color: var(--bs-success);
}

.btn-success:hover {
    color: var(white) !important;
    background-color: var(--bs-success) !important;
}

#side-menu {
    .nav-item .nav-link {
        color: black;
        font-weight: normal;
        font-size: 1rem;
    }

    .nav-item .nav-link svg {
        margin-top: -.2rem;
    }

    .nav-item .nav-link.active {
        font-weight: bold;
        color: var(--bs-primary);
    }

    .nav-item .nav-link.inactive {
        color: gray;
        font-weight: normal;
    }

    /* Fixed side menu (2026-11-23): the page scrolls inside <main>, the menu does
       not follow. The sticky element is the inner wrapper — the <nav> column is
       stretched to the full row height by Bootstrap, so a sticky on it would have
       no room to move. Its height is the viewport minus the sticky header, and the
       list scrolls inside it, which is what keeps the collapse button at the
       bottom reachable on long menus. `--tp-navbar-h` is measured by main.js
       (fonts/padding decide the header height, so it is not a hard number). */
    @media (min-width: 768px) {
        .sidebar-sticky {
            position: sticky;
            top: var(--tp-navbar-h);
            height: calc(100vh - var(--tp-navbar-h));
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .sidebar-nav {
            flex: 1 1 auto;
            overflow-y: auto;
            /* Bootstrap .nav ships flex-wrap: wrap; in a column that is bounded in
               height (the sticky wrapper) the last items would wrap into a second
               column beside the menu instead of scrolling — and Bootstrap's .row
               negative margins make that direction scrollable too */
            flex-wrap: nowrap;
            overflow-x: hidden;
            overscroll-behavior: contain;
        }

        .sidebar-footer {
            flex: 0 0 auto;
            justify-content: flex-end;
            padding: .5rem .75rem .25rem;
            border-top: 1px solid var(--bs-border-color, #dee2e6);
            margin-top: .25rem;
        }

        .sidebar-collapse-btn {
            color: var(--bs-secondary-color, #6c757d);
            border: 1px solid transparent;
            border-radius: 999px;
            line-height: 1;
            transition: color .15s ease, background-color .15s ease;
        }

        .sidebar-collapse-btn:hover {
            color: var(--bs-primary);
            background-color: rgba(13, 110, 253, .08);
        }

        .sidebar-collapse-btn .bi {
            display: inline-block;
            transition: transform .2s ease;
        }

        /* narrow icon rail: labels disappear, icons centre, main takes the room */
        .menu-label {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .menu-icon {
            text-align: center;
        }

        /* transition only the widths; `flex` alone would snap on `0 0 auto` */
        transition: flex-basis .18s ease, width .18s ease, max-width .18s ease;
    }
}

/* body.tp-menu-collapsed is set by main.js (toggle at the bottom of the menu,
   remembered in localStorage). Widths are the ones Bootstrap put on the columns
   (col-lg-2 / col-lg-10) with the menu squeezed to a rail — the main column
   follows with the same transition so the page does not jump. */
@media (min-width: 768px) {
    body.tp-menu-collapsed #side-menu {
        flex: 0 0 auto;
        width: 3.5rem;
        max-width: 3.5rem;
    }

    body.tp-menu-collapsed #main-content {
        flex: 0 0 auto;
        width: calc(100% - 3.5rem);
        max-width: calc(100% - 3.5rem);
        transition: flex-basis .18s ease, width .18s ease, max-width .18s ease;
    }

    body.tp-menu-collapsed #side-menu .menu-label {
        display: none;
    }

    body.tp-menu-collapsed #side-menu .nav-link .row {
        margin: 0;
        --bs-gutter-x: 0;
    }

    body.tp-menu-collapsed #side-menu .menu-icon {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body.tp-menu-collapsed #side-menu .sidebar-footer {
        justify-content: center;
        padding-inline: .25rem;
    }

    body.tp-menu-collapsed #side-menu .sidebar-collapse-btn .bi {
        transform: rotate(180deg);
    }
}

li {
    .nav-link {
        color: lightgray;
    }

    .nav-link.active {
        color: var(--bs-primary);
        font-weight: bold;
    }

    .nav-link.active:hover {
        color: black;
    }

    .nav-link:hover {
        color: gray;
    }
}

input[type="checkbox"] {
    /* Add if not using autoprefixer */
    -webkit-appearance: none;
    /* Remove most all native input styles */
    appearance: none;
    /* For iOS < 15 */
    background-color: rgba(224, 224, 224, 0.5);
    /* Not removed via appearance */
    margin: 0;

    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid currentColor;
    border-radius: 0.15em;
    transform: translateY(-0.075em);

    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transform-origin: bottom left;
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #0b3443;
    /* Windows High Contrast Mode */
    background-color: CanvasText;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}

input[type="checkbox"]:disabled {
    --form-control-color: #959495;

    color: #959495;
    cursor: not-allowed;
}
input[type="checkbox"] {
    cursor: pointer;
    pointer-events: auto;
}
.context-menu {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 160px;
}

.context-menu-item {
    padding: 8px 14px;
    cursor: pointer;
}

.context-menu-item:hover {
    background: #f2f2f2;
}

.btn-xs{--bs-btn-padding-y:0.15rem;--bs-btn-padding-x:0.5rem;--bs-btn-font-size:0.675rem;--bs-btn-border-radius:var(--bs-border-radius-sm)}