/* Hidropuro-aligned application palette. */
:root{--green:#2eb361;--green-dark:#1d7a44;--cta:#25d366;--yellow:#f5cd4e;--peach:#eaf6ee;--ink:#17342c;--paper:#f4f8f6;--line:#d8e5df;color:var(--ink);background:var(--paper)}
body{color:var(--ink);background:var(--paper)}
header.app-header{background:var(--green-dark);color:#fff;display:flex;flex-direction:row;align-items:center;gap:1rem;padding:1rem max(1rem,4vw);border-bottom:1px solid var(--green-dark)}
.brand{font-size:1.7rem;font-weight:850;letter-spacing:-.07rem;line-height:1.05}.brand span{display:block;font-size:.7rem;letter-spacing:.015rem;font-weight:500;margin-top:.3rem}.header-section{margin-left:auto;font-weight:650}
.brand{display:flex;align-items:center;gap:.5rem}.brand-icon{display:block;width:56px;height:56px;object-fit:contain;flex:none}header.app-header .brand-icon{filter:brightness(0) invert(1)}.brand .brand-wordmark{display:block;margin:0;font-size:inherit;letter-spacing:inherit;font-weight:inherit}.brand-wordmark strong{display:block;font-size:inherit;line-height:1}.brand-wordmark small{display:block;font-size:.7rem;letter-spacing:.015rem;font-weight:500;margin-top:.3rem}
button,.button-link{background:var(--cta)!important;color:var(--ink)!important;cursor:pointer}button:hover,.button-link:hover{filter:brightness(1.15)}
.menu-toggle{width:46px;height:46px;background:transparent!important;color:#fff!important;border:1px solid #ffffff65;padding:0;font-size:1.8rem;display:grid;place-items:center}
.app-menu{margin:0;height:100dvh;max-height:100dvh;width:min(320px,88vw);max-width:88vw;border:0;border-right:1px solid var(--line);padding:1.4rem;background:var(--paper);color:var(--ink)}
.app-menu::backdrop{background:#0e2a1a80}.menu-open{overflow:hidden}.menu-top{display:flex;align-items:center;justify-content:space-between;font-size:1.6rem}.menu-top button{background:transparent!important;color:var(--ink)!important}.menu-caption{color:#506657;font-size:.9rem;margin-bottom:2rem}.app-menu nav{display:flex;flex-direction:column;gap:.4rem}.app-menu nav a{display:flex;justify-content:space-between;padding:.85rem 1rem;border-radius:10px;font-weight:600}.app-menu nav a:hover{background:var(--peach)}.app-menu nav a[aria-current]{background:var(--green);color:var(--ink)}.app-menu nav .logout{border-top:1px solid var(--line);border-radius:0;margin-top:1.5rem;font-weight:400}
.home-heading{margin:2.2rem 0}.home-heading h1{font-size:clamp(1.8rem,4vw,2.8rem);letter-spacing:-.07rem;margin:.7rem 0}.home-heading p{color:#506657}.eyebrow{font-weight:750;font-size:.75rem;letter-spacing:.12rem}
.dashboard{gap:1rem}.dashboard-card{display:flex;flex-direction:column;gap:1rem;background:white;border:1px solid var(--line);border-radius:16px;padding:1.5rem;min-height:205px;transition:transform .15s,box-shadow .15s}.dashboard-card:hover{transform:translateY(-3px);box-shadow:0 8px 24px #0e2a1a14}.card-label{display:flex;justify-content:space-between;gap:1rem;font-weight:700}.dashboard-card strong{font-size:3rem;line-height:1.1;color:var(--green-dark)}.dashboard-card>span:last-child{font-size:.9rem;margin-top:auto}.dashboard-card h2{font-size:1.4rem;line-height:1.2;margin:0}.dashboard-card:nth-child(2){background:var(--peach)}.dashboard-card:nth-child(3){background:var(--yellow)}.dashboard-card.accent{background:var(--green);color:var(--ink)}.dashboard-card.accent strong{color:var(--ink)}
th{background:var(--peach)}.flash{border-left-color:var(--green)}.card{border-color:var(--line)}.secondary{background:var(--yellow)!important;color:var(--ink)!important}.edit-link{color:var(--ink)!important}.badge{background:var(--peach)!important;color:var(--ink)}.save-bar{background:var(--paper)!important}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
@media(max-width:700px){.dashboard{grid-template-columns:1fr}.dashboard-card{min-height:170px}.header-section{font-size:.8rem}.brand{font-size:1.45rem}}
@media(prefers-reduced-motion:reduce){.dashboard-card{transition:none}.dashboard-card:hover{transform:none}}
.home-link{display:inline-flex;align-items:center;gap:.4rem;white-space:nowrap;border:1px solid #ffffff80;border-radius:8px;padding:.55rem .8rem;font-weight:650}
.home-link:hover{background:#ffffff18}
.home-link span{font-size:1.4rem;line-height:1}
.app-header a:focus-visible,.app-header button:focus-visible{outline-color:#fff}
@media(max-width:520px){.header-section{display:none}.home-link{margin-left:auto}.app-header{gap:.7rem!important}.brand{font-size:1.25rem}.brand span{font-size:.6rem}}

.home-heading{margin:1.2rem 0 1.5rem;display:flex;flex-direction:column;gap:.8rem}.home-heading h1{margin:.45rem 0}.home-heading p{margin:.25rem 0}
.home-intro{display:flex;align-items:center;gap:.9rem;min-width:0}.home-logo{width:90px;height:90px;object-fit:contain;flex:none}
.weather-widget{width:calc(50% - .4rem);flex:none;background:#fff;border:1px solid var(--line);border-radius:12px;padding:.7rem .85rem;box-shadow:0 3px 12px #0e2a1a0a}
.weather-widget.weather-strip{width:100%;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:.15rem .9rem;padding:.3rem .7rem}
.weather-strip .weather-title{flex:none;gap:.3rem}
.weather-strip .weather-cities{display:flex;flex-wrap:nowrap;gap:.3rem 1.1rem;margin:0;flex:1 1 100%}
.weather-strip .weather-city{display:flex;align-items:center;gap:.3rem;border:0;border-left:2px solid #b6d6c9;border-radius:5px;background:#f0f7f3;padding:.3rem .9rem;font-size:.7rem;flex:1 1 0;min-width:0}
.weather-strip .weather-alerts:empty{display:none}
.weather-strip .weather-alerts{flex:none;flex-basis:100%;flex-wrap:nowrap;gap:.25rem}
.weather-strip .weather-detail{white-space:nowrap}
.weather-strip .weather-alert{white-space:nowrap;font-size:.57rem;padding:.07rem .26rem}
.weather-strip .weather-source{flex:none;font-size:.6rem}
.weather-strip .weather-source{margin:0 0 0 auto;padding:0;white-space:nowrap}
.home-heading-row{display:flex;gap:1.2rem}
.home-heading-row .weather-widget{width:calc(50% - .6rem)}
@media(max-width:650px){.home-heading-row{flex-direction:column}.home-heading-row .weather-widget{width:100%}.weather-strip{flex-direction:column;align-items:stretch}.weather-strip .weather-source{margin-left:0}}.weather-title{display:flex;justify-content:space-between;align-items:center;font-size:.84rem;font-weight:750}.weather-title small{font-weight:400;color:#64766c}.weather-cities{display:grid;gap:.15rem;margin:.35rem 0}.weather-city{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:.35rem;border-top:1px solid #edf3ef;padding:.18rem 0;font-size:.72rem}.weather-city strong{font-size:.72rem}.weather-value{font-size:.82rem;font-weight:650;white-space:nowrap}.weather-detail{font-size:.62rem;line-height:1.1;color:#516a5b}.weather-rain{display:inline-block;margin-top:.1rem;font-size:.6rem;font-weight:650;color:#1d7fb8}.weather-strip .weather-rain{margin-top:0;margin-left:auto;color:#1d7fb8;font-size:.68rem;white-space:nowrap;background:#e4f1fb;border-radius:5px;padding:.15rem .5rem}.weather-minmax{font-size:.65rem;color:#64766c;white-space:nowrap}.weather-source{display:block;font-size:.63rem;color:#62766a}.weather-source a{text-decoration:underline}
.weather-widget{background:linear-gradient(135deg,#f3fbf8,#fff 60%)}.weather-title{color:var(--green-dark)}.weather-city{border:0;border-left:2px solid #b6d6c9;border-radius:5px;background:#f0f7f3;padding:.14rem .4rem}.weather-city strong{white-space:nowrap}.weather-city[data-tone="clear"]{background:#fff7e5;border-left-color:#e7ac36}.weather-city[data-tone="cloud"]{background:#edf4f8;border-left-color:#7ca6b5}.weather-city[data-tone="rain"]{background:#e8f2ff;border-left-color:#348ac9}.weather-city[data-tone="cold"]{background:#e5f4fc;border-left-color:#2387bc}.weather-city[data-tone="heat"]{background:#fff0e8;border-left-color:#d96633}.weather-cities{gap:.25rem}
.weather-alerts{display:flex;flex-wrap:wrap;gap:.25rem}.weather-alert{display:inline-block;border-radius:5px;padding:.1rem .28rem;font-size:.6rem;font-weight:650}.weather-alert-rain{background:#dceeff;color:#125b8d}.weather-alert-cold{background:#d9f0fc;color:#0b628f}.weather-alert-heat{background:#ffe2d2;color:#a43b16}.weather-source{margin-top:.3rem}
@media(max-width:650px){.home-heading{flex-direction:column}.weather-widget{width:100%}}
@media(max-width:520px){.brand-icon{width:34px;height:34px}.home-logo{width:70px;height:70px}}
.home-dashboard{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem}
.home-metric{display:flex;flex-direction:column;gap:.35rem;min-height:98px;padding:.65rem .85rem;background:#fff;border:1px solid var(--line);border-radius:12px}
.home-metric span{font-weight:650;font-size:.88rem}.home-metric strong{font-size:1.65rem;line-height:1;color:var(--green-dark)}.home-metric small{margin-top:auto;color:#506657;font-size:.78rem}
@media(max-width:800px){.home-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}}

.home-charts{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,1fr);gap:.9rem;margin:.9rem 0 1.35rem}
.home-chart-card{min-width:0;background:#fff;border:1px solid var(--line);border-radius:12px;padding:1.1rem 1.15rem;display:flex;flex-direction:column}
.home-chart-heading{display:flex;justify-content:space-between;align-items:start;gap:1rem}.home-chart-heading h2{margin:.35rem 0 .8rem;font-size:1.25rem}
.chart-legend{display:flex;flex-wrap:wrap;gap:.8rem;font-size:.8rem;color:#506657}.chart-legend span,.status-legend span{display:flex;align-items:center;gap:.4rem}.chart-legend i,.status-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;flex:none}.legend-order{background:var(--green-dark)}.legend-dispatch,.legend-prepared{background:var(--green)}.legend-finished{background:#dce9e2}
.activity-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.35rem;min-height:203px;padding:1.35rem .3rem 0;background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#e8efea calc(25% - 1px),#e8efea 25%)}
.activity-day{min-width:0;display:flex;flex-direction:column;align-items:center;gap:.45rem}.activity-bars{height:153px;width:100%;display:flex;align-items:end;justify-content:center;gap:5px}.activity-bar{display:block;position:relative;width:min(22px,35%);min-height:2px;border-radius:4px 4px 0 0}.order-bar{background:var(--green-dark)}.dispatch-bar{background:var(--green)}.activity-bar b{position:absolute;bottom:calc(100% + 2px);left:50%;transform:translateX(-50%);font-size:.7rem;color:#456056}.activity-day small{font-size:.75rem;color:#506657;white-space:nowrap}
.chart-note{font-size:.8rem;color:#5e7168;margin:auto 0 0;padding-top:1rem}
.status-chart{display:flex;align-items:center;justify-content:center;gap:1.5rem;flex:1;padding:.7rem 0}.status-donut{width:155px;height:155px;flex:none;border-radius:50%;display:grid;place-items:center}.status-donut>div{width:101px;height:101px;background:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-direction:column}.status-donut strong{font-size:2rem;line-height:1}.status-donut small{color:#62766a}.status-legend{min-width:135px;flex:1;display:grid;gap:.7rem}.status-legend>div{display:flex;justify-content:space-between;gap:.5rem;font-size:.85rem}.status-legend strong{color:#17342c}
@media(max-width:900px){.home-charts{grid-template-columns:1fr}}
@media(max-width:560px){.home-chart-heading{flex-direction:column}.status-chart{flex-wrap:wrap}.activity-bars{height:140px}.activity-chart{min-height:190px}.home-chart-card{padding:1rem}.status-legend{max-width:250px}}

.news-ticker{display:flex;align-items:stretch;overflow:hidden;background:var(--green-dark);color:#fff;border-radius:5px;margin:1.1rem 0 0;height:27px}.news-ticker-label{display:flex;align-items:center;flex:none;padding:0 .75rem;background:var(--yellow);color:#0e2a1a;font-size:.66rem;font-weight:850;letter-spacing:.07rem;z-index:1}.news-ticker-window{min-width:0;overflow:hidden;display:flex;align-items:center;flex:1}.news-track{display:flex;align-items:center;white-space:nowrap;padding-left:.9rem;font-size:.76rem}.news-track-ready{width:max-content;padding-left:0;animation:news-scroll 55s linear infinite}.news-group{display:flex;align-items:center;gap:1.6rem;padding-right:1.6rem;flex:none}.news-entry{display:inline-flex;align-items:center;gap:.4rem;white-space:nowrap}.news-entry strong{color:var(--yellow)}.news-entry small{opacity:.7}.news-entry[href]:hover{text-decoration:underline}.news-ticker:hover .news-track-ready,.news-ticker:focus-within .news-track-ready{animation-play-state:paused}.news-ticker-source{font-size:.65rem;color:#677b70;margin:.25rem 0 0}.news-ticker-source a{text-decoration:underline}@keyframes news-scroll{to{transform:translateX(-50%)}}
@media(prefers-reduced-motion:reduce){.news-track-ready{animation:none}.news-ticker-window{overflow-x:auto}}

/* --- Login: logo + tarjeta destacada, no afecta a .card/.narrow genericos --- */
.login-shell{min-height:80vh;display:flex;align-items:center;justify-content:center;padding:3rem 1rem;background:radial-gradient(circle at 15% 0%,rgba(245,205,78,.18) 0%,rgba(245,205,78,0) 45%),linear-gradient(160deg,var(--green) 0%,var(--green-dark) 60%,var(--ink) 130%)}
.login-card{width:100%;max-width:400px;background:#fff;border:1px solid var(--line);border-radius:20px;padding:2.5rem 2.25rem 2.25rem;margin:0;box-shadow:0 24px 48px -20px rgba(23,52,44,.45),0 2px 6px rgba(23,52,44,.06)}
.login-brand{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.55rem;margin-bottom:1.85rem}
.login-brand img{width:72px;height:72px;object-fit:contain}
.login-brand strong{font-size:1.55rem;font-weight:850;color:var(--ink);letter-spacing:-.01rem;line-height:1}
.login-brand small{font-size:.85rem;font-weight:500;color:var(--green-dark);letter-spacing:.01rem}
.login-card h1{font-size:1.05rem;font-weight:700;color:var(--ink);text-align:center;margin:0 0 1.65rem}
.login-card label{display:grid;gap:.4rem;margin-bottom:1.15rem;font-size:.88rem;font-weight:500;color:var(--ink)}
.login-card input{font:inherit;font-size:1rem;padding:.82rem .9rem;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}
.login-card input:hover{border-color:#b9cec5}
.login-card input:focus{outline:none;border-color:var(--green);background:#fff;box-shadow:0 0 0 3px rgba(46,179,97,.22)}
.login-card button{width:100%;margin-top:.6rem;padding:.92rem;font-size:1.02rem;font-weight:700;border:0;border-radius:10px;background:var(--cta);color:var(--ink);cursor:pointer;transition:filter .15s ease,transform .05s ease;box-shadow:0 10px 20px -10px rgba(37,211,102,.65)}
.login-card button:hover{filter:brightness(.96)}
.login-card button:active{transform:translateY(1px)}
.login-card button:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
@media (max-width:480px){.login-shell{padding:2rem .75rem}.login-card{padding:2rem 1.4rem 1.75rem;border-radius:16px}.login-brand img{width:60px;height:60px}.login-brand strong{font-size:1.35rem}}

.home-heading{align-items:stretch}
.weather-widget{display:flex;flex-direction:column}
.weather-source{margin-top:auto;padding-top:.4rem}
.mesa-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#d96633;margin-right:.35rem;vertical-align:middle;animation:mesaPulse 1.6s ease-in-out infinite}
@keyframes mesaPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(1.6)}}

.inv-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.inv-tab{border:1px solid var(--line);background:#fff;color:#456;padding:.55rem .95rem;border-radius:999px;font-size:.84rem;font-weight:600;text-decoration:none}
.inv-tab.active{background:var(--ink);color:#fff;border-color:var(--ink)}
.inv-grid{display:grid;gap:14px;margin:1rem 0}
.mesa-cell{position:relative;border-radius:10px;padding:.7rem .6rem;cursor:pointer;border:2px solid transparent;background:#eef5f0;min-height:82px}
.mesa-cell:hover{box-shadow:0 8px 16px -10px rgba(23,52,44,.4)}
.mesa-cell.vacia{background:repeating-linear-gradient(45deg,#f1f1ef,#f1f1ef 8px,#e7e7e3 8px,#e7e7e3 16px);color:#99a}
.mesa-cell.soon{background:#fff7e5;border-color:#e7ac36}
.mesa-cell.late{background:#fff0e8;border-color:#d96633}
.mesa-num{font-size:.72rem;font-weight:700;color:#678}
.mesa-dim{font-size:.66rem;color:#9ab}
.mesa-cultivo{font-size:.9rem;font-weight:700;margin-top:.3rem}
.mesa-cant{font-size:.72rem;color:#567}
.mesa-pop{position:absolute;z-index:20;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 16px 32px -14px rgba(23,52,44,.45);padding:.85rem .95rem;width:230px;font-size:.84rem;display:none}
.mesa-pop.show{display:block}
.mesa-pop h3{margin:0 0 .5rem;font-size:.92rem}
.mesa-pop dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:.15rem .5rem}
.mesa-pop dt{color:#789;font-size:.76rem}
.mesa-pop dd{margin:0;font-weight:600}
.mesa-pop-close{position:absolute;top:6px;right:8px;border:0;background:none;font-size:.9rem;color:#aab;cursor:pointer;padding:0}
.mesa-pop-tip{display:block;margin-top:.6rem;font-size:.72rem;color:#9ab}
.mesa-pop-notas{margin:.5rem 0 0;font-size:.78rem;color:#456}
.mesa-overlay{position:fixed;inset:0;background:rgba(23,52,44,.45);display:none;align-items:center;justify-content:center;z-index:50;padding:1rem}
.mesa-overlay.show{display:flex}
.mesa-overlay .card{width:100%;max-width:380px;max-height:90vh;overflow:auto}

.proy-title{margin:0 0 .6rem;font-size:1rem}
.proy-late{color:#a43b16;font-weight:700;background:#fff0e8}
.proy-soon{color:#8a5a12;font-weight:700;background:#fff7e5}

.mesa-pop-hist{margin-top:.5rem;padding-top:.5rem;border-top:1px solid var(--line);font-size:.72rem;color:#567}
.mesa-pop-hist ul{margin:.3rem 0 0;padding-left:1rem}
.mesa-pop-hist li{margin-bottom:.15rem}

.mov-panel summary{cursor:pointer;font-weight:700;font-size:1.05rem;padding:.3rem 0;}
.mov-filtros{display:flex;flex-wrap:wrap;gap:.9rem;align-items:flex-end;margin:.8rem 0 1rem;}
.mov-filtros label{display:flex;flex-direction:column;gap:.25rem;font-size:.85rem;color:#555;}
.mov-filtros select,.mov-filtros input[type=date]{padding:.4rem .5rem;border:1px solid #ccc;border-radius:6px;font-size:.9rem;}
.mov-filtros button{padding:.45rem 1rem;border:none;border-radius:6px;background:#2c6e49;color:#fff;font-weight:600;cursor:pointer;}
.mov-filtros button:hover{background:#245a3b;}
.mov-limpiar{align-self:center;color:#a43b16;text-decoration:none;font-size:.85rem;}
.mov-limpiar:hover{text-decoration:underline;}

.weather-widget{width:calc((100% - 2.4rem)/3)}
.mesas-summary{font-size:.74rem;color:#44574c;margin:.3rem 0 .4rem;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem}
.mesas-summary strong{font-size:.95rem;color:var(--green-dark)}
.mesas-sep{color:#9fb3a7}
.mesas-alarma-tag{background:#fff0e8;color:#a43b16;border-radius:5px;padding:.08rem .35rem;font-weight:700;font-size:.7rem}
@media(max-width:650px){.weather-widget.mesas-card{width:100%}}

.mesa-overlay .card{max-width:380px}
@media(min-width:560px){.mesa-overlay .card{max-width:640px}}
.mesa-overlay .card.grid{gap:.6rem .9rem}
.mesa-overlay h3{grid-column:1/-1;margin:0 0 .2rem}
.mesa-overlay label{gap:.2rem;font-size:.85rem}
.mesa-overlay input,.mesa-overlay select{padding:.5rem .6rem}
.weather-city-link{display:grid;text-decoration:none;color:inherit;cursor:pointer;transition:transform .1s,box-shadow .1s}
.weather-city-link:hover{transform:translateY(-1px);box-shadow:0 2px 8px #0e2a1a14}
.sensor-gauge{display:flex;flex-direction:column;align-items:center;gap:.3rem}
.sensor-gauge-ring{width:132px;height:132px;border-radius:50%;display:grid;place-items:center}
.sensor-gauge-inner{width:98px;height:98px;background:#fff;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.1rem;box-shadow:inset 0 0 0 1px #edf3ef}
.sensor-gauge-inner strong{font-size:1.35rem;color:var(--green-dark);line-height:1}
.sensor-gauge-inner small{font-size:.68rem;color:#64766c}
.sensor-gauge-range{font-size:.68rem;color:#64766c}
.sensor-evo-svg{width:100%;height:160px;display:block}
.sensor-evo-axis{display:flex;justify-content:space-between;font-size:.68rem;color:#64766c;margin-top:.2rem}
.sensor-evo-minmax{display:flex;justify-content:space-between;font-size:.72rem;color:#44574c;margin-top:.15rem;font-weight:650}
@media(max-width:560px){.sensor-gauge-ring{width:110px;height:110px}.sensor-gauge-inner{width:80px;height:80px}}