:root{font-family:Inter,Segoe UI,Arial,sans-serif;color:#23352f;background:#f5f6f2;font-synthesis:none;font-size:15px;--green:#133a32;--mint:#b5edcb;--line:#dce3dc;--muted:#697870}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer}a{color:inherit}button:disabled{opacity:.55;cursor:wait}.loading{padding:4rem;text-align:center;color:var(--muted)}.auth{min-height:100vh;display:grid;grid-template-columns:minmax(300px,1fr) minmax(360px,1fr)}.auth-aside{background:var(--green);color:#fff;padding:clamp(32px,7vw,100px);display:flex;flex-direction:column;justify-content:space-between;gap:40px}.auth-aside h1{font-size:clamp(36px,4vw,58px);line-height:1.12;letter-spacing:-2px;font-weight:500;max-width:600px}.auth-aside p{color:#c3d6cd;font-size:17px;line-height:1.7;max-width:450px}.auth-aside .seal{font-size:80px;color:var(--mint);line-height:1}.auth-main{display:flex;align-items:center;justify-content:center;padding:40px 28px}.auth-card{width:100%;max-width:430px}.auth-card h2{font-size:30px;letter-spacing:-.8px}.eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:11px;font-weight:700;color:var(--muted)}.brand{display:flex;align-items:center;gap:12px;font-size:23px;font-weight:650;letter-spacing:-.7px}.brand img{width:38px;height:38px}.brand small{display:block;font-size:10px;color:#a5b9ad;letter-spacing:1.5px;margin-top:3px}.auth .brand small{color:#bbd5c7}.app-shell{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--green);color:#d6e2d9;padding:28px 16px;position:sticky;top:0;height:100vh;overflow:auto;display:flex;flex-direction:column}.sidebar .brand{padding:0 10px;margin-bottom:30px}.nav-group{font-size:10px;text-transform:uppercase;letter-spacing:1.7px;color:#95ada0;margin:22px 14px 8px}.nav-item{display:block;width:100%;text-align:left;padding:11px 13px;border:0;background:none;color:#d6e2d9;border-radius:8px;margin:2px 0;font-size:13px}.nav-item:hover{background:#ffffff0d}.nav-item.active{background:var(--mint);color:var(--green);font-weight:650}.side-footer{margin-top:auto;padding-top:30px;font-size:11px;color:#afc1b6}.main{padding:0 42px 46px;min-width:0}.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;height:91px;border-bottom:1px solid var(--line);margin-bottom:35px}.establishment{display:flex;align-items:center;gap:12px}.square{width:35px;height:35px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;background:white;font-weight:700;color:#426457}.topbar .name{font-weight:650;font-size:14px}.subtle{color:var(--muted);font-size:12px;line-height:1.6}.account{display:flex;align-items:center;gap:10px;text-align:right}.mobile-nav{display:none}.page-title{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:20px 0 30px}h1{font-size:32px;letter-spacing:-1.1px;font-weight:600;margin:7px 0 12px}h2{font-size:18px;font-weight:650;margin:0 0 18px;letter-spacing:-.3px}h3{font-size:16px;margin:0 0 12px}p{line-height:1.65}.page-title p{color:var(--muted);max-width:650px;margin:0;font-size:14px}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--green);border-radius:8px;padding:11px 16px;background:var(--green);color:white;font-weight:600;font-size:13px;text-decoration:none;white-space:nowrap}.button.secondary{background:white;color:var(--green);border-color:var(--line)}.button.light{background:var(--mint);color:var(--green);border-color:transparent}.button.small{padding:7px 10px;font-size:12px}.button.ghost{border:0;background:none;color:var(--muted);padding:8px}.actions{display:flex;gap:9px;flex-wrap:wrap}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:25px 0}.stat{background:white;border:1px solid var(--line);border-radius:12px;padding:21px}.stat .value{font-size:36px;letter-spacing:-1px;font-weight:500;margin:10px 0}.stat .label{font-size:12px;color:var(--muted)}.stat .tag{font-size:10px;letter-spacing:1px;text-transform:uppercase;color:#557462}.panel{background:white;border:1px solid var(--line);border-radius:12px;padding:24px;margin-bottom:22px}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.panel-head h2{margin:0}.cols{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:22px}.welcome{background:#e8efe5;border:1px solid #d7e2d3;padding:24px;border-radius:12px;display:flex;align-items:center;gap:25px;margin-bottom:24px}.welcome .symbol{font-size:36px;color:#446b45}.welcome h2{margin:0 0 5px}.welcome p{margin:0;color:#627561;font-size:13px}.quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.quick button{background:white;border:1px solid var(--line);border-radius:10px;padding:20px;text-align:left;color:var(--green)}.quick button:hover{border-color:#7a9b87}.quick .icon{font-size:25px;display:block;margin-bottom:18px}.quick strong{font-size:13px;display:block}.quick small{font-size:11px;color:var(--muted);display:block;margin-top:7px}.equipment{border:1px solid var(--line);border-radius:10px;padding:17px;margin-bottom:12px;display:flex;justify-content:space-between;align-items:center;gap:15px}.temperature{font-size:26px;font-weight:500;letter-spacing:-.8px}.badge{display:inline-block;padding:5px 8px;font-size:10px;border-radius:5px;background:#edf3eb;color:#4d7253;line-height:1.3}.badge.alert{background:#fff0e6;color:#9a552d}.badge.neutral{background:#eef0ee;color:#6d766d}.badge.closed{background:#e4f3ec;color:#287252}.empty{padding:32px 18px;text-align:center;border:1px dashed #d9e2d7;border-radius:10px;color:var(--muted);font-size:13px;line-height:1.7}.empty strong{display:block;color:#4b6554;font-size:15px;margin-bottom:5px}.alert-card{border-top:1px solid var(--line);padding:15px 0}.alert-card:first-of-type{border:0}.alert-card p{font-size:13px;margin:9px 0;color:var(--muted)}.filter{width:min(400px,100%);margin-bottom:18px}.record{border-top:1px solid var(--line);padding:18px 0;display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.record:first-child{border-top:0}.record h3{margin-bottom:8px}.record .excerpt{font-size:12px;color:var(--muted);max-width:550px;line-height:1.6}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:12px}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px 10px;white-space:nowrap}th{color:var(--muted);font-weight:500}.note{padding:15px 18px;border-radius:9px;background:#f0f4ed;color:#596e5c;font-size:12px;line-height:1.7;margin:18px 0}.note.warning{background:#fff3e8;color:#895d37}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.field{display:flex;flex-direction:column;gap:7px}.field.full{grid-column:1/-1}label{font-size:12px;font-weight:600;color:#3c5446}input,select,textarea{width:100%;padding:11px 12px;border:1px solid #ccd8cc;border-radius:7px;background:#fff;color:#263d30;min-height:43px}textarea{resize:vertical;min-height:95px;line-height:1.5}select[multiple]{min-height:120px}input[type=file]{font-size:12px}input[type=checkbox]{width:auto;min-height:0}input:focus,select:focus,textarea:focus{border-color:#3e7853;outline:2px solid #cde4cb}.form-error{color:#a3442e;background:#fff2e9;border-radius:7px;padding:12px;font-size:13px;display:none;line-height:1.6}.form-error.visible{display:block}.form-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}dialog{border:1px solid var(--line);border-radius:14px;width:min(760px,calc(100% - 32px));max-height:90vh;padding:28px;color:#263d30;box-shadow:0 30px 90px #002b2633}dialog::backdrop{background:#0d241e70;backdrop-filter:blur(2px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.dialog-head h2{margin:0}.preview{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.preview img{height:110px;width:140px;object-fit:cover;border-radius:7px}.details{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}.detail{font-size:13px;overflow-wrap:anywhere}.detail.full{grid-column:1/-1}.detail dt{color:var(--muted);font-size:11px;margin-bottom:6px}.detail dd{margin:0;white-space:pre-wrap;line-height:1.6}.document-links{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.steps{counter-reset:step}.steps p{font-size:12px;padding:12px 0;margin:0;border-top:1px solid var(--line);color:var(--muted)}.steps p::before{counter-increment:step;content:counter(step);background:#edf2e8;color:#486347;border-radius:50%;display:inline-grid;place-items:center;width:22px;height:22px;margin-right:10px;font-weight:650}.module-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.module-card{border:1px solid var(--line);border-radius:10px;padding:20px;text-align:left;background:white;color:var(--green)}.module-card strong{display:block;margin-bottom:12px}.module-card small{color:var(--muted)}#toast{position:fixed;right:24px;bottom:24px;padding:15px 20px;background:var(--green);color:#fff;border-radius:8px;max-width:min(500px,calc(100% - 40px));display:none;box-shadow:0 8px 30px #133a3225;z-index:5;font-size:13px}#toast.show{display:block}.muted-link{font-size:12px;color:var(--muted)}.spark{width:100%;height:170px;display:block}.spark text{font-size:10px;fill:#708173}.password-field{display:flex;gap:7px}.password-field input{min-width:0}.password-field button{flex-shrink:0}.full-button{width:100%;margin-top:22px}.notice{color:var(--muted);font-size:12px;line-height:1.65}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}@media (min-width:1550px){.main{padding-left:60px;padding-right:60px;max-width:1650px}}@media (max-width:1150px){.main{padding-left:25px;padding-right:25px}.app-shell{grid-template-columns:215px 1fr}.stats{gap:10px}.stat{padding:16px}.cols{grid-template-columns:1fr}.module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:760px){.auth{grid-template-columns:1fr}.auth-aside{padding:27px;gap:18px}.auth-aside h1{font-size:30px;margin:15px 0}.auth-aside .seal,.auth-aside .bottom{display:none}.auth-aside p{font-size:13px;margin:0}.auth-main{padding:28px 22px}.app-shell{display:block}.sidebar{display:none}.main{padding:0 18px 30px}.topbar{height:80px;margin-bottom:18px}.topbar .name{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account .subtle{display:none}.account .button{padding:7px;font-size:11px}.mobile-nav{display:block;margin:0 0 23px}.mobile-nav label{display:none}.page-title{margin:18px 0 22px;flex-wrap:wrap;gap:15px}h1{font-size:27px}.page-title p{font-size:13px}.stats{grid-template-columns:1fr 1fr;gap:10px}.stat .value{font-size:29px}.stat{padding:15px}.panel{padding:18px}.quick{gap:8px}.quick button{padding:14px 10px}.quick .icon{font-size:22px;margin-bottom:12px}.quick strong{font-size:11px}.quick small{display:none}.welcome{padding:18px;gap:15px}.welcome .symbol{font-size:27px}.module-grid{grid-template-columns:1fr 1fr;gap:10px}.module-card{padding:15px;font-size:12px}.form-grid,.details{grid-template-columns:1fr}.field.full,.detail.full{grid-column:auto}dialog{padding:20px;max-height:94vh}.record{flex-direction:column;gap:12px}.record .actions{width:100%}.equipment{padding:14px}.temperature{font-size:23px}.square{display:none}.panel-head{align-items:flex-start}#toast{right:18px;bottom:18px}.auth-card h2{font-size:26px}}@media print{.sidebar,.topbar,.mobile-nav,.page-title .actions,.button,#toast{display:none!important}.app-shell{display:block}.main{padding:0}.panel{break-inside:avoid}dialog[open]{position:static;max-height:none;width:100%;border:0;box-shadow:none}body:has(dialog[open]) #app{display:none}.spark{height:180px}}
/* Touch-friendly controls and a layout that also fits narrow tablets. */
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.button,.button.small,.button.ghost,.nav-item{min-height:44px}
.button{white-space:normal;text-align:center;line-height:1.35;max-width:100%}
.actions{align-items:stretch}.actions>.button{flex-shrink:0}
.page-title>div:first-child{min-width:0}.page-title>.actions{justify-content:flex-end;max-width:55%}
input,select,textarea{font-size:16px;min-height:48px;min-width:0;scroll-margin-block:24px}
input[type=checkbox]{min-height:22px;width:22px;flex:0 0 22px;accent-color:var(--green)}
input[hidden]{display:none}label{font-size:14px;line-height:1.4}
.field{min-width:0}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.number-field{display:flex;gap:8px}.number-field input{flex:1;width:0}.number-field button{flex:0 0 48px;font-size:22px;padding:4px}
.form-section{grid-column:1/-1;margin:12px 0 0;padding-top:16px;border-top:1px solid var(--line);font-size:16px;color:var(--green)}
.record-choices{max-height:250px;overflow:auto;border:1px solid var(--line);border-radius:8px}
.record-choice{display:flex;align-items:center;gap:12px;padding:12px;min-height:52px;font-weight:400;border-bottom:1px solid var(--line);cursor:pointer}
.record-choice:last-child{border-bottom:0}.record-choice span{min-width:0;overflow-wrap:anywhere}.record-choice small{display:block;color:var(--muted);margin-top:4px}
.equipment-info{min-width:0;overflow-wrap:anywhere}.equipment-measure{flex-shrink:0;text-align:right}.equipment-actions{display:flex;gap:4px;justify-content:flex-end;margin-top:6px}
.equipment .badge{margin-top:5px}.record>div:first-child{min-width:0;overflow-wrap:anywhere}
.document-links .button{overflow-wrap:anywhere}.table-wrap{max-width:100%;overscroll-behavior-x:contain}
.touch-nav{display:none}#page:focus{outline:none}
body:has(dialog[open]){overflow:hidden}
dialog{padding:0;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow:hidden}
dialog[open]{display:flex;flex-direction:column}
#modal-body{display:flex;flex-direction:column;min-height:0;max-height:inherit}
.dialog-head{flex-shrink:0;padding:18px 24px;margin:0;border-bottom:1px solid var(--line);gap:12px;background:#fff}
.dialog-head h2{line-height:1.4;overflow-wrap:anywhere}.dialog-head .button{flex:0 0 44px}
.dialog-content{overflow:auto;min-height:0;padding:24px;overscroll-behavior:contain}
.dialog-content.form-dialog{display:flex;overflow:hidden;padding:0}
.scroll-form{display:flex;flex-direction:column;min-height:0;width:100%;max-height:100%}
.form-scroll{overflow:auto;min-height:0;padding:24px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.form-submit{flex-shrink:0;padding:0 24px 18px;background:white;border-top:1px solid var(--line)}
.form-submit .form-footer{margin:0;padding-top:14px;border:0}.form-submit .form-error.visible{margin-top:12px;max-height:110px;overflow:auto}
.form-footer .button{min-height:48px}
@media (min-width:1101px){.page-title{flex-wrap:wrap}.page-title>.actions{max-width:100%}}
@media (max-width:1100px){
 .app-shell{display:block}.sidebar{display:none}.main{padding:0 28px 100px}
 .topbar{height:auto;min-height:80px;margin-bottom:18px;gap:16px}.establishment{min-width:0}.establishment>div:last-child{min-width:0}.topbar .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .mobile-nav{display:flex;align-items:center;gap:12px;margin-bottom:24px}.mobile-nav label{display:block;flex-shrink:0}.mobile-nav select{max-width:540px}
 .page-title{flex-wrap:wrap}.page-title>div:first-child{width:100%}.page-title>.actions{max-width:100%;width:100%;justify-content:flex-start}
 .touch-nav{position:fixed;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));bottom:0;left:0;right:0;z-index:3;padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:#fff;border-top:1px solid var(--line);box-shadow:0 -4px 20px #133a3208}
 .touch-nav button{background:none;color:#63786c;border:0;border-radius:8px;min-height:56px;font-size:12px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;padding:4px}
 .touch-nav button span{font-size:23px;line-height:1}.touch-nav button.active{background:#e4f3ec;color:var(--green);font-weight:700}
 #toast{bottom:calc(88px + env(safe-area-inset-bottom));right:20px}
 .cols{grid-template-columns:1fr}.quick button{min-height:112px}.quick strong{font-size:14px}.quick small{display:block}
 .auth{grid-template-columns:minmax(280px,.8fr) minmax(320px,1fr)}.auth-aside{padding:35px}
}
@media (max-width:700px){
 .main{padding:0 max(14px,env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
 .topbar{min-height:70px;margin-bottom:16px;gap:8px}.topbar .name{max-width:160px}.account>div{display:none}.account .button{font-size:13px;min-height:44px;padding:10px}.square{display:none}
 .mobile-nav{display:block;margin-bottom:20px}.mobile-nav label{font-size:12px;margin-bottom:6px}.mobile-nav select{max-width:none}
 h1{font-size:28px;line-height:1.15;overflow-wrap:anywhere}.page-title{margin:12px 0 22px;gap:18px}.page-title p{font-size:14px}.page-title .eyebrow{font-size:10px}
 .page-title>.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.page-title>.actions>.button{min-width:0;font-size:14px;padding:12px 8px}.page-title>.actions>.button:only-child,.page-title>.actions>#refresh-sensors{grid-column:1/-1}
 .panel{padding:16px;margin-bottom:16px}.panel-head{flex-wrap:wrap;gap:8px}.panel-head h2{font-size:18px}.subtle,.notice,.note,.record .excerpt{font-size:13px}.badge{font-size:11px}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:14px;min-width:0}.stat .value{font-size:29px}.stat .label{font-size:12px;line-height:1.5}
 .quick{grid-template-columns:1fr;gap:10px}.quick button{display:grid;grid-template-columns:32px 1fr;column-gap:12px;min-height:72px;padding:14px;align-items:center}.quick .icon{grid-row:1/3;margin:0;font-size:26px}.quick strong{font-size:15px}.quick small{font-size:12px;margin-top:3px}
 .equipment{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:14px}.equipment-info strong{font-size:15px}.equipment-measure{display:contents}.equipment .temperature{grid-column:2;grid-row:1;font-size:28px;align-self:start;text-align:right}.equipment-actions{grid-column:1/-1;justify-content:stretch;border-top:1px solid var(--line);padding-top:8px;margin:0}.equipment-actions .button{flex:1;min-height:44px}
 .module-grid{grid-template-columns:1fr}.module-card{min-height:80px;font-size:15px;padding:18px}.module-card strong{margin-bottom:8px}.module-card small{font-size:13px}
 .record .actions{display:flex;gap:10px}.record .actions .button{flex:1;font-size:13px}.filter{width:100%}
 .form-grid,.details{grid-template-columns:1fr;gap:18px}.field.full,.detail.full,.form-section{grid-column:1/-1}
 dialog{width:calc(100% - 12px);max-width:none;margin:auto;max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);border-radius:12px}
 .dialog-head{padding:12px 16px}.dialog-head h2{font-size:19px}.dialog-content,.form-scroll{padding:18px 16px}.form-submit{padding:0 16px max(12px,env(safe-area-inset-bottom))}.form-footer{gap:10px}.form-footer .button{flex:1;min-width:0;font-size:15px}.preview img{width:calc(50% - 5px);height:120px}
 .auth{display:block;min-height:100dvh}.auth-aside{padding:20px 24px;gap:0}.auth-aside>div:not(.brand),.auth-aside .bottom{display:none}.auth-main{padding:28px 20px}.auth-card h2{font-size:27px}.loading{padding:48px 12px}
 #toast{left:14px;right:14px;width:auto;max-width:none;font-size:14px}
}
@media (max-width:380px){.topbar .name{max-width:140px}.touch-nav button{font-size:11px}.page-title>.actions{grid-template-columns:1fr}.equipment .temperature{font-size:25px}.stat{padding:12px}}
@media (max-height:500px) and (orientation:landscape){.touch-nav{position:static;box-shadow:none}.main{padding-bottom:24px}dialog{max-height:calc(100dvh - 8px)}.dialog-head{padding:6px 16px}.form-scroll{padding:14px 16px}.form-submit{padding-bottom:8px}.form-submit .form-footer{padding-top:8px}}
@media print{body:has(dialog[open]){overflow:visible}.touch-nav{display:none!important}dialog[open],#modal-body,.dialog-content,.scroll-form,.form-scroll{display:block;overflow:visible;max-height:none}.dialog-head{border:0}.form-submit{display:none}.main{padding:0}.equipment-measure{display:block}}

.sensor-battery{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin-top:8px}.sensor-battery .badge{font-size:12px;margin:0}.sensor-battery .subtle{font-size:12px}.badge.battery-critical{background:#ffe4df;color:#9b2d22}
