@font-face {
    font-family: "Material Symbols";
    src: url("_content/Radzen.Blazor/fonts/MaterialSymbolsOutlined.woff2") format("woff2 supports variations"),
         url("_content/Radzen.Blazor/fonts/MaterialSymbolsOutlined.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
}

.fill-slider .slider-bound-label {
    flex: 0 0 3.25rem;
    width: 3.25rem;
}

:root {
    --rz-primary: #153D77 !important;
    --rz-primary-lighter: #D6E4F4 !important;
    --rz-primary-light: #4871A6 !important;
    --rz-primary-dark: #0F2A54 !important;
    --rz-primary-darker: #081634 !important;
    --rz-on-primary-lighter: var(--rz-primary-darker) !important;
    --rz-on-primary-light: var(--rz-primary-dark) !important;
    --rz-on-primary: var(--rz-primary-lighter) !important;
    --rz-on-primary-dark: var(--rz-primary-light) !important;
    --rz-on-primary-darker: var(--rz-primary-lighter) !important;

    /* RadzenSteps defaults to --rz-secondary (pink) for the active step; use the app primary. */
    --rz-steps-number-selected-background: var(--rz-primary) !important;
    --rz-steps-number-selected-color: var(--rz-on-primary) !important;
    --rz-steps-title-selected-color: var(--rz-primary) !important;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-right {
    text-align: right !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.d-flex {
    display: flex !important;
}

.rz-tabview-nav {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
}

.rz-tabview-nav > li {
    flex-shrink: 0;
}

/* AnimalInfo's Pedigree tab needs a full-viewport-tall tree; let it grow the page
   instead of Radzen's default .rz-tabview-panels { overflow: auto } inner scroll. */
.animal-info-tabs .rz-tabview-panels {
    overflow: visible;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.w-100 {
    width: 100% !important;
}

.w-25 {
    width: 25% !important;
}

@media screen and (max-width: 1024px) {
    .w-25 {
        width: 60% !important;
    }

    .animal-info-trait-row {
        flex-wrap: wrap !important;
    }

    .animal-info-linear-scale {
        display: none;
    }
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

@media print {
    .print-layout .mb-4 {
        margin-bottom: 0.5rem !important;
    }
}

/* Shared by every report page whose grid is printed to PDF (wrap the RadzenDataGrid in .print-grid). */
.report-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f5f7;
}

/* Header titles wrap instead of being cut with an ellipsis. */
.print-grid .rz-column-title-content,
.print-grid .rz-column-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}
.print-grid .rz-cell-data,
.print-grid .rz-column-title-content {
    font-size: 0.65rem;
    line-height: 1.1;
}

.print-grid .rz-cell-data,
.print-grid .rz-cell-data .rz-text-truncate {
    max-width: 100%;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

.print-grid td,
.print-grid th {
    padding: 0.2rem 0.3rem;
}

@media print {
    .report-loading-overlay {
        display: none !important;
    }

    .print-grid {
        overflow: visible;
    }

    .print-grid .rz-grid-table {
        table-layout: fixed;
        width: auto;
    }

    .print-grid.fits-page .rz-grid-table {
        table-layout: fixed;
        width: 100%;
    }

    .print-grid * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}

.ml-2 {
    margin-left: 0.5rem !important;
}

.text-white {
    color: #fff !important;
}

.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

.rz-card.rz-variant-filled {
    border-radius: 12px;
}

.rz-footer {
    background-color: transparent;
}

/* Placeholder/label in the filter = Radzen placeholder gray + normal weight (matches the legacy). */
.filter-expander .rz-form-field-label {
    color: #757575 !important;
    font-weight: 400 !important;
}

h1:focus {
    outline: none;
}

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

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

.validation-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MzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* CustomDataGrid — global grid styling (marker class added in CustomDataGrid.GetComponentCssClass). */
.custom-data-grid td,
.custom-data-grid th {
    font-size: 0.9375rem !important;
}

.custom-data-grid thead th {
    background-color: #f1f5f9 !important;
}

/* Widen the "items per page" box so 3-4 digit values (100, 1000) are not clipped. */
.custom-data-grid .rz-paginator .rz-dropdown,
.custom-data-grid .rz-pager .rz-dropdown {
    width: 5.5rem !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
}

.custom-data-grid .rz-paginator .rz-dropdown .rz-dropdown-label,
.custom-data-grid .rz-pager .rz-dropdown .rz-dropdown-label {
    overflow: visible !important;
    text-overflow: clip !important;
    width: auto !important;
}

/* Pager summary ("Page X of Y") font size — match the legacy (gsp.css). */
.custom-data-grid {
    --rz-pager-summary-font-size: 1.3rem !important;
    border-radius: 12px;
    overflow: hidden;
}

/* Small grids (e.g. Herd List detail tabs) have no rows yet while loading, so the grid's
   natural height is tiny — combined with overflow:hidden above, that clips the loading
   lottie instead of letting it render full size. The floor must ALSO go on the scrolling
   ancestor (.rz-data-grid-data): Radzen renders the loading overlay position:absolute, so
   its own min-height can't grow the ancestor that clips it.

   Both rules are gated on .custom-data-grid-loading, which CustomDataGrid.GetComponentCssClass
   adds only while IsLoading is true. An unconditional floor is what makes a grid holding a
   single row show a tall blank area under it — the clipped-lottie fix and the blank-space bug
   are the same rule, so it must exist only while the lottie is actually on screen. */
.custom-data-grid-loading .grid-loading-container {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-data-grid-loading .rz-data-grid-data {
    min-height: 260px;
}

.dairy-report-grid.custom-data-grid-loading .grid-loading-container,
.dairy-report-grid.custom-data-grid-loading .rz-data-grid-data {
    min-height: 500px;
}

.filter-expander.rz-fieldset {
    background-color: #fff;
    border-radius: 12px;
}

/* Long FilterExpander titles wrap instead of being cut off: the legend and its (inline-flex)
   toggle button are capped at the fieldset width; the toggler and icon keep their size. */
.filter-expander .rz-fieldset-legend,
.filter-expander .rz-fieldset-legend button {
    max-width: 100%;
    white-space: normal;
    text-align: start;
}

.filter-expander .rz-fieldset-legend-text {
    white-space: normal;
    overflow-wrap: anywhere;
}

.filter-expander .rz-fieldset-legend .rzi,
.filter-expander .rz-fieldset-toggler {
    flex-shrink: 0;
}

.animal-data-filter-switch.rz-switch.rz-switch-checked .rz-switch-circle:before {
    background: #081634 !important;
}

.rz-breadcrumb-item .rz-link {
    color: #424242;
}

.rz-breadcrumb-item .rz-link:hover {
    color: #153D77;
}

/* Horizontal scroll when the grid content is wider than the viewport (small screens). */
.custom-data-grid .rz-data-grid-data {
    overflow-x: auto;
}

.custom-data-grid.custom-data-grid-expandable .rz-data-grid-data {
    container-type: inline-size;
}

/* Panel inside an expanded row: a plain div with this class around whatever the row Template
   renders. Two different limits are needed. width 0 keeps the panel out of the cell's intrinsic
   width, so it can never stretch the outer table; min-width then takes the narrower of the cell
   (100%) and the grid's visible area (100cqi, from the container rule above, less the cell
   padding). It has to be a min-width: the used width is max(min-width, min(max-width, width)),
   so a max-width here would never apply. Sticky keeps the panel in view while the outer grid
   scrolls sideways. */
.expanded-row-panel {
    position: sticky;
    left: 0;
    box-sizing: border-box;
    width: 0;
    min-width: min(100%, calc(100cqi - 2rem));
    overflow-x: auto;
}

/* Inside the panel, back to Radzen's own table-layout: RadzenDataGrid hardcodes
   rz-grid-table-fixed, and fixed is what holds the per-column Width values instead of squeezing
   them — the nested table overflows and the data area scrolls it under the rows. The portal-wide
   auto below would let the nested columns shrink to any width, so nothing ever overflows and no
   scrollbar appears. */
.expanded-row-panel .custom-data-grid .rz-grid-table {
    table-layout: fixed !important;
}

/* The pager keeps "items per page" against the right edge and sits outside the scrolling box, so
   it is clipped instead of scrolled; it only wraps below a 1024px viewport, which an expanded row
   never reaches. */
.expanded-row-panel .rz-pager {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

/* Every CustomDataGrid: let column content determine width at any screen size instead of
   Radzen's default table-layout:fixed, which truncates values with an ellipsis regardless of
   available space. Explicit per-column Width values are treated as a minimum, not a cap — long
   values grow the column and scroll horizontally (see the overflow-x rule above) instead of
   getting cut with an ellipsis. Kept global (not component-scoped ::deep) so it isn't at the
   mercy of the scope attribute propagating through CustomDataGrid<TItem>, a C# component, not
   a .razor file. */
.custom-data-grid .rz-grid-table {
    table-layout: auto !important;
}

.custom-data-grid .rz-column-title,
.custom-data-grid .rz-column-title-content,
.custom-data-grid .rz-cell-data,
.custom-data-grid .rz-text-truncate {
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
}

/* CustomDataGrid's later nowrap rules must not truncate values in printed reports. */
.print-grid .custom-data-grid .rz-cell-data,
.print-grid .custom-data-grid .rz-text-truncate {
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

/* RadzenSteps headers: one step per line on phone screens (every stepped form in the Portal)
   instead of squeezing all the titles into a single row; the connector lines are dropped. */
@media (max-width: 576px) {
    .rz-steps > ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .rz-steps .rz-steps-item {
        display: block;
    }

    .rz-steps .rz-steps-item:not(:last-child):after {
        display: none;
    }
}

/* Manual Data upload actions (Load File / Upload): stack full-width on phone screens instead of
   squeezing side by side. */
@media (max-width: 576px) {
    .manual-data-upload-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .manual-data-upload-actions .rz-button {
        width: 100%;
    }
}

.custom-data-grid.custom-data-grid-expandable table:has(.rz-row-toggler) > colgroup > col:first-child {
    width: 0 !important;
}
.custom-data-grid.custom-data-grid-expandable table:has(.rz-row-toggler) > thead > tr > th:first-child,
.custom-data-grid.custom-data-grid-expandable td:has(.rz-row-toggler) {
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden;
}
.custom-data-grid.custom-data-grid-expandable .rz-row-toggler {
    display: none;
}

/* Taller grid COLUMN HEADER only (data rows stay the same). */
.custom-data-grid thead th {
    padding-block: 0.75rem !important;
}

.rz-grid-table thead th {
    background-color: #f1f5f9;
}

.rz-grid-table thead th > div:not(.rz-cell-filter) {
    padding: 1.5rem 0;
}

.rz-pager .rz-pagesize-text,
.rz-pager .rz-pager-summary {
    font-size: 1.3rem;
}

.rz-pager.rz-align-center {
    justify-content: flex-start;
}

.rz-pager.rz-align-center .rz-pager-summary {
    order: 0;
    margin-right: auto;
}

.rz-pager.rz-align-center .rz-dropdown {
    order: 1;
}

.rz-pager.rz-align-center .rz-pagesize-text {
    order: 1;
}

/* Dialogs use fixed px widths (600-800px); cap them so they never overflow small screens. */
.rz-dialog {
    max-width: 95vw;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .rz-dialog {
        width: 95vw !important;
    }

    .rz-pager.rz-align-center {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
}

/* Animal Data - Beef Brahman/Brangus male/female summary cards.
   RadzenCard renders its own div, so scoped .razor.css cannot reach this class. */
.brahman-brangus-total-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 160px;
    height: 100%;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.brahman-brangus-total-card:hover {
    box-shadow: var(--rz-shadow-3, 0 4px 12px rgba(0, 0, 0, 0.12));
}

/* Each card highlights in the colour SexIndicator already uses for its icon and label,
   so the hover reads as "this is the male/female card" instead of the generic primary. */
.brahman-brangus-total-card-male:hover {
    border-color: #1565C0;
    background-color: rgba(21, 101, 192, 0.08);
}

.brahman-brangus-total-card-female:hover {
    border-color: #C2185B;
    background-color: rgba(194, 24, 91, 0.08);
}

/* Scales the label the SexIndicator renders beside its icon. */
.brahman-brangus-total-card b {
    font-size: 1.35rem;
}

.brahman-brangus-total-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Holds the line's height while the spinner stands in for the number, so the card
       does not resize once the totals arrive. */
    min-height: 2.75rem;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Chromosomal Mating Results detail tabs - full width layout */
.cm-results-tabs > .rz-tabview > .rz-tabview-nav {
    display: flex;
    width: 100%;
}

.cm-results-tabs > .rz-tabview > .rz-tabview-nav > li {
    flex: 1;
    text-align: center;
}

.cm-results-tabs > .rz-tabview > .rz-tabview-nav > li > a,
.cm-results-tabs > .rz-tabview > .rz-tabview-nav > li > a .rz-tabview-title {
    font-size: 1.25rem;
}
