/* Shared System pages, matching the approved outline icons and reference cards. */
.portal-sidebar .portal-link svg{width:20px;height:20px;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none;flex:0 0 20px}
.portal-shell>main:has(.system-page){background:#f4f7f9;padding:30px 32px 42px;max-width:none}
.portal-shell>main:has(.system-page)>.section-back{display:none}
.system-page{--system-ink:#1c414f;--system-muted:#78909e;--system-primary:#006480;--system-accent:#00abc5;--system-border:#d7e4eb;max-width:1760px;margin:0 auto;color:var(--system-ink)}
.system-page svg,.system-dialog svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.system-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:0 0 24px}
.system-head>div:first-child{min-width:0}
.portal-shell .system-page>.system-head{position:static;height:auto;min-height:0;padding:0;background:transparent;border:0;box-shadow:none;flex-wrap:nowrap;z-index:auto}
.portal-shell .system-page .system-kicker{color:#00a3bf;margin:0;font-size:11px!important}
.portal-shell .system-page h1{font-size:var(--medicare-type-heading,18px)!important;line-height:1.3;font-weight:600!important;letter-spacing:normal!important;color:var(--system-ink)!important;margin:8px 0 9px}
.portal-shell .system-page h2{font-size:20px!important;font-weight:700!important;color:var(--system-ink)!important;line-height:1.35;margin:4px 0 5px}
.portal-shell .system-page h3{font-size:15px!important;font-weight:650!important;color:var(--system-ink)!important;line-height:1.45;margin:0}
.portal-shell .system-page p{color:var(--system-muted);line-height:1.6;margin:4px 0 12px}
.system-page .system-kicker,.system-dialog .system-kicker{font-size:11px;font-weight:750;letter-spacing:2.2px;color:#00a3bf;text-transform:uppercase;line-height:1.6}
.portal-shell .system-page .system-meta,.portal-shell .system-page .system-meta p,.portal-shell .system-dialog .system-meta{font-size:11px!important;color:var(--system-muted,#78909e);line-height:1.6}
.system-grid{display:grid;gap:18px;margin:0 0 20px;grid-template-columns:repeat(2,minmax(0,1fr))}
.system-card{background:#fff;border:1px solid var(--system-border);border-radius:14px;padding:22px;box-shadow:0 4px 18px #244c6010;min-width:0}
.system-card>p:last-child{margin-bottom:0}
.system-head-actions,.system-card-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.portal-shell .system-page .system-button,.portal-shell .system-dialog .system-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;box-sizing:border-box;width:auto;min-height:42px;padding:10px 16px;border:1px solid #d5e2e9;border-radius:10px;background:#fff;color:#075d78;font-size:13px!important;font-weight:650!important;font-family:inherit;text-decoration:none;line-height:1.3;white-space:nowrap;box-shadow:none;cursor:pointer;margin:0}
.portal-shell .system-page .system-button.primary,.portal-shell .system-dialog .system-button.primary{background:#006581;border-color:#006581;color:#fff}
.portal-shell .system-page .system-button:hover,.portal-shell .system-dialog .system-button:hover{background:#edf7fa;border-color:#a9ccd8}
.portal-shell .system-page .system-button.primary:hover,.portal-shell .system-dialog .system-button.primary:hover{background:#00546d;border-color:#00546d}
.portal-shell .system-page .system-button:disabled,.portal-shell .system-dialog .system-button:disabled{opacity:.45;cursor:not-allowed}
.system-page .system-button.icon-only,.system-dialog .system-button.icon-only{padding:10px;width:42px;min-width:42px}
.system-page .system-button.danger,.system-dialog .system-button.danger{color:#d8424c}
.system-page .system-button svg,.system-dialog .system-button svg{width:19px;height:19px}
.system-page [hidden],.system-dialog [hidden]{display:none!important}
.system-notice,.system-error{padding:13px 16px;border:1px solid #b9dfe9;border-radius:10px;background:#eff9fc;color:#205c6e!important;overflow-wrap:anywhere}
.system-error,.system-notice.is-error{border-color:#f0c8cd;background:#fff4f5;color:#a32f3c!important}
.system-empty{padding:28px 0;text-align:center;color:var(--system-muted)}
.system-page .system-card-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:#eaf7fa;color:#008da9;flex:0 0 auto}
.system-card-icon>svg{width:28px;height:28px}
.system-page :is(input[type=search],input[type=text],input[type=password],select){box-sizing:border-box;border:1px solid #d4e1e8;border-radius:10px;background:white;color:#254452;min-height:44px;padding:10px 13px;font:inherit;box-shadow:none;max-width:100%;margin:0}
.system-page input:focus,.system-page select:focus,.system-dialog input:focus{outline:2px solid #00abc5;outline-offset:2px}
.system-page button:focus-visible,.system-page a:focus-visible,.system-dialog button:focus-visible{outline:2px solid #00abc5;outline-offset:3px}

/* Updates: agent row, upload/state columns and full-width release archive. */
.updates-agent-grid{grid-template-columns:1.05fr 1.95fr}
.updates-agent-card,.updates-controlled-card{display:flex;align-items:center;gap:17px;padding:18px 20px;min-height:94px;box-sizing:border-box}
.updates-agent-card .system-card-icon{background:#e8f6f0;color:#14946d}
.updates-controlled-card{background:#f7fcfd}
.updates-controlled-card .system-card-icon{width:32px;height:42px;background:none;border-radius:0}
.portal-shell .updates-controlled-card h2{font-size:15px!important;margin-bottom:4px}
.portal-shell .updates-controlled-card p{font-size:12px!important;margin:0}
.updates-agent-state{display:flex;align-items:center;gap:7px;font-size:20px;line-height:1.4;margin-top:2px}
.updates-agent-card .system-kicker{font-size:10px;letter-spacing:1.4px;color:#7b94a3}
.updates-agent-card p{margin:0}
.updates-dot{width:8px;height:8px;display:inline-block;border-radius:50%;background:#b4c2ca}
.updates-dot.online{background:#1aaf84}.updates-dot.offline{background:#d94c58}
.updates-main-grid{grid-template-columns:1fr 1fr;align-items:stretch}
.updates-upload-card>p,.updates-state-card>p{padding-bottom:16px;border-bottom:1px solid #e7eef2}
.updates-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;box-sizing:border-box;min-height:186px;margin:18px 0 20px!important;padding:26px 18px;border:1.5px dashed #a8cfdc;border-radius:14px;background:#f8fcfd;color:#456b7c;text-align:center;cursor:pointer;overflow-wrap:anywhere}
.updates-dropzone>svg{width:34px;height:34px;margin-bottom:3px;color:#00a5c0}
.updates-dropzone>span:not(.system-button){font-size:11px;color:#8da2ae}
.updates-dropzone input[type=file]{position:absolute;width:1px;height:1px;opacity:0;clip-path:inset(50%);overflow:hidden}
.updates-dropzone:focus-within{outline:2px solid #00abc5;outline-offset:3px}
.updates-dropzone.is-dragover{background:#e6f6fb;border-color:#0097b5}
.system-page .updates-file-picker{min-height:30px;font-size:11px!important;padding:5px 10px}
.updates-upload-card form>button{margin-top:0}
.updates-current-line{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:20px 0 13px;flex-wrap:wrap}
.updates-state-badge,.updates-type-pill,.updates-verified{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:750;border-radius:20px;padding:5px 10px;line-height:1.5;background:#edf2f5;color:#6f8592}
.updates-state-badge[data-state=completed]{background:#e7f6ef;color:#11835f}
.updates-state-badge[data-state=failed]{background:#fdeced;color:#b72f3e}
.updates-state-badge[data-state=running],.updates-state-badge[data-state=rolling_back]{background:#eaf6fc;color:#04779e}
.updates-state-badge[data-state=rollback_failed]{background:#fde6e9;color:#a52435}
.updates-type-pill{background:#fff4dd;color:#a96915}
.updates-verified{background:#e9f7f0;color:#16835d}
.updates-verified svg{width:14px;height:14px}
.updates-state-card h3{overflow-wrap:anywhere}
.system-page progress{display:block;width:100%;height:10px;margin:18px 0 8px;accent-color:#00acc5;border:0;border-radius:30px;background:#e8f0f4;overflow:hidden}
.system-page progress::-webkit-progress-bar{background:#e8f0f4;border-radius:30px}
.system-page progress::-webkit-progress-value{background:linear-gradient(90deg,#005c79,#00b2c8);border-radius:30px}
.system-page progress::-moz-progress-bar{background:linear-gradient(90deg,#005c79,#00b2c8);border-radius:30px}
.updates-state-card details{margin-top:15px;color:#577b8b}
.updates-state-card summary{cursor:pointer;font-weight:650}
.updates-log{max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.6 ui-monospace,monospace;color:#365467;background:#f1f6f9;border:1px solid #dce7ed;border-radius:10px;padding:13px}
.updates-releases-card>p{padding-bottom:16px;border-bottom:1px solid #e6edf2}
.updates-release-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:17px;align-items:center;padding:20px 0;border-bottom:1px solid #e6edf2}
.updates-release-row:last-child{border-bottom:0;padding-bottom:4px}
.updates-release-icon{display:grid;place-items:center;width:48px;height:58px;border-radius:14px;background:#eaf7fb;color:#047fa0}
.updates-release-icon svg{width:25px;height:25px}
.updates-release-heading{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.portal-shell .updates-release-row h3{font-size:13px!important;font-weight:700!important;overflow-wrap:anywhere}
.updates-release-info p{margin:4px 0 0;overflow-wrap:anywhere}
.portal-shell .updates-release-info>p:not(.system-meta){font-size:12px!important}
.updates-release-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.portal-shell .updates-release-actions .system-button{min-height:38px;padding:8px 11px;font-size:12px!important}
.updates-storage-summary{display:flex;align-items:flex-start;gap:12px;margin:16px 0 12px;padding:14px 16px;border:1px solid #deebf0;border-radius:12px;background:#f7fcfd;color:#305c6e}
.updates-storage-icon{display:grid;place-items:center;flex:0 0 28px;color:#087f9e}.updates-storage-icon svg{width:23px;height:23px}
.portal-shell .updates-storage-summary strong{font-size:13px!important;font-weight:650!important}.updates-storage-summary p{margin:4px 0 0!important}
.updates-storage-audit{margin:12px 0 5px;color:#577b8b;font-size:12px}.updates-storage-audit summary{cursor:pointer;font-weight:650}.updates-storage-audit>p{margin:9px 0}
.updates-storage-warnings{padding:10px 12px 10px 28px;border:1px solid #f0d7a0;border-radius:10px;background:#fff9ec;color:#805c1d;overflow-wrap:anywhere}
.updates-storage-files{list-style:none;padding:0;margin:10px 0;max-height:280px;overflow:auto;border:1px solid #deebf0;border-radius:10px}.updates-storage-files li{display:grid;gap:3px;padding:10px 12px;border-bottom:1px solid #e6edf2}.updates-storage-files li:last-child{border-bottom:0}.updates-storage-files code{font-size:11px;color:#365467;white-space:normal;overflow-wrap:anywhere}
.updates-delete-dialog .system-dialog-icon{color:#c73846;background:#fff0f1}.portal-shell .updates-delete-dialog .system-dialog-body>p:first-child{color:#4e6d7c!important}.portal-shell .updates-delete-dialog .system-button.danger{background:#c73846;border-color:#c73846;color:#fff}.portal-shell .updates-delete-dialog .system-button.danger:hover{background:#ad2e3b;border-color:#ad2e3b}.updates-delete-dialog .system-dialog-actions .system-button{min-width:150px}

/* Consent dialogs: large shield, selected release, explicit final action. */
.system-dialog{--system-muted:#78909e;box-sizing:border-box;width:min(760px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 40px);overflow-y:auto;margin:auto;padding:30px;border:1px solid #cbdde7;border-radius:24px;background:#fff;color:#1c414f;box-shadow:0 28px 90px #163b4b3d}
.system-dialog::backdrop{background:#18374766;backdrop-filter:blur(4px)}
.system-dialog-head{display:flex;align-items:flex-start;gap:24px}
.system-dialog-head>div{flex:1;min-width:0}
.system-dialog-icon{display:grid;place-items:center;flex:0 0 68px;width:68px;height:68px;border-radius:20px;background:#e9f7fa;color:#008aa8}
.system-dialog-icon svg{width:38px;height:38px}
.portal-shell .system-dialog h2{font-size:clamp(22px,2vw,29px)!important;line-height:1.25;font-weight:700!important;color:#1b414e!important;letter-spacing:-.7px!important;margin:9px 0 7px;overflow-wrap:anywhere}
.system-dialog-head>.system-button{flex:0 0 auto;min-width:32px;width:32px;min-height:32px;padding:5px;border:0}
.system-dialog-body{margin:22px 0 0 92px;line-height:1.6}
.portal-shell .system-dialog-body>p:first-child{background:#f4fbfd;border:1px solid #cfe6ef;border-radius:14px;padding:17px;color:#587e8d!important;font-size:14px!important}
.updates-confirm-package{display:grid;gap:6px;margin:16px 0;overflow-wrap:anywhere}
.updates-confirm-package code{font-size:10px;color:#7c929e;overflow-wrap:anywhere}
.updates-package-details{margin:15px 0;color:#78909e;font-size:11px}.updates-package-details summary{cursor:pointer;font-size:11px!important}
.system-dialog-actions{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin:24px 0 0 92px;padding-top:22px;border-top:1px solid #e1ebef}
.system-dialog-actions .system-button{min-width:130px;min-height:48px}

/* Audit: searchable chronology, real totals and server-paginated exports. */
.audit-filters{padding:16px 18px;margin-bottom:16px}
.audit-search{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0}
.audit-search-main{display:flex;align-items:center;gap:10px;flex:1 1 360px;min-width:0}
.audit-search-main input{width:100%;min-width:0}
.audit-search-main svg{color:#839eac}
.audit-filter-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.audit-results{padding:0;overflow:hidden}
.audit-results-head{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:17px 18px;flex-wrap:wrap}
.audit-total{display:flex;align-items:center;gap:9px;color:#537b8c}
.audit-total strong{font-size:18px;color:#08607c}
.audit-export-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.audit-export-help{padding:0 18px 10px}
.audit-table-wrap{overflow:auto;max-width:100%}
.audit-table{border-collapse:collapse;width:100%;min-width:780px;text-align:left;table-layout:fixed;margin:0}
.portal-shell .system-page .audit-table th{font-size:10px!important;text-transform:uppercase;letter-spacing:1px;font-weight:750;color:#638394;background:#f0f5f7;padding:19px 14px;border:1px solid #dfe9ef;text-align:left}
.audit-table td{padding:17px 14px;border:1px solid #e1e9ee;color:#617f8f;vertical-align:top;overflow-wrap:anywhere;line-height:1.5}
.audit-table th:first-child,.audit-table td:first-child{border-left:0;width:17%}
.audit-table th:nth-child(2){width:22%}.audit-table th:nth-child(3){width:17%}.audit-table th:nth-child(4){width:18%}
.audit-table th:last-child,.audit-table td:last-child{border-right:0}
.audit-action{display:inline-block;font-size:10px;font-weight:750;background:#eaf7fb;color:#047b9b;padding:5px 9px;border-radius:20px;max-width:100%;overflow-wrap:anywhere}
.audit-source{display:block;font-size:10px;color:#93a7b2;margin-top:5px}
.audit-empty{text-align:center;padding:36px 20px!important}
.audit-pagination{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 18px;flex-wrap:wrap}
.audit-pagination a{color:#006681;font-weight:650}

/* Backup archive and service status use the same grid and outlined controls. */
.backup-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.backup-metric{display:flex;align-items:center;gap:15px;padding:16px 18px;background:#fff;border:1px solid var(--system-border);border-radius:12px;min-width:0}
.backup-metric>svg{width:28px;height:28px;color:#006b86}
.backup-metric strong{display:block;font-size:16px;line-height:1.4;color:#234958;overflow-wrap:anywhere}
.backup-metric span{display:block;font-size:11px;color:#8a9fab;letter-spacing:.2px}
.backup-protected{display:flex;align-items:center;gap:16px;margin-bottom:18px;padding:16px 20px;border:1px solid #f1d493;border-radius:12px;background:#fff9ec;color:#90681b}
.backup-protected p{margin:3px 0 0!important;font-size:11px!important;color:#9a844f!important}
.backup-protected>svg{width:26px;height:26px}
.backup-archive,.backup-services{min-width:0}
.backup-list{margin-top:14px;border-top:1px solid #e3edf2}
.backup-row{display:flex;align-items:center;gap:16px;padding:18px 0;border-bottom:1px solid #e3edf2}
.backup-row:last-child{border-bottom:0}
.backup-row>svg{width:25px;height:25px;color:#296079;flex:0 0 auto}
.backup-row-info{flex:1;min-width:0;overflow-wrap:anywhere}
.backup-row-info strong{font-size:13px}
.backup-row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.backup-row-actions .system-button{min-height:37px;padding:8px}
.backup-queue-row{display:flex;gap:14px;align-items:flex-start;padding:16px 0;border-bottom:1px solid #e5edf2}
.backup-queue-row:last-child{border-bottom:0}.backup-queue-row>svg{color:#077490}
.system-dialog label{display:block;margin:14px 0 5px;color:#355e70}
.system-dialog input[type=password],.system-dialog input[type=text]{box-sizing:border-box;width:100%;padding:12px;border:1px solid #cbdde6;border-radius:10px;min-height:44px;font:inherit}
.system-dialog .backup-confirm-check{display:flex;align-items:flex-start;gap:10px}
.system-dialog .backup-confirm-check input{flex:0 0 auto;margin-top:3px}
.backup-metrics .system-meta{font-size:11px!important}
.system-head>form{margin:0;flex:0 0 auto}
.backup-dialog .backup-consent{display:flex;align-items:flex-start;gap:10px;margin:18px 0}.backup-dialog .backup-consent input{flex:0 0 auto;margin:3px 0 0}.backup-dialog .form-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:22px;padding-top:18px;border-top:1px solid #dce8ee}
.backup-services>p{padding-bottom:14px;border-bottom:1px solid #e4edf2}.backup-services .backup-storage{padding-top:16px;color:#648798;font-size:12px}.backup-storage summary{cursor:pointer;font-weight:650}.backup-services .backup-storage dl{grid-template-columns:110px minmax(0,1fr)}
.backup-page>.system-card{margin-bottom:18px}
.backup-summary{display:flex;gap:20px;align-items:flex-start;flex-wrap:wrap}.backup-summary>div{flex:1 1 500px}.backup-summary>form{flex:0 0 auto;margin:0}.backup-summary .backup-progress{flex-basis:100%}
.backup-storage dl{display:grid;grid-template-columns:150px minmax(0,1fr);gap:9px 16px;color:#5b7989}.backup-storage dd{margin:0;overflow-wrap:anywhere}.backup-storage dt{font-weight:650}
.backup-history>div>table{width:100%;border-collapse:collapse}.backup-history th,.backup-history td{text-align:left;padding:16px 12px;border-bottom:1px solid #e2ebf1;vertical-align:middle}.backup-history td small{display:block;margin-top:5px;color:#8298a6;font-size:10px}.backup-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.backup-actions form{margin:0}
.backup-notice,.backup-error{padding:14px 17px;margin:0 0 18px;border-radius:12px;background:#eef9f5;border:1px solid #bfdfd2;color:#256d56}.backup-error{background:#fff3f4;border-color:#f0c2c9;color:#a43241}
.backup-history .ui-table-scroll{overflow:auto}.backup-history table{min-width:680px}
.portal-shell .system-page .audit-search label{display:grid;gap:5px;color:#6f8c9c;font-size:11px!important}.portal-shell .system-page .audit-search-main{display:flex;flex-direction:column;align-items:stretch;gap:5px}
.audit-table pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0;font-size:11px}
.audit-search{display:block}.audit-search-primary{display:flex;align-items:center;gap:10px}.portal-shell .system-page .audit-search-primary .audit-search-main{position:relative;display:block;flex:1 1 auto;margin:0}.audit-search-main>.audit-field-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.audit-search-primary .audit-search-main>svg{position:absolute;left:13px;top:12px;width:20px;height:20px}.audit-search-primary .audit-search-main>input{padding-left:42px!important}.audit-advanced{margin-top:10px;color:#78919f}.audit-advanced summary{cursor:pointer;font-size:11px!important}.audit-advanced>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding-top:12px}.audit-advanced label{margin:0!important}.audit-total{white-space:nowrap;border:1px solid #d7e4eb;border-radius:10px;padding:9px 12px;font-size:11px}.audit-total svg{width:18px;height:18px}
@media(max-width:600px){.audit-search-primary{flex-wrap:wrap}.portal-shell .system-page .audit-search-primary .audit-search-main{flex-basis:100%}.audit-advanced>div{grid-template-columns:1fr}}

@media(max-width:1100px){.system-head{gap:18px}.updates-release-row{grid-template-columns:42px minmax(0,1fr)}.updates-release-actions{grid-column:2}.backup-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.updates-agent-grid{grid-template-columns:1fr 1.5fr}}
@media(max-width:800px){.portal-shell>main:has(.system-page){padding:22px 18px 40px}.system-grid,.updates-agent-grid,.updates-main-grid{grid-template-columns:1fr}.system-head{align-items:flex-start}.system-card{padding:19px}.system-head>.system-button{min-height:38px}.system-dialog{padding:24px}.system-dialog-head{gap:16px}.system-dialog-icon{width:52px;height:52px;flex-basis:52px;border-radius:15px}.system-dialog-icon svg{width:30px;height:30px}.system-dialog-body,.system-dialog-actions{margin-left:0}.backup-row{flex-wrap:wrap}.backup-row-actions{margin-left:40px}.audit-search-main{flex-basis:100%}}
@media(max-width:480px){.portal-shell>main:has(.system-page){padding:18px 12px 30px}.system-head{flex-wrap:wrap;gap:10px;margin-bottom:18px}.system-head>div{flex-basis:100%}.system-card{padding:17px}.backup-metrics{gap:8px}.backup-metric{padding:12px;gap:9px}.backup-metric>svg{width:23px;height:23px}.updates-release-row{gap:10px}.updates-release-actions{grid-column:1/-1;margin-left:52px}.system-dialog{padding:19px;width:calc(100vw - 20px);max-width:calc(100vw - 20px);border-radius:19px}.system-dialog-head{gap:12px}.system-dialog-icon{width:42px;height:42px;flex-basis:42px}.system-dialog-actions .system-button{flex:1;min-width:0}.portal-shell .system-dialog h2{font-size:22px!important}}


/* 1.0.37 - Unified Medicare workspace standard.
   Istruttori / Discipline istruttori are the reference for hierarchy, spacing and actions. */
.portal-shell>main:has(.system-page){padding-top:28px}
.system-page.ui-directory-page,.system-page.ui-system-standard{max-width:1500px}
.system-page.ui-directory-page>.system-head,.system-page.ui-system-standard>.system-head{align-items:flex-start;margin-bottom:22px}
.system-page.ui-directory-page>.system-head h1,.system-page.ui-system-standard>.system-head h1{margin:0 0 8px!important;font-size:18px!important;font-weight:650!important;letter-spacing:0!important}
.system-page.ui-directory-page>.system-head p,.system-page.ui-system-standard>.system-head p{margin:0!important;font-size:12px!important;color:#7b93a1!important;line-height:1.55!important}
.system-page.ui-directory-page>.system-head>.system-button,.system-page.ui-directory-page>.system-head>div+div .system-button{align-self:flex-start}

/* Search/filter areas now follow the same clean horizontal rhythm used in Anagrafica istruttori. */
.ui-directory-page .directory-search{margin:0 0 14px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
.ui-directory-page .directory-search :is(input[type=search],input[type=text],input[type=number],input[type=date],select){min-height:42px!important;border-radius:9px!important;border-color:#d8e4ea!important;background:#fff!important}
.ui-directory-page .directory-search button,.ui-directory-page .directory-search .system-button{min-height:42px!important}
.ui-directory-page .system-meta{margin:8px 0 16px!important}

/* Tables: one shared calm visual language, no heavy boxes or shadows. */
.ui-directory-page .directory-table-card,.ui-directory-page .catalog-table-wrap,.ui-directory-page .certificate-table-wrap{background:#fff!important;border:1px solid #dce6eb!important;border-radius:12px!important;box-shadow:none!important;overflow:auto!important;padding:0!important}
.ui-directory-page table{width:100%;border-collapse:collapse!important;background:#fff}
.ui-directory-page table thead th{background:#f7f9fa!important;color:#617986!important;font-size:11px!important;font-weight:600!important;text-align:left!important;padding:13px 12px!important;border-bottom:1px solid #dce6eb!important;white-space:normal!important}
.ui-directory-page table tbody td{color:#294957!important;font-size:12px!important;padding:14px 12px!important;border-bottom:1px solid #e5ecef!important;vertical-align:middle!important;line-height:1.45!important}
.ui-directory-page table tbody tr:last-child td{border-bottom:0!important}
.ui-directory-page table tbody tr:hover td{background:#f8fbfc!important}
.ui-directory-page table strong{font-weight:650!important;color:#203f4d!important}
.ui-directory-page table small{font-size:10px!important;color:#86a0ad!important;line-height:1.45!important;margin-top:4px!important}
.ui-directory-page table input[type=checkbox]{width:16px!important;height:16px!important;accent-color:#00a9c1}

/* Action bars mirror the Instructor/Discipline pattern. */
.ui-directory-page .catalog-bulk,.ui-directory-page .training-pagination,.ui-directory-page .certificate-pagination{margin-top:14px!important;min-height:42px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ui-directory-page .catalog-bulk{justify-content:flex-start!important}
.ui-directory-page .catalog-bulk [data-selected-count]{margin-right:0!important;min-width:92px}
.ui-directory-page .catalog-pagination{margin-top:12px!important}
.ui-directory-page .catalog-pagination>span,.ui-directory-page .training-pagination>span{font-size:11px!important;color:#7f98a5!important}
.ui-directory-page .catalog-actions{white-space:normal!important}
.ui-directory-page .catalog-actions .system-button{min-height:36px!important;padding:7px 11px!important;font-size:11px!important;border-radius:9px!important;margin:2px 4px 2px 0!important}
.ui-directory-page .training-menu summary{border-radius:8px!important}

/* Forms and cards throughout the system use the same spacing scale. */
.system-page.ui-system-standard .system-card,.system-page .catalog-form-card,.system-page .training-edit-form,.system-page .certificate-profile-form{box-shadow:none!important;border-color:#dce6eb!important;border-radius:12px!important}
.system-page.ui-system-standard label,.system-page .catalog-form-card label,.system-page .training-edit-form label,.system-page .certificate-profile-form label{font-size:11px!important;color:#486674!important;font-weight:600}
.system-page.ui-system-standard :is(input,select,textarea),.system-page .catalog-form-card :is(input,select,textarea),.system-page .training-edit-form :is(input,select,textarea),.system-page .certificate-profile-form :is(input,select,textarea){border-color:#d8e4ea!important;border-radius:9px!important;box-shadow:none!important}

/* Keep dedicated workspaces (mail/chat) functionally specialized while inheriting typography/buttons. */
.portal-shell .system-button{transition:background .12s ease,border-color .12s ease,color .12s ease}

@media(max-width:900px){
  .ui-directory-page .directory-search{grid-template-columns:1fr!important}
  .ui-directory-page .certificate-filters label:first-child{grid-column:auto!important}
}

/* 1.0.54 - Standard obbligatorio per tutte le sezioni elenco/anagrafiche.
   Dashboard/Istruttori/Clienti restano il riferimento: piena larghezza utile,
   tabella compatta, selezione riga, barra azioni sotto e scroll interno. */
.portal-shell .system-page.ui-directory-page,
.portal-shell .system-page.ui-standard-list-page{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}
.portal-shell .ui-directory-page>.system-head{
  width:100%;
  box-sizing:border-box;
}
.portal-shell .ui-directory-page .standard-directory-search,
.portal-shell .ui-directory-page .directory-search{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box;
}
.portal-shell .ui-directory-page .directory-table-card,
.portal-shell .ui-directory-page .standard-directory-table,
.portal-shell .ui-directory-page .catalog-table-wrap,
.portal-shell .ui-directory-page .certificate-table-wrap{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
  overflow:auto!important;
  max-height:560px;
  scrollbar-gutter:stable both-edges;
}
.portal-shell .ui-directory-page .directory-table-card>div,
.portal-shell .ui-directory-page .standard-directory-table>div{
  max-width:none!important;
  width:100%!important;
}
.portal-shell .ui-directory-page .directory-table-card table,
.portal-shell .ui-directory-page .standard-directory-table table,
.portal-shell .ui-directory-page .catalog-table-wrap table,
.portal-shell .ui-directory-page .certificate-table-wrap table{
  width:100%!important;
  min-width:980px;
  table-layout:auto;
}
.portal-shell .ui-directory-page .directory-table-card thead th,
.portal-shell .ui-directory-page .standard-directory-table thead th,
.portal-shell .ui-directory-page .catalog-table-wrap thead th,
.portal-shell .ui-directory-page .certificate-table-wrap thead th{
  position:sticky;
  top:0;
  z-index:3;
  background:#f7f9fa!important;
  box-shadow:0 1px 0 #dce6eb;
}
.portal-shell .ui-directory-page [data-directory-row]{cursor:pointer}
.portal-shell .ui-directory-page [data-directory-row].is-selected>td{
  background:#e8f3ff!important;
}
.portal-shell .ui-directory-page [data-directory-row]:focus-within>td{
  background:#f2f8fc!important;
}
.portal-shell .ui-directory-page .directory-select-column{
  width:46px!important;
  min-width:46px!important;
  max-width:46px!important;
  text-align:center!important;
  padding-left:12px!important;
  padding-right:8px!important;
}
.portal-shell .ui-directory-page .directory-select-column input[type=radio],
.portal-shell .ui-directory-page .directory-select-column input[type=checkbox]{
  width:17px!important;
  height:17px!important;
  margin:0!important;
  accent-color:#00a9c1;
}
.portal-shell .ui-directory-page .directory-action-bar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  min-height:44px;
  margin:14px 0 0;
}
.portal-shell .ui-directory-page .directory-action-bar form{margin:0}
.portal-shell .ui-directory-page .directory-selection-status{
  margin-right:auto;
  color:#7f98a5;
  font-size:11px;
  font-weight:600;
}
.portal-shell .ui-directory-page .directory-action-bar .system-button{
  min-height:40px!important;
  border-radius:9px!important;
}
.portal-shell .ui-directory-page .directory-action-bar .directory-trash-button{
  width:42px!important;
  min-width:42px!important;
  padding:9px!important;
  color:var(--medicare-type-primary,#234b5b)!important;
  background:#fff!important;
  border-color:#d8e4ea!important;
}
.portal-shell .ui-directory-page .directory-action-bar .directory-trash-button:hover:not(:disabled){
  color:#b63a42!important;
  border-color:#e7c4c8!important;
  background:#fff8f8!important;
}
.portal-shell .ui-directory-page .directory-action-bar [aria-disabled=true]{
  pointer-events:none;
  opacity:.42;
}
.portal-shell .ui-directory-page .directory-action-bar button:disabled{opacity:.42}
@media(max-width:900px){
  .portal-shell .ui-directory-page .directory-table-card,
  .portal-shell .ui-directory-page .standard-directory-table,
  .portal-shell .ui-directory-page .catalog-table-wrap,
  .portal-shell .ui-directory-page .certificate-table-wrap{max-height:62vh}
}

/* 1.0.57 - directory layout repair.
   The portal shell already owns sidebar geometry; directory pages must never
   reapply a left margin/viewport width to <main>. */
.portal-shell .ui-directory-page{
  width:100%!important;
  max-width:none!important;
}
.portal-shell .ui-directory-page .directory-breadcrumb{
  display:flex;align-items:center;gap:7px;margin:0 0 22px;
  font-size:11px;color:#6f8794;font-weight:500;
}
.portal-shell .ui-directory-page .directory-breadcrumb a{color:#00627d;font-weight:700}
.portal-shell .ui-directory-page .directory-breadcrumb strong{color:#254452;font-weight:600}
.portal-shell .ui-directory-page>.system-head{margin-bottom:22px!important}
.portal-shell .ui-directory-page .directory-table-card,
.portal-shell .ui-directory-page .standard-directory-table,
.portal-shell .ui-directory-page .certificate-table-wrap{
  width:100%!important;max-width:none!important;
  overflow-x:auto!important;overflow-y:auto!important;
  border-radius:12px!important;
}
.portal-shell .training-list-page .standard-directory-table{max-height:440px!important}
.portal-shell .certificates-page .certificate-table-wrap{max-height:440px!important}
.portal-shell .training-list-page .training-classes-table{
  width:100%!important;min-width:900px!important;
}
.portal-shell .certificates-page .certificate-table-wrap table{
  width:100%!important;min-width:1040px!important;
}
.portal-shell .ui-directory-page .directory-action-bar{
  border-top:0!important;padding-top:0!important;margin-top:12px!important;
  justify-content:flex-start!important;
}
.portal-shell .ui-directory-page .directory-action-bar .directory-selection-status{
  margin-right:14px!important;min-width:155px;
}
.portal-shell .ui-directory-page .training-list-search,
.portal-shell .ui-directory-page .certificate-filters{max-width:none!important;width:100%!important}
@media(max-width:900px){
  .portal-shell .ui-directory-page .directory-breadcrumb{margin-bottom:18px}
}
