:root {
    --font-body: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --font-display: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --brand-blue: #005083;
    --brand-blue-dark: #003f68;
    --brand-blue-deep: #003455;
    --brand-blue-soft: #e8f3f8;
    --brand-yellow: #ffdc00;
    --brand-yellow-dark: #d8b900;
    --surface-page: #f4f7fa;
    --surface-card: #fff;
    --border-subtle: #dce5ee;
    --text-main: #111827;
    --text-muted: #5f6b7a;
}

html, body {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    background: var(--surface-page);
    color: var(--text-main);
}

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

.btn-primary {
    color: #fff;
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-primary:hover {
    background-color: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(255, 220, 0, .62);
}

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: #b32121;
    padding: 1rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

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

.page-titlebar {
    margin-bottom: 1.25rem;
}

.page-titlebar h1 {
    color: var(--text-main);
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: 0;
    margin: .42rem 0 .18rem;
}

.page-titlebar p {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    margin: 0;
}

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

.breadcrumbs {
    color: #66758a;
    display: flex;
    align-items: center;
    gap: .64rem;
    font-size: .86rem;
}

.breadcrumbs a {
    color: #53657a;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--brand-blue);
}

.breadcrumbs span:not(:last-child) {
    width: 7px;
    height: 7px;
    border-right: 1.8px solid #8b98aa;
    border-bottom: 1.8px solid #8b98aa;
    transform: rotate(-45deg);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.22;
    margin: 0;
    color: var(--text-main);
}

.eyebrow {
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.3;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.lead-text {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    max-width: 760px;
    margin: .55rem 0 0;
}

.portal-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(30, 38, 45, .08);
    padding: 1.25rem;
}

.portal-card h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: .75rem 0 .45rem;
}

.employee-docs-upload-dialog-backdrop {
    align-items: flex-start;
    background: rgba(15, 23, 42, .42);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 6rem 1rem 2rem;
    position: fixed;
    z-index: 2000;
}

.employee-docs-upload-dialog {
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
    display: grid;
    gap: 1rem;
    max-width: 720px;
    padding: 1rem;
    width: min(720px, 100%);
}

.employee-docs-upload-dialog-title {
    align-items: flex-start;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: .8rem;
}

.employee-docs-upload-dialog-title h2 {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.employee-docs-upload-link-card {
    display: grid;
    gap: .75rem;
}

.employee-docs-upload-link-card label {
    display: grid;
    gap: .35rem;
}

.employee-docs-upload-link-card span {
    color: var(--brand-blue-dark);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.employee-docs-upload-link-card small {
    color: #64748b;
}

.employee-docs-upload-link-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.tool-card p {
    color: #617286;
    flex: 1;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tool-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #e7f5f2;
    color: #236c62;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.status-badge {
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.module-setup-card,
.result-shell {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(30, 38, 45, .08);
}

.module-setup-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 72px minmax(260px, 1fr) minmax(260px, .82fr);
    gap: 1.3rem;
    align-items: center;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.module-panel h2,
.result-main h2 {
    color: #111827;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 .88rem;
}

.disabled-dropzone {
    border: 1.5px dashed #c8d3e1;
    border-radius: 8px;
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    margin-bottom: .9rem;
    background: #fbfdff;
}

.disabled-dropzone strong {
    color: #111827;
    display: block;
    font-size: .94rem;
}

.disabled-dropzone small {
    color: #6b7280;
}

.file-placeholder {
    width: 42px;
    height: 48px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    display: inline-block;
    position: relative;
    background: #fff;
    flex: 0 0 auto;
}

.file-placeholder::before {
    content: "";
    position: absolute;
    right: -2px;
    top: -2px;
    width: 16px;
    height: 16px;
    background: #f6f8fb;
    border-left: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 0 4px 0 4px;
}

.file-placeholder::after {
    content: "PDF";
    position: absolute;
    left: 6px;
    bottom: 9px;
    background: #e11d48;
    color: #fff;
    border-radius: 2px;
    font-size: .58rem;
    font-weight: 700;
    padding: .08rem .24rem;
}

.file-placeholder.large {
    width: 58px;
    height: 68px;
}

.check-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #16a34a;
    display: inline-block;
    margin-left: auto;
    position: relative;
    opacity: .9;
}

.check-placeholder::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 5px;
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

.compare-divider {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #f0f3f8;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.compare-divider span {
    width: 24px;
    height: 18px;
    position: relative;
}

.compare-divider span::before,
.compare-divider span::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #111827;
}

.compare-divider span::before {
    top: 3px;
    left: 2px;
    box-shadow: 7px -4px 0 -2px #111827;
}

.compare-divider span::after {
    bottom: 3px;
    right: 2px;
}

.module-action-panel {
    border-left: 1px solid #e2e8f0;
    display: grid;
    gap: .8rem;
    padding-left: 1.5rem;
}

.module-action-panel label {
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.module-action-panel .btn {
    min-height: 46px;
    font-weight: 600;
}

.result-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
    gap: 1.2rem;
    padding: 1.25rem;
}

.module-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.metric-card {
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: .9rem;
    min-height: 64px;
    padding: .85rem 1rem;
}

.metric-card strong {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
}

.metric-card span {
    color: #243044;
    font-size: 14px;
    font-weight: 400;
}

.metric-neutral {
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
}

.metric-warning {
    background: #fff8d8;
    color: #9a7a00;
}

.metric-info {
    background: #eff6f3;
    color: #16836f;
}

.placeholder-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.placeholder-row {
    display: grid;
    grid-template-columns: 1fr .7fr 1.4fr;
    gap: 1rem;
    align-items: center;
    min-height: 52px;
    padding: .7rem 1rem;
    border-bottom: 1px solid #edf2f7;
    color: #334155;
    font-size: .9rem;
}

.placeholder-row:last-child {
    border-bottom: 0;
}

.placeholder-head {
    background: #f8fafc;
    color: #111827;
    font-weight: 600;
}

.preview-panel {
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    overflow: hidden;
}

.preview-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #dfe7f1;
}

.preview-tabs button {
    background: #fff;
    border: 0;
    color: #475569;
    min-height: 48px;
    font-weight: 600;
}

.preview-tabs button.active {
    color: var(--brand-blue);
    box-shadow: inset 0 -3px 0 var(--brand-blue);
}

.document-preview-placeholder {
    min-height: 360px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .72rem;
    padding: 2rem;
    text-align: center;
}

.document-preview-placeholder strong {
    color: #111827;
}

.document-preview-placeholder p {
    color: #64748b;
    max-width: 260px;
    margin: 0;
}

.status-active {
    background: #e5f4ec;
    color: #20603d;
}

.status-concept {
    background: #fff8d8;
    color: #795315;
}

.status-disabled {
    background: #e9edf2;
    color: #5d6875;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 1rem;
}

.empty-state {
    border: 1px dashed #c2cfdd;
    border-radius: 8px;
    color: #607286;
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
}

.status-list {
    display: grid;
    gap: .8rem;
    margin: 0;
}

.status-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #edf1f5;
    padding-bottom: .7rem;
}

.status-list dt {
    color: #5f7084;
    font-weight: 600;
}

.status-list dd {
    margin: 0;
    font-weight: 700;
}

.table-surface {
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    overflow-x: auto;
}

.portal-table {
    margin: 0;
}

.portal-table thead th {
    color: #526477;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.placeholder-tool {
    max-width: 820px;
}

.placeholder-box {
    background: #f8fafc;
    border: 1px dashed #c2cfdd;
    border-radius: 8px;
    color: #5f7084;
    padding: 1rem;
}

.admin-tool-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(260px, 2fr) 160px 120px 110px;
    gap: .75rem;
    align-items: center;
}

.tool-toggle-form {
    align-items: center;
    display: flex;
    gap: .55rem;
}

.tool-toggle-form .form-check {
    margin: 0;
    min-height: 0;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
}

.admin-tab {
    align-items: center;
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    color: #334155;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    padding: .5rem .85rem;
    text-decoration: none;
}

.admin-tab.active,
.admin-tab:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 1rem;
    align-items: start;
}

.admin-users-table tbody tr {
    border-left: 3px solid transparent;
}

.admin-users-table tbody tr.is-selected {
    background: var(--brand-blue-soft);
    border-left-color: var(--brand-blue);
}

.admin-users-table td strong,
.admin-users-table td span {
    display: block;
}

.role-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.role-chip {
    background: #eef2f7;
    border: 1px solid #d7e1ec;
    border-radius: 4px;
    color: #334155;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    padding: 3px 7px;
}

.security-note {
    color: #64748b;
    font-size: .84rem;
}

.admin-user-panel {
    display: grid;
    gap: 1rem;
}

.admin-user-panel h2 {
    margin-top: 0;
}

.admin-user-panel-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.form-grid.compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: .9rem;
}

.role-fieldset {
    border: 1px solid #e1e7ef;
    border-radius: 8px;
    display: grid;
    gap: .45rem;
    margin: .9rem 0;
    padding: .85rem;
}

.role-fieldset legend {
    color: #526477;
    float: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    margin: 0;
    padding: 0 .25rem;
    text-transform: uppercase;
    width: auto;
}

.role-check {
    align-items: center;
    display: flex;
    gap: .5rem;
    margin: 0;
}

.admin-danger-zone {
    border-top: 1px solid #e1e7ef;
    padding-top: 1rem;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 180px);
}

.login-panel {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid #dce5ee;
    border-radius: 8px;
    padding: 2rem;
}

@media (max-width: 980px) {
    .dashboard-grid,
    .admin-tool-row,
    .admin-users-layout,
    .form-grid.compact,
    .module-setup-card,
    .result-shell,
    .module-status-grid {
        grid-template-columns: 1fr;
    }

    .compare-divider {
        transform: rotate(90deg);
    }

    .module-action-panel {
        border-left: 0;
        border-top: 1px solid #e2e8f0;
        padding: 1rem 0 0;
    }

    .placeholder-row {
        grid-template-columns: 1fr;
    }
}
