:root {
    --homotechsual-primary: #b43e6e;
    --homotechsual-primary-dark: #8f2d58;
    --homotechsual-ink: #24213a;
    --homotechsual-surface: #fff9f7;
    --homotechsual-link: #7f2456;
}

html, body {
    font-family: 'Avenir Next', 'Segoe UI Variable', 'Segoe UI', sans-serif;
    background-color: var(--homotechsual-surface);
    color: var(--homotechsual-ink);
}

a {
    color: var(--homotechsual-link);
}

.content {
    padding-top: 1.1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }


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

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.demo-banner {
    margin: 0.8rem 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e3594f;
    border-radius: 0.5rem;
    background:
        linear-gradient(100deg, rgba(38, 49, 65, 0.96) 0%, rgba(47, 61, 82, 0.94) 58%, rgba(227, 89, 79, 0.9) 100%),
        url('/branding/homotechsual/bg-gradient-noise.svg');
    background-size: cover;
    background-position: center;
    color: #f9fafb;
}

.demo-banner strong {
    color: #f59e0b;
}

.summary-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 4.5rem;
}

.summary-card-hero {
    background: #ffffff;
    border-width: 1.5px;
    min-height: 5.5rem;
}

.summary-card h3 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
    color: #6c757d;
    line-height: 1.2;
}

.summary-card p {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.25rem 0 0;
    line-height: 1.1;
}

.summary-card-hero p {
    font-size: 1.8rem;
}

.summary-card-sub {
    font-size: 0.71rem;
    color: #6c757d;
    margin-top: 0.3rem;
    line-height: 1.3;
}

.summary-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #adb5bd;
    margin: 0.75rem 0 0.1rem;
    display: block;
}

.legend-panel {
    margin: 0.5rem 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #ffffff;
}


.legend-panel ul {
    margin: 0;
    padding-left: 1.1rem;
}

.legend-panel li {
    margin-bottom: 0.25rem;
}

.legend-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    margin-right: 0.45rem;
    position: relative;
    top: -0.02rem;
}

.status-ok-dot {
    background-color: #198754;
}

.status-warn-dot {
    background-color: #fd7e14;
}

.status-bad-dot {
    background-color: #dc3545;
}

.status-unknown-dot {
    background-color: #6c757d;
}

.status-ok {
    color: #198754;
    font-weight: 600;
}

.status-warn {
    color: #fd7e14;
    font-weight: 600;
}

.status-bad {
    color: #dc3545;
    font-weight: 700;
}

.status-unknown {
    color: #6c757d;
    font-weight: 600;
}

.requirements-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.requirement-card {
    border: 1px solid #d7dce1;
    border-radius: 0.55rem;
    padding: 0.8rem;
    background: #ffffff;
}

.requirement-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}


.question-ref {
    margin: 0;
    color: #495057;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.question-text {
    margin: 0.2rem 0 0;
    color: #343a40;
}

.requirement-status {
    min-width: 9rem;
    text-align: right;
    font-weight: 700;
}

.requirement-meta {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #495057;
}

.missing-sources {
    color: #b02a37;
}

.status-rationale {
    margin: 0.6rem 0 0.5rem;
}

.no-evidence {
    margin: 0.45rem 0;
    color: #6c757d;
    font-style: italic;
}

.evidence-table th {
    font-size: 0.82rem;
    color: #495057;
}

.dashboard-section {
    margin-top: 1rem;
}


.section-description {
    margin: 0 0 0.55rem;
    color: #4b5563;
}

.status-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.65rem;
}

.status-breakdown-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.6rem;
    background: #ffffff;
}

.status-breakdown-label {
    font-weight: 600;
    color: #374151;
}

.status-breakdown-value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.status-breakdown-text {
    margin-top: 0.2rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.deep-dive {
    padding-bottom: 0.4rem;
}

.deep-dive-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.deep-dive-summary::marker {
    color: #1b6ec2;
}

.deep-dive-summary::-webkit-details-marker {
    display: none;
}

.deep-dive-summary::after {
    content: "▾";
    color: #6b7280;
    font-size: 0.95rem;
    transition: transform 140ms ease;
}

details[open] > .deep-dive-summary::after {
    transform: rotate(180deg);
}

.requirement-summary-title {
    color: #1f2937;
}

.informational-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.informational-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eef2f7;
}

.informational-list li:last-child {
    border-bottom: 0;
}

.pillar-drilldown-grid {
    display: grid;
    gap: 0.95rem;
    margin-top: 0.75rem;
}

.pillar-drilldown-card {
    border: 1px solid #dbe4ea;
    border-radius: 0.8rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 0.9rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pillar-drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.pillar-name {
    font-weight: 800;
    font-size: 1.02rem;
    color: #1f2937;
}

.pillar-meta {
    color: #6b7280;
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

.control-drilldown-list {
    display: grid;
    gap: 0.75rem;
}

.informational-control-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    background: #fff;
    padding: 0.7rem 0.8rem 0.2rem;
}

.informational-control-card[open] {
    border-color: #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.informational-control-card .question-text {
    margin-top: 0.35rem;
}

.informational-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 0.55rem;
}

/* MudChipSet spacing for context chips */
.context-chips {
    margin: 0.5rem 0 0.8rem !important;
}

.mapping-rationale-grid {
    width: 100%;
}

.mapping-diagnostics-grid,
.mapping-coverage-grid {
    width: 100%;
}

.mapping-diagnostics-grid .mud-table-container,
.mapping-coverage-grid .mud-table-container,
.mapping-rationale-grid .mud-table-container {
    max-width: 100%;
    overflow-x: auto;
}

.mapping-diagnostics-grid .mud-table-root,
.mapping-coverage-grid .mud-table-root,
.mapping-rationale-grid .mud-table-root {
    width: 100%;
    table-layout: fixed;
}

.mapping-diagnostics-grid .mud-table-head th,
.mapping-diagnostics-grid .mud-table-body td,
.mapping-coverage-grid .mud-table-head th,
.mapping-coverage-grid .mud-table-body td,
.mapping-rationale-grid .mud-table-head th,
.mapping-rationale-grid .mud-table-body td {
    white-space: normal;
    vertical-align: top;
}

.mapping-diagnostics-grid .mud-table-cell,
.mapping-coverage-grid .mud-table-cell,
.mapping-rationale-grid .mud-table-cell {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    line-height: 1.25;
}

/* Column widths are set via Width="X%" on each column definition in MappingDiagnostics.razor */

.mapping-coverage-grid .mud-table-head th:nth-child(1),
.mapping-coverage-grid .mud-table-body td:nth-child(1) {
    width: 12%;
}

.mapping-coverage-grid .mud-table-head th:nth-child(2),
.mapping-coverage-grid .mud-table-body td:nth-child(2) {
    width: 20%;
}

.mapping-coverage-grid .mud-table-head th:nth-child(3),
.mapping-coverage-grid .mud-table-body td:nth-child(3) {
    width: 12%;
}

.mapping-coverage-grid .mud-table-head th:nth-child(4),
.mapping-coverage-grid .mud-table-body td:nth-child(4) {
    width: 16%;
}

.mapping-coverage-grid .mud-table-head th:nth-child(5),
.mapping-coverage-grid .mud-table-body td:nth-child(5) {
    width: 28%;
}

.mapping-coverage-grid .mud-table-head th:nth-child(6),
.mapping-coverage-grid .mud-table-body td:nth-child(6) {
    width: 12%;
}

.mapping-rationale-grid .mud-table-container {
    overflow-x: hidden;
}

.mapping-rationale-grid .mud-table-root table {
    width: 100%;
    table-layout: fixed;
}

.mapping-rationale-grid .mud-table-head th,
.mapping-rationale-grid .mud-table-body td {
    white-space: normal;
    vertical-align: top;
}

.mapping-rationale-grid .mud-table-head th:nth-child(1),
.mapping-rationale-grid .mud-table-body td:nth-child(1) {
    width: 14%;
}

.mapping-rationale-grid .mud-table-head th:nth-child(2),
.mapping-rationale-grid .mud-table-body td:nth-child(2) {
    width: 30%;
}

.mapping-rationale-grid .mud-table-head th:nth-child(3),
.mapping-rationale-grid .mud-table-body td:nth-child(3) {
    width: 12%;
}

.mapping-rationale-grid .mud-table-head th:nth-child(4),
.mapping-rationale-grid .mud-table-body td:nth-child(4) {
    width: 44%;
}

.rationale-requirement,
.rationale-question-ref,
.rationale-question-text,
.rationale-basis {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mapping-diagnostics-grid .mud-table-body td,
.mapping-coverage-grid .mud-table-body td {
    overflow-wrap: break-word;
    word-break: normal;
}

.mapping-diagnostics-grid .informational-actions,
.mapping-coverage-grid .informational-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin: 0;
}

.mapping-diagnostics-grid .informational-actions .mud-button-root,
.mapping-coverage-grid .informational-actions .mud-button-root {
    min-width: 0;
    width: 100%;
    padding-inline: 0.35rem;
}

.diagnostics-question-content {
    min-width: 0;
}

.diagnostics-question-ref {
    font-weight: 600;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.diagnostics-question-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #6b7280;
}

.diagnostics-help-btn {
    flex-shrink: 0;
    width: 2rem !important;
    height: 2rem !important;
    padding: 0 !important;
}

/* Questionnaire answer textarea cell — min-width prevents the column from collapsing on narrow viewports */
.questionnaire-answer-cell {
    min-width: 22rem;
}

/* Secondary / muted text (replaces Bootstrap: text-muted, small-as-class) */
.secondary-text {
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
}

/* Evidence detail panel (row detail expansion in Evidence Explorer) */
.evidence-detail-panel {
    padding: 0.75rem 1rem;
}

/* Evidence item card (replaces Bootstrap: border rounded p-2 mb-2 bg-light) */
.evidence-item-card {
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--mud-palette-background-grey);
    font-size: 0.85rem;
}

.evidence-item-card:last-child {
    margin-bottom: 0;
}

.evidence-item-header {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

/* Compliance distribution stacked bar (replaces Bootstrap: .progress / .progress-bar .bg-xxx) */
.compliance-bar {
    display: flex;
    height: 2rem;
    border-radius: 4px;
    overflow: hidden;
    background: var(--mud-palette-background-grey);
}

.compliance-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.compliance-bar-segment.compliant   { background-color: var(--mud-palette-success); }
.compliance-bar-segment.partial     { background-color: var(--mud-palette-warning); color: #333; }
.compliance-bar-segment.noncompliant { background-color: var(--mud-palette-error); }
.compliance-bar-segment.unknown     { background-color: var(--mud-palette-secondary); }

/* Inline contribution bar (replaces Bootstrap: .progress / .progress-bar.bg-info) */
.contribution-bar {
    height: 0.75rem;
    border-radius: 2px;
    overflow: hidden;
    background: var(--mud-palette-background-grey);
}

.contribution-bar-fill {
    height: 100%;
    background-color: var(--mud-palette-info);
}

.diagnostics-row-detail {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    background: var(--mud-palette-background-grey);
    border-top: 1px solid var(--mud-palette-table-lines);
}

.diagnostics-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.diagnostics-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mud-palette-text-secondary);
}

.rationale-question-ref {
    font-weight: 600;
}

.rationale-question-text {
    display: block;
    color: #6b7280;
}

.rationale-status {
    white-space: nowrap;
}

/* Global fallback layout/nav styles for Docker watch scenarios where CSS isolation assets are unavailable. */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background-image:
        linear-gradient(165deg, rgba(38, 49, 65, 0.96) 0%, rgba(47, 61, 82, 0.95) 52%, rgba(227, 89, 79, 0.92) 100%),
        url('/branding/homotechsual/bg-gradient-noise.svg');
    background-size: cover, 470px auto;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center 74%;
}

.page > main > .top-row {
    background-color: #fef7f4;
    border-bottom: 1px solid #f2d8ce;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    row-gap: 0.25rem;
    column-gap: 0.75rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}


.workspace-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: #6d1f3f;
    font-weight: 700;
    line-height: 1.1;
}

.page > main > .top-row .mud-input-control {
    margin: 0;
}

.top-bar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-filters > * {
    margin: 0 !important;
}

.top-bar-scheme-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-menu {
    display: inline-flex;
    align-items: center;
    margin: 0 !important;
}

.page > main > .top-row .top-bar-menu-button {
    min-height: 40px;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
}

.page > main > .top-row .top-bar-menu-button .mud-button-root {
    min-height: 40px;
    height: 40px;
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
    justify-content: space-between;
    text-transform: none;
    white-space: nowrap;
}

.page > main > .top-row .top-bar-menu-button .mud-button-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.page > main > .top-row .top-bar-scheme-button {
    min-height: 40px;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
}

.page > main > .top-row a {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.page > main > .top-row a:hover {
    text-decoration: underline;
}

.mapping-row-focused {
    background: rgba(255, 193, 7, 0.2);
    border-radius: 0.25rem;
    padding: 0.1rem 0.25rem;
}

.page > main > .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .top-row {
    min-height: 5.35rem;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
}

.sidebar .top-row .brand-container {
    min-width: 0;
    padding: 0.6rem 0.5rem 0.5rem 0.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-scrollable {
    display: block;
    overflow-y: auto;
    /* The sidebar gradient runs into a medium-luminance red at the bottom.
       A 0.4 black overlay ensures white text (L=1) meets WCAG AAA (≥7:1)
       across the full gradient: ~17:1 at the dark top, ~7.5:1 at the red bottom. */
    background: rgba(0, 0, 0, 0.4);
}

/* MudNavMenu sidebar theming */
.sidebar .mud-navmenu {
    padding: 0.5rem 0;
}

/* Nav group header (section heading) — direct .mud-nav-link child of .mud-nav-group */
.sidebar .mud-nav-group > .mud-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    border-left: 4px solid transparent;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
}

.sidebar .mud-nav-group > .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
}

.sidebar .mud-nav-group > .mud-nav-link .mud-icon-root,
.sidebar .mud-nav-group > .mud-nav-link .mud-nav-link-expand-icon,
.sidebar .mud-nav-group > .mud-nav-link .mud-nav-link-expand-icon .mud-icon-root {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Separator line between nav sections */
.sidebar .mud-nav-group + .mud-nav-group > .mud-nav-link {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.75rem;
}

.sidebar .mud-nav-item .mud-nav-link {
    color: #ffffff !important;
    border-left: 4px solid transparent;
    border-radius: 4px;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    gap: 0.65rem;
}

.sidebar .mud-nav-item .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: #ffffff !important;
}

.sidebar .mud-nav-item .mud-nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
    border-left-color: #E3594F;
    color: #ffffff !important;
    font-weight: 600;
}

.sidebar .mud-nav-item .mud-nav-link .mud-icon-root {
    color: inherit !important;
    font-size: 1.5rem;
    vertical-align: middle;
}

.homotechsual-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #fff;
    text-decoration: none;
    width: 100%;
}

.homotechsual-brand-logo {
    width: min(100%, 19rem);
    height: auto;
    display: block;
}

.homotechsual-brand span {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.95;
    letter-spacing: 0.01em;
    margin-top: 0;
    text-align: center;
}

@media (max-width: 640.98px) {
    .page > main > .top-row {
        justify-content: space-between;
    }

    .page > main > .top-row a {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .nav-scrollable {
        height: calc(100vh - 3.5rem);
    }

    .page > main > .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row,
    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Global fallback reconnect modal styling for Docker watch scenarios where isolated CSS is unavailable. */
.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    background-color: #ffffff;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
}

#components-reconnect-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button {
    border: 0;
    background-color: #6b9ed2;
    color: #ffffff;
    padding: 4px 24px;
    border-radius: 4px;
}

#components-reconnect-modal button:hover {
    background-color: #3b6ea2;
}

#components-reconnect-modal button:active {
    background-color: #6b9ed2;
}

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
}

.components-rejoining-animation div {
    position: absolute;
    border: 3px solid #0087ff;
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0;
        left: 0;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}


/* ── Policy Register ──────────────────────────────────────────────────────── */
.policy-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.policy-summary-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.policy-summary-card {
    flex: 1;
    min-width: 200px;
}

.policy-summary-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.55;
    margin-bottom: 0.25rem;
}

.policy-summary-metrics {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.15rem 0 0.35rem;
}

.policy-summary-total {
    font-weight: 400;
    opacity: 0.55;
    font-size: 0.85em;
}

.policy-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.policy-date-overdue {
    color: var(--mud-palette-error);
    font-weight: 600;
}

.policy-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* ── Overview dashboard ───────────────────────────────────────────────────── */

.overview-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.overview-stat-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
}

.overview-stat-card--alert .overview-stat-value {
    color: var(--mud-palette-error);
}

.overview-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #263141;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.overview-stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.overview-section-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.overview-section-card {
    border-radius: 8px;
    padding: 1.5rem;
    color: #fff;
}

.overview-section-card--compliance {
    background: #263141;
}

.overview-section-card--governance {
    background: #1a2230;
}

.overview-section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.75rem;
}

.overview-section-stats {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.overview-section-cta {
    padding-left: 0 !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e3594f !important;
}

.overview-client-strip {
    margin-top: 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.overview-client-header,
.overview-client-row {
    display: grid;
    grid-template-columns: 1fr 120px 140px 100px;
    align-items: center;
    padding: 0.55rem 1rem;
}

.overview-client-header {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.overview-client-row {
    border-bottom: 1px solid #f0f0f0;
}

.overview-client-row:last-child {
    border-bottom: none;
}

.overview-client-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
    text-align: center;
}

.overview-client-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #263141;
}


/* Policy Register split metrics */
.policy-metric-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.policy-metric-sublabel {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: #888;
}

.overview-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

.overview-lower-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
}


/* Needs attention */
.overview-attention-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.overview-attention-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
}

.overview-attention-item a {
    text-decoration: none;
    color: inherit;
}

.overview-attention-item a:hover {
    text-decoration: underline;
}

.overview-attention-item--critical { background: #ffebee; color: #b71c1c; }
.overview-attention-item--high     { background: #fff3e0; color: #bf360c; }
.overview-attention-item--medium   { background: #fffde7; color: #f57f17; }

.overview-attention-item--critical::before { content: "●"; margin-right: 0.3rem; color: #c62828; }
.overview-attention-item--high::before     { content: "●"; margin-right: 0.3rem; color: #e65100; }
.overview-attention-item--medium::before   { content: "●"; margin-right: 0.3rem; color: #f9a825; }

/* Useful links */
.overview-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.overview-links-list li {
    display: flex;
    flex-direction: column;
    gap: 1px;
}


/* ── Risk Register ──────────────────────────────────────────────────────── */

.risk-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.risk-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.risk-stat-card--alert {
    border-left: 4px solid #e3594f;
}

.risk-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #263141;
    line-height: 1;
}

.risk-stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Heat map */
.risk-heatmap-section {
    margin-bottom: 1.5rem;
}

.risk-heatmap-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.risk-heatmap-wrapper {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.risk-heatmap-y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.3rem;
    align-self: center;
    white-space: nowrap;
}

.risk-heatmap-grid-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.risk-heatmap-grid {
    display: grid;
    grid-template-columns: 24px repeat(5, 52px);
    grid-template-rows: repeat(5, 44px);
    gap: 3px;
}

.risk-heatmap-axis-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #555;
}

.risk-heatmap-cell {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, outline 0.1s;
    outline: 2px solid transparent;
    -webkit-user-select: none;
    user-select: none;
}

.risk-heatmap-cell:hover {
    opacity: 0.85;
}

.risk-heatmap-cell.selected {
    outline: 2px solid #263141;
}

.risk-heatmap-cell--empty {
    cursor: default;
    background: transparent !important;
    font-size: 0;
}

.risk-heatmap-cell--low    { background: #c8e6c9; color: #1b5e20; }
.risk-heatmap-cell--medium { background: #fff9c4; color: #f57f17; }
.risk-heatmap-cell--high   { background: #ffcdd2; color: #b71c1c; }

.risk-heatmap-x-labels {
    display: grid;
    grid-template-columns: 24px repeat(5, 52px);
    gap: 3px;
    margin-top: 3px;
}

.risk-heatmap-x-axis-label {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 600;
    color: #555;
}

.risk-heatmap-x-label {
    font-size: 0.7rem;
    text-align: center;
    font-weight: 600;
    color: #555;
}

.risk-heatmap-x-title {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
    text-align: center;
    padding-left: 24px;
}

/* Risk score chips */
.risk-score-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.6;
}

.risk-score-chip--low    { background: #c8e6c9; color: #1b5e20; }
.risk-score-chip--medium { background: #fff9c4; color: #f57f17; }
.risk-score-chip--high   { background: #ffcdd2; color: #b71c1c; }

/* Treatment chips */
.risk-treatment-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
}

.risk-treatment-chip--mitigate { background: #e3f2fd; color: #0d47a1; }
.risk-treatment-chip--accept   { background: #fce4ec; color: #880e4f; }
.risk-treatment-chip--transfer { background: #e8f5e9; color: #1b5e20; }
.risk-treatment-chip--avoid    { background: #ede7f6; color: #4a148c; }

/* Risk status chips */
.risk-status-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
}

.risk-status-chip--open       { background: #ffcdd2; color: #b71c1c; }
.risk-status-chip--inprogress { background: #fff9c4; color: #f57f17; }
.risk-status-chip--accepted   { background: #e3f2fd; color: #0d47a1; }
.risk-status-chip--closed     { background: #c8e6c9; color: #1b5e20; }

/* Toggle control */
.risk-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.risk-view-toggle-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}

/* Filter indicator */
.risk-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: #f5f5f5;
    border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INCIDENT REGISTER
   ═══════════════════════════════════════════════════════════════════════════ */

/* Severity chips */
.incident-severity-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.incident-severity-chip--critical { background: #b71c1c; color: #fff; }
.incident-severity-chip--high     { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.incident-severity-chip--medium   { background: #fff8e1; color: #e65100; border: 1px solid #ffcc02; }
.incident-severity-chip--low      { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* Status chips */
.incident-status-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.incident-status-chip--open          { background: #ffebee; color: #c62828; }
.incident-status-chip--investigating { background: #fff3e0; color: #e65100; }
.incident-status-chip--contained     { background: #e3f2fd; color: #1565c0; }
.incident-status-chip--closed        { background: #e8f5e9; color: #2e7d32; }

/* Category chips */
.incident-category-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: #f5f5f5;
    color: #444;
}

.incident-category-chip--malware    { background: #fce4ec; color: #880e4f; }
.incident-category-chip--phishing   { background: #fff3e0; color: #bf360c; }
.incident-category-chip--ransomware { background: #b71c1c; color: #fff; }
.incident-category-chip--access     { background: #e8eaf6; color: #283593; }
.incident-category-chip--databreach { background: #fce4ec; color: #c62828; }
.incident-category-chip--insider    { background: #f3e5f5; color: #6a1b9a; }
.incident-category-chip--supply     { background: #e0f2f1; color: #004d40; }
.incident-category-chip--other      { background: #f5f5f5; color: #444; }

/* Detail panel */
.incident-detail-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
}

.incident-detail-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.35rem 1rem;
    margin-top: 0.5rem;
}

