html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.edit-form-anchor {
    scroll-margin-top: 4.5rem;
}

.list-row-actions {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: end;
    align-items: center;
    gap: .5rem;
}

.list-row-actions .btn {
    min-width: 6.75rem;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .list-row-actions {
        width: 100%;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
        justify-content: stretch;
    }

    .list-row-actions .btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
}

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

/* Tema dell'area riservata. La login resta volutamente indipendente. */
.portal-shell,
.portal-shell main,
.portal-shell .top-row,
.portal-shell .dashboard-hero,
.portal-shell .dashboard-tile,
.portal-shell .theme-selector {
    transition:
        background-color .2s ease,
        background-image .2s ease,
        border-color .2s ease,
        color .2s ease,
        box-shadow .2s ease;
}

html[data-portal-theme="dark"] .portal-shell {
    --bs-body-color: #f2f7ff;
    --bs-secondary-color: #d8eaff;
    --bs-tertiary-color: #c8e0fb;
    --bs-emphasis-color: #fff;
    --bs-border-color: #31445d;
    --portal-dark-bg: #091525;
    --portal-dark-surface: #122238;
    --portal-dark-surface-raised: #182b43;
    --portal-dark-surface-soft: #0e1d30;
    --portal-dark-border: #31465f;
    --portal-dark-text: #f2f7ff;
    --portal-dark-muted: #d8eaff;
    --portal-dark-primary: #78b9ff;
    color: #e5edf7;
}

html[data-portal-theme="dark"] .portal-shell main {
    background:
        radial-gradient(circle at 88% 8%, rgba(13, 110, 253, .1), transparent 30rem),
        #091525;
}

html[data-portal-theme="dark"] .portal-shell .top-row {
    background: rgba(10, 24, 42, .96);
    border-bottom-color: #263a53;
    color: #e3efff;
}

html[data-portal-theme="dark"] .portal-shell .top-row .text-secondary {
    color: #d8eaff !important;
}

html[data-portal-theme="dark"] .portal-shell .app-version {
    background: #1a2c43;
    color: #e0edff;
}

html[data-portal-theme="dark"] .portal-shell .dashboard-hero {
    background:
        radial-gradient(circle at 90% 10%, rgba(56, 139, 255, .2), transparent 38%),
        linear-gradient(135deg, #13243a, #0e1c2f);
    border-color: #314861;
    box-shadow: 0 .8rem 2.2rem rgba(0, 0, 0, .28);
}

html[data-portal-theme="dark"] .portal-shell .dashboard-kicker {
    color: #75b7ff !important;
}

html[data-portal-theme="dark"] .portal-shell .dashboard-hero h1,
html[data-portal-theme="dark"] .portal-shell .dashboard-section > header h2 {
    color: #f1f6fc;
}

html[data-portal-theme="dark"] .portal-shell .dashboard-hero p:last-child,
html[data-portal-theme="dark"] .portal-shell .dashboard-section > header p {
    color: var(--portal-dark-muted);
}

html[data-portal-theme="dark"] .portal-shell .dashboard-tile {
    background: #122238;
    border-color: #2c4059;
    box-shadow: 0 .4rem 1.15rem rgba(0, 0, 0, .24);
    color: #e8f0fa;
}

html[data-portal-theme="dark"] .portal-shell .dashboard-tile:hover,
html[data-portal-theme="dark"] .portal-shell .dashboard-tile:focus-visible {
    border-color: var(--tile-accent);
    color: #fff;
}

html[data-portal-theme="dark"] .portal-shell .tile-copy strong {
    color: #edf4fc;
}

html[data-portal-theme="dark"] .portal-shell .tile-copy > span {
    color: var(--portal-dark-muted);
}

html[data-portal-theme="dark"] .portal-shell .tile-icon {
    background: color-mix(in srgb, var(--tile-accent) 22%, #14243a);
}

html[data-portal-theme="dark"] .portal-shell .theme-selector {
    background: rgba(7, 19, 36, .82);
    border-color: #344760;
}

html[data-portal-theme="dark"] .portal-shell .theme-option {
    color: #d8eaff;
}

html[data-portal-theme="dark"] .portal-shell .theme-option[aria-pressed="true"] {
    background: #1b2d45;
    box-shadow: 0 .25rem .8rem rgba(0, 0, 0, .32);
    color: #78b9ff;
}

/* Controlli e form Bootstrap */
html[data-portal-theme="dark"] .portal-shell :is(
    .form-control,
    .form-select,
    .input-group-text,
    .form-control:disabled,
    .form-select:disabled) {
    background-color: var(--portal-dark-surface-soft) !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(.form-control, .form-select) {
    color-scheme: dark;
}

html[data-portal-theme="dark"] .portal-shell :is(.form-control, .form-select)::placeholder {
    color: #bad8f8 !important;
    opacity: 1;
}

html[data-portal-theme="dark"] .portal-shell :is(.form-control, .form-select):focus {
    background-color: #12263e !important;
    border-color: #67aaf4 !important;
    box-shadow: 0 0 0 .22rem rgba(78, 158, 245, .2) !important;
    color: #fff !important;
}

html[data-portal-theme="dark"] .portal-shell :is(.form-control, .form-select):disabled {
    color: #c2daf5 !important;
    opacity: .78;
}

html[data-portal-theme="dark"] .portal-shell .form-floating > label,
html[data-portal-theme="dark"] .portal-shell :is(.form-label, .form-check-label, .control-label, legend) {
    color: #e3efff !important;
}

html[data-portal-theme="dark"] .portal-shell .form-floating > label::after {
    background-color: transparent !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .form-text,
    .text-secondary,
    .text-muted,
    .text-body-secondary,
    .user-agent) {
    color: var(--portal-dark-muted) !important;
}

html[data-portal-theme="dark"] .portal-shell .form-check-input {
    background-color: #0c1a2b;
    border-color: #60758d;
}

html[data-portal-theme="dark"] .portal-shell .form-check-input:checked {
    background-color: #2b86e5;
    border-color: #67aaf4;
}

html[data-portal-theme="dark"] .portal-shell input:-webkit-autofill,
html[data-portal-theme="dark"] .portal-shell input:-webkit-autofill:hover,
html[data-portal-theme="dark"] .portal-shell input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--portal-dark-text);
    box-shadow: 0 0 0 1000px var(--portal-dark-surface-soft) inset !important;
}

/* Superfici delle form, pannelli e schede applicative */
html[data-portal-theme="dark"] .portal-shell :is(
    .card,
    [class*="-card"],
    [class*="-panel"],
    .audit-summary,
    .audit-table-wrap,
    .broadcast-result,
    .push-summary,
    .send-panel) {
    background-color: var(--portal-dark-surface) !important;
    border-color: var(--portal-dark-border) !important;
    box-shadow: 0 .45rem 1.35rem rgba(0, 0, 0, .22) !important;
    color: var(--portal-dark-text);
}

html[data-portal-theme="dark"] .portal-shell :is(
    .account-row,
    .asset-row,
    .assignment-row,
    .authorized-plate-row,
    .contact-entry,
    .guest-row,
    .guard-row,
    .package-history-row,
    .personal-plate-row,
    .person-card,
    .plate-card,
    .push-device-row,
    .recipient-row,
    .relation-entry,
    .ownership-entry,
    .occupation-entry) {
    background-color: var(--portal-dark-surface-soft) !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text);
}

html[data-portal-theme="dark"] .portal-shell :is(
    .account-search,
    .authorized-search,
    .contacts-search,
    .guard-search,
    .search-box,
    .building-option,
    .parking-option,
    .scope-option,
    .qr-details > div,
    .details-grid > div,
    .board-type-summary) {
    background-color: var(--portal-dark-surface-soft) !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text);
}

html[data-portal-theme="dark"] .portal-shell :is(
    .building-option:has(input:checked),
    .parking-option:has(input:checked),
    .scope-option:has(input:checked),
    .recipient-row:has(input:checked)) {
    background-color: #123553 !important;
    border-color: #5da8f5 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .empty-bulletin,
    .empty-history,
    .empty-plates,
    .empty-search-result,
    .empty-state) {
    background-color: rgba(16, 31, 50, .72) !important;
    border-color: #40546c !important;
    color: var(--portal-dark-muted) !important;
}

/* Tabelle e liste */
html[data-portal-theme="dark"] .portal-shell .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--portal-dark-text);
    --bs-table-border-color: var(--portal-dark-border);
    --bs-table-hover-bg: rgba(74, 145, 220, .11);
    --bs-table-hover-color: #fff;
    color: var(--portal-dark-text);
}

html[data-portal-theme="dark"] .portal-shell .table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--portal-dark-border);
    color: inherit;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .audit-table-wrap,
    .expense-table-wrap,
    .table-responsive) {
    border-color: var(--portal-dark-border) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .expense-table-wrap thead th,
    .audit-table-wrap thead th) {
    background-color: #1a304a !important;
    color: #cce2fa !important;
}

/* Titoli, testi secondari e collegamenti */
html[data-portal-theme="dark"] .portal-shell :is(h1, h2, h3, h4, h5, h6) {
    color: #f1f6fc;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .asset-metadata,
    .assignment-row span,
    .authorized-search span,
    .contact-card-heading p,
    .contact-identity span,
    .expense-result-heading p,
    .package-meta,
    .person-main span,
    .plate-dates,
    .plate-property,
    .plate-summary span,
    .personal-plate-row span,
    .guest-row span,
    .recipient-main span,
    .relation-entry span,
    .status-card span,
    .bulletin-meta,
    .bulletin-body,
    .history-summary) {
    color: var(--portal-dark-muted) !important;
}

html[data-portal-theme="dark"] .portal-shell a:not(.btn):not(.nav-link):not(.dashboard-tile) {
    color: var(--portal-dark-primary);
}

html[data-portal-theme="dark"] .portal-shell .btn-outline-dark {
    border-color: #93a8bf;
    color: #dce7f3;
}

html[data-portal-theme="dark"] .portal-shell .btn-outline-dark:hover {
    background: #dce7f3;
    color: #102037;
}

/* Dialoghi, navigazione del profilo e menu Bootstrap */
html[data-portal-theme="dark"] .portal-shell :is(
    .modal-content,
    .dropdown-menu,
    .list-group-item) {
    background-color: var(--portal-dark-surface) !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(.dropdown-item, .list-group-item-action) {
    color: var(--portal-dark-text);
}

html[data-portal-theme="dark"] .portal-shell :is(.dropdown-item, .list-group-item-action):hover {
    background-color: #213852;
    color: #fff;
}

html[data-portal-theme="dark"] .portal-shell .nav-tabs {
    border-bottom-color: var(--portal-dark-border);
}

html[data-portal-theme="dark"] .portal-shell .nav-tabs .nav-link.active {
    background-color: var(--portal-dark-surface);
    border-color: var(--portal-dark-border) var(--portal-dark-border) var(--portal-dark-surface);
    color: #fff;
}

/* Stati informativi: colori semantici conservati con contrasto adatto al Dark */
html[data-portal-theme="dark"] .portal-shell :is(.alert-light, .text-bg-light) {
    background-color: #1a2c43 !important;
    border-color: #425a75 !important;
    color: #dbe7f4 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .alert-info,
    .common-board-notice,
    .qr-association,
    .board-type-summary,
    .expense-no-save) {
    background-color: #0d3049 !important;
    border-color: #27658d !important;
    color: #bde5ff !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .alert-warning,
    .broadcast-warning,
    .expense-warnings) {
    background-color: #3a2e0c !important;
    border-color: #80691f !important;
    color: #ffe69c !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .alert-danger,
    .delete-confirmation,
    .broadcast-confirmation,
    .confirmation-box) {
    background-color: #421b22 !important;
    border-color: #8b3f4b !important;
    color: #ffc2ca !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .alert-success,
    .entry-recorded,
    .qr-associated,
    .expense-balanced) {
    background-color: #123c2a !important;
    border-color: #327154 !important;
    color: #b9f2d3 !important;
}

html[data-portal-theme="dark"] .portal-shell .result-green {
    background-color: #123c2a !important;
    border-color: #3d8c66 !important;
}

html[data-portal-theme="dark"] .portal-shell .result-blue {
    background-color: #102f54 !important;
    border-color: #4389da !important;
}

html[data-portal-theme="dark"] .portal-shell .result-red {
    background-color: #421b22 !important;
    border-color: #a94c5a !important;
}

html[data-portal-theme="dark"] .portal-shell :is(.expense-description, .bulletin-body) {
    background-color: #0e1d30 !important;
    border-color: #496682 !important;
}

html[data-portal-theme="dark"] .portal-shell .expense-table-wrap tfoot th {
    background-color: #123c2a !important;
    color: #b9f2d3 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(.text-danger, .validation-message) {
    color: #ff8f9b !important;
}

html[data-portal-theme="dark"] .portal-shell .text-success {
    color: #6ed9a2 !important;
}

html[data-portal-theme="dark"] .portal-shell .text-info {
    color: #78c7f5 !important;
}

/* Rifiniture delle singole sezioni applicative */
html[data-portal-theme="dark"] .portal-shell :is(
    .package-controls,
    .recipient-list,
    .plate-entry,
    .authorized-list,
    .audit-toolbar,
    .push-toolbar) {
    background-color: var(--portal-dark-surface) !important;
    border-color: var(--portal-dark-border) !important;
    box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .2);
}

html[data-portal-theme="dark"] .portal-shell :is(
    .history-summary,
    .audit-summary span,
    .push-summary span,
    .building-tags span,
    .board-icon,
    .device-icon,
    .asset-icon) {
    background-color: #153552 !important;
    color: #b9ddff !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .package-icon,
    .operation-badge) {
    background-color: #443817 !important;
    color: #ffe6a1 !important;
}

html[data-portal-theme="dark"] .portal-shell .package-icon.guest-entry {
    background-color: #153b2b !important;
    color: #aeeac9 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .contact-card-heading,
    .push-user-card > header) {
    background: linear-gradient(135deg, #182d46, #13253a) !important;
    border-color: var(--portal-dark-border) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .contact-numbers,
    .asset-row + .asset-row,
    .recipient-row + .recipient-row,
    .push-device-row + .push-device-row,
    .bulletin-card footer) {
    border-color: var(--portal-dark-border) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .contact-numbers,
    .asset-details span,
    .asset-details small,
    .device-details span,
    .device-details small,
    .package-copy span,
    .package-copy small,
    .package-meta span:not(.badge),
    .recipient-main span,
    .recipient-main small,
    .send-panel span,
    .board-section-heading p,
    .author,
    .attachment-list small,
    .empty-bulletin p,
    .empty-history p,
    .result-count) {
    color: var(--portal-dark-muted) !important;
}

html[data-portal-theme="dark"] .portal-shell .result-count {
    border: 1px solid #2f6f9f;
    background-color: #16436a !important;
    color: #f1f8ff !important;
}

html[data-portal-theme="dark"] .portal-shell .phone-action {
    background-color: #153552 !important;
    color: #8fc8ff !important;
}

html[data-portal-theme="dark"] .portal-shell .whatsapp-action {
    background-color: #153b2b !important;
    color: #82e2ad !important;
}

html[data-portal-theme="dark"] .portal-shell .action-disabled {
    background-color: #202c3b !important;
    border-color: #49586a !important;
    color: #c4dcf7 !important;
}

html[data-portal-theme="dark"] .portal-shell .parking-list span {
    background-color: #22344a !important;
    color: #c4d2e2 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .registry-icon-properties,
    .registry-icon-people,
    .registry-icon-millesimal) {
    background: linear-gradient(145deg, #19334d, #192c42) !important;
    box-shadow: inset 0 0 0 1px #3c5570 !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .registry-card-properties .registry-arrow,
    .registry-card-people .registry-arrow,
    .registry-card-millesimal .registry-arrow) {
    background-color: #203a56 !important;
    color: #9bcbff !important;
}

html[data-portal-theme="dark"] .portal-shell .bulletin-card.inactive,
html[data-portal-theme="dark"] .portal-shell .push-disabled {
    background-color: #101b2a !important;
    color: #c8e0fb !important;
}

html[data-portal-theme="dark"] .portal-shell .attachment-list a {
    background-color: #381c25 !important;
    border-color: #75404d !important;
    color: #ffbac5 !important;
}

html[data-portal-theme="dark"] .portal-shell .attachment-list a:hover {
    background-color: #49232e !important;
}

html[data-portal-theme="dark"] .portal-shell .outcome.success,
html[data-portal-theme="dark"] .portal-shell .broadcast-result span {
    background-color: #153b2b !important;
    color: #aeeac9 !important;
}

html[data-portal-theme="dark"] .portal-shell .outcome.failure {
    background-color: #421b22 !important;
    color: #ffc2ca !important;
}

html[data-portal-theme="dark"] .portal-shell .confirmation-password {
    background-color: #201a24 !important;
    border-color: #c65c69 !important;
    color: #ffb0bb !important;
}

html[data-portal-theme="dark"] .portal-shell .expense-row-amount {
    color: #81bdff !important;
}

html[data-portal-theme="dark"] .portal-shell .expense-balanced span {
    background-color: #1d573d !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .millesimal-section,
    .millesimal-card,
    .building-total-item,
    .summary-item) {
    background-color: var(--portal-dark-surface) !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .millesimal-section > header,
    .millesimal-loading,
    .millesimal-empty) {
    background: #10243a !important;
    border-color: var(--portal-dark-border) !important;
    color: var(--portal-dark-text) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .millesimal-card-heading h3,
    .millesimal-total strong,
    .building-total-item strong,
    .summary-item strong) {
    color: #f2f7ff !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .millesimal-total > span,
    .millesimal-total small,
    .millesimal-metrics small,
    .common-parts-building-totals h4,
    .building-total-item > span,
    .building-total-item small,
    .summary-item span) {
    color: var(--portal-dark-muted) !important;
}

html[data-portal-theme="dark"] .portal-shell :is(
    .millesimal-card-heading,
    .millesimal-metrics > span,
    .building-total-item,
    .millesimal-details,
    .millesimal-details .table-responsive) {
    border-color: var(--portal-dark-border) !important;
}

html[data-portal-theme="dark"] .portal-shell .millesimal-details summary {
    color: #8ed5ff;
}

html[data-portal-theme="dark"] .portal-shell .missing-value td {
    background-color: #421b22 !important;
    color: #ffc2ca !important;
}

html[data-portal-theme="dark"] .portal-shell .audit-table-wrap tr {
    border-color: var(--portal-dark-border) !important;
}

@media (max-width: 767.98px) {
    html[data-portal-theme="dark"] .portal-shell .audit-table-wrap tr {
        background-color: var(--portal-dark-surface) !important;
        box-shadow: 0 .3rem .8rem rgba(0, 0, 0, .22) !important;
    }

    html[data-portal-theme="dark"] .portal-shell .audit-table-wrap td::before {
        color: var(--portal-dark-muted) !important;
    }
}

/* Il prompt Push è esterno al wrapper del layout, ma appartiene all'area riservata. */
html[data-portal-theme="dark"] .push-prompt {
    background-color: rgba(18, 34, 56, .96) !important;
    border-color: #405672 !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .38) !important;
}

html[data-portal-theme="dark"] .push-prompt .push-icon {
    background-color: #153b2b !important;
}

html[data-portal-theme="dark"] .push-prompt .push-copy {
    color: #e7eef8 !important;
}

html[data-portal-theme="dark"] .push-prompt .push-copy span {
    color: #aab9ca !important;
}

@media (prefers-reduced-motion: reduce) {
    .portal-shell,
    .portal-shell main,
    .portal-shell .top-row,
    .portal-shell .dashboard-hero,
    .portal-shell .dashboard-tile,
    .portal-shell .theme-selector {
        transition: none;
    }
}
