@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
    --dh-ink: #14231e;
    --dh-muted: #61746b;
    --dh-surface: #ffffff;
    --dh-surface-soft: #f5f1e8;
    --dh-line: #dfded5;
    --dh-primary: #0f5b4f;
    --dh-primary-strong: #0a4038;
    --dh-accent: #d99b45;
    --dh-danger: #b23b3b;
    --dh-shadow: 0 18px 46px rgba(28, 45, 38, .11);
    --dh-radius: 18px;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Manrope", sans-serif;
    color: var(--dh-ink);
    background:
        radial-gradient(circle at 0% 0%, rgba(217, 155, 69, .16), transparent 34rem),
        radial-gradient(circle at 95% 8%, rgba(15, 91, 79, .12), transparent 30rem),
        linear-gradient(180deg, #fbfaf6 0%, #f3f0e8 100%);
}

a {
    color: var(--dh-primary);
}

a:hover {
    color: var(--dh-primary-strong);
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, .28);
    background:
        linear-gradient(135deg, rgba(10, 64, 56, .98), rgba(18, 88, 75, .96)),
        #0f5b4f;
    box-shadow: 0 12px 34px rgba(12, 42, 35, .18);
}

.brand-shell {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .9rem;
    color: #173027;
    background: linear-gradient(135deg, #f8e3ba 0%, #d99b45 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 18px rgba(0, 0, 0, .16);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.brand-logo-mark {
    width: 3.85rem;
    height: 3.85rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.brand-stack {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
    transform: translateY(.18rem);
}

.brand-title-link {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 1.2rem;
}

@media (min-width: 992px) {
    .brand-stack {
        transform: translateY(.32rem);
    }

    .brand-title-link {
        font-size: 1.284rem;
    }
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: .9rem;
    padding: .45rem .6rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(217, 155, 69, .28);
}

.app-navbar .navbar-nav {
    gap: .2rem;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, .82);
    border-radius: 999px;
    padding: .55rem .82rem;
    font-weight: 700;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.show {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.navbar .dropdown-menu {
    border: 1px solid rgba(20, 35, 30, .08);
    border-radius: 1rem;
    box-shadow: var(--dh-shadow);
    margin-top: .55rem;
    padding: .45rem;
}

.navbar .dropdown-item {
    border-radius: .75rem;
    padding: .62rem .8rem;
    font-weight: 700;
}

.navbar .dropdown-item:hover {
    background: #f4eee3;
    color: var(--dh-primary-strong);
}

.app-main {
    width: 100%;
}

.app-navbar-sidebar {
    margin-bottom: 0 !important;
}

.app-sidebar-desktop {
    position: fixed;
    z-index: 1020;
    top: 5rem;
    bottom: 0;
    left: 0;
    display: flex;
    width: 264px;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(20, 35, 30, .1);
    background: #fff;
    box-shadow: 6px 0 18px rgba(20, 35, 30, .035);
    transition: width .18s ease;
}

.app-sidebar-desktop-header {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .8rem .5rem 1.35rem;
    border-bottom: 1px solid rgba(20, 35, 30, .08);
}

.app-sidebar-desktop-title {
    color: var(--dh-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.app-sidebar-collapse {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: #60746a;
    background: transparent;
    font-size: 1.1rem;
}

.app-sidebar-collapse:hover {
    color: var(--dh-primary-strong);
    background: #eaf3ef;
}

.app-sidebar-desktop-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .45rem .8rem 1rem;
}

.app-side-links {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-height: 100%;
}

.app-side-group {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    padding-bottom: .72rem;
    border-bottom: 1px solid rgba(20, 35, 30, .08);
}

.app-side-section-label {
    margin: .65rem .72rem .42rem;
    color: var(--dh-muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.app-side-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 44px;
    padding: .55rem .72rem;
    border-radius: 8px;
    color: #35473f;
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}

.app-side-link:hover,
.app-side-link:focus-visible {
    color: var(--dh-primary-strong);
    background: rgba(15, 91, 79, .08);
}

.app-side-link:focus-visible,
.app-side-action:focus-visible {
    outline: 2px solid var(--dh-primary);
    outline-offset: 2px;
}

.app-side-link-active {
    color: var(--dh-primary-strong);
    background: #eaf3ef;
    box-shadow: inset 3px 0 0 var(--dh-primary);
    font-weight: 800;
}

.app-side-icon {
    display: inline-flex;
    flex: 0 0 1.35rem;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    color: #75877e;
    font-size: 1.08rem;
}

.app-side-link-active .app-side-icon {
    color: var(--dh-primary);
}

.app-side-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-left: auto;
    padding: 0 .35rem;
    border-radius: 999px;
    color: #fff;
    background: #bf4b3a;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
}

.app-side-quick-actions {
    display: grid;
    gap: .4rem;
    margin: .6rem .15rem .1rem;
}

.app-side-action {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 40px;
    padding: .55rem .72rem;
    border: 1px solid rgba(15, 91, 79, .22);
    border-radius: 8px;
    color: var(--dh-primary-strong);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.app-side-action:hover {
    color: var(--dh-primary-strong);
    background: #eef5f1;
}

.app-side-action-primary {
    border-color: var(--dh-primary);
    color: #fff;
    background: var(--dh-primary);
}

.app-side-action-primary:hover {
    color: #fff;
    background: var(--dh-primary-strong);
}

.app-sidebar-drawer {
    --bs-offcanvas-width: min(88vw, 340px);
    color: var(--dh-ink);
    background: #fbfaf6;
    box-shadow: 12px 0 32px rgba(20, 35, 30, .16);
}

.app-sidebar-drawer .offcanvas-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .75rem .8rem 1rem;
}

.app-sidebar-drawer .offcanvas-header {
    border-bottom: 1px solid var(--dh-line);
}

.app-sidebar-drawer .app-side-section-label:first-child {
    margin-top: .15rem;
}

.navigation-sidebar .app-navbar-sidebar .navbar-brand {
    margin-right: 0;
}

.navigation-sidebar .app-main-sidebar {
    width: calc(100% - 264px);
    max-width: none;
    margin-left: 264px;
    transition: width .18s ease, margin-left .18s ease;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop {
    width: 68px;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop-header {
    justify-content: center;
    padding-inline: .4rem;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop-title,
.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-section-label,
.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-label,
.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-badge {
    display: none;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop-body {
    padding-inline: .55rem;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-group {
    gap: .25rem;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-link,
.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-action {
    justify-content: center;
    gap: 0;
    padding-inline: .3rem;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-icon {
    flex-basis: 1.5rem;
    width: 1.5rem;
    font-size: 1.2rem;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-quick-actions {
    gap: .35rem;
    margin-inline: 0;
}

.navigation-sidebar.sidebar-collapsed .app-sidebar-desktop .app-side-group {
    border-bottom: 0;
}

.navigation-sidebar.sidebar-collapsed .app-main-sidebar {
    width: calc(100% - 68px);
    margin-left: 68px;
}

.app-sidebar-drawer .app-side-group {
    padding-bottom: .8rem;
}

.document-tools-page {
    max-width: 1080px;
}

.document-tools-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    margin-bottom: 1rem;
    padding: .35rem;
    border: 1px solid rgba(15, 91, 79, .1);
    border-radius: 10px;
    background: #f0f4f1;
}

.document-tools-tab {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem .8rem;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #46584f;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.document-tools-tab:hover {
    color: var(--dh-primary-strong);
    background: rgba(255, 255, 255, .65);
}

.document-tools-tab.active {
    border-color: rgba(15, 91, 79, .12);
    color: var(--dh-primary-strong);
    background: #fff;
    box-shadow: 0 2px 5px rgba(24, 47, 37, .06);
}

.document-tools-tab > i {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.document-tools-count {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 1.4rem;
    height: 1.4rem;
    align-items: center;
    justify-content: center;
    padding: 0 .3rem;
    border-radius: 999px;
    color: #52645a;
    background: #edf1ee;
    font-size: .72rem;
    font-weight: 800;
}

.document-tools-tab.active .document-tools-count {
    color: #fff;
    background: var(--dh-primary);
}

.document-tools-section {
    border-color: rgba(20, 35, 30, .1);
    border-radius: 8px;
}

.document-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.document-record-list {
    display: grid;
    gap: .75rem;
}

.document-record {
    padding: .95rem;
    border: 1px solid rgba(20, 35, 30, .12);
    border-radius: 8px;
    background: #fff;
}

.document-record-actions {
    display: flex;
    gap: .5rem;
    margin-top: .85rem;
}

.document-record-actions form {
    display: contents;
}

.receipt-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin: .6rem 0;
}

.receipt-meta div {
    min-width: 0;
}

.receipt-meta dt {
    color: var(--dh-muted);
    font-size: .75rem;
    font-weight: 700;
}

.receipt-meta dd {
    margin: .12rem 0 0;
    font-size: .9rem;
}

.document-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 750;
    white-space: nowrap;
}

.document-status.is-available {
    color: #18734e;
}

.document-status.is-pending {
    color: #8a6728;
}

.document-empty-state {
    display: grid;
    justify-items: center;
    gap: .35rem;
    padding: 2.2rem 1rem;
    border: 1px dashed rgba(20, 35, 30, .2);
    border-radius: 8px;
    text-align: center;
}

.document-empty-state > i {
    margin-bottom: .25rem;
    color: #809087;
    font-size: 1.8rem;
}

.document-hub-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
    gap: .85rem;
}

.document-hub-card {
    border-color: rgba(20, 35, 30, .1);
    border-radius: 8px;
}

.document-hub-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    margin-top: 1rem;
}

.document-hub-action {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .65rem;
    padding: .8rem;
    border: 1px solid rgba(15, 91, 79, .15);
    border-radius: 8px;
    color: var(--dh-ink);
    text-decoration: none;
}

.document-hub-action:hover {
    border-color: rgba(15, 91, 79, .35);
    color: var(--dh-primary-strong);
    background: #f5f8f6;
}

.document-hub-action-icon {
    display: inline-flex;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: var(--dh-primary);
    background: #eaf3ef;
    font-size: 1.05rem;
}

.document-hub-action-copy {
    display: grid;
    min-width: 0;
    gap: .18rem;
    line-height: 1.2;
}

.document-hub-action-copy strong {
    font-size: .85rem;
}

.document-hub-action-copy small {
    color: var(--dh-muted);
    font-size: .75rem;
}

.document-hub-arrow {
    margin-left: auto;
    color: #72847a;
}

@media (max-width: 575.98px) {
    .document-tools-tabs {
        gap: .25rem;
        padding: .25rem;
    }

    .document-tools-tab {
        min-height: 58px;
        gap: .3rem;
        padding: .5rem .35rem;
        font-size: .8rem;
    }

    .document-hub-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar-desktop,
    .navigation-sidebar .app-main-sidebar {
        transition: none;
    }
}

.page-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 18%, rgba(217, 155, 69, .22), transparent 16rem),
        linear-gradient(135deg, #ffffff 0%, #f7f1e7 52%, #edf5f1 100%);
    border: 1px solid rgba(15, 91, 79, .12);
    border-radius: calc(var(--dh-radius) + 6px);
    padding: clamp(1.1rem, 2.4vw, 1.8rem);
    margin-bottom: 1.25rem;
    box-shadow: 0 14px 36px rgba(32, 48, 41, .08);
}

.page-hero::after {
    content: "";
    position: absolute;
    right: -3.5rem;
    bottom: -5rem;
    width: 12rem;
    height: 12rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 91, 79, .14);
    pointer-events: none;
}

.page-hero-kicker {
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: .72rem;
    font-weight: 800;
    color: var(--dh-primary);
    margin-bottom: .42rem;
}

.page-hero-title {
    margin-bottom: .28rem;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--dh-ink);
}

.page-hero-subtitle {
    margin-bottom: 0;
    color: var(--dh-muted);
    max-width: 68ch;
}

.card {
    border: 1px solid rgba(20, 35, 30, .08);
    border-radius: var(--dh-radius);
    box-shadow: 0 10px 30px rgba(30, 45, 39, .07);
}

.card-header {
    border-bottom-color: rgba(20, 35, 30, .08);
    background: linear-gradient(180deg, #fff 0%, #faf7f0 100%);
    border-radius: var(--dh-radius) var(--dh-radius) 0 0 !important;
}

.card-title {
    font-weight: 800;
    letter-spacing: -.02em;
}

.btn {
    border-radius: .9rem;
    font-weight: 800;
}

.btn-sm {
    border-radius: .75rem;
}

.btn-primary {
    border-color: var(--dh-primary);
    background: linear-gradient(135deg, var(--dh-primary) 0%, #167767 100%);
    box-shadow: 0 9px 18px rgba(15, 91, 79, .18);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--dh-primary-strong);
    background: linear-gradient(135deg, var(--dh-primary-strong) 0%, var(--dh-primary) 100%);
}

.btn-outline-primary {
    border-color: rgba(15, 91, 79, .42);
    color: var(--dh-primary);
    background: rgba(255, 255, 255, .62);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: var(--dh-primary);
    background: var(--dh-primary);
    color: #fff;
}

.btn-outline-secondary {
    border-color: rgba(97, 116, 107, .34);
    color: #40534b;
    background: rgba(255, 255, 255, .64);
}

.btn-danger {
    border-color: var(--dh-danger);
    background: var(--dh-danger);
}

.form-control,
.form-select {
    border-color: rgba(20, 35, 30, .14);
    border-radius: .95rem;
    padding: .68rem .85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 91, 79, .58);
    box-shadow: 0 0 0 .22rem rgba(15, 91, 79, .12);
}

.form-label {
    color: #32443d;
    font-weight: 700;
}

.table {
    overflow: hidden;
    border-radius: var(--dh-radius);
    --bs-table-bg: rgba(255, 255, 255, .82);
    --bs-table-striped-bg: rgba(245, 241, 232, .68);
    --bs-table-hover-bg: rgba(232, 242, 237, .82);
}

.table thead th {
    color: #3d4f47;
    background: #f3eee5;
    border-bottom: 0;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    border-radius: 999px;
    font-weight: 800;
}

.alert {
    width: min(920px, calc(100% - 1.5rem));
    margin: .8rem auto 0;
    border: 0;
    border-radius: 1rem;
    box-shadow: var(--dh-shadow);
}

.nav-tabs {
    border: 0;
    gap: .4rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .25rem;
}

.nav-tabs .nav-link {
    white-space: nowrap;
    border: 1px solid rgba(20, 35, 30, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--dh-muted);
    font-weight: 800;
}

.nav-tabs .nav-link.active {
    color: #fff;
    border-color: var(--dh-primary);
    background: var(--dh-primary);
}

.legal-footer {
    margin-top: auto;
    border-top: 1px solid rgba(20, 35, 30, .08);
    padding: 1.25rem 0 1.6rem;
    color: var(--dh-muted);
    font-size: .9rem;
    background: rgba(255, 255, 255, .38);
}

.legal-footer a {
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .navigation-sidebar .app-main-sidebar,
    .navigation-sidebar.sidebar-collapsed .app-main-sidebar {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        transition: none;
    }

    /* Barra in alto su mobile: a tutta larghezza, senza angoli, cosi' combacia con la pagina sotto. */
    .app-navbar {
        border-bottom: 0;
        border-radius: 0;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(12, 42, 35, .14);
    }

    .navbar-collapse {
        margin-top: .8rem;
        padding: .7rem;
        border-radius: 1rem;
        background: rgba(255, 255, 255, .08);
    }

    .app-navbar .navbar-nav {
        gap: .25rem;
    }

    .app-navbar .nav-link {
        border-radius: .9rem;
        padding: .72rem .85rem;
    }

    .navbar .dropdown-menu {
        margin-top: .2rem;
        box-shadow: none;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-navbar {
        margin-bottom: 1rem !important;
    }

    .brand-mark {
        width: 2.15rem;
        height: 2.15rem;
    }

    .brand-title-link {
        font-size: 1.08rem;
    }

    .page-hero {
        border-radius: 1.1rem;
    }

    .card {
        border-radius: 1.05rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 2.65rem;
    }

    .d-grid .btn,
    form .btn.w-100 {
        min-height: 2.85rem;
    }
}

/* Check-out workspace */
.checkout-workspace,
.checkout-report-page {
    max-width: 1120px;
}

.checkout-report-page {
    max-width: 940px;
}

.checkout-hero-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.checkout-structure-filter {
    width: min(300px, 42vw);
    background-color: rgba(255, 255, 255, .9);
}

.checkout-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid rgba(20, 35, 30, .09);
    border-radius: 1rem;
    background: rgba(20, 35, 30, .09);
}

.checkout-summary-strip > div.is-overdue {
    background: #fff3f1;
}

.checkout-summary-strip > div.is-overdue strong,
.checkout-summary-strip > div.is-overdue span {
    color: #a4372d;
}

.checkout-summary-strip > div {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .55rem;
    min-width: 0;
    padding: .9rem 1rem;
    background: rgba(255, 255, 255, .9);
}

.checkout-summary-strip strong {
    color: var(--dh-primary);
    font-size: 1.35rem;
}

.checkout-summary-strip span {
    overflow: hidden;
    color: var(--dh-muted);
    font-size: .86rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    margin: 1.1rem 0 1.4rem;
    padding: .25rem 0;
    scrollbar-width: thin;
}

.checkout-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: .55rem .9rem;
    border: 1px solid rgba(20, 35, 30, .12);
    border-radius: .75rem;
    background: rgba(255, 255, 255, .82);
    color: #43544d;
    font-weight: 800;
    white-space: nowrap;
}

.checkout-tab span {
    display: inline-grid;
    min-width: 1.45rem;
    min-height: 1.45rem;
    place-items: center;
    padding: 0 .32rem;
    border-radius: 999px;
    background: rgba(20, 35, 30, .07);
    font-size: .73rem;
}

.checkout-tab:hover,
.checkout-tab:focus-visible {
    border-color: rgba(15, 91, 79, .42);
    color: var(--dh-primary);
}

.checkout-tab.is-active {
    border-color: var(--dh-primary);
    background: var(--dh-primary);
    color: #fff;
}

.checkout-tab.is-active span {
    background: rgba(255, 255, 255, .18);
}

.checkout-tab.is-overdue:not(.is-active) {
    border-color: rgba(164, 55, 45, .32);
    color: #a4372d;
}

.checkout-tab-panel[hidden] {
    display: none;
}

.checkout-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkout-section-heading > div {
    min-width: 0;
}

.checkout-section-heading h2 {
    display: inline;
    margin: 0;
    color: #172a23;
    font-size: 1.18rem;
    font-weight: 850;
}

.checkout-section-heading p {
    margin: .2rem 0 0;
    color: var(--dh-muted);
    font-size: .9rem;
}

.checkout-count-badge {
    flex: 0 0 auto;
    padding: .38rem .65rem;
    border-radius: 999px;
    background: #f4e8b1;
    color: #6f5712;
    font-size: .76rem;
    font-weight: 800;
}

.checkout-count-badge.is-overdue {
    background: #f8d7d3;
    color: #852a22;
}

.checkout-day-heading {
    margin: 1.35rem 0 .65rem;
    color: #52635c;
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.checkout-card-list {
    display: grid;
    gap: .7rem;
}

.checkout-task-card,
.checkout-review-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .95rem;
    border: 1px solid rgba(20, 35, 30, .09);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 24px rgba(20, 35, 30, .04);
}

.checkout-task-card.has-alert,
.checkout-review-card.has-alert {
    border-left: 4px solid #d79627;
    background: #fffdf7;
}

.checkout-task-card.is-overdue {
    border-left: 4px solid #b84438;
    background: #fff8f7;
}

.checkout-task-date {
    display: grid;
    width: 3.55rem;
    min-height: 4.4rem;
    place-content: center;
    border-radius: .75rem;
    background: #edf4f1;
    color: var(--dh-primary);
    text-align: center;
}

.checkout-task-date span,
.checkout-task-date small {
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.checkout-task-date strong {
    font-size: 1.45rem;
    line-height: 1.1;
}

.checkout-task-main,
.checkout-review-main {
    min-width: 0;
}

.checkout-task-structure {
    overflow: hidden;
    color: #1b3028;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-task-booking {
    margin-top: .16rem;
    color: var(--dh-muted);
    font-size: .82rem;
}

.checkout-status {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    flex: 0 0 auto;
    padding: .34rem .58rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 850;
    white-space: nowrap;
}

.checkout-status.is-complete {
    background: #dcefe5;
    color: #176243;
}

.checkout-status.is-pending {
    background: #edf0ee;
    color: #53635d;
}

.checkout-status.is-warning {
    background: #f8e9bd;
    color: #75530b;
}

.checkout-status.is-overdue {
    background: #f8d7d3;
    color: #852a22;
}

.checkout-task-progress {
    max-width: 360px;
    color: #40534b;
}

.checkout-task-progress .progress {
    height: .34rem;
    margin-top: .35rem;
    background: #e4e9e6;
}

.checkout-task-progress .progress-bar {
    background: var(--dh-primary);
}

.checkout-task-action .btn {
    min-width: 8.4rem;
}

.checkout-review-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: .75rem;
    font-size: 1.15rem;
}

.checkout-review-icon.is-ok {
    background: #dcefe5;
    color: #176243;
}

.checkout-review-icon.is-warning {
    background: #f8e9bd;
    color: #75530b;
}

.checkout-review-note {
    margin: .7rem 0 0;
    color: #344740;
    font-size: .9rem;
}

.checkout-review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .38rem 1rem;
    margin-top: .65rem;
    color: var(--dh-muted);
    font-size: .76rem;
}

.checkout-review-meta span {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.checkout-empty-state {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1.15rem;
    border: 1px dashed rgba(20, 35, 30, .15);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .55);
    color: var(--dh-muted);
}

.checkout-empty-state > i {
    color: #55907b;
    font-size: 1.35rem;
}

.checkout-empty-state strong {
    display: block;
    color: #33483f;
}

.checkout-empty-state p {
    margin: .15rem 0 0;
    font-size: .84rem;
}

.checkout-empty-state.compact {
    padding: .9rem;
}

.checkout-back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--dh-primary);
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.checkout-report-summary,
.checkout-form-section,
.checkout-review-box {
    margin-bottom: 1rem;
    padding: 1.15rem;
    border: 1px solid rgba(20, 35, 30, .09);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 30px rgba(20, 35, 30, .04);
}

.checkout-report-summary.has-alert {
    border-top: 4px solid #d79627;
}

.checkout-report-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.checkout-report-metrics > div {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: .55rem;
    padding: .8rem;
    border-radius: .75rem;
    background: #f3f6f4;
}

.checkout-report-metrics i {
    color: var(--dh-primary);
    font-size: 1.15rem;
}

.checkout-report-metrics strong {
    color: #1d322a;
    font-size: 1.1rem;
}

.checkout-report-metrics span {
    color: var(--dh-muted);
    font-size: .78rem;
}

.checkout-report-note {
    margin-top: 1rem;
    padding: .85rem;
    border-left: 3px solid #d6ab3f;
    border-radius: .25rem .7rem .7rem .25rem;
    background: #fffaf0;
}

.checkout-report-note > span {
    color: #765b18;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.checkout-report-note p {
    margin: .25rem 0 0;
    color: #3c392f;
}

.checkout-readonly-list {
    display: grid;
    gap: .35rem;
    margin-top: 1rem;
}

.checkout-readonly-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem .2rem;
    color: #30463d;
    font-size: .88rem;
}

.checkout-readonly-item i {
    color: #27825d;
}

.checkout-readonly-item.is-missing {
    color: #7b4f18;
}

.checkout-readonly-item.is-missing i {
    color: #c68527;
}

.checkout-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.checkout-photo-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: .7rem;
    background: #e8ece9;
}

.checkout-photo-card a,
.checkout-photo-card img {
    display: block;
    width: 100%;
    height: 100%;
}

.checkout-photo-card img {
    object-fit: cover;
}

.checkout-photo-card form {
    position: absolute;
    right: .4rem;
    bottom: .4rem;
}

.checkout-photo-card .btn {
    min-height: 2rem;
    padding: .25rem .5rem;
    border-color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .92);
}

.checkout-contact-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(20, 35, 30, .08);
}

.checkout-contact-strip strong,
.checkout-contact-strip span {
    display: block;
}

.checkout-contact-strip span {
    margin-top: .1rem;
    color: var(--dh-muted);
    font-size: .8rem;
}

.checkout-review-box {
    display: grid;
    gap: .8rem;
}

.checkout-review-box.is-reviewed,
.checkout-review-copy {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
}

.checkout-review-box.is-reviewed > i,
.checkout-review-copy > i {
    color: #27825d;
    font-size: 1.35rem;
}

.checkout-review-box strong,
.checkout-review-box span {
    display: block;
}

.checkout-review-box span {
    color: var(--dh-muted);
    font-size: .82rem;
}

.checkout-review-box p {
    margin: .55rem 0 0;
}

.checkout-edit-notice {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .75rem .85rem;
    border-radius: .75rem;
    background: #eef4f2;
    color: #425a51;
    font-size: .84rem;
}

.checkout-step {
    display: inline-grid;
    width: 1.6rem;
    height: 1.6rem;
    margin-right: .4rem;
    place-items: center;
    border-radius: .45rem;
    background: var(--dh-primary);
    color: #fff;
    font-size: .74rem;
    font-weight: 850;
    vertical-align: .12rem;
}

.checkout-upload-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.checkout-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 4.2rem;
    padding: .8rem;
    border: 1px solid rgba(15, 91, 79, .22);
    border-radius: .8rem;
    background: #f4f8f6;
    color: var(--dh-primary);
    font-weight: 850;
    cursor: pointer;
}

.checkout-upload-button.is-primary {
    border-color: var(--dh-primary);
    background: var(--dh-primary);
    color: #fff;
}

.checkout-upload-button i {
    font-size: 1.25rem;
}

.checkout-file-feedback {
    min-height: 1.25rem;
    margin-top: .55rem;
    color: #287257;
    font-size: .8rem;
    font-weight: 700;
}

.checkout-interactive-list {
    display: grid;
    gap: .55rem;
}

.checkout-check-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem;
    border: 1px solid rgba(20, 35, 30, .1);
    border-radius: .8rem;
    background: #fff;
    cursor: pointer;
}

.checkout-check-item:has(input:checked) {
    border-color: rgba(39, 130, 93, .32);
    background: #f0f8f4;
}

.checkout-check-item .form-check-input {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin: .05rem 0 0;
}

.checkout-check-copy {
    min-width: 0;
}

.checkout-check-copy strong,
.checkout-check-copy small {
    display: block;
}

.checkout-check-copy strong {
    color: #23382f;
}

.checkout-check-copy small {
    margin-top: .18rem;
    color: var(--dh-muted);
}

.checkout-submit-bar {
    position: sticky;
    z-index: 8;
    bottom: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
    padding: .85rem;
    border: 1px solid rgba(20, 35, 30, .12);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 38px rgba(20, 35, 30, .16);
    backdrop-filter: blur(8px);
}

.checkout-submit-bar strong,
.checkout-submit-bar span {
    display: block;
}

.checkout-submit-bar span {
    color: var(--dh-muted);
    font-size: .78rem;
}

.checkout-submit-bar .btn {
    min-width: 11rem;
}

@media (max-width: 767.98px) {
    .checkout-hero-actions {
        width: 100%;
    }

    .checkout-structure-filter {
        width: 100%;
        flex: 1 1 auto;
    }

    .checkout-summary-strip > div {
        display: grid;
        gap: .05rem;
        justify-content: start;
    }

    .checkout-task-card,
    .checkout-review-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .checkout-task-action {
        grid-column: 1 / -1;
    }

    .checkout-task-action .btn {
        width: 100%;
    }

    .checkout-task-progress {
        max-width: none;
    }

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

    .checkout-contact-strip {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .checkout-workspace,
    .checkout-report-page {
        padding-right: .75rem;
        padding-left: .75rem;
    }

    .checkout-hero-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .checkout-hero-actions .btn span {
        display: none;
    }

    .checkout-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: .75rem;
    }

    .checkout-summary-strip > div {
        padding: .7rem .55rem;
    }

    .checkout-summary-strip strong {
        font-size: 1.15rem;
    }

    .checkout-summary-strip span {
        font-size: .68rem;
    }

    .checkout-tabs {
        margin-top: .8rem;
    }

    .checkout-task-card,
    .checkout-review-card {
        gap: .7rem;
        padding: .75rem;
    }

    .checkout-task-date {
        width: 3rem;
        min-height: 4rem;
    }

    .checkout-task-structure {
        white-space: normal;
    }

    .checkout-status {
        margin-top: .4rem;
    }

    .checkout-review-icon {
        width: 2.4rem;
        height: 2.4rem;
    }

    .checkout-review-meta {
        display: grid;
        gap: .3rem;
    }

    .checkout-report-summary,
    .checkout-form-section,
    .checkout-review-box {
        padding: .9rem;
    }

    .checkout-report-metrics {
        grid-template-columns: 1fr;
    }

    .checkout-upload-actions {
        grid-template-columns: 1fr;
    }

    .checkout-submit-bar {
        bottom: .4rem;
        display: grid;
    }

    .checkout-submit-copy {
        display: none;
    }

    .checkout-submit-actions {
        width: 100%;
    }

    .checkout-submit-bar .btn {
        width: 100%;
        min-width: 0;
    }
}
/* Layout degli articoli generati dalla redazione AI. */
.blog-content .editorial-layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin: 2rem 0;
}

.blog-content .editorial-layout-split .editorial-layout-media figure,
.blog-content .editorial-layout-split .editorial-layout-media img {
  width: 100%;
  margin: 0;
}

@media (max-width: 767.98px) {
  .blog-content .editorial-layout-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

/* ---------- Guida agli invii agli enti (scheda Enti della struttura) ---------- */
.enti-guide {
    margin-bottom: 1rem;
    border: 1px solid #f0d9b5;
    border-radius: 14px;
    background: #fffaf2;
    transition: border-color .25s, background-color .25s;
}
.enti-guide.is-ready { border-color: #b9dfcc; background: #f3faf6; }
.enti-guide-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    cursor: pointer;
    list-style: none;
}
.enti-guide-summary::-webkit-details-marker { display: none; }
.enti-guide-summary:focus-visible { outline: 3px solid #d99b45; outline-offset: 2px; border-radius: 14px; }
.enti-guide-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 10px;
    background: #fbe7c6;
    color: #8a5a17;
    font-size: 1.1rem;
}
.enti-guide.is-ready .enti-guide-icon { background: #d7efe3; color: #0f5b4f; }
.enti-guide-heading { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.enti-guide-heading small { color: #6b7a73; }
.enti-guide-status {
    flex: 0 0 auto;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: #f7d9a8;
    color: #6e4410;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.enti-guide.is-ready .enti-guide-status { background: #0f5b4f; color: #fff; }
.enti-guide-chevron { color: #6b7a73; transition: transform .25s; }
.enti-guide[open] .enti-guide-chevron { transform: rotate(180deg); }
.enti-guide-body { padding: 0 1rem 1rem; }
.enti-guide-intro { margin: 0 0 .9rem; color: #43524b; font-size: .93rem; }
.enti-guide-ready {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-bottom: .9rem;
    padding: .8rem .9rem;
    border-radius: 10px;
    background: #0f5b4f;
    color: #fff;
    font-size: .92rem;
}
.enti-guide-ready[hidden] { display: none; }
.enti-guide-ready i { font-size: 1.2rem; margin-top: .05rem; }
.enti-guide-ready strong { display: block; }
.enti-guide-ready span { color: rgba(255, 255, 255, .85); }
.enti-guide-columns { display: grid; gap: .9rem; }
.enti-guide-group h6 { margin: 0 0 .45rem; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7a73; }
.enti-guide-checks { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.enti-check {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .65rem;
    border: 1px solid #ecdcc4;
    border-radius: 10px;
    background: #fff;
    font-size: .88rem;
    transition: border-color .25s, background-color .25s;
}
.enti-check[hidden] { display: none; }
.enti-check.is-ok { border-color: #cfe7da; }
.enti-check-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #d9c3a1;
    border-radius: 50%;
    color: transparent;
    transition: background-color .25s, border-color .25s, color .25s;
}
.enti-check.is-ok .enti-check-mark { border-color: #0f5b4f; background: #0f5b4f; color: #fff; }
.enti-check-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.enti-check-text small { color: #6b7a73; }
.enti-check-go {
    flex: 0 0 auto;
    padding: .2rem .55rem;
    border: 1px solid #d9c3a1;
    border-radius: 999px;
    background: transparent;
    color: #8a5a17;
    font-size: .76rem;
    font-weight: 700;
}
.enti-check.is-ok .enti-check-go { display: none; }
.enti-guide-steps { display: grid; gap: .4rem; margin-top: 1rem; }
.enti-guide-steps details { border: 1px solid #ecdcc4; border-radius: 10px; background: #fff; }
.enti-guide.is-ready .enti-guide-steps details,
.enti-guide.is-ready .enti-check { border-color: #d6ebe0; }
.enti-guide-steps summary { padding: .6rem .8rem; cursor: pointer; font-size: .9rem; font-weight: 700; }
.enti-guide-steps details > div { padding: 0 .8rem .7rem; font-size: .88rem; color: #43524b; }
.enti-guide-steps details > div p:last-child,
.enti-guide-steps details > div ol:last-child { margin-bottom: 0; }
.enti-guide-note { margin: .9rem 0 0; font-size: .8rem; color: #6b7a73; }
@media (min-width: 992px) {
    .enti-guide-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575.98px) {
    .enti-guide-heading small { display: none; }
    .enti-check-go { display: none; }
}
.enti-detail-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: #fbe7c6;
    color: #6e4410;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}
.enti-detail-status:hover { color: #4f300a; text-decoration: underline; }
.enti-detail-status.is-ready { background: #d7efe3; color: #0f5b4f; }

/* ---------- Menu mobile: pulsante e pannello a scomparsa (.dh-drawer) ---------- */
.app-menu-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    transition: background-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.app-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.app-menu-button span:nth-child(2) {
    width: 12px;
    margin-left: 6px;
}

.app-menu-button:hover,
.app-menu-button:active {
    background: rgba(255, 255, 255, .16);
}

.app-menu-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem rgba(217, 155, 69, .45);
}

@media (max-width: 991.98px) {
    .dh-drawer {
        --bs-offcanvas-width: min(86vw, 360px);
        --bs-offcanvas-zindex: 1060;
        --bs-offcanvas-transition: transform .28s cubic-bezier(.22, .61, .36, 1);
        top: 0;
        bottom: 0;
        height: 100%;
        border-left: 0 !important;
        border-radius: 1.5rem 0 0 1.5rem;
        color: var(--dh-ink);
        background: #fbfaf6;
        box-shadow: -18px 0 44px rgba(10, 30, 25, .22);
        will-change: transform;
        contain: layout paint;
    }

    /* Lo sfondo scuro resta sotto il pannello, sopra la barra in alto. */
    .offcanvas-backdrop {
        z-index: 1055;
        background-color: #0a2a24;
    }

    .offcanvas-backdrop.show {
        opacity: .5;
    }

    .dh-drawer .dh-drawer-header {
        flex: 0 0 auto;
        gap: .75rem;
        padding: calc(.9rem + env(safe-area-inset-top)) 1rem .9rem 1.1rem;
        border-bottom: 1px solid rgba(20, 35, 30, .07);
    }

    .dh-drawer-brand {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: .55rem;
    }

    .dh-drawer-brand img {
        width: 40px;
        height: 40px;
        padding: 4px;
        border-radius: 12px;
        background: var(--dh-primary);
    }

    .dh-drawer-brand .offcanvas-title {
        margin: 0;
        font-size: 1.12rem;
        font-weight: 800;
        letter-spacing: -.02em;
    }

    .dh-drawer-close {
        display: inline-flex;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        color: var(--dh-ink);
        background: #efebe1;
        font-size: 1rem;
    }

    .dh-drawer-close:hover,
    .dh-drawer-close:active {
        background: #e5e0d3;
    }

    /* Solo questa parte scorre: la pagina sotto resta ferma (vedi html.dh-menu-open). */
    .dh-drawer .offcanvas-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding: .35rem .75rem 1rem;
    }

    .dh-drawer .app-side-links {
        gap: 0;
        min-height: 0;
    }

    .dh-drawer .app-side-group {
        gap: .15rem;
        padding-bottom: .25rem;
        border-bottom: 0;
    }

    .dh-drawer .app-side-section-label {
        margin: 1rem .7rem .4rem;
        font-size: .7rem;
        letter-spacing: .07em;
    }

    .dh-drawer .app-side-section-label:first-child {
        margin-top: .7rem;
    }

    .dh-drawer .app-side-link {
        gap: .8rem;
        min-height: 50px;
        padding: .45rem .6rem;
        border-radius: 14px;
        color: var(--dh-ink);
        font-size: .96rem;
        font-weight: 700;
        transition: background-color .15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .dh-drawer .app-side-link:active {
        background: rgba(15, 91, 79, .1);
    }

    .dh-drawer .app-side-icon {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border-radius: 11px;
        color: #4d6159;
        background: #efebe1;
        font-size: 1.02rem;
    }

    .dh-drawer .app-side-link-active {
        color: #fff;
        background: var(--dh-primary);
        box-shadow: 0 8px 18px -10px rgba(15, 91, 79, .8);
    }

    .dh-drawer .app-side-link-active .app-side-icon {
        color: #fff;
        background: rgba(255, 255, 255, .16);
    }

    .dh-drawer .app-side-link-active:hover,
    .dh-drawer .app-side-link-active:focus-visible {
        color: #fff;
        background: var(--dh-primary-strong);
    }

    .dh-drawer .app-side-quick-actions {
        margin: .5rem 0 .25rem;
    }

    .dh-drawer .app-side-action {
        min-height: 46px;
        border-radius: 14px;
    }

    .dh-drawer-footer {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: .6rem;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(20, 35, 30, .08);
        background: #f5f2ea;
    }

    .dh-drawer-user {
        display: flex;
        min-width: 0;
        flex: 1;
        align-items: center;
        gap: .6rem;
        color: var(--dh-ink);
        text-decoration: none;
    }

    .dh-drawer-avatar {
        display: inline-flex;
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: #173027;
        background: linear-gradient(135deg, #f8e3ba, #d99b45);
        font-weight: 800;
    }

    .dh-drawer-user-text {
        display: flex;
        min-width: 0;
        flex-direction: column;
        line-height: 1.2;
    }

    .dh-drawer-user-text strong {
        overflow: hidden;
        font-size: .9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dh-drawer-user-text small {
        color: var(--dh-muted);
        font-size: .76rem;
        font-weight: 700;
    }

    .dh-drawer-logout {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        min-height: 40px;
        padding: 0 .85rem;
        border-radius: 999px;
        color: #a23a32;
        background: #fff;
        box-shadow: inset 0 0 0 1px rgba(162, 58, 50, .2);
        font-size: .86rem;
        font-weight: 800;
        text-decoration: none;
    }

    .dh-drawer-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .dh-drawer-btn {
        display: flex;
        min-height: 50px;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        color: var(--dh-primary-strong);
        background: #fff;
        box-shadow: inset 0 0 0 1px rgba(15, 91, 79, .25);
        font-weight: 800;
        text-decoration: none;
    }

    .dh-drawer-btn.is-primary {
        color: #1c1303;
        background: linear-gradient(135deg, #f3c77f, #d99b45);
        box-shadow: 0 10px 22px -12px rgba(217, 155, 69, .9);
    }

    /* Menu aperto: la pagina sotto non scorre e l'assistente non copre le voci. */
    html.dh-menu-open,
    html.dh-menu-open body {
        overflow: hidden;
        overscroll-behavior: none;
    }

    html.dh-menu-open .ai-assistant {
        visibility: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dh-drawer {
        --bs-offcanvas-transition: none;
    }
}


/* Avviso possibili overbooking: dentro la barra in alto (sticky), su tutte le pagine finche' non e' risolto. */
.overbooking-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .75rem;
    width: calc(100% - 2rem);
    margin: .6rem 1rem .75rem;
    padding: .7rem .9rem .7rem 1rem;
    border: 1px solid #f5b5ad;
    border-left: 5px solid #d92d20;
    border-radius: 12px;
    color: #7a1209;
    background: #fff1ef;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    font-size: .88rem;
    line-height: 1.35;
}

.overbooking-bar-text span {
    color: #5c1a12;
}

.overbooking-bar > .bi {
    flex-shrink: 0;
    color: #d92d20;
    font-size: 1.25rem;
}

.overbooking-bar-text {
    flex: 1;
    min-width: 0;
}

.overbooking-bar-text strong {
    display: block;
    font-size: .95rem;
}

.overbooking-bar-btn {
    flex-shrink: 0;
    padding: .45rem .95rem;
    border-radius: 999px;
    color: #fff;
    background: #d92d20;
    font-weight: 800;
    text-decoration: none;
}

.overbooking-bar-btn:hover,
.overbooking-bar-btn:focus {
    color: #fff;
    background: #b42318;
}

@media (max-width: 575.98px) {
    .overbooking-bar {
        flex-wrap: wrap;
        align-items: flex-start;
        width: calc(100% - 1.2rem);
        margin: .5rem .6rem .6rem;
        font-size: .8rem;
    }

    .overbooking-bar-text span {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .overbooking-bar-btn {
        margin-left: 2rem;
    }
}

body.has-overbooking-bar .app-sidebar-desktop {
    top: var(--app-top, 9.5rem);
}

/* Check-out: orario delle pulizie e priorita' (check-in in giornata nella stessa struttura). */
.checkout-task-card.is-priority {
    box-shadow: inset 4px 0 0 #d9822b;
}

.checkout-task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .6rem;
    margin-top: .6rem;
}

.checkout-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    color: #7a3e00;
    background: #fde7c8;
    font-size: .78rem;
    font-weight: 800;
}

.checkout-cleaning-time {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--dh-primary-strong);
    font-size: .86rem;
    font-weight: 800;
}

.checkout-cleaning-time.is-unset {
    color: var(--dh-muted);
    font-weight: 600;
    font-style: italic;
}

.checkout-time-edit summary {
    color: var(--dh-primary);
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.checkout-time-edit summary::-webkit-details-marker {
    display: none;
}

.checkout-time-edit[open] summary {
    margin-bottom: .35rem;
}

.checkout-time-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.checkout-time-form .form-control {
    width: auto;
    min-width: 7rem;
}


/* Stato della struttura: interruttore nei moduli e badge "Disattivata" in elenco e dettaglio. */
.struttura-stato {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem 1rem;
    padding: .9rem 1rem;
    border: 1px solid #f0d9b5;
    border-radius: 14px;
    background: #fff8ec;
    transition: background-color .15s ease, border-color .15s ease;
}

.struttura-stato.is-on {
    border-color: #cfe5d8;
    background: #f1f8f4;
}

.struttura-stato .form-switch {
    min-height: 0;
    padding-left: 0;
}

.struttura-stato .form-switch .form-check-input {
    width: 3rem;
    height: 1.6rem;
    margin: 0;
    cursor: pointer;
}

.struttura-stato .form-switch .form-check-input:checked {
    border-color: #1f7a5a;
    background-color: #1f7a5a;
}

.struttura-stato-testo {
    flex: 1;
    min-width: 12rem;
}

.struttura-stato-titolo {
    display: block;
    margin-bottom: .15rem;
    font-weight: 800;
    cursor: pointer;
}

.struttura-stato-aiuto {
    color: #5b6b63;
    font-size: .85rem;
    line-height: 1.4;
}

.struttura-stato [data-stato-on] { display: none; }
.struttura-stato.is-on [data-stato-on] { display: revert; }
.struttura-stato.is-on [data-stato-off] { display: none; }
.struttura-stato.is-on span[data-stato-on].struttura-stato-badge { display: inline-flex; }

.struttura-stato-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    color: #146c43;
    background: #e3f4ea;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

.struttura-stato-badge::before {
    content: "";
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: currentColor;
}

.struttura-stato-badge.is-off {
    color: #8a5a00;
    background: #fdf0d5;
}

.struttura-disattivata .structure-thumb,
.struttura-disattivata .structure-thumb-placeholder,
.struttura-disattivata .card-img-top {
    filter: grayscale(1);
    opacity: .6;
}


/* Ricerca nella barra in alto (funzionalità e manuale): includes/ricerca_menu.html + js/ricerca-menu.js. */
.app-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.app-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: min(380px, 34vw);
}

.app-search-icon {
    position: absolute;
    left: .8rem;
    color: rgba(255, 255, 255, .7);
    pointer-events: none;
}

.app-search-input {
    width: 100%;
    height: 2.35rem;
    padding: 0 2.2rem 0 2.25rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    font-size: .9rem;
    outline: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.app-search-input::placeholder {
    color: rgba(255, 255, 255, .68);
}

.app-search-input:focus {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .18);
}

.app-search-input::-webkit-search-cancel-button {
    filter: invert(1);
}

.app-search-kbd {
    position: absolute;
    right: .7rem;
    padding: .05rem .4rem;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 6px;
    color: rgba(255, 255, 255, .75);
    background: transparent;
    font-size: .72rem;
    pointer-events: none;
}

.app-search-input:focus ~ .app-search-kbd {
    display: none !important;
}

.app-search-results {
    position: absolute;
    top: calc(100% + .45rem);
    left: 0;
    right: 0;
    z-index: 1060;
    max-height: min(70vh, 26rem);
    overflow-y: auto;
    padding: .35rem;
    border: 1px solid rgba(20, 35, 30, .1);
    border-radius: 14px;
    color: #1d2b25;
    background: #fff;
    box-shadow: 0 16px 40px rgba(10, 30, 25, .22);
}

.app-search-group {
    padding: .5rem .65rem .25rem;
    color: #6b7a72;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.app-search-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border-radius: 10px;
    color: inherit;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
}

.app-search-item .bi {
    color: #1f7a5a;
}

.app-search-item.is-active,
.app-search-item:focus {
    color: #0f5b4f;
    background: #eaf4ef;
}

.app-search-empty {
    padding: .75rem;
    color: #6b7a72;
    font-size: .88rem;
}

.app-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

@media (max-width: 991.98px) {
    /* Su mobile: icona lente accanto al menu; aperta, il campo va a capo a tutta larghezza. */
    .app-search {
        order: 1;
        margin-left: auto;
        margin-right: .5rem;
    }

    .app-search ~ .ms-auto {
        order: 2;
        margin-left: 0 !important;
    }

    .app-search-box {
        display: none;
    }

    .app-search.is-open {
        order: 3;
        flex: 0 0 100%;
        margin: .6rem 0 .1rem;
    }

    .app-search.is-open ~ .ms-auto {
        margin-left: auto !important;
    }

    .app-search.is-open .app-search-toggle {
        display: none;
    }

    .app-search.is-open .app-search-box {
        display: flex;
        width: 100%;
    }
}
