html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .absolute-center {
        min-width: 90vw !important;
    }

    tr {
        display: grid;
        background: var(--bs-white) !important;
        margin-top: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0px 10px 15px -3px rgba(0,0,0,0.1);
        border: 1px solid #dee2e6 !important;
        border-radius: 0.5rem;
    }

        tr > td:first-child {
            border-start-end-radius: 0.5rem;
            border-start-start-radius: 0.5rem;
        }

        tr > td:last-child {
            border-end-end-radius: 0.5rem;
            border-end-start-radius: 0.5rem;
        }

        tr > td {
            --bs-table-accent-bg: var(--bs-white);
            border: none !important;
            border-color: transparent !important;
        }

    .table-striped > tbody > tr:nth-of-type(odd) {
        --bs-table-accent-bg: var(--bs-white);
    }

    thead {
        display: none;
    }

    .table-h-fixed {
        max-height: 100% !important;
    }

    .w-sm-100 {
        width: 100%;
    }

    .link-list-item {
        display: block;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    background-color: #F8F9FA;
    color: #101720;
}

.cursor-pointer {
    cursor: pointer;
}

.absolute-center {
    min-width: 25vw;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fw-semibold {
    font-weight: 500;
}

.table-h-fixed {
    max-height: 62vh;
}

    .table-h-fixed thead {
        position: sticky;
        top: -1px;
    }

input[type="checkbox"][readonly] {
    pointer-events: none;
}

tr > td {
    text-align: center;
}

tr > td {
    align-content: center;
}

.order-details-items .table-h-fixed {
    max-height: 50vh;
}

#webcam-preview {
    display: none;
    background: black;
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.btn-close-reader {
    display: none;
    position: fixed;
    z-index: 1001;
    top: 2rem;
    border-radius: 50%;
    right: 2rem;
}

body.scanning > #webcam-preview, body.scanning > .btn-close-reader {
    display: block !important;
}

body.scanning {
    overflow: hidden;
}

.swal2-popup.swal2-modal.swal2-show:has(.swal-wide) {
    width: 1200px !important;
}

.anim-appear {
    animation: 0.3s ease-out 0s 1 appear;
}

@keyframes appear {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.link-list-item:not(:last-child)::after {
    content: ",";
}

.form-switch.form-switch-lg .form-check-input {
    height: 1.7rem;
    width: calc(2.5rem + 0.75rem);
    border-radius: 4rem;
}

.badge-bg-inprogress {
    background-color: var(--bs-warning);
    color: var(--bs-gray-800);
}

.badge-bg-placed, .badge-bg-editable {
    background-color: var(--bs-primary);
}

.badge-bg-fulfilled, .badge-bg-finalized {
    background-color: var(--bs-success);
}




.lds-spinner,
.lds-spinner div,
.lds-spinner div:after {
    box-sizing: border-box;
}

.lds-spinner {
    color: var(--bs-primary);
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

    .lds-spinner div {
        transform-origin: 40px 40px;
        animation: lds-spinner 1.2s linear infinite;
    }

        .lds-spinner div:after {
            content: " ";
            display: block;
            position: absolute;
            top: 3.2px;
            left: 36.8px;
            width: 6.4px;
            height: 17.6px;
            border-radius: 20%;
            background: currentColor;
        }

        .lds-spinner div:nth-child(1) {
            transform: rotate(0deg);
            animation-delay: -1.1s;
        }

        .lds-spinner div:nth-child(2) {
            transform: rotate(30deg);
            animation-delay: -1s;
        }

        .lds-spinner div:nth-child(3) {
            transform: rotate(60deg);
            animation-delay: -0.9s;
        }

        .lds-spinner div:nth-child(4) {
            transform: rotate(90deg);
            animation-delay: -0.8s;
        }

        .lds-spinner div:nth-child(5) {
            transform: rotate(120deg);
            animation-delay: -0.7s;
        }

        .lds-spinner div:nth-child(6) {
            transform: rotate(150deg);
            animation-delay: -0.6s;
        }

        .lds-spinner div:nth-child(7) {
            transform: rotate(180deg);
            animation-delay: -0.5s;
        }

        .lds-spinner div:nth-child(8) {
            transform: rotate(210deg);
            animation-delay: -0.4s;
        }

        .lds-spinner div:nth-child(9) {
            transform: rotate(240deg);
            animation-delay: -0.3s;
        }

        .lds-spinner div:nth-child(10) {
            transform: rotate(270deg);
            animation-delay: -0.2s;
        }

        .lds-spinner div:nth-child(11) {
            transform: rotate(300deg);
            animation-delay: -0.1s;
        }

        .lds-spinner div:nth-child(12) {
            transform: rotate(330deg);
            animation-delay: 0s;
        }

@keyframes lds-spinner {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ============================================================
   SIDEBAR LAYOUT (FuvarPlus-mintára)
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f1f5f9;
    --sidebar-active-bg: #0d6efd;
    --sidebar-active-text: #ffffff;
    --sidebar-border: #334155;
    --topbar-bg: #ffffff;
    --page-bg: #f8fafc;
}

/* App wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--page-bg);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

    .sidebar-brand:hover {
        color: #fff;
    }

    .sidebar-brand .brand-icon {
        width: 36px;
        height: 36px;
        background: var(--sidebar-active-bg);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: #fff;
        flex-shrink: 0;
    }

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: #64748b;
    padding: 0.5rem;
    margin-right: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.15s, background-color 0.15s, transform 0.3s;
}

    .sidebar-collapse-btn:hover {
        color: #f1f5f9;
        background-color: #293548;
    }

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, width 0.3s ease;
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

    .sidebar.collapsed .sidebar-brand-row {
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-brand {
        justify-content: center;
        padding: 1.25rem 0 1rem;
    }

    .sidebar.collapsed .sidebar-label {
        display: none;
    }

    .sidebar.collapsed .sidebar-brand-row {
        flex-direction: column;
        gap: 0;
    }

    .sidebar.collapsed .sidebar-collapse-btn {
        margin: 0 0 0.25rem 0;
        padding: 0.4rem 0.6rem;
    }

    .sidebar.collapsed .sidebar-section-label {
        text-align: center;
        padding: 0.75rem 0.5rem 0.25rem;
        font-size: 0.6rem;
    }

    .sidebar.collapsed .sidebar-section-label-row {
        justify-content: center;
        padding-right: 0;
    }

    .sidebar.collapsed .sidebar-section-action {
        display: none;
    }

    .sidebar.collapsed .sidebar-nav-item {
        justify-content: center;
        padding: 0.6rem;
    }

    .sidebar.collapsed .sidebar-nav-item .nav-icon {
        font-size: 1.15rem;
    }

    .sidebar.collapsed .sidebar-collapse-btn i {
        transform: rotate(180deg);
    }

.sidebar.collapsed + .sidebar-overlay + .main-content,
.app-wrapper:has(.sidebar.collapsed) .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-section-label {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.sidebar-section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
}

.sidebar-section-action {
    color: #475569;
    font-size: 0.8rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
    text-decoration: none;
}

    .sidebar-section-action:hover {
        color: #f1f5f9;
        background-color: #293548;
    }

.sidebar-divider {
    border-top: 1px solid var(--sidebar-border);
    margin: 0.5rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    gap: 0.75rem;
    transition: background-color 0.15s, color 0.15s;
    border-radius: 0;
    position: relative;
}

    .sidebar-nav-item:hover {
        background-color: #293548;
        color: var(--sidebar-text-hover);
        text-decoration: none;
    }

    .sidebar-nav-item.active {
        background-color: var(--sidebar-active-bg);
        color: var(--sidebar-active-text);
        font-weight: 500;
    }

    .sidebar-nav-item .nav-icon {
        font-size: 1rem;
        width: 1.25rem;
        text-align: center;
        flex-shrink: 0;
    }

/* Sidebar submenu (hierarchical nav) */
.sidebar-nav-group {}

.sidebar-nav-group-toggle {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    gap: 0.75rem;
    transition: background-color 0.15s, color 0.15s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    position: relative;
}

    .sidebar-nav-group-toggle:hover {
        background-color: #293548;
        color: var(--sidebar-text-hover);
    }

    .sidebar-nav-group-toggle.active {
        background-color: rgba(13, 110, 253, 0.15);
        color: var(--sidebar-active-text);
        font-weight: 500;
    }

    .sidebar-nav-group-toggle .nav-icon {
        font-size: 1rem;
        width: 1.25rem;
        text-align: center;
        flex-shrink: 0;
    }

    .sidebar-nav-group-toggle .submenu-arrow {
        margin-left: auto;
        font-size: 0.7rem;
        transition: transform 0.2s ease;
    }

    .sidebar-nav-group.open .submenu-arrow {
        transform: rotate(90deg);
    }

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background-color: rgba(0, 0, 0, 0.12);
}

    .sidebar-nav-group.open .sidebar-submenu {
        max-height: 500px;
    }

    .sidebar-submenu .sidebar-nav-item {
        padding-left: 3rem;
        font-size: 0.85rem;
    }

    .sidebar-submenu .sidebar-nav-item .nav-icon {
        font-size: 0.85rem;
    }

/* Collapsed sidebar: hide submenu text, show as tooltip/popup */
.sidebar.collapsed .sidebar-nav-group-toggle {
    justify-content: center;
    padding: 0.6rem;
}

.sidebar.collapsed .sidebar-nav-group-toggle .submenu-arrow {
    display: none;
}

.sidebar.collapsed .sidebar-submenu {
    max-height: 0 !important;
    display: none;
}

.sidebar.collapsed .sidebar-nav-group-toggle .nav-icon {
    font-size: 1.15rem;
}

.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 0.75rem 0;
    flex-shrink: 0;
}

/* Main content area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top navbar */
.top-navbar {
    height: var(--topbar-height);
    background-color: var(--topbar-bg);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.topbar-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: none;
    flex-shrink: 0;
}

    .topbar-toggle:hover {
        background-color: #f1f5f9;
        color: #334155;
    }

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* User dropdown */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    color: #334155;
    font-size: 0.875rem;
    transition: background-color 0.15s, border-color 0.15s;
    white-space: nowrap;
    max-width: 260px;
}

.user-menu-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.user-menu-btn::after {
    display: none; /* hide Bootstrap's default caret */
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #3b5bdb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.user-chevron {
    font-size: 0.7rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.user-menu-btn[aria-expanded="true"] .user-chevron {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 200px;
    padding: 0.5rem;
    margin-top: 0.35rem;
}

.user-dropdown-menu .dropdown-item {
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    color: #334155;
}

.user-dropdown-menu .dropdown-item:hover {
    background-color: #f1f5f9;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background-color: #fff1f1;
}

/* Page content */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* Card style adjustments */
.card {
    border: 1px solid #e2e8f0;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.875rem 1.25rem;
}

/* Mobile: sidebar overlay */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* On mobile, reset collapsed state */
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .sidebar.collapsed .sidebar-label {
        display: inline;
    }

    .sidebar.collapsed .sidebar-nav-item {
        justify-content: flex-start;
        padding: 0.6rem 1.25rem;
    }

    .sidebar.collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 1.25rem 1.25rem 1rem;
    }

    .sidebar.collapsed .sidebar-section-label {
        text-align: left;
        padding: 0.75rem 1.25rem 0.25rem;
        font-size: 0.7rem;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .topbar-toggle {
        display: flex;
    }

    .page-content {
        padding: 1rem;
    }
}

/* Legacy nav-item (top navbar maradék) */
.nav-item {
    border-bottom: 1px solid transparent;
}

    .nav-item.active {
        border-bottom: 1px solid var(--bs-gray-500);
    }
