:root{--ink:#23342e;--muted:#89938e;--line:#edf0ed;--green:#b5d992;--green-dark:#628c47;--blue:#577e9e;--bg:#f6f8f5}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:'DM Sans',sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}.sidebar{position:fixed;inset:0 auto 0 0;width:238px;background:#fff;border-right:1px solid #edf0ed;padding:30px 20px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink);font-family:Manrope,sans-serif;font-size:13px;font-weight:800;letter-spacing:1.1px}.brand-icon{display:grid;place-items:center;width:36px;height:36px;background:#d5eac5;border-radius:11px;font-size:24px;color:#61844d}.brand small{display:block;font:700 9px 'DM Sans';letter-spacing:2.2px;color:#9ba69d;margin-top:4px}.sidebar-label{font-size:9px;letter-spacing:1.5px;font-weight:700;color:#a4aea7;margin:54px 10px 16px}.nav-active{background:#eef5e9;color:#587b48;border-radius:9px;padding:13px 12px;font-weight:700}.nav-active>span:first-child{font-size:18px;margin-right:10px}.nav-arrow{float:right}.calendar-label{margin-top:39px}.calendar-key{display:flex;align-items:flex-start;gap:10px;font-size:12px;font-weight:700;padding:9px 8px;line-height:1.3}.calendar-key small{display:block;color:#a7b0a8;font-size:10px;font-weight:500;margin-top:5px}.key-dot,.legend i{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none;margin-top:3px}.school-dot{background:#d5ac45}.town-dot{background:#648bac}.key-check{margin-left:auto;color:#a6b0a8}.sidebar-bottom{margin-top:auto;background:#f3f7f0;border-radius:12px;padding:17px;color:#55714a}.help-icon{font-size:23px;margin-bottom:17px}.sidebar-bottom strong{font-size:12px}.sidebar-bottom p{font-size:11px;color:#8a9b86;line-height:1.6;margin-bottom:0}.sidebar-footer{font-size:8px;letter-spacing:1px;color:#b0bab1;margin:25px 3px 0}.sidebar-footer span{float:right}.main{margin-left:238px}.topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 48px}.breadcrumbs{font-size:9px;color:#aab2ac;font-weight:700;letter-spacing:1.3px}.breadcrumbs span{padding:0 12px;color:#d6dcd7}.breadcrumbs b{color:#718078}.top-right{display:flex;align-items:center;gap:24px}.demo-pill{font-size:9px;letter-spacing:.8px;font-weight:700;color:#839186}.demo-pill i,.calendar-footer i{display:inline-block;width:6px;height:6px;background:#9cc981;border-radius:50%;margin-right:6px}.profile-button{border:0;background:none;display:flex;align-items:center;gap:10px;text-align:left;color:#5e6e63}.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e6ede2;color:#58794a;font-weight:700}.profile-text b,.profile-text small{display:block}.profile-text b{font-size:11px}.profile-text small{font-size:9px;color:#a5afa7;margin-top:3px}.content{max-width:1500px;margin:auto;padding:46px 48px 20px}.heading{display:flex;justify-content:space-between;align-items:end;margin-bottom:29px}.eyebrow{color:#8ca37e;font-size:9px;letter-spacing:1.6px;font-weight:700}.eyebrow>span{display:inline-block;width:22px;height:2px;background:#aacb95;vertical-align:middle;margin-right:8px}h1,h2,p{margin-top:0}h1{font:800 35px Manrope,sans-serif;letter-spacing:-1.7px;margin:11px 0 8px}h1 em{font-style:normal;color:#9abc88}.heading p{margin:0;color:#96a198;font-size:13px}.primary-button{border:0;border-radius:8px;background:#789d68;color:white;padding:12px 18px;font-weight:700;font-size:12px;box-shadow:0 5px 12px #799d6830}.primary-button span{font-size:20px;vertical-align:middle;margin-right:7px;line-height:10px}.notice{height:55px;background:#eef5e9;border:1px solid #e5f0df;border-radius:9px;display:flex;align-items:center;gap:12px;padding:0 16px;color:#82977b;font-size:11px;margin-bottom:21px}.notice b{color:#617c57}.notice-icon{border:1px solid #9ab890;color:#85a779;border-radius:50%;width:16px;height:16px;text-align:center;font-weight:bold}.notice-spark{margin-left:auto;font-size:19px;color:#bad3ad}.calendar-card{background:white;border:1px solid #e9ede9;border-radius:12px;overflow:hidden;box-shadow:0 8px 35px #203a2910}.calendar-toolbar{display:flex;justify-content:space-between;align-items:center;padding:23px 25px 20px}.date-controls{display:flex;align-items:center;gap:17px}.today-button,.secondary-button{background:white;border:1px solid #e2e9e2;border-radius:6px;padding:8px 13px;color:#65766a;font-weight:700;font-size:11px}.arrows{display:flex;gap:5px}.arrows button{border:0;background:none;color:#849188;font-size:22px;line-height:1}.calendar-toolbar h2{font:700 17px Manrope;margin:0;text-transform:capitalize;letter-spacing:-.5px}.view-switch{background:#f5f7f4;border-radius:7px;padding:3px;display:flex}.view-switch button{border:0;background:none;padding:7px 12px;font-size:10px;color:#98a29a;font-weight:700;border-radius:5px}.view-switch .selected{background:white;color:#58764e;box-shadow:0 1px 4px #273c2920}.legend{display:flex;align-items:center;gap:24px;padding:0 25px 18px;color:#6d7d70;font-size:10px;font-weight:700}.legend i{width:8px;height:8px;margin:0 5px 0 0}.legend small{color:#a7b0a7;font-size:9px;font-weight:400;margin-left:5px}.legend-note{margin-left:auto;color:#bdc5be;font-size:8px;letter-spacing:.8px}.calendar-scroll{overflow:auto;max-height:690px}.week-grid{display:grid;grid-template-columns:58px repeat(var(--days),minmax(100px,1fr));min-width:760px}.day-head{height:70px;text-align:center;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:12px;color:#a5afa6;font-size:9px;font-weight:700;letter-spacing:1px}.day-head b{display:grid;place-items:center;width:30px;height:30px;margin:3px auto 0;color:#5e6e62;font:700 15px Manrope}.day-head.today b{background:#85aa75;color:white;border-radius:50%}.time-col{position:relative;height:1152px}.time-label{position:absolute;right:12px;transform:translateY(-50%);color:#b3bcb4;font-size:9px}.day-column{position:relative;height:1152px;border-left:1px solid #eef1ee;background:repeating-linear-gradient(to bottom,transparent 0,transparent 47px,#eff2ef 47px,#eff2ef 48px)}.day-column:after{content:'';position:absolute;top:672px;width:100%;border-top:1px dashed #ccdcd0;pointer-events:none}.event{position:absolute;left:4px;right:4px;border:0;border-left:3px solid #caa347;border-radius:4px;background:#fcf3d9;color:#80641f;text-align:left;padding:5px 6px;overflow:hidden;font-size:10px;z-index:2}.event.town{background:#e7eff6;border-color:#668eae;color:#557b9a}.event b,.event small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.event small{font-size:9px;margin-top:3px}.month-grid{display:grid;grid-template-columns:repeat(7,minmax(100px,1fr));min-width:700px}.month-day{height:112px;border-top:1px solid var(--line);border-right:1px solid var(--line);padding:8px;color:#6e7c71}.month-day.outside{color:#cdd5ce;background:#fbfcfb}.month-day strong{font-size:11px}.month-event{display:block;width:100%;text-align:left;border:0;border-radius:3px;margin-top:4px;padding:4px;background:#fcf3d9;color:#80641f;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.month-event.town{background:#e7eff6;color:#557b9a}.month-weekday{text-align:center;padding:13px;color:#a5afa6;font-size:9px;font-weight:700}.calendar-footer{padding:17px 25px;display:flex;justify-content:space-between;color:#a9b5aa;font-size:8px;font-weight:700;letter-spacing:.8px}.calendar-footer b{font-size:14px;color:#a5c59b}.bottom-note{display:flex;gap:12px;align-items:center;margin:23px 3px;color:#a0aaa1;font-size:11px}.bottom-note>span{font-size:20px;color:#b4cda9}.bottom-note b{color:#76897a;margin-right:5px}footer{border-top:1px solid #e9ede8;margin-top:34px;padding:22px 0;color:#b6c0b7;font-size:8px;letter-spacing:1px;font-weight:700}footer span{float:right}footer b{color:#a1c393;font-size:13px}dialog{border:0;border-radius:14px;padding:28px;width:min(500px,calc(100% - 32px));box-shadow:0 20px 80px #1e332b33;color:var(--ink)}dialog::backdrop{background:#24392e66}.dialog-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:20px}.dialog-head h2{font:800 23px Manrope;margin:8px 0 0;letter-spacing:-1px}.close{background:none;border:0;font-size:24px;color:#98a69b}label{display:block;color:#65776a;font-size:11px;font-weight:700;margin:15px 0}input,select,textarea{display:block;width:100%;border:1px solid #e1e9e1;border-radius:7px;padding:11px;margin-top:7px;color:#34483a;background:white}textarea{resize:vertical}.form-row{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px}.optional,.form-hint,.dialog-copy{color:#9aa79c;font-size:11px;line-height:1.6}.error{color:#b34747;font-size:11px}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.profile-options{display:grid;gap:8px}.profile-options button{display:flex;align-items:center;text-align:left;gap:12px;background:#f7f9f6;border:1px solid #eef1ed;border-radius:8px;padding:12px;color:#65766a}.profile-options button>span:nth-child(2){flex:1}.profile-options b,.profile-options small{display:block}.profile-options small{color:#9aa79c;margin-top:4px}.school-avatar{background:#f8edc9;color:#8c6c20}.town-avatar{background:#e1edf5;color:#557b9a}.delete-button{margin-right:auto;border:0;background:none;color:#b46565;font-weight:700;font-size:11px}@media(max-width:900px){.sidebar{width:65px;padding:20px 12px}.brand span:not(.brand-icon),.sidebar-label,.nav-active,.calendar-key,.sidebar-bottom,.sidebar-footer{display:none}.main{margin-left:65px}.content{padding:30px 22px}.topbar{padding:0 22px}.profile-text,.breadcrumbs{display:none}}@media(max-width:600px){.sidebar{display:none}.main{margin:0}.topbar{height:60px}.top-right{margin-left:auto}.content{padding:25px 15px}h1{font-size:27px}.heading{align-items:start;gap:15px}.heading .primary-button{white-space:nowrap;padding:10px}.notice{height:auto;padding:13px;line-height:1.5}.calendar-toolbar{align-items:start;gap:15px;flex-direction:column}.legend{flex-wrap:wrap;gap:10px}.legend-note{display:none}.bottom-note span span{display:none}.form-row{grid-template-columns:1fr 1fr}.form-row label:first-child{grid-column:span 2}}

/* Accenti dell'interfaccia in base al profilo dimostrativo. */
body[data-profile="school"] .primary-button,body[data-profile="school"] .day-head.today b{background:#b78e32}
body[data-profile="school"] h1 em{color:#c6a34c}
body[data-profile="school"] .notice,body[data-profile="school"] .nav-active,body[data-profile="school"] .sidebar-bottom{background:#faf5e5;color:#806a37}
body[data-profile="school"] .notice b,body[data-profile="school"] .sidebar-bottom strong{color:#806a37}
body[data-profile="school"] .eyebrow{color:#a4863a}
body[data-profile="school"] .eyebrow>span{background:#cfb567}
body[data-profile="town"] .primary-button,body[data-profile="town"] .day-head.today b{background:#648bac}
body[data-profile="town"] h1 em{color:#779bb5}
body[data-profile="town"] .notice,body[data-profile="town"] .nav-active,body[data-profile="town"] .sidebar-bottom{background:#edf3f7;color:#5e7f97}
body[data-profile="town"] .notice b,body[data-profile="town"] .sidebar-bottom strong{color:#52758e}
body[data-profile="town"] .eyebrow{color:#6689a2}
body[data-profile="town"] .eyebrow>span{background:#88a9be}

.calendar-key{width:100%;border:0;background:transparent;text-align:left;color:inherit;border-radius:8px;cursor:pointer}.calendar-key:hover{background:#f5f7f4}.calendar-key:focus-visible{outline:2px solid #789d68;outline-offset:2px}.calendar-key[aria-pressed="false"]{opacity:.48}.calendar-key[aria-pressed="false"] .key-check{visibility:hidden}

.overlap-warning:not([hidden]){display:block;background:#fff5d5;border:1px solid #ecd584;border-radius:8px;color:#765819;padding:12px 14px;font-size:12px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}

/* Segnala le sovrapposizioni mantenendo il colore dell'ente. */
.event.has-overlap,.month-event.has-overlap{box-shadow:inset 0 -5px 0 #e2b63f}
.month-event.has-overlap{padding-bottom:8px}

/* Colori della scuola e avviso visibile sulle sovrapposizioni. */
.school-dot{background:#dc812f}
.school-avatar{background:#ffead8;color:#a64d12}
.event:not(.town){background:#fff0e3;border-color:#dc812f;color:#8b451b}
.month-event:not(.town){background:#fff0e3;color:#8b451b}
body[data-profile="school"] .primary-button,body[data-profile="school"] .day-head.today b{background:#be6522}
body[data-profile="school"] h1 em{color:#d28448}
body[data-profile="school"] .notice,body[data-profile="school"] .nav-active,body[data-profile="school"] .sidebar-bottom{background:#fff2e6;color:#925b33}
body[data-profile="school"] .notice b,body[data-profile="school"] .sidebar-bottom strong{color:#8b4d22}
body[data-profile="school"] .eyebrow{color:#af642c}
body[data-profile="school"] .eyebrow>span{background:#dc9a68}
.event.has-overlap,.month-event.has-overlap{box-shadow:inset 0 -5px 0 #e2b63f;padding-right:22px}
.month-event.has-overlap{position:relative}
.event.has-overlap::after,.month-event.has-overlap::after{content:'⚠️';position:absolute;right:3px;bottom:2px;font-size:12px;line-height:1}
/* Allinea l'avviso all'interno dell'evento e lascia la striscia continua. */
.event.has-overlap::after,.month-event.has-overlap::after{top:5px;right:5px;bottom:auto;width:14px;height:14px;display:flex;align-items:center;justify-content:center;font-size:11px;line-height:14px}
.event.has-overlap,.month-event.has-overlap{box-shadow:inset 0 -4px 0 #e2b63f}

/* Un solo indicatore per ogni gruppo di eventi sovrapposti nella griglia. */
.event.has-overlap{box-shadow:none;padding-right:6px}
.event.has-overlap::after{content:none}
.overlap-strip{position:absolute;left:3px;right:3px;height:4px;background:#e2b63f;z-index:3;pointer-events:none;text-align:center;border-radius:0 0 3px 3px;color:#765819;font-size:13px;line-height:1}
.overlap-strip::after{content:'⚠️';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#fff4ca;border-radius:50%;width:19px;height:19px;display:flex;align-items:center;justify-content:center;font-size:12px}
/* Fasce indicative: scuola fino alle 14, Comune dalle 14. */
.day-column{background:repeating-linear-gradient(to bottom,transparent 0,transparent 47px,rgba(94,110,99,.11) 47px,rgba(94,110,99,.11) 48px),linear-gradient(to bottom,#fff8f1 0,#fff8f1 58.3333%,#f1f7fb 58.3333%,#f1f7fb 100%)}
.day-column:after{border-top:2px solid #a6b6ac;z-index:1}

/* Mantiene visibili navigazione e intestazioni durante lo scorrimento. */
.topbar{position:sticky;top:0;z-index:20}
.calendar-card{overflow:visible}
.calendar-header{position:sticky;top:76px;z-index:12;background:#fff;border-radius:12px 12px 0 0}
.day-head,.month-weekday{position:sticky;top:0;z-index:8;background:#fff}
@media(max-width:600px){.calendar-header{top:60px}}

.day-head,.month-weekday{top:var(--header-offset,0px)}

.calendar-actions{display:flex;align-items:center;gap:16px}
.calendar-actions .primary-button{white-space:nowrap}
@media(max-width:600px){.calendar-actions{width:100%;justify-content:space-between;gap:8px}.calendar-actions .primary-button{padding:10px 12px}}

.login-dialog{max-width:440px;padding:36px}.login-dialog::backdrop{background:#26382fe0}.login-brand{display:flex;align-items:center;gap:10px;margin-bottom:40px;font:800 12px Manrope,sans-serif;letter-spacing:1px}.login-brand small{display:block;color:#9ba69d;font:700 9px 'DM Sans',sans-serif;letter-spacing:2px;margin-top:3px}.login-dialog h2{font:800 26px Manrope,sans-serif;letter-spacing:-1px;margin:10px 0}.login-dialog label{margin:20px 0}.login-submit{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:14px}.login-submit span{margin:0;font-size:16px;line-height:1}.login-note{background:#f5f7f3;border-radius:8px;padding:12px;color:#859388;font-size:11px;line-height:1.5;margin:20px 0 0}

.login-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f2f6f0}.login-card{width:min(440px,100%);background:#fff;border:1px solid #e7eee6;border-radius:16px;padding:36px;box-shadow:0 16px 50px #203a2912}.login-card h1{font:800 26px Manrope,sans-serif;letter-spacing:-1px;margin:10px 0}.login-card label{margin:20px 0}@media(max-width:480px){.login-card{padding:26px}}
