/* Sabatelli / Frost app visual system – responsive shell v1.1 */
:root {
  --navy:#28483b; --navy2:#315447; --ink:#263d35;
  --muted:#73867c; --edge:#dfe9e3; --bg:#f3f6f3;
  --surface:#fff; --green:#337956; --greenSoft:#e9f4ed;
  --red:#c95055; --orange:#c98a36; --blue:#527d9c;
  --shadow:0 3px 17px rgba(29,62,43,.045);
}
html,body{max-width:100%;overflow-x:hidden}
body{font-family:'DM Sans',system-ui,-apple-system,'Segoe UI',sans-serif;font-size:14px}
:focus-visible{outline:3px solid #60b487!important;outline-offset:2px}
.shell{align-items:stretch}
.sidebar{width:244px;background:#fff;color:var(--ink);border-right:1px solid var(--edge);box-shadow:none;z-index:5}
.sidebar>.brand{min-height:151px;padding:18px 18px 16px;flex-direction:column;justify-content:center;gap:0;border-color:var(--edge);align-items:center;text-align:center}
.sidebar .brandlogo{width:164px;height:94px;padding:0;background:transparent;border-radius:0}
.sidebar .brandlogo img{width:100%;height:100%;object-fit:contain;display:block}
.sidebar .brandtext b{font-size:13px;color:#304d3d;letter-spacing:0;font-weight:800}
.sidebar .brandtext small{font-size:9px;color:#82948a;letter-spacing:1.25px;margin-top:4px}
.navhead{color:#8a9990;margin:22px 19px 8px;letter-spacing:1.15px;font-size:10px}
.menu{padding:0 11px;gap:4px}
.navitem{font-size:13px;min-height:45px;border-radius:9px;padding:12px 13px;color:#526b5b;gap:11px;font-weight:700}
.navitem .ico{width:18px;height:18px;color:#648575}
.navitem:hover{background:#ecf3ef;color:#264c38}
.navitem.active{background:#315e47;color:#fff;box-shadow:0 2px 5px #26563c1f}
.navitem.active .ico{color:#fff}
.navitem.active:before{display:none}
.navitem .count{background:#ebf1ed;color:#516f5a;margin-left:auto}
.navitem.active .count{background:#ffffff23;color:#fff}
.sidebottom{padding:12px 13px 20px}
.sidehint{border-color:#dfeae2;background:#f1f7f2;padding:12px}
.sidehint strong{color:#42634f}
.sidehint p{color:#708578}
.userline{border-top:1px solid var(--edge);padding:14px 5px 0}
.userline b{color:#2d493a}
.userline small{color:#779183}
.avatar{background:#dcebe0;color:#315e45}
.logout{color:#6c8575}
.topbar{height:70px;background:white;border-bottom-color:var(--edge);padding:0 29px}
.crumb{color:#86978c}
.crumb strong{color:#355340;font-size:14px}
.main{min-width:0;width:0;flex:1}
.content{padding:27px 29px 64px;max-width:1560px}
.sectionintro{margin-bottom:22px}
.sectionintro h1{font-family:'DM Sans',sans-serif;color:#273f33;font-size:26px;letter-spacing:-.75px}
.eyebrow{color:#527b61;letter-spacing:1.25px}
.subtitle{color:#7e9285;font-size:13px}
.panel,.stat,.intervention-card{border-radius:12px;border-color:var(--edge);box-shadow:var(--shadow)}
.btn{border-radius:9px;font-size:12px;box-shadow:none;padding:10px 15px;color:#345344}
.btn.primary{background:#326749;border-color:#326749;box-shadow:none}
.btn.primary:hover{background:#255439}
.btn.blue{background:#e7f1f6;color:#3b718d;border-color:#d8e8f0}
.btn:hover{transform:none}
.stats{gap:12px;margin-bottom:18px}
.stat{min-height:128px;padding:20px 19px}
.statname{color:#62796b;font-size:12px;margin-bottom:15px}
.statnum{font-family:'DM Sans',sans-serif;color:#2d4c3a;font-size:34px}
.statfoot{font-size:11px}
.staticon{background:#ebf2ed;color:#49725b}
.sectionbar{margin:24px 0 12px}
.sectionbar h2{color:#2f4938;font-size:16px}
.itemtitle{font-size:14px;color:#2d4337}
.itemsub{font-size:11.5px}
.kicker{color:#678372}
.intervention-card{padding:16px 17px}
.intervention-card:hover{border-color:#9fbfac;background:#fbfdfb;box-shadow:0 4px 15px #335b3b15}
.intervention-card:focus-visible{outline-offset:0}
.status-aperto{background:#ebf2fb;color:#456f9d}
.status-in_corso{background:#fff3e3;color:#a66b21}
.status-completato{background:#e1f4e8;color:#277f4f}
.status-annullato{background:#ebedef;color:#6f7b7e}
.priority-urgente{background:#ffebeb;color:#ba3d43}
.priority-alta{background:#fff0dc;color:#b66e25}
.priority-media{background:#edf3fb;color:#52799d}
.priority-bassa{background:#e8f4ea;color:#5b8366}
.calendar-shell{border-radius:12px}
.calday.today .date-num{background:#325e45}
.calday.selected{outline:2px solid #4b956a;background:#f0f9f2}
.calday:hover{background:#f2f8f3}
.cal-event{background:#e5f1e9;border-left-color:#4d9c65;color:#397b4e}
.cal-event.done{background:#ebf0f0;border-left-color:#799f90;color:#547c6d}
.field:focus,.input:focus,.select:focus,.textarea:focus{border-color:#528c68;box-shadow:0 0 0 3px #51936b17}
.searchbox .ico{color:#86a092}
.modalback{background:#142b22a6}
.modal{border-radius:14px;box-shadow:0 24px 80px #071c103d}
.modalheader{border-color:var(--edge)}
.modalheader h2{color:#294935}
.modalfooter{background:#f7faf7;border-color:var(--edge)}
.dropfile{background:#f5faf6;border-color:#9fc9a9;color:#466d54}
.tipbox{background:#f2f8f3;border-color:#d7e8dc;color:#4d7658}
.tipbox strong{color:#345c3e}
.authwrap{grid-template-columns:minmax(360px, .88fr) minmax(360px, 1.12fr)}
.authbrand{background:linear-gradient(152deg,#285039 0%,#376b4b 80%,#3e7954 100%);padding:46px 55px}
.authbrand .brand{flex-direction:column;align-items:flex-start;gap:10px}
.authbrand .brandlogo{width:214px;height:120px;padding:0;border-radius:12px;background:#fff}
.authbrand .brandtext b{font-size:17px;color:#fff}
.authbrand .brandtext small{color:#d3e6d6}
.authheadline h1{font-family:'DM Sans',sans-serif;letter-spacing:-1.6px;font-size:clamp(31px,3vw,47px)}
.authheadline h1 span{color:#b7e7bb}
.authheadline p{color:#d1e3d6}
.authfoot{color:#cfdfd0}
.authbox h2{font-family:'DM Sans',sans-serif;color:#304c38}
.authright{padding:38px}
.mobile-tabs,.mobile-fab,.mobile-more-wrap,.mobile-header-brand{display:none}
@media(min-width:881px){.sidebar{height:100dvh}}
@media(max-width:1180px) and (min-width:881px){
  .sidebar{width:218px}.sidebar>.brand{min-height:137px}.sidebar .brandlogo{width:146px;height:82px}
  .content{padding:25px 22px 52px}.topbar{padding:0 22px}
}
@media(max-width:880px){
  .shell{display:block;min-height:100dvh}
  .sidebar{display:none!important}
  .main{width:100%;min-height:100dvh;padding-bottom:0}
  .topbar{height:69px;padding:0 20px;position:sticky;top:0;z-index:8;box-shadow:0 2px 8px #1a392311}
  .topbar .crumb{display:none}
  .mobile-header-brand{display:flex;align-items:center;gap:10px;min-width:0}
  .mobile-head-logo{width:69px;height:45px;border-radius:6px;background:#fff;flex-shrink:0;overflow:hidden;display:grid;place-items:center}
  .mobile-head-logo img{width:100%;height:100%;object-fit:contain}
  .mobile-header-brand b{font-size:15px;font-weight:800;color:#2b4d37;display:block;line-height:1.2}
  .mobile-header-brand small{color:#819489;font-size:11px;display:block;margin-top:3px}
  .content{padding:20px 20px calc(118px + env(safe-area-inset-bottom,0px));width:100%;max-width:none}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two-col{grid-template-columns:1fr}
  .cardgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mobile-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;position:fixed;left:0;bottom:0;right:0;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));height:calc(71px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #dce6de;z-index:16;box-shadow:0 -3px 14px #1b422111}
  .mobile-tab{appearance:none;background:transparent;border:0;padding:6px 2px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;color:#788e7e;font-size:10px;letter-spacing:-.15px;font-weight:700;border-radius:8px}
  .mobile-tab.active{color:#275e3f;background:#edf6ef}
  .mobile-tab-icon{position:relative;display:grid;place-items:center;height:25px}
  .mobile-tab-icon .ico{width:21px;height:21px;stroke-width:2}
  .mobile-count{position:absolute;left:15px;top:-7px;background:#ad7544;color:#fff;border-radius:11px;padding:2px 4px;min-width:17px;font-size:9px;line-height:12px}
  .mobile-fab{display:flex;align-items:center;gap:7px;position:fixed;right:16px;bottom:calc(87px + env(safe-area-inset-bottom,0px));z-index:15;padding:12px 16px;background:#315e45;border:none;border-radius:30px;color:#fff;box-shadow:0 5px 22px #1c472e42;font-size:12px;font-weight:800}
  .mobile-fab .ico{width:18px;height:18px}
  .mobile-more-wrap{display:block;visibility:hidden;opacity:0;pointer-events:none;position:fixed;inset:0;z-index:15;transition:opacity .15s}
  .mobile-more-wrap.open{visibility:visible;opacity:1;pointer-events:auto}
  .mobile-more-overlay{position:absolute;inset:0;border:0;background:#0f271766;width:100%;height:100%;border-radius:0}
  .mobile-more-panel{position:absolute;bottom:calc(77px + env(safe-area-inset-bottom,0px));left:12px;right:12px;background:#fff;border:1px solid #e1e9e1;border-radius:15px;box-shadow:0 16px 36px #16342135;padding:13px;max-width:500px;margin:0 auto}
  .mobile-more-title{display:flex;gap:11px;align-items:center;padding:7px 8px 13px;margin-bottom:7px;border-bottom:1px solid var(--edge)}
  .mobile-more-title b{display:block;color:#294d36;font-size:13px}.mobile-more-title small{display:block;color:#748b7b;margin-top:3px}
  .mobile-more-item{width:100%;padding:13px 11px;background:#fff;border:0;border-radius:9px;display:flex;align-items:center;gap:12px;text-align:left;color:#365944;font-weight:700}
  .mobile-more-item.selected,.mobile-more-item:hover{background:#edf5ef}
  .mobile-more-item span{flex:1}.mobile-more-item .ico{height:19px;width:19px}
  .mobile-logout{color:#ad5350}
  .toastzone{bottom:calc(149px + env(safe-area-inset-bottom,0px));right:13px}
  .modalback{z-index:30}
  .authwrap{grid-template-columns:1fr 1fr}
}
@media(max-width:630px){
  .topbar{height:61px;padding:0 13px}
  .mobile-head-logo{width:61px;height:41px}
  .mobile-header-brand b{font-size:13px}
  .refresh-btn{padding:9px;border-radius:8px}
  .refresh-btn span{display:none}
  .content{padding:16px 12px calc(124px + env(safe-area-inset-bottom,0px))}
  .sectionintro{margin-bottom:17px}
  .sectionintro h1{font-size:23px}
  .sectionintro .subtitle{font-size:12px}
  .row-actions{margin-top:13px}
  .stats{gap:9px}.stat{padding:14px;min-height:112px}
  .statnum{font-size:28px}.statname{font-size:11px;margin-bottom:14px}
  .statfoot{font-size:9.5px}
  .staticon{top:12px;right:12px;width:29px;height:29px}
  .cardgrid{grid-template-columns:1fr}
  .intervention-card{gap:9px;padding:13px 12px;flex-wrap:wrap}
  .itemmain{flex-basis:100%}
  .itemright{max-width:100%;width:100%;justify-content:flex-start}
  .itemtitle{font-size:14px}
  .itemsub{font-size:11px;gap:7px}
  .panel{border-radius:11px}
  .filterpanel{gap:9px;padding:10px}
  .filterpanel select{min-width:0;width:calc(50% - 5px);flex:1}
  .searchbox{min-width:100%}
  .results-count{margin-left:auto}
  .cal-header{gap:8px;flex-wrap:wrap}
  .cal-header h2{font-size:17px}
  .calendar-shell{padding:9px}
  .weekdays div{padding:8px 0;font-size:9px}
  .calday{min-height:67px;padding:5px 1px}
  .cal-event{height:5px;width:55%;margin:4px auto;font-size:0;padding:0;border:0;border-radius:8px;background:#71a782}
  .cal-event.done{background:#b0c0b5}
  .calday.selected{outline-width:2px}
  .date-num{margin:0 auto 4px}
  .calendar-detail{margin-top:12px}
  .modalback{align-items:stretch;padding:0}
  .modal{max-height:100dvh;height:100dvh;min-height:0;border-radius:0;display:flex;flex-direction:column;overscroll-behavior:contain;overflow-y:auto}
  .modalbody{flex:1;overflow-y:auto;padding:17px 15px}
  .modalheader{padding:15px;flex-shrink:0}
  .modalfooter{position:sticky;bottom:0;flex-shrink:0;z-index:2;padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));border-radius:0}
  .modalfooter .btn{padding:12px 9px;white-space:normal}
  .formgrid{grid-template-columns:1fr}
  .photos{grid-template-columns:repeat(3,minmax(0,1fr))}
  .data-actions{display:flex;flex-direction:column}
  .data-actions .panel{min-width:0;width:100%;margin-bottom:0}
  .users-table{min-width:550px}
  .authwrap{display:block;min-height:100dvh}
  .authbrand{min-height:185px;padding:17px 21px}
  .authbrand .brand{display:flex;flex-direction:row;align-items:center;gap:12px}
  .authbrand .brandlogo{width:103px;height:66px;padding:0}
  .authbrand .brandtext b{font-size:12px}
  .authbrand .brandtext small{font-size:9px}
  .authheadline h1{font-size:23px;margin:18px 0 0;letter-spacing:-.7px}
  .authright{padding:28px 19px}
  .authbox h2{font-size:24px}
}
@media(max-width:355px){
  .mobile-tab{font-size:9px}.mobile-tabs{padding-left:3px;padding-right:3px}
  .mobile-head-logo{width:51px}.mobile-header-brand b{font-size:12px}
  .statnum{font-size:25px}
}
/* Small-screen refinements */
@media(max-width:880px){.authbrand .brand{display:flex}}
@media(max-width:630px){
 .cardgrid .itemright{max-width:100%;width:100%;flex-wrap:wrap;justify-content:flex-start}
 .cal-header .cal-controls{flex-shrink:0}
 .calendar-detail .sectionbar{flex-wrap:wrap}
 .calendar-detail .sectionbar .btn{white-space:normal}
 .mobile-tab:active{background:#e7f2e9}
 .mobile-fab:active{background:#244d35}
}
