/* =========================================================================
   WM DESIGN SYSTEM – v2.0
   Aggiornamento estetico – tutti i nomi di classe originali mantenuti
   ========================================================================= */

/* --------------------------- 2. COLORI & TOKENS -------------------------- */
:root {
    --wm-font: 'DM Sans', system-ui, sans-serif;
    --wm-color-text: #1f2937;
    --wm-color-muted: #6b7280;
    --wm-color-border: #e2e8f0;
    --wm-color-surface: #ffffff;
    --wm-color-bg: #f8fafc;
    --wm-color-shadow: rgba(0, 0, 0, .05);
    --wm-danger: #cc0000;
    --wm-accent-blue: #1e3a8a;
    --wm-accent-red: #cc0000;
    --wm-accent-tesori: #2a7a88;
    --wm-accent-eff: #d89200;
    --wm-accent-vita: #b4311f;
    --wm-info: #0277bd;
    --wm-info-dk: #01579b;
    --wm-spacing-xs: 4px;
    --wm-spacing-sm: 8px;
    --wm-spacing-md: 12px;
    --wm-spacing-lg: 16px;
    --wm-radius-sm: 6px;
    --wm-radius-md: 8px;
    --wm-radius-lg: 12px;
    --wm-radius-pill: 20px;
}

/* --------------------------- 3. RESET BASE ------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body, input, button, select, textarea {
    font-family: var(--wm-font);
}

/* --------------------------- 4. LAYOUT BASE ------------------------------ */
.wm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.wm-section {
    margin-bottom: 14px;
}

/* --------------------------- 5. CARD ------------------------------------ */
.wm-card {
    background: var(--wm-color-surface);
    border: 0.5px solid var(--wm-color-border);
    border-radius: var(--wm-radius-lg);
    box-shadow: 0 1px 4px var(--wm-color-shadow);
}

.wm-card-body {
    padding: 16px 20px;
}

/* --------------------------- 6. TIPOGRAFIA ------------------------------ */
.wm-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--wm-color-text);
    letter-spacing: -.01em;
}

.wm-subtitle {
    font-size: .95rem;
    color: var(--wm-color-text);
    margin: 6px 0 10px;
}

.wm-text-danger {
    color: var(--wm-danger);
}

.wm-text-muted {
    color: var(--wm-color-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .03em;
    display: block;
    margin-bottom: 3px;
}

/* --------------------------- 7. SEPARATORI ------------------------------ */
.wm-hr,
.wm-card hr {
    border: 0;
    border-top: 0.5px solid var(--wm-color-border);
    margin: 12px 0;
}

.wm-hr2,
.wm-card hr {
    border: 0;
    border-top: 0.5px solid var(--wm-color-border);
    margin: 10px 0;
    max-width: 250px;
    width: auto;
    margin-left: 0;
    margin-right: auto;
    align-self: flex-start;
}



/* --------------------------- 8. TOOLBAR (Inserisci / Modifica / ...) ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--wm-color-bg);
    border-bottom: 0.5px solid var(--wm-color-border);
    border-radius: var(--wm-radius-lg) var(--wm-radius-lg) 0 0;
    flex-wrap: wrap;
}

    /* Bottoni toolbar Bootstrap rimappati */
    .toolbar .btn {
        height: 30px;
        padding: 0 16px;
        font-size: 12px;
        font-weight: 500;
        border-radius: var(--wm-radius-sm);
        border: 0.5px solid var(--wm-color-border);
        background: var(--wm-color-surface);
        color: var(--wm-color-text);
        cursor: pointer;
        transition: background .12s, border-color .12s;
        line-height: 28px;
        font-family: var(--wm-font);
    }

        .toolbar .btn:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

    .toolbar .btn-primary {
        background: var(--wm-accent-blue);
        color: #fff;
        border-color: var(--wm-accent-blue);
    }

        .toolbar .btn-primary:hover {
            background: #1e40af;
            border-color: #1e40af;
        }

    .toolbar .btn-secondary {
        background: var(--wm-color-surface);
        color: var(--wm-color-text);
    }

    .toolbar .btn-accent {
        background: var(--wm-color-surface);
        color: var(--wm-color-muted);
    }

        .toolbar .btn-accent.disabled,
        .toolbar .btn:disabled {
            opacity: .4;
            cursor: not-allowed;
            pointer-events: none;
        }

/* --------------------------- 9. SECTION CHIP ---------------------------- */
.section-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wm-accent-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--wm-radius-pill);
    margin-bottom: 14px;
}

.chip-icon {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,.6);
    border-radius: 50%;
}

/* --------------------------- 10. BREADCRUMB / NAV DATA ----------------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.crumb-link {
    height: 28px;
    padding: 0 12px;
    border-radius: var(--wm-radius-sm);
    border: 0.5px solid var(--wm-color-border);
    background: var(--wm-color-surface);
    color: var(--wm-color-text);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background .12s;
    font-family: var(--wm-font);
}

    .crumb-link:hover {
        background: #f1f5f9;
    }

/* --------------------------- 11. FORM ROWS ------------------------------ */
.wm-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

    .wm-form-row + .wm-form-row {
        margin-top: var(--wm-spacing-sm);
    }

.wm-form-col {
    flex: 1 1 0;
    min-width: 0;
}

.wm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

    .wm-row + .wm-row {
        margin-top: var(--wm-spacing-sm);
    }

.wm-col-apri {
    flex: 0 0 74px;
    text-align: center;
}

.wm-col-label {
    flex: 0 0 150px;
    text-align: right;
}

.wm-col-label-tight {
    flex: 0 0 120px;
    text-align: right;
}

.wm-col-field {
    flex: 1 1 0;
    min-width: 180px;
}

.wm-col-fixed {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .wm-col-label,
    .wm-col-label-tight {
        flex: 1 1 100%;
        text-align: left;
        margin-top: 2px;
    }

    .wm-col-field {
        flex-basis: 100%;
    }
}

/* --------------------------- 12. INPUT ---------------------------------- */
.wm-input {
    width: 100%;
    padding: 0 10px;
    height: 32px;
    border: 0.5px solid #cbd5e1;
    border-radius: var(--wm-radius-md);
    font-size: .9rem;
    color: var(--wm-color-text);
    background: var(--wm-color-surface);
    font-family: var(--wm-font);
    transition: border-color .15s;
    outline: none;
}

    .wm-input:focus {
        border-color: var(--wm-accent-blue);
        box-shadow: 0 0 0 3px rgba(30, 58, 138, .08);
    }

    .wm-input[readonly] {
        background: #f8fafc;
        color: #64748b;
        cursor: default;
    }

.wm-input-narrow {
    width: 210px;
}

.wm-input--multiline {
    min-height: 38px;
    resize: vertical;
}

/* --------------------------- 13. PULSANTI BASE -------------------------- */
.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid transparent;
    border-radius: var(--wm-radius-md);
    padding: 0 12px;
    height: 32px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    background: #334155;
    color: #fff;
    font-family: var(--wm-font);
    transition: background .12s;
}

    .wm-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.wm-btn-danger {
    background: #c62828;
    border-color: #b71c1c;
}

.wm-btn-info {
    background: var(--wm-info);
    border-color: var(--wm-info-dk);
}

.wm-btn-outline {
    background: #fff;
    color: #444;
    border-color: #cbd5e1;
}

.wm-btn-link {
    background: transparent;
    color: #1f6feb;
    padding: 0;
    border: none;
}

.wm-btn-compact {
    min-height: 28px;
    height: 28px;
    line-height: 1;
    padding: 0 10px;
}

.wm-btn-apri {
    min-width: 70px;
}

/* --------------------------- 14. PULSANTE MODERNO (APRI) --------------- */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--wm-radius-md);
    border: 0.5px solid #cbd5e1;
    background: var(--wm-color-surface);
    color: var(--wm-color-text);
    cursor: pointer;
    font-family: var(--wm-font);
    transition: background .12s, border-color .12s;
    white-space: nowrap;
}

    .btn-modern:hover {
        background: #f1f5f9;
        border-color: #94a3b8;
    }

    .btn-modern:active {
        background: #e2e8f0;
        transform: translateY(1px);
    }

    .btn-modern:focus-visible {
        outline: 2px solid var(--wm-accent-blue);
        outline-offset: 2px;
    }

    .btn-modern:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.btn-w-70 {
    width: 70px;
}

.btn-w-50 {
    width: 50px;
}

/* Uniforma il pulsante preghiera finale */
#bt_ApriListaPregFin {
    height: 28px !important;
    width: 70px !important;
    padding: 0 12px !important;
}

/* --------------------------- 15. TABELLE -------------------------------- */
.wm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--wm-radius-md);
}

.wm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

    .wm-table th,
    .wm-table td {
        border: 0.5px solid var(--wm-color-border);
        padding: 8px 10px;
        vertical-align: middle;
    }

    .wm-table thead th {
        background: #f8fafc;
        font-weight: 600;
        font-size: .8rem;
        letter-spacing: .04em;
        color: var(--wm-color-muted);
        text-transform: uppercase;
    }

    .wm-table tbody tr:hover {
        background: #f8fafc;
    }

    .wm-table tbody tr:nth-child(odd) {
        background: #fcfcfc;
    }

.wm-row-selected {
    background: #dbeafe !important;
    color: var(--wm-accent-blue);
}

.wm-table-min td,
.wm-table-min th {
    padding: 0 4px;
    line-height: 1;
    vertical-align: middle;
}


    /* comprime TUTTO il contenuto delle celle */
    .wm-table-min td * {
        line-height: 1 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* comando "Apri" (CommandField) */
    .wm-table-min td a,
    .wm-table-min td input {
        display: inline-block;
        padding: 0 4px !important;
        line-height: 1 !important;
        font-size: inherit;
    }

.wm-table-min > :not(caption) > * > * {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    line-height: 1.25 !important;
}

.wm-table-title {
    color: #c62828; /* rosso elegante (non aggressivo) */
    text-align: center;
    font-weight: 600;
    margin: 4px 0 8px 0; /* poco spazio sopra, giusto sotto */
}

/* ==========================
   DiscorsiOUT – Grid compatta con pager sano
   ========================== */

.wm-table-discorsiout {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    /* Celle compatte */
    .wm-table-discorsiout th,
    .wm-table-discorsiout td {
        padding: 4px 6px;
        line-height: 1.3;
        vertical-align: middle;
        white-space: nowrap;
    }

    /* Header */
    .wm-table-discorsiout th {
        font-weight: 600;
    }

    /* Pager SEMPRE visibile */
    .wm-table-discorsiout .aspNetPager,
    .wm-table-discorsiout tr.aspNetPagerRow td {
        padding: 6px 4px;
        text-align: center;
        line-height: 1.4;
    }

    /* Link pager */
    .wm-table-discorsiout a,
    .wm-table-discorsiout input {
        padding: 4px 6px;
        min-height: 24px;
        display: inline-block;
    }

/* --------------------------- 16. ACCENTI -------------------------------- */
.wm-accent-blue {
    color: var(--wm-accent-blue);
    font-weight: 600;
}

.wm-accent-red {
    color: var(--wm-accent-red);
    font-weight: 600;
}

.wm-accent-eff {
    color: var(--wm-accent-eff);
    font-weight: 600;
}



/* --------------------------- 17. A11Y ----------------------------------- */
.wm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* --------------------------- 18. SPAZIATURE ----------------------------- */
.wm-row-gap-sm {
    margin-top: var(--wm-spacing-sm);
}

.wm-row-gap-md {
    margin-top: var(--wm-spacing-md);
}

.wm-row-gap-lg {
    margin-top: var(--wm-spacing-lg);
}

/* --------------------------- 19. IMG ------------------------------------ */
.wm-img-fluid {
    max-width: 100%;
    height: auto;
}

/* =========================================================================
   20. PANEL TESORI
   ========================================================================= */
.tesori-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .tesori-row .wm-input {
        flex: 1 1 auto;
        min-width: 0;
    }

.pnl-tesori .efficaci-duo {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}


#pnlTesori {
    background: var(--wm-color-surface);
}

/* Sezione interna "Lettura biblica" */
.section-divider {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wm-color-muted);
    margin: 14px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-divider::after {
        content: '';
        flex: 1;
        height: 0.5px;
        background: var(--wm-color-border);
    }

/* =========================================================================
   21. PANEL EFFICACI
   ========================================================================= */
.pnl-efficaci {
    margin-top: 14px;
}

    .pnl-efficaci label,
    .pnl-efficaci .wm-text-muted {
        font-size: 11px;
        font-weight: 500;
        color: var(--wm-color-muted);
        margin: 0 0 3px 0;
        display: block;
        letter-spacing: .03em;
    }

.efficaci-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

    .efficaci-row .wm-input {
        flex: 1 1 auto;
        min-width: 0;
    }

.efficaci-duo {
    display: flex;
    gap: 5px;
    align-items: flex-start;
}

    .efficaci-duo .efficaci-block {
        flex: 1 1 0;
        min-width: 0;
    }

.efficaci-block {
    min-width: 0;
}

@media (max-width: 768px) {
    .efficaci-duo {
        flex-direction: column;
        gap: 5px;
    }

    .pnl-tesori .efficaci-duo {
        flex-direction: column;
    }
}

/* Icona email */
.invio-email {
    width: 40px !important;
    height: auto !important;
    object-fit: contain !important;
}

/* =========================================================================
   22. VITA CRISTIANA
   ========================================================================= */
.vc-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 12px;
}

.vc-col {
    flex: 1 1 45%;
    min-width: 260px;
}

.vc-cantico {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px;
}

    .vc-cantico input {
        width: 50px !important;
    }

.vc-min,
.vc-min-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .vc-min input {
        width: 40px !important;
        text-align: center;
    }

.vc-final-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .vc-row {
        flex-direction: column;
        gap: 8px;
    }

    .vc-col {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .vc-final-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

#PnlVitaCR4 .vc-cantico input {
    width: 50px !important;
}

#PnlVitaCR4 .vc-cantico {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#PnlVitaCR4 .vc-col div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* =========================================================================
   23. SECTION CARD (wrapper section interna)
   ========================================================================= */
.section-card {
    padding: 16px 20px;
}

/* =========================================================================
   24. RESPONSIVE GLOBALE
   ========================================================================= */
@media (max-width: 575.98px) {
    .wm-card-body {
        padding: 12px;
    }

    .section-card {
        padding: 12px;
    }

    .toolbar {
        padding: 8px 12px;
        gap: 6px;
    }

        .toolbar .btn {
            font-size: 11px;
            padding: 0 10px;
        }
}

/* =================================================================================
   PATCH – Migliorie layout Vita Cristiana (Cantico / Parti / Minuti / Preghiera)
   ================================================================================= */

/* 1) Riduce lo spazio tra “Cantico” e la textbox (iniziale e finale) */
#PnlVitaCR .efficaci-row,
#PnlVitaCR4 .efficaci-row {
    margin-bottom: 4px !important; /* invece di 12px inline */
}

/* Riduce lo spazio tra label .wm-text-muted e il relativo campo */
#PnlVitaCR .wm-text-muted,
#PnlVitaCR4 .wm-text-muted {
    margin-bottom: 2px !important;
}

/* 2) Meno spazio tra il titolo della parte (section-divider) e il blocco Conduttore */
#PnlVitaCR .section-divider {
    margin-bottom: 6px !important; /* era 10px */
}

#PnlVitaCR .wm-form-row {
    margin-top: 4px !important; /* era 10px inline */
}

/* 3) Riduzione spazi verticali tra etichetta Conduttore/Lettore e textbox */
#PnlVitaCR .wm-form-row,
#PnlVitaCR3 .wm-form-row,
#PnlVitaCR2 .wm-form-row {
    gap: 2px !important;
}

/* 4) Allinea correttamente il blocco “Minuti” agli altri campi */
#PnlVitaCR .efficaci-row,
#PnlVitaCR2 .efficaci-row,
#PnlVitaCR3 .efficaci-row {
    align-items: center !important;
}

#PnlVitaCR .wm-form-row,
#PnlVitaCR2 .wm-form-row,
#PnlVitaCR3 .wm-form-row {
    align-items: flex-start !important;
}

/* Sistema la casella minuti troppo “bassa” */
#PnlVitaCR input[ID*="txtMin"],
#PnlVitaCR2 input[ID*="txtMin"],
#PnlVitaCR3 input[ID*="txtMin"] {
    margin-top: 2px !important;
}

/* 5) Cantico finale e Preghiera finale affiancati correttamente */
#PnlVitaCR4 .efficaci-duo {
    display: flex !important;
    flex-direction: row !important;
    gap: 26px !important;
    align-items: flex-start !important;
}

/* Uniforma i due blocchi */
#PnlVitaCR4 .efficaci-block {
    flex: 1 1 0 !important;
}

/* Mini-fix: l’input dei cantici è molto stretto, centratura migliore */
#PnlVitaCR4 input[ID*="txtCantFin"],
#PnlVitaCR input[ID*="txtCant"] {
    text-align: center !important;
}

/* ============================================================
   TITOLI SEZIONE – Nuovo stile uniforme
   ============================================================ */

.section-title-base {
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 12px 6px 36px;
    border-radius: 20px;
    border: 2px solid transparent;
    display: block; /* importantissimo per non avere testo di lato */
    position: relative;
    margin-bottom: 10px !important; /* spazio giusto verso il contenuto */
}

    /* Icona generica */
    .section-title-base::before {
        content: "";
        position: absolute;
        left: 10px;
        top: 50%;
        width: 20px;
        height: 20px;
        transform: translateY(-50%);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

/* ===========================================
   ✅ DISCORSO PUBBLICO 
   =========================================== */
.section-title-disc {
    color:darkslateblue !important;
    border-color:darkblue !important;
}

    
/* ===========================================
   ✅ TESORI — deve essere TURCHESE
   =========================================== */
.section-title-tesori {
    color: #2a7a88 !important;
    border-color: #2a7a88 !important;
}

    .section-title-tesori::before {
        background-image: url("/images/VitaCR/Tesori.jpg");
    }

/* ===========================================
   ✅ EFFICACI — deve essere GIALLO
   =========================================== */
.section-title-efficaci {
    color: #d89200 !important;
    border-color: #d89200 !important;
}

    .section-title-efficaci::before {
        background-image: url("/images/VitaCR/Efficaci.jpg");
    }

/* ===========================================
   ✅ VITA CRISTIANA (già giusto)
   =========================================== */
.section-title-vita-cristiana {
    color: #b4311f;
    border-color: #b4311f;
}

    .section-title-vita-cristiana::before {
        background-image: url("/images/VitaCR/VitaCR.jpg");
    }


/* ============================================================
   SPACING & LAYOUT – aggiornati
   ============================================================ */

/* Spazi costanti tra i pannelli */
.wm-section {
    margin-top: 22px !important;
    margin-bottom: 22px !important;
}

/* Layout righe */
.efficaci-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Layout duo */
.efficaci-duo {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 12px;
}

.efficaci-block {
    flex: 1 1 230px;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   FIX SPECIFICO – Studio Biblico ↔ Lettore
   ============================================================ */

#PnlVitaCR3 .efficaci-duo {
    align-items: flex-start !important;
}

/* ============================================================
   NUOVA GRIGLIA MODERNA PER I FORMS
   ============================================================ */

.form-row {
    display: flex;
    gap: 28px;
    margin-top: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* colonna larga */
.form-col {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
}

    /* colonna stretta (date, minuti, telefono, ecc.) */
    .form-col.sm {
        flex: 0 0 160px;
    }

    /* si adatta al contenuto (checkbox, bottoni) */
    .form-col.auto {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    /* label uniforme */
    .form-col label {
        font-size: 13px;
        color: #6c7680;
        margin-bottom: 4px;
        font-weight: 500;
    }

    /* input coerenti */
    .form-col input[type="text"],
    .form-col input[type="date"],
    .form-col select,
    .wm-input {
        width: 100%;
        height: 34px;
        padding: 6px 10px;
        border-radius: 6px;
    }

/* checkbox affiancati */
.form-check {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* Titoli sezione */
.section-chip {
    margin-top: 32px;
    margin-bottom: 16px !important;
}

/* ============================================================
   ✅ 1. Toggle Checkbox Moderno
   ============================================================ */
.form-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 22px;
    background: #d0d4da;
    border-radius: 22px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.25s ease;
    margin-right: 8px;
}

    .form-check input[type="checkbox"]::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 2px;
        transition: transform 0.25s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    }

    .form-check input[type="checkbox"]:checked {
        background: #2a7a88;
    }

        .form-check input[type="checkbox"]:checked::before {
            transform: translateX(20px);
        }

/* Label a fianco del toggle */
.form-check label, .form-col.auto.form-check * {
    vertical-align: middle;
    font-size: 14px;
    margin-left: 6px;
}

/* ============================================================
   ✅ 2. Pulsante INVIA — Moderno + Allineato
   ============================================================ */
.invio-email {
    height: 38px !important;
    padding: 0 14px !important;
    border-radius: 6px !important;
    background: #2a7a88 !important;
    border: 1px solid #1f5a63 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
}

    .invio-email:hover {
        background: #236874 !important;
        transform: translateY(-1px);
    }

    .invio-email img {
        height: 20px;
        width: auto;
    }

/* Allineamento nella riga */
.form-row .form-col.auto {
    display: flex;
    align-items: center;
}


/* ============================================================
   ✅ 3. Griglia Moderna (form-row / form-col)
   ============================================================ */
.form-row {
    display: flex;
    gap: 28px;
    margin-top: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.form-col {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
}

    .form-col.sm {
        flex: 0 0 160px;
    }

    .form-col.str {
        flex: 0 0 25px;
        font-size: 14px;
        margin-left: 2px;
        margin-top: 0px;
        margin-bottom: 4px;
    }

    .form-col.auto {
        flex: 0 0 auto;
    }

    /* Label uniforme */
    .form-col label {
        font-size: 13px;
        color: #6c7680;
        margin-bottom: 4px;
        font-weight: 500;
    }

    /* Input coerenti */
    .form-col input[type="text"],
    .form-col select,
    .wm-input {
        width: 100%;
        height: 34px;
        padding: 6px 10px;
        border-radius: 6px;
    }

/* ============================================================
   ✅ TOGGLE MODERNO COMPATTO E ALLINEATO
   ============================================================ */

/* Wrapper: allinea perfettamente ogni toggle con altri campi */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px; /* allinea verticalmente con le textbox */
}

    /* Toggle handle */
    .form-check input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 36px; /* più basso */
        height: 18px;
        background: #d0d4da;
        border-radius: 20px;
        position: relative;
        cursor: pointer;
        transition: all 0.25s ease;
        outline: none;
    }

        /* Cerchietto interno */
        .form-check input[type="checkbox"]::before {
            content: "";
            position: absolute;
            width: 14px;
            height: 14px;
            top: 2px;
            left: 2px;
            background: white;
            border-radius: 50%;
            transition: transform 0.25s ease;
            box-shadow: 0px 1px 3px rgba(0,0,0,0.25);
        }

        /* Colore ON */
        .form-check input[type="checkbox"]:checked {
            background: #2a7a88;
        }

            .form-check input[type="checkbox"]:checked::before {
                transform: translateX(18px);
            }

    /* Testo accanto al toggle */
    .form-check label,
    .form-col.auto.form-check * {
        font-size: 14px;
        margin-left: 4px;
    }

/* ============================================================
   ✅ BOTTONE "INVIA" MODERNO E ALLINEATO
   ============================================================ */


.btn-invia {
    height: 30px;
    padding: 0 12px;
    background: #2a7a88;
    border: 1px solid #1f5a63;
    color: white;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
    font-size: 12px;
   }


    .btn-invia:hover {
        background: #236874;
        transform: translateY(-1px);
    }

.form-col.auto {
    display: flex;
    align-items: center;
}

/* -------------------------
   CARD & STRUTTURA
------------------------- */
.wm-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    padding: 28px;
}

.wm-section {
    margin-top: 32px;
}

/* -------------------------
   PILL / ETICHETTE
------------------------- */
.wm-pill-wrap {
    margin-bottom: 24px;
}

.wm-pill {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    background-color: #1e3a8a;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.wm-form-id {
    margin-left: 10px;
    font-size: 0.7rem;
    color: #9aa1ac;
}

/* -------------------------
   FORM GRID
------------------------- */

/* ✅ BASE – NON TOCCARE PIÙ */
/* ===== BASE CONGREGAZIONE – BLOCCO IMMUTABILE ===== */
.wm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.wm-field {
    display: flex;
    flex-direction: column;
}

.wm-field-full {
    grid-column: span 2;
}

.wm-field-inline {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.wm-field-small input {
    max-width: 60px;
}

.wm-field-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}

/* -------------------------
   LABEL & INPUT
------------------------- */
.wm-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.wm-input {
    height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #cfd6e0;
}

    .wm-input:focus {
        outline: none;
        border-color: #1e3a8a;
    }

.wm-input-disabled {
    background: #f4f6f9;
    color: #6b7280;
}

/* -------------------------
   ERRORI
------------------------- */
.wm-form-error {
    grid-column: span 2;
    color: #c00;
    font-size: 0.8rem;
}

/* -------------------------
   TABELLE
------------------------- */
.wm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

    .wm-table th,
    .wm-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #e5e9f0;
    }

.wm-table-compact th,
.wm-table-compact td {
    padding: 6px 8px;
}

.wm-row-selected {
    background-color: #e8f0ff;
}

/* -------------------------
   HEADER SEZIONI
------------------------- */
.wm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

/* -------------------------
   RESPONSIVE
------------------------- */
@media (max-width: 768px) {

    .wm-form-grid {
        grid-template-columns: 1fr;
    }

    .wm-field-full {
        grid-column: span 1;
    }

    .wm-field-inline {
        grid-template-columns: 1fr;
    }
}

/* Gruppo checkbox oratore */
.wm-field-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

/* Toolbar immagini (compatibilità legacy) */
.toolbar img,
.toolbar input[type="image"] {
    margin-right: 8px;
}

/* Pannello discorsi header */
.wm-section-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* Campi default: metà riga */
.wm-field {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
}

/* Full width */
.wm-field-full {
    grid-column: span 12;
}

/* Campi specifici */
.wm-field-span-6 {
    grid-column: span 6;
}

/* Checkbox allineate orizzontali */
.wm-field-checkbox-group {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 26px; /* verticale rispetto al campo Nominativo */
}

/* Responsive */
@media (max-width: 768px) {
    .wm-form-grid {
        grid-template-columns: 1fr;
    }

    .wm-field,
    .wm-field-span-6,
    .wm-field-full {
        grid-column: span 1;
    }

    .wm-field-checkbox-group {
        padding-top: 0;
        justify-content: flex-start;
    }
}

/* =========================
   SOLO PnlDettaglioOrat
========================= */
/* ===== SOLO ORATORE ===== */
.wm-orat-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.wm-orat-row {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

/* Checkbox a destra del nominativo */
.wm-orat-checks {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 28px;
}

/* Mobile */
@media (max-width: 768px) {
    .wm-orat-grid,
    .wm-orat-row {
        grid-template-columns: 1fr;
    }

    .wm-orat-checks {
        padding-top: 0;
        flex-wrap: wrap;
    }
}

/* =========================
   RICERCA ORATORI (GRID)
========================= */

.wm-orat-search {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

/* Radio in linea */
.wm-orat-radio {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Riga filtro */
.wm-orat-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: center;
}

.wm-orat-check {
    display: flex;
    align-items: center;
}

.wm-orat-field {
    display: flex;
    flex-direction: column;
}

/* Azioni */
.wm-orat-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Responsive */
@media (max-width: 768px) {

    .wm-orat-radio {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wm-orat-row {
        grid-template-columns: 1fr;
    }

    .wm-orat-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Uniforma select e textbox */
.wm-input {
    height: 38px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    color: #212529;
}

/* Forza il <select> a comportarsi come un input */
.wm-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>\
    <path fill='%23666' d='M4 6l4 4 4-4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px; /* spazio per la freccia */
    cursor: pointer;
}


.wm-section-header-asseg {
    display: flex;
    align-items: center;
}

/* ✅ pill a sinistra */
.wm-pill-asseg {
    white-space: nowrap;
}

/* ✅ gruppo a destra */
.wm-ddl-group-asseg {
    display: flex;
    gap: 20px;
    margin-left: auto; /* 💣 chiave: spinge tutto a destra */
}

/* ✅ label sopra */
.wm-field-asseg {
    display: flex;
    flex-direction: column;
    min-width: 220px;
}

.wm-label-asseg {
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
}

/* ✅ dimensione ddl */
.wm-field-asseg .wm-ddl-modern {
    width: 220px;
}

@media (max-width: 768px) {

    .wm-section-header-asseg {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* ✅ gruppo scende sotto la pill */
    .wm-ddl-group-asseg {
        flex-direction: column;
        margin-left: 0;
        width: 100%;
        gap: 10px;
    }

    .wm-field-asseg {
        width: 100%;
    }

        .wm-field-asseg .wm-ddl-modern {
            width: 100%;
        }
}


.wm-breakout {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 20px;
}

.wm-breakout.wm-card {
    border-radius: 0; /* oppure lascia se ti piace */
}

body {
    overflow-x: hidden;
}

.pnl-tesori,
.pnl-efficaci,
.pnl-vita-cr {
    padding: 12px 14px;
}

@media (max-width: 768px) {
    .pnl-tesori,
    .pnl-efficaci,
    .pnl-vita-cr {
        padding: 8px 10px;
    }
}

/* ===== FIX SPACING TESORI ===== */

/* 1. Titoli (1. Vasaio, 2. Gemme...) */
.pnl-tesori .wm-accent-eff {
    display: inline-block;
    margin: 4px 0 2px 0 !important;
    line-height: 1.2;
}

/* 2. Righe input (APRI + textbox) */
.pnl-tesori .efficaci-row {
    margin-top: 2px !important;
    gap: 6px !important;
}

/* 3. Wrapper che crea spazio fantasma */
.pnl-tesori .wm-form-row {
    margin-top: 2px !important;
}

    /* 4. SUPER IMPORTANTE: elimina spacing automatico tra blocchi */
    .pnl-tesori .wm-form-row + .wm-form-row {
        margin-top: 2px !important;
    }

/* 2. Righe input (APRI + textbox) */
.pnl-efficaci .efficaci-row {
    margin-top: 2px !important;
    gap: 6px !important;
}

/* 3. Wrapper che crea spazio fantasma */
.pnl-efficaci .wm-form-row {
    margin-top: 2px !important;
}

    /* 4. SUPER IMPORTANTE: elimina spacing automatico tra blocchi */
    .pnl-efficaci .wm-form-row + .wm-form-row {
        margin-top: 2px !important;
    }

/* 2. Righe input (APRI + textbox) */
.pnl-vita-cr .efficaci-row {
    margin-top: 2px !important;
    gap: 6px !important;
}

/* 3. Wrapper che crea spazio fantasma */
.pnl-vita-cr .wm-form-row {
    margin-top: 2px !important;
}

    /* 4. SUPER IMPORTANTE: elimina spacing automatico tra blocchi */
    .pnl-vita-cr .wm-form-row + .wm-form-row {
        margin-top: 2px !important;
    }
/* 5. Duo (blocchi verticali) */
.pnl-tesori .efficaci-duo {
    gap: 6px !important;
    margin-top: 4px !important;
}

/* 6. Label tipo "Sala principale" */
.pnl-tesori .wm-text-muted {
    margin-bottom: 1px !important;
}

.section-chip {
    margin-top: 8px !important;
}

.wm-section-header {
    margin-bottom: 6px !important; /* 🔴 prima era troppo alto */
    padding-bottom: 0 !important;
}

.wm-card.wm-section {
    padding-top: 10px !important; /* 🔴 riduce spazio sopra la pill */
}

.wm-group-oratore {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 280px; /* 🔴 blocco unico responsive */
}

/* =========================================
   MOBILE – VERSIONE COMPATTA
   ========================================= */
@media (max-width: 768px) {

    /* 1. Riduce padding delle card */
    .pnl-tesori,
    .pnl-efficaci,
    .pnl-vita-cr {
        padding: 6px 8px !important;
    }

    /* 2. Titoli sezioni (Tesori, Efficaci...) */
    .section-title-base {
        font-size: 0.9rem;
        padding: 5px 10px 5px 32px;
        margin-bottom: 6px !important;
    }

    /* 3. Sottotitoli tipo "1. Vasaio" */
    .wm-accent-eff {
        font-size: 0.95rem;
        margin: 3px 0 2px 0 !important;
        line-height: 1.2;
    }

    /* 4. Righe input */
    .efficaci-row {
        gap: 6px !important;
        margin-top: 2px !important;
    }

    .wm-form-row {
        gap: 6px !important;
        margin-top: 2px !important;
    }

    /* 5. Blocchi verticali */
    .efficaci-duo {
        gap: 6px !important;
        margin-top: 4px !important;
        flex-direction: column; /* 🔥 fonda tutto per mobile */
    }

    /* 6. Label tipo "Sala principale" */
    .wm-text-muted {
        font-size: 11px;
        margin-bottom: 1px !important;
    }

    /* 7. Input più compatti */
    .wm-input {
        height: 28px;
        font-size: 0.8rem;
        padding: 0 8px;
    }

    /* 8. Bottoni più piccoli */
    .btn-modern {
        height: 26px;
        font-size: 10px;
        padding: 0 8px;
    }

    /* 9. Spazi tra sezioni */
    .wm-section {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
}


@media (max-width: 768px) {

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px;
    }

        .toolbar .btn {
            width: 100%;
            height: 34px;
            font-size: 12px;
            border-radius: 8px;
        }
}


@media (max-width: 768px) {

    .wm-card {
        padding: 10px !important;
    }

    .wm-section {
        margin: 10px 0 !important;
    }

    .wm-hr {
        margin: 8px 0;
    }
}


@media (max-width: 768px) {

    .wm-input {
        height: 28px;
        font-size: 0.85rem;
    }

    .btn-modern {
        height: 26px;
        font-size: 10px;
        padding: 0 8px;
    }
}

@media (max-width: 768px) {

    .wm-input {
        height: 28px;
        font-size: 0.85rem;
    }

    .btn-modern {
        height: 26px;
        font-size: 10px;
        padding: 0 8px;
    }
}


@media (max-width: 768px) {

    .toolbar {
        display: flex;
        flex-direction: row !important; /* 🔥 override */
        flex-wrap: wrap;
        gap: 6px;
        align-items: stretch;
    }

        .toolbar .btn {
            flex: 1 1 calc(33.33% - 6px); /* 3 per riga */
            height: 34px;
            font-size: 12px;
        }

            /* seconda riga → ultimi 2 bottoni */
            .toolbar .btn:nth-child(n+4) {
                flex: 1 1 calc(50% - 6px);
            }
}

@media (max-width: 768px) {
    :root {
        --wm-spacing-lg: 8px;
    }
}


@media (max-width: 768px) {

    .wm-breakout {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 8px !important;
    }
}


@media (max-width: 768px) {

    .wm-card {
        padding: 10px !important;
    }
}


@media (max-width: 768px) {
    .wm-card

{
    padding: 8px !important;
}

.pnl-tesori,
.pnl-efficaci,
.pnl-vita-cr {
    padding: 6px !important;
}
}


@media (max-width: 768px) {

    .body-content,
    .body-content .container {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
}

@media (max-width: 768px) {
    .wm-card {
        border-radius: 6px; /* meno arrotondato → più edge-to-edge */
    }
}
