html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- High-End Global Overrides --- */
:root {
    --brand-red: #C13636;
    --brand-red-glow: rgba(193, 54, 54, 0.15);
    --input-border: #cbd5e1;
    --input-focus: #94a3b8;
    --card-bg: #ffffff;
    --body-bg: #f1f5f9;
}

/* 1. Main Page Layout */
body .rz-layout {
    background-color: var(--body-bg) !important;
}

/* 2. Elevated Form Cards */
body .rz-card.rz-variant-flat {
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    background: var(--card-bg) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    padding: 2rem !important;
    /*margin-bottom: 2rem !important;*/
}

/* 3. Refined Input Controls (TextBox, AutoComplete, DropDown) */
body .rz-textbox,
body .rz-autocomplete,
body .rz-dropdown,
body .rz-textarea,
body .rz-numeric {
    background-color: #ffffff !important;
    border: 1.5px solid var(--input-border) !important;
    border-radius: 10px !important;
    height: 42px !important;
    padding: 0 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 0.9rem !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

    /* 3. Focus State Highlight: High-Visibility Border */
    /* Distinguishes the active control from others with a thick red or blue border */
    body .rz-textbox:focus,
    body .rz-autocomplete:focus,
    body .rz-dropdown:focus,
    body .rz-numeric:focus,
    body .rz-textarea:focus,
    body .rz-state-focus {
        border: 2px solid #C13636 !important; /* Thick red border for focus */
        box-shadow: 0 0 0 4px rgba(193, 54, 54, 0.15) !important;
        outline: none !important;
        background-color: #ffffff !important;
    }

    /* Hover State */
    body .rz-textbox:hover,
    body .rz-autocomplete:hover,
    body .rz-dropdown:hover {
        border-color: var(--input-focus) !important;
    }

    /* 4. Professional Labels
        4a. Reduce Spacing: Label to Input */
    body .rz-label {
        margin-bottom: 2px !important; /* Moves label closer to the input control */
        font-size: 0.8rem !important;
        display: inline-block !important;
    }

    /* 4b. Red Asterisks for Required Fields
        Targets labels containing an asterisk to highlight the 'required' status */
    body .rz-label:contains('*') {
        color: #334155 !important;
    }

    /* 4c. Ensures any literal '*' within a label is rendered in red */
    body .rz-label {
        color: #334155 !important;
    }
    /**********************************/

/* 5. Buttons (Add, Save, etc.) */
body .rz-button {
    border-radius: 10px !important;
    font-weight: 600 !important;
    height: 24px !important;
    /*padding: 0 24px !important;*/
    box-shadow: 0 4px 4px -1px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

    body .rz-button:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    }

    body .rz-button:active {
        transform: translateY(0) !important;
    }

/* 6. Modern Grid Overrides */
body .rz-datagrid {
    border: none !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
}

body .rz-grid-table thead th {
    background-color: #f8fafc !important;
    padding: 16px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 800 !important;
    color: #475569 !important;
}

body .rz-data-row td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body .rz-data-row:hover td {
    background-color: #f8fafc !important;
}

/* 7. Action Bar Adjustments */
.action-bar-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

body .rz-main,
body .rz-body {
    padding-top: 0 !important; /* Removes the large gap at the top of the layout */
}
body .rz-content {
    padding-top: 0.5rem !important; /* Tightens the main content area */
}
/* Tightens the gap between the header and the action bar */
body .rz-card.rz-variant-flat:first-of-type {
    margin-top: 0 !important;
    padding-top: 0.25rem !important;
}

/* 5. Tighter Form Elements */
.rz-stack.rz-mb-2 {
    margin-bottom: 0.5rem !important;
}

hr {
    margin: 10px 0 !important; /* Reduces vertical space taken by separators */
}
/********************************************************/


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: 0.5rem;
}*/

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.";
}

.rz-layout,
.rz-body,
.rz-sidebar,
.rz-header {
    font-family: "Inter", "Segoe UI", sans-serif;
}

.rz-body {
    padding: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.metric-title {
    color: #64748B;
    font-size: 0.9rem;
}

.metric-value {
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 0.4rem;
}

.bis-section {
    margin-bottom: 2rem;
}

.bis-button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bis-button.rz-button {
    border-radius: 8px;
    min-width: 110px;
    font-weight: 600;
}

.bis-dropdown,
.bis-radio-group {
    min-width: 280px;
}

.bis-grid {
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    overflow: hidden;
}

.bis-grid .rz-datatable-thead th {
    background-color: #f3f6fb;
    color: #1e334d;
    font-weight: 600;
}

.bis-html-table-wrapper {
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    overflow-x: auto;
}

.bis-html-table {
    width: 100%;
    border-collapse: collapse;
}

.bis-html-table th,
.bis-html-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e7edf5;
    text-align: left;
}

.bis-html-table thead {
    background-color: #f3f6fb;
    color: #1e334d;
}

.bis-empty-row {
    text-align: center;
    color: #5b6c80;
}

/* Custom Circular Action Button */
.btn-edit-circle {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    background-color: #f8fafc !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease-in-out !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-edit-circle:hover {
    background-color: var(--brand-red) !important;
    color: #ffffff !important;
    border-color: var(--brand-red) !important;
    transform: translateY(-2px);
    /*box-shadow: 0 4px 12px rgba(193, 54, 54, 0.2) !important;*/
}

/* Ensure the icon stays centered */
.btn-edit-circle .rz-button-icon-left {
    margin: 0 !important;
    font-size: 18px !important;
}





/********************/
/* Container: Modern "Slab" style */
/* Full width container with bottom border 2 and light color */
.master-header-wrapper {
    width: 100%;
    background-color: #ffffff;
    /* We move the border-bottom to the pseudo-element for the arrow effect */
    border-bottom: 2px solid #e2e8f0;
    position: relative;
    z-index: 5;
}
    

/* Vertical dividers between sections */
.header-section-border {
    border-right: 1px solid #e2e8f0;
}

/* Modern Action Button Styling */
.action-btn-modern {
    height: 42px !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
}

.action-btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.main-label {
    font-size: 0.75rem;
    font-weight: 800;
}

.shortcut-label {
    font-size: 0.6rem;
    opacity: 0.7;
    font-weight: 400;
}

.search-mode-btn {
    border-radius: 20px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
}

/* Specific button color overrides using your brand red */
.btn-delete.rz-button-danger {
    background-color: var(--brand-red) !important;
}


/****** Search section on page expand collapse */

body .rz-card.rz-variant-flat:first-of-type.search-card {
    padding-top: 0 !important;
}
body .rz-card.rz-variant-flat.search-card{
    padding:0 !important;
    margin-bottom:0 !important;
}
.page-shell {
    position: relative;
    min-height: calc(100vh - 120px);
}

.form-panel {
    position: relative;
    z-index: 1;
}

.list-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #fff;
    border-left: 1px solid #dcdcdc;
    box-shadow: -10px 0 26px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
}

    .list-panel.normal {
        width: 25%;
        min-width: 250px;
    }

    .list-panel.wide {
        width: 50%;
        min-width: 300px;
    }

    .list-panel.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .list-panel.closed {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

.list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9e9e9;
    background: #fafafa;
    min-height: 42px;
}



.list-panel-body {
    flex: 1;
    overflow: hidden;
    padding: 0.10rem;
    min-height: 0;
}

.full-search-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.grid-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

    .grid-wrapper .rz-datatable,
    .grid-wrapper .rz-data-grid,
    .grid-wrapper .rz-grid-table {
        width: 100%;
    }

    .grid-wrapper > * {
        flex: 1;
        min-height: 0;
    }
.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.1;
}

.panel-subtitle {
    font-size: 0.75rem;
    color: #777;
    margin-top: 2px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.panel-icon-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
}

.panel-icon-btn .rzi {
    font-size: 16px !important;
}

.search-card {
    height: 100%;
}

.grid-state {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
}

.floating-open-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 60;
}

@media (max-width: 1200px) {
    .list-panel.normal {
        width: 25%;
    }

    .list-panel.wide {
        width: 50%;
    }
}

@media (max-width: 992px) {
    .list-panel.normal,
    .list-panel.wide {
        width: 85%;
        min-width: unset;
    }
}

/***********************/


/*********** Grid Compact layout */
.compact-grid {
    font-size: 10px;
}

    .compact-grid .rz-data-grid-header,
    .compact-grid .rz-grid-table thead {
        background: skyblue;
        border-bottom: 1px solid #ddd;
    }


    .compact-grid .rz-data-grid-header th,
    .compact-grid .rz-grid-table thead th {
        height: 30px !important;
        max-height: 30px !important;
        min-height: 30px !important;
        padding: 0.5px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        vertical-align: middle !important;
        background-color: linen !important;
    }
    .compact-grid .rz-data-grid-header,
    .compact-grid .rz-grid-table thead {
        height: 30px !important;
    }

    .compact-grid .rz-grid-table thead th > div:not(.rz-cell-filter) {
        padding: 0 !important;
    }

    .compact-grid .rz-grid-table thead th > div {
        padding: 0 !important;
    }

    .compact-grid .rz-grid-table tbody tr:nth-child(even) > td {
        background-color: lightgrey !important;
    }

    .compact-grid .rz-grid-table tbody tr:nth-child(odd) > td {
        background-color: lightyellow !important;
    }
    .compact-grid .rz-grid-table tbody tr:hover > td {
        background-color: #eaf2ff !important;
    }

    .compact-grid th .rz-column-title {
        line-height: 20px !important;
        display: flex;
        align-items: center;
    }

    .compact-grid .rz-header-cell-content {
        padding: 0 !important;
    }

    .compact-grid .rz-grid-table tbody tr {
        height: 30px !important;
    }


    .compact-grid .rz-data-grid-data td,
    .compact-grid .rz-grid-table tbody td {
        font-size: 10px !important;
        padding: 2px 8px !important;
        line-height: 1.05 !important;
        vertical-align: middle !important;
    }

   
    .compact-grid .rz-data-row,
    .compact-grid .rz-grid-table tbody tr {
        height: 20px !important;
    }

    .compact-grid .rz-cell-data {
        padding: 0 !important;
    }

    .compact-grid .rz-button.grid-action-btn {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        padding: 0 !important;
    }

    .compact-grid .rz-badge {
        font-size: 10px !important;
        padding: 2px 4px !important;
        line-height: 1.1 !important;
    }

    .compact-grid .rz-cell-data {
        padding: 0 !important;
    }

    .compact-grid .rz-textbox,
    .compact-grid .rz-dropdown,
    .compact-grid .rz-autocomplete,
    .compact-grid .rz-inputtext {
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        font-size: 12px !important;
        padding: 2px 8px !important;
    }

    /* Target the Radzen Pager Summary specifically */
    .compact-grid .rz-datatable-pager-summary {
        float: left;
        margin-left: 10px;
        font-size: 12px !important;
        opacity: 0.7;
        order: 1; /* Moves text to the far left */
    }

    .compact-grid .rz-pager-nav {
        order: 2; /* Moves navigation buttons next to it */
        justify-content: flex-end;
    }

    /* Hide labels on buttons to save space */
    .compact-grid .rz-pager-item {
        min-width: 30px !important;
        height: 30px !important;
        padding: 0 !important;
    }

    /* Remove the circle/background from pager buttons */
    .compact-grid .rz-pager-item {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        color: var(--rz-text-color) !important;
        min-width: 25px !important;
        margin: 0 5px !important;
    }

    /* Style for the currently active page number */
        .compact-grid .rz-pager-item.rz-state-active {
            color: var(--rz-primary) !important;
            font-weight: bold !important;
            border-bottom: 2px solid var(--rz-primary) !important; /* Optional: adds a nice underline to the active page */
        }

    /* Remove background from the navigation arrows (first, prev, next, last) */
    .compact-grid .rz-pager-nav-button {
        background-color: transparent !important;
        border: none !important;
        color: var(--rz-text-secondary-color) !important;
    }

    /* Hide the hover effect background if you want a truly flat look */
    .compact-grid .rz-pager-button:hover:not(.rz-state-active) {
        background-color: rgba(0,0,0,0.05) !important;
        text-decoration: underline;
    }
 /**********************************/