@property --sidebar-width {
    syntax: "<length>";
    inherits: true;
    initial-value: 260px;
}

.sidebar {
    /* sidebar width is driven by a CSS variable so the page wrapper can compute its width */
    width: var(--sidebar-width, 300px);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0; /* Hide sidebar to the right initially */
    left: auto;
    z-index: 999;
    transition: transform 0.3s linear;
    padding-top: 100px;
    padding-bottom: 40px;
    .sidebar-inner {
        overflow-y: scroll;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}
.sidebar * {
    transition: all 0.2s linear !important;
}
.progress {
    max-height: 10px;
    .progress-bar {
        border-radius: 5px;
    }
}
.alert-modal .modal-dialog {
    max-width: 400px;
}
.btn-primary {
    color: #fff !important;
}
.circle-badge.bg-danger {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: solid 1px #fff;
    right: 15%;
}
.circle-badge.bg-success {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: solid 3px #fff;
    right: 0%;
}
.root,
:root {
    /* default sidebar width used across the layout */
    --sidebar-width: 300px;
}
.main-container {
    --sidebar-width: 300px;
    transition: --sidebar-width 220ms linear;
}
.main-container {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar content";
    grid-template-rows: 80px 1fr;
    /* use the CSS variable so the layout tracks the sidebar width */
    grid-template-columns: var(--sidebar-width) 1fr;
}

.page-wrapper {
    grid-area: content;
    background-color: #f5f5f5;
    /* make page-wrapper take viewport width minus sidebar width */
    width: calc(100vw - var(--sidebar-width) - 15px);
    box-sizing: border-box;
}
/* .upper-sidebar{
    width: 250px;
} */
.sidebar a {
    display: block;
    color: #000;
    text-decoration: none;
}
.float-left {
    float: left;
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    gap: 5px;
}
.header .search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}
.header .search-box input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}
.header .search-box input:focus {
    background-color: #d8d8d873 !important;
}
.header .search-box i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.aspect-ratio img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.sidebar-item path {
    fill: #727272;
}

table * {
    text-wrap: nowrap;
}
.sidebar-item.active,
.sidebar-item:hover {
    background-color: var(--gray-200);
    span {
        font-weight: 600;
        color: #000 !important;
    }
    small {
        background-color: #fff !important;
    }
}

.sidebar-item.active path,
.sidebar-item:hover path {
    fill: var(--bs-primary);
}
.sidebar-child-item {
    transition: all 0.2s !important;
}
.sidebar-child-item:hover,
.sidebar-child-item.active {
    color: var(--bs-primary) !important;
}
.sidebar-child-item.active {
    font-weight: bold !important;
}
.rotate-icon {
    transition: transform 0.3s ease;
}

.rotate-icon.rotate {
    transform: rotate(-180deg);
}
.header-button {
    width: 35px;
    height: 35px;
}
.header-button path {
    fill: #727272;
}
.header-button:focus path,
.header-button:active path,
.header-button:hover path {
    fill: var(--bs-primary);
}
.remaining-models {
    top: 18%;
    right: 40%;
}
.mx-140 {
    max-width: 140px;
}

.number-remind {
    width: 15px;
    height: 15px;
}
.file-preview {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
.page-item.active a {
    background-color: var(--bs-dark) !important;
    border-color: var(--bs-dark) !important;
}
.shadow-sm {
    box-shadow: var(--bs-box-shadow-sm) !important;
}
.shadow {
    box-shadow: var(--bs-box-shadow) !important;
}
.custom-card {
    background-color: #fff;
    border-radius: var(--bs-border-radius);
    /* box-shadow: var(--bs-box-shadow-sm) !important; */
    border-width: var(--bs-border-width);
    border-style: var(--bs-border-style);
    border-color: var(--gray-200);
}
@media (min-width: 768px) {
    /* collapse button */
    .collapse-btn {
        position: absolute;
        top: 85px; /* sits under the fixed header */
        left: -14px; /* RTL: button near inner edge */
        width: 28px;
        height: 28px;
        border-radius: 8px;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* collapsed layout: shrink sidebar and hide text */
    .main-container.is-collapsed {
        --sidebar-width: 72px;
    }
    .main-container.is-collapsed .sidebar {
        width: var(--sidebar-width);
    }
    .main-container.is-collapsed .sidebar .sidebar-items .sidebar-item {
        gap: 0 !important;
        padding-inline: 0.75rem !important;
    }

    .main-container.is-collapsed .sidebar .sidebar-inner {
        padding: 8px !important;
    }
    .main-container.is-collapsed .sidebar .sidebar-package .sidebar-container {
        margin-right: 0px !important;
        margin-left: 0px !important;
        .inner-col {
            flex-direction: column !important;
        }
    }
    .sidebar .sidebar-items .sidebar-item {
        width: 260px;
        gap: 12px;
        transition: all 220ms linear;
    }
    /* kill transitions during first paint */
    .no-transitions .main-container,
    .no-transitions .sidebar,
    .no-transitions .sidebar .sidebar-items .sidebar-item,
    .no-transitions .sidebar .sidebar-text,
    .no-transitions #collapseSidebarBtn i {
        transition: none !important;
    }
    .sidebar-package .lower-div {
        overflow-x: hidden;
    }
    .sidebar .sidebar-text {
        opacity: 1;
        transform: scale(1);
        transition: opacity 160ms linear, transform 160ms linear;
        white-space: nowrap;
    }
    .main-container.is-collapsed .sidebar .sidebar-text {
        display: none !important;
    }
    .main-container.is-collapsed .sidebar .icon-container img {
        width: 24px;
        height: 24px;
    }

    .main-container.is-collapsed .sidebar .sidebar-items .sidebar-item {
        gap: 0;
        width: 47px;
    }
    .main-container.is-collapsed .sidebar .sidebar-text {
        opacity: 0;
        transform: scale(0.5);
        pointer-events: none;
    }
    #collapseSidebarBtn i {
        transition: transform 200ms ease;
    }
    /* rotate arrow when collapsed (RTL sidebar on the right) */
    .main-container.is-collapsed #collapseSidebarBtn i {
        transform: rotate(180deg);
    }
}

@media (min-width: 576px) {
    .modal-dialog.modal-dialog-centered.search-modal {
        max-width: 700px !important;
    }
}

@media (max-width: 768px) {
    .number-remind {
        width: 10px;
        height: 10px;
    }
    .header-button {
        width: 32px;
        height: 32px;
    }
    /* on small screens make sidebar width a percentage and update the CSS variable */
    :root {
        --sidebar-width: 75%;
    }
    .sidebar {
        width: var(--sidebar-width) !important;
        /* hide to the right by the same amount so transform works consistently */
        right: calc(-1 * var(--sidebar-width));
        padding-bottom: 100px;
        z-index: 333333;
    }
    .sidebar.show {
        transform: translateX(-100%); /* Slide sidebar in */
    }
    .upper-sidebar {
        width: fit-content;
    }
    .main-container {
        grid-template-areas:
            "header header"
            "content content";
        grid-template-columns: 1fr;
    }
    .page-wrapper {
        width: 100vw;
    }
    .offcanvas-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        transform: translateX(100%);
        /* transition: all 0.15s linear !important; */
    }
    .offcanvas-overlay.active {
        transform: translateX(0) !important;
    }
}

.unit-card input[type="radio"]:checked {
    /* Do nothing here, but trigger sibling selector */
}

.unit-card input[type="radio"]:checked + span,
.unit-card input[type="radio"]:checked ~ .unt-content,
.unit-card input[type="radio"]:checked {
    /* apply styles individually */
}

.unit-card input[type="radio"]:checked {
    outline: none; /* optional */
}

/* Or just target parent label on :has */
label.unit-card:has(input[type="radio"]:checked) {
    border-color: var(--blue-400) !important;
}
