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

    body.dark-mode-loading {
        background-color: #121212;
    }

        body.dark-mode-loading .loading-progress-text {
            color: #fff;
        }

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4M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ODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

#app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-progress-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-progress-text {
    position: absolute;
    font-family: 'Roboto', sans-serif; /* or your app font */
    font-weight: 500;
    font-size: 1rem;
    color: #444;
    /* Ensure text doesn't wrap awkwardly */
    white-space: nowrap;
    pointer-events: none;
}

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

.h-100 {
    height: 100%;
}

.w-100 {
    width: 100%;
}

/* Main Layout */

.dynamic-page-header {
    background-color: var(--mud-palette-surface);
    z-index: 1000;
}

@media (max-width: 959.98px) {
    .dynamic-page-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        padding: 0 16px;
        border-bottom: 1px solid var(--mud-palette-divider);
    }

    .page-title-text {
        font-size: 1.5rem !important;
    }

    .main-content-container {
        padding-top: 80px !important;
    }
}

@media (min-width: 960px) {
    .dynamic-page-header {
        position: static;
        background-color: transparent;
        border-bottom: none;
        margin-bottom: 6px;
        height: 64px;
    }

    .page-title-text {
        font-size: 2.125rem !important;
    }

    .main-content-container {
        padding-top: 10px !important;
    }
}

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

/* 4. The SVG Wrapper */
.loading-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Start at top (12 o'clock) */
}

    /* Common circle styles */
    .loading-progress circle {
        fill: none;
        stroke-width: 6; /* Thicker, easier to see */
        stroke-linecap: round; /* Smooth rounded ends */
    }

.loading-circle-bg {
    stroke: #e0e0e0;
}

/* The Progress Value */
.loading-circle-progress {
    stroke: #0dcaf0; /* MudBlazor Primary Color */
    stroke-dasharray: var(--blazor-load-percentage, 0%) 200%;
    transition: stroke-dasharray 0.1s linear; /* Smooth update */
}

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

/* Fix negative MudGrid margin on top of tab headers */
.mud-tabs-panels {
    overflow: hidden;
}

/* Fix datepicker's labels */
.mud-picker .mud-input-outlined-with-label .mud-input-label-outlined.mud-input-label-inputcontrol {
    padding-right: 40px !important;
}

/* --- MAP CONTAINER --- */
.map-container {
    background-color: var(--mud-palette-surface);
    overflow: hidden;
    position: relative;
    font-family: 'Roboto', sans-serif;
}

/* --- PATHS (Borders) --- */
.map-path {
    stroke: var(--mud-palette-background); /* White in Light, Dark Grey in Dark */
    stroke-width: 0.5px;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: opacity 0.2s;
    opacity: 0.9;
}

    .map-path:hover {
        opacity: 1.0;
        stroke: var(--mud-palette-text-primary);
        stroke-width: 1.5px;
        z-index: 10; /* Bring to front logically */
    }

/* --- TEXT LABELS (The Fix) --- */
.map-label {
    pointer-events: none;
    font-weight: 700; /* Bold for readability */
    /* HALO EFFECT: This creates a thick outline matching the background color */
    /* This ensures text pops regardless of the region color underneath */
    fill: var(--mud-palette-text-primary);
    stroke: var(--mud-palette-surface);
    stroke-width: 3px;
    paint-order: stroke fill; /* Draw outline BEHIND the text */
    stroke-linejoin: round;
}

/* Region Labels (Large) */
.label-region {
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Province Labels (Medium) */
.label-province {
    font-weight: 500;
}

/* City Labels (Small) */
.label-city {
    font-weight: 400;
    fill: var(--mud-palette-text-primary);
    /* Make city halo slightly thinner */
    stroke-width: 2.5px;
}

/* City Markers */
.city-marker {
    fill: var(--mud-palette-text-primary); /* Contrast dot */
    stroke: var(--mud-palette-surface); /* Halo around dot */
    stroke-width: 1px;
    cursor: pointer;
    transition: r 0.2s;
}

    .city-marker:hover {
        fill: var(--mud-palette-secondary);
    }

/* Range Date picker fix */
.mud-picker-datepicker-toolbar .mud-button-date {
    font-size: 1.75rem !important;
    margin-left: auto;
    margin-right: auto;
}

/* Table Management */
td.mud-table-cell,
th.mud-table-cell {
    padding: 5px !important;
}

.selected-row {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.2);
}

    .selected-row:hover {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.3) !important;
    }

.mobile-list-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 15px 4px 0;
    width: 100%;
    position: relative;
}

.mobile-list-chevron {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}


.full-height-table {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    /* Used for elevation shadow */
    margin-bottom: 4px;
}

    /* Internal scrollable area */
    .full-height-table .mud-table-container {
        flex: 1 1 0px !important;
        overflow-y: auto !important;
    }

    /* Fixed pager at bottom */
    /*
    .full-height-table .mud-table-pagination {
        flex: none !important;
        min-height: 52px !important;
        max-height: 52px !important;
        overflow: hidden !important;
    }
    */

.mud-table-pagination {
    flex: none !important;
    min-height: 40px !important;
    max-height: 40px !important;
    overflow: hidden !important;
}

    .mud-table-pagination .mud-table-pagination-toolbar {
        padding-top: 0px !important;
        min-height: 0 !important;
        height: 40px;
    }

@media (min-width:601px) {
        .full-height-table table.mud-table-root {
        table-layout: fixed;
        width: 100% !important;
    }

    /* Ellipsis strictly for header text content */
    .full-height-table .mud-table-sort-label .mud-table-sort-label-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Normal wrapping for data */
    .full-height-table td.mud-table-cell {
        word-wrap: break-word;
        white-space: normal !important;
    }

    .full-height-table .action-column {
        text-align: right !important;
    }

    .full-height-table .mud-table-dense * .mud-table-row .mud-table-cell {
        padding: 6px;
        padding-inline-start: 6px;
        padding-inline-end: 6px;
    }
}

/* Mobile adaptations */

@media (max-width: 600px) {
    /* Instantly hide colgroup to prevent horizontal space glitch */
    .full-height-table colgroup {
        display: none !important;
    }

    .full-height-table .mud-table-row {
        display: flex !important;
        align-items: center !important;
        padding: 4px 8px !important;
        border-bottom: 1px solid var(--mud-palette-divider) !important;
    }

    /* Suppress MudBlazor auto-labels for non-data/master cells */
    .full-height-table .mud-table-cell:first-child::before,
    .full-height-table .mobile-master-cell::before {
        display: none !important;
    }

    .full-height-table .mud-table-cell {
        padding: 0 !important;
    }

    .full-height-table .mud-table-cell-checkbox .mud-checkbox {
        margin: 0 !important;
        padding: 0 !important;
    }

    .full-height-table .mud-table-cell.mobile-master-cell {
        display: block !important;
        flex-grow: 1 !important;
        padding: 0 0 0 12px !important;
        border: none !important;
    }
    /*
    .full-height-table .mud-table-pagination-toolbar {
        padding-top: 0px !important;
        min-height: 0 !important;
    }
    */

    .full-height-table .mud-table-pagination-actions {
        margin-left: auto !important;
    }

    .full-height-table .mud-table-pagination-display {
        display: none;
    }

    .responsive-button {
        font-size: 0 !important;
    }

        .responsive-button span {
            margin: 0 !important;
            font-size: 0 !important;
        }

        .responsive-button button {
            min-width: 50px;
            padding: 6px 16px !important;
        }
}

.footnote-number {

}