﻿/* Stili del guscio. La grafica vera segue i temi DevExpress e la palette PoliStore:
   qui c'è solo quello che il tema non può sapere — la struttura a due colonne, la barra in
   alto e i tre segnali che devono restare leggibili sempre (ambiente, company, grado). */

html, body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ---------- struttura ---------- */

.ps-guscio {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ps-corpo {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-height: 0;
}

.ps-contenuto {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

/* ---------- barra in alto ---------- */

.ps-testata {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .7rem 1.25rem;
    background: #4B2E83;
    color: #fff;
    flex-wrap: wrap;
}

.ps-testata__marchio {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    color: inherit;
    text-decoration: none;
}

.ps-marchio {
    font-size: 1.15rem;
    font-weight: 600;
}

.ps-sottotitolo {
    opacity: .8;
}

.ps-testata__company {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.ps-testata__vuoto {
    opacity: .75;
    font-size: .9rem;
    font-style: italic;
}

.ps-testata__persona {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.ps-testata__nome {
    font-size: .9rem;
    opacity: .9;
}

.ps-testata__esci {
    color: #fff;
    font-size: .9rem;
}

/* Ambiente e grado: due etichette che non devono mai essere una deduzione. */

.ps-pill {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .2rem .6rem;
    border-radius: 2px;
    white-space: nowrap;
}

.ps-pill--collaudo {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

/* La produzione si vede da lontano. Se fosse evidenziato tutto, non lo sarebbe niente. */
.ps-pill--produzione {
    background: #C0392B;
    color: #fff;
}

.ps-pill--grado {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

/* ---------- selettore della company ---------- */

.ps-selettore {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
}

.ps-selettore__campo {
    max-width: 22rem;
    padding: .25rem .4rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 2px;
    background: rgba(255, 255, 255, .95);
    font: inherit;
    font-size: .9rem;
}

.ps-selettore__azione,
.ps-company__azione {
    padding: .28rem .8rem;
    border: 0;
    border-radius: 2px;
    background: #2E7D5B;
    color: #fff;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}

/* ---------- menu ---------- */

.ps-menu {
    width: 15.5rem;
    flex: 0 0 auto;
    padding: 1.25rem 0;
    background: #F5F4F8;
    border-right: 1px solid #E0DEE8;
}

.ps-menu__gruppo {
    margin-bottom: 1.4rem;
}

.ps-menu__titolo {
    display: block;
    padding: 0 1.25rem .4rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7A7590;
}

.ps-menu__voce {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .45rem 1.25rem;
    color: #2B2740;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.ps-menu__voce:hover {
    background: #EBE9F2;
}

.ps-menu__voce.active {
    background: #E4E0F0;
    border-left-color: #4B2E83;
    font-weight: 600;
}

.ps-menu__nota {
    font-size: .72rem;
    color: #7A7590;
    font-style: italic;
}

/* ---------- esiti ---------- */

.ps-esiti {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.ps-esito {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .7rem 1rem;
    border-left: 3px solid #999;
    background: #FAFAFA;
}

.ps-esito--esito {
    border-left-color: #2E7D5B;
    background: #F1F8F4;
}

.ps-esito--attenzione {
    border-left-color: #B8860B;
    background: #FDF9EF;
}

.ps-esito--errore {
    border-left-color: #C0392B;
    background: #FDF2F2;
}

.ps-esito__testo {
    flex: 1;
}

/* La chiave di errore non è per l'utente: è quello che il supporto chiederà. */
.ps-esito__chiave {
    display: block;
    margin-top: .2rem;
    font-family: Consolas, monospace;
    font-size: .75rem;
    color: #777;
}

.ps-esito__chiudi {
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

/* ---------- conferme ---------- */

.ps-conferma__conseguenza {
    margin: 0 0 .8rem;
}

.ps-conferma__istruzione {
    margin: 0 0 .4rem;
    font-size: .9rem;
    color: #555;
}

.ps-conferma__campo {
    max-width: 22rem;
}

/* ---------- scelta della company ---------- */

.ps-ricerca {
    display: block;
    width: 100%;
    max-width: 28rem;
    margin: .75rem 0 1rem;
    padding: .4rem .6rem;
    border: 1px solid #CCC;
    border-radius: 2px;
    font: inherit;
}

.ps-company-elenco {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    max-width: 46rem;
}

.ps-company {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem .9rem;
    border: 1px solid #E0DEE8;
    border-radius: 2px;
    background: #fff;
    margin: 0;
}

.ps-company__dati {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: .75rem;
    min-width: 0;
}

.ps-company__codice {
    font-family: Consolas, monospace;
    font-weight: 600;
}

.ps-company__nome {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- testi ---------- */

.ps-avviso {
    padding: 1.5rem;
}

.ps-azione {
    display: inline-block;
    margin-top: .5rem;
}

.ps-nota {
    color: #666;
    font-size: .9rem;
}

.ps-ambiente {
    color: #555;
}

.ps-negato {
    padding: .75rem 1rem;
    background: #FDF2F2;
    border-left: 3px solid #C0392B;
}

dl dt {
    font-weight: 600;
    margin-top: .6rem;
}

dl dd {
    margin: 0 0 0 1rem;
}

@media (max-width: 900px) {

    .ps-corpo {
        flex-direction: column;
    }

    .ps-menu {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid #E0DEE8;
    }

    .ps-testata__company {
        margin-left: 0;
        width: 100%;
    }
}

/* ---------- schema metadati ---------- */

.ps-schema {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.ps-schema__tipi {
    width: 16rem;
    flex: 0 0 auto;
    border: 1px solid #E0DEE8;
    border-radius: 2px;
    background: #fff;
    padding: .75rem 0;
}

.ps-schema__tipi-testata {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .75rem .5rem;
}

.ps-schema__tipo {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    padding: .4rem .75rem;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ps-schema__tipo:hover {
    background: #F5F4F8;
}

.ps-schema__tipo--scelto {
    background: #E4E0F0;
    border-left-color: #4B2E83;
    font-weight: 600;
}

.ps-schema__conteggio {
    font-size: .78rem;
    color: #7A7590;
}

.ps-schema__nuovo {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .6rem .75rem;
}

.ps-schema__campi {
    flex: 1;
    min-width: 0;
}

.ps-schema__campi-testata {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

/* ---------- editor di un campo ---------- */

.ps-editor {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid #E0DEE8;
    border-left: 3px solid #4B2E83;
    border-radius: 2px;
    background: #FBFAFD;
}

.ps-editor__titolo {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    font-size: 1.05rem;
    margin: 0 0 .75rem;
}

.ps-editor__tipo {
    font-size: .8rem;
    font-weight: 400;
    color: #7A7590;
}

.ps-editor__form {
    max-width: 52rem;
}

.ps-editor__errori {
    margin: .75rem 0 0;
    padding-left: 1.2rem;
    color: #C0392B;
    font-size: .9rem;
}

.ps-editor__azioni {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
}

/* ---------- chiavi API e segreti ---------- */

.ps-chiave__genera {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #E0DEE8;
}

.ps-chiave__stato {
    font-size: .85rem;
}

.ps-segreto__avviso {
    margin: 0 0 .75rem;
}

/* Il valore si seleziona con un triplo clic e si copia: nessun pulsante che passi dagli
   appunti del browser, che in un back-office su rete di gestione può non essere disponibile. */
.ps-segreto__valore {
    margin: 0 0 .75rem;
    padding: .7rem .9rem;
    background: #2B2740;
    color: #F5F4F8;
    border-radius: 2px;
    font-family: Consolas, monospace;
    font-size: .95rem;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: all;
}

@media (max-width: 900px) {

    .ps-schema {
        flex-direction: column;
    }

    .ps-schema__tipi {
        width: 100%;
    }
}

/* ---------- installazione ---------- */

.ps-setup__company,
.ps-setup__report {
    margin-top: 1.75rem;
}

.ps-setup__riepilogo {
    margin-left: .75rem;
    font-size: .85rem;
    font-weight: 400;
    color: #7A7590;
}

.ps-setup__passi {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .75rem;
    max-width: 58rem;
}

.ps-setup__passo {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: .6rem .9rem;
    border: 1px solid #E0DEE8;
    border-left: 3px solid #B9B4C7;
    border-radius: 2px;
    background: #fff;
}

.ps-setup__passo--alreadyapplied {
    border-left-color: #2E7D5B;
}

.ps-setup__passo--applied {
    border-left-color: #2E7D5B;
    background: #F1F8F4;
}

.ps-setup__passo--pending {
    border-left-color: #B8860B;
    background: #FDF9EF;
}

.ps-setup__passo--notapplicable {
    border-left-color: #B9B4C7;
}

.ps-setup__passo--failed {
    border-left-color: #C0392B;
    background: #FDF2F2;
}

.ps-setup__passo--skipped {
    opacity: .65;
}

.ps-setup__esito {
    flex: 0 0 9rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ps-setup__descrizione {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.ps-setup__codice {
    font-size: .75rem;
    color: #7A7590;
}

.ps-setup__messaggio {
    font-size: .88rem;
    color: #555;
}

/* ---------------------------------------------------------------------------------------------
   Schermate di configurazione della company (anagrafica, utenti e ruoli).
   Riusano in gran parte le classi dell'editor; qui c'e' solo quello che manca.
   --------------------------------------------------------------------------------------------- */

.ps-sezione {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--ps-bordo, #d9dde4);
}

.ps-sezione__testata {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ps-sezione__testata h2 {
    margin: 0;
}

/* Valore in sola lettura dentro un DxFormLayoutItem: stessa altezza di un campo, ma dichiara
   di non essere modificabile invece di essere un campo disabilitato che sembra un guasto. */
.ps-valore-fisso {
    display: inline-block;
    padding: 6px 0;
    font-weight: 600;
}

.ps-valore-fisso__nota {
    display: block;
    font-weight: 400;
    font-size: 12.5px;
    opacity: .75;
}

/* Riga di un'associazione revocata: resta leggibile, ma non si confonde con una attiva. */
.ps-utente--revocato {
    opacity: .6;
}

.ps-utente__stato {
    font-size: 12.5px;
}

/* ---------------------------------------------------------------------------------------------
   Griglia dei form, nostra.

   DxFormLayout in questo ambiente non applica la propria disposizione: le didascalie e gli
   editor finiscono in fila e gli editor collassano alla larghezza del contenuto. Finche' non e'
   chiaro perche', i form si disegnano con una griglia CSS di dodici colonne che controlliamo
   noi — gli editor DevExpress restano quelli, e' solo il contenitore a cambiare.

   Un campo dichiara quante colonne occupa: --4, --6, --8, altrimenti tutta la riga.
   --------------------------------------------------------------------------------------------- */

.ps-form {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: .9rem 1.25rem;
    align-items: start;
    max-width: 60rem;
    margin-top: .5rem;
}

.ps-form__campo {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    /* senza questo un editor largo sfonda la colonna invece di restringersi */
    min-width: 0;
}

.ps-form__campo--3 { grid-column: span 3; }
.ps-form__campo--4 { grid-column: span 4; }
.ps-form__campo--6 { grid-column: span 6; }
.ps-form__campo--8 { grid-column: span 8; }

.ps-form__etichetta {
    font-size: .85rem;
    font-weight: 600;
    color: #4A4458;
}

/* Gli editor DevExpress non hanno una larghezza propria: gliela diamo qui. */
.ps-form__editor {
    width: 100%;
}

.ps-form__aiuto {
    font-size: .8rem;
    color: #7A7590;
}

/* Più caselle nello stesso campo si impilano: affiancate si leggerebbero come una sola
   domanda con due risposte. */
.ps-form__editor--pila {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

/* Sotto i 900px le colonne non servono più a niente: ogni campo prende la riga intera.
   La soglia sta qui e non a 768 perché i filtri a quattro colonne diventano illeggibili
   prima che lo schermo diventi un telefono. */
@media (max-width: 900px) {
    .ps-form__campo--3,
    .ps-form__campo--4,
    .ps-form__campo--6,
    .ps-form__campo--8 {
        grid-column: span 12;
    }
}

/* ---------------------------------------------------------------------------------------------
   Aggiunte del 23/09: colonna stretta del form, schermata Callback, cruscotto della Dashboard,
   accesso locale di emergenza.
   --------------------------------------------------------------------------------------------- */

.ps-form__campo--2 { grid-column: span 2; }

@media (max-width: 900px) {
    .ps-form__campo--2 { grid-column: span 12; }
}

.ps-callback__evento {
    border-top: 1px solid #E4E0EC;
    padding-top: 1rem;
    margin-top: 1rem;
}

.ps-callback__titolo {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .5rem;
    display: flex;
    gap: .75rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.ps-callback__corpo {
    background: #F6F4FA;
    border: 1px solid #E4E0EC;
    border-radius: 4px;
    padding: .75rem;
    font-size: .8rem;
    max-height: 20rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.ps-cruscotto__tessere {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .75rem;
    margin: 1rem 0 .5rem;
    max-width: 60rem;
}

.ps-cruscotto__tessera {
    background: #FFFFFF;
    border: 1px solid #E4E0EC;
    border-radius: 6px;
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.ps-cruscotto__valore {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2E1D52;
    font-variant-numeric: tabular-nums;
}

.ps-cruscotto__etichetta {
    font-size: .8rem;
    color: #7A7590;
}

.ps-cruscotto__titolo {
    font-size: .95rem;
    font-weight: 600;
    margin: 1.5rem 0 .5rem;
}

.ps-cruscotto__tabella {
    border-collapse: collapse;
    width: 100%;
    max-width: 60rem;
    font-size: .875rem;
}

.ps-cruscotto__tabella th,
.ps-cruscotto__tabella td {
    text-align: left;
    padding: .35rem .6rem;
    border-bottom: 1px solid #EEEBF3;
}

.ps-cruscotto__tabella th {
    font-weight: 600;
    color: #4A4458;
}

.ps-cruscotto__tabella .ps-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ps-cruscotto__barra-cella {
    width: 30%;
}

.ps-cruscotto__barra {
    display: block;
    height: .55rem;
    border-radius: 2px;
    background: #4B2E83;
}

.ps-accesso {
    max-width: 26rem;
    margin: 3rem auto;
    background: #FFFFFF;
    border: 1px solid #E4E0EC;
    border-radius: 6px;
    padding: 1.5rem 1.75rem;
}

.ps-accesso h1 {
    font-size: 1.25rem;
    margin-top: 0;
}

.ps-accesso__campo {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .9rem;
}

.ps-accesso__campo input {
    padding: .45rem .6rem;
    border: 1px solid #C9C3D6;
    border-radius: 4px;
    font: inherit;
}

.ps-accesso__azioni {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-top: 1rem;
}

.ps-accesso__azioni button {
    background: #4B2E83;
    color: #FFFFFF;
    border: 0;
    border-radius: 4px;
    padding: .5rem 1rem;
    font: inherit;
    cursor: pointer;
}

/* ---------- accesso con account Microsoft (24/09) ---------- */

.ps-form__campo--12 { grid-column: span 12; }

.ps-elenco-passi {
    margin: 0 0 12px;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.ps-elenco-passi li + li {
    margin-top: 8px;
}

/* Il link di consenso è lungo e va copiato per intero: si spezza ovunque invece di uscire. */
.ps-link-consenso {
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    user-select: all;
}

/* Sorgente esterna: lo script si legge e si scrive a spaziatura fissa. */
.ps-script textarea {
    font-family: Consolas, monospace;
    font-size: .85rem;
    white-space: pre;
}

/* ---------- report (23/11/2026) ---------- */

.ps-report__schede {
    margin-top: 1rem;
}

.ps-report__schede .dxbl-tabs-content {
    padding-top: 1rem;
}

/* Titolo della tabella a sinistra, esportazione a destra. */
.ps-report__testata {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 75rem;
}

.ps-report__export {
    display: inline-flex;
    gap: .4rem;
}

.ps-report__griglia {
    max-width: 75rem;
    margin-bottom: .5rem;
}

.ps-gravita {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: #EEF0F4;
    color: #4A4458;
}

.ps-gravita.ps-gravita--errore { background: #FDE2E0; color: #A61B1B; }
.ps-gravita.ps-gravita--avviso { background: #FFF2CC; color: #8A6100; }
.ps-gravita.ps-gravita--ok { background: #DDF2E3; color: #1E6B2F; }

.ps-cruscotto__valore.ps-gravita--errore { color: #A61B1B; }
.ps-cruscotto__valore.ps-gravita--avviso { color: #8A6100; }
.ps-cruscotto__valore.ps-gravita--ok { color: #1E6B2F; }
