/* Vista PC / telefono - Fatturazione, FE, Email (prefisso fz-).
   Solo le regole proprie di queste pagine: quelle comuni stanno in app.css (ed-*, vt-*, mg-pagina--tel).
   Le pagine hanno blocchi <style> locali letti dopo questo foglio: dove serve si alza la specificità
   (doppia classe) per vincere su di loro. */

/* ── Comuni del gruppo ─────────────────────────────────────────────── */
.fz-check { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; cursor: pointer; align-self: center; }
.fz-ctrl { min-height: 40px; font-size: 16px; }
.fz-chip-dato { align-self: flex-start; margin-top: 2px; }
.fz-tel-pagina { padding: .5rem; }

/* Riga dei totali sopra le schede (somma sull'elenco filtrato) */
.fz-totali {
    display: flex; flex-wrap: wrap; gap: .3rem 1rem;
    padding: .45rem .7rem; margin-bottom: .6rem;
    background: var(--ab-s-ffffff, #fff); border: 1px solid var(--fe-border, var(--ab-b-e2e8f5, #e2e8f5)); border-radius: 8px;
    font-size: .85rem; color: var(--fe-text-muted, var(--ab-t-6b7cad, #6b7cad));
}
.fz-totali strong { color: var(--fe-text, var(--ab-t-1e2d5a, #1e2d5a)); font-variant-numeric: tabular-nums; }

/* Filtri di una pagina in vista telefono: una colonna, etichette sopra, controlli alti */
.fz-filtri-tel { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.fz-filtri-tel label { font-size: .78rem; font-weight: 600; color: var(--fe-text-muted, var(--ab-t-6b7cad, #6b7cad)); margin-bottom: 2px; }
.fz-filtri-tel .form-control,
.fz-filtri-tel .form-select,
.fz-filtri-tel input,
.fz-filtri-tel select { min-height: 40px; font-size: 16px; width: 100%; }
.fz-filtri-tel .pr-btn { min-height: 40px; }

/* Modale a tutto schermo sul telefono quando la pagina non può usare modal-fullscreen */
.fz-modale-tel.modal-dialog { max-width: none; width: 100%; height: 100%; margin: 0; }
.fz-modale-tel.modal-dialog .modal-content { height: 100%; border: 0; border-radius: 0; }
.fz-modale-tel.modal-dialog .modal-body { overflow-y: auto; }

/* ── FE\ElencoFattureElettroniche (Fatture ricevute / emesse) ───────── */
/* Barra filtri: due colonne, etichette sopra, controlli da 40px, non più agganciata in alto */
.efe-bar.fz-efe-bar--tel { position: static; }
.fz-efe-bar--tel .efe-bar-inner { padding: .5rem; gap: .5rem; }
.fz-efe-bar--tel .efe-bar-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; width: 100%; flex: 1 1 100%; }
.fz-efe-bar--tel .efe-bar-sep { display: none; }
.fz-efe-bar--tel .efe-bar-group { flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
.fz-efe-bar--tel .efe-bar-input,
.fz-efe-bar--tel .efe-bar-select { width: 100%; min-width: 0; height: 40px; font-size: 16px; }
.fz-efe-bar--tel .efe-btn { height: auto; min-height: 40px; justify-content: center; white-space: normal; text-align: center; }
.fz-efe-bar--tel .efe-btn-xmlzip { grid-column: 1 / -1; }
.fz-efe-bar--tel .dropdown .efe-btn { width: 100%; }

/* Elenco: niente altezza fissa né pannelli affiancati */
.efe-layout.fz-efe-layout--tel { display: block; height: auto; overflow: visible; }
.fz-efe-layout--tel .efe-list-panel { overflow: visible; border-right: 0; }
.fz-efe-tel { padding: .5rem; }
.fz-efe-legenda { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-bottom: .6rem; font-size: .75rem; color: var(--efe-text-muted, var(--ab-t-6b7cad, #6b7cad)); }
.fz-efe-legenda > span { display: inline-flex; align-items: center; gap: .3rem; }
.fz-efe-scheda.efe-row--orange { border-left: 4px solid var(--efe-orange, var(--ab-b-f97316, #f97316)); }
.fz-efe-scheda.efe-row--blue { border-left: 4px solid var(--efe-blue, var(--ab-b-1a56db, #1a56db)); }
.fz-efe-scheda.efe-row--unread .vt-scheda-titolo { font-weight: 800; }
.fz-efe-scheda .vt-scheda-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }

/* Dettaglio della fattura dentro la scheda */
.fz-efe-dett { margin: .6rem -.75rem -.65rem; border-top: 1px solid var(--efe-border, var(--ab-b-e2e8f5, #e2e8f5)); background: var(--ab-s-f9fbff, #f9fbff); border-radius: 0 0 10px 10px; cursor: default; }
.fz-efe-dett .efe-tab-bar { padding: 0 .25rem; }
.fz-efe-dett .efe-tab { min-height: 40px; }
.fz-efe-riga { padding: .5rem .75rem; border-bottom: 1px solid var(--efe-border, var(--ab-b-e2e8f5, #e2e8f5)); }
.fz-efe-riga:last-child { border-bottom: 0; }
.fz-efe-riga .vt-scheda-dati { margin-top: .2rem; }
.fz-efe-riga-testa { display: flex; gap: .4rem; align-items: baseline; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.fz-efe-allegati { padding: .6rem .75rem; flex-direction: column; }
.fz-efe-allegati .efe-allegato-btn { min-height: 40px; text-align: left; overflow-wrap: anywhere; }

/* Anteprima a tutto schermo (sopra barra in alto e menu) */
.efe-preview-panel.fz-efe-anteprima-tel {
    position: fixed; inset: 0; z-index: 1050;
    height: auto; flex: none; border: 0;
    display: flex; flex-direction: column;
}
.fz-efe-anteprima-tel .efe-preview-header { min-height: 52px; }
.fz-efe-anteprima-tel .efe-btn-menu { min-width: 40px; min-height: 40px; }
.fz-efe-anteprima-tel .efe-preview-document { padding: .5rem; overflow-x: auto; }
.fz-efe-chiudi { order: 2; min-width: 40px; min-height: 40px; }

/* ── FE\ElencoFattureDaInviare e FE\ElencoFattureInviate (classe fz-fe-tel sulla pagina) ── */
.ef-page.fz-fe-tel,
.efi-page.fz-fe-tel { padding: .5rem; }
.fz-fe-tel .ef-header,
.fz-fe-tel .efi-header { flex-direction: column; align-items: stretch; padding: .6rem .7rem; }
.fz-fe-tel .ef-actions,
.fz-fe-tel .efi-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.fz-fe-tel .ef-divider,
.fz-fe-tel .efi-divider { display: none; }
.fz-fe-tel .ef-btn,
.fz-fe-tel .efi-btn { min-height: 40px; justify-content: center; padding: .4rem .6rem; white-space: normal; text-align: center; }
.fz-fe-tel .ef-btn .ef-btn-label,
.fz-fe-tel .efi-btn .efi-btn-label { display: inline; }
.fz-fe-tel .ef-upload-wrap,
.fz-fe-tel .ef-upload-wrap .ef-btn,
.fz-fe-tel .dropdown,
.fz-fe-tel .dropdown .ef-btn,
.fz-fe-tel .dropdown .efi-btn { width: 100%; }
.fz-fe-tel .td-filter-bar { flex-direction: column; align-items: stretch; padding: .55rem .7rem; }
.fz-fe-tel .td-filter-field { flex-direction: column; align-items: stretch; gap: 2px; }
.fz-fe-tel .td-filter-select { width: 100%; min-height: 40px; font-size: 16px; }
.fz-fe-tel .td-filter-btn { min-height: 40px; justify-content: center; }
.fz-fe-tel .td-filter-range { justify-content: center; white-space: normal; }
.fz-fe-tel .vt-barra .form-select { flex: 1 1 160px; }

/* ── FE\ElencoRicevute: tabella a righe impilate ── */
.er-page.fz-er-tel { margin: .5rem auto; padding: 0 .5rem; }
.fz-er-tel .er-header { flex-direction: column; align-items: stretch; }
.fz-er-tel .er-back-btn { min-height: 40px; justify-content: center; }
.fz-er-tel .er-table thead { display: none; }
.fz-er-tel .er-table,
.fz-er-tel .er-table tbody,
.fz-er-tel .er-table tr,
.fz-er-tel .er-table td { display: block; width: 100%; }
.fz-er-tel .er-table tr.er-row { padding: .55rem .7rem; border-bottom: 1px solid var(--fe-border, var(--ab-b-e2e8f5, #e2e8f5)); }
.fz-er-tel .er-table tr.er-row td { padding: .15rem 0; border: 0; text-align: left !important; }
.fz-er-tel .er-filename { overflow-wrap: anywhere; }
.fz-er-tel .er-open-btn { width: 100%; min-height: 40px; justify-content: center; margin-top: .3rem; }

/* ── Fatturazione\ElencoTestateDocXcliente e StoricoPrezzi: select d'ordinamento nella barra ── */
.vt-barra .fz-ordina { flex: 1 1 160px; }

/* ── Fatturazione\StoricoPrezzi (classe fz-sp-tel sulla pagina) ── */
.sp-page.fz-sp-tel { padding: .5rem; gap: .6rem; }
.fz-sp-tel .sp-header { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; }
.fz-sp-tel .sp-card--filters { padding: .7rem; }
.fz-sp-tel .sp-filter-row { flex-direction: column; align-items: stretch; gap: .6rem; }
.fz-sp-tel .sp-field { flex: 1 1 auto; min-width: 0; }
.fz-sp-tel .sp-input,
.fz-sp-tel .sp-input-group .sp-input { min-width: 0; width: 100%; min-height: 40px; font-size: 16px; }
.fz-sp-tel .sp-input-btn { min-width: 44px; }
.fz-sp-tel .sp-radio { min-height: 40px; flex: 1 1 0; justify-content: center; }
.fz-sp-tel .sp-check { min-height: 40px; white-space: normal; }
.fz-sp-tel .sp-field--actions { flex-wrap: wrap; margin-left: 0; }
.fz-sp-tel .sp-field--actions .sp-btn { flex: 1 1 140px; min-height: 40px; justify-content: center; }
.fz-sp-tel .sp-grid-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }

/* ── Fatturazione\Ripetute (MagazzinoPaginaBase dà mg-pagina--tel; qui solo le aggiunte) ── */
.fz-ripetute.mg-pagina--tel .mg-campo > .d-flex { flex: 1 1 100%; }
.fz-ripetute.mg-pagina--tel .mg-riga.fz-mesi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.fz-ripetute.mg-pagina--tel .mg-riga.fz-mesi > .mg-check { grid-column: 1 / -1; }
.fz-ripetute.mg-pagina--tel textarea.form-control { font-size: 16px; min-height: 6rem; }
.fz-ripetute.mg-pagina--tel .pr-header-right .pr-btn { min-height: 40px; }
.fz-rip-elenco .vt-barra .pr-btn { min-height: 40px; }
.fz-rip-elenco .fz-filtri-tel > div { display: flex; flex-direction: column; }

/* ── Fatturazione\TrasformaDdtInFatture e TrasformaProformeInParcelle (classe fz-trasf-tel sulla sezione) ── */
.fe-section.fz-trasf-tel .fe-section-body { padding: .6rem; }
.fz-trasf-tel .td-filter-bar.td-filter-bar { flex-direction: column; align-items: stretch; padding: .6rem .7rem; }
.fz-trasf-tel .td-filter-field.td-filter-field { flex-direction: column; align-items: stretch; flex-wrap: wrap; width: 100%; margin-left: 0 !important; gap: .35rem; }
.fz-trasf-tel .td-filter-date,
.fz-trasf-tel .td-filter-select,
.fz-trasf-tel .td-filter-field .form-control { width: 100%; min-width: 0 !important; min-height: 40px; font-size: 16px; }
.fz-trasf-tel .td-filter-btn { min-height: 40px; justify-content: center; }
.fz-trasf-tel .td-filter-range { justify-content: center; white-space: normal; }
.fz-trasf-tel .td-filter-bar .form-check { margin-left: 0 !important; min-height: 32px; }
.fz-trasf-tel .fe-field-row--split { flex-direction: column; align-items: stretch; }
.fz-trasf-tel .fe-field-group,
.fz-trasf-tel .fe-field-group--sm,
.fz-trasf-tel .fe-field-group--md { flex: 1 1 auto; width: 100%; }
.fz-trasf-tel .fe-control input.form-control { min-height: 40px; font-size: 16px; }
.fz-trasf-tel .fe-section-body > .mb-3 > .btn,
.fz-trasf-tel .fe-section-body > .btn,
.fz-trasf-tel .fe-field-group > .btn { width: 100%; min-height: 40px; margin: 0 0 .4rem 0 !important; }
.fz-trasf-tel .form-check-inline { display: flex; min-height: 32px; }
.fz-trasf-righe { margin: .6rem -.75rem -.65rem; padding: .5rem .75rem .65rem; background: var(--ab-s-f8faff, #f8faff); border-top: 1px solid var(--fe-border, var(--ab-b-e2e8f5, #e2e8f5)); border-radius: 0 0 10px 10px; }
.fz-trasf-riga { padding: .45rem 0; border-bottom: 1px solid var(--fe-border, var(--ab-b-e2e8f5, #e2e8f5)); }
.fz-trasf-riga-testa { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; overflow-wrap: anywhere; cursor: pointer; margin: 0; }
.fz-trasf-righe > .pr-btn { width: 100%; min-height: 40px; justify-content: center; white-space: normal; }

/* ── Email\InvioMail e InvioMailMassivo: finestra a tutto schermo sul telefono (classe fz-im-tel) ── */
.fz-im-tel .im-card,
.fz-im-tel .imm-card { border-radius: 0; }
.fz-im-tel .im-header,
.fz-im-tel .imm-header { padding: .7rem .8rem; }
.fz-im-tel .im-close-btn,
.fz-im-tel .imm-close-btn { width: 40px; height: 40px; }
.fz-im-tel .im-body,
.fz-im-tel .imm-body { padding: .7rem; }
.fz-im-tel .im-field-row { flex-direction: column; align-items: stretch; gap: .25rem; }
.fz-im-tel .im-field-row .im-label { flex: none; padding-top: 0; font-size: .75rem; }
.fz-im-tel .im-field-row .im-err-msg { margin-left: 0; }
.fz-im-tel .im-control .im-input { font-size: 16px; min-height: 40px; }
.fz-im-tel .im-control--readonly { flex-wrap: wrap; padding: .5rem .85rem; }
.fz-im-tel .im-allegato-row { flex-wrap: wrap; }
.fz-im-tel .im-allegato-row .im-allegato-nome { white-space: normal; overflow-wrap: anywhere; }
.fz-im-tel .im-allegato-row .im-allegato-download { min-height: 40px; }
.fz-im-tel .im-footer,
.fz-im-tel .imm-footer { padding: .6rem .7rem; }
.fz-im-tel .im-footer .im-btn,
.fz-im-tel .imm-footer .imm-btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
.fz-im-tel .imm-dest-row { flex-wrap: wrap; padding: .6rem .7rem; }
.fz-im-tel .imm-dest-row .imm-dest-nome { white-space: normal; overflow-wrap: anywhere; }
.fz-im-tel .imm-dest-row .imm-dest-email { overflow-wrap: anywhere; }
.fz-im-tel .imm-dest-row .imm-dest-allegato { width: 100%; }
.fz-im-tel .imm-dest-row .imm-pdf-btn { width: 100%; min-height: 40px; justify-content: center; white-space: normal; overflow-wrap: anywhere; }
.fz-im-tel .imm-field-wrap .imm-input { font-size: 16px; min-height: 40px; }
.fz-im-tel .imm-field-wrap { padding: .5rem .7rem; }
.fz-im-tel .imm-richedit-wrap { padding: .5rem .5rem .7rem; }
.fz-im-tel .imm-esito-email { overflow-wrap: anywhere; }

/* ── Fatturazione attività (FatturazioneAttivita, FatturazioneAttivitaAnno) ── */
.fz-fattatt .fz-fa-num { text-align: right; font-variant-numeric: tabular-nums; min-width: 7.5rem; flex: 0 0 auto; }
.fz-fattatt .fz-fa-num--forte { font-weight: 700; }
.fz-fattatt .fz-fa-tot { display: grid; grid-template-columns: repeat(4, max-content); gap: .35rem 1.2rem; }
.fz-fattatt .fz-fa-tot > div,
.fz-fattatt .fz-fa-anno > div { display: flex; align-items: center; gap: .4rem; }
.fz-fattatt .fz-fa-tot label,
.fz-fattatt .fz-fa-anno label { font-size: .8rem; color: var(--ab-t-6b7cad, #6b7cad); min-width: 6.5rem; margin: 0; }
.fz-fattatt .fz-fa-anno { display: flex; flex-direction: column; gap: .35rem; }
.fz-fattatt.mg-pagina--tel .fz-fa-tot { grid-template-columns: minmax(0, 1fr); }
.fz-fattatt.mg-pagina--tel .fz-fa-num { flex: 1 1 auto; min-height: 40px; font-size: 16px; }
.fz-fattatt.mg-pagina--tel input[type=radio],
.fz-fattatt.mg-pagina--tel input[type=checkbox] { width: 22px; height: 22px; }

/* Menu del tasto destro sulle griglie (stile ContextMenuStrip di Windows Forms, come quello di StatoPratiche) */
.fz-ctx-fondo { position: fixed; inset: 0; z-index: 1054; background: transparent; }
.fz-ctx {
    position: fixed; z-index: 1055; min-width: 210px; padding: 2px;
    background: var(--ab-s-f2f2f2, #f2f2f2); border: 1px solid var(--ab-b-a0a0a0, #a0a0a0); box-shadow: 2px 2px 4px rgba(0,0,0,.25);
    font-family: "Segoe UI", Tahoma, sans-serif; font-size: 12px; color: var(--ab-t-000000, #000);
    display: flex; flex-direction: column; user-select: none;
    background-image: linear-gradient(to right, var(--ab-s-e8e8e8, #e8e8e8) 0, var(--ab-s-e8e8e8, #e8e8e8) 26px, var(--ab-s-d5d5d5, #d5d5d5) 26px, var(--ab-s-d5d5d5, #d5d5d5) 27px, transparent 27px);
}
.fz-ctx-voce {
    display: flex; align-items: center; width: 100%; height: 22px; padding: 0 18px 0 0;
    border: 1px solid transparent; background: transparent; text-align: left; white-space: nowrap;
    font: inherit; color: inherit; cursor: default;
}
.fz-ctx-voce > i { width: 26px; flex: none; text-align: center; font-size: 13px; }
.fz-ctx-voce > span { padding-left: 8px; flex: 1 1 auto; }
.fz-ctx-voce:hover:not(:disabled) { background: var(--ab-s-cce8ff, #cce8ff); border-color: var(--ab-b-99d1ff, #99d1ff); }
.fz-ctx-voce:disabled { color: var(--ab-t-8c8c8c, #8c8c8c); }
.fz-ctx-voce--bold { font-weight: 700; }
.fz-ctx-voce > .fz-ctx-freccia { width: auto; font-size: 9px; margin-right: -10px; }
.fz-ctx-nota { padding: 2px 8px 4px 34px; color: var(--ab-t-8c8c8c, #8c8c8c); font-style: italic; }
.fz-ctx-sottomenu { position: relative; }
.fz-ctx--figlio { position: absolute; left: 100%; top: -3px; display: none; }
.fz-ctx-sottomenu:hover > .fz-ctx--figlio { display: flex; }
