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

/* Main Layout Fix: Critical for scrolling tables within Flexbox */
main {
    /* 1. Allows flex shrinking so it doesn't expand to fit the table */
    min-width: 0;

    /* 2. STRICTLY prevents this container from becoming wider than the viewport */
    overflow-x: hidden;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

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

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

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

code {
    color: #c02d76;
}

/* =========================================
   PRINT LAYOUT PROTECTION
   Ensures the Printable Bracket page ignores 
   Flatly theme colors/fonts to save ink.
   ========================================= */
@media print {
    /* Force white background and black text */
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    /* Revert fonts to standard system fonts (cleaner for print) */
    body, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    }

    /* Maximize width and remove margins */
    .container, .container-fluid, .content, .page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide sidebar and navigation elements if they aren't already hidden */
    .sidebar, .top-row, .navbar, .btn-primary, .no-print {
        display: none !important;
    }

    /* Ensure borders are crisp black */
    .card, .table, .table-bordered, .border {
        border-color: #000 !important;
    }
}
