/* Layout condiviso delle app interne HotMinds: header, contenuto, footer. */

body { display: flex; flex-direction: column; min-height: 100vh; font-size: 15px; line-height: 24px; }

.hm-header, .hm-footer { background: var(--bg); }
[data-bs-theme="light"] .hm-header, [data-bs-theme="light"] .hm-footer { background: var(--surface); }

.hm-header { border-bottom: 1px solid var(--line); }
.hm-header__inner, .hm-footer__inner, .hm-main {
  width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 2rem;
}
.hm-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }

.hm-brand { display: flex; align-items: center; gap: 1rem; color: var(--fg); text-decoration: none; }
.hm-brand:hover { color: var(--fg); }
.hm-logo { height: 22px; width: auto; display: block; }
.hm-brand__app {
  padding-left: 1rem; border-left: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.hm-header__azioni { display: flex; align-items: center; gap: 0.75rem; }

.hm-utente {
  display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.5rem;
  background: none; border: 0; color: var(--fg); font-size: 13px; font-weight: 600;
}
.hm-utente__iniziale {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 13px;
}

.hm-icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--fg);
}
.hm-icon-btn:hover { border-color: var(--muted); }
.hm-icona-sole { display: none; }
[data-bs-theme="light"] .hm-icona-sole { display: block; }
[data-bs-theme="light"] .hm-icona-luna { display: none; }

.hm-main { flex: 1; padding-block: 2.5rem 4rem; }

.hm-footer { border-top: 1px solid var(--line); }
.hm-footer__inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; font-size: 13px; color: var(--muted); }

/* Tipografia editoriale */
.hm-caps { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
[data-bs-theme="light"] .hm-caps { color: #556410; } /* il lime su carta non regge il 4.5:1 */
.hm-title { font-size: 28px; line-height: 32px; font-weight: 700; margin-bottom: 0.5rem; }
.hm-lead { font-size: 15px; color: var(--muted); margin-bottom: 0; }
.hm-muted { color: var(--muted); }

.hm-page-head { padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }

.hm-empty { padding: 2rem; border: 1px dashed var(--line); border-radius: 6px; }
.hm-empty__titolo { font-weight: 600; margin-bottom: 0.25rem; }
.hm-empty .hm-muted { margin-bottom: 0; font-size: 13px; }

/* Form */
.hm-accesso { max-width: 420px; margin: 2rem auto 0; }
.hm-form { margin-top: 2rem; }
.form-label { font-size: 13px; font-weight: 600; }
.form-control { min-height: 44px; background: var(--surface); border-color: var(--line); color: var(--fg); }
.form-control:focus { background: var(--surface); color: var(--fg); border-color: var(--purple); box-shadow: none; }
.hm-btn { min-height: 44px; padding-inline: 2rem; font-weight: 600; }
.hm-field-error { display: block; margin-top: 0.25rem; font-size: 13px; color: var(--error); }
.hm-alert { padding: 0.75rem 1rem; margin-bottom: 1.5rem; border-left: 3px solid var(--error); background: var(--surface); font-size: 13px; }
.hm-alert ul { margin: 0; padding: 0; list-style: none; }
.hm-alert.validation-summary-valid { display: none; }
.hm-alert strong { display: block; }
.hm-form--stretto { max-width: 560px; }
.hm-form__azioni { display: flex; align-items: center; gap: 1.5rem; }
.form-select { min-height: 44px; background-color: var(--surface); border-color: var(--line); color: var(--fg); }
.form-select:focus { border-color: var(--purple); box-shadow: none; }

/* Navigazione */
.hm-nav { display: flex; gap: 0.25rem; margin-right: auto; }
.hm-nav__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.75rem;
  color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent;
}
.hm-nav__link:hover { color: var(--fg); }
.hm-nav__link[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

.hm-link { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.hm-link:hover { color: var(--fg); text-decoration-color: currentColor; }
.hm-caps .hm-link { color: inherit; }
.hm-link-btn { padding: 0; background: none; border: 0; font-size: inherit; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.hm-link-btn:hover { text-decoration-color: currentColor; }

/* Liste */
.hm-page-head--azioni { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hm-subtitle { font-size: 18px; font-weight: 700; margin-bottom: 1rem; }
.hm-filtri { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.hm-filtri__campo { flex: 1 1 220px; max-width: 320px; }
.hm-filtri__campo .form-label { margin-bottom: 0.25rem; }
.hm-conteggio, .hm-nota { font-size: 13px; color: var(--muted); }
.hm-nota { margin-top: 1rem; }
.hm-table { --bs-table-bg: transparent; --bs-table-color: var(--fg); font-size: 14px; }
.hm-table th { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hm-table td, .hm-table th { padding: 0.75rem; vertical-align: middle; }
.hm-table a { color: var(--fg); font-weight: 600; }
.hm-azioni { display: flex; justify-content: flex-end; gap: 1rem; white-space: nowrap; }
.hm-azioni form { margin: 0; }
.hm-riga-spenta td { color: var(--muted); }
.hm-stato { display: inline-block; padding: 0.125rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hm-stato--ok { border-color: var(--ok); color: var(--fg); }

.hm-dati { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 1rem 0 0; }
.hm-dati dt { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hm-dati dd { margin: 0; }

.hm-stato--errore { border-color: var(--error); color: var(--fg); }
.hm-azioni--sinistra { justify-content: flex-start; align-items: center; }
.hm-avviso { padding: 0.75rem 1rem; margin-bottom: 1.5rem; border-left: 3px solid var(--accent); background: var(--surface); font-size: 13px; }
.hm-avviso strong { display: block; }
.hm-avviso--ok { border-left-color: var(--ok); }

/* Invii e modelli e-mail */
.hm-griglia-campi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.hm-scelte { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.hm-scelta { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.hm-destinatari__barra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-bottom: 0.5rem; }
.hm-destinatari__barra .hm-conteggio { margin-right: auto; }
.hm-destinatari__elenco { max-height: 420px; overflow-y: auto; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 6px; }
.hm-destinatari__elenco li + li { border-top: 1px solid var(--line); }
.hm-destinatari__elenco label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-height: 44px; padding: 0.5rem 0.75rem; cursor: pointer; }
.hm-destinatari__elenco .hm-muted { font-size: 13px; }
.hm-con-legenda { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.hm-con-legenda > .hm-form { margin-top: 0; }
.hm-testo-email { font-family: var(--font-mono, monospace); font-size: 13px; }
.hm-segnaposto { padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.hm-segnaposto__titolo { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hm-segnaposto dl { margin: 0; }
.hm-segnaposto dl > div + div { margin-top: 0.5rem; }
.hm-segnaposto dd { margin: 0; color: var(--muted); }
.hm-anteprima { margin-bottom: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.hm-anteprima__oggetto { font-weight: 700; padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.hm-anteprima__corpo { white-space: pre-wrap; }
.hm-elenco-destinatari { margin-bottom: 1.5rem; font-size: 13px; }
.hm-elenco-destinatari summary { font-weight: 600; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.hm-elenco-destinatari ul { max-height: 240px; overflow-y: auto; padding-left: 1.25rem; }

@media (max-width: 991.98px) {
  .hm-con-legenda { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .hm-header__inner, .hm-footer__inner, .hm-main { padding-inline: 1.25rem; }
  .hm-brand__app, .hm-utente__nome { display: none; }
  .hm-nav__link { padding: 0 0.5rem; }
  .hm-filtri__campo { max-width: none; }
}
