/* AgroVolcan 20 preview · isolated from production's existing stylesheet. */
:root{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:light;--bg:#f5f8f7;--surface:#fff;--surface2:#f0f5f3;--text:#17232e;--muted:#68788a;--line:#e5eceb;--green:#099366;--green-s:#e0f8ec;--red:#f0444c;--orange:#ff7d48;--red-s:#fff0ed;--shadow:0 13px 42px rgba(20,46,48,.065);--radius:21px;--hero:linear-gradient(98deg,rgba(252,255,254,.9) 2%,rgba(252,255,254,.35) 54%,rgba(255,248,233,.1)),url("./hero.svg");--bar:#fff}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-size:15px;line-height:1.48}body[data-theme="dark"]{color-scheme:dark;--bg:#0f1419;--surface:#1b2228;--surface2:#252f34;--text:#f7f9f8;--muted:#a7b5ba;--line:#39434a;--green:#3de2a1;--green-s:#153b32;--red:#ff5159;--red-s:#492629;--shadow:0 10px 28px #0004;--hero:linear-gradient(90deg,rgba(16,21,27,.91) 4%,rgba(16,21,27,.47) 63%,rgba(28,16,20,.27)),url("./hero.svg");--bar:#192126}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.53}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--green);outline-offset:3px}a{color:inherit;text-decoration:none}.muted{color:var(--muted)}.small{font-size:12px}.row{display:flex;align-items:center;gap:12px}.between{justify-content:space-between}.wrap{flex-wrap:wrap}.grow{flex:1}.strong{font-weight:800}.subline{font-size:13px;color:var(--muted)}.pill{display:inline-flex;align-items:center;gap:6px;border-radius:100px;padding:5px 10px;font-size:12px;font-weight:750;white-space:nowrap}.pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}.pill.ok{color:#087f59;background:var(--green-s)}.pill.off{color:#7b8890;background:var(--surface2)}.pill.bad{color:#d5393a;background:var(--red-s)}.pill.warn{color:#ad7610;background:#fff2d4}.pill.plain:before{display:none}.pill.plain{background:var(--surface2);color:var(--muted)}.boot{min-height:100vh;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px}.boot img{width:96px}.layout{display:grid;grid-template-columns:250px minmax(0,1fr);max-width:1750px;min-height:100vh;margin:auto}.sidebar{background:var(--surface);padding:25px 13px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;border-right:1px solid var(--line);z-index:2}.brand{display:flex;align-items:center;gap:8px;font-size:23px;letter-spacing:-1.1px;font-weight:900;padding:0 9px}.brand img{width:54px;height:54px;object-fit:contain}.brand strong{color:var(--red)}.sidebar-note{font-size:11px;color:var(--muted);padding:0 19px;margin:7px 0 35px;letter-spacing:.13em;font-weight:800}.nav-links{display:grid;gap:7px}.nav-link{display:flex;align-items:center;gap:12px;padding:13px 14px;border:0;background:transparent;color:var(--muted);text-align:left;border-radius:13px;font-weight:700;width:100%}.nav-link svg{width:21px;height:21px;flex:none}.nav-link.active{color:var(--red);background:var(--red-s)}.nav-link:hover:not(.active){background:var(--surface2);color:var(--text)}.sidebar-bottom{margin-top:auto;padding:16px 10px;border-top:1px solid var(--line)}.content{min-width:0;padding:25px clamp(18px,3.8vw,52px) 110px}.topbar{display:flex;justify-content:space-between;align-items:center;gap:13px;margin-bottom:24px}.eyebrow{font-weight:850;text-transform:uppercase;font-size:11px;letter-spacing:.13em;color:var(--green)}.top-meta{display:flex;align-items:center;gap:12px}.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:850;background:#e9efff;color:#253f81;flex:none}.connect-indicator{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted)}.connect-indicator:before{content:"";width:8px;height:8px;background:#f2ac45;border-radius:50%}.connect-indicator.live:before{background:#00aa6f}.connect-indicator.lost:before{background:#f14c4f}.banner{min-height:195px;padding:27px 32px;border-radius:26px;background-image:var(--hero);background-position:center;background-size:cover;border:1px solid #e7ede5;display:flex;align-items:center;box-shadow:var(--shadow);overflow:hidden}.banner h1{font-size:clamp(30px,3.7vw,45px);letter-spacing:-.055em;line-height:1.08;margin:9px 0 8px;max-width:610px}.banner p{max-width:550px;margin:0;color:#475c58}.banner .eyebrow{color:#006b4e}.banner.dark-art{background-image:linear-gradient(90deg,rgba(7,11,19,.96) 3%,rgba(9,15,23,.75) 53%,rgba(46,11,17,.15)),url("./hero.svg");background-blend-mode:normal,multiply;border:1px solid #3c2428}.banner.dark-art h1,.banner.dark-art p{color:white}.banner.dark-art .eyebrow{color:#8ef0ba}.main-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,.87fr);gap:18px;margin-top:20px}.stack{display:grid;align-content:start;gap:18px}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:21px;min-width:0}.card h2{font-size:18px;letter-spacing:-.025em;margin:0}.card h3{font-size:15px;margin:0}.card p{margin:6px 0;color:var(--muted)}.card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.link-btn{border:0;color:var(--green);background:none;font-size:13px;font-weight:750;white-space:nowrap;padding:7px}.link-btn:hover{text-decoration:underline}.segmented{display:inline-flex;align-items:center;background:var(--surface2);border-radius:100px;padding:4px;gap:4px;max-width:100%;flex-wrap:wrap}.segment{border:0;background:transparent;color:var(--muted);padding:9px 16px;border-radius:100px;font-weight:780;white-space:nowrap}.segment.active{color:#fff;background:linear-gradient(110deg,#ff7044,#f0244d);box-shadow:0 4px 10px #ee394c33}.section-intro{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:24px 0 15px}.section-intro h2{font-size:23px;letter-spacing:-.045em;margin:0}.section-intro p{margin:0;color:var(--muted);font-size:13px}.access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.gate{border:1px solid var(--line);border-radius:18px;padding:17px;background:var(--surface)}.gate-header{display:flex;justify-content:space-between;align-items:flex-start;gap:7px;margin-bottom:12px}.gate-title{font-weight:800;font-size:16px}.gate-sub{font-size:12px;color:var(--muted)}.garage-icon{width:58px;height:58px;display:block}.garage-icon svg{height:100%;width:100%;stroke:currentColor}.garage-icon .shutter{transform:translateY(0);transform-box:fill-box;transform-origin:center top;transition:transform 1s ease}.garage-icon[data-open="true"] .shutter{transform:translateY(-11px) scaleY(.25)}.garage-icon[data-state="unknown"]{color:var(--muted)}.garage-icon[data-state="open"]{color:var(--green)}.quick-open{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;border-radius:16px;text-align:left;background:linear-gradient(115deg,#ff6045,#f22e4b);color:#fff;padding:17px 19px;min-height:83px}.quick-open strong{display:block;font-size:17px}.quick-open small{font-size:12px;opacity:.93}.quick-open svg{width:26px;height:26px}.gate.alt{background:var(--surface2)}.gate.alt .quick-open{background:var(--surface)}.gate.alt .quick-open{color:var(--text);border:1px solid var(--line)}.gate-state{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.gate-state .pills{display:flex;gap:5px;flex-wrap:wrap;justify-content:end}.indicator{font-size:12px;color:var(--muted);margin-top:9px;min-height:15px}.list{display:grid;gap:11px}.list-item{border:1px solid var(--line);border-radius:15px;background:var(--surface);padding:13px;display:flex;align-items:center;gap:12px;min-width:0}.list-item>div:nth-child(2){min-width:0}.list-item .avatar{background:var(--green-s);color:var(--green)}.list-item p{font-size:12px;margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-item strong{font-size:14px}.list-item .arrow{margin-left:auto;color:var(--muted);font-size:24px}.meter{height:10px;background:var(--surface2);border-radius:100px;overflow:hidden;margin:12px 0 6px}.meter>span{height:100%;display:block;background:linear-gradient(90deg,#39cc8a,#048357);border-radius:inherit;transition:width .45s}.sensor-number{font-size:26px;font-weight:850;letter-spacing:-.035em}.sensor-icon{width:53px;height:53px;border-radius:16px;background:var(--green-s);color:var(--green);display:grid;place-items:center;font-size:27px}.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.stat{background:var(--surface2);border-radius:16px;padding:13px}.stat .value{font-size:25px;line-height:1.3;letter-spacing:-.04em;font-weight:900}.stat .label{color:var(--muted);font-size:12px}.filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:15px}.field{display:flex;flex-direction:column;gap:5px;min-width:0}.field label{font-size:12px;font-weight:750;color:var(--muted)}input,select{border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--text);padding:11px 13px;min-width:0;max-width:100%}.filters input{flex:1;min-width:170px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px}.data-table{border-collapse:collapse;width:100%;font-size:13px;min-width:580px}.data-table td,.data-table th{text-align:left;padding:12px 13px;border-bottom:1px solid var(--line);vertical-align:middle}.data-table th{background:var(--surface2);color:var(--muted);font-weight:800;font-size:11px}.data-table tr:last-child td{border:0}.tabs{display:flex;gap:6px;overflow:auto;padding-bottom:6px;margin-bottom:15px}.tabs button{white-space:nowrap;border:0;background:var(--surface2);color:var(--muted);padding:10px 14px;border-radius:11px;font-weight:770}.tabs button.active{background:var(--red-s);color:var(--red)}.btn{display:inline-flex;gap:7px;justify-content:center;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 15px;font-weight:800;white-space:nowrap;color:var(--text);background:var(--surface)}.btn.red{border:0;color:white;background:linear-gradient(110deg,#ff5d45,#f3274c)}.btn.green{border:0;color:white;background:var(--green)}.btn.secondary{background:var(--surface2)}.btn.outline{border-color:var(--red);color:var(--red);background:transparent}.setting{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:16px 0;border-bottom:1px solid var(--line)}.setting:last-child{border-bottom:0}.switch{width:48px;height:28px;border-radius:20px;background:#b5bec5;border:0;position:relative;flex:none}.switch:before{content:"";background:white;width:22px;height:22px;position:absolute;top:3px;left:3px;border-radius:50%;box-shadow:0 1px 4px #0004;transition:transform .17s}.switch.on{background:var(--green)}.switch.on:before{transform:translateX(20px)}.notice{padding:14px 16px;background:var(--surface2);border-radius:14px;font-size:13px;color:var(--muted);border:1px solid var(--line)}.notice.warning{background:#fff5e5;color:#775015;border-color:#f9dea7}body[data-theme="dark"] .notice.warning{background:#3a3024;color:#ffdb9d}.empty{text-align:center;color:var(--muted);padding:30px 10px}.toast{z-index:80;position:fixed;left:50%;bottom:28px;transform:translate(-50%,30px);background:#1a2730;color:white;max-width:min(420px,94vw);border-radius:16px;padding:13px 19px;box-shadow:0 10px 35px #0004;opacity:0;pointer-events:none;transition:all .2s}.toast.on{opacity:1;transform:translate(-50%,0)}.action-dialog{width:min(420px,95vw);color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:28px;text-align:center;box-shadow:0 30px 70px #0007}.action-dialog::backdrop{background:#061315a8;backdrop-filter:blur(3px)}.action-dialog h2{margin:5px 0;font-size:23px}.action-dialog p{margin:10px auto}.dialog-actions{display:flex;gap:10px;margin-top:20px}.dialog-actions>*{flex:1}.dialog-hero{width:60px;height:60px;border-radius:19px;background:var(--red-s);color:var(--red);font-size:34px;display:grid;place-items:center;margin:auto}.login-shell{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.login-art{background-image:var(--hero);background-size:cover;background-position:right;display:flex;align-items:end;padding:45px}.login-art .login-quote{background:#fffdf2ee;border-radius:24px;padding:24px;max-width:440px;color:#253737;font-size:25px;font-weight:850;line-height:1.3}.login-main{display:grid;place-items:center;padding:25px}.login-card{width:min(425px,100%);padding:30px;background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}.login-card .brand{padding:0;margin-bottom:24px}.login-card h1{font-size:29px;margin:0}.login-form{display:grid;gap:16px;margin-top:24px}.login-form button{margin-top:5px;width:100%}.bottom-nav{display:none}.floating-label{font-size:12px;color:var(--muted)}.mobile-top-brand{display:none}.hidden{display:none!important}.chip{display:inline-flex;align-items:center;border:1px solid var(--line);padding:4px 9px;border-radius:30px;font-size:12px;color:var(--muted)}.badge-counter{border-radius:50%;padding:3px 8px;color:var(--red);background:var(--red-s)}.mini-device{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}.mini-device:last-child{border:0}.mini-device .garage-icon{width:38px;height:38px;flex:none}.mini-device strong{font-size:14px}.font-red{color:var(--red)}.font-green{color:var(--green)}.text-right{text-align:right}form.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}form.form-grid .full{grid-column:1/-1}#sessionStatus{min-width:90px}.inline-search{max-width:330px;width:100%}
@media(max-width:1200px){.main-grid{grid-template-columns:minmax(0,1fr)}.sidepanel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.sidepanel>.card{height:100%}}
@media(max-width:850px){.layout{display:block}.sidebar{display:none}.content{padding:12px 14px 110px}.topbar{padding:6px 3px;margin-bottom:13px}.mobile-top-brand{display:flex}.top-meta .desktop-label{display:none}.brand{font-size:20px}.brand img{width:45px;height:45px}.banner{min-height:180px;padding:23px 21px;background-position:58% center}.banner h1{font-size:33px}.banner p{max-width:70%;font-size:13px}.banner.dark-art{background-position:center}.bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:20;justify-content:space-around;align-items:stretch;padding:9px 6px max(10px,env(safe-area-inset-bottom));background:var(--bar);box-shadow:0 -8px 28px #0001;border-top:1px solid var(--line)}.bottom-nav button{border:0;background:none;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:2px;flex-direction:column;font-size:11px;font-weight:700;min-width:58px;max-width:102px;padding:5px;border-radius:12px}.bottom-nav button.active{color:var(--red);background:var(--red-s)}.bottom-nav svg{width:24px;height:24px}.sidepanel{grid-template-columns:1fr}}
@media(max-width:550px){.banner h1{font-size:29px}.banner{min-height:148px}.banner p{max-width:82%}.card{padding:15px;border-radius:18px}.access-grid{grid-template-columns:1fr}.gate{display:grid;grid-template-columns:1fr;gap:1px}.section-intro{margin:20px 0 12px}.section-intro h2{font-size:20px}.stat-grid{gap:6px}.stat{padding:10px}.stat .value{font-size:21px}.login-shell{display:block}.login-art{min-height:170px;padding:20px}.login-main{margin-top:-24px;position:relative;z-index:1}.login-card{padding:23px}.login-art .login-quote{font-size:17px}.filters input{min-width:130px}.action-dialog{padding:22px}form.form-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Historicos V20.0.2: responsive layout independent of classic web */
.history-head{padding-bottom:8px}.history-explainer{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:13px;padding:2px 0 11px}.history-explainer svg{color:var(--green);flex:none;width:20px}.history-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}.history-filter-grid .field{display:grid;gap:5px;min-width:0;color:var(--muted);font-size:12px;font-weight:740}.history-filter-grid input,.history-filter-grid select{width:100%;min-width:0;min-height:44px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:11px;padding:9px}.history-filter-grid .history-search,.history-filter-grid .history-wide{grid-column:span 2}.history-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end;margin:0 0 15px}.history-caption{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;color:var(--muted);font-size:12px;padding:12px 2px;border-bottom:1px solid var(--line)}.history-list{display:grid;gap:0}.history-event{display:flex;gap:13px;align-items:flex-start;padding:15px 0;border-bottom:1px solid var(--line)}.history-event-icon{width:39px;height:39px;display:grid;place-items:center;background:var(--surface2);color:var(--red);flex:none;border-radius:12px}.history-event-body{min-width:0;flex:1}.history-event-title{display:flex;gap:9px;align-items:center;flex-wrap:wrap;font-size:15px;font-weight:820}.history-event-sub{font-size:12px;color:var(--muted);margin-top:3px}.history-event-note{font-size:13px;overflow-wrap:anywhere;color:var(--text);margin-top:6px}.history-pages{display:flex;justify-content:space-between;gap:9px;margin-top:18px}.history-chart-wrap{border:1px solid var(--line);background:var(--surface2);border-radius:17px;overflow:auto;padding:7px}.history-chart{width:100%;min-width:320px;display:block;color:var(--muted)}.history-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:14px}.history-stat-grid>div{border:1px solid var(--line);background:var(--surface2);border-radius:13px;padding:12px;min-width:0}.history-stat-grid span{display:block;color:var(--muted);font-size:12px}.history-stat-grid strong{font-size:16px}.history-chart-caption{font-weight:850;margin:16px 0 12px}.history-shortcuts{display:flex;gap:9px;flex-wrap:wrap}
@media(max-width:1050px){.history-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.history-filter-grid .history-search,.history-filter-grid .history-wide{grid-column:span 2}}
@media(max-width:550px){.history-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.history-filter-grid .history-search,.history-filter-grid .history-wide{grid-column:span 2}.history-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.history-actions .btn{flex:1}.history-event-title{font-size:14px}.history-event-icon{width:34px;height:34px}.history-filter-grid input,.history-filter-grid select{font-size:14px}}

/* V20.0.3 · Accesibilidad, estados de seguridad e histórico centrado en personas. */
.garage-icon[data-state="open"]{color:var(--red)}
.garage-icon[data-state="closed"]{color:var(--green)}
.quick-open:disabled,.gate.alt .quick-open:disabled{background:var(--surface2);color:var(--muted);opacity:1;border:1px solid var(--line);box-shadow:none}
.quick-open:disabled strong{color:var(--text)}
.sensor-entry{width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.sensor-entry:hover{border-color:var(--green);background:var(--surface2)}
.sensor-entry .sensor-details{min-width:0;display:grid;gap:2px}.sensor-entry .sensor-place{display:block}.sensor-entry .sensor-stamp{display:block}
.sensor-entry .meter{width:100%;display:block}
.sensor-entry .sensor-chevron{margin-left:9px;color:var(--green);flex:none}
.history-event-action{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--muted);font-weight:780}
.history-event-title{font-size:17px;font-weight:900;margin:5px 0}
.history-event-date{font-size:12px;color:var(--muted);margin-top:5px}
.history-event-note{font-size:12px;color:var(--muted)}
.member-tools{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px;flex-wrap:wrap}
.member-tools p{font-size:12px;max-width:480px}
.member-farm{border:1px solid var(--line);border-radius:15px;padding:0 13px;margin:10px 0;background:var(--surface)}
.member-farm summary{cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px;list-style:none}
.member-farm summary::-webkit-details-marker{display:none}
.member-farm summary:before{content:'›';font-size:22px;color:var(--muted);transition:transform .2s}
.member-farm[open] summary:before{transform:rotate(90deg)}
.member-farm .list{padding:5px 0 14px}
@media(max-width:550px){.sensor-entry .sensor-number{font-size:20px}.sensor-entry .sensor-chevron{width:16px}.history-event-title{font-size:15px}}

/* V20.0.4 · Formularios administrativos accesibles sin tocar controles físicos */
.admin-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;min-width:0}.admin-actions .btn{white-space:normal}.admin-list{display:grid;gap:9px;margin-top:15px}.admin-item{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid var(--line);border-radius:13px;padding:12px;background:var(--surface)}.admin-item .grow{min-width:160px;overflow-wrap:anywhere}.admin-form-card{background:var(--surface2);border:1px solid var(--line);border-radius:15px;padding:17px;margin:16px 0}.admin-form-card h3{font-size:17px;margin-bottom:10px}.admin-form-card .field{display:grid;gap:6px;min-width:0}.admin-form-card label,.admin-farm-pick{font-weight:720;font-size:13px;color:var(--muted)}.admin-form-card input,.admin-form-card select,.admin-form-card textarea,.admin-farm-pick select,.admin-copy input{width:100%;min-width:0;padding:11px 12px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:10px;font:inherit}.admin-form-card textarea{resize:vertical}.admin-form-card .admin-actions{align-self:end}.admin-farm-pick{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}.admin-farm-pick select{width:auto;max-width:100%;min-width:200px}.admin-days{border:1px solid var(--line);border-radius:11px;padding:10px;display:flex;gap:13px;flex-wrap:wrap}.admin-days legend{font-size:13px;font-weight:800}.admin-days label{display:flex;gap:5px;align-items:center;font-size:13px;font-weight:600}.admin-copy{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.admin-copy input{flex:1;min-width:160px}.admin-invite-output{margin-top:14px;overflow-wrap:anywhere}.btn.outline.danger{color:var(--red);border:1px solid var(--red)}[data-perm-action][hidden]{display:none!important}.admin-form-card .full{grid-column:1/-1}.admin-form-card .admin-actions.full{justify-content:flex-start}
@media(max-width:850px){.admin-item>.grow{width:calc(100% - 70px)}.admin-item>.admin-actions{width:100%;justify-content:flex-start}.admin-farm-pick{display:grid;width:100%}.admin-farm-pick select{width:100%}.admin-copy input{width:100%;flex-basis:100%}.admin-form-card{padding:12px}}

/* V20.0.5 · Migración funcional final: dispositivos, BLE, comerciales, OTA y alertas */
.device-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.device-admin-list{display:grid;gap:12px;margin-top:16px}
.ble-status{margin-top:14px;min-height:44px;padding:12px 14px;border:1px dashed var(--line);border-radius:12px;background:var(--surface);color:var(--muted);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.v20-modal-backdrop{position:fixed;inset:0;z-index:100;background:#0008;display:grid;place-items:center;padding:20px;overflow:auto}
.v20-modal{width:min(760px,100%);max-height:calc(100vh - 40px);overflow:auto;margin:auto}
.alert-settings-form{display:grid;gap:1px;margin-top:14px;border-top:1px solid var(--line)}
.alert-settings-form .setting{padding:13px 2px;border-bottom:1px solid var(--line)}
.alert-settings-form input[type="checkbox"]{width:20px;height:20px;accent-color:var(--red)}
.alert-farm-pick{display:grid;gap:6px;margin:14px 0}.alert-farm-pick select{max-width:420px}
.admin-item .pill{margin-right:5px;margin-top:5px}
.admin-item .subline{overflow-wrap:anywhere}
.admin-form-card input[type="file"]{padding:9px}
.admin-form-card input[type="color"]{min-height:44px;padding:4px}
.v20-safety-note{border-left:4px solid var(--green)}
@media(max-width:900px){.device-two-col{grid-template-columns:1fr}.v20-modal-backdrop{padding:10px}.v20-modal{max-height:calc(100vh - 20px)}}
@media(max-width:550px){.admin-actions .btn{flex:1 1 140px}.device-admin-list .admin-item{padding:11px}.alert-farm-pick select{width:100%}}

/* V20.0.5.2 · Instalación PWA e invitaciones */

.install-app-banner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
  margin:0 0 18px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--surface);
  box-shadow:var(--shadow);
}

.install-app-icon{
  width:48px;
  height:48px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:
    linear-gradient(
      135deg,
      var(--red),
      #7b0b20
    );
  overflow:hidden;
}

.install-app-icon img{
  width:42px;
  height:42px;
  object-fit:contain;
}

.install-app-text{
  display:grid;
  gap:3px;
  min-width:0;
}

.install-app-text strong{
  font-size:15px;
}

.install-app-text span{
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.install-app-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.invite-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
  background:var(--bg);
}

.invite-card{
  width:min(560px,100%);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:var(--shadow);
  padding:26px;
}

.invite-card h1{
  font-size:30px;
  line-height:1.08;
  margin:12px 0;
}

.invite-brand{
  padding:0;
  margin-bottom:20px;
}

.invite-brand img{
  width:58px;
  height:58px;
}

.invite-card .form-grid{
  margin-top:18px;
}

.invite-card .admin-actions{
  margin-top:4px;
  justify-content:flex-start;
}

.invite-card .admin-actions .btn{
  min-width:150px;
}

@media(max-width:650px){

  .install-app-banner{
    grid-template-columns:auto 1fr;
  }

  .install-app-actions{
    grid-column:1/-1;
    justify-content:stretch;
  }

  .install-app-actions .btn{
    flex:1;
  }

  .invite-shell{
    padding:12px;
  }

  .invite-card{
    padding:20px;
    border-radius:20px;
  }

  .invite-card h1{
    font-size:26px;
  }
}


/* =========================================================
   AgroVolcan 20.0.6 UI2 · navegación móvil
   ========================================================= */

@media (max-width: 900px) {

  /*
   * La aplicación nunca debe desplazar
   * horizontalmente el viewport completo.
   *
   * Elementos concretos como tablas/tabs
   * pueden seguir teniendo su propio scroll.
   */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  #app,
  .layout,
  .content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .content,
  .card,
  .main-grid,
  .access-grid,
  .stack,
  .sidepanel {
    min-width: 0;
  }

  img,
  svg {
    max-width: 100%;
  }


  /*
   * bottomNav() se renderiza justo después
   * de .layout.
   *
   * Lo mantenemos siempre fijo aunque
   * el usuario haga scroll.
   */
  #app > .layout + * {
    position: fixed !important;

    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: 100% !important;
    max-width: 100vw !important;

    box-sizing: border-box;

    z-index: 10000 !important;

    /*
     * Android / iPhone:
     * los botones y textos quedan por encima
     * de la barra de navegación del sistema.
     */
    padding-bottom:
      calc(
        9px +
        env(safe-area-inset-bottom, 0px)
      ) !important;
  }


  /*
   * Dejamos espacio real bajo el contenido
   * para que la última tarjeta nunca quede
   * escondida detrás de la navegación.
   */
  .content {
    padding-bottom:
      calc(
        100px +
        env(safe-area-inset-bottom, 0px)
      ) !important;
  }


  /*
   * Evitar que grids/flex generen
   * accidentalmente ancho superior
   * al viewport.
   */
  .layout > *,
  .content > *,
  .card > *,
  .main-grid > *,
  .access-grid > * {
    max-width: 100%;
  }

}


/* AGROVOLCAN UI3 SENSOR LAYOUT */

/*
 * Columna derecha del sensor:
 * lectura -> estado -> fecha.
 * Evita que el porcentaje invada el nombre o la finca.
 */
.sensor-entry > .text-right{
    flex:0 0 auto;
    min-width:112px;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    justify-content:center;
    gap:4px;
    text-align:right;
}

.sensor-entry .sensor-number{
    display:block;
    line-height:1.05;
    white-space:nowrap;
}

.sensor-entry > .text-right .pill{
    align-self:flex-end;
}

.sensor-entry .sensor-stamp{
    display:block;
    white-space:nowrap;
    line-height:1.25;
}

/*
 * La zona central puede encogerse correctamente
 * sin meterse debajo de la lectura.
 */
.sensor-entry .sensor-details{
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
}

.sensor-entry .sensor-details strong,
.sensor-entry .sensor-place{
    overflow:hidden;
    text-overflow:ellipsis;
}

/*
 * Móvil: mantenemos icono, información, lectura
 * y flecha perfectamente separados.
 */
@media(max-width:550px){

    .sensor-entry{
        gap:10px;
        padding:12px;
    }

    .sensor-entry > .text-right{
        min-width:94px;
        max-width:108px;
        gap:3px;
    }

    .sensor-entry .sensor-number{
        font-size:20px;
    }

    .sensor-entry > .text-right .pill{
        font-size:11px;
        padding:4px 8px;
    }

    .sensor-entry .sensor-stamp{
        font-size:11px;
    }

    .sensor-entry .sensor-chevron{
        margin-left:2px;
        width:16px;
        flex:0 0 16px;
    }
}

/*
 * Pantallas muy estrechas.
 */
@media(max-width:390px){

    .sensor-entry{
        gap:8px;
    }

    .sensor-entry .sensor-icon{
        width:47px;
        height:47px;
        border-radius:14px;
    }

    .sensor-entry > .text-right{
        min-width:82px;
        max-width:92px;
    }

    .sensor-entry .sensor-number{
        font-size:18px;
    }
}
