/* Global rules only (skill code-mudblazor-ui §7): the plain loading block shown before MudBlazor starts. Colours come from the theme once it runs. */
#app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: Roboto, "Segoe UI", sans-serif;
    color: #424242;
    gap: 12px;
}

#app-loading .app-loading-bar {
    width: 240px;
    height: 4px;
    background: linear-gradient(90deg, #1565c0 0%, #90caf9 50%, #1565c0 100%);
    background-size: 200% 100%;
    animation: app-loading-move 1.2s linear infinite;
    border-radius: 2px;
}

@keyframes app-loading-move {
    from { background-position: 0 0; }
    to { background-position: -200% 0; }
}

body:has(.mud-layout) #app-loading {
    display: none;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #b71c1c;
}

/* Utility classes not provided by MudBlazor. */
.pcos-mono {
    font-family: "Roboto Mono", Consolas, monospace;
    letter-spacing: 0.05em;
}

.pcos-break {
    word-break: break-all;
}

.pcos-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* MudSimpleTable aligns every cell to the start with a more specific selector. */
.mud-simple-table table td.pcos-num,
.mud-simple-table table th.pcos-num {
    text-align: right;
}

/* One-line cell text with "…" for very long values; the full text is in the title tooltip. */
.pcos-ellipsis {
    display: inline-block;
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.pcos-clickable {
    cursor: pointer;
}

/* LichHen (S32): day cards and shifts */
.pcos-fill { height: 100%; }
.pcos-sign-cell { min-width: 160px; }
.pcos-filter { max-width: 280px; min-width: 200px; }
.pcos-shift { background-color: var(--mud-palette-background-gray); border-left: 3px solid var(--mud-palette-primary); }
.pcos-shift-off { border-left-color: var(--mud-palette-warning); }

/* KhamBenh (S03, S06, S08): rows with a priority risk flag or urgent case (an icon and text label are shown too) */
.pcos-row-risk { background-color: color-mix(in srgb, var(--mud-palette-error) 10%, var(--mud-palette-surface)); box-shadow: inset 4px 0 0 var(--mud-palette-error); }

/* Printable documents (referral letter) */
@media print { .pcos-no-print { display: none !important; } .pcos-page-break { break-after: page; } }
.pcos-ref-list { max-height: 65vh; overflow-y: auto; }
.pcos-ref-table { white-space: pre-wrap; font-size: 0.8rem; overflow-x: auto; background-color: var(--mud-palette-background-gray); padding: 8px; }
.pcos-concern { font-weight: 700; box-shadow: inset 0 -3px 0 var(--mud-palette-warning); }

/* Lets a flex child shrink below its content width (long words wrap instead of widening the card). */
.pcos-minw0 {
    min-width: 0;
}

/* Dense tabs everywhere (one-screen layout, owner 2026-10-05): MudTabs v9 has no Dense/Size parameter, so the 48px tab bar is reduced here. */
.mud-tabs-tabbar .mud-tabs-tabbar-inner {
    min-height: 36px;
}

.mud-tab {
    min-height: 36px;
    padding: 4px 10px;
    font-size: 0.8125rem;
}

/* Tab content inside a dialog scrolls within the window (dialog header, tabs and actions stay visible). */
.pcos-dialog-scroll {
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

/* S20 report body: long reports (stock of the whole formulary) scroll inside the paper, the column headers stay visible. */
.pcos-report-scroll {
    max-height: calc(100vh - 205px);
    overflow-y: auto;
}

.pcos-report-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
}

/* Primary agent diagnosis on S09: the most prominent line of the card. */
.pcos-dx-primary {
    font-weight: 600;
    line-height: 1.3;
}

/* Ruled-out agent diagnoses: kept for reference, visually secondary. */
.pcos-dimmed .mud-typography {
    color: var(--mud-palette-text-secondary);
}

/* "x/y criteria met" bar of an agent diagnosis. */
.pcos-criteria-bar {
    max-width: 120px;
}
