/* EMA Conta — scala leggibile e impaginazione applicativa */
html { font-size: 16px; }
body { line-height: 1.45; }

/* Navigazione orizzontale */
.portal-frame { display: block; min-height: 100vh; }
.side {
    position: sticky;
    z-index: 50;
    top: 0;
    width: 100%;
    height: 76px;
    padding: 0 28px;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    box-shadow: 0 2px 12px rgba(8, 27, 50, .16);
}

.purge-panel{max-width:980px;background:#fff;border:1px solid #d7e0ea;padding:28px;display:grid;gap:26px}.purge-summary h3{font-size:24px;margin:0 0 18px}.purge-summary p{font-size:16px;line-height:1.55}.purge-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.purge-stats span{background:#f3f7fb;border-left:4px solid #1683d8;padding:14px;font-size:15px}.purge-stats strong{display:block;font-size:28px;color:#10233f}.purge-form{border-top:1px solid #d7e0ea;padding-top:22px;display:grid;gap:14px;max-width:580px}.purge-form label{font-size:16px}.purge-form input{display:block;width:100%;margin-top:9px;padding:13px;border:1px solid #8fa4b8;font-size:16px}.purge-form button{background:#b42318;color:#fff;border:0;padding:14px 18px;font-size:16px;font-weight:700;cursor:pointer}.purge-form button:disabled{background:#9aa7b4;cursor:not-allowed}
.side-brand { min-width: 190px; padding: 0 26px 0 0; border: 0; border-right: 1px solid rgba(255,255,255,.14); }
.side-brand strong { font-size: 20px; }
.side-brand small { margin-top: 3px; font-size: 9px; }
.side > p { display: none; }
.side nav { min-width: 0; flex: 1; display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.side nav a { min-height: 42px; padding: 0 10px; gap: 6px; font-size: 12px; white-space: nowrap; }
.side form { margin: 0 0 0 auto; }
.side form button { width: auto; min-width: 120px; padding: 12px 16px; font-size: 12px; }

.portal-page { grid-column: auto; }
.portal-page > header { height: 78px; padding: 0 max(28px, calc((100vw - 1400px) / 2)); }
.portal-page header small { font-size: 11px; }
.portal-page h1 { font-size: 25px; }
.profile strong, .profile small { font-size: 12px; }
.profile > b { width: 42px; height: 42px; }
.page-content { width: min(1400px, 100%); margin: auto; padding: 40px 28px 60px; }

/* Titoli e azioni */
.eyebrow { margin-bottom: 12px; font-size: 12px; }
.welcome-row, .admin-heading { align-items: center; margin-bottom: 28px; }
.welcome-row h2, .admin-heading h2 { font-size: 32px; }
.welcome-row > div > span, .admin-heading > div > span { font-size: 15px; }
.welcome-row .action-button { min-height: 48px; padding: 0 20px; font-size: 14px; }
.alert { padding: 14px 16px; font-size: 14px; }

/* Dashboard */
.metro-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metro-grid article { min-height: 150px; padding: 22px; }
.metro-grid article > b { font-size: 38px; }
.metro-grid article strong { margin: 10px 0 7px; font-size: 15px; }
.metro-grid article small { font-size: 12px; }
.dashboard-panels { gap: 18px; margin-top: 22px; }
.dashboard-panels > article { padding: 28px; }
.dashboard-panels h3 { font-size: 20px; }
.readiness { margin-top: 28px; }
.readiness > b { width: 108px; height: 108px; font-size: 30px; }
.readiness > b small { font-size: 12px; }
.readiness strong, .readiness span small { font-size: 14px; }
.dashboard-panels li { padding: 15px 0; font-size: 13px; }

/* Utenti e sicurezza */
.admin-grid { grid-template-columns: minmax(360px, .75fr) 1.5fr; gap: 20px; }
.new-user-form, .user-list, .security-panel { padding: 28px; }
.new-user-form h3, .security-panel h3 { font-size: 20px; }
.new-user-form small, .security-panel p { font-size: 13px; }
.new-user-form label, .password-form label, .confirm-2fa label { font-size: 13px; }
.new-user-form input, .new-user-form select, .password-form input, .confirm-2fa input { min-height: 46px; font-size: 15px; }
.new-user-form button, .security-panel button { min-height: 45px; font-size: 13px; }
.user-row { min-height: 72px; grid-template-columns: 2fr 1fr .8fr; font-size: 13px; }
.user-row.head { min-height: 38px; font-size: 11px; }
.user-row > span > b { width: 36px; height: 36px; }
.state { padding: 6px 10px; }
.codes, .field-error { font-size: 12px; }

/* Importazioni e riconciliazione */
.import-grid { gap: 18px; }
.import-card { grid-template-columns: 54px 1fr auto; gap: 15px; padding: 22px; }
.import-card .import-icon { width: 48px; height: 48px; font-size: 17px; }
.import-card h3 { font-size: 17px; }
.import-card p { font-size: 13px; }
.import-card select, .import-card input { min-height: 42px; font-size: 13px; }
.import-card button { min-height: 42px; padding: 0 16px; font-size: 13px; }
.import-card > small { font-size: 11px; }
.year-create label { font-size: 13px; }
.year-create input { min-height: 39px; font-size: 14px; }
.year-create button { min-height: 39px; font-size: 12px; }
.document-list > h3 { font-size: 18px; }
.document-list strong { font-size: 13px; }
.document-list small, .document-list em, .file-kind { font-size: 11px; }
.transaction-card { padding: 26px; }
.transaction-card h3 { font-size: 18px; }
.transaction-card header p { font-size: 13px; }
.transaction-card header small { font-size: 12px; }
.transaction-card header > strong { font-size: 22px; }
.transaction-card button { min-height: 42px; padding: 0 16px; font-size: 13px; }
.proposal { padding: 18px; grid-template-columns: 68px 1fr auto; }
.score { width: 62px; height: 62px; }
.score b { font-size: 21px; }
.score small { font-size: 8px; }
.proposal strong { font-size: 14px; }
.proposal p { font-size: 13px; }
.proposal div > small, .pending-label, .reconciled-label { font-size: 11px; }
.empty-state p { font-size: 14px; }

/* Accesso riservato */
.auth-private-header .ema-brand small { font-size: 9px; }
.secure-label { font-size: 13px; }
.auth-private-card { width: min(470px, 100%); padding: 42px; }
.auth-private-card .auth-title h2 { font-size: 30px; }
.auth-title p { font-size: 11px; }
.auth-copy { font-size: 15px; }
.auth-form > label { font-size: 14px; }
.auth-form input { height: 50px; font-size: 16px; }
.form-line { font-size: 12px; }
.auth-form button { height: 50px; font-size: 15px; }
.private-notice { font-size: 11px; }

/* Introduzione */
.onboarding-modal { padding: 38px; }
.onboarding-modal h2 { font-size: 29px; }
.onboarding-modal > p:not(.eyebrow) { font-size: 15px; }
.onboarding-points span { font-size: 14px; }
.onboarding-modal button { min-height: 46px; font-size: 14px; }
.onboarding-modal > small { font-size: 11px; }

@media (max-width: 1050px) {
    .side { height: auto; min-height: 76px; flex-wrap: wrap; padding: 12px 20px; gap: 10px 18px; }
    .side nav { order: 3; width: 100%; overflow-x: auto; }
    .side nav a { white-space: nowrap; }
    .side form { margin-left: auto; }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .side-brand { min-width: 0; }
    .side-brand > span:last-child { display: none; }
    .side form button { min-width: 0; font-size: 0; }
    .side form button::after { content: 'Esci'; font-size: 12px; }
    .portal-page > header, .page-content { padding-left: 18px; padding-right: 18px; }
    .metro-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-panels { grid-template-columns: 1fr; }
    .welcome-row { align-items: flex-start; flex-direction: column; }
    .import-grid { grid-template-columns: 1fr; }
    .import-card.import-documents { grid-column: auto; }
}
@media (max-width: 480px) {
    .metro-grid { grid-template-columns: 1fr; }
    .portal-page > header { height: auto; min-height: 72px; gap: 12px; }
    .profile span { display: none; }
    .page-content { padding-top: 28px; }
    .welcome-row h2, .admin-heading h2 { font-size: 27px; }
    .auth-private-card { padding: 30px 24px; }
}
