.hm-header { border-bottom: 1px solid var(--line); }
.hm-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.hm-brand { display: flex; align-items: center; gap: 16px; color: var(--fg); text-decoration: none; }
.hm-brand__app { font-weight: 600; padding-left: 16px; border-left: 1px solid var(--line); }

.hm-header__actions { display: flex; align-items: center; gap: 12px; }
.hm-session { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hm-session::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.hm-login { max-width: 360px; margin: 0 auto; text-align: center; }
.hm-login__title { font-size: 32px; line-height: 40px; font-weight: 700; margin-bottom: 8px; }
.hm-login__form { display: grid; gap: 16px; margin-top: 32px; }
.hm-pin { font-size: 28px; letter-spacing: .5em; text-align: center; padding-block: 12px; }
.hm-pin[aria-invalid="true"] { border-color: var(--error); }
.hm-error { color: var(--error); font-size: 14px; margin: -4px 0 0; }

.hm-icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--fg); font-size: 18px; }
.hm-icon-btn:hover { border-color: var(--muted); }

.hm-main { padding-block: 72px; min-height: calc(100vh - 64px - 56px); }

.hm-hero { max-width: 720px; margin-bottom: 56px; }
.hm-display { font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -.01em; margin: 8px 0 20px; }
.hm-lead { font-size: 17px; line-height: 26px; color: var(--muted); }

/* Fonti dati: griglia 2×2 di card upload */
.hm-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hm-card { border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: grid; gap: 16px; align-content: start; }
.hm-source.is-drag { border-color: var(--lime); }
.hm-source__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hm-source__title { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0; }
.hm-source__files { font-size: 13px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }

.hm-badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.hm-badge--ok { background: var(--ok); color: #fff; }

.hm-drop { display: grid; gap: 4px; place-items: center; min-height: 120px; width: 100%;
  border: 1px dashed var(--muted); border-radius: 8px; background: transparent; color: var(--fg); }
.hm-drop:hover, .hm-source.is-drag .hm-drop { border-color: var(--lime); }
.hm-drop__ext { font-size: 12px; color: var(--muted); }

.hm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.hm-stats dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hm-stats dd { font-size: 20px; line-height: 28px; margin: 0; }

.hm-months { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hm-months li { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.hm-months li.is-on { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }

.hm-warn { color: var(--warn); font-size: 14px; margin: 0; }
.hm-note, .hm-busy { color: var(--muted); font-size: 13px; margin: 0; }
.hm-link { justify-self: start; background: none; border: 0; padding: 0; color: var(--fg); text-decoration: underline; font-size: 14px; }

.hm-confirm { border: 1px solid var(--warn); border-radius: 8px; padding: 16px; display: grid; gap: 8px; }
.hm-confirm p { margin: 0; font-size: 14px; }
.hm-confirm__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* Report generati */
.hm-reports { margin-top: 56px; display: grid; gap: 24px; }
.hm-section-title { font-size: 24px; line-height: 32px; font-weight: 700; margin: 0; }
.hm-generate { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hm-report { grid-template-columns: 1fr auto; align-items: center; max-width: 560px; }
.hm-report .hm-note { margin-top: 4px; }

.hm-alert { border: 1px solid var(--warn); border-radius: 12px; padding: 20px 24px; display: grid; gap: 8px; max-width: 720px; }
.hm-alert__title { font-size: 16px; font-weight: 700; color: var(--warn); margin: 0; }
.hm-alert p { margin: 0; font-size: 14px; }
.hm-chips { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hm-chips li { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--warn); }

.hm-footer { border-top: 1px solid var(--line); padding-block: 16px; }

@media (max-width: 576px) {
  .hm-display { font-size: 40px; line-height: 44px; }
  .hm-brand__app { display: none; }
}
@media (max-width: 768px) {
  .hm-sources { grid-template-columns: 1fr; }
}
