body {
    --body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
}

:root {
    /* Falcon red */
    --fhs-color-primary: #C8102E;
    --fhs-color-secondary: #FDF2F4;
}

.navmenu-icon {
    display: none;
}

/* Blazor's FocusOnNavigate (App.razor) focuses the page h1 on every
   navigation for screen-reader announcements; suppress the resulting
   browser focus outline since it isn't a keyboard-navigation focus. */
h1:focus {
    outline: none;
}

h1 {
    font-size: 24px;
    margin: 0;
}

h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}

.main {
    min-height: calc(100dvh - 50px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
}

.body-content {
    align-self: stretch;
    height: calc(100dvh - 50px) !important;
    display: flex;
}

.content {
    padding: 1rem 1.5rem;
    align-self: stretch !important;
    width: 100%;
    max-width: 1200px;
}

/* Page header: title + subtitle on the left, actions on the right */
.fhs-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.fhs-page-header .fhs-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.fhs-subtitle {
    margin: 4px 0 0;
    color: var(--neutral-foreground-hint);
    font-size: 13px;
    max-width: 75ch;
}

.fhs-hint {
    color: var(--neutral-foreground-hint);
    font-size: 12px;
}

.fhs-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fhs-card {
    padding: 20px !important;
    height: auto !important;
}

.fhs-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fhs-card-header h2 {
    margin: 0;
}

.fhs-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-stroke-rest);
}

/* Two cards next to each other on wide screens */
.fhs-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1100px) {
    .fhs-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Label/value list (detail pages) */
.fhs-details {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.fhs-details dt {
    font-weight: 600;
}

.fhs-details dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .fhs-details {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .fhs-details dd {
        margin-bottom: 8px;
    }
}

/* Form: fields below each other, full width up to a readable maximum */
.fhs-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 760px;
}

.fhs-form fluent-text-field,
.fhs-form fluent-text-area,
.fhs-form fluent-select {
    width: 100%;
}

.fhs-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 600px) {
    .fhs-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.fhs-form-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

.fhs-form-buttons > div {
    display: flex;
    gap: 8px;
}

.fhs-mono {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
}

/* Tables (FilterableList and cards) */
.fhs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fhs-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.fhs-table td {
    padding: 10px;
    vertical-align: top;
}

.fhs-table tbody tr {
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.fhs-table tbody tr:hover {
    background-color: var(--neutral-fill-stealth-hover);
}

/* Simple list with dividers (divisions, linked users) */
.fhs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fhs-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.fhs-list li:last-child {
    border-bottom: none;
}

.fhs-empty {
    border: 1px dashed var(--neutral-stroke-rest);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    color: var(--neutral-foreground-hint);
    font-size: 13px;
}

/* Badges (see Components/Badge.razor) */
.fhs-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.fhs-badge-gray { background: #F3F4F6; color: #374151; }
.fhs-badge-green { background: #DCFCE7; color: #166534; }
.fhs-badge-red { background: #FEE2E2; color: #991B1B; }
.fhs-badge-amber { background: #FEF3C7; color: #92400E; }
.fhs-badge-blue { background: #DBEAFE; color: #1E40AF; }

/* Read-only value with a copy button (see Components/CopyField.razor) */
.fhs-copy-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.fhs-copy-field code {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--neutral-layer-2);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fhs-copy-field.multiline code {
    max-height: 12rem;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Centered card for the login and password pages */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - 120px);
}

.login-card {
    padding: 2rem !important;
    width: 440px !important;
    max-width: 95vw;
    height: auto !important;
}

.login-card fluent-text-field,
.login-card fluent-button {
    width: 100%;
}

.fhs-divider-section {
    border-top: 1px solid var(--neutral-stroke-rest);
    padding-top: 20px;
}

.fhs-password-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 12px;
}

.fhs-password-rules li {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--neutral-foreground-hint);
}

.fhs-password-rules li.ok {
    color: #15803D;
}

/* Bounded, scrollable list of checkboxes */
.fhs-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 18rem;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
}

@media (max-width: 600px) {
    .fhs-checklist,
    .fhs-password-rules {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Boost fluent-select dropdown above siblings only while open */
fluent-select[open] {
    position: relative;
    z-index: 100;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

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

        .loading-progress circle:last-child {
            stroke: var(--fhs-color-primary);
            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, "Laden");
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::before {
        content: "Er is een fout opgetreden: "
    }

@media (max-width: 600px) {
    .content {
        padding: 0.75rem 1rem;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Fluent inputs render their Label as a sibling <label>: keep it close to its input in the flex stacks */
.fhs-form > label.fluent-input-label,
.fhs-stack > label.fluent-input-label {
    margin-bottom: -12px;
}

/* Falcon HaloPSA Sync */
.fhs-key {
    font-family: Consolas, "Courier New", monospace;
    font-weight: 600;
    white-space: nowrap;
}

.fhs-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 1000px) {
    .fhs-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.fhs-richtext {
    overflow-wrap: anywhere;
    line-height: 1.5;
}

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

.fhs-richtext table {
    border-collapse: collapse;
    margin: 8px 0;
}

.fhs-richtext th,
.fhs-richtext td {
    border: 1px solid var(--neutral-stroke-rest);
    padding: 4px 8px;
    vertical-align: top;
}

.fhs-richtext pre,
.fhs-richtext code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    background: var(--neutral-layer-2);
    border-radius: 4px;
}

.fhs-richtext pre {
    padding: 8px;
    overflow-x: auto;
}

.fhs-richtext blockquote {
    border-left: 3px solid var(--neutral-stroke-rest);
    margin: 8px 0;
    padding-left: 12px;
    color: var(--neutral-foreground-hint);
}

.fhs-plaintext {
    white-space: pre-wrap;
}

.fhs-comment {
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    padding: 12px 0;
}

.fhs-comment:last-child {
    border-bottom: none;
}

.fhs-comment-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.fhs-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.fhs-stat {
    background: var(--neutral-layer-2);
    border-radius: 6px;
    padding: 12px;
}

.fhs-stat-value {
    font-size: 22px;
    font-weight: 600;
}

.fhs-stat-label {
    font-size: 13px;
    color: var(--neutral-foreground-hint);
}

.fhs-table tbody tr.fhs-clickable {
    cursor: pointer;
}

.fhs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Long text in a table cell: at most 3 lines */
.fhs-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 40ch;
}

/* Search filters: a grid of labeled fields, the search button at the end */
.fhs-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.fhs-filter-grid > .fhs-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fhs-filter-grid > .fhs-field > label {
    font-size: 12px;
    font-weight: 600;
}

.fhs-filter-grid > .fhs-field-wide {
    grid-column: span 2;
}

.fhs-filter-grid fluent-search,
.fhs-filter-grid fluent-select,
.fhs-filter-grid .fluent-autocomplete-multiselect,
.fhs-filter-grid fluent-autocomplete,
.fhs-filter-grid .fluent-datepicker {
    width: 100% !important;
}

.fhs-filter-group {
    grid-column: 1 / -1;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 6px 12px 12px;
    margin: 0;
    min-width: 0;
}

.fhs-filter-group-body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 8px 16px;
    align-items: center;
}

.fhs-filter-group > legend {
    font-size: 12px;
    font-weight: 600;
    padding: 0 4px;
}

.fhs-filter-group .fhs-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: center;
}

.fhs-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 600px) {
    .fhs-filter-grid > .fhs-field-wide {
        grid-column: auto;
    }

    .fhs-filter-group-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Timesheet: a row per day, the time entries as blocks on a 24-hour track; one scroll container for all days */
.fhs-ts-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
    margin-bottom: 8px;
}

.fhs-ts {
    overflow: auto;
    max-height: calc(100dvh - 300px);
    min-height: 200px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    background: var(--neutral-layer-1);
}

.fhs-ts-grid {
    position: relative;
}

.fhs-ts-row {
    display: flex;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.fhs-ts-label {
    position: sticky;
    left: 0;
    z-index: 2;
    flex: 0 0 130px;
    width: 130px;
    box-sizing: border-box;
    padding: 6px 10px;
    background: var(--neutral-layer-1);
    border-right: 1px solid var(--neutral-stroke-rest);
    font-size: 13px;
}

.fhs-ts-track {
    position: relative;
    flex: none;
    background-image: repeating-linear-gradient(90deg, var(--neutral-stroke-divider-rest) 0 1px, transparent 1px var(--fhs-ts-hour, 64px));
}

.fhs-ts-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--neutral-layer-2);
}

.fhs-ts-header .fhs-ts-label {
    z-index: 4;
    background: var(--neutral-layer-2);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.fhs-ts-zoom {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.fhs-ts-hour {
    position: absolute;
    top: 6px;
    padding-left: 4px;
    font-size: 11px;
    color: var(--neutral-foreground-hint);
}

.fhs-ts-weekend .fhs-ts-track,
.fhs-ts-weekend .fhs-ts-label {
    background-color: var(--neutral-layer-3);
}

.fhs-ts-today .fhs-ts-label {
    color: var(--fhs-color-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--fhs-color-primary);
}

.fhs-ts-block {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 4px 6px;
    border-radius: 4px;
    border-left: 3px solid;
    font-size: 12px;
    line-height: 18px;
    color: #1F2937;
    text-decoration: none;
}

.fhs-ts-block:hover,
.fhs-ts-block:focus-visible {
    z-index: 1;
    outline: 2px solid var(--fhs-color-primary);
    outline-offset: 1px;
}

.fhs-ts-block .fhs-key {
    margin-right: 6px;
}

.fhs-ts-notime {
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0 4px, transparent 4px 8px);
}

.fhs-ts-color-0 { background-color: #DBEAFE; border-color: #2563EB; }
.fhs-ts-color-1 { background-color: #DCFCE7; border-color: #16A34A; }
.fhs-ts-color-2 { background-color: #FEF3C7; border-color: #D97706; }
.fhs-ts-color-3 { background-color: #FCE7F3; border-color: #DB2777; }
.fhs-ts-color-4 { background-color: #EDE9FE; border-color: #7C3AED; }
.fhs-ts-color-5 { background-color: #CCFBF1; border-color: #0D9488; }
.fhs-ts-color-6 { background-color: #FFE4E6; border-color: #E11D48; }
.fhs-ts-color-7 { background-color: #E0E7FF; border-color: #4F46E5; }

@media (max-width: 600px) {
    .fhs-ts-label {
        flex-basis: 96px;
        width: 96px;
        padding: 6px;
        font-size: 12px;
    }
}

/* Long text in a compact table: at most 2 lines */
.fhs-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fhs-table tbody tr.fhs-clickable:focus-visible {
    outline: 2px solid var(--fhs-color-primary);
    outline-offset: -2px;
}

/* A dialog with custom content (FluentDialog without the default header and footer) */
.fhs-dialog {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100dvh - 64px);
    box-sizing: border-box;
}

.fhs-dialog h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 6px;
}

.fhs-dialog-text {
    max-height: 40vh;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.fhs-dialog-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* A card-like panel for controls with dropdowns: FluentCard clips its content (contain: content) */
.fhs-panel {
    background: var(--neutral-layer-1);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: calc(var(--control-corner-radius) * 2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 16px;
}

/* Drag to scroll the timesheet (fhs.dragScroll); the time entry blocks stay links */
.fhs-ts {
    cursor: grab;
}

.fhs-ts.fhs-dragging {
    cursor: grabbing;
    user-select: none;
}

.fhs-ts-block {
    cursor: pointer;
}

/* Sync: option panel, dashboard, run detail */
.fhs-panel h2 {
    margin-bottom: 12px;
}

.fhs-sync-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fhs-sync-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.fhs-sync-group {
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px;
    padding: 6px 12px 12px;
    margin: 0;
    min-width: 0;
}

.fhs-sync-group > legend {
    font-size: 12px;
    font-weight: 600;
    padding: 0 4px;
}

.fhs-sync-entity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-height: 30px;
    padding-left: 12px;
}

.fhs-sync-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.fhs-sync-dates > label {
    font-weight: 600;
    font-size: 13px;
}

.fhs-sync-summary {
    background: var(--fhs-color-secondary);
    border-left: 3px solid var(--fhs-color-primary);
    border-radius: 4px;
    padding: 10px 14px;
}

.fhs-sync-errors {
    color: #991B1B;
    font-size: 13px;
    margin: 6px 0 0;
}

ul.fhs-sync-errors {
    padding-left: 18px;
}

.fhs-sync-running {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.fhs-sync-running + .fhs-sync-running {
    border-top: 1px solid var(--neutral-stroke-rest);
}

.fhs-sync-running-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fhs-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
    border-left: 2px solid var(--neutral-stroke-rest);
}

.fhs-timeline li {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 12px 8px;
}

.fhs-timeline li::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fhs-color-primary);
}

/* Sanitized Halo HTML (ticket details, action notes) */
.fhs-html {
    max-width: 900px;
    overflow-wrap: anywhere;
}

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

.fhs-html p {
    margin: 0 0 0.5em 0;
}

/* Report charts (BarChart) */
.fhs-chart {
    overflow-x: auto;
    margin-bottom: 12px;
}

.fhs-chart-grid {
    stroke: var(--neutral-stroke-divider-rest, #e0e0e0);
    stroke-width: 1;
}

.fhs-chart-axis {
    font-size: 11px;
    fill: var(--neutral-foreground-hint, #616161);
}

.fhs-chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.fhs-chart-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
}

/* A report row that needs attention (hours out of contract) */
.fhs-row-attention td {
    background: rgba(255, 185, 0, 0.12);
}
