:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #182033;
    background: #f4f6fa;
    --accent: #5874f8;
    --accent-dark: #4562ea;
    --accent-soft: #eef1ff;
    --page-background: #f4f6fa;
    --sidebar-background: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f7f8fc;
    --border: #e1e7f0;
    --text: #182033;
    --muted: #748096;
    --danger: #ef3f57;
}

html[data-theme="dark"] {
    color-scheme: dark;
    color: #e7edf7;
    background: #0f1724;
    --accent: #8297ff;
    --accent-dark: #a7b5ff;
    --accent-soft: #26345d;
    --page-background: #0f1724;
    --sidebar-background: #111a29;
    --surface: #182334;
    --surface-muted: #202c40;
    --border: #344258;
    --text: #e7edf7;
    --muted: #a3afc1;
    --danger: #ff6074;
}

.sidebar-alert-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 44px;
    margin: 0 .15rem .85rem;
    padding: .55rem .65rem;
    color: #b42336;
    text-decoration: none;
    background: #fff3f4;
    border: 1px solid #ffc9d0;
    border-radius: 10px;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.sidebar-alert-link:hover {
    color: #8f1728;
    background: #ffe8eb;
    border-color: #ffabb6;
}

.sidebar-alert-icon {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--danger);
    box-shadow: 0 0 0 0 rgb(239 63 87 / 45%);
    animation: sidebar-alert-pulse 1.35s ease-in-out infinite;
}

.sidebar-alert-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.sidebar-alert-label {
    flex: 1;
    font-size: .88rem;
    font-weight: 750;
}

.sidebar-alert-count {
    display: grid;
    min-width: 24px;
    height: 24px;
    padding: 0 .4rem;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--danger);
    font-size: .75rem;
    line-height: 1;
}

@keyframes sidebar-alert-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgb(239 63 87 / 38%);
    }
    50% {
        opacity: .45;
        transform: scale(.92);
        box-shadow: 0 0 0 6px rgb(239 63 87 / 0%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-alert-icon {
        animation: none;
    }
}

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

.photo-choice {
    width: 100%;
    overflow: hidden;
    padding: 0;
    color: #1e293b;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    cursor: pointer;
}

.photo-choice img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.photo-choice span { display: block; padding: .75rem; font-weight: 700; }
.report-html-preview { overflow-x: auto; margin-top: 1rem; padding: 1rem; background: #fff; border: 1px solid #dbe3ef; border-radius: 10px; }
.nested-details { margin-top: 1rem; }
.nested-details > summary { cursor: pointer; font-weight: 700; }

[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--page-background);
    color: var(--text);
}

a {
    color: var(--accent-dark);
}

.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 248px;
    height: 100vh;
    padding: 1.35rem 1rem 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--sidebar-background);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .15rem .45rem 1.4rem;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(145deg, #6d85ff, #526ef5);
    box-shadow: 0 7px 18px rgb(82 110 245 / 30%);
}

.brand-mark svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.brand-copy {
    display: grid;
    min-width: 0;
}

.brand-copy strong {
    font-size: 1rem;
    line-height: 1.2;
}

.brand-copy small {
    margin-top: .18rem;
    color: var(--muted);
    font-size: .76rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
}

.sidebar-group-label {
    margin: 1.15rem .75rem .35rem;
    color: #99a3b5;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .09em;
}

.sidebar-group-label:first-child {
    margin-top: .15rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .78rem;
    min-height: 42px;
    padding: .65rem .75rem;
    border-radius: 10px;
    color: #69758a;
    font-size: .91rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.sidebar-link:hover {
    color: var(--accent-dark);
    background: #f5f7ff;
}

.sidebar-link.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.sidebar-link.active .nav-icon {
    color: var(--accent);
}

.nav-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.sidebar-account {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: 1.25rem;
    padding: 1rem .45rem 0;
    border-top: 1px solid var(--border);
}

.sidebar-account strong {
    overflow: hidden;
    color: #69758a;
    font-size: .78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account form {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.sidebar-account-actions {
    display: flex;
    align-items: stretch;
    gap: .45rem;
    margin-top: .35rem;
}

.theme-toggle {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    place-items: center;
    color: #465267;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--accent-dark);
    border-color: #cdd5e4;
    background: var(--surface-muted);
}

.theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-icon-moon {
    display: block;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    min-height: 38px;
    padding: .45rem .7rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #465267;
    background: var(--surface);
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-logout:hover {
    color: var(--accent-dark);
    border-color: #cdd5e4;
    background: var(--surface-muted);
}

.report-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.report-opinion-form,
.read-only-report-opinion {
    margin-top: 1rem;
}

.read-only-report-opinion {
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.read-only-report-opinion p {
    margin: .5rem 0 0;
    white-space: pre-wrap;
}

.report-output-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.report-output-actions form {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

.word-save-status {
    color: var(--muted);
    font-size: .85rem;
}

.recommendation-summary-title {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    min-width: 0;
}

.recommendation-checkbox-list {
    display: grid;
    gap: .35rem;
    margin-bottom: 1rem;
}

.recommendation-checkbox {
    margin: 0;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
}

.recommendation-checkbox small {
    color: var(--muted);
}

.selected-recommendation-list,
.management-link-list {
    margin: 0;
    padding-left: 1.25rem;
}

.management-link-list li {
    padding: .7rem .25rem;
    border-bottom: 1px solid var(--border);
}

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

.management-link-list a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.management-link-list a:hover {
    color: var(--accent-dark);
}

.recommendation-edit-actions {
    justify-content: space-between;
}

.recommendation-editor-card {
    display: flex;
    width: 100%;
    min-height: calc(100dvh - 14rem);
    flex-direction: column;
}

.recommendation-text-editor {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.recommendation-text-editor textarea {
    flex: 1;
    min-height: clamp(18rem, calc(100dvh - 25rem), 64rem);
    resize: vertical;
}

.word-report-action {
    margin-top: 1rem;
}

.word-download-action {
    margin-top: .45rem;
}

.word-download-action .link-button {
    color: var(--primary);
}

.icon-button-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.icon-button-content svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-workspace {
    min-width: 0;
    background: var(--page-background);
}

.mobile-header,
.sidebar-toggle,
.sidebar-overlay {
    display: none;
}

.app-main {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2.25rem) 3rem;
}

.public-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgb(88 116 248 / 11%), transparent 30rem),
        var(--page-background);
}

.public-header {
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 82%);
    backdrop-filter: blur(10px);
}

.public-header .sidebar-brand {
    width: fit-content;
    padding-bottom: .15rem;
}

.public-main {
    width: min(1120px, 100%);
    padding-top: clamp(2rem, 6vw, 5rem);
}

h1 {
    margin: 0 0 .45rem;
    color: var(--text);
    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: -.025em;
}

h1:focus {
    outline: none;
}

p {
    line-height: 1.55;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

.form-card,
.data-card {
    padding: clamp(1.1rem, 3vw, 1.6rem);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgb(31 42 68 / 4%);
}

.narrow-card {
    width: min(680px, 100%);
    margin-inline: auto;
}

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

.settings-section h2 {
    margin-top: 0;
}

.master-word-upload-form {
    margin-top: 1rem;
}

.email-bcc-settings-form {
    margin-top: 1rem;
}

.email-test-form {
    margin-top: 1rem;
}

.collapsible-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
}

.compact-settings-line {
    padding: .8rem 1rem;
}

.compact-settings-line h2 {
    margin: 0;
    font-size: 1rem;
}

.login-card {
    width: min(480px, 100%);
    margin-inline: auto;
}

form > label,
.form-grid label {
    display: grid;
    gap: .35rem;
    margin-bottom: 1rem;
    color: #4d596d;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: .55rem .7rem;
    border: 1px solid #cfd7e4;
    border-radius: 10px;
    background: white;
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgb(88 116 248 / 14%);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    min-height: auto;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.form-grid {
    display: grid;
    gap: 0 1rem;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.location-form-grid > .full-width,
.location-locality-fields {
    grid-column: 1 / -1;
}

.location-locality-fields {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) minmax(9rem, 14rem) minmax(7rem, 9rem);
    gap: 0 1rem;
}

fieldset {
    margin: 0 0 1.4rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcff;
}

legend {
    padding: 0 .4rem;
    color: var(--text);
    font-weight: 700;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin: .4rem 0 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 500;
}

.field-help {
    margin: -.55rem 0 1rem;
    color: var(--muted);
    font-size: .9rem;
}

.conditional-field-help {
    margin: 0;
    padding-top: .85rem;
}

.form-footer {
    margin: 1rem 0 0;
    font-size: .92rem;
}

.primary-button,
.secondary-button,
.success-button,
.danger-button,
.link-button {
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.primary-button,
.secondary-button,
.success-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .55rem 1rem;
}

.primary-button {
    color: white;
    background: var(--accent);
    box-shadow: 0 5px 12px rgb(88 116 248 / 20%);
}

.primary-button:hover {
    background: var(--accent-dark);
}

.success-button {
    border: 1px solid #159447;
    color: white;
    background: #18a957;
    box-shadow: 0 5px 12px rgb(24 169 87 / 20%);
}

.success-button:hover {
    background: #128642;
}

.danger-button {
    border: 1px solid var(--danger);
    color: white;
    background: var(--danger);
}

.danger-button:hover {
    background: #d92f48;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.secondary-button {
    border: 1px solid #d4dce8;
    color: #465267;
    background: white;
}

.secondary-button:hover {
    color: var(--accent-dark);
    border-color: #c2cce0;
    background: #f8f9fc;
}

.link-button {
    padding: 0;
    background: transparent;
    text-decoration: underline;
}

.alert,
.validation-summary {
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    border-radius: 10px;
}

.success-alert {
    border: 1px solid #91c7a6;
    color: #185c34;
    background: #edf9f1;
}

.warning-alert {
    border: 1px solid #e4bd74;
    color: #71430a;
    background: #fff8e8;
}

.warning-alert ul {
    margin: .45rem 0 0;
    padding-left: 1.25rem;
}

.danger-alert {
    width: min(680px, 100%);
    margin-inline: auto;
    border: 1px solid #d18080;
    color: #7a1f1f;
    background: #fff0f0;
}

.danger-alert ul {
    margin: .65rem 0 0;
    padding-left: 1.25rem;
}

.success-message {
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    border: 1px solid #91c7a6;
    border-radius: 10px;
    color: #185c34;
    background: #edf9f1;
}

.validation-summary.validation-summary-valid {
    display: none;
}

.validation-summary.validation-summary-errors {
    border: 1px solid #e1a2a2;
    color: #8d1c1c;
    background: #fff3f3;
}

.validation-summary ul {
    margin: 0;
}

.validation-message,
.field-validation-error {
    color: #a01818;
    font-size: .88rem;
    font-weight: 500;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgb(31 42 68 / 4%);
}

th,
td {
    padding: .75rem;
    border-bottom: 1px solid #e8edf4;
    text-align: left;
    vertical-align: top;
}

th {
    color: #68758a;
    background: #f6f8fc;
    font-size: .82rem;
    letter-spacing: .025em;
}

.select-all-control {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    cursor: pointer;
}

.select-all-control input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--accent);
}

.finance-dashboard-section {
    margin-bottom: 1.25rem;
}

.finance-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
}

.finance-action-card {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    justify-content: center;
    gap: .35rem;
    padding: 1rem 1.1rem;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.finance-action-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.finance-action-card strong {
    font-size: 1.02rem;
}

.finance-action-card span {
    color: var(--muted);
    font-size: .9rem;
}

.finance-radio-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.finance-radio-filter label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 700;
}

.status-badge.active {
    color: #185c34;
    background: #e5f6eb;
}

.status-badge.inactive {
    color: #7a2525;
    background: #faeaea;
}

.status-badge.workflow {
    color: #435ecf;
    background: #edf0ff;
}

.expertise-section {
    margin-top: 1.25rem;
}

.expertise-section h2 {
    margin: 0 0 1rem;
    color: var(--text);
}

.collapsible-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.return-section-target {
    scroll-margin-top: 1rem;
}

.collapsible-card-heading::-webkit-details-marker {
    display: none;
}

.collapsible-card-heading h2 {
    margin: 0;
}

.collapsible-card-action::after {
    content: "Aç";
    color: var(--accent-strong);
    font-weight: 700;
}

.collapsible-card[open] > .collapsible-card-heading {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.collapsible-card[open] .collapsible-card-action::after {
    content: "Kapat";
}

.inspected-business-heading-copy h2 {
    margin: 0;
}

.inspected-business-heading-copy p {
    margin: 0;
    color: var(--muted);
}

.inspected-business-card {
    margin: 3px 0;
    padding: .75rem 1rem;
}

.inspected-business-heading-copy {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.inspected-business-heading-copy h2,
.inspected-business-heading-copy p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inspected-business-heading-copy h2 {
    flex: 0 0 auto;
    font-size: 1rem;
}

.inspected-business-heading-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 0 0 auto;
}

.active-expertise-link {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #cdd6ff;
    border-radius: 9px;
    color: var(--accent-strong);
    background: #f2f4ff;
}

.active-expertise-link:hover {
    border-color: var(--accent);
    background: #e9edff;
}

.active-expertise-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.inspected-business-management-actions {
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.muted-text {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 500;
}

.embedded-table {
    box-shadow: none;
}

.inline-operation-form {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.inline-operation-form label {
    flex: 1;
    margin: 0;
}

.completion-card {
    border-color: #cdd6ff;
    background: #fafbff;
}

.timeline {
    display: grid;
    gap: .9rem;
}

.timeline-item {
    display: grid;
    gap: .2rem;
    padding-left: 1rem;
    border-left: 3px solid #8da1ff;
}

.timeline-item small {
    color: var(--muted);
}

.card-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-heading-row h2,
.email-test-card h2 {
    margin: 0;
    color: var(--text);
}

.status-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem 1.5rem;
    margin: 0 0 1.25rem;
}

.status-details div {
    padding-bottom: .65rem;
    border-bottom: 1px solid #e8edf4;
}

.status-details dt {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 650;
}

.status-details dd {
    margin: .25rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.email-test-card {
    margin-top: 1.25rem;
}

.email-test-card > p:first-of-type {
    margin-top: .45rem;
    color: var(--muted);
}

.email-configuration-help {
    margin: 1rem 0 0;
}

.email-test-help {
    margin: .85rem 0 0;
}

.danger-zone {
    margin-top: 1.25rem;
    border-color: #d8a1a1;
}

.danger-zone h2 {
    margin: 0;
    color: #7a1f1f;
}

.danger-zone p {
    color: var(--muted);
}

.cancel-action-toggle {
    width: fit-content;
    cursor: pointer;
    list-style: none;
}

.cancel-action-toggle::-webkit-details-marker {
    display: none;
}

.cancel-action[open] > .cancel-action-toggle {
    margin-bottom: .75rem;
}

.cancel-action-panel {
    margin: 0;
}

.confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell a + a {
    margin-left: .75rem;
}

.warning-text {
    margin-top: .25rem;
    color: #8a4b08;
    font-size: .84rem;
    font-weight: 650;
}

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

.blazor-error-boundary,
#blazor-error-ui {
    color: white;
    background: #9b2525;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    padding: .8rem 1rem;
    border-radius: 7px;
}

#blazor-error-ui a {
    color: white;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.expertise-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
}

.expertise-status-filters .primary-button,
.expertise-status-filters .secondary-button {
    min-height: 36px;
    padding: .4rem .75rem;
    font-size: .88rem;
}

.expertise-list-tools {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
}

.expertise-date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .65rem;
}

.expertise-date-filter label {
    min-width: 175px;
    margin: 0;
}

.expertise-date-filter input {
    min-height: 42px;
}

.expertise-result-summary {
    margin: .65rem 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1rem;
}

.pagination-nav .primary-button,
.pagination-nav .secondary-button {
    width: auto;
    min-width: 40px;
    min-height: 38px;
    justify-content: center;
    padding: .4rem .7rem;
}

.pagination-ellipsis {
    padding: 0 .2rem;
    color: var(--muted);
}

.selection-card {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbfe;
}

.selection-card h3 {
    margin-top: 0;
}

.instruction-preview {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 12px 28px rgb(52 78 155 / 10%);
}

.instruction-preview .confirmation-actions {
    margin-top: 1rem;
}

.instruction-preview tfoot th {
    border-top: 2px solid var(--border);
}

.compact-actions {
    margin-top: 1rem;
}

.html-output {
    display: block;
    margin-top: 1rem;
}

.html-output textarea {
    width: 100%;
    font-family: Consolas, monospace;
}

.danger-zone {
    border-color: #d8a4a4;
}

.danger-text {
    color: #a32121;
}

html[data-theme="dark"] .sidebar-alert-link {
    color: #ff9cab;
    background: #3a2029;
    border-color: #71404c;
}

html[data-theme="dark"] .sidebar-alert-link:hover {
    color: #ffc1ca;
    background: #48242f;
    border-color: #8b4b59;
}

html[data-theme="dark"] .sidebar-link,
html[data-theme="dark"] .sidebar-account strong,
html[data-theme="dark"] .sidebar-logout,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .mobile-menu-button {
    color: #b7c2d3;
}

html[data-theme="dark"] .sidebar-link:hover {
    background: #1d2940;
}

html[data-theme="dark"] .public-header,
html[data-theme="dark"] .mobile-header {
    background: rgb(17 26 41 / 94%);
}

html[data-theme="dark"] fieldset,
html[data-theme="dark"] .completion-card,
html[data-theme="dark"] .report-html-preview {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--border);
}

html[data-theme="dark"] legend {
    color: var(--text);
}

html[data-theme="dark"] form > label,
html[data-theme="dark"] .form-grid label {
    color: #c4cede;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .photo-choice,
html[data-theme="dark"] .selection-card {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--border);
}

html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .sidebar-logout:hover {
    background: #27344a;
    border-color: #52617a;
}

html[data-theme="dark"] .active-expertise-link {
    color: #bec8ff;
    background: #28365c;
    border-color: #52617a;
}

html[data-theme="dark"] .active-expertise-link:hover {
    background: #32436f;
    border-color: var(--accent);
}

html[data-theme="dark"] th {
    color: #b5c0d1;
    background: #202d42;
}

html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .status-details div,
html[data-theme="dark"] .collapsible-card[open] > .collapsible-card-heading {
    border-color: var(--border);
}

html[data-theme="dark"] .status-badge.workflow {
    color: #bec8ff;
    background: #28365c;
}

html[data-theme="dark"] .status-badge.active,
html[data-theme="dark"] .success-alert,
html[data-theme="dark"] .success-message {
    color: #9ce1b6;
    background: #183827;
    border-color: #356d4a;
}

html[data-theme="dark"] .status-badge.inactive,
html[data-theme="dark"] .danger-alert,
html[data-theme="dark"] .validation-summary.validation-summary-errors {
    color: #ffb0b0;
    background: #412226;
    border-color: #79424a;
}

html[data-theme="dark"] .warning-alert {
    color: #f5cd91;
    background: #3d311d;
    border-color: #735b2f;
}

html[data-theme="dark"] .danger-text {
    color: #ff8798;
}

html[data-theme="dark"] .danger-zone {
    border-color: #79424a;
}

html[data-theme="dark"] .danger-zone h2 {
    color: #ffb0b0;
}

@media (max-width: 900px) {
    body:has(.sidebar-toggle:checked) {
        overflow: hidden;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-sidebar {
        position: fixed;
        z-index: 50;
        left: 0;
        transform: translateX(-102%);
        box-shadow: 16px 0 40px rgb(25 35 56 / 15%);
        transition: transform 180ms ease;
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 40;
        inset: 0;
        display: block;
        pointer-events: none;
        opacity: 0;
        background: rgb(21 28 44 / 45%);
        transition: opacity 180ms ease;
    }

    .sidebar-toggle:checked + .sidebar-overlay {
        pointer-events: auto;
        opacity: 1;
    }

    .sidebar-toggle:checked ~ .app-sidebar {
        transform: translateX(0);
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: .85rem;
        min-height: 58px;
        padding: .65rem 1rem;
        border-bottom: 1px solid var(--border);
        background: rgb(255 255 255 / 94%);
        backdrop-filter: blur(12px);
    }

    .mobile-header > a {
        color: var(--text);
        font-weight: 800;
        text-decoration: none;
    }

    .mobile-menu-button {
        display: grid;
        width: 38px;
        height: 38px;
        place-items: center;
        border: 1px solid var(--border);
        border-radius: 9px;
        color: #5d6a80;
        background: white;
        cursor: pointer;
    }

    html[data-theme="dark"] .mobile-menu-button {
        color: var(--text);
        background: var(--surface-muted);
        border-color: var(--border);
    }

    .mobile-menu-button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-width: 1.8;
    }
}

@media (max-width: 760px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .two-columns,
    .three-columns,
    .status-details {
        grid-template-columns: 1fr;
    }

    .location-locality-fields {
        grid-template-columns: 1fr;
    }

    .inline-operation-form {
        align-items: stretch;
        flex-direction: column;
    }

    .data-card,
    .table-wrapper {
        overflow-x: auto;
    }

    .app-main {
        padding: 1.25rem .85rem 2rem;
    }

    .form-card,
    .data-card {
        border-radius: 13px;
    }
}

@media (max-width: 480px) {
    .app-sidebar {
        width: min(86vw, 310px);
    }

    .primary-button,
    .secondary-button,
    .success-button,
    .danger-button {
        width: 100%;
    }

    .heading-actions,
    .confirmation-actions {
        width: 100%;
    }
}
