:root{color:#202e25;background:#fbf8ef;font-family:system-ui,sans-serif;line-height:1.5;--green:#234737;--border:#d9d9c8;--paper:#fffdf6}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input,select{font:inherit}
button,a,input,select{touch-action:manipulation}
button,.button{min-height:44px;cursor:pointer;border:1px solid var(--border);border-radius:10px;background:var(--paper);color:inherit;padding:.5rem .8rem;font-weight:650}
button:disabled{opacity:.65;cursor:wait}
:focus-visible{outline:3px solid #387957;outline-offset:3px}
.top{background:var(--green);color:white}
.wrap{max-width:1100px;margin:auto;padding-inline:1rem}
.top-inner{display:flex;justify-content:space-between;align-items:center;min-height:64px}
.brand{color:white;text-decoration:none;display:inline-flex;gap:.6rem;align-items:center;font-weight:800;font-size:1.2rem}
.brand img{width:36px;height:36px}
.plain{background:transparent;color:white;border-color:#aabdaf}
main{padding-block:1.2rem 2rem}
.home{color:#475d4e;font-weight:700;margin:0 0 .25rem}
h1,h2,h3{line-height:1.15;margin:0}
h1{font-family:Georgia,serif;font-size:clamp(2.15rem,7vw,3.7rem);letter-spacing:-.035em}
h2{font-size:1.45rem}
h3{font-size:1.04rem}
.title{display:flex;align-items:start;gap:.65rem;flex-wrap:wrap;justify-content:space-between;margin-bottom:1rem}
.primary{background:var(--green);color:white;border-color:var(--green)}
.secondary{border-color:#819485}
nav{display:flex;flex-wrap:wrap;gap:.35rem;padding:.35rem;background:#efeee2;border-radius:13px;margin-bottom:1rem}
nav button{background:transparent;border-color:transparent;font-size:.9rem;padding-inline:.55rem}
nav button[aria-current="page"]{background:var(--green);color:white}
#inventory-controls{display:flex;flex-wrap:wrap;gap:.65rem;align-items:end;margin-bottom:1rem}
.search{flex:1 1 150px}
label{display:grid;gap:.3rem;font-size:.9rem;font-weight:650;min-width:0}
input,select{width:100%;min-height:44px;border:1px solid #8d998a;border-radius:8px;background:white;color:#202e25;padding:.45rem .55rem;min-width:0}
input[type="checkbox"]{width:24px;min-height:24px;accent-color:var(--green)}
.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.card{display:flex;flex-direction:column;align-items:stretch;min-width:0;text-align:left;overflow:hidden;padding:0;border-radius:15px;background:var(--paper)}
.card:hover{border-color:#557a5f}
.art{display:flex;justify-content:center;align-items:center;min-height:100px;background:#efe8d7}
.art[data-category="enlatados"]{background:#e3edeb}.art[data-category="otros"]{background:#f2e7dc}
.art img{width:100%;height:clamp(105px,30vw,170px);object-fit:contain}
.card-body{display:grid;gap:.3rem;padding:.72rem;overflow-wrap:anywhere}
.card-name{font-size:1.05rem;font-weight:800;line-height:1.2}
.amount{font-weight:600;color:#3f5547}
.status{font-size:.78rem;font-weight:720;width:fit-content;border-radius:8px;padding:.24rem .42rem;background:#e8eee2;color:#264935}
.urgent{background:#f8dfd4;color:#752d23}.soon{background:#f8e8bb;color:#67470d}.pending{background:#ebe6f1;color:#533b67}
.detail-link{font-size:.8rem;text-decoration:underline;color:#345a42}
.detail-art img{height:120px}
dialog{border:1px solid var(--border);border-radius:16px;background:var(--paper);color:inherit;max-width:min(94vw,660px);width:100%;max-height:90dvh;padding:1rem}
dialog::backdrop{background:#18291db3}
.dialog-header{display:flex;justify-content:space-between;gap:.6rem;align-items:center;margin-bottom:.8rem}
#close{min-width:44px;font-size:1.35rem}
form,#dialog-body,.stack{display:grid;gap:.75rem}
#login form{max-width:440px;margin-top:1rem}
fieldset{border:1px solid var(--border);border-radius:10px;margin:0;padding:.65rem;min-width:0}
legend{font-weight:800}
.row{display:flex;gap:.55rem;flex-wrap:wrap;align-items:end}
.row>*{flex:1 1 100px}
.check{display:flex;align-items:center;gap:.45rem}
.lot,.history, .invoice-line{padding:.7rem;border:1px solid var(--border);border-radius:10px;background:white}
small{color:#485a4d}
#notice,#dialog-error{padding:.65rem;border-radius:10px;background:#ede4ce}
#notice{position:sticky;bottom:.5rem;box-shadow:0 2px 14px #122a2633;width:fit-content}
.empty{color:#475d4e;padding:.9rem;border:1px dashed #a6ad9c;border-radius:10px}
.preview{max-height:90px;width:100%;object-fit:contain}
@media(min-width:680px){.cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.wrap{padding-inline:1.5rem}}
@media(min-width:950px){.cards{grid-template-columns:repeat(4,minmax(0,1fr))}}

#google-login{display:inline-flex;align-items:center;margin-top:1rem;text-decoration:none}
