:root {
    --fmg-app-safe-top: env(safe-area-inset-top, 0px);
    --fmg-app-safe-right: env(safe-area-inset-right, 0px);
    --fmg-app-safe-bottom: env(safe-area-inset-bottom, 0px);
    --fmg-app-safe-left: env(safe-area-inset-left, 0px);
}

html,
body.fmg-app-mode {
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overscroll-behavior: none;
    background: #f5f2f8;
}

body.fmg-app-mode {
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

body.fmg-app-mode #wpadminbar,
body.fmg-app-mode > header,
body.fmg-app-mode > footer,
body.fmg-app-mode .site-header,
body.fmg-app-mode .site-footer,
body.fmg-app-mode .elementor-location-header,
body.fmg-app-mode .elementor-location-footer,
body.fmg-app-mode .ht-ctc-chat,
body.fmg-app-mode .cky-consent-container,
body.fmg-app-mode .cookie-law-info-bar,
body.fmg-app-mode .grecaptcha-badge,
body.fmg-app-mode .fmg-premium-footer,
body.fmg-app-mode #fmg-premium-footer,
body.fmg-app-mode .flamingo-premium-footer,
body.fmg-app-mode #flamingo-premium-footer,
body.fmg-app-mode [data-flamingo-premium-footer] {
    display: none !important;
}

.fmg-app-template-root,
.fmg-app-template-root > .fmg-app,
body.fmg-app-mode .fmg-app {
    min-height: 100vh;
    min-height: 100dvh;
}

body.fmg-app-mode .fmg-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

body.fmg-app-mode .fmg-sidebar {
    padding-top: max(24px, var(--fmg-app-safe-top));
    padding-bottom: max(18px, var(--fmg-app-safe-bottom));
}

body.fmg-app-mode .fmg-main {
    padding-top: max(26px, calc(18px + var(--fmg-app-safe-top)));
    padding-right: max(28px, calc(18px + var(--fmg-app-safe-right)));
    padding-bottom: max(32px, calc(20px + var(--fmg-app-safe-bottom)));
    padding-left: max(28px, calc(18px + var(--fmg-app-safe-left)));
}

body.fmg-app-mode .fmg-login-window {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(24px, var(--fmg-app-safe-top)) max(20px, var(--fmg-app-safe-right)) max(24px, var(--fmg-app-safe-bottom)) max(20px, var(--fmg-app-safe-left));
}

.fmg-app-offline {
    position: fixed;
    z-index: 1000000;
    top: var(--fmg-app-safe-top);
    left: 50%;
    width: min(620px, calc(100% - 32px));
    transform: translateX(-50%);
    border-radius: 0 0 14px 14px;
    padding: 10px 16px;
    background: #9a3412;
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.fmg-app-offline.is-online {
    background: #166534;
}

.fmg-app-readiness-panel {
    margin-top: 20px;
}

.fmg-app-readiness-panel h2 {
    margin-top: 0;
}

.fmg-app-url-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 6px 0 18px;
}

.fmg-app-url-row input {
    width: 100%;
    min-width: 0;
    border: 1px solid #ddd4e8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #faf8fc;
}

.fmg-app-capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.fmg-app-capability-grid span {
    display: block;
    border: 1px solid #e4ddec;
    border-radius: 12px;
    padding: 11px 13px;
    background: #fff;
}

/* Modalità app sulle pagine amministrative Flamingo. */
body.wp-admin.fmg-app-admin-mode {
    background: #f5f2f8 !important;
}

body.wp-admin.fmg-app-admin-mode #wpadminbar,
body.wp-admin.fmg-app-admin-mode #adminmenumain,
body.wp-admin.fmg-app-admin-mode #wpfooter,
body.wp-admin.fmg-app-admin-mode .update-nag,
body.wp-admin.fmg-app-admin-mode .notice:not(.fmg-notice):not(.notice-error):not(.notice-success),
body.wp-admin.fmg-app-admin-mode .screen-meta-toggle,
body.wp-admin.fmg-app-admin-mode #screen-meta {
    display: none !important;
}

body.wp-admin.fmg-app-admin-mode #wpcontent,
body.wp-admin.fmg-app-admin-mode #wpfooter {
    margin-left: 0 !important;
}

body.wp-admin.fmg-app-admin-mode #wpcontent {
    padding: 0 24px 32px !important;
}

body.wp-admin.fmg-app-admin-mode #wpbody-content {
    padding-top: 82px !important;
}

body.wp-admin.fmg-app-admin-mode .wrap {
    margin: 20px 0 0 !important;
    max-width: none;
}

body.wp-admin.fmg-app-admin-mode .wrap > h1:first-child,
body.wp-admin.fmg-app-admin-mode .wrap > h2:first-child {
    margin-top: 0;
}

.fmg-native-admin-bar {
    position: fixed;
    z-index: 100000;
    inset: 0 0 auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: max(8px, var(--fmg-app-safe-top)) max(18px, var(--fmg-app-safe-right)) 8px max(18px, var(--fmg-app-safe-left));
    border-bottom: 1px solid #ddd4e8;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    box-shadow: 0 6px 24px rgba(49, 20, 78, .08);
}

.fmg-native-admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2f1645;
    text-decoration: none;
}

.fmg-native-admin-brand img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.fmg-native-admin-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.fmg-native-admin-brand strong {
    font-size: 17px;
}

.fmg-native-admin-brand small {
    margin-top: 3px;
    color: #705b83;
}

.fmg-native-admin-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.fmg-native-connection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #166534;
    font-size: 13px;
    font-weight: 600;
}

.fmg-native-connection::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.fmg-native-connection.is-offline {
    color: #c2410c;
}

body.wp-admin.fmg-app-admin-mode .postbox,
body.wp-admin.fmg-app-admin-mode .stuffbox,
body.wp-admin.fmg-app-admin-mode .card {
    border-color: #e2d9eb;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(49, 20, 78, .06);
}

body.wp-admin.fmg-app-admin-mode #submitdiv,
body.wp-admin.fmg-app-admin-mode .postbox {
    overflow: hidden;
}

@media (max-width: 782px) {
    body.wp-admin.fmg-app-admin-mode #wpcontent {
        padding: 0 12px 24px !important;
    }

    body.wp-admin.fmg-app-admin-mode #wpbody-content {
        padding-top: 92px !important;
    }

    .fmg-native-admin-bar {
        align-items: flex-start;
        gap: 10px;
    }

    .fmg-native-admin-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .fmg-native-admin-actions .button {
        min-height: 36px;
    }

    .fmg-app-url-row,
    .fmg-app-capability-grid {
        grid-template-columns: 1fr;
    }
}

/* Flamingo Gestionale 0.21.9-beta — campi leggibili e login web su tela bianca */
body.fmg-app-mode .fmg-app input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
body.fmg-app-mode .fmg-app textarea,
body.fmg-app-mode .fmg-app select,
body.fmg-app-mode .fmg-login-window input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
body.fmg-app-mode .fmg-login-window textarea,
body.fmg-app-mode .fmg-login-window select,
body.wp-admin.fmg-app-admin-mode input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
body.wp-admin.fmg-app-admin-mode textarea,
body.wp-admin.fmg-app-admin-mode select {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
    color-scheme: light !important;
}

body.fmg-app-mode .fmg-app option,
body.fmg-app-mode .fmg-app optgroup,
body.fmg-app-mode .fmg-login-window option,
body.fmg-app-mode .fmg-login-window optgroup,
body.wp-admin.fmg-app-admin-mode option,
body.wp-admin.fmg-app-admin-mode optgroup {
    color: #111827 !important;
    background: #ffffff !important;
    -webkit-text-fill-color: #111827 !important;
}

body.fmg-app-mode .fmg-app input::placeholder,
body.fmg-app-mode .fmg-app textarea::placeholder,
body.fmg-app-mode .fmg-login-window input::placeholder,
body.fmg-app-mode .fmg-login-window textarea::placeholder,
body.wp-admin.fmg-app-admin-mode input::placeholder,
body.wp-admin.fmg-app-admin-mode textarea::placeholder {
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    opacity: 1 !important;
}

body.fmg-app-mode .fmg-app input:-webkit-autofill,
body.fmg-app-mode .fmg-app input:-webkit-autofill:hover,
body.fmg-app-mode .fmg-app input:-webkit-autofill:focus,
body.fmg-app-mode .fmg-login-window input:-webkit-autofill,
body.fmg-app-mode .fmg-login-window input:-webkit-autofill:hover,
body.fmg-app-mode .fmg-login-window input:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

body.fmg-app-mode input::-webkit-datetime-edit,
body.fmg-app-mode input::-webkit-datetime-edit-fields-wrapper,
body.fmg-app-mode input::-webkit-datetime-edit-text,
body.fmg-app-mode input::-webkit-datetime-edit-month-field,
body.fmg-app-mode input::-webkit-datetime-edit-day-field,
body.fmg-app-mode input::-webkit-datetime-edit-year-field,
body.fmg-app-mode input::-webkit-datetime-edit-hour-field,
body.fmg-app-mode input::-webkit-datetime-edit-minute-field {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

html:has(body.fmg-app-login-screen),
body.fmg-app-login-screen,
body.fmg-app-login-screen .fmg-app-template-root {
    background: #ffffff !important;
}

body.fmg-app-login-screen .fmg-app-template-root {
    min-height: 100vh;
    min-height: 100dvh;
}

body.fmg-app-login-screen .fmg-login-window {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    background: #ffffff !important;
}

body.fmg-app-login-screen .fmg-login-card {
    width: min(760px, 100%) !important;
}

/* 0.21.9 — fallback ad alta specificità per tutti i controlli del Gestionale. */
body.fmg-app-mode input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.fmg-app-mode textarea,
body.fmg-app-mode select,
body.wp-admin.fmg-app-admin-mode input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.wp-admin.fmg-app-admin-mode textarea,
body.wp-admin.fmg-app-admin-mode select {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
    text-shadow: none !important;
}

body.fmg-app-mode input:disabled,
body.fmg-app-mode textarea:disabled,
body.fmg-app-mode select:disabled,
body.fmg-app-mode input[readonly],
body.wp-admin.fmg-app-admin-mode input:disabled,
body.wp-admin.fmg-app-admin-mode textarea:disabled,
body.wp-admin.fmg-app-admin-mode select:disabled,
body.wp-admin.fmg-app-admin-mode input[readonly] {
    color: #4b5563 !important;
    -webkit-text-fill-color: #4b5563 !important;
    opacity: 1 !important;
}



/*
 * Flamingo Gestionale 0.21.14-beta — normalizzazione tipografica standalone.
 *
 * La shell dedicata carica wp_head() per gli asset WordPress, quindi un tema
 * a blocchi può applicare dimensioni globali molto grandi a titoli e testi non
 * esplicitamente dimensionati. Queste regole sono limitate al contenuto del
 * Gestionale autenticato e non modificano la schermata di login.
 */
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main {
    font-size: 14px;
    line-height: 1.45;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h1 {
    font-size: 26px;
    line-height: 1.18;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h2 {
    font-size: 18px;
    line-height: 1.25;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h3 {
    font-size: 16px;
    line-height: 1.3;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h4,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h5,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h6 {
    font-size: 14px;
    line-height: 1.35;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main p,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main li,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main dt,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main dd,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main label,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main input,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main select,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main textarea,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main button {
    font-size: 14px;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main table td {
    font-size: 13px;
}

body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main table th {
    font-size: 12px;
}

@media (max-width: 782px) {
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main {
        font-size: 13px;
    }

    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h1 {
        font-size: 23px;
    }

    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h2 {
        font-size: 17px;
    }

    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main h3 {
        font-size: 15px;
    }

    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main p,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main li,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main dt,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main dd,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main label,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main input,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main select,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main textarea,
    body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-main button {
        font-size: 13px;
    }
}


/* Flamingo Gestionale 0.21.15-beta — menu laterale più compatto. */
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-nav-item {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 13px !important;
    line-height: 1.25;
}
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-admin-links > span {
    font-size: 10px !important;
    letter-spacing: .10em;
}
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-admin-links a {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12px !important;
    line-height: 1.25;
}
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-nav-item svg,
body.fmg-app-mode.fmg-app-authenticated #fmg-app-root .fmg-admin-links a svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

/* Firebase / notifiche push Android */
.fmg-push-settings-panel{margin-top:24px}.fmg-push-settings-panel .fmg-form-grid{margin-top:20px}.fmg-push-settings-panel input[type=file],.fmg-push-settings-panel input[type=text]{width:100%;min-height:46px;padding:10px 12px;border:1px solid #ddd2e6;border-radius:12px;background:#fff;color:#18121f}.fmg-push-settings-panel .fmg-inline-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.fmg-push-settings-panel .fmg-inline-actions form{margin:0}.fmg-push-settings-panel small,.fmg-push-settings-panel .fmg-muted{display:block;color:#6f6477;margin-top:6px}.fmg-push-settings-panel .fmg-btn-danger{background:#fff0f0;border:1px solid #e6bcbc;color:#7a1f1f}

/*
 * Flamingo Gestionale 2.0.38 — liste operative unificate e rifinite.
 * Web, client Windows e Android usano lo stesso elenco continuo espandibile.
 */
body.fmg-app-mode .fmg-inventory-section,
body.fmg-app-mode .fmg-inventory-table-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.fmg-app-mode .fmg-compact-source-hidden {
    display: none !important;
}

body.fmg-app-mode .fmg-compact-list {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e8deeb;
    border-radius: 15px;
    background: #fff;
}

body.fmg-app-mode .fmg-compact-list-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid #eee7f0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

body.fmg-app-mode .fmg-compact-list-card:last-child {
    border-bottom: 0;
}

body.fmg-app-mode .fmg-compact-list-card.is-overdue {
    box-shadow: inset 3px 0 0 #d98c85;
}

body.fmg-app-mode .fmg-compact-list-toggle {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 30px !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    box-shadow: none !important;
    text-align: left !important;
    font: inherit !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: background .16s ease;
}

body.fmg-app-mode .fmg-compact-list-toggle:hover,
body.fmg-app-mode .fmg-compact-list-toggle:focus-visible,
body.fmg-app-mode .fmg-compact-list-card.is-open .fmg-compact-list-toggle {
    background: #faf7fb !important;
}

body.fmg-app-mode .fmg-compact-list-toggle:focus-visible {
    outline: 2px solid rgba(104, 43, 124, .28) !important;
    outline-offset: -2px;
}

body.fmg-app-mode .fmg-compact-list-summary {
    display: block;
    min-width: 0;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.fmg-app-mode .fmg-compact-list-chevron {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f7f2f8;
    color: #682b7c !important;
    font-size: 22px !important;
    font-weight: 600;
    line-height: 1;
    transition: transform .18s ease, background .18s ease;
}

body.fmg-app-mode .fmg-compact-list-card.is-open .fmg-compact-list-chevron {
    transform: rotate(90deg);
    background: #eee5f0;
}

body.fmg-app-mode .fmg-compact-list-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    width: 100%;
    min-width: 0;
    padding: 4px 16px 16px;
    border-top: 1px solid #eee7f0;
    background: #fff;
}

body.fmg-app-mode .fmg-compact-list-details[hidden] {
    display: none !important;
}

body.fmg-app-mode .fmg-compact-list-detail {
    display: grid;
    grid-template-columns: minmax(105px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid #f3eef4;
}

body.fmg-app-mode .fmg-compact-list-label {
    color: #746979 !important;
    -webkit-text-fill-color: #746979 !important;
    font-size: 10px !important;
    line-height: 1.35;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}

body.fmg-app-mode .fmg-compact-list-value,
body.fmg-app-mode .fmg-compact-list-value * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

body.fmg-app-mode .fmg-compact-list-value {
    color: #111827;
    font-size: 12px;
    line-height: 1.45;
}

body.fmg-app-mode .fmg-compact-list-value small {
    display: block;
    margin-top: 3px;
}

body.fmg-app-mode .fmg-compact-list-actions {
    grid-column: 1 / -1;
    padding-top: 13px;
}

body.fmg-app-mode .fmg-compact-list-actions-content,
body.fmg-app-mode .fmg-compact-list-actions-content .fmg-row-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100%;
    min-width: 0;
}

body.fmg-app-mode .fmg-compact-list-actions a,
body.fmg-app-mode .fmg-compact-list-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid #ded5e6 !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: normal !important;
}

body.fmg-app-mode .fmg-compact-list-actions a:hover,
body.fmg-app-mode .fmg-compact-list-actions button:hover {
    background: #f5eff6 !important;
    border-color: #cdbbd2 !important;
}

body.fmg-app-mode .fmg-compact-list-actions form {
    display: inline-flex !important;
    margin: 0 !important;
}

/* Evita che filtri e intestazioni forzino lo spostamento orizzontale. */
body.fmg-app-mode .fmg-card-section-head {
    min-width: 0;
    max-width: 100%;
}

body.fmg-app-mode .fmg-card-section-head > * {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    body.fmg-app-mode .fmg-compact-list-details {
        grid-template-columns: minmax(0, 1fr);
    }

    body.fmg-app-mode .fmg-inventory-filter-form,
    body.fmg-app-mode .fmg-events-search-form,
    body.fmg-app-mode .fmg-task-filter-form,
    body.fmg-app-mode .fmg-costs-filter-form {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.fmg-app-mode .fmg-card-section-head {
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    body.fmg-app-mode .fmg-compact-list-toggle {
        min-height: 54px !important;
        padding: 12px 13px !important;
    }

    body.fmg-app-mode .fmg-compact-list-details {
        padding: 3px 13px 13px;
    }

    body.fmg-app-mode .fmg-compact-list-detail {
        grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
        gap: 10px;
    }
}


/* =========================================================
 * 2.0.77 — Stato Richieste visibile prima dell'apertura
 * Linguaggio visivo coerente con i badge informativi HACCP.
 * ========================================================= */
body.fmg-app-mode .fmg-compact-list-summary-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex-wrap: wrap;
}

body.fmg-app-mode .fmg-compact-list-summary-text {
    display: flex;
    flex: 1 1 240px;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

body.fmg-app-mode .fmg-compact-list-summary-wrap .fmg-compact-list-summary {
    flex: 0 1 auto;
}

body.fmg-app-mode .fmg-compact-list-secondary {
    display: block;
    min-width: 0;
    color: #756b79 !important;
    -webkit-text-fill-color: #756b79 !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
    font-weight: 400 !important;
    overflow-wrap: anywhere;
}

body.fmg-app-mode .fmg-request-glance-status,
body.fmg-app-mode .fmg-event-glance-payment,
body.fmg-app-mode .fmg-tax-glance-status {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 26px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    box-sizing: border-box;
}

body.fmg-app-mode .fmg-request-glance-status.is-neutral {
    background: #f3f4f6;
    color: #4b5563 !important;
    -webkit-text-fill-color: #4b5563 !important;
}

body.fmg-app-mode .fmg-request-glance-status.is-info,
body.fmg-app-mode .fmg-event-glance-payment.is-info,
body.fmg-app-mode .fmg-tax-glance-status.is-info {
    background: #e0f2fe;
    color: #0369a1 !important;
    -webkit-text-fill-color: #0369a1 !important;
}

body.fmg-app-mode .fmg-request-glance-status.is-success,
body.fmg-app-mode .fmg-event-glance-payment.is-success,
body.fmg-app-mode .fmg-tax-glance-status.is-success {
    background: #dcfce7;
    color: #166534 !important;
    -webkit-text-fill-color: #166534 !important;
}

body.fmg-app-mode .fmg-request-glance-status.is-danger,
body.fmg-app-mode .fmg-event-glance-payment.is-danger,
body.fmg-app-mode .fmg-tax-glance-status.is-danger {
    background: #fee2e2;
    color: #991b1b !important;
    -webkit-text-fill-color: #991b1b !important;
}

body.fmg-app-mode .fmg-request-glance-status.is-warning,
body.fmg-app-mode .fmg-tax-glance-status.is-warning {
    background: #ffedd5;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
}

body.fmg-app-mode .fmg-compact-list-card.has-payment-danger {
    box-shadow: inset 3px 0 0 #dc2626;
}

body.fmg-app-mode .fmg-compact-list-card.has-payment-info {
    box-shadow: inset 3px 0 0 #0284c7;
}

body.fmg-app-mode .fmg-compact-list-card.has-payment-success {
    box-shadow: inset 3px 0 0 #16a34a;
}

@media (max-width: 680px) {
    body.fmg-app-mode .fmg-compact-list-summary-wrap {
        gap: 7px;
    }

    body.fmg-app-mode .fmg-request-glance-status,
    body.fmg-app-mode .fmg-event-glance-payment,
    body.fmg-app-mode .fmg-tax-glance-status {
        font-size: .72rem;
    }
}


/* 2.1.29 — MOD: evidenza completa della riga assegnata anche nella lista compatta. */
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row {
    background: #e9f7ec !important;
    box-shadow: inset 4px 0 0 #3f8f52 !important;
}
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row .fmg-compact-list-toggle {
    background: #e9f7ec !important;
}
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row .fmg-compact-list-toggle:hover,
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row .fmg-compact-list-toggle:focus-visible,
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row.is-open .fmg-compact-list-toggle {
    background: #e1f3e5 !important;
}
body.fmg-app-mode .fmg-compact-list-card.fmg-mod-assigned-row .fmg-compact-list-details {
    background: #f5fbf6 !important;
}
body.fmg-app-mode .fmg-compact-list-summary-wrap .fmg-mod-assigned-badge {
    margin-left: auto;
}


/* 2.1.82 — Preventivi multipli nella Richiesta */
body.fmg-app-mode .fmg-request-linked-quotes-list { display:flex; flex-direction:column; gap:6px; }
body.fmg-app-mode .fmg-request-linked-quotes-list > a,
body.fmg-app-mode .fmg-request-linked-quotes-list > span { display:flex; flex-direction:column; gap:1px; text-decoration:none; color:inherit; }
body.fmg-app-mode .fmg-request-linked-quotes-list small { display:block; color:#756b79; font-weight:400; font-size:11px; }

/* 2.1.83 — Preventivi associati nelle Richieste */
.fmg-request-quote-associations{margin:0 0 18px;padding:16px;border:1px solid rgba(143,93,143,.20);border-radius:18px;background:rgba(255,255,255,.72)}
.fmg-request-quote-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.fmg-request-quote-head h3{margin:2px 0 0;font-size:18px}.fmg-request-quote-count{display:inline-flex;min-width:28px;height:28px;align-items:center;justify-content:center;border-radius:999px;background:#f3ebf3;color:#6d3f6d;font-weight:700}
.fmg-request-quote-current{display:flex;flex-direction:column;gap:8px}.fmg-request-quote-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(143,93,143,.16);border-radius:14px;background:#fff}.fmg-request-quote-copy{display:flex;min-width:0;flex-direction:column;gap:2px}.fmg-request-quote-copy strong{font-size:14px}.fmg-request-quote-copy small,.fmg-request-quote-help{color:#756b79;font-size:11px}.fmg-request-quote-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.fmg-request-quote-actions form{margin:0}.fmg-btn-small{min-height:34px;padding:7px 10px;font-size:12px}
.fmg-request-quote-add{margin-top:12px}.fmg-request-quote-add>summary{cursor:pointer;display:inline-flex;align-items:center;gap:6px;color:#7f4e80;font-weight:700;list-style:none}.fmg-request-quote-add>summary::-webkit-details-marker{display:none}.fmg-request-quote-available{display:flex;flex-direction:column;gap:7px;max-height:360px;overflow:auto;margin-top:10px;padding-right:4px}.fmg-request-quote-option{margin:0}.fmg-request-quote-option button{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title action" "meta action";align-items:center;gap:2px 12px;text-align:left;padding:10px 12px;border:1px solid rgba(143,93,143,.16);border-radius:13px;background:#fff;cursor:pointer}.fmg-request-quote-option button:hover{border-color:rgba(143,93,143,.42);background:#fcf8fc}.fmg-request-quote-option strong{grid-area:title;font-size:14px}.fmg-request-quote-option small{grid-area:meta;color:#756b79;font-size:11px}.fmg-request-quote-option span{grid-area:action;color:#7f4e80;font-weight:700;font-size:12px}.fmg-request-quote-help{display:block;margin-top:10px}
@media(max-width:680px){.fmg-request-quote-row{align-items:flex-start;flex-direction:column}.fmg-request-quote-actions{width:100%}.fmg-request-quote-option button{grid-template-columns:1fr;grid-template-areas:"title" "meta" "action"}.fmg-request-quote-option span{margin-top:4px}}
