/* Shell desktop: densita maggiore, hover e navigazione laterale persistente. */
body.cfo-ui-desktop {
    --cfo-control-min-height: 38px;
    --cfo-touch-gap: 8px;
    --cfo-desktop-content-gap: clamp(20px, 2vw, 32px);
    --cfo-desktop-focus: #0b57d0;
}

body.cfo-ui-desktop .btn,
body.cfo-ui-desktop .form-control,
body.cfo-ui-desktop .form-select {
    min-height: var(--cfo-control-min-height);
}

body.cfo-ui-desktop :is(
    .area-home-section-heading > .btn,
    .area-home-source-actions .btn,
    .area-home-relink-form .btn,
    .cfo-source-file-buttons .btn,
    .cfo-source-file-bar .cfo-relink-source-controls .btn
) {
    min-height: 28px;
}

body.cfo-ui-desktop :is(
    .area-home-relink-form .form-control,
    .cfo-source-file-bar .cfo-relink-source-controls .form-control
) {
    min-height: 28px;
    height: 28px;
}

body.cfo-ui-desktop .app-wrapper > .main-content,
body.cfo-ui-desktop .wrapper > #content,
body.cfo-ui-desktop > .d-flex > main,
body.cfo-ui-desktop > .d-flex > .flex-grow-1 {
    padding: var(--cfo-desktop-content-gap) !important;
}

body.cfo-ui-desktop .page-title-card {
    min-height: 148px;
}

body.cfo-ui-desktop .page-client-context {
    min-width: 260px;
}

body.cfo-ui-desktop .btn,
body.cfo-ui-desktop .form-control,
body.cfo-ui-desktop .form-select,
body.cfo-ui-desktop .nav-link,
body.cfo-ui-desktop summary {
    transition: border-color .15s ease, box-shadow .15s ease,
        background-color .15s ease, color .15s ease, transform .15s ease;
}

body.cfo-ui-desktop :where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cfo-desktop-focus) 38%, transparent);
    outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--cfo-desktop-focus);
}

body.cfo-ui-desktop .table-responsive,
body.cfo-ui-desktop .annual-progression-scroll,
body.cfo-ui-desktop .finance-preview-table-wrap {
    scrollbar-gutter: stable;
}

@media (min-width: 781px) {
    body.cfo-ui-desktop .app-sidebar .nav-link:hover {
        transform: translateX(2px);
    }

    body.cfo-ui-desktop .sidebar-mobile-backdrop {
        display: none !important;
    }
}

@media (min-width: 781px) and (max-width: 1440px) {
    body.cfo-ui-desktop {
        --cfo-sidebar-width: 260px;
    }

    body.cfo-ui-desktop .page-title-card {
        grid-template-columns: minmax(0, 1fr) minmax(230px, 285px);
    }

    body.cfo-ui-desktop .page-client-context {
        min-width: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.cfo-ui-desktop *,
    body.cfo-ui-desktop *::before,
    body.cfo-ui-desktop *::after {
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
