:root {
    --insightive-bg: #071022;
    --insightive-sidebar: #0f1b35;
    --insightive-topbar: rgba(15, 27, 53, 0.88);
    --insightive-surface: #121f3d;
    --insightive-surface-strong: #172544;
    --insightive-card: #121f3d;
    --insightive-hover: rgba(255, 255, 255, 0.055);
    --insightive-active: #263454;
    --insightive-border: rgba(136, 161, 207, 0.16);
    --insightive-border-strong: rgba(136, 161, 207, 0.28);
    --insightive-text: #f7f9ff;
    --insightive-muted: #97a6bf;
    --insightive-subtle: #64748b;
    --insightive-accent: #ff7a1a;
    --insightive-accent-strong: #ff8c32;
    --insightive-blue: #3578ff;
    --insightive-success: #21c779;
    --insightive-danger: #f36f7d;
    --insightive-warning: #ffc857;
    --insightive-glow: rgba(255, 122, 26, 0.11);
    --insightive-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    --bs-body-bg: var(--insightive-bg);
    --bs-body-color: var(--insightive-text);
    --bs-border-color: var(--insightive-border);
    --bs-secondary-color: var(--insightive-muted);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[data-theme="light"] {
    --insightive-bg: #edf2f9;
    --insightive-sidebar: #f7f9fd;
    --insightive-topbar: rgba(247, 249, 253, 0.9);
    --insightive-surface: #ffffff;
    --insightive-surface-strong: #f3f6fb;
    --insightive-card: #ffffff;
    --insightive-hover: rgba(13, 27, 52, 0.055);
    --insightive-active: #e7edf7;
    --insightive-border: rgba(59, 78, 115, 0.15);
    --insightive-border-strong: rgba(59, 78, 115, 0.25);
    --insightive-text: #102033;
    --insightive-muted: #5e6f88;
    --insightive-subtle: #7c8ca3;
    --insightive-glow: rgba(53, 120, 255, 0.12);
    --insightive-shadow: 0 24px 60px rgba(42, 58, 86, 0.14);
    --bs-body-bg: var(--insightive-bg);
    --bs-body-color: var(--insightive-text);
}

html, body {
    background: var(--insightive-bg);
    color: var(--insightive-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100%;
}

a, .btn-link {
    color: var(--insightive-blue);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--insightive-accent), var(--insightive-accent-strong));
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(255, 122, 26, 0.28);
    font-weight: 800;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--insightive-bg), 0 0 0 0.25rem rgba(53, 120, 255, 0.42);
}

.content {
    padding-top: 1.1rem;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 8rem);
    place-items: center;
}

.auth-panel {
    width: min(100%, 28rem);
}

.auth-panel h1,
.page-heading h1 {
    margin-bottom: 0.75rem;
}

.auth-switch {
    margin-top: 1rem;
}

.eyebrow {
    color: #5d6b82;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.management-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
}

.tenant-pill {
    border: 1px solid #d5dbe5;
    border-radius: 999px;
    color: #3d4b60;
    display: inline-flex;
    font-size: 0.85rem;
    margin-left: 0.75rem;
    padding: 0.2rem 0.65rem;
}

.intake-overview {
    align-items: stretch;
    border-bottom: 1px solid #dbe1ea;
    border-top: 1px solid #dbe1ea;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 0;
}

.intake-project h2 {
    font-size: 1.45rem;
    margin: 0.15rem 0 0.4rem;
}

.intake-label,
.intake-category {
    color: #5d6b82;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.intake-meta {
    color: #5d6b82;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.intake-meta strong {
    color: #233142;
}

.intake-progress-panel {
    align-self: center;
}

.intake-progress-header {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.intake-progress-header span {
    color: #5d6b82;
    font-size: 0.9rem;
}

.intake-progress-header strong {
    font-size: 1.25rem;
}

.intake-progress {
    height: 0.65rem;
}

.intake-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
}

.intake-main {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.intake-question {
    background: #fff;
    border: 1px solid #d5dbe5;
    border-left: 4px solid #9aa7b8;
    border-radius: 8px;
    padding: 1rem;
}

.intake-question.is-complete {
    border-left-color: #198754;
}

.intake-question-header {
    align-items: start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.intake-question-title {
    align-items: start;
    display: flex;
    gap: 0.8rem;
    min-width: 0;
}

.intake-question-number {
    align-items: center;
    background: #eef2f7;
    border: 1px solid #d5dbe5;
    border-radius: 999px;
    color: #314158;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.intake-question label {
    display: block;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 0.1rem;
}

.intake-textarea {
    min-height: 8.5rem;
    resize: vertical;
}

.intake-help {
    color: #5d6b82;
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.intake-sidebar {
    display: grid;
    gap: 0.9rem;
    position: sticky;
    top: 1rem;
}

.intake-sidebar-block {
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    padding: 0.9rem;
}

.intake-sidebar-block h2 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
}

.intake-stat {
    align-items: baseline;
    border-top: 1px solid #edf0f5;
    display: flex;
    gap: 0.55rem;
    padding: 0.65rem 0;
}

.intake-stat:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.intake-stat:last-child {
    padding-bottom: 0;
}

.intake-stat strong {
    font-size: 1.35rem;
}

.intake-stat span {
    color: #5d6b82;
    font-size: 0.9rem;
}

.intake-nav {
    display: grid;
    gap: 0.4rem;
}

.intake-nav-item {
    align-items: center;
    border: 1px solid #edf0f5;
    border-radius: 6px;
    color: #314158;
    display: flex;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    text-decoration: none;
}

.intake-nav-item:hover {
    background: #f8fafc;
    color: #1b6ec2;
}

.intake-nav-item span {
    align-items: center;
    background: #eef2f7;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    height: 1.55rem;
    justify-content: center;
    width: 1.55rem;
}

.intake-nav-item.is-complete span {
    background: #d1e7dd;
    color: #0f5132;
}

.intake-sidebar-actions {
    display: grid;
    gap: 0.5rem;
}

.requirement-summary {
    border-bottom: 1px solid #dbe1ea;
    border-top: 1px solid #dbe1ea;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.25rem 0;
    padding: 0.8rem 0;
}

.requirement-summary div {
    align-items: baseline;
    display: inline-flex;
    gap: 0.45rem;
}

.requirement-summary strong {
    font-size: 1.35rem;
}

.requirement-summary span {
    color: #5d6b82;
    font-size: 0.92rem;
}

.requirements-board {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.8fr);
}

.requirement-column {
    min-width: 0;
}

.requirement-column-heading {
    align-items: center;
    border-bottom: 1px solid #dbe1ea;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
}

.requirement-column-heading h2 {
    font-size: 1.15rem;
    margin: 0;
}

.count-pill {
    align-items: center;
    background: #eef2f7;
    border: 1px solid #d5dbe5;
    border-radius: 999px;
    color: #314158;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 2rem;
    justify-content: center;
    padding: 0.2rem 0.65rem;
}

.requirement-stack {
    display: grid;
    gap: 0.9rem;
}

.requirement-similarity-group {
    display: grid;
    gap: 0.65rem;
}

.similarity-heading {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0.8rem;
}

.similarity-heading h3 {
    font-size: 1rem;
    margin: 0.1rem 0 0;
}

.requirement-card {
    background: #fff;
    border: 1px solid #d5dbe5;
    border-left: 4px solid #6c757d;
    border-radius: 8px;
    padding: 1rem;
}

.requirement-card-accepted {
    border-left-color: #198754;
}

.requirement-card-rejected {
    border-left-color: #dc3545;
}

.requirement-card-reanalysis {
    border-left-color: #ffc107;
}

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

.requirement-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0.1rem 0 0;
}

.requirement-type {
    color: #5d6b82;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.requirement-meta {
    color: #5d6b82;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.86rem;
    gap: 0.75rem;
    margin: 0.55rem 0 0.75rem;
}

.requirement-description {
    margin-bottom: 0.85rem;
}

.requirement-source {
    background: #f8fafc;
    border-left: 3px solid #ccd5e1;
    color: #4a5668;
    font-size: 0.9rem;
    margin: 0 0 0.85rem;
    max-height: 8rem;
    overflow: auto;
    padding: 0.65rem 0.8rem;
}

.requirement-comment {
    margin-bottom: 0.75rem;
}

.requirement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.requirement-versions {
    border-top: 1px solid #edf0f5;
    padding-top: 0.7rem;
}

.requirement-versions summary {
    color: #3d4b60;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.version-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.version-row {
    align-items: center;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 6px;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.55rem 0.65rem;
}

.version-row-meta {
    align-items: center;
    color: #5d6b82;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    gap: 0.5rem;
    justify-content: end;
}

@media (max-width: 900px) {
    .management-grid,
    .intake-overview,
    .intake-layout,
    .requirements-board {
        grid-template-columns: 1fr;
    }

    .intake-sidebar {
        position: static;
    }

    .version-row {
        align-items: start;
        flex-direction: column;
    }

    .version-row-meta {
        justify-content: start;
    }
}

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

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

.page-heading {
    margin-bottom: 2rem;
}

.page-heading h1,
.auth-panel h1 {
    color: var(--insightive-text);
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.04;
}

.page-heading p,
.auth-panel p,
.text-muted,
.form-text {
    color: var(--insightive-muted) !important;
}

.eyebrow {
    color: var(--insightive-blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 11rem);
    place-items: center;
    min-width: 0;
    width: 100%;
}

.auth-panel,
.management-grid > section,
.intake-question,
.intake-sidebar-block,
.similarity-heading,
.requirement-card {
    background: var(--insightive-card);
    border: 1px solid var(--insightive-border);
    border-radius: 18px;
    box-shadow: var(--insightive-shadow);
}

.auth-panel {
    max-width: 100%;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    position: relative;
    width: min(100%, 31rem);
}

.auth-panel::before {
    background: linear-gradient(90deg, var(--insightive-accent), var(--insightive-blue));
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.management-grid {
    align-items: start;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
}

.management-grid > section {
    padding: 1.35rem;
}

h2 {
    color: var(--insightive-text);
    font-size: 1.1rem;
    font-weight: 900;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--insightive-text);
    --bs-table-border-color: var(--insightive-border);
    --bs-table-hover-bg: var(--insightive-hover);
    color: var(--insightive-text);
}

.table thead th {
    color: var(--insightive-subtle);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.form-control,
.form-select,
.form-check-input,
textarea {
    background-color: var(--insightive-surface-strong) !important;
    border-color: var(--insightive-border) !important;
    color: var(--insightive-text) !important;
}

.form-control::placeholder {
    color: var(--insightive-subtle);
}

.form-label {
    color: var(--insightive-muted);
    font-weight: 800;
}

.btn {
    border-radius: 12px;
}

.btn-outline-secondary,
.btn-outline-primary {
    border-color: var(--insightive-border-strong);
    color: var(--insightive-text);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    background: var(--insightive-hover);
    border-color: var(--insightive-border-strong);
    color: var(--insightive-text);
}

.badge {
    border-radius: 999px;
    font-weight: 800;
    padding: 0.42rem 0.65rem;
}

.text-bg-secondary {
    background: var(--insightive-active) !important;
    color: var(--insightive-text) !important;
}

.text-bg-success {
    background: rgba(33, 199, 121, 0.16) !important;
    color: var(--insightive-success) !important;
}

.text-bg-warning {
    background: rgba(255, 200, 87, 0.18) !important;
    color: var(--insightive-warning) !important;
}

.alert {
    border-radius: 14px;
}

.alert-danger {
    background: rgba(243, 111, 125, 0.14);
    border-color: rgba(243, 111, 125, 0.28);
    color: var(--insightive-danger);
}

.tenant-pill,
.count-pill,
.intake-question-number,
.intake-nav-item span {
    background: var(--insightive-active);
    border: 1px solid var(--insightive-border);
    color: var(--insightive-text);
}

.intake-overview,
.requirement-summary,
.requirement-column-heading {
    border-color: var(--insightive-border);
}

.intake-label,
.intake-category,
.intake-meta,
.intake-meta strong,
.intake-help,
.intake-stat span,
.requirement-summary span,
.requirement-type,
.requirement-meta,
.version-row-meta {
    color: var(--insightive-muted);
}

.intake-project h2,
.intake-progress-header strong,
.intake-stat strong,
.requirement-summary strong,
.requirement-card h3,
.similarity-heading h3,
.requirement-column-heading h2 {
    color: var(--insightive-text);
}

.intake-question,
.requirement-card {
    border-left-width: 4px;
}

.intake-question.is-complete,
.requirement-card-accepted {
    border-left-color: var(--insightive-success);
}

.requirement-card-rejected {
    border-left-color: var(--insightive-danger);
}

.requirement-card-reanalysis {
    border-left-color: var(--insightive-warning);
}

.requirement-source,
.version-row,
.intake-nav-item {
    background: var(--insightive-surface-strong);
    border-color: var(--insightive-border);
    color: var(--insightive-muted);
}

.intake-nav-item:hover {
    background: var(--insightive-hover);
    color: var(--insightive-text);
}

.requirement-versions {
    border-color: var(--insightive-border);
}

.requirement-versions summary {
    color: var(--insightive-text);
}

@media (max-width: 900px) {
    .management-grid,
    .intake-overview,
    .intake-layout,
    .requirements-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-heading h1,
    .auth-panel h1 {
        font-size: 2rem;
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .auth-panel {
        width: min(100%, 22rem);
    }
}
