/* Layout dell'app. Colori e font vengono da brand.css. */

body { min-height: 100vh; display: flex; flex-direction: column; }

.salta { position: absolute; top: 8px; left: 8px; z-index: 10; padding: 8px 12px; background: var(--superficie); color: var(--fg); }

/* Testata */
.testata { border-bottom: 1px solid var(--linea); }
.testata-riga { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.marchio { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); }
.marchio:hover { color: var(--fg); }
.logo { height: 26px; width: auto; }
.testata-azioni { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.icona { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-icona { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    color: var(--fg); border: 1px solid var(--linea); }
.btn-icona:hover { color: var(--fg); border-color: var(--muted); }
.btn-esci { min-height: 44px; color: var(--fg); border-color: var(--linea); }
.btn-esci:hover { background: transparent; color: var(--fg); border-color: var(--muted); }

/* Tema: si vede l'icona del tema in cui si passa. */
.icona-luna { display: none; }
[data-bs-theme="light"] .icona-sole { display: none; }
[data-bs-theme="light"] .icona-luna { display: block; }

/* AppSwitcher (handoff §12.1) */
.app-switcher { display: flex; align-items: stretch; gap: 4px; align-self: stretch; }
.app-switcher a { display: inline-flex; align-items: center; min-width: 44px; padding: 0 14px; color: var(--muted);
    text-decoration: none; border-bottom: 2px solid transparent; }
.app-switcher a:hover { color: var(--fg); }
.app-switcher-hub { justify-content: center; padding: 0 10px; }
.app-switcher-tab { font-weight: 600; letter-spacing: .08em; }
.app-switcher-tab.attivo { color: var(--fg); border-bottom-color: var(--accent); }

/* Pagina */
.pagina { flex: 1; padding-top: 64px; padding-bottom: 64px; }
.titolo-display { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 16px; }
.occhiello { color: var(--muted); margin-bottom: 12px; }

/* Accesso */
.accesso { max-width: 420px; margin: 0 auto; }
.accesso-form { display: grid; gap: 12px; margin-top: 32px; }
.accesso-form .btn { margin-top: 8px; }
.errore-campo { color: var(--error); font-size: 13px; line-height: 20px; min-height: 20px; }

/* Hub */
.moduli { list-style: none; padding: 0; margin: 48px 0 0; border-top: 1px solid var(--linea); max-width: 880px; }
.moduli li { border-bottom: 1px solid var(--linea); }
.modulo { display: grid; grid-template-columns: 72px 1fr; column-gap: 24px; padding: 32px 0; color: var(--fg); text-decoration: none; }
.modulo .numero { grid-row: span 2; font-size: 40px; line-height: 44px; }
.modulo-titolo { font-size: 28px; line-height: 32px; font-weight: 700; }
.modulo-descrizione { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.modulo:hover .modulo-titolo { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }

.titolo-sezione { font-size: 20px; line-height: 28px; font-weight: 700; margin: 40px 0 16px; display: flex; align-items: baseline; gap: 12px; }
.conteggio { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; color: var(--muted); }
.btn-secondario { min-height: 44px; color: var(--fg); border-color: var(--linea); display: inline-flex; align-items: center; }
.btn-secondario:hover { background: transparent; color: var(--fg); border-color: var(--muted); }

/* Caricamento */
.caricamento { display: grid; gap: 16px; max-width: 640px; margin-top: 32px; }
.caricamento .btn { justify-self: start; }
.area-caricamento { display: grid; gap: 4px; justify-items: center; padding: 48px 24px; text-align: center; cursor: pointer;
    border: 1px dashed var(--muted); background: var(--superficie); }
.area-caricamento:hover, .area-caricamento.trascinamento { border-color: var(--fg); }
.caricamento:has(input:focus-visible) .area-caricamento { outline: 2px solid var(--purple); outline-offset: 2px; }
.area-titolo { font-weight: 600; font-size: 17px; }
.area-nome { color: var(--fg); font-size: 13px; min-height: 20px; }

/* Report */
.report-testata { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.report-file { font-size: 13px; overflow-wrap: anywhere; }
.avviso { border-left: 3px solid var(--warn); padding: 12px 16px; margin: 16px 0 0; background: var(--superficie); }

.schede { margin-top: 32px; border-bottom: 1px solid var(--linea); gap: 4px; }
.schede .nav-link { min-height: 44px; padding: 0 16px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    background: none; font-weight: 600; }
.schede .nav-link:hover { color: var(--fg); }
.schede .nav-link.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab-pane:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }

.cifre { display: flex; flex-wrap: wrap; gap: 48px; margin: 32px 0 0; }
.cifre dt { font-size: 11px; line-height: 16px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.cifre dd { margin: 4px 0 0; font-size: 40px; line-height: 44px; font-weight: 500; }
.cifre .cifra-nota { font-size: 13px; line-height: 20px; color: var(--muted); font-family: var(--bs-font-sans-serif); }

.esiti { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--linea); max-width: 720px; }
.esito { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.esito .numero { font-size: 17px; }
.stato { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; }
.stato::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: currentColor; }
.stato-ok { color: var(--ok); }
.stato-attenzione { color: var(--warn); }
.stato-neutro { color: var(--muted); }

/* Tabella unica (_Tabella.cshtml) */
.tabella-contenitore { border-top: 1px solid var(--linea); }
.tabella { --bs-table-bg: transparent; --bs-table-color: var(--fg); --bs-table-border-color: var(--linea);
    font-size: 13px; line-height: 20px; margin: 0; }
.tabella th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabella th, .tabella td { padding: 10px 12px; vertical-align: top; }
.tabella .num { text-align: right; font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabella .codice { font-family: "JetBrains Mono", ui-monospace, monospace; white-space: nowrap; }
.tabella tfoot td { font-weight: 700; border-top: 2px solid var(--fg); }

/* Piede */
.piede { border-top: 1px solid var(--linea); padding: 20px 0; color: var(--muted); }

@media (max-width: 575.98px) {
    .testata-riga { gap: 12px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
    .app-switcher { order: 3; width: 100%; }
    .titolo-display { font-size: 28px; line-height: 32px; }
    .modulo { grid-template-columns: 48px 1fr; column-gap: 16px; }
    .modulo .numero { font-size: 28px; line-height: 32px; }
}
