.perm-shell{padding:28px;max-width:1540px;margin:auto;color:#173f38}.perm-header{display:flex;justify-content:space-between;gap:24px;align-items:center;background:linear-gradient(135deg,#fff,#f5f8f4);border:1px solid #e3e9e3;border-radius:26px;padding:28px 32px;margin-bottom:18px;box-shadow:0 12px 35px rgba(28,64,52,.06)}.perm-eyebrow{font-size:12px;font-weight:900;letter-spacing:.16em;color:#768466}.perm-header h1{margin:5px 0 6px;font-size:40px;line-height:1.05}.perm-header p,.perm-panel-head p{margin:0;color:#6f7772}.perm-header-actions{display:flex;gap:10px;flex-wrap:wrap}.perm-primary,.perm-secondary{border:0;border-radius:999px;font-weight:850;padding:12px 20px;cursor:pointer}.perm-primary{background:#265f4c;color:#fff}.perm-secondary{background:#edf3ef;color:#265f4c;border:1px solid #d8e4dc}.perm-secondary:disabled{opacity:.5;cursor:not-allowed}.perm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.perm-stat{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid #e1e7e2;border-radius:20px;padding:18px}.perm-stat-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:#eef3ef;font-weight:900}.perm-stat.green .perm-stat-icon{background:#dff3e5;color:#1f6a42}.perm-stat.red .perm-stat-icon{background:#f9e2e2;color:#963b3b}.perm-stat span,.perm-stat small{display:block;color:#77817c}.perm-stat strong{display:block;font-size:27px;line-height:1.05;margin:3px 0}.perm-toolbar{display:grid;grid-template-columns:minmax(260px,1.5fr) repeat(3,minmax(155px,.6fr));gap:10px;background:#fff;border:1px solid #e1e7e2;border-radius:18px;padding:12px;margin-bottom:18px}.perm-toolbar select,.perm-search input,.perm-form input,.perm-form select,.perm-row select{width:100%;box-sizing:border-box;padding:12px;border:1px solid #d8ded9;border-radius:12px;background:#fff;color:#183d36}.perm-search{position:relative}.perm-search span{position:absolute;left:14px;top:10px;font-size:20px;color:#7b8781}.perm-search input{padding-left:40px}.perm-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px}.perm-users,.perm-profile-card{background:#fff;border:1px solid #e1e7e2;border-radius:22px;padding:16px;box-shadow:0 10px 28px rgba(34,66,55,.05)}.perm-list-head{display:flex;justify-content:space-between;align-items:center;padding:3px 5px 12px}.perm-list-head span{color:#7b8580;font-size:13px}.perm-user{display:grid;grid-template-columns:44px 1fr 10px;align-items:center;gap:11px;width:100%;border:0;background:transparent;text-align:left;padding:11px;border-radius:15px;cursor:pointer;margin:3px 0}.perm-user:hover,.perm-user.active{background:#edf4ef}.perm-avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#dfece5;color:#245b48;font-size:18px;font-weight:900}.perm-avatar.large{width:68px;height:68px;border-radius:21px;font-size:28px}.perm-user-copy strong,.perm-user-copy span,.perm-user-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.perm-user-copy span,.perm-user-copy small{color:#6f7772;margin-top:2px;font-size:12px}.perm-dot{width:9px;height:9px;border-radius:50%}.perm-dot.on{background:#38a363}.perm-dot.off{background:#c95e5e}.perm-editor{min-width:0}.perm-user-hero{display:grid;grid-template-columns:68px 1fr auto;align-items:center;gap:16px;padding:8px 8px 20px}.perm-user-hero h2{margin:0 0 3px;font-size:28px}.perm-user-hero p{margin:0;color:#6e7974}.perm-badges{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}.perm-badges span{background:#eef3ef;color:#315c4d;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}.perm-status{padding:8px 12px;border-radius:999px;font-size:11px;font-weight:900}.perm-status.on{background:#dff2e5;color:#23633f}.perm-status.off{background:#f7dddd;color:#8a2d2d}.perm-tabs{display:flex;gap:5px;border-top:1px solid #edf0ee;border-bottom:1px solid #edf0ee;padding:10px 4px}.perm-tabs button{border:0;background:transparent;padding:10px 15px;border-radius:11px;font-weight:800;color:#69766f;cursor:pointer}.perm-tabs button.active{background:#e8f1eb;color:#245d49}.perm-tab-content{padding:22px 8px 8px}.perm-panel-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:18px}.perm-panel-head h3{margin:0 0 5px;font-size:22px}.perm-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.perm-form label{font-weight:750}.perm-form input,.perm-form select{margin-top:7px}.perm-account-state{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-top:18px;padding:16px;border-radius:16px;background:#f6f8f6}.perm-account-state strong{display:block}.perm-account-state p{margin:4px 0 0;color:#6f7772;font-size:13px}.perm-switch input{display:none}.perm-switch span{display:block;width:52px;height:29px;border-radius:999px;background:#c6ceca;position:relative;cursor:pointer}.perm-switch span:after{content:"";position:absolute;width:23px;height:23px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}.perm-switch input:checked+span{background:#2f8a5d}.perm-switch input:checked+span:after{transform:translateX(23px)}.perm-actions{display:flex;justify-content:flex-end;margin-top:18px}.perm-department-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.perm-department-card{display:grid;grid-template-columns:1fr auto auto;gap:16px;align-items:center;border:1px solid #e1e7e2;border-radius:15px;padding:15px}.perm-department-card strong,.perm-department-card small{display:block}.perm-department-card small{color:#85908a;margin-top:3px}.perm-department-card label{font-weight:800;font-size:13px}.perm-department-card input{width:18px;height:18px;accent-color:#2f7a59;vertical-align:middle}.perm-permission-groups{display:grid;gap:13px}.perm-group{border:1px solid #e1e7e2;border-radius:16px;overflow:hidden}.perm-group h4{margin:0;padding:13px 16px;background:#f4f7f4;font-size:15px}.perm-row{display:grid;grid-template-columns:1fr 180px;gap:16px;align-items:center;padding:13px 16px;border-top:1px solid #edf0ee}.perm-row strong,.perm-row span,.perm-row small{display:block}.perm-row span{color:#6f7772;margin-top:3px;font-size:13px}.perm-row small{margin-top:5px;font-weight:800}.perm-row small.yes{color:#2f7c54}.perm-row small.no{color:#a34d4d}.perm-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.perm-summary-grid article{border:1px solid #e1e7e2;border-radius:16px;padding:17px}.perm-summary-grid span,.perm-summary-grid small{display:block;color:#78837e}.perm-summary-grid strong{display:block;font-size:24px;margin:5px 0}.perm-note{margin-top:15px;padding:17px;border-radius:16px;background:#eef5f0}.perm-note p{margin:5px 0 0;color:#627069}.perm-message{padding:12px 16px;border-radius:12px;margin-bottom:15px;background:#eef2ef}.perm-message.error{background:#f8dddd;color:#852d2d}.perm-message.success{background:#ddf3e4;color:#21623c}.perm-empty{padding:35px;text-align:center;color:#6f7772;background:#fff;border-radius:20px}.perm-loading{text-align:center;padding:80px 20px}.perm-loading h2{margin:15px 0 5px}.perm-loading p{color:#748079}.perm-spinner{width:38px;height:38px;margin:auto;border:4px solid #dce7df;border-top-color:#2e654f;border-radius:50%;animation:perm-spin .8s linear infinite}@keyframes perm-spin{to{transform:rotate(360deg)}}
@media(max-width:1050px){.perm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.perm-toolbar{grid-template-columns:1fr 1fr}.perm-layout{grid-template-columns:300px minmax(0,1fr)}}
@media(max-width:780px){.perm-shell{padding:12px}.perm-header{align-items:flex-start;flex-direction:column;padding:22px}.perm-header h1{font-size:32px}.perm-stats,.perm-toolbar,.perm-layout,.perm-form,.perm-department-grid,.perm-summary-grid{grid-template-columns:1fr}.perm-user-hero{grid-template-columns:55px 1fr}.perm-avatar.large{width:55px;height:55px}.perm-status{grid-column:1/-1;justify-self:start}.perm-tabs{overflow:auto}.perm-row{grid-template-columns:1fr}.perm-department-card{grid-template-columns:1fr auto}.perm-department-card label:last-child{grid-column:2}.perm-header-actions{width:100%}.perm-header-actions button{flex:1}}
.perm-bulk-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.perm-bulk-actions .perm-secondary{padding:9px 13px;font-size:12px}.perm-modal-backdrop{position:fixed;inset:0;z-index:99999;background:rgba(12,29,24,.56);display:grid;place-items:center;padding:20px}.perm-modal{width:min(760px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:24px;padding:24px;box-shadow:0 30px 80px rgba(0,0,0,.28)}.perm-modal-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.perm-modal-head h2{margin:5px 0 0;font-size:30px}.perm-modal-close{border:0;background:#edf3ef;color:#245d49;width:40px;height:40px;border-radius:50%;font-size:25px;cursor:pointer}.perm-modal-note{padding:14px 16px;background:#f4f7f4;border-radius:14px;color:#5f6c65}.perm-known-users{display:grid;gap:10px;margin-top:16px}.perm-known-users article{display:grid;grid-template-columns:140px 210px 1fr;gap:14px;padding:14px;border:1px solid #e1e7e2;border-radius:14px;align-items:center}.perm-known-users span,.perm-known-users small{color:#68756e}.perm-modal-actions{display:flex;justify-content:flex-end;margin-top:18px}@media(max-width:780px){.perm-known-users article{grid-template-columns:1fr}.perm-bulk-actions{justify-content:flex-start}}

/* v7.4 layout and user workflow fixes */
#permissionsScreen,#labProductionScreen{margin:0!important;padding-top:0!important;min-height:0!important}
.perm-modal-user{width:min(920px,94vw);max-height:90vh;overflow:auto}
.perm-template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
.perm-template-grid button{padding:14px;text-align:left;border:1px solid #dfe6e1;border-radius:14px;background:#fff;cursor:pointer}
.perm-template-grid button.active{border-color:#2b694f;background:#edf6f0}.perm-template-grid strong,.perm-template-grid small{display:block}.perm-template-grid small{color:#6f7973;margin-top:4px}
.perm-new-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.perm-new-form label{font-weight:750}.perm-new-form input,.perm-new-form select{display:block;width:100%;box-sizing:border-box;margin-top:6px;padding:12px;border:1px solid #d8ded9;border-radius:12px;background:#fff}
.perm-new-departments{margin:16px 0;padding:15px;border:1px solid #e0e6e1;border-radius:15px}.perm-new-departments>div{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:10px}.perm-new-departments label{font-weight:700}.perm-row.mandatory{background:#f7faf8}.perm-row select:disabled{opacity:.7;cursor:not-allowed}
@media(max-width:700px){.perm-template-grid,.perm-new-form{grid-template-columns:1fr}}

/* v9.0.1: leggibilità elenco utenti e centratura pulsanti chiusura */
.perm-user-copy strong{color:#111!important}.perm-modal-close{display:inline-grid!important;place-items:center!important;line-height:1!important;padding:0!important;text-align:center!important}
.perm-avatar.role-superadmin,.perm-avatar.role-manager,.perm-avatar.role-department_manager,.perm-avatar.role-operator{font-size:22px}


/* Build 002 — footer nuovo utente */
.perm-modal-actions{display:flex!important;gap:12px!important;justify-content:flex-end!important;align-items:center!important;flex-wrap:nowrap!important}
.perm-modal-actions button{position:static!important;width:auto!important;min-width:150px!important;margin:0!important;flex:0 0 auto!important}
@media(max-width:620px){.perm-modal-actions{flex-direction:column-reverse!important}.perm-modal-actions button{width:100%!important;min-width:0!important}}
