@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ==========================================================================
   1. General & Typography
   ========================================================================== */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.content {
    padding-top: 1.1rem;
}


/* ==========================================================================
   2. Bootstrap Component Overrides
   ========================================================================== */

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Custom focus style for better accessibility and visual feedback */
.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;
}


/* ==========================================================================
   3. Blazor UI States (Error, Reconnection)
   ========================================================================== */

/* --- Blazor Error UI Bar --- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* --- Blazor Error Boundary --- */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljk4IDg3LjMwNDIgMjU5Ljk4IDg5LjIzNzEgMjU5Ljk4IDkxLjE3IDI2MS4wNDkgOTIuNDE5NSAyNjMuNTc2IDkyLjQxOTUgMjY2LjEwNCA5Mi40MTk1IDI2Ny4xNzMgOTEuMTcgMjY3LjE3MyA4OS4yMzcxIDI2Ny4xNzMgODcuMzA0MiAyNjYuMTA0IDg2LjA1NDcgMjYzLjU3NiA4Ni4wNTQ3WiIgZmlsbD0iI0ZGRkZGRiIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


/* ==========================================================================
   4. Validation & Forms
   ========================================================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}


/* ==========================================================================
   5. Order Form Specific Styles
   ========================================================================== */

.order-form-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.85rem;
}

.brand-section {
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.brand-header {
    background-color: #343a40;
    color: white;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    padding: 0;
}

.product-item {
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem;
    background: white;
    display: flex;
    flex-direction: column;
    min-height: 80px;
    justify-content: space-between; /* Ensures vendor number and quantity control are spaced */
}

    .product-item:last-child {
        border-right: none;
    }

.product-description {
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #212529;
}

.vendor-number {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

/* --- Custom Quantity Input Styles --- */

/* Hide the default spinner arrows for number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield; /* Firefox */
}

/* Container for the custom buttons and input */
.quantity-control-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto; /* Pushes the control to the bottom of the product-item flex container */
}

/* Styles for the custom plus/minus buttons */
.btn-quantity {
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    width: 38px; /* Control button width */
    height: 38px; /* Control button height */
    font-size: 1.25rem; /* Control font size of +/- */
    font-weight: bold;
    line-height: 1;
    user-select: none; /* Prevents text selection on double-click */
    transition: background-color 0.15s ease-in-out;
}

    .btn-quantity:hover {
        background-color: #e9ecef;
    }

    .btn-quantity.minus {
        border-top-left-radius: .25rem;
        border-bottom-left-radius: .25rem;
        border-right: none;
    }

    .btn-quantity.plus {
        border-top-right-radius: .25rem;
        border-bottom-right-radius: .25rem;
        border-left: none;
    }

/* Make the input field fit between the buttons */
.quantity-control-wrapper .quantity-input {
    width: 60px; /* Adjust width as needed */
    text-align: center;
    border-radius: 0;
    height: 38px;
    border: 1px solid #ced4da;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.quantity-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* --- End Custom Quantity Input Styles --- */


.order-summary-card {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f8f9fa;
}

    .order-summary-item:last-child {
        border-bottom: none;
    }

.order-summary-description {
    flex: 1;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.order-summary-quantity {
    font-weight: 600;
    color: #0d6efd;
    min-width: 2rem;
    text-align: right;
}

.btn-order-action {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}


/* ==========================================================================
   6. Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-item {
        border-right: none;
    }

    .order-form-container {
        font-size: 0.9rem;
    }

    .btn-order-action {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    /* Stack buttons vertically on small screens */
    .order-buttons-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

        .order-buttons-container .btn {
            margin: 0 !important;
        }
}

@media (min-width: 768px) and (max-width: 991px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==========================================================================
   7. Blazor Reconnection Modal
   ========================================================================== */

#reconnect-modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

/* This class is added to the <body> by Blazor automatically when reconnecting */
body.components-reconnecting #reconnect-modal {
    display: flex; /* Show the modal */
}

/* ==========================================================================
   8. User Management - Mobile-Friendly Cards
   ========================================================================== */

/* User Cards Container */
.users-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Detailed Card Layout */
.user-card-detailed {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

    .user-card-detailed:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

.user-card-header-detailed {
    background: linear-gradient(135deg, #1b6ec2 0%, #1861ac 100%);
    color: white;
    padding: 16px 20px;
}

.user-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.user-card-email {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

.user-card-body-detailed {
    padding: 20px;
}

.user-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

    .user-detail-row:last-child {
        border-bottom: none;
        margin-bottom: 16px;
    }

.user-detail-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.user-actions-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

    .user-actions-detailed .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
        white-space: nowrap;
    }

/* Responsive Design for User Cards */
@media (max-width: 576px) {
    .user-card-header-detailed {
        padding: 14px 16px;
    }

    .user-card-body-detailed {
        padding: 16px;
    }

    .user-detail-row {
        padding: 8px 0;
    }

    .user-actions-detailed {
        grid-template-columns: 1fr;
        gap: 8px;
    }

        .user-actions-detailed .btn {
            width: 100%;
        }
}

@media (min-width: 577px) and (max-width: 768px) {
    .users-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .user-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .users-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .user-card-detailed {
        margin-bottom: 4px;
    }

    .user-actions-detailed {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .users-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .user-card-detailed {
        margin-bottom: 4px;
    }

    .user-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1600px) {
    .users-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .user-card-detailed {
        margin-bottom: 4px;
    }

    .user-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Table display for larger screens (optional - you can remove if you prefer cards everywhere) */
@media (min-width: 992px) {
    .users-table-container {
        display: block;
    }

    .users-container {
        display: none;
    }
}

/* Force card layout on all screen sizes */
.force-card-layout .users-table-container {
    display: none !important;
}

.force-card-layout .users-container {
    display: grid !important;
}

.force-card-layout .users-layout {
    display: block !important;
}

.force-card-layout .stores-table-container {
    display: none !important;
}

.force-card-layout .stores-layout {
    display: block !important;
}

.force-card-layout .products-table-container {
    display: none !important;
}

.force-card-layout .products-layout {
    display: block !important;
}

/* ==========================================================================
   9. Store Management - Mobile-Friendly Cards
   ========================================================================== */

/* Stores Container */
.stores-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* State Group Headers for Mobile */
.state-group-header {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 1rem;
}

    .state-group-header h5 {
        margin: 0;
        font-size: 1rem;
    }

/* Store Cards */
.store-card-detailed {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    margin-bottom: 12px;
}

    .store-card-detailed:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .store-card-detailed.inactive {
        opacity: 0.7;
        background: #f8f9fa;
    }

.store-card-header-detailed {
    background: linear-gradient(135deg, #1b6ec2 0%, #1861ac 100%);
    color: white;
    padding: 16px 20px;
}

    .store-card-header-detailed.inactive {
        background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    }

.store-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.store-card-address {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

.store-card-body-detailed {
    padding: 20px;
}

.store-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

    .store-detail-row:last-child {
        border-bottom: none;
        margin-bottom: 16px;
    }

.store-detail-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.store-actions-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

    .store-actions-detailed .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
        white-space: nowrap;
    }

        .store-actions-detailed .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

/* Customer Number Badge */
.customer-number-badge {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Responsive Design for Store Cards */
@media (max-width: 576px) {
    .store-card-header-detailed {
        padding: 14px 16px;
    }

    .store-card-body-detailed {
        padding: 16px;
    }

    .store-detail-row {
        padding: 8px 0;
    }

    .store-actions-detailed {
        grid-template-columns: 1fr;
        gap: 8px;
    }

        .store-actions-detailed .btn {
            width: 100%;
        }

    .state-group-header {
        margin-bottom: 12px;
        padding: 10px 14px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .stores-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .store-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .stores-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .store-card-detailed {
        margin-bottom: 4px;
    }

    .store-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .stores-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .store-card-detailed {
        margin-bottom: 4px;
    }

    .store-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1600px) {
    .stores-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .store-card-detailed {
        margin-bottom: 4px;
    }

    .store-actions-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ==========================================================================
   10. Product Management - Mobile-Friendly Cards
   ========================================================================== */

/* Products Container */
.products-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Product Cards */
.product-card-detailed {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    margin-bottom: 12px;
}

    .product-card-detailed:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .product-card-detailed.inactive {
        opacity: 0.7;
        background: #f8f9fa;
    }

.product-card-header-detailed {
    background: linear-gradient(135deg, #1b6ec2 0%, #1861ac 100%);
    color: white;
    padding: 16px 20px;
}

    .product-card-header-detailed.inactive {
        background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    }

.product-card-brand {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.product-card-vendor {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
    font-family: 'Courier New', monospace;
}

.product-card-body-detailed {
    padding: 20px;
}

.product-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

    .product-detail-row:last-child {
        border-bottom: none;
        margin-bottom: 16px;
    }

.product-detail-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-right: 12px;
}

.product-detail-value {
    flex: 1;
    text-align: right;
}

.product-description {
    text-align: left;
    color: #212529;
    line-height: 1.4;
}

.product-states {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.product-actions-detailed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

    .product-actions-detailed .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
        white-space: nowrap;
    }

/* Vendor Order Number Badge */
.vendor-order-badge {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Product Filter Card */
.product-filter-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.product-count-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

/* Responsive Design for Product Cards */
@media (max-width: 576px) {
    .product-card-header-detailed {
        padding: 14px 16px;
    }

    .product-card-body-detailed {
        padding: 16px;
    }

    .product-detail-row {
        padding: 8px 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .product-detail-value {
        text-align: left;
        margin-top: 4px;
    }

    .product-states {
        justify-content: flex-start;
    }

    .product-actions-detailed {
        grid-template-columns: 1fr;
        gap: 8px;
    }

        .product-actions-detailed .btn {
            width: 100%;
        }

    .product-filter-header {
        flex-direction: column;
        align-items: stretch;
    }

    .product-count-info {
        text-align: center;
        margin-top: 8px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .product-card-detailed {
        margin-bottom: 4px;
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .products-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .product-card-detailed {
        margin-bottom: 4px;
    }
}

@media (min-width: 1600px) {
    .products-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .product-card-detailed {
        margin-bottom: 4px;
    }
}



/* ==========================================================================
   Blazor Layout System - Responsive Sidebar Layout
   ========================================================================== */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
    background-color: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    .top-row ::deep a, .top-row ::deep .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
            text-decoration: underline;
        }

        .top-row ::deep a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }

/* Desktop Layout */
@media (min-width: 768px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
    }

    .main {
        flex: 1;
        min-width: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block !important;
    }
}

/* Mobile Layout */
@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        height: auto;
    }

    .top-row {
        position: static;
    }

    .navbar-toggler {
        display: block;
    }

    .nav-scrollable {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Hide any duplicate/browser-generated hamburger icons */
    .page > .navbar-toggler,
    .main .navbar-toggler,
    button[data-bs-toggle]:not(.sidebar button) {
        display: none !important;
    }

    /* Ensure only sidebar hamburger is visible */
    .sidebar .navbar-toggler {
        display: block !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
}

/* Sidebar Navigation Styles */
.sidebar .navbar-brand {
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
}

.sidebar .navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item {
    font-size: 0.9rem;
    position: relative;
}

    .sidebar .nav-item:last-of-type {
        padding-bottom: 1rem;
    }

.sidebar .nav-link {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .sidebar .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

    .sidebar .nav-link.active {
        background-color: rgba(255,255,255,0.25);
        color: white;
    }

/* Content padding */
.content {
    padding: 1.5rem 2rem;
}

@media (max-width: 767.98px) {
    .content {
        padding: 1rem;
    }
}

/* Fix for navbar brand on mobile */
@media (max-width: 640px) {
    .navbar-brand .d-none.d-sm-inline {
        display: none !important;
    }
}
