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

h1:focus {
    outline: none;
}

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

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

.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;
}

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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 {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNT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3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7); /* semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 0.4rem solid #ddd;
    border-top: 0.4rem solid #007bff; /* spinner color */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* This code is for shipping label. */
.label-card {
    font-family: 'Courier New', monospace;
    padding: 16px;
    border: 1px solid #000;
    background-color: white;
    max-width: 1700px;
    margin: 0 auto;
}

.label-header {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.label-section {
    margin: 8px 0;
}

.label-caption {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 2px;
}

.dashed-divider {
    border-top: 1px dashed #000;
    width: 100%;
}

.barcode-section {
    padding: 8px 0;
}

.tracking-number {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Customer and Branch layout */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* ========== FIX FOR PRODUCTION ISSUE ========== */
/* Force the bottom row to display properly */
.label-section .label-row {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 12px !important; /* Increased gap */
}

/* Make sure columns take space */
.label-section .label-col {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: visible !important; /* Changed to visible */
}

    /* Specific column adjustments - WIDER FOR CONTENT */
    .label-section .label-col.text-start {
        flex: 1.5 !important; /* Merchant */
        min-width: 80px !important;
    }

    .label-section .label-col.text-md-start {
        flex: 2.5 !important; /* Tracking */
        min-width: 140px !important;
    }

    .label-section .label-col.text-md-end {
        flex: 2 !important; /* Weight - WIDER */
        min-width: 120px !important;
    }

    .label-section .label-col.text-end {
        flex: 1 !important; /* CU */
        min-width: 60px !important;
    }

/* Better text handling */
.label-section .label-caption {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
}

.label-section .label-strong {
    white-space: normal !important; /* Allow wrapping */
    word-break: break-word !important;
    overflow: visible !important;
    display: block !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}
/* ========== END FIX ========== */

/* Responsive button container */
.button-container {
    display: flex;
    width: 100%;
    gap: 12px;
}

.dialog-button {
    flex: 1;
    min-width: 0;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .button-container {
        flex-direction: column;
        gap: 8px;
    }

    .dialog-button {
        width: 100%;
        flex: none;
    }

    .label-card {
        padding: 12px;
        max-width: 100%;
    }
}


/* Print-specific styles */
@media print {
    /* REMOVE ALL HEADERS/FOOTERS */
    @page {
        margin: 0 !important;
        size: auto;
    }

    /* Hide everything by default */
    body {
        visibility: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Show only the print container */
    #print-container, #print-container * {
        visibility: visible !important;
    }

    /* Position the print container */
    #print-container {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 10px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        background: white !important;
        box-sizing: border-box !important;
    }

        /* Label styling - NARROWER */
        #print-container .label-card {
            font-family: 'Courier New', monospace !important;
            width: 450px !important;
            max-width: 450px !important;
            min-width: 450px !important;
            padding: 15px !important;
            border: 1px solid #000 !important;
            background: white !important;
            box-shadow: none !important;
            box-sizing: border-box !important;
        }

        /* Bottom row - TIGHTER LAYOUT */
        #print-container .label-section:last-child .label-row {
            display: flex !important;
            flex-wrap: nowrap !important;
            justify-content: space-between !important;
            align-items: flex-start !important;
            width: 100% !important;
            gap: 6px !important; /* Even smaller gap */
            box-sizing: border-box !important;
        }

        /* Column widths - OPTIMIZED FOR 450px */
        #print-container .label-section:last-child .label-col {
            box-sizing: border-box !important;
            overflow: hidden !important;
        }

            #print-container .label-section:last-child .label-col.text-start {
                flex: 1 !important; /* Merchant */
                min-width: 65px !important;
                max-width: 75px !important;
            }

            #print-container .label-section:last-child .label-col.text-md-start {
                flex: 2 !important; /* Tracking */
                min-width: 135px !important;
                max-width: 155px !important;
            }

            #print-container .label-section:last-child .label-col.text-md-end {
                flex: 1.4 !important; /* Weight */
                min-width: 105px !important;
                max-width: 125px !important;
            }

            #print-container .label-section:last-child .label-col.text-end {
                flex: 0.5 !important; /* CU - smallest */
                min-width: 35px !important;
                max-width: 45px !important;
            }

        /* Text styling - COMPACT */
        #print-container .label-section:last-child .label-caption {
            font-size: 8.5px !important;
            font-weight: bold !important;
            text-transform: uppercase !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            margin-bottom: 1px !important;
        }

        #print-container .label-section:last-child .label-strong {
            font-size: 9.5px !important;
            font-weight: 600 !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            line-height: 1.1 !important;
        }

        /* CU specific - right aligned and compact */
        #print-container .label-section:last-child .label-col.text-end .label-strong {
            text-align: right !important;
            font-size: 9.5px !important;
        }
}


/*///////////////////////////////////////////////////*/

/* =========================
   PROFILE HEADER (BIGGER)
   ========================= */

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    /* ✅ Taller banner */
    padding: 28px 26px;
    min-height: 140px;
    border-radius: 16px;
    border: 1px solid var(--mud-palette-lines-default);
    background: linear-gradient( 135deg, rgba(var(--mud-palette-primary-rgb), 0.22) 0%, rgba(var(--mud-palette-primary-rgb), 0.00) 65% );
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.profile-avatar-lg {
    /* ✅ Bigger avatar like your screenshot */
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid rgba(255, 255, 255, .95);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
    display: grid;
    place-items: center;
    /* ✅ Bigger initials if no photo */
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.profile-header-text {
    min-width: 0;
}

.profile-header-actions {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        padding: 22px 18px;
    }
}

.page-loading-overlay {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    z-index: 9999;
    /* optional: dims background and blocks clicking while loading */
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(2px);
}
