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

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* Custom Validation Error States */
.custom-error .e-input-group,
.e-input-group.custom-error {
    border: 2px solid #dc3545 !important;
    box-shadow: none !important;
}

.custom-error .e-float-text,
.e-input-group.custom-error .e-float-text {
    color: #dc3545 !important;
}

.custom-error .e-input-group.e-input-focus,
.e-input-group.custom-error.e-input-focus {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.custom-error.e-input-focus .e-float-text,
.e-input-group.custom-error.e-input-focus .e-float-text {
    color: #dc3545 !important;
}

/* Custom validation error message styling */
.custom-error-message {
    color: #dc3545;
    margin-top: 4px;
    display: block;
}


/*****************************************************************
 * 1. DIALOG LAYOUT CONTROL
 * Targets SfDialogs that contain Grids (using .no-padding class)
 *****************************************************************/

/* Removes the default 18-20px padding so the Grid touches the dialog edges */
.e-dialog.no-padding .e-dlg-content {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Forces the container inside the dialog to occupy 100% space for virtualization */
.e-dialog.no-padding .dialog-grid-container {
    height: 100%;
    width: 100%;
}

.e-tab.e-fill .e-content .e-item.e-active {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.single-record-content {
    /* Let the content flow naturally, dialog will handle overflow */
    max-height: none;
}

/* Adds a subtle separator line between the Dialog Header and the Grid content */
.e-dialog.no-padding .e-dlg-header-content {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}


/*****************************************************************
 * 2. GLOBAL GRID VISUAL POLISH
 * General styling for all SfGrids (Desktop & Mobile)
 *****************************************************************/

/* Alternating row background for a "Zebra" striping effect */
.e-grid .e-altrow {
    background-color: #f8f9fa !important;
}

/* Unified hover effect: changes row color to light blue when mouse is over */
.e-grid .e-row:hover {
    background-color: #f0f8ff !important;
}

/* Standardizes text color for all grid cells to ensure high contrast */
.e-grid .e-rowcell {
    color: #212529 !important;
}

/* FIX: Prevents hover/altrow colors from overriding the 'Selected' blue highlight.
   Crucial for keeping the active row visible after clicking. */
.e-grid .e-row.e-selectionbackground,
.e-grid .e-row.e-selectionbackground:hover {
    background-color: #e3f2fd !important;
    color: #0d6efd !important;
}


/*****************************************************************
 * 3. RESPONSIVE GRID ENGINE
 * Applied only when .responsive-grid is active (typically on Mobile)
 *****************************************************************/

/* Ensures parent wrappers expand to full width without scrollbar interference */
.responsive-grid .full-height-container,
.responsive-grid .flex-grow-row {
    width: 100% !important;
    overflow: visible !important;
}

/* Forces the Grid and its internal HTML Table to ignore fixed pixel widths */
.responsive-grid .e-grid,
.responsive-grid .e-table {
    width: 100% !important;
}

/* In 'Adaptive Mode', ensures columns don't get squashed below 120px 
   and prevents text from wrapping to multiple lines. */
.responsive-grid .e-rowcell {
    min-width: 120px !important;
    white-space: nowrap !important;
}

/* High-contrast alternating rows specifically for Mobile 'Card' views */
.responsive-grid .e-altrow {
    background-color: #f8f9fa !important;
}

/* Mobile-specific hover/touch feedback colors */
.responsive-grid .e-row:hover {
    background-color: #e3f2fd !important;
}

.responsive-grid .e-row.e-altrow:hover {
    background-color: #d1e7ff !important;
}

@media (max-width: 640.98px) {

    /* Target e-small buttons inside the grid on mobile */
    .e-grid .e-btn.e-small {
        /* Vertical padding 4px, Horizontal 8px for text buttons */
        padding: 6px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 32px; /* Minimum width for icon-only buttons */
        height: 30px; /* Consistent height for both types */
        font-size: 12px !important;
        line-height: 1;
    }

    /* Specifically optimize icon-only buttons to stay square */
    .e-grid .e-btn.e-small.e-icon-btn {
        padding: 6px !important;
        width: 30px !important;
    }

    /* Ensure the DropDownButton (Details) matches the sizing */
    .e-grid .e-dropdown-btn.e-small {
        padding: 6px !important;
        height: 30px !important;
    }
}


/* StatusBar */
.app-topbar {
    min-height: 3.5rem;
    background: linear-gradient(180deg, #0b1d46, #3b0a57);
    /* OR background-color: #0b1d46; */

    color: #ffffff;
}

/* Alignment */
.app-topbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Ensure brand can shrink in flex and ellipsis can apply */
.app-topbar .navbar-brand {
    min-width: 0;
    display: inline-block;
}

/* Global truncation for brand text (applies on all breakpoints) */
.app-topbar .navbar-brand.app-brand-mobile {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 35vw;
    flex-shrink: 1;
}

.app-topbar .navbar-brand .brand-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Text & controls */
.app-topbar a,
.app-topbar .navbar-text,
.app-topbar button {
    color: #ffffff;
}

.app-topbar .btn-link:hover {
    color: #e5e7eb;
}


/* App logo styling */
.app-logo {
    border-radius: 6px;
    width: 28px;
    height: 28px;
}

/* Responsive adjustments for single toggle and brand truncation */
@media (max-width: 640.98px) {
    .auth-status-toggle {
        margin-right: 0.5rem;
    }

    .app-topbar .navbar-brand.app-brand-mobile {
        max-width: 55vw;
    }

    /* Responsive logo sizing */
    .app-logo {
        width: 24px;
        height: 24px;
    }
}

/* AuthAwareGrid - Vertical row rendering: make Actions cell look like a card footer */
@media (max-width: 640.98px) {

    .e-grid.e-row-responsive .e-gridcontent td.aa-actions-cell {
        padding: 4px 6px !important; /* smaller vertical padding */
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important; /* smaller gap */
        border-top: 1px solid rgba(0,0,0,0.08) !important;
        background: rgba(0,0,0,0.02) !important;
        border-radius: 0 0 10px 10px;
        line-height: 1 !important; /* helps reduce extra height */
    }

    .e-grid.e-row-responsive .e-gridcontent td.aa-actions-cell::before {
        content: none !important;
        display: none !important;
    }
}


