@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyN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wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/*MODIFICHE*/
@media(max-width: 465px) {
    .mud-dialog-title .mud-typography-h6 {
        font-size: 18px;
    }
}

/*#img_homepage {
    max-width: 100vw;
    height: auto;
    max-height: 100vh;
    width: auto;
}*/

#img_homepage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.center {
    display: flaex;
    align-items: center;
    justify-content: center;
}

.card_password {
    width: 700px;
    height: 400px;
}
    .card_password > .mud-card-media {
        height: 40% !important;
    }

@media (max-width: 768px) {
    .card_password {
        width: 100%;
    }

    .card_password > .mud-card-media {
        height: 71px !important;
    }
}

.bold_dettagli {
    color: #006699;
}


/* TEST PER ELIMINARE I MARGIN LEFT/RIGHT DEI CONTAINER*/
.mud-container-maxwidth-lg {
    max-width: 100% !important;
}

/* ══ Stili comuni dei progetti EssetiWeb (presi dal progetto MAD, vedi LINEE-GUIDA-PROGETTI.md) ══ */

/* ── Stile standard delle pagine (vedi Shared/IntestazionePagina.razor) ── */
.intestazione-pagina {
    border-top: 6px solid var(--mud-palette-primary);
}

.intestazione-pagina-icona {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-primary);
    background: rgba(var(--mud-palette-primary-rgb), .1);
}

    .intestazione-pagina-icona .mud-icon-root {
        font-size: 1.75rem;
    }

/* intestazione delle tabelle: HeaderClass="mud-theme-primary header-white" */
.header-white th,
.header-white th .mud-table-sort-label,
.header-white th .mud-table-sort-label:hover,
.header-white th .mud-table-sort-label .mud-table-sort-label-icon {
    color: #fff !important;
    font-weight: 600 !important;
}

/* colonna dei pulsanti di riga (modifica, elimina, ...) */
.colonna-azioni {
    text-align: center !important;
    white-space: nowrap;
    width: 1%;
}

/* ── Snackbar: tutte uguali (anche quella di caricamento, vedi MainLayout) ──
   in alto a destra subito sotto la app bar; colore principale del tema per normale/info/successo,
   arancio e rosso solo per avvisi ed errori */
.mud-snackbar-location-top-right {
    top: calc(var(--mud-appbar-height, 64px) - 4px) !important;
    right: 16px !important;
}

.mud-snackbar.mud-alert-filled-normal,
.mud-snackbar.mud-alert-filled-info,
.mud-snackbar.mud-alert-filled-success {
    color: var(--mud-palette-primary-text);
    background-color: var(--mud-palette-primary);
}

/* intestazione nel colore del tema anche nelle tabelle con intestazione fissa,
   che nel loro CSS danno alle celle th lo sfondo della pagina */
.header-white th {
    background-color: var(--mud-palette-primary) !important;
}

/* pannello filtri standard (Shared/PannelloFiltri.razor) */
.pannello-filtri {
    margin: 12px 0 16px 0;
}

.pannello-filtri-corpo {
    border-left: 4px solid var(--mud-palette-primary) !important;
    background-color: var(--mud-palette-surface);
}

/* selettore delle colonne visibili (Shared/SelettoreColonne.razor) */
.selettore-colonne {
    position: relative;
    display: inline-block;
}

.selettore-colonne-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.selettore-colonne-dropdown {
    position: absolute;
    right: 0;
    top: 38px;
    z-index: 9999;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    min-width: 230px;
    max-height: 440px;
    overflow-y: auto;
    padding: 4px 0 6px;
}

.selettore-colonne-header {
    padding: 8px 16px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    margin-bottom: 2px;
}

.selettore-colonne-item {
    display: flex;
    align-items: center;
    padding: 1px 10px 1px 6px;
    cursor: pointer;
    transition: background 0.12s;
    gap: 2px;
}

    .selettore-colonne-item:hover {
        background: var(--mud-palette-action-hover);
    }

.selettore-colonne-footer {
    border-top: 1px solid var(--mud-palette-lines-default);
    margin-top: 4px;
    padding: 4px 10px 0;
    display: flex;
    gap: 4px;
}

/* tabelle fisse: altezza = spazio che resta sullo schermo, scorrono al loro interno (anche in orizzontale)
   e l'intestazione delle colonne resta visibile. Altezza calcolata da wwwroot/Script/tabelle-fisse.js */
.tabella-fissa {
    max-width: 100%;
}

    .tabella-fissa > .mud-table-container {
        overflow: auto;
    }

        .tabella-fissa > .mud-table-container > table > thead > tr > th {
            position: sticky;
            top: 0;
            z-index: 30;
        }

            /* prima colonna (es. selezione) fissata a sinistra da alcune pagine: la sua intestazione
               deve stare sopra le celle fisse delle righe, che scorrendo la coprirebbero */
            .tabella-fissa > .mud-table-container > table > thead > tr > th:first-child {
                z-index: 50 !important;
            }

/* area con più tabelle una sotto l'altra: scorre l'area, non le singole tabelle,
   così l'intestazione della tabella che si sta guardando resta in cima. Altezza da tabelle-fisse.js */
.area-tabelle-fissa {
    overflow: auto;
    max-width: 100%;
}

    .area-tabelle-fissa .mud-table-container {
        overflow: visible !important;
        max-height: none !important;
    }

        .area-tabelle-fissa .mud-table-container > table > thead > tr > th {
            position: sticky;
            top: 0;
            z-index: 30;
        }

            .area-tabelle-fissa .mud-table-container > table > thead > tr > th:first-child {
                z-index: 50 !important;
            }

/* logo della barra in alto: non più largo dello spazio disponibile (su telefono veniva tagliato) */
#logo_navbar {
    height: 50px;
    max-width: calc(100vw - 140px);
    object-fit: contain;
    object-position: left center;
}

@media (max-width: 599px) {
    #logo_navbar {
        height: 36px;
        max-width: calc(100vw - 90px);
    }

    /* Logout: solo l'icona */
    .mad-logout .mad-logout-testo {
        display: none;
    }

    .mad-logout .mud-button-icon-start {
        margin: 0;
    }
}

/* Tabelle in modalità "schede" (telefono / tablet, Breakpoint della MudTable): il testo deve poter andare a capo.
   Con white-space: nowrap (usato da varie colonne per il desktop) la scheda diventava larga quanto la riga
   più lunga e i valori finivano fuori schermo a destra. */
@media (max-width: 599.98px) {
    .mud-xs-table .mud-table-cell {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 959.98px) {
    .mud-sm-table .mud-table-cell {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 1279.98px) {
    .mud-md-table .mud-table-cell {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

/* ── telefono ─────────────────────────────────────────────────────────────────────────────── */
/* classi per mostrare / nascondere elementi solo su telefono */
.solo-telefono {
    display: none !important;
}

@media (max-width: 599.98px) {
    .solo-telefono {
        display: inline-flex !important;
    }

    .nascosto-su-telefono {
        display: none !important;
    }

    /* margini laterali delle pagine (pa-8 / px-10 = 32-40 px per lato su uno schermo di 375) */
    .mud-main-content .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-top: 12px !important;
    }
}

/* tabelle a schede: niente riquadro scorrevole dentro la pagina (max-height delle pagine, es. 70vh),
   su telefono scorre la pagina */
@media (max-width: 599.98px) {
    .mud-xs-table .mud-table-container {
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 959.98px) {
    .mud-sm-table .mud-table-container {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ── tabelle a schede curate (telefono / tablet): <MudTable Class="... tabella-schede" Breakpoint="Breakpoint.Sm"> ──
   ogni riga diventa una scheda; nelle celle:
   - Class="cella-titolo"  campo principale in cima alla scheda, grande e senza etichetta
   - Class="cella-azioni"  pulsanti in fondo a destra, senza etichetta
   - Class="cella-solo-pc" nascosta su telefono / tablet                                               */
@media (max-width: 959.98px) {
    .tabella-schede.mud-sm-table {
        background: transparent !important;
        box-shadow: none !important;
    }

        .tabella-schede.mud-sm-table > .mud-toolbar,
        .tabella-schede.mud-sm-table .mud-table-pagination {
            background: var(--mud-palette-surface);
            border-radius: 12px;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
            margin-bottom: 10px;
        }

        .tabella-schede.mud-sm-table .mud-table-pagination {
            margin-top: 4px;
        }

        .tabella-schede.mud-sm-table .mud-table-body .mud-table-row {
            display: flex !important;
            flex-direction: column;
            background: var(--mud-palette-surface) !important;
            border-radius: 12px;
            border-left: 4px solid var(--mud-palette-primary);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
            margin: 0 0 10px 0;
            padding: 8px 12px;
        }

        .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell {
            display: flex !important;
            justify-content: space-between;
            align-items: baseline;
            gap: 12px;
            border: none !important;
            background: transparent !important;
            padding: 3px 0 !important;
            min-height: 0;
            font-size: 0.875rem;
            text-align: right;
        }

            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell::before {
                color: var(--mud-palette-text-secondary);
                font-weight: 500;
                font-size: 0.75rem;
                text-align: left;
                padding: 0 !important;
                flex: 0 0 auto;
            }

            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell.cella-titolo {
                order: -1;
                justify-content: flex-start;
                text-align: left;
                font-size: 1rem;
                font-weight: 700;
                color: var(--mud-palette-primary);
                padding-bottom: 6px !important;
                margin-bottom: 4px;
                border-bottom: 1px solid var(--mud-palette-lines-default) !important;
            }

            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell.cella-titolo::before,
            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell.cella-azioni::before {
                display: none;
            }

            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell.cella-azioni {
                justify-content: flex-end;
                padding-top: 6px !important;
            }

            .tabella-schede.mud-sm-table .mud-table-body .mud-table-cell.cella-solo-pc {
                display: none !important;
            }
}

/* ── schede di sola lettura (es. Avanzamenti → Opzioni relative all'OdP) ─────────────
   <div class="scheda-dettagli"> con un titolo (scheda-dettagli-titolo) e coppie etichetta / valore
   (scheda-dettagli-voce); scheda-dettagli-compatta per i riquadri di riepilogo affiancati */
.scheda-dettagli {
    height: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-top: 3px solid var(--mud-palette-primary);
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

.scheda-dettagli-titolo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

    .scheda-dettagli-titolo .mud-typography {
        font-weight: 600;
    }

.scheda-dettagli-voce {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

    .scheda-dettagli-voce:last-child {
        border-bottom: none;
    }

.scheda-dettagli-etichetta {
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.scheda-dettagli-valore {
    font-size: .9375rem;
    color: var(--mud-palette-text-primary);
    word-break: break-word;
}

.scheda-dettagli-compatta {
    flex: 1 1 200px;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scheda-dettagli-valore-grande {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

/* contenuto ancora in caricamento: è già disegnato (i suoi dati si caricano) ma compare solo a caricamento finito;
   intanto si vede la snackbar di caricamento (pagine: MainLayout; finestre e schede: il loro contenitore) */
.contenuto-in-caricamento {
    visibility: hidden;
}

/* Avanzamenti → Richiesta pezzi e attrezzature: stessa altezza per le tre schede (la finestra non salta
   cambiando scheda) e liste delle attrezzature che scorrono */
.richiesta-pezzi {
    min-height: 50vh;
}

.richiesta-pezzi-lista {
    max-height: 40vh;
    overflow-y: auto;
}

    .richiesta-pezzi-lista .mud-list-item {
        border-radius: 6px;
    }