:root{--bg:#f2f5f9;--surface:#ffffff;--surface-2:#f8fafc;--border:#dfe5ee;--border-strong:#c8d1dd;--text:#1c2a3a;--muted:#64748b;--primary:#1d5c8f;--primary-hover:#174b75;--primary-soft:#e6f0f8;--sidebar:#12324f;--sidebar-text:#c9d7e6;--sidebar-active:#1d5c8f;--success:#15803d;--success-soft:#e7f6ec;--warning:#b45309;--warning-soft:#fdf3e2;--danger:#b91c1c;--danger-soft:#fdecec;--radius:10px;--shadow:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.08);--shadow-lg:0 12px 32px rgba(16,24,40,.18);--font:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif}*{box-sizing:border-box}body,html{margin:0;padding:0}body{font-family:var(--font);font-size:14px;color:var(--text);background:var(--bg);line-height:1.45}a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}h1{font-size:22px;margin:0}h1,h2{font-weight:650}h2{font-size:17px;margin:0 0 12px}h3{font-size:15px;font-weight:650}h3,p{margin:0 0 8px}.muted,small{color:var(--muted)}.shell{display:flex;min-height:100vh}.sidebar{width:240px;flex-shrink:0;background:var(--sidebar);color:var(--sidebar-text);display:flex;flex-direction:column;position:-webkit-sticky;position:sticky;top:0;height:100vh;overflow-y:auto}.brand{padding:18px 18px 14px;border-bottom:1px solid rgba(255,255,255,.08)}.brand-title{color:#fff;font-weight:700;font-size:16px;letter-spacing:.2px}.brand-sub{font-size:12px;opacity:.75}.nav{padding:10px 8px;display:flex;flex-direction:column;gap:2px}.nav-section{font-size:11px;text-transform:uppercase;letter-spacing:.08em;opacity:.55;padding:14px 10px 6px}.nav a{color:var(--sidebar-text);padding:8px 10px;border-radius:7px;display:flex;align-items:center;gap:10px;text-decoration:none;font-size:14px}.nav a:hover{background:rgba(255,255,255,.07);color:#fff}.nav a.active{background:var(--sidebar-active);color:#fff}.nav .ico{width:18px;text-align:center;opacity:.9}.sidebar-foot{margin-top:auto;padding:12px 14px;border-top:1px solid rgba(255,255,255,.08);font-size:13px}.sidebar-foot .who{color:#fff;font-weight:600;word-break:break-word}.sidebar-foot .role{font-size:12px;opacity:.7;margin-bottom:8px}.sidebar-foot button{width:100%}.main{flex:1 1;min-width:0;display:flex;flex-direction:column}.topbar{display:none;align-items:center;gap:12px;padding:10px 14px;background:var(--sidebar);color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:30}.content{padding:22px 26px 40px;max-width:1500px;width:100%}.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap}.page-head .sub{color:var(--muted);margin-top:2px}@media (max-width:960px){.sidebar{position:fixed;left:0;top:0;z-index:50;transform:translateX(-100%);transition:transform .2s;box-shadow:var(--shadow-lg)}.shell.open .sidebar{transform:none}.shell.open .backdrop{display:block}.topbar{display:flex}.content{padding:16px 14px 32px}}.backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:40}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}.card+.card{margin-top:16px}.card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}.card-head h2{margin:0}.grid{display:grid;grid-gap:16px;gap:16px}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width:1100px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:1fr 1fr}}@media (max-width:700px){.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.row.end{justify-content:flex-end}.spacer{flex:1 1}.stack{gap:10px}.stack,.stat{display:flex;flex-direction:column}.stat{gap:4px}.stat .label{color:var(--muted);font-size:13px}.stat .value{font-size:28px;font-weight:700;color:var(--primary)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border-strong);background:var(--surface);color:var(--text);padding:7px 13px;border-radius:8px;font:inherit;font-weight:550;cursor:pointer;white-space:nowrap;min-height:36px}.btn,.btn:hover{text-decoration:none}.btn:hover{background:var(--surface-2)}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-hover)}.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}.btn-danger:hover{background:#991b1b}.btn-ghost{border-color:transparent;background:transparent}.btn-ghost:hover{background:rgba(0,0,0,.05)}.btn-sm{padding:4px 9px;min-height:30px;font-size:13px}.btn-lg{padding:10px 18px;font-size:15px;min-height:42px}.btn-new{box-shadow:0 2px 6px rgba(29,92,143,.35)}.sidebar .btn{background:rgba(255,255,255,.08);color:#fff;border-color:rgba(255,255,255,.15)}label{font-weight:550;font-size:13px;display:block;margin-bottom:4px}.field{display:flex;flex-direction:column;min-width:0}.field .hint{font-size:12px;color:var(--muted);margin-top:3px}.req{color:var(--danger)}input[type=date],input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],select,textarea{font:inherit;color:var(--text);background:#fff;border:1px solid var(--border-strong);border-radius:8px;padding:7px 10px;min-height:36px;width:100%}textarea{min-height:70px;resize:vertical}input:focus,select:focus,textarea:focus{outline:2px solid rgba(29,92,143,.25);border-color:var(--primary)}input:disabled,input[readonly],select:disabled{background:#f1f4f8;color:#475569}input[type=color]{width:44px;height:34px;padding:2px;border:1px solid var(--border-strong);border-radius:6px;background:#fff}.check{display:flex;align-items:center;gap:8px;font-weight:450;cursor:pointer;margin:0}.check input{width:16px;height:16px}table.table{width:100%;border-collapse:collapse}.table th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600;background:var(--surface-2);white-space:nowrap}.table td,.table th{padding:9px 10px;border-bottom:1px solid var(--border)}.table td{vertical-align:top}.table tr:hover td{background:#fafcfe}.table tr.clickable{cursor:pointer}.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:#fff}.table-wrap .table tr:last-child td{border-bottom:none}.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:600;background:#eef2f7;color:#334155;white-space:nowrap}.badge.COMPLETATO,.badge.ok{background:var(--success-soft);color:var(--success)}.badge.PRENOTATO{background:var(--primary-soft);color:var(--primary)}.badge.ANNULLATO{background:#f1f1f1;color:#6b7280;text-decoration:line-through}.badge.ASSENTE,.badge.warn{background:var(--warning-soft);color:var(--warning)}.badge.danger,.badge.off{background:var(--danger-soft);color:var(--danger)}.dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0}.alert{padding:11px 14px;border-radius:8px;border:1px solid;margin-bottom:14px}.alert-error{background:var(--danger-soft);border-color:#f5c2c2;color:#7f1d1d}.alert-warn{background:var(--warning-soft);border-color:#f3d9a7;color:#7c4a03}.alert-ok{background:var(--success-soft);border-color:#bfe5cb;color:#14532d}.alert-info{background:var(--primary-soft);border-color:#c4d9ec;color:#123c5e}.alert ul{margin:6px 0 0;padding-left:18px}.modal-back{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:100;display:flex;align-items:flex-start;justify-content:center;padding:40px 12px;overflow-y:auto}.modal{background:#fff;border-radius:12px;box-shadow:var(--shadow-lg);width:100%;max-width:640px}.modal.wide{max-width:860px}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border)}.modal-head h2{margin:0}.modal-body{padding:18px}.modal-foot{gap:10px;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--border);background:var(--surface-2);border-radius:0 0 12px 12px;flex-wrap:wrap}.modal-foot,.section-title{display:flex;align-items:center}.section-title{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--primary);font-weight:700;margin:4px 0 10px;gap:8px}.section-title:after{content:"";flex:1 1;height:1px;background:var(--border)}.form-grid{display:grid;grid-template-columns:1fr 1fr;grid-gap:12px 14px;gap:12px 14px;margin-bottom:16px}.form-grid .full{grid-column:1/-1}@media (max-width:600px){.form-grid{grid-template-columns:1fr}}.created-by{display:flex;align-items:center;gap:8px;padding:9px 12px;background:var(--surface-2);border:1px dashed var(--border-strong);border-radius:8px;font-size:13px}.slots{display:flex;flex-wrap:wrap;gap:6px}.slot-btn{border:1px solid var(--border-strong);background:#fff;border-radius:7px;padding:6px 10px;cursor:pointer;font:inherit;font-weight:600}.slot-btn.sel,.slot-btn:hover{border-color:var(--primary)}.slot-btn.sel{background:var(--primary);color:#fff}.slot-btn:disabled{background:#f3f4f6;color:#a0a8b4;cursor:not-allowed;text-decoration:line-through}.detail-list{display:grid;grid-template-columns:170px 1fr;grid-gap:7px 14px;gap:7px 14px;margin:0}.detail-list dt{color:var(--muted)}.detail-list dd{margin:0;font-weight:500;word-break:break-word}@media (max-width:560px){.detail-list{grid-template-columns:1fr}.detail-list dd{margin-bottom:6px}}.timeline{list-style:none;padding:0;margin:0;border-left:2px solid var(--border)}.timeline li{padding:0 0 10px 14px;position:relative;font-size:13px}.timeline li:before{content:"";position:absolute;left:-6px;top:4px;width:10px;height:10px;border-radius:50%;background:var(--primary)}.toast-wrap{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:8px;z-index:200}.toast{background:#1f2937;color:#fff;padding:10px 14px;border-radius:8px;box-shadow:var(--shadow-lg);max-width:380px}.toast.error{background:var(--danger)}.toast.ok{background:var(--success)}.cal-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.cal-title{font-size:18px;font-weight:650;min-width:220px}.seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:8px;overflow:hidden}.seg button{border:none;background:#fff;padding:7px 12px;font:inherit;cursor:pointer;border-right:1px solid var(--border-strong)}.seg button:last-child{border-right:none}.seg button.on{background:var(--primary);color:#fff}.cal-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.cal-filters>*{width:auto;min-width:150px;flex:1 1 160px;max-width:260px}.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--muted);margin-bottom:10px;align-items:center}.legend span{display:inline-flex;gap:6px;align-items:center}.tgrid{display:flex;border:1px solid var(--border);border-radius:var(--radius);background:#fff;overflow-x:auto}.tgrid-times{width:54px;flex-shrink:0;position:relative;background:var(--surface-2)}.tgrid-day,.tgrid-times{border-right:1px solid var(--border)}.tgrid-day{flex:1 1;min-width:150px;display:flex;flex-direction:column}.tgrid-day:last-child{border-right:none}.tgrid-day.today .tgrid-dayhead{background:var(--primary-soft)}.tgrid-dayhead{height:56px;padding:6px 8px;border-bottom:1px solid var(--border);text-align:center;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;background:#fff;z-index:2}.tgrid-dayhead .dname{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.tgrid-dayhead .dnum{font-size:18px;font-weight:700}.tgrid-lanes{display:flex;position:relative}.tgrid-lane{flex:1 1;position:relative;border-right:1px dashed #edf0f4;min-width:70px}.tgrid-lane:last-child{border-right:none}.tgrid-lanehead{font-size:11px;text-align:center;padding:3px 2px;border-bottom:1px solid var(--border);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}.hour-line{position:absolute;left:0;right:0;border-top:1px solid #eef1f5}.time-label{right:6px;font-size:11px;color:var(--muted);transform:translateY(-7px)}.ev,.time-label{position:absolute}.ev{left:3px;right:3px;border-radius:6px;padding:3px 6px;font-size:12px;overflow:hidden;cursor:pointer;border-left:4px solid;box-shadow:0 1px 2px rgba(0,0,0,.08);line-height:1.25}.ev:hover{filter:brightness(.97);z-index:3}.ev .ev-time{font-weight:700}.ev .ev-name{font-weight:600}.ev .ev-meta,.ev .ev-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ev .ev-meta{font-size:11px;opacity:.85}.ev.ANNULLATO{opacity:.55;text-decoration:line-through}.ev.COMPLETATO{opacity:.8}.ev.ASSENTE{background-image:repeating-linear-gradient(45deg,transparent,transparent 6px,rgba(0,0,0,.04) 0,rgba(0,0,0,.04) 12px)}.free{position:absolute;left:3px;right:3px;border:1.5px dashed #9bc0a8;border-radius:6px;background:#f3faf5;color:#2f6b45;font-size:12px;padding:3px 6px;cursor:pointer;font-weight:600}.free:hover{background:#e3f4e8;border-color:#3f8f5c}.free.disabled{cursor:default}.closed-band{position:absolute;left:0;right:0;background:repeating-linear-gradient(135deg,#f6f7f9,#f6f7f9 6px,#eef0f3 0,#eef0f3 12px)}.day-notes{padding:4px 6px;border-bottom:1px solid var(--border);background:var(--warning-soft);font-size:11px;color:#7c4a03}.day-notes.open{background:var(--success-soft);color:#14532d}.month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:#fff}.month .mhead{background:var(--surface-2);padding:8px;text-align:center;font-size:12px;text-transform:uppercase;color:var(--muted);font-weight:600}.month .mcell,.month .mhead{border-bottom:1px solid var(--border)}.month .mcell{min-height:112px;border-right:1px solid var(--border);padding:6px;cursor:pointer;display:flex;flex-direction:column;gap:3px}.month .mcell:nth-child(7n){border-right:none}.month .mcell:hover{background:#fafcfe}.month .mcell.other{background:#fafbfc;color:#a3acb9}.month .mcell.today .mnum{background:var(--primary);color:#fff;border-radius:50%;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center}.month .mnum{font-weight:700;font-size:13px}.month .mitem{font-size:11.5px;padding:1px 5px;border-radius:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-left:3px solid}.month .mfree{font-size:11.5px;color:#2f6b45;font-weight:600}.month .mclosed{font-size:11px;color:var(--warning)}@media (max-width:700px){.month .mcell{min-height:70px}.month .mitem{display:none}}.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(135deg,#12324f,#1d5c8f 60%,#2a7ab5)}.auth-card{background:#fff;border-radius:14px;box-shadow:var(--shadow-lg);width:100%;max-width:420px;padding:30px}.auth-card.wide{max-width:560px}.auth-card h1{margin-bottom:4px}.auth-logo{width:48px;height:48px;border-radius:12px;background:var(--primary);color:#fff;justify-content:center;font-weight:800;font-size:18px;margin-bottom:14px}.auth-logo,.pagination{display:flex;align-items:center}.pagination{gap:8px;justify-content:flex-end;margin-top:12px}.empty{padding:26px;text-align:center;color:var(--muted)}.week-editor td{vertical-align:middle}.week-editor input[type=time]{width:110px}.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:999px;padding:3px 10px;font-size:12.5px;background:#fff}.print-page{padding:24px;background:#fff;min-height:100vh}.print-page h1{font-size:20px}.print-page table{width:100%;border-collapse:collapse;font-size:12px;margin-top:10px}.print-page td,.print-page th{border:1px solid #b8c0cc;padding:5px 6px;text-align:left;vertical-align:top}.print-page th{background:#eef2f6}@media print{.no-print{display:none!important}.print-page{padding:0}body{background:#fff}@page{size:A4 landscape;margin:12mm}}