/* Stili comuni a tutte le pagine Thymeleaf (rivenditore e operatore).
   Gli stili specifici di una pagina vanno in un file a parte, non qui. */

body, h1, h2, h3, h4, h5 {
    font-family: "Poppins", sans-serif;
}

body {
    font-size: 16px;
}

/* ---- Sidebar ---- */
.app-sidebar {
    z-index: 3;
    width: 300px;
    font-weight: bold;
}

.app-close {
    width: 100%;
    font-size: 22px;
}

.app-logo {
    margin-bottom: 10%;
}

.app-logo img {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    margin-left: 15px;
}

.app-overlay {
    cursor: pointer;
}

/* ---- Contenuto ---- */
.app-main {
    margin-left: 340px;
    margin-right: 40px;
}

/* Sotto i 993px w3.css azzera i margini di .w3-main: il contenuto usa tutta la larghezza */

.app-intestazione {
    margin-top: 80px;
}

.app-separatore {
    width: 50px;
    border: 5px solid orange;
}

/* Righe cliccabili delle tabelle che aprono un dettaglio */
table.app-tabella-cliccabile tbody tr {
    cursor: pointer;
}

/* ---- Titoli di sezione ---- */
.app-sezione {
    margin-top: 2%;
    margin-bottom: 2%;
}

.app-sezione-bordata {
    border-bottom: 2px solid orange;
    padding-bottom: 4%;
}

/* ---- Pulsante bianco con bordo arancione (es. "mostra anche i chiusi") ---- */
.app-pulsante-secondario {
    padding: 5px 10px;
    margin-top: 1%;
    background-color: white;
    border: 1px solid orange;
    border-radius: 8px;
    cursor: pointer;
}

/* ---- Filtri sullo stato (pagina pratiche dell'operatore) ---- */
.app-filtri-stato {
    border: 1px solid orange;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 2%;
}

.app-filtri-stato label {
    display: inline-block;
    margin: 4px 16px 4px 0;
    cursor: pointer;
}

.app-filtri-stato .app-pulsante-secondario {
    margin-right: 8px;
}

/* ---- Schede "campo / valore" delle pagine di dettaglio ---- */
table.app-scheda {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #eeeeee;
    table-layout: fixed;
}

table.app-scheda th,
table.app-scheda td {
    padding: 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
    border: none;
}

table.app-scheda th {
    width: 40%;
}

table.app-scheda td {
    font-size: 0.9em;
    white-space: pre-wrap;
}

table.app-scheda tr:nth-child(even) {
    background-color: #eeeded;
}

/* ---- Note ---- */
.app-nota {
    border-top: 2px solid orange;
    padding: 10px 0;
}

.app-nota-testo {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    margin: 4px 0 8px;
}

.app-note-titolo {
    margin-top: 3%;
}

.app-note-invia {
    width: 30%;
    border-radius: 8px;
}

/* ---- Link cliccabili dentro le schede ---- */
.app-link {
    color: darkblue;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Elenco allegati e anteprima immagini ---- */
.app-allegati li {
    cursor: pointer;
}

.app-anteprima {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: auto;
}

/* ---- Caricamento (mostraCaricamento / conCaricamento in common.js) ---- */
.app-caricamento {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.35);
    cursor: wait;
}

.app-caricamento[hidden] {
    display: none;
}

.app-caricamento-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: calc(100% - 32px);
    padding: 24px 32px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.app-caricamento-testo {
    margin: 0;
    font-weight: bold;
}

.app-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #f1f1f1;
    border-top-color: #ff9800;
    border-radius: 50%;
    animation: app-spinner-giro 0.8s linear infinite;
}

@keyframes app-spinner-giro {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-spinner {
        animation-duration: 2.4s;
    }
}
