/* ---------------------------------------------------------------------------
   Stili del kit di interfaccia.

   Vivono qui e non nell'host perche' sono la controparte dei componenti del
   kit: una pagina di modulo che usa jt3-page e Jt3Grid deve venire impaginata
   allo stesso modo in qualunque host la si carichi. L'host li include come
   asset statico del pacchetto (_content/Jt3.Ui.Kit/jt3-kit.css).

   Le classi erano usate dalle pagine da settimane senza che nessuno le avesse
   definite: le griglie si vedevano perche' DevExpress porta il proprio stile,
   tutto il resto — filtri, pulsanti, schede — era testo nudo.
--------------------------------------------------------------------------- */

.jt3-page { display: flex; flex-direction: column; gap: 1rem; }

/* --- filtri e comandi --- */

.jt3-filters {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: .6rem .85rem;
}

.jt3-input {
    font: inherit; font-size: .9rem; padding: .35rem .55rem;
    border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: #111827;
    min-width: 12rem;
}

.jt3-input:focus { outline: 2px solid #93c5fd; outline-offset: -1px; border-color: #2563eb; }

.jt3-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; color: #374151; }
.jt3-check input { accent-color: #2563eb; }

.jt3-count { margin-left: auto; font-size: .85rem; color: #6b7280; }

.jt3-btn {
    font: inherit; font-size: .875rem; padding: .35rem .8rem; cursor: pointer;
    border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: #111827;
    text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
}

.jt3-btn:hover:not(:disabled) { background: #f3f4f6; }
.jt3-btn:disabled { opacity: .5; cursor: default; }

.jt3-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.jt3-btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.jt3-alert {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    border-radius: 4px; padding: .6rem .85rem; font-size: .9rem;
}

.jt3-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 1rem 1.25rem;
}

.jt3-link { color: #2563eb; }

/* Usate da pagine di modulo da settimane senza essere mai state definite: si
   vedevano solo perche' il testo nudo e' comunque leggibile, non perche' fosse
   lo stile giusto. */
.jt3-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    border-radius: 4px; padding: .6rem .85rem; font-size: .9rem; margin: 0;
}

/* Esito riuscito di un comando: stessa forma di .jt3-error, colore opposto.
   Serve dove l'operazione non cambia visibilmente l'elenco e senza un
   messaggio sembrerebbe non aver fatto nulla. */
.jt3-notice {
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
    border-radius: 4px; padding: .6rem .85rem; font-size: .9rem; margin: 0;
}

.jt3-empty { color: #6b7280; font-size: .9rem; font-style: italic; }

.jt3-warning { color: #b45309; font-size: .85rem; }

.jt3-amount { text-align: right; font-variant-numeric: tabular-nums; }

.jt3-actions { display: flex; gap: .5rem; margin-top: .5rem; }

/* --- forma modale (creazione e modifica) ------------------------------------
   Una sola forma per le due operazioni: il titolo e i valori precompilati li
   decide la pagina, non questo foglio. I campi si dispongono a griglia
   responsive perche' un'anagrafica con trenta campi in una colonna sola
   costringe a scorrere per compilare quattro caratteri.
--------------------------------------------------------------------------- */

.jt3-form {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem 1rem;
}

.jt3-form-field { display: flex; flex-direction: column; gap: .25rem; }
.jt3-form-field label { font-size: .78rem; color: #6b7280; }
.jt3-form-field.jt3-form-wide { grid-column: 1 / -1; }

/* Jt3FormLayout (DxFormLayout) gestisce da solo le proprie colonne interne
   responsive: dentro .jt3-form resta un unico elemento della griglia, e senza
   questa regola auto-fill lo mette in una sola colonna da minmax(220px, 1fr)
   — l'intera scheda si schiaccia in ~220px e i campi appaiono tagliati,
   qualunque sia la larghezza della Jt3FormModal che la contiene. */
.jt3-form > .jt3-form-layout { grid-column: 1 / -1; width: 100%; }

.jt3-form-actions { display: flex; gap: .5rem; justify-content: flex-end; width: 100%; }

/* --- breadcrumb (Jt3Breadcrumb) ---------------------------------------------
   Ogni livello tranne l'ultimo e' un collegamento: e' il "torna al livello
   precedente" richiesto, non un pulsante indietro a parte. */

.jt3-breadcrumb {
    display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
    font-size: .85rem; color: #6b7280; margin-bottom: .25rem;
}

.jt3-breadcrumb-link { color: #2563eb; text-decoration: none; }
.jt3-breadcrumb-link:hover { text-decoration: underline; }
.jt3-breadcrumb-sep { color: #d1d5db; }
.jt3-breadcrumb-current { color: #374151; font-weight: 600; }

/* --- intestazione di filtro configurabile (Jt3FilterBar) --------------------
   Stessa forma di .jt3-filters: e' l'intestazione che le pagine di elenco
   componevano a mano, qui diventa un componente che ricorda la scelta per
   utente. */

.jt3-filterbar {
    display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: .6rem .85rem;
}

.jt3-filterbar-field { display: flex; flex-direction: column; gap: .2rem; }
.jt3-filterbar-field label { font-size: .78rem; color: #6b7280; }
.jt3-filterbar-config { margin-left: auto; }

/* --- lookup di selezione (Jt3Lookup) ----------------------------------------
   Il testo che il combo filtra e' "codice - descrizione" insieme: le due
   parti si distinguono solo nello stile, non nel campo che DevExpress usa
   per cercare. --------------------------------------------------------- */

/* Il contenitore del lookup esiste solo per intercettare l'evento 'input'
   che risale dal campo di DevExpress: display:contents lo toglie dal
   flusso, cosi' il DxComboBox resta figlio diretto del flex di .jt3-filters
   e la barra non cambia disposizione. */
.jt3-lookup-host { display: contents; }
.jt3-lookup { min-width: 12rem; }
.jt3-lookup-code { font-weight: 600; margin-right: .4rem; }
.jt3-lookup-desc { color: #6b7280; }

/* --- griglia e tabelle --- */

.jt3-grid { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }

.jt3-grid-toolbar {
    display: flex; align-items: center; gap: .5rem;
    padding: .6rem .85rem; border-bottom: 1px solid #e5e7eb; background: #f9fafb;
}

.jt3-grid-title { font-weight: 600; font-size: .95rem; }
.jt3-grid-commands { display: flex; gap: .5rem; margin-left: auto; }
.jt3-grid-empty { margin: 0; padding: .85rem; color: #6b7280; font-size: .9rem; }

.jt3-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; }
.jt3-table th, .jt3-table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid #f3f4f6; }
.jt3-table th { color: #6b7280; font-weight: 500; background: #f9fafb; }

/* Jt3EditableGrid: le righe di un master-detail (documento, preventivo...),
   modificabili sul posto. Larghezza piena come .jt3-table, di cui e' la
   controparte modificabile. */
.jt3-linegrid { width: 100%; margin-bottom: .5rem; }

/* --- matrice di validazione ore (HoursValidationList) -----------------------
   Stessa tavolozza di .jt3-alert per le celle sotto obiettivo: e' lo stesso
   segnale di attenzione, qui applicato cella per cella invece che a un
   messaggio intero. Il weekend usa lo stesso grigio dei bordi della tabella,
   solo piu' pieno, per restare un'informazione di sfondo e non un allarme. */
.jt3-table-scroll { overflow-x: auto; }
.jt3-hours-table td, .jt3-hours-table th { text-align: right; white-space: nowrap; }
.jt3-hours-table td:first-child, .jt3-hours-table td:nth-child(2),
.jt3-hours-table th:first-child, .jt3-hours-table th:nth-child(2) { text-align: left; }
.jt3-hours-weekend { background: #f3f4f6; color: #6b7280; }
.jt3-hours-missing { background: #fecaca; color: #991b1b; }
.jt3-hours-short { background: #fef2f2; color: #991b1b; }

/* --- schede (Jt3Tabs) -------------------------------------------------------
   L'anagrafica di un partner ha sei aree e novanta campi: su una pagina sola
   nessuno arriva in fondo. La scheda non attiva si nasconde e non si smonta —
   dentro c'e' un modulo con dei campi legati, e distruggerlo al cambio di
   scheda butterebbe via quello che l'utente ha appena scritto.
--------------------------------------------------------------------------- */

.jt3-tabs { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; }

.jt3-tabstrip {
    display: flex; gap: .15rem; padding: 0 .5rem; overflow-x: auto;
    border-bottom: 1px solid #e5e7eb; background: #f9fafb;
    border-radius: 6px 6px 0 0;
}

.jt3-tab {
    flex: 0 0 auto; padding: .55rem .85rem; border: 0; background: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-size: .875rem; color: #6b7280; white-space: nowrap;
}

.jt3-tab:hover:not(:disabled) { color: #374151; }
.jt3-tab:disabled { opacity: .45; cursor: default; }
.jt3-tab-active { color: #1d4ed8; border-bottom-color: #2563eb; font-weight: 600; }

.jt3-tab-badge {
    display: inline-block; margin-left: .35rem; padding: 0 .35rem;
    border-radius: .75rem; background: #e5e7eb; color: #374151; font-size: .7rem;
}

.jt3-tab-active .jt3-tab-badge { background: #dbeafe; color: #1d4ed8; }

.jt3-tabpanels { padding: 1rem; }
.jt3-tabpanel[hidden] { display: none; }

/* --- intestazione di una scheda anagrafica ----------------------------------
   Codice e denominazione in alto, i ruoli accanto: quello che serve sapere per
   capire su quale record si sta lavorando, senza scorrere.
--------------------------------------------------------------------------- */

.jt3-record-head {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem;
    padding: .25rem 0;
}

.jt3-record-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.jt3-record-roles { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.jt3-record-actions { display: flex; gap: .5rem; margin-left: auto; }

.jt3-fieldset { border: 0; margin: 0 0 1.25rem; padding: 0; }

.jt3-fieldset > legend {
    padding: 0; margin-bottom: .5rem;
    font-size: .8rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: #6b7280;
}

/* --- elenco di avvisi -------------------------------------------------------
   Una notifica non e' una riga di griglia: si legge, non si filtra. Titolo,
   testo e azioni impilati, e la non letta si distingue a colpo d'occhio —
   una casella in cui letto e non letto si somigliano e' una casella che si
   smette di guardare.
--------------------------------------------------------------------------- */

.jt3-section-title { margin: 1.25rem 0 .5rem; font-size: 1rem; font-weight: 600; }
.jt3-hint { margin: .5rem 0; color: #6b7280; font-size: .875rem; }
.jt3-muted { color: #6b7280; font-size: .8rem; }
.jt3-inline { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; }

.jt3-badge {
    display: inline-block; padding: .05rem .4rem; border-radius: .75rem;
    background: #eef2ff; color: #4338ca; font-size: .75rem;
}

.jt3-list { list-style: none; margin: 0; padding: 0; }

.jt3-list-item {
    padding: .7rem .85rem; border: 1px solid #e5e7eb; border-radius: .35rem;
    background: #fff; margin-bottom: .5rem;
}

.jt3-list-item.jt3-unread { border-left: 3px solid #4338ca; background: #fbfbff; }

.jt3-list-head { display: flex; align-items: center; gap: .5rem; }
.jt3-list-head .jt3-muted { margin-left: auto; }
.jt3-list-body { margin: .35rem 0 .5rem; font-size: .875rem; color: #374151; }
.jt3-list-actions { display: flex; gap: .5rem; }

.jt3-form-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.jt3-form-row .jt3-input { flex: 1 1 auto; }

/* --- foglio di stampa -------------------------------------------------------
   Misure in millimetri: e' un foglio, non una pagina web. A schermo si vede
   com'e' impaginato, e cio' che si vede e' cio' che esce dalla stampante.
--------------------------------------------------------------------------- */

.jt3-print-page { background: #e5e7eb; min-height: 100vh; padding: 1.5rem; }

.jt3-print-toolbar {
    display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem;
}

.jt3-sheet {
    width: 210mm; min-height: 297mm; box-sizing: border-box; margin: 0 auto;
    padding: 18mm 16mm; background: #fff; color: #111827;
    font-family: system-ui, sans-serif; font-size: 10pt; line-height: 1.35;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.jt3-sheet-head { display: flex; justify-content: space-between; gap: 12mm; margin-bottom: 10mm; }
.jt3-issuer { max-width: 85mm; }
.jt3-recipient { max-width: 85mm; }
.jt3-recipient-label { color: #6b7280; font-size: 9pt; }

.jt3-sheet-title { font-size: 13pt; margin: 0 0 4mm; }
.jt3-sheet-ref { margin: 0 0 6mm; color: #374151; }

.jt3-sheet-lines { width: 100%; border-collapse: collapse; margin-bottom: 8mm; }
.jt3-sheet-lines th {
    text-align: left; font-weight: 600; font-size: 9pt;
    border-bottom: .6pt solid #111827; padding: 1.5mm 2mm;
}
.jt3-sheet-lines td { padding: 1.5mm 2mm; border-bottom: .3pt solid #e5e7eb; vertical-align: top; }

.jt3-col-row { width: 10mm; }
.jt3-col-code { width: 26mm; }
.jt3-col-qty { width: 22mm; text-align: right; }
.jt3-col-um { width: 12mm; }
.jt3-col-money { width: 26mm; text-align: right; }

.jt3-sheet-lines td.jt3-col-qty,
.jt3-sheet-lines td.jt3-col-money { text-align: right; font-variant-numeric: tabular-nums; }

.jt3-sheet-totals { margin-left: auto; border-collapse: collapse; min-width: 70mm; }
.jt3-sheet-totals th { text-align: left; font-weight: 500; padding: 1mm 3mm; color: #374151; }
.jt3-sheet-totals td { text-align: right; padding: 1mm 3mm; font-variant-numeric: tabular-nums; }
.jt3-sheet-totals .jt3-total th, .jt3-sheet-totals .jt3-total td {
    font-weight: 700; border-top: .6pt solid #111827;
}

.jt3-sheet-notes { margin-top: 8mm; color: #374151; white-space: pre-wrap; }

@media print {
    /* In stampa resta solo il foglio: niente sfondo, niente ombra, niente
       pulsanti. La pagina e' gia' A4, quindi non si riscala nulla. */
    .jt3-print-page { background: #fff; padding: 0; }
    .jt3-print-toolbar { display: none; }
    .jt3-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }

    @page { size: A4; margin: 15mm; }
}

/* Avviso di record bloccato da un altro utente. Sta in cima alla maschera e
   non accanto al pulsante di salvataggio: chi apre un documento occupato deve
   saperlo prima di scrivere, non quando prova a salvare. */
.jt3-lock-banner { display: block; }

/* --- terminale di reparto ---------------------------------------------------
   Misure volutamente fuori scala rispetto al resto del kit: questa non e' una
   schermata da scrivania. Si usa in piedi, a un metro di distanza, con i guanti
   e su uno schermo capacitivo che non distingue due bersagli vicini — quindi
   tasti da 4rem, testo grande e niente di cliccabile piccolo. Vive qui e non
   nella pagina perche' la stessa tavolozza serve al tastierino, al cronometro e
   ai pannelli, che sono componenti diversi.
--------------------------------------------------------------------------- */

.jt3-terminal { display: flex; flex-direction: column; gap: 1rem; font-size: 1.05rem; }

.jt3-terminal-bar {
    display: flex; align-items: center; gap: 1rem;
    padding: .6rem .9rem; border-radius: .4rem;
    background: #111827; color: #f9fafb;
}

.jt3-terminal-who { font-size: 1.35rem; font-weight: 600; }
.jt3-terminal-bar .jt3-btn { margin-left: auto; }

.jt3-terminal-clock { font-size: 1.05rem; color: #9ca3af; }
.jt3-terminal-login .jt3-terminal-clock,
.jt3-terminal > .jt3-terminal-clock { color: #4b5563; text-align: center; }

.jt3-terminal-login {
    max-width: 22rem; margin: 2rem auto; padding: 1.5rem;
    border: 1px solid #e5e7eb; border-radius: .5rem; background: #fff; text-align: center;
}

.jt3-terminal-login h2 { margin: 0 0 1rem; font-size: 1.2rem; }

.jt3-pin-display { display: flex; justify-content: center; gap: .75rem; margin-bottom: 1rem; }

.jt3-pin-digit { font-size: 2rem; line-height: 1; color: #d1d5db; }
.jt3-pin-digit.jt3-pin-filled { color: #2563eb; }

.jt3-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }

.jt3-key {
    height: 4rem; font-size: 1.6rem; cursor: pointer;
    border: 1px solid #d1d5db; border-radius: .4rem; background: #fff; color: #111827;
}

.jt3-key:hover:not(:disabled) { background: #f3f4f6; }
.jt3-key:disabled { opacity: .4; cursor: default; }
.jt3-key-clear { color: #b91c1c; }
.jt3-key-enter { background: #2563eb; border-color: #2563eb; color: #fff; }
.jt3-key-enter:hover:not(:disabled) { background: #1d4ed8; }

.jt3-btn-big { min-height: 3.2rem; min-width: 11rem; font-size: 1.1rem; }
.jt3-btn-danger { border-color: #b91c1c; color: #b91c1c; }
.jt3-btn-danger:hover:not(:disabled) { background: #fef2f2; }

.jt3-terminal-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }

.jt3-terminal-running { border-left: 4px solid #2563eb; }

.jt3-terminal-running-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-bottom: .5rem;
}

/* Il cronometro e' il motivo per cui l'operatore alza lo sguardo: deve leggersi
   da lontano senza cercarlo. */
.jt3-terminal-elapsed {
    font-size: 2.6rem; font-variant-numeric: tabular-nums; font-weight: 600; color: #111827;
}

.jt3-terminal-subject { font-size: 1.2rem; margin: 0 0 .75rem; }
.jt3-terminal-subject .jt3-badge { margin-left: .5rem; }

.jt3-terminal-table { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.jt3-terminal-table th {
    text-align: left; font-size: .85rem; color: #6b7280; font-weight: 600;
    border-bottom: 1px solid #e5e7eb; padding: .4rem .5rem;
}
.jt3-terminal-table td { padding: .55rem .5rem; border-bottom: 1px solid #f3f4f6; }
.jt3-terminal-table tfoot td { font-weight: 600; border-top: 1px solid #e5e7eb; border-bottom: none; }

.jt3-terminal-pick tbody tr { cursor: pointer; }
.jt3-terminal-pick tbody tr:hover { background: #f9fafb; }
.jt3-terminal-picked, .jt3-terminal-pick tbody tr.jt3-terminal-picked:hover { background: #dbeafe; }

/* I semilavorati si distinguono dagli ingredienti a colpo d'occhio: sono fasi
   da eseguire, non materiale da prendere dallo scaffale. */
.jt3-terminal-phase td { background: #f5f3ff; font-weight: 600; }

.jt3-tabbar { display: flex; gap: .5rem; margin-bottom: .75rem; }

.jt3-key-tab {
    padding: .55rem 1.1rem; font-size: 1rem; cursor: pointer;
    border: 1px solid #d1d5db; border-radius: .35rem; background: #fff; color: #374151;
}

.jt3-key-tab-active { background: #2563eb; border-color: #2563eb; color: #fff; }

.jt3-terminal-instructions { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.5; }

/* Riepilogo del monitor di reparto: quattro numeri sopra la griglia, perche' la
   domanda che ci si fa aprendo la pagina e' "quanto e' stato fatto", e la
   risposta non deve richiedere di raggruppare una colonna. */
.jt3-summary { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: .95rem; }

/* --- barra dei layout di griglia --------------------------------------------
   Vive dentro la barra comandi della griglia, a destra dei pulsanti: e' una
   scelta di vista, non un comando sui dati, e mescolarla a "Nuovo" ed "Elimina"
   la farebbe premere per sbaglio.
--------------------------------------------------------------------------- */

.jt3-layoutbar { display: inline-flex; align-items: center; gap: .4rem; margin-left: .35rem; }

.jt3-layoutbar::before {
    content: ""; align-self: stretch; width: 1px; background: #e5e7eb; margin-right: .15rem;
}

.jt3-layout-select {
    max-width: 16rem; padding: .3rem .5rem; font-size: .85rem;
    border: 1px solid #d1d5db; border-radius: .3rem; background: #fff; color: #111827;
}

.jt3-layout-select:focus { outline: 2px solid #93c5fd; outline-offset: -1px; border-color: #2563eb; }
