@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';

/* Sections:
   1. Base: font, body, headings, links
   2. Utilities
   3. Theme: Bootstrap variables (follow the Fluent brand color), badges, bg-label
   4. Layout: app header, side nav / mobile drawer, body, list pages, section wrappers
   5. Fluent UI v5 component overrides: card, data grid, paginator, input file, dropdown, dialog, textarea
   6. Forms: Bootstrap form-control / select, custom labels
   7. Misc components: loading, tables, widgets, thumbnails / image zoom
   8. Blazor error UI
   9. Print (keep last: it overrides the screen rules above at equal specificity) */


/* ==================== 1. Base ==================== */

@font-face {
    font-family: "Avenir";
    src: url("fonts/Avenir/0078f486-8e52-42c0-ad81-3c8d3d43f48e.woff2") format("woff2"), url("fonts/Avenir/908c4810-64db-4b46-bb8e-823eb41f68c0.woff") format("woff"), url('fonts/Avenir/Avenir.ttf') format('truetype');
    font-display: block;
}

body {
    --fontFamilyBase: "Avenir", "Segoe UI Variable", "Segoe UI", "Noto Sans SC", sans-serif;
    font-family: var(--fontFamilyBase);
    font-size: var(--fontSizeBase300);
    line-height: var(--lineHeightBase300);
    margin: 0;
    background: #d5d8da !important;
    --colorBrandForegroundLink: #0d6efd;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
}

h3 {
    font-size: var(--fontSizeBase600) !important;
    line-height: var(--lineHeightBase600) !important;
}

h4 {
    font-size: var(--fontSizeBase500) !important;
    line-height: var(--lineHeightBase500) !important;
}

h5 {
    font-size: var(--fontSizeBase400) !important;
    line-height: var(--lineHeightBase400) !important;
}

h6 {
    font-size: var(--fontSizeBase300) !important;
    line-height: var(--lineHeightBase300) !important;
}

a[href] {
    text-decoration: none;
    color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
}

    a[href]:hover {
        text-decoration: underline;
    }

code {
    color: #c02d76;
}


/* ==================== 2. Utilities ==================== */

.hide {
    display: none;
}

.show {
    display: block;
}

.m-b-10 {
    margin-bottom: 10px !important;
}

.pull-right {
    float: right !important;
}

.height-150 {
    height: 150px !important;
}

.height-200 {
    height: 200px !important;
}

@media (max-width: 600px) {
    .xs-hide {
        display: none !important;
    }
}


/* ==================== 3. Theme ==================== */

:root, [data-bs-theme=light] {
    --bs-paper-bg: #fff;
    --bs-paper-bg-rgb: 255, 255, 255;
    --bs-bg-label-tint-amount: 84%;
    --bs-primary: var(--colorBrandBackground); /* follows the Fluent brand color (AppTheme.BrandColor) */
    --bs-secondary: #808390;
    --bs-success: #28c76f;
    --bs-info: #00bad1;
    --bs-warning: #ff9f43;
    --bs-danger: #ff4c51;
    --bs-light: #dfdfe3;
    --bs-dark: #2f3349;
    --bs-gray: #97959e;
    --bs-primary-rgb: 95, 80, 197; /* = AppTheme.BrandColor #5f50c5; an rgb triplet can't reference a var */
    --bs-secondary-rgb: 128, 131, 144;
    --bs-success-rgb: 40, 199, 111;
    --bs-info-rgb: 0, 186, 209;
    --bs-warning-rgb: 255, 159, 67;
    --bs-danger-rgb: 255, 76, 81;
    --bs-light-rgb: 223, 223, 227;
    --bs-dark-rgb: 47, 51, 73;
    --bs-gray-rgb: 151, 149, 158;
    --bs-primary-text-emphasis: #2e2960;
    --bs-secondary-text-emphasis: #33343a;
    --bs-success-text-emphasis: #10502c;
    --bs-info-text-emphasis: #004a54;
    --bs-warning-text-emphasis: #66401b;
    --bs-danger-text-emphasis: #661e20;
    --bs-light-text-emphasis: #6d6b77;
    --bs-dark-text-emphasis: #6d6b77;
    --bs-primary-bg-subtle: #e9e7fd;
    --bs-secondary-bg-subtle: #ebebed;
    --bs-success-bg-subtle: #ddf6e8;
    --bs-info-bg-subtle: #d6f4f8;
    --bs-warning-bg-subtle: #fff0e1;
    --bs-danger-bg-subtle: #ffe2e3;
    --bs-light-bg-subtle: #f5f5f6;
    --bs-dark-bg-subtle: #dedee2;
    --bs-primary-border-subtle: #c8c4f9;
    --bs-secondary-border-subtle: #cdcfd4;
    --bs-success-border-subtle: #abe9c7;
    --bs-info-border-subtle: #9ce4ed;
    --bs-warning-border-subtle: #ffdab6;
    --bs-danger-border-subtle: #ffb9bb;
    --bs-light-border-subtle: #e6e6e8;
    --bs-dark-border-subtle: #aeafb8;
    --bs-white-rgb: 255, 255, 255;
    --bs-black-rgb: 47, 43, 61;
}

.badge {
    --bs-badge-padding-x: 0.77em;
    --bs-badge-padding-y: 0.4235em;
    --bs-badge-font-size: 0.8667em;
    --bs-badge-font-weight: 700;
    --bs-badge-color: #fff;
    --bs-badge-border-radius: 0.125rem;
    display: inline-block;
    padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
    font-weight: var(--bs-badge-font-weight);
    line-height: 1;
    color: var(--bs-badge-color);
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--bs-badge-border-radius);
}

    .badge:empty {
        display: none;
    }

/* Light tinted background + strong text in the theme color. */
.bg-label-primary {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-primary)) !important;
    color: var(--bs-primary) !important;
}

.bg-label-secondary {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-secondary)) !important;
    color: var(--bs-secondary) !important;
}

.bg-label-success {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-success)) !important;
    color: var(--bs-success) !important;
}

.bg-label-info {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-info)) !important;
    color: var(--bs-info) !important;
}

.bg-label-warning {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-warning)) !important;
    color: var(--bs-warning) !important;
}

.bg-label-danger {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-danger)) !important;
    color: var(--bs-danger) !important;
}

.bg-label-dark {
    background-color: color-mix(in sRGB, var(--bs-paper-bg) var(--bs-bg-label-tint-amount), var(--bs-dark)) !important;
    color: var(--bs-dark) !important;
}


/* ==================== 4. Layout ==================== */

/* ---- App header (MainLayoutHead) ----
   Wide: logo + full test banner + quick search.
   <960px: banner shrinks to its icon. <768px: quick search hidden (hamburger shows).
   <600px: text title instead of the logo, tighter spacing. <400px: short title. */
.fluent-layout-item.app-header {
    padding: 0.5rem 1.5rem;
    column-gap: 4px;
}

a.header-brand[href] {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #000;
    text-decoration: none !important;
    white-space: nowrap;
}

.header-logo {
    display: block;
    max-height: 45px;
}

.header-title {
    display: none;
    font-weight: 700;
    font-size: var(--fontSizeBase400);
}

.test-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 45px;
    padding: 0 12px;
    border-radius: var(--borderRadiusMedium);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    column-gap: 16px;
}

.header-action {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.header-quicksearch {
    display: flex;
    align-items: center;
}

/* Mobile menu button (FluentLayoutHamburger in MainLayout). v5 puts an inline white color on the
   button (meant for a brand-colored header); ours is white, so use the brand color. */
.fluent-layout-item[area=header] .fluent-layout-hamburger {
    margin: 0 8px 0 -8px;
}

    .fluent-layout-item[area=header] .fluent-layout-hamburger fluent-button {
        color: var(--colorBrandForeground1) !important;
    }

    .fluent-layout-item[area=header] .fluent-layout-hamburger:hover {
        background-color: transparent;
    }

@media (max-width: 959.98px) {
    .test-badge {
        padding: 0 6px;
        height: 32px;
    }

    .test-badge-text {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .header-quicksearch {
        display: none;
    }
}

@media (max-width: 599.98px) {
    .fluent-layout-item.app-header {
        padding: 0.5rem 0.75rem;
    }

    .header-logo {
        display: none;
    }

    .header-title {
        display: inline;
    }

    .header-actions {
        column-gap: 10px;
    }
}

@media (max-width: 399.98px) {
    .header-title-suffix {
        display: none;
    }

    .header-actions {
        column-gap: 6px;
    }
    #login-logo{
        max-width: 350px;
    }
}

/* ---- Side nav (NavMenu) ---- */
.navmenu {
    background-color: var(--colorBrandBackground);
}

nav.sitenav {
    box-shadow: 0 0.125rem 0.5rem 0 rgba(47, 43, 61, 0.12);
}

/* Fluent UI v5 FluentNav: purple sidebar with white text. Colors come from the
   --nav-bg-color / --nav-bg-color-hover variables the library reads. */
.sitenav .fluent-nav {
    --nav-bg-color: var(--colorBrandBackground);
    --nav-bg-color-hover: rgba(0,0,0,.4);
    /* Nav icons are filled with these tokens inline; make them white inside the sidebar.
       The selected item (e.g. a collapsed category holding the current page) switches its
       icon to the brand token, which would be purple on the purple sidebar. */
    --colorNeutralForeground1: #fff;
    --colorNeutralForeground2: #fff;
    --colorBrandForeground1: #fff;
    padding: 0;
    row-gap: 0;
    color: #fff;
}

    .sitenav .fluent-nav .fluent-navitem,
    .sitenav .fluent-nav .fluent-navcategoryitem,
    .sitenav .fluent-nav .fluent-navcategoryitem > .expand-icon {
        color: #fff;
        border-radius: 0;
    }

    /* Expanded group: a slightly darker brand shade behind the sub items
       (--colorBrandBackgroundSelected was too dark). */
    .sitenav .fluent-nav .fluent-navsubitemgroup {
        --nav-bg-color: color-mix(in srgb, var(--colorBrandBackground) 80%, #000);
    }

    /* Current page stays highlighted like hover; white indicator bar. */
    .sitenav .fluent-nav .fluent-navitem.active {
        background-color: rgba(0,0,0,.4);
    }

        .sitenav .fluent-nav .fluent-navitem.active:after {
            background-color: #fff;
        }

    /* Third-level categories (a category inside a category, e.g. Interment > Society) collapse
       normally; nav group heights are fixed by wwwroot/js/FluentNav.razor.override.js.
       Sub items carry an inline <FluentIcon> (v5 doesn't render IconRest for sub items), so
       they use a tighter indent and icon gap than the library's 46px / 16px to keep labels
       on one line in the 250px sidebar. Third-level items sit 20px deeper than the second. */
    .sitenav .fluent-nav .fluent-navsubitemgroup .fluent-navsubitem {
        padding-inline-start: 36px;
        column-gap: 8px;
    }

    .sitenav .fluent-nav .fluent-navsubitemgroup .fluent-navsubitemgroup .fluent-navsubitem {
        padding-inline-start: 56px;
    }

/* Mobile menu drawer opened by the hamburger: brand-colored panel, the nav fills it edge to edge. */
fluent-drawer[hamburger]::part(dialog) {
    background-color: var(--colorBrandBackground);
    width: min(300px, 85vw);
    border: none;
}

fluent-drawer[hamburger] fluent-drawer-body {
    padding: 0;
    row-gap: 0;
}

    fluent-drawer[hamburger] fluent-drawer-body::part(header) {
        padding: 6px 6px 6px 16px;
        min-height: 0;
    }

    fluent-drawer[hamburger] fluent-drawer-body > [slot=close] {
        color: #fff;
    }

fluent-drawer[hamburger] .navmenu,
fluent-drawer[hamburger] nav.sitenav {
    width: 100%;
    box-shadow: none;
}

fluent-drawer[hamburger] #main-menu {
    width: 100% !important;
    min-width: 0 !important;
}

/* ---- Body ---- */
.body-content {
    align-self: stretch;
    height: calc(100dvh - 86px) !important;
    display: flex;
    position: relative;
    padding: 1rem;
}

.content {
    align-self: stretch !important;
    width: 100%;
}

/* ---- List pages ----
   Card is capped to the body area (86px header+footer, 2rem body padding)
   so the page never scrolls; only .list-card-scroll (the grid) scrolls. */
.list-card {
    max-height: calc(100dvh - 86px - 2rem);
    height: auto;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .list-card > .list-card-fixed {
        flex: 0 0 auto;
    }

    .list-card > .list-card-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    /* A FluentDataGrid (display:grid, width:100%) inside the scroll box resolves to a fractional
       width (e.g. 1551.33px) while the box's client width is the floored integer, so native
       (Windows) scrollbars show a spurious horizontal scrollbar for that sub-pixel overflow —
       even with no rows. Capping the grid 1px under the box removes the false bar while leaving
       genuine overflow (narrow screens, where the column tracks exceed the box) free to scroll.
       Bootstrap's .table-responsive (overflow-x: auto) wrapper has the same problem. */
    .list-card-scroll > .fluent-data-grid,
    .table-responsive > .fluent-data-grid {
        max-width: calc(100% - 1px);
    }

    /* Plain <table class="table list-card-table"> inside a list-card-scroll: keep the header
       row visible while the body scrolls (mirrors the FluentDataGrid sticky header). */
    .list-card-scroll > .list-card-table > thead > tr > th {
        position: sticky;
        top: 0;
        z-index: 1;
        background-color: var(--colorNeutralBackground4);
    }

/* List page header: title on the left, actions (filters + buttons) on the right, kept on one
   line. On phones the title takes the first row and the actions the second.
   On a FluentStack also set Wrap="true" (the stack writes flex-wrap inline). */
.list-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
}

.list-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* CustomListHead: the criteria chips + buttons fill the rest of the title row and keep the h4
   font they had when they sat inside the title (FluentOverflow collapses what doesn't fit). */
.list-head-filters {
    flex: 1 1 0;
    min-width: 0;
    font-size: var(--fontSizeBase500);
    line-height: var(--lineHeightBase500);
    font-weight: 700;
}

    /* Phone variant of the chips (all of them, wrapped); hidden on wider screens. */
    .list-head-filters > .list-head-chips {
        display: none;
        flex-wrap: wrap;
        gap: 4px;
    }

@media (max-width: 599.98px) {
    /* Chips get their own full row and all show; the buttons go on the row below. */
    .list-head-filters {
        flex-basis: 100%;
    }

        .list-head-filters > fluent-overflow {
            display: none;
        }

        .list-head-filters > .list-head-chips {
            display: flex;
        }

            .list-head-filters > .list-head-chips:empty {
                display: none;
            }
}

@media (max-width: 599.98px) {
    .list-card-header > h3,
    .list-card-header > h4 {
        flex-basis: 100%;
        margin-bottom: 0;
    }

    /* FluentSpacer (an empty flex-grow div): drop it so the wrapped rows start at the left. */
    .list-card-header > div:empty {
        display: none;
    }
}

/* ---- Section wrappers ----
   Replace Fluent UI v4's FluentHeader / FluentBodyContent / FluentFooter (removed in v5).
   Same layout as the v4 components, using the v5 design tokens. */
.section-header {
    display: flex;
    z-index: 10;
    flex-shrink: 0;
    height: 50px;
    background-color: var(--colorBrandBackground);
    font-family: var(--fontFamilyBase);
    font-weight: bold;
    font-size: var(--fontSizeBase400);
    line-height: var(--lineHeightBase400);
    color: var(--colorNeutralForegroundOnBrand);
}

    .section-header > .header-gutters {
        display: flex;
        position: relative;
        align-items: center;
        width: 100%;
        margin: 0.5rem 1.5rem;
    }

.section-body {
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    height: 100%;
    width: 100%;
}

.section-footer {
    display: flex;
    z-index: 10;
    flex-direction: row;
    font-size: var(--fontSizeBase200);
    line-height: var(--lineHeightBase200);
}

/* Replaces Fluent UI v4's FluentHorizontalScroll (removed in v5). */
.horizontal-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
}


/* ==================== 5. Fluent UI v5 component overrides ==================== */

/* ---- Card ---- */
.fluent-card .fluent_header {
    border-radius: var(--borderRadiusMedium) var(--borderRadiusMedium) 0 0;
    padding: 10px 15px;
    background-color: var(--colorBrandBackground);
    color: #fff;
}

/* ---- Data grid ---- */
:root {
    --datagrid-hover-color: lightyellow;
}

.fluent-data-grid td[multiline=true] {
    padding-top: 6px;
    padding-bottom: 6px;
}

.fluent-data-grid tr[row-type=sticky-header] > th {
    background-color: var(--colorNeutralBackground4);
}

.fluent-data-grid th > a {
    display: flex;
    justify-content: flex-start;
    padding: 6px;
    user-select: none;
    text-decoration: none;
    color: #1e77c5 !important;
    cursor: pointer;
}

.fluent-data-grid a[href] {
    text-decoration: none;
    color: #0d6efd;
    outline: none !important;
}

    .fluent-data-grid a[href]:hover {
        text-decoration: none;
        color: #0d6efd;
        outline: none !important;
    }

.fluent-data-grid td, .fluent-data-grid .col-title {
    padding-left: 3px !important;
    padding-right: 3px !important;
}

    .fluent-data-grid tr td:first-child, .fluent-data-grid .col-title:first-child {
        padding-left: 6px !important;
    }

    .fluent-data-grid tr td:last-child, .fluent-data-grid .col-title:last-child {
        padding-right: 6px !important;
    }

/* "No data to show." / loading / error row: v5 gives table cells no vertical padding and
   the row only gets the leftover height of the grid, so in a content-sized grid it is a thin strip. */
.fluent-data-grid tr[row-state=empty-content] > td,
.fluent-data-grid tr[row-state=loading-content] > td,
.fluent-data-grid tr[row-state=error-content] > td {
    padding-block: 15px;
}

/* Bordered grid: <FluentDataGrid Class="grid-bordered"> draws a line around every cell.
   The v5 grid lays out as CSS grid (rows are display:contents), so border-collapse does not
   apply — the table draws the top/left edge and each cell only its right/bottom edge,
   which avoids double lines. */
.fluent-data-grid.grid-bordered {
    --grid-border-color: var(--colorNeutralStroke1);
    border-top: 1px solid var(--grid-border-color);
    border-left: 1px solid var(--grid-border-color);
}

    .fluent-data-grid.grid-bordered > thead > tr > th,
    .fluent-data-grid.grid-bordered > tbody > tr > td {
        border-top: none;
        border-left: none;
        border-right: 1px solid var(--grid-border-color);
        border-bottom: 1px solid var(--grid-border-color);
    }

    /* Header cells are display:block and stretch to the tallest one in the row (a wrapped
       two-line title), so single-line titles sat at the top. align-content centers them
       vertically and keeps the column's text-align (Align) untouched. */
    .fluent-data-grid > thead > tr > th {
        align-content: center;
    }

/* Success-green checkbox: <FluentCheckbox Class="checkbox-success">. The checked box is painted
   from the compound-brand tokens inside its shadow DOM, so swap those for the success green. */
.checkbox-success {
    --colorCompoundBrandBackground: var(--colorStatusSuccessForegroundInverted);
    --colorCompoundBrandBackgroundHover: var(--colorStatusSuccessForegroundInverted);
    --colorCompoundBrandBackgroundPressed: var(--colorStatusSuccessForegroundInverted);
    --colorCompoundBrandStroke: var(--colorStatusSuccessForegroundInverted);
    --colorCompoundBrandStrokeHover: var(--colorStatusSuccessForegroundInverted);
    --colorCompoundBrandStrokePressed: var(--colorStatusSuccessForegroundInverted);
}

/* Phone layout: add class "grid-mobile-cards" to the grid's wrapper; on narrow screens
   each row becomes a card and each cell a "label: value" line. Labels come from the column's Class
   via ::before content (see the page's .razor.css). */
@media (max-width: 600px) {
    .grid-mobile-cards .fluent-data-grid,
    .grid-mobile-cards .fluent-data-grid tbody,
    .grid-mobile-cards .fluent-data-grid tr,
    .grid-mobile-cards .fluent-data-grid td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .grid-mobile-cards .fluent-data-grid.grid-bordered {
        border: none;
    }

    .grid-mobile-cards .fluent-data-grid thead,
    .grid-mobile-cards .fluent-data-grid tr[row-type=header],
    .grid-mobile-cards .fluent-data-grid tr[row-type=sticky-header] {
        display: none !important;
    }

    .grid-mobile-cards .fluent-data-grid tr {
        margin: 8px;
        width: auto !important;
        border: 1px solid var(--colorNeutralStroke2);
        border-radius: 6px;
        padding: 6px 4px;
        background-color: var(--colorNeutralBackground1);
    }

    .grid-mobile-cards .fluent-data-grid td {
        display: flex !important;
        gap: 8px;
        border: none !important;
        padding: 3px 6px !important;
        white-space: normal;
        overflow-wrap: anywhere;
        min-height: 0;
        height: auto !important;
    }

        .grid-mobile-cards .fluent-data-grid td::before {
            flex: 0 0 90px;
            font-size: var(--fontSizeBase200);
            font-weight: 600;
            color: var(--colorNeutralForeground3);
        }

        .grid-mobile-cards .fluent-data-grid td > * {
            min-width: 0;
        }

    .grid-mobile-cards .text-nowrap {
        white-space: normal !important;
    }
}

/* ---- Paginator (CustomFluentPaginator) ---- */
.page-buttons {
    align-items: center;
    display: flex;
    column-gap: 5px;
}

.fluent-paginator .pagination-text {
    margin: 0;
}

/* Summary on the left, page buttons on the right; when they don't fit side by side the
   buttons wrap onto their own row. The summary's two phrases never break inside. */
.fluent-paginator {
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 6px;
}

    .fluent-paginator .summary {
        display: flex;
        flex-wrap: wrap;
        column-gap: 1.5rem;
    }

    .fluent-paginator .summary-part {
        white-space: nowrap;
    }

/* Narrow screens: stack summary over centered buttons and show fewer page numbers
   (CustomFluentPaginator marks numbers by distance from the current page). */
@media (max-width: 767.98px) {
    .fluent-paginator {
        justify-content: center;
    }

        .fluent-paginator .summary {
            width: 100%;
            justify-content: center;
        }

        .fluent-paginator .paginator-nav {
            margin-inline: auto;
        }

    .page-buttons .page-far2 {
        display: none;
    }
}

@media (max-width: 599.98px) {
    .fluent-paginator .paginator-nav,
    .page-buttons {
        gap: 4px;
    }

    .page-buttons .page-far1 {
        display: none;
    }
}

@media (max-width: 399.98px) {
    .fluent-paginator .paginator-nav fluent-button[aria-label="Go to first page"],
    .fluent-paginator .paginator-nav fluent-button[aria-label="Go to last page"] {
        display: none;
    }
}

/* ---- Input file ---- */
.fluent-inputfile-container {
    height: 40px;
    line-height: 40px;
    border: 1px dashed var(--colorBrandBackground);
}

.inputfile-content {
    pointer-events: none;
}

/* ---- Combobox ----
   The slotted <input> defaults to size=20 (~145px) and, as a flex item with
   min-width:auto, can't shrink below that, so the combobox ignores a narrow Width/column.
   (Narrower than 160px still needs ControlStyle="min-width: ..." on the component.) */
fluent-dropdown[type=combobox] > input[slot=control] {
    min-width: 0;
    width: 0; /* flex: 1 still makes it fill the control */
}

/* ---- Dialog / drawer body ---- */
/* A focused Fluent input draws its accent underline (::after) 1px past each side
   (left/right: -1px). A full-width input therefore overflows the scrollable content part by ~1px and
   shows a horizontal scrollbar while focused (immediately, with Autofocus). 1px of side padding absorbs it. */
fluent-dialog-body::part(content) {
    padding-inline: 1px;
}

/* The sticky title is z-index 1, the same as fluent-dropdown's inner .control (position: relative),
   so a dropdown scrolled under the title paints on top of it. Lift the title above the content. */
fluent-dialog-body::part(title) {
    z-index: 3;
}

/* The shadow "actions" part (16px + 24px padding) is rendered even when nothing is put
   in <ActionTemplate>. Panels that keep their buttons inside the content got ~40px of blank space below
   them, so hide the part when no slot="action" child exists. */
fluent-dialog-body:not(:has(> [slot="action"]))::part(actions) {
    display: none;
}

/* <FluentDialogBody Class="dialog-fill">: the body only grows to its content, so a dialog with a fixed
   Height left blank space below. Stretch the body to the dialog and hand the remaining height down
   the content part and the ChildContent div, so a flex: 1 child (e.g. a PDF iframe) fills it. */
fluent-dialog-body.dialog-fill {
    height: 100%;
    box-sizing: border-box;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

    fluent-dialog-body.dialog-fill::part(content) {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    fluent-dialog-body.dialog-fill > :not([slot]) {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

/* <FluentDialogBody Class="dialog-scroll">: with a fixed dialog Height, content taller than the dialog
   pushed the body past it and the sticky actions bar covered the last lines (e.g. EmailDialog's attachment
   list). Cap the body at the dialog height so the content part scrolls above the actions instead. */
fluent-dialog-body.dialog-scroll {
    height: 100%;
    box-sizing: border-box;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

/* Phones: a dialog uses almost the whole screen width whatever Width the caller passed (70%, 90%,
   500px, max(90%, 1000px)...; it ends up on the inner dialog part), and the body padding shrinks so
   forms and grids get the room. */
@media (max-width: 599.98px) {
    fluent-dialog::part(dialog) {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }

    fluent-dialog-body {
        padding-inline: 12px;
    }
}

/* ---- Text area ----
   With Resize="Vertical": the library only stretches textareas without a resize attribute
   (fluent-textarea:not([resize]) { width: 100% }), so a vertically resizable one fell back to the web
   component's default 18rem width. Vertical-only resize doesn't change width, so stretch it as well. */
fluent-textarea[resize="vertical"],
fluent-textarea[resize="vertical"]::part(root) {
    width: 100%;
}

/* ---- Show/hide password button ----
   Placed in a FluentTextInput's EndTemplate (Users/Create, ChangePassword, ResetPasswordPanel). */
.pwd-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
    display: flex;
    align-items: center;
}


/* ==================== 6. Forms ==================== */

.form-control {
    border-top: 1px solid #f2f2f2;
    border-left: 1px solid #f2f2f2;
    border-right: 1px solid #f2f2f2;
    border-bottom: 1px solid #aaa;
    border-radius: 3px;
    padding: 5px 9px;
    font-size: 0.9rem;
}

    .form-control:focus {
        border-color: #f2f2f2;
        box-shadow: none;
        border-bottom: 2px solid var(--colorBrandBackground);
        border-radius: 3px 3px 0 0;
    }

    .form-control.grey-info {
        background-color: #e9ecef;
        height: auto;
        min-height: 34px;
    }

select.form-control {
    appearance: none;
    background-image: url("../icon/arrow.png") !important;
    background-repeat: no-repeat;
    background-position: calc(100% - 7px) 50%;
    background-size: 12px auto;
    padding-right: 20px !important;
}

    select.form-control:disabled {
        opacity: 0.8;
        cursor: no-drop;
    }

/* Plain label styled like a Fluent field label (for non-Fluent inputs next to Fluent ones). */
.fluent-input-label {
    color: var(--colorNeutralForeground1);
    font-family: var(--fontFamilyBase);
    font-size: var(--fontSizeBase300);
    line-height: var(--lineHeightBase300);
    font-weight: initial;
    font-variation-settings: normal;
    display: block;
}

.fluent-height-input {
    height: calc(var(--height-number, 32) * 1px);
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.validation-message {
    color: var(--colorPaletteRedForeground1);
}
.my-3-o{
    margin:0;
}

/* ==================== 7. Misc components ==================== */
.alert {
    border: 1px dashed var(--colorBrandBackground);
    padding: 5px;
}

.loading-zone {
    background: #fff;
    padding: 20px 15px;
    border-radius: 5px;
    text-align: center;
    min-width: 300px;
}

    .loading-zone > .loading-ring {
        width: 42px;
        margin: 20px auto;
    }

/* ---- Tables / detail fields ---- */
table.card-border, div.card-border {
    border: 1px solid #d6d6d6;
    border-radius: 5px;
}

thead.table-light th {
    border-bottom: 2px solid #bec3c6 !important;
}

.detail_key {
    font-weight: 400;
    color: #663300;
}

.detail_value {
    font-weight: 600;
}

/* Section heading inside the plot-detail edit panel (Plot / Enclosure & Monument / ...). */
.plot-section-title {
    margin: 14px 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--colorNeutralStroke2);
    color: var(--colorNeutralForeground2);
    font-weight: 600;
}

.plot-section-title:first-child {
    margin-top: 0;
}

.dbclick {
    padding: 2px 4px;
    background-color: aliceblue;
    border-radius: 4px;
    min-height: 24px;
    white-space: pre-wrap;
}

/* ---- EC summary tables (Care/EC/HistorySummary, TrialSummary) ---- */
.ec-summary-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

    .ec-summary-table td {
        border-bottom: 1px solid #ccc;
        padding: 10px 20px;
    }

    .ec-summary-table tr td:nth-child(2) {
        text-align: right;
    }

    .ec-summary-table td.indent {
        padding-left: 50px;
    }

.ec-summary-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    font-size: 1.3em;
}

@media (max-width: 599.98px) {
    .ec-summary-table td {
        padding: 8px 10px;
    }

    .ec-summary-table td.indent {
        padding-left: 22px;
    }
}

/* ---- Widgets (home page stats) ---- */
.widget {
    border: none;
    box-shadow: 0 2px 0 rgba(0,0,0,.07);
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;
    background: #fff;
    padding: 20px 10px;
    display: block;
    text-align: center;
}

.widget-stat-text, .widget-stat-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.widget-stat-title {
    font-weight: 600;
}

.widget-stat-text {
    font-size: 0.875em;
}

.widget-stat-number {
    font-size: 26px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 700;
}

/* ---- Thumbnails and image zoom ---- */
.thumbnail {
    background-color: #ccc;
    background-image: radial-gradient(white, #ccc);
    position: relative;
    padding: 3px;
    margin-bottom: 15px;
    border-radius: 5px;
}

    .thumbnail a > img, .thumbnail > img {
        display: block;
        max-width: 100%;
        height: auto;
        margin-right: auto;
        margin-left: auto;
    }

.thumbnailIcon {
    font-size: 1.6rem;
    border: 2px solid #ffc107;
    border-radius: 50%;
    width: 30px !important;
    height: 30px;
    display: inline-block;
    text-align: center;
    position: absolute;
    top: -15px;
    right: -15px;
    background: rgba(255,255,255,0.8);
}

#imageZoomDiv {
    overflow: auto;
    position: relative;
    border: 1px solid #000;
    border-radius: 0px 0px 5px 5px;
    text-align: center;
}

    #imageZoomDiv img {
        margin: auto;
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
    }

.imageZoomIcon {
    position: absolute;
    top: 5px;
    right: 20px;
    z-index: 9;
}

/* FilePreviewDialog PDF/txt preview: the iframe is always shown; where it stays empty (Android can't render a
   PDF in an iframe, iOS shows only the first page) the FluentMessageBar under it offers "Open in new window". */
.doc-preview-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.doc-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: 1px solid var(--neutral-stroke-rest, #ccc);
}


/* ==================== 8. Blazor error UI ==================== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    margin: 20px 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


/* ==================== 9. Print ==================== */

@media print {
    .no-print, .no-print * {
        display: none !important;
    }

    @page {
        size: letter; /* the size of print page, and auto is the initial value */
        margin: 10mm; /* printer-safe margins — 0mm clipped content into the unprintable left edge */
    }

    /* Print flows top-to-bottom like paper: drop the fixed-viewport heights and the
       overflow:hidden flex shell, otherwise browsers clip the print at one screen. */
    .body-content {
        height: auto !important;
        overflow: visible !important;
        padding: 0.5rem;
    }

    .content {
        overflow: visible !important;
    }

    /* Grids are capped to ~300-400px scroll boxes on screen; uncage them on paper
       (mc cms.css @media print parity). */
    .table-responsive {
        overflow: visible !important;
        height: auto !important;
        max-height: initial !important;
    }

    .fluent-card {
        height: auto !important;
        max-height: initial !important;
    }

    .list-card {
        overflow: visible !important;
    }

    /* ---- printDiv() mode (Components/App.razor) ----
       printDiv() no longer swaps document.body.innerHTML (that destroyed the Blazor renderer's
       DOM and left the page inert after the preview closed). It now only sets html.print-mode
       and lets CSS hide everything outside #section-to-print. Scoped to .print-mode, so a plain
       Ctrl+P keeps the whole-page behaviour above. The shell must stop being a fixed-viewport
       flex box, otherwise the print is clipped at one screen. ml2026 parity (2026-10-27). */
    html.print-mode,
    html.print-mode body {
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    /* MainLayout sets overflow:hidden inline on the FluentLayout; .layout is flex-column. */
    html.print-mode .layout {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    html.print-mode .fluent-layout-item:not([area=content]) {
        display: none !important;
    }

    html.print-mode .body-content {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    html.print-mode .content {
        width: auto;
    }
}
