/* SO.VE - stile unico, mobile-first, alto contrasto per uso al sole */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #ffffff;
    color: #111111;
    font-size: 18px;
    line-height: 1.4;
}

.contenitore {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

.marchio {
    text-align: center;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 28px 0 20px;
    color: #0a3d62;
}

.testata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 4px solid #0a3d62;
    margin-bottom: 14px;
}

.titolo-testata {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 2px;
    color: #0a3d62;
}

.nome-utente {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    flex: 1;
}

.titolo-pagina {
    font-size: 22px;
    font-weight: 800;
    margin: 6px 0 12px;
}

label {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin: 14px 0 6px;
}

input, select {
    width: 100%;
    height: 54px;
    font-size: 19px;
    border: 2px solid #444444;
    border-radius: 6px;
    padding: 0 12px;
    background: #ffffff;
    color: #111111;
}

input:focus, select:focus {
    outline: 3px solid #0a3d62;
    outline-offset: 1px;
}

.bottone {
    /* centratura con flex e altezza minima: il pulsante cresce se il testo va a capo
       (es. "CARICA ULTIMO CANTIERE" su schermi stretti) invece di traboccare */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 8px 14px;
    line-height: 1.2;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 16px;
    letter-spacing: 1px;
}

.bottone-primario { background: #0a3d62; color: #ffffff; }
.bottone-primario:disabled { background: #7a8a99; }
.bottone-secondario { background: #eeeeee; color: #111111; border: 2px solid #444444; }
.bottone-pericolo { background: #b71c1c; color: #ffffff; }

.bottone-piccolo {
    height: 46px;
    line-height: 42px;
    font-size: 16px;
    margin-top: 10px;
}

.pulsanti-principali { margin-bottom: 6px; }

/* I due pulsanti principali dell'operaio (CARICA ULTIMO LAVORO / REGISTRO): bordo blu
   per dargli piu' presenza rispetto al grigio, restando comunque azioni secondarie */
.pulsanti-principali .bottone-secondario {
    background: #21615d;
    color: #ffffff;
    border-color: #0a3d62;
}

.avviso-ok {
    background: #1b7e35;
    color: #ffffff;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    padding: 18px 12px;
    border-radius: 6px;
    margin: 12px 0;
    letter-spacing: 1px;
}

.avviso-errore {
    background: #b71c1c;
    color: #ffffff;
    font-weight: 700;
    padding: 14px;
    border-radius: 6px;
    margin: 12px 0;
}

.testo-guida {
    font-size: 17px;
    margin: 12px 0;
}

.collegamento {
    color: #0a3d62;
    font-weight: 800;
    text-decoration: underline;
}

.piede { margin-top: 24px; text-align: center; }

/* Ore lavorate: due selettori affiancati */
.righe-ore { display: flex; gap: 12px; }
.righe-ore > div { flex: 1; }

/* Ore compatte (inserimento operaio): etichetta + tendine strette ore:minuti su una riga */
.campo-ore {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 0;
}

.campo-ore .etichetta-ore {
    margin: 0;
    min-width: 118px;
    font-weight: 700;
    font-size: 16px;
}

.campo-ore .select-ore {
    width: auto;
    min-width: 60px;
    text-align: center;
    padding: 0 4px;
}

.campo-ore .sep-ore {
    font-weight: 800;
    font-size: 20px;
    color: #0a3d62;
}

/* Anteprima foto (LAVORO EXTRA) */
.foto-anteprima { margin-top: 10px; }
.foto-anteprima img { max-width: 180px; border-radius: 6px; border: 2px solid #444444; display: block; }
#foto-rimuovi { cursor: pointer; margin-top: 8px; }

/* Schede del registro */
.scheda {
    border: 2px solid #444444;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
}

.riga-scheda {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    font-size: 16px;
}

.riga-scheda span:first-child { font-weight: 700; color: #333333; }
.riga-scheda span:last-child { text-align: right; }

.intesta-scheda {
    font-size: 19px;
    font-weight: 800;
    border-bottom: 2px solid #dddddd;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.intesta-scheda span { font-weight: 800 !important; color: #0a3d62 !important; }

/* Paginazione del registro */
.paginazione {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
}

.paginazione .bottone { flex: 1; margin-top: 0; }

/* ---------- Area ADMIN (visualizzazione desktop) ---------- */

.contenitore-admin {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    font-size: 15px;
}

.testata-admin { gap: 18px; flex-wrap: wrap; }

.menu-admin {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

.menu-admin a {
    padding: 9px 14px;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    color: #0a3d62;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.menu-admin a.voce-attiva,
.menu-admin a:hover { background: #0a3d62; color: #ffffff; }

.schede-tabelle {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.schede-tabelle a {
    padding: 8px 14px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #111111;
    border: 2px solid #444444;
    border-radius: 6px;
}

.schede-tabelle a.voce-attiva { background: #0a3d62; color: #ffffff; border-color: #0a3d62; }

.scorri-orizzontale { overflow-x: auto; }

.tabella-admin {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
}

.tabella-admin th {
    background: #0a3d62;
    color: #ffffff;
    padding: 9px 7px;
    text-align: left;
    white-space: nowrap;
}

.tabella-admin td {
    border-bottom: 1px solid #cccccc;
    padding: 6px 7px;
    vertical-align: middle;
    white-space: nowrap;
}

.tabella-admin tr:nth-child(even) { background: #f2f5f8; }

.filtri {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.filtri label { margin: 0 0 4px; font-size: 13px; }

.filtri input, .filtri select {
    height: 38px;
    font-size: 14px;
    width: auto;
    min-width: 150px;
}

.filtri .bottone {
    height: 42px;
    line-height: 38px;
    font-size: 14px;
    margin-top: 0;
    width: auto;
    padding: 0 18px;
    display: inline-block;
}

.bottone-riga {
    display: inline-block;
    width: auto;
    height: 34px;
    line-height: 30px;
    font-size: 12px;
    margin-top: 0;
    padding: 0 10px;
}

.bottone-largo { max-width: 380px; }

/* ---------- Pulsanti area ADMIN: compatti (desktop) ----------
   Il min-height:58px della classe base serve al tocco sullo smartphone dell'operaio;
   in ufficio i pulsanti devono stare entro l'altezza della barra del menu (dove c'e' ESCI).
   inline-flex: si adattano al testo, stanno in linea e centrano l'etichetta (bordi inclusi). */
.contenitore-admin .bottone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 0;
    height: 36px;
    line-height: 1;
    font-size: 14px;
    padding: 0 16px;
    margin-top: 0;
    letter-spacing: 0.5px;
}

.contenitore-admin .bottone-riga {
    height: 32px;
    font-size: 12px;
    padding: 0 10px;
}

form.in-riga { display: inline-block; margin: 0; }

.campo-riga {
    height: 34px;
    font-size: 14px;
    width: auto;
    min-width: 160px;
    padding: 0 8px;
}

.campo-nome { min-width: 260px; }

.voce-disattivata td, .voce-disattivata input, .voce-disattivata select { color: #999999; }

.riquadro {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.riquadro-stretto { max-width: 560px; }

.riquadro .filtri { margin-bottom: 0; }

.conteggio { font-weight: 700; margin: 12px 0; }

.piccolo { font-size: 14px; color: #555555; }

/* ---------- Campo NOTE, cliente derivato, avviso ---------- */

textarea {
    width: 100%;
    font-size: 18px;
    border: 2px solid #444444;
    border-radius: 6px;
    padding: 10px 12px;
    background: #ffffff;
    color: #111111;
    font-family: inherit;
    resize: vertical;
}

textarea:focus { outline: 3px solid #0a3d62; outline-offset: 1px; }

/* Cliente: mostrato in sola lettura perche' determinato dalla costruzione */
.valore-derivato {
    min-height: 54px;
    display: flex;
    align-items: center;
    font-size: 19px;
    font-weight: 700;
    color: #0a3d62;
    background: #eef2f6;
    border: 2px solid #ccd6df;
    border-radius: 6px;
    padding: 0 12px;
}

.valore-vuoto { color: #3d4f5e; font-weight: 400; font-style: italic; }

.avviso-info {
    background: #fff3cd;
    color: #6b4e00;
    border: 2px solid #e0c257;
    border-radius: 6px;
    padding: 14px 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 12px 0 4px;
}

.cella-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.miniatura-foto { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; display: block; }

/* ---------- Rifiniture desktop area ADMIN ----------
   L'admin non si usa su smartphone: campi piu' compatti, bordi leggeri,
   pannelli con ombra morbida e feedback al passaggio del mouse. */

/* Bordi piu' leggeri sui campi (aspetto desktop, non mobile) */
.contenitore-admin input,
.contenitore-admin select,
.contenitore-admin textarea {
    border: 1px solid #b6bfc8;
}

/* Form di modifica registrazione: campi ed etichette compatti da desktop */
.riquadro-stretto { max-width: 620px; }
.riquadro-stretto input,
.riquadro-stretto select { height: 38px; font-size: 14px; }
.riquadro-stretto textarea { font-size: 14px; }
.riquadro-stretto label { font-size: 13px; margin: 12px 0 4px; }
.riquadro-stretto .valore-derivato { min-height: 38px; font-size: 15px; }

/* Titoli di pagina piu' misurati sul desktop */
.contenitore-admin .titolo-pagina { font-size: 20px; margin: 4px 0 14px; }

/* Feedback al passaggio del mouse (tipico del desktop) */
.contenitore-admin .bottone:hover { filter: brightness(0.93); }
.contenitore-admin .collegamento:hover { text-decoration: none; }
.tabella-admin tr:hover td { background: #e8eef4; }
