html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden; /* prevent accidental horizontal scrollbars */
    touch-action: manipulation; /* reduce double-tap to zoom on some browsers */
}

/* Prevent background scroll when a modal is open */
.modal-open {
    overflow: hidden;
}

/* Make modal content scroll nicely within viewport */
.modal .modal-dialog {
    max-height: 80vh;
    margin: 1rem auto;
}

.modal .modal-content {
    max-height: 80vh;
    overflow: auto;
}

/* Improve Bootstrap-Select inside modals */
.modal .bootstrap-select .dropdown-menu {
    z-index: 2000; /* higher than modal content */
    width: 100% !important;
}

.modal .bootstrap-select .dropdown-menu .inner {
    max-height: 40vh !important;
}

/* General typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Improve readability for small text */
small, .small {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Better link styling */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* DeliveryChallan specific (moved from inline) */
.accordion-button::after {
    display: none !important;
}

.accordion-button {
    background-color: #fff !important;
}

.accordion-button:focus {
    box-shadow: none !important;
}

.accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
}

/* Home accordion polishing */
.accordion-clean .accordion-item {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden; /* removes visual gaps between header/body */
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.accordion-clean .accordion-button {
    padding: 0.75rem 1rem;
    background-color: #fff;
}

.accordion-clean .accordion-button:not(.collapsed) {
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
}

.accordion-clean .accordion-collapse {
    border-top: 1px solid #eee; /* seamless boundary */
}

/* Compact actions in DeliveryChallan */
@media (max-width: 768px) {
    .dc-actions .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .dc-actions .btn i {
        margin-right: 0.25rem;
    }
}

a, .btn-link {
    color: #006bb7;
}

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

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44Nzc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Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

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




.withprogressbar {
    width: 100%;
    height: 100%;
    background-color: grey;
    opacity: 50%;
    top: 0%;
    left: 0%;
    position: absolute;
    z-index: 1000;
}

label {
    display: block;
}

/* Spinner overlay */
.spinner-overlay {
    position: fixed; /* relative to viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* cover viewport without 100vw/100vh overflow issues */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 99999; /* above all content, including sidebar */
    pointer-events: all; /* prevent clicks underneath */
    transform: none !important; /* avoid offset from parent transforms */
}

/* Spinner circle */
.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #106ebe; /* accent color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Spinner rotation animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile typography improvements (compact) */
@media (max-width: 768px) {
    html, body {
        font-size: 16px; /* compact base font size */
        line-height: 1.55; /* slightly tighter */
    }
    
    .spinner-overlay {
        min-height: 100vh;
    }
    
    /* Compact buttons */
    .btn {
        font-size: 0.95rem;
        font-weight: 500;
        padding: 0.5rem 1rem;
    }
    
    /* Compact form inputs */
    .form-control, .form-select {
        font-size: 0.95rem;
        padding: 0.5rem;
    }
    
    /* Compact heading hierarchy */
    h1 { font-size: 1.5rem; font-weight: 600; }
    h2 { font-size: 1.25rem; font-weight: 600; }
    h3 { font-size: 1.1rem; font-weight: 500; }
    h4 { font-size: 1rem; font-weight: 500; }
    h5 { font-size: 0.95rem; font-weight: 500; }
    h6 { font-size: 0.85rem; font-weight: 500; }

    /* Compact side nav links */
    .side-nav .nav-link {
        padding: 8px 12px;
        gap: 6px;
    }

    /* Keep floating buttons above footer/safe area and aligned */
    .fab {
        bottom: calc(env(safe-area-inset-bottom, 0) + 72px);
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }

    #btnGoTop {
        position: fixed;
        bottom: calc(env(safe-area-inset-bottom, 0) + 72px) !important;
        left: 16px !important; /* align horizontally with .fab but on left */
        right: auto !important;
        z-index: 1000;
        background-color: #106ebe;
        border-color: #106ebe;
    }
}

/* Utility classes migrated from inline styles */
.title-cap {
    text-transform: capitalize;
}

.clickable-addon {
    cursor: pointer;
    min-width: 100px;
    justify-content: center;
}

.input-flat {
    background-color: rgb(248,249,250);
    border: none;
}

.w-350px { width: 350px; max-width: 100%; }
.h-38 { height: 38px; }

.modal-backdrop-custom {
    background-color: rgba(0,0,0,0.5);
}


/*1. Make the dropdown menu the same width as the select control */
.bootstrap-select .dropdown-menu {
    width: 100% !important; /*match the select box width */
    min-width: 100% !important; /*prevent shrinking */
    box-sizing: border-box;
}

/* Improve Bootstrap-Select long option handling on mobile */
@media (max-width: 768px) {
    /* Ensure the control uses full width */
    .bootstrap-select {
        width: 100% !important;
    }

    /* Allow selected text to wrap if long */
    .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
        white-space: normal;
        line-height: 1.3;
    }

    /* Make dropdown fill container and stay within viewport */
    .bootstrap-select .dropdown-menu {
        width: 100% !important;
        min-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 2000; /* above surrounding content */
    }

    

    /* Allow option text to wrap to multiple lines */
    .bootstrap-select .dropdown-menu li a span.text,
    .bootstrap-select .dropdown-menu .dropdown-item {
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.3;
    }
}


.report-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.report-tile {
    width: calc(33.33% - 8px); /* 3 per row */
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    background-color: #e6f0fa;
    border: 1px solid #106ebe;
    border-radius: 12px;
    color: #106ebe;
    font-weight: bold;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
}

    .report-tile:hover {
        background-color: #106ebe;
        color: white;
        transform: translateY(-2px);
    }

/* Prevent tiles from being too big on large screens */
@media (min-width: 768px) {
    .report-tile {
        max-width: 150px; /* keeps tiles reasonable size */
    }
}

/* Optional: slightly smaller font for very small screens */
@media (max-width: 400px) {
    .report-tile {
        font-size: 0.65rem;
    }
}

/* Container for bottom-right buttons (New button) */
.floating-buttons {
    position: fixed;
    bottom: 40px; /* distance from bottom */
    right: 30px; /* distance from right edge */
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1050;
}

/* "New" button - Gmail Compose style */
.btn-floating-new {
    padding: 14px 28px;
    border-radius: 28px;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

    .btn-floating-new i {
        font-size: 20px;
        margin-right: 8px;
    }

/* "Top" button - icon + text */
.btn-floating-top {
    position: fixed; /* fixed, not relative */
    bottom: 40px; /* distance from bottom, same as New */
    left: 30px; /* left side of screen */
    display: none; /* hidden initially */
    padding: 12px 20px;
    border-radius: 28px;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background-color: var(--bs-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    transition: all 0.2s ease-in-out;
}

    .btn-floating-top i {
        font-size: 18px;
        margin-right: 0px;
    }

    /* Show animation */
    .btn-floating-top.show {
        display: flex;
        animation: fadeIn 0.3s ease-in-out;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Align Go To Top with FAB on desktop */
#btnGoTop {
    position: fixed;
    bottom: 20px;
    left: 16px;
    z-index: 1000;
}

/* Custom blue navbar */
.custom-navbar {
    background-color: #106ebe !important;
}

/* Make hamburger icon visible (white bars) */
.custom-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Remove border and add padding */
.custom-toggler {
    border: none;
    background: none;
}

/* Sidebar */
.side-nav {
    position: fixed;
    top: 0;
    left: -260px;
    width: 250px;
    height: 100%;
    background-color: #106ebe;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1050;
    padding-top: 10px; 
}

/* When checkbox checked - show the nav */
#nav-toggle:checked ~ .side-nav {
    left: 0;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 1040;
}

#nav-toggle:checked ~ .overlay {
    display: block;
}


/* Nav link styles */
.side-nav .nav-link {
    color: #fff;
    padding: 10px 15px;
    font-weight: 500;
    display: flex;
    align-items: center; /* ensures vertical centering */
    gap: 8px; /* clean spacing between icon and text */
}

    .side-nav .nav-link i {
        font-size: 1.1rem;
        line-height: 1; /* keeps icon perfectly aligned */
        vertical-align: middle; /* just in case for older browsers */
        margin-top: -1px; /* fine-tune tiny downward shift */
    }


    .side-nav .nav-link:hover,
    .side-nav .nav-link.active {
        background-color: rgba(255,255,255,0.15);
        border-radius: 6px;
    }

/* Desktop mode */
@media (min-width: 992px) {
    .side-nav {
        left: 0;
        position: static;
        width: 220px;
        height: auto;
        background: none;
        padding-top: 0;
    }

    .overlay {
        display: none !important;
    }
}

/* Splash page styles */
.splash-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    padding: 0 1rem;
}

.splash-logo {
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
}

.splash-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.splash-subtitle {
    margin-top: 0.5rem;
    opacity: 0.8;
    color: #666;
    font-size: 1rem;
}

.splash-progress {
    height: 8px;
    margin-top: 1rem;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
    overflow: hidden;
}

/* Mobile splash improvements */
@media (max-width: 768px) {
    .splash-container {
        padding: 0 2rem;
    }
    
    .splash-title {
        font-size: 1.5rem;
    }
    
    .splash-subtitle {
        font-size: 1.1rem;
    }
    
    .splash-progress {
        width: 70%;
    }
}

