:root{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#182d45;background:#f2f5fa;font-size:15px}*{box-sizing:border-box}body{margin:0;min-height:100vh}header{background:#102b50;color:white;padding:16px max(22px,calc((100vw - 1220px)/2));display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;align-items:center;gap:12px}.brand strong{font-size:18px}.brand small{display:block;color:#b8cce3;margin-top:2px}.logo{border-radius:14px;background:white;color:#102b50;font-weight:900;padding:11px;font-size:18px}.logo span{color:#db3243}.user{display:flex;gap:10px;align-items:center;font-size:12px;color:#d3e1f2}main{max-width:1220px;margin:auto;padding:28px 22px 80px}h1{font-size:clamp(25px,3vw,34px);margin:4px 0}h2{font-size:19px;margin:0 0 14px}p{color:#62758b;line-height:1.5}.hero{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.5px;color:#4779b6}.hero p{margin:7px 0}.month{background:white;border:1px solid #e0e7f0;border-radius:16px;padding:10px 16px}.month label{font-size:12px;color:#65788e}input,select,textarea{display:block;width:100%;font:inherit;background:white;color:#172c46;border:1px solid #d4dfe9;border-radius:11px;padding:11px 12px;margin-top:6px;min-height:44px}textarea{min-height:76px}label{font-size:12px;font-weight:700;color:#41576d}.month input{border:0;padding:5px 0;min-height:30px}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.stat,.card{background:#fff;border:1px solid #e3eaf2;border-radius:19px;padding:22px;box-shadow:0 4px 16px #1c385b08}.stat small{display:block;color:#6b7f94;font-size:12px}.stat strong{display:block;font-size:29px;margin-top:9px;color:#153c72}.tabs{display:flex;gap:8px;overflow:auto;padding:5px 0 14px;margin-bottom:8px}.tabs button{white-space:nowrap;background:#e8eef6;color:#3c5571}.tabs button.active{background:#153d74;color:#fff}button{cursor:pointer;border:0;border-radius:12px;padding:11px 16px;font-weight:700;font:inherit;min-height:43px;background:#e8eef6;color:#163a66}button.primary{background:#1d62b4;color:#fff}button.danger{background:#fbe8e8;color:#aa3030}button.ghost{background:#ffffff1b;color:#fff}button:disabled{opacity:.5;cursor:wait}button:hover{filter:brightness(.97)}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}.toolbar p{margin:4px 0}.tablewrap{overflow:auto;border-radius:14px;border:1px solid #e3eaf2}table{width:100%;border-collapse:collapse;min-width:680px}th,td{text-align:left;padding:12px 11px;border-bottom:1px solid #eaf0f6;font-size:13px}th{color:#60758c;background:#f7f9fc;font-size:11px;text-transform:uppercase;letter-spacing:.5px}td .mini{font-size:12px;padding:7px 10px;min-height:34px}tr:last-child td{border-bottom:0}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.person{border:1px solid #e5ebf4;border-radius:15px;padding:17px}.person h3{margin:0 0 5px}.person p{margin:0 0 15px}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:18px}.formgrid .wide{grid-column:1/-1}.actions{display:flex;gap:10px;flex-wrap:wrap}.hint{font-size:12px;color:#65788e}.pill{background:#eaf4ff;border-radius:50px;padding:5px 9px;color:#1e5b9e;font-weight:700;font-size:11px}.empty{text-align:center;padding:36px;color:#71859b}.auth{max-width:420px;margin:8vh auto}.auth form{display:grid;gap:16px}#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#122f54;color:white;border-radius:12px;padding:12px 18px;box-shadow:0 6px 20px #0003;display:none;z-index:99;max-width:92vw}footer{text-align:center;padding:16px;color:#7d8da1;font-size:11px}.warning{background:#fff7e6;color:#865200;padding:12px 15px;border-radius:12px;margin-bottom:16px}.scroll{overflow:auto}.small{font-size:12px}.mt{margin-top:20px}@media(max-width:800px){header{padding:12px 16px}.user #userEmail{display:none}main{padding:20px 13px 85px}.hero{align-items:flex-start;flex-direction:column}.stats{grid-template-columns:repeat(2,1fr)}.grid{grid-template-columns:1fr}.formgrid{grid-template-columns:1fr}.stat,.card{padding:16px}.tabs{position:sticky;top:0;background:#f2f5fa;z-index:4}.brand strong{font-size:15px}.brand small{font-size:10px}}@media(min-width:801px) and (max-width:1100px){.grid{grid-template-columns:repeat(2,1fr)}}

/* SottoSopra V2 — interfaccia mobile Android-inspired */
:root{font-family:Roboto,Inter,system-ui,-apple-system,'Segoe UI',sans-serif;background:#f4f6fb;color:#172b48}header{background:#123660;box-shadow:0 4px 18px #0b28541c}main{max-width:1300px}.logo{border-radius:17px}.card,.stat{border-radius:23px;box-shadow:0 5px 22px #1a3b650a}.stat{border-left:4px solid #2871c4}.stat strong{color:#174c8a}.tabs{gap:10px}.tabs button{border-radius:100px;padding:12px 19px}.tabs button.active{background:#155ca9;box-shadow:0 3px 12px #165ea62e}button{transition:background .15s,transform .15s;border-radius:14px}button:active{transform:scale(.98)}button.primary{background:#1767bf}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #80b7ef;outline-offset:2px}.person{border-radius:22px}.control-list{display:grid;gap:16px}.control-person{padding:24px}.control-head h2{margin-bottom:3px}.control-head p{margin:0 0 16px}.control-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.metric{background:#f1f6fc;padding:16px;border-radius:16px}.metric small{display:block;color:#5d7492;font-size:12px}.metric strong{font-size:22px;color:#174a82;display:block;margin-top:7px}.compare{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:14px 0}.compare>div{border:1px solid #e1eaf4;border-radius:16px;padding:14px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.compare b{font-size:13px}.compare strong{font-size:22px}.status{border-radius:100px;padding:5px 10px;font-size:11px;font-weight:700}.status.good{background:#e3f6ec;color:#137247}.status.amber{background:#fff1d9;color:#946000}.status.red{background:#fce8e8;color:#a63232}.status.muted{background:#edf1f6;color:#61738c}.progress-track{height:9px;border-radius:30px;background:#e7edf5;overflow:hidden}.progress-track>div{height:100%;border-radius:30px;background:#2c78d0}.control-person .hint{margin-bottom:0}
@media(max-width:800px){body{padding-bottom:75px}main{padding-top:18px}.hero{gap:10px}.hero h1{font-size:28px}.month{width:100%}.month input{width:100%}.stats{gap:10px}.stat{padding:16px}.stat strong{font-size:25px}.tabs{position:fixed;bottom:0;left:0;right:0;top:auto;margin:0;padding:8px max(8px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;background:white;border-top:1px solid #dfe8f3;box-shadow:0 -4px 18px #14325c1c;z-index:30;overflow:visible}.tabs button{font-size:10px;white-space:normal;line-height:1.2;min-height:53px;padding:8px 2px;border-radius:13px;background:transparent;color:#4b6480}.tabs button.active{background:#e4effd;color:#155ca9;box-shadow:none;font-weight:800}.tabs button::before{content:'◉';display:block;font-size:17px;margin-bottom:3px}.tabs button[data-view=employees]::before{content:'♙'}.tabs button[data-view=attendance]::before{content:'◷'}.tabs button[data-view=shifts]::before{content:'▦'}.tabs button[data-view=consultant]::before{content:'▥'}.tabs button[data-view=consultant]{font-size:9px}.control-grid{grid-template-columns:1fr 1fr}.control-grid .metric:first-child{grid-column:1/-1}.compare{grid-template-columns:1fr}.control-person{padding:17px}.metric strong{font-size:19px}.toolbar button{width:100%}footer{padding-bottom:20px}}

/* V3 - calendario unico mensile, ottimizzato per il tocco */
.view-switch{display:flex;gap:8px;flex-wrap:wrap;margin:4px 0 15px}.view-switch button{border-radius:100px;font-size:13px;min-height:42px}.view-switch button.selected{background:#dcecff;color:#1359a3;opacity:1;cursor:default;font-weight:800}.cal-legend{display:flex;align-items:center;flex-wrap:wrap;gap:14px;color:#5a708a;font-size:12px;margin:0 0 12px}.cal-legend span{display:inline-flex;align-items:center;gap:5px}.cal-legend i{width:12px;height:12px;border-radius:4px;display:inline-block}.legend-blue{background:#d7eaff;border:1px solid #9bc3f1}.legend-gray{background:#f3f6fa;border:1px solid #e0e8f2}.calendar-card{padding:10px;overflow:hidden}.calendar-scroll{overflow:auto;max-width:100%;overscroll-behavior-x:contain;scrollbar-color:#b2c7df #f3f6fa}.calendar-table{border-collapse:separate;border-spacing:3px;table-layout:fixed;width:max-content;min-width:100%}.calendar-table th,.calendar-table td{border:0;padding:0;text-align:center}.calendar-table thead th{position:sticky;top:0;z-index:2;background:#edf3fb;border-radius:10px;color:#385d83;height:55px}.calendar-table .cal-person{position:sticky;left:0;z-index:3;width:172px;min-width:172px;max-width:172px;text-align:left;padding:10px 12px;background:#f0f5fc;box-shadow:3px 0 5px #183a5510;border-radius:10px}.calendar-table thead .cal-person{z-index:4}.cal-person strong{display:block;font-size:12px;white-space:normal;overflow-wrap:anywhere;color:#153b68}.cal-person small{display:block;font-size:11px;color:#647d96;margin-top:5px}.calendar-table .cal-day{width:85px;min-width:85px}.cal-day span{display:block;font-size:11px}.cal-day b{display:block;font-size:16px;margin-top:3px}.calendar-table .cal-weekend{background:#f7f8fb}.cal-cell{width:85px;min-width:85px;height:73px}.cal-slot{width:100%;height:70px;min-height:70px;padding:5px 3px;background:#f3f6fa;color:#7b8da2;border:1px dashed #d9e4f0;border-radius:11px;font-size:11px;line-height:1.5;display:flex;align-items:center;justify-content:center}.cal-slot.cal-filled{background:#e1efff;color:#14579d;border:1px solid #b8d6f5;font-weight:700}.cal-slot:hover{background:#cde3fc;border-color:#6da7e5}.cal-plus{font-size:22px;font-weight:400}.cal-time{font-variant-numeric:tabular-nums}.calendar-scroll:focus-visible{outline:3px solid #87b7e8;outline-offset:-3px}@media(max-width:800px){.calendar-card{padding:5px}.calendar-table .cal-person{width:126px;min-width:126px;max-width:126px;padding:7px}.calendar-table .cal-day,.cal-cell{width:77px;min-width:77px}.cal-slot{min-height:65px;height:65px}.cal-legend{font-size:11px}.view-switch button{flex:1}}

/* V7: azione copia settimana */
#copyWeek{background:#e0edff;color:#15569d;border:1px solid #c3d9f6;font-weight:750}#copyWeek:not(:disabled):hover{background:#d0e5ff}#copyWeekForm{border:1px solid #b8d5f3;box-shadow:0 12px 35px #183e6912}#copyWeekForm p{max-width:850px}

/* V8 — Material-inspired: comandi settimanali e interfaccia tablet touch */
:root{--surface:#fff;--ink:#142c4d;--accent:#1765b6;--outline:#dbe5f2}html{scroll-behavior:smooth}body{background:linear-gradient(180deg,#f1f5fb,#f7f9fc);color:var(--ink)}header{position:relative;background:#12355f}.brand strong{letter-spacing:-.25px}.hero{gap:22px}.hero h1{letter-spacing:-.7px}.month{min-width:265px;box-shadow:0 5px 18px #1d3e6510}.week-controls{display:flex;gap:6px;margin:8px 0 4px}.week-controls button{flex:1;min-height:42px;padding:8px 9px;border-radius:12px;background:#e8f1fd;color:#164f8c;font-weight:750;font-size:12px}.week-controls button:hover{background:#d7e8fc}.month>small{display:block;margin-top:7px;color:#6b7f95}.stats{gap:12px}.stat{min-height:118px;display:flex;flex-direction:column;justify-content:center}.stat strong{font-variant-numeric:tabular-nums}.tabs{scrollbar-width:thin}.tabs button{font-weight:650}.tabs button.active{font-weight:800}.card,.stat{border-color:#e0e9f4}.toolbar{align-items:center}.toolbar button{min-height:46px}button{touch-action:manipulation}button:focus-visible{outline:3px solid #7bb7f4;outline-offset:2px}.calendar-table .cal-person{width:205px;min-width:205px;max-width:205px}.calendar-table .cal-day,.cal-cell{width:100px;min-width:100px}.cal-slot{min-height:80px;height:80px;font-size:12px}.calendar-table thead th{height:61px}.calendar-scroll{scrollbar-width:thin}.tablewrap{scrollbar-width:thin}.warning{border:1px solid #ffe3a5}.empty{border:1px dashed #d9e5f2;border-radius:16px;background:#f8fbff}#toast{bottom:calc(20px + env(safe-area-inset-bottom))}
@media(min-width:801px) and (max-width:1250px){main{padding-inline:24px}.calendar-table .cal-person{width:175px;min-width:175px;max-width:175px}.calendar-table .cal-day,.cal-cell{width:90px;min-width:90px}}
@media(max-width:800px){header{padding:12px 16px}.brand{min-width:0}.brand strong{font-size:15px}.hero{margin-bottom:15px}.hero h1{font-size:27px}.month{min-width:0;width:100%;padding:12px 15px}.week-controls button{font-size:13px;min-height:46px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat{min-height:105px;padding:13px}.stat strong{font-size:25px}.tabs{padding-top:7px}.tabs button{min-height:58px}.calendar-table .cal-person{width:132px;min-width:132px;max-width:132px}.calendar-table .cal-day,.cal-cell{width:93px;min-width:93px}.cal-slot{height:78px;min-height:78px;font-size:11px}.calendar-card{padding:7px}.card{border-radius:20px}.toolbar{gap:10px}.toolbar button{width:auto;flex:1}.toolbar button.primary{min-width:160px}.actions button{min-height:46px}input,select,textarea{min-height:48px}#toast{bottom:calc(90px + env(safe-area-inset-bottom))}footer{font-size:10px}}
@media(max-width:420px){main{padding-inline:11px}.stat{padding:11px}.stat small{font-size:11px}.stat strong{font-size:23px}.tabs button{font-size:9px}.week-controls button span{display:none}.calendar-table .cal-person{width:112px;min-width:112px;max-width:112px}.calendar-table .cal-day,.cal-cell{width:86px;min-width:86px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}button{transition:none}}

/* V9: logo ufficiale SottoSopra */
.logo.logo-official{background:#fff;padding:3px 9px;border-radius:15px;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 10px #00000014}
.logo-official img{display:block;width:152px;height:76px;object-fit:contain}
@media(max-width:800px){.logo.logo-official{padding:3px 5px;border-radius:11px}.logo-official img{width:105px;height:55px}.brand{gap:9px}.brand strong{font-size:14px}.brand small{font-size:10px}}
@media(max-width:390px){.logo-official img{width:82px;height:46px}.brand strong{font-size:12px}.brand small{font-size:9px}}

/* V10: colori calendario settimanale */
.cal-slot.cal-daytime{background:#e0f0ff;color:#15569c;border:1px solid #9bc6f2;font-weight:750}
.cal-slot.cal-night{background:#eae4ff;color:#4b328b;border:1px solid #bba9ee;font-weight:750}
.cal-slot.cal-rest{background:#e6f5e9;color:#27693c;border:1px solid #a6d8b2;font-weight:750}
.legend-night{background:#eae4ff;border:1px solid #bba9ee}.legend-rest{background:#e6f5e9;border:1px solid #a6d8b2}
