:root{--navy:#123f63;--navy2:#0d2f4b;--blue:#2d7fb0;--blueSoft:#edf5fa;--bg:#f4f6f8;--card:#fff;--text:#17212b;--muted:#6f7a86;--green:#198754;--amber:#d39b00;--red:#c43131;--line:#dde3e8;--shadow:0 8px 26px rgba(10,35,55,.08)}
*{box-sizing:border-box}html,body{max-width:100%;overflow-x:hidden}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}h1,h2,h3{line-height:1.08}button,input,select,textarea{font-family:inherit}
.top{background:var(--navy);color:#fff;padding:9px 14px;position:sticky;top:0;z-index:20}.top .wrap{max-width:1100px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{display:flex;align-items:center;gap:9px;font-weight:900;min-width:0}.brand img{width:150px;height:46px;object-fit:contain;background:#fff;border-radius:9px;flex:0 0 auto}.brand span{white-space:nowrap}.top-user{font-size:14px;text-align:right;line-height:1.2;max-width:45%;overflow-wrap:anywhere}.container{max-width:1100px;margin:18px auto;padding:0 16px}.card{background:var(--card);border-radius:18px;padding:18px;box-shadow:var(--shadow);margin-bottom:16px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.kpi{background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px;min-width:0}.kpi .v{font-size:25px;font-weight:900;overflow-wrap:anywhere}.muted{color:var(--muted)}.small{font-size:12px;color:var(--muted)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;padding:12px 16px;font-weight:850;cursor:pointer;min-height:44px;text-align:center}.primary{background:var(--navy);color:#fff}.secondary{background:var(--blueSoft);color:var(--navy)}.danger{background:var(--red);color:#fff}.success{background:var(--green);color:#fff}.full{width:100%}input,select,textarea{width:100%;padding:12px;border:1px solid #cfd7de;border-radius:11px;font-size:16px;background:#fff}label{display:block;font-weight:750;margin:10px 0 6px}.status{display:inline-block;padding:7px 11px;border-radius:999px;font-weight:800;font-size:13px}.pending{background:#fff2bd;color:#7f6200}.done{background:#d9f7e5;color:#17643c}.partial{background:#e4f2fb;color:#0f5d7a}.rejected{background:#fde8e8;color:#8a1d1d}.progress{height:10px;background:#e6ebef;border-radius:99px;overflow:hidden}.progress span{display:block;height:100%;background:var(--blue)}
.hero{background:linear-gradient(135deg,var(--navy2),#17648e);color:#fff;border-radius:22px;padding:22px}.hero h2{font-size:30px;margin:6px 0}.route-row{display:flex;justify-content:space-between;gap:12px;align-items:center}.route-row>div{min-width:0}.route-row b{overflow-wrap:anywhere}.invoice{border:1px solid var(--line);border-radius:16px;padding:14px;margin:10px 0;background:#fff}.qtyctrl{display:flex;align-items:center;gap:8px}.qtyctrl button{width:46px;height:46px;border-radius:11px;border:1px solid var(--line);background:#fff;font-size:22px}.qtyctrl input{width:88px;text-align:center}.alert{padding:12px 14px;border-radius:12px;margin:12px 0}.ok{background:#e5f6ed;color:#145a32}.error{background:#fde8e8;color:#8a1d1d}.warn{background:#fff6df;color:#7f6200}.setup{max-width:520px;margin:50px auto;padding:20px}.setup-logo{max-width:260px}.footer{text-align:center;color:#7b8792;padding:28px 10px 70px;font-size:13px}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.customer-head{padding:20px}.customer-title{font-size:clamp(26px,5vw,38px);margin:0 0 8px;overflow-wrap:anywhere}.customer-meta{font-size:14px;color:var(--muted);line-height:1.45}.customer-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}.customer-summary>div{background:#f8fafb;border:1px solid var(--line);border-radius:14px;padding:11px;min-width:0}.customer-summary span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.customer-summary b{display:block;font-size:18px;overflow-wrap:anywhere}
.section-title{font-size:23px;margin:22px 2px 12px}.invoice-select-card{border:1px solid var(--line);border-radius:16px;padding:14px;margin:10px 0;background:#fff}.invoice-main{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center}.invoice-check{width:28px;height:28px;margin:0}.invoice-open{display:flex;justify-content:space-between;gap:12px;align-items:center;min-width:0}.invoice-open>div{min-width:0}.invoice-code{font-weight:900;font-size:18px;overflow-wrap:anywhere}.invoice-amount{text-align:right;white-space:nowrap}.invoice-amount b{font-size:18px}.tap-hint{font-size:12px;color:var(--muted);background:#f6f8fa;border-radius:9px;padding:8px 10px;margin-top:10px}.batch-box{border-left:4px solid var(--red)}
.invoice-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.invoice-title{font-size:26px;margin:0 0 6px}.invoice-total{font-size:26px;font-weight:900;margin-top:10px}.product-card{border-left:4px solid var(--navy);padding:16px}.product-name{font-weight:900;font-size:17px;line-height:1.25;overflow-wrap:anywhere}.product-meta{color:var(--muted);font-size:13px;margin-top:6px}.product-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:12px}.qty-stepper{display:grid;grid-template-columns:48px 1fr 48px;gap:8px;align-items:center}.qty-stepper button{height:48px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:20px;font-weight:900}.qty-stepper input{text-align:center;font-weight:900}.empty-detail{border:1px solid #f1d18a;background:#fff8e7;color:#715300;border-radius:16px;padding:16px;margin:14px 0}.tax-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tax-grid>div{background:#f8fafb;border:1px solid var(--line);border-radius:12px;padding:10px}.tax-grid span{display:block;color:var(--muted);font-size:12px}.tax-grid b{font-size:17px}
.repair-box{border:1px dashed #9cb7ca;background:#f5fafc}.repair-box h3{margin-top:0}
@media(max-width:720px){.brand img{width:145px;height:44px}.brand span{font-size:15px}.top-user{font-size:13px;max-width:44%}.container{margin:10px auto;padding:0 12px}.card{padding:15px;border-radius:17px}.grid{gap:8px}.kpi{padding:10px}.kpi .v{font-size:20px}.hero{padding:18px}.hero h2{font-size:26px}.two,.product-grid{grid-template-columns:1fr}.route-row{align-items:flex-start}.customer-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.customer-summary>div{padding:9px}.customer-summary b{font-size:16px}.invoice-open{align-items:flex-start}.invoice-code{font-size:17px}.invoice-amount b{font-size:16px}.section-title{font-size:21px}}
@media(max-width:430px){.top{padding:8px 10px}.brand img{width:145px;height:44px}.brand span{font-size:14px}.top-user{font-size:12px;max-width:40%}.customer-title{font-size:29px}.customer-summary{grid-template-columns:1fr 1fr 1fr}.customer-summary span{font-size:11px}.customer-summary b{font-size:14px}.invoice-open{display:block}.invoice-amount{text-align:left;margin-top:8px}.invoice-main{align-items:start}.tax-grid{grid-template-columns:1fr 1fr}.btn{padding:11px 12px}.hero h2{font-size:24px}}
/* V3.3 - devoluciones parciales mobile */
.fiscal-save-card{position:sticky;bottom:8px;z-index:4;box-shadow:0 12px 35px rgba(15,45,70,.18);border:1px solid #d9e5ec}
.qty-stepper{display:grid;grid-template-columns:54px minmax(70px,1fr) 54px;align-items:center;gap:8px}
.qty-stepper button{height:50px;border:0;border-radius:14px;background:#0c4d72;color:#fff;font-size:28px;font-weight:900;touch-action:manipulation}
.qty-stepper input{height:50px;text-align:center;font-size:22px;font-weight:900;background:#fff;border:1px solid #cbd8df;border-radius:14px}
.item-return-preview{background:#f4f8fa;padding:8px 10px;border-radius:10px}
@media(max-width:430px){.product-grid{grid-template-columns:1fr}.fiscal-save-card{bottom:6px}.tax-grid{grid-template-columns:1fr 1fr}.qty-stepper button{height:54px}}

/* V3.6 - interfaz movil compacta para clientes y facturas */
.section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:10px}.compact-section-head{margin:16px 2px 8px}.compact-section-head .section-title{margin:0}.count-pill{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#e9eef2;color:var(--navy);font-size:13px;vertical-align:middle}.list-help{font-size:12px;color:var(--muted);margin-top:4px}.compact-total{text-align:right;white-space:nowrap}.compact-total span{display:block;font-size:11px;color:var(--muted)}.compact-total b{font-size:17px}.invoice-list-compact{display:grid;gap:7px}.invoice-select-card.compact{margin:0;padding:9px 10px;border-radius:12px}.invoice-select-card.compact .invoice-main{grid-template-columns:24px minmax(0,1fr);gap:8px}.invoice-select-card.compact .invoice-check{width:22px;height:22px}.invoice-select-card.compact .invoice-open{display:grid;grid-template-columns:minmax(0,1fr) auto 16px;align-items:center;gap:8px}.invoice-select-card.compact .invoice-code{font-size:15px;line-height:1.05}.invoice-state{font-size:11px;color:var(--muted);margin-top:2px}.invoice-state.is-partial{color:#0f6d93}.invoice-state.is-rejected{color:var(--red)}.invoice-select-card.compact .invoice-amount{margin:0;text-align:right;line-height:1.05}.invoice-select-card.compact .invoice-amount b{font-size:15px}.invoice-return-mini{display:block;font-size:10px;color:var(--red);margin-top:3px}.invoice-chevron{font-size:22px;color:#91a0ab}.invoice-rejected{opacity:.72}.batch-box{margin-top:12px}
.product-topline{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.product-line-amount{font-weight:850;white-space:nowrap;color:var(--navy)}.product-controls{display:grid;grid-template-columns:minmax(120px,170px) minmax(0,1fr);gap:8px;align-items:center;margin-top:7px}.compact-product{padding:10px 11px;margin-bottom:7px;border-radius:13px}.compact-product .product-name{font-size:14px;line-height:1.14}.compact-product .product-meta{font-size:11px;margin-top:3px}.compact-product .qty-stepper{grid-template-columns:34px minmax(48px,1fr) 34px;gap:5px}.compact-product .qty-stepper button{height:36px;border-radius:9px;font-size:21px}.compact-product .qty-stepper input{height:36px;border-radius:9px;font-size:17px;padding:4px}.compact-reason{height:36px;padding:4px 8px;font-size:13px;border-radius:9px}.compact-preview{display:flex;gap:5px;align-items:center;justify-content:flex-end;margin-top:4px;padding:0;background:transparent;font-size:10px;color:var(--muted)}.compact-preview b{color:var(--red);font-size:11px}.compact-fiscal{padding:10px 12px;bottom:4px;border-radius:14px}.fiscal-main{display:flex;justify-content:space-between;align-items:center;gap:12px}.fiscal-total{font-size:21px;font-weight:950;color:var(--navy)}.compact-save{min-height:38px;padding:8px 18px;border-radius:10px}.fiscal-details{margin-top:7px}.fiscal-details summary{cursor:pointer;font-size:12px;color:var(--navy);font-weight:800}.fiscal-details .tax-grid{margin-top:7px}.fiscal-rule{margin-top:7px}
@media(max-width:720px){.customer-head{padding:12px}.customer-title{font-size:23px;margin-bottom:4px}.customer-meta{font-size:12px;line-height:1.3}.customer-summary{margin-top:10px}.customer-summary>div{padding:6px 7px;border-radius:10px}.customer-summary span{font-size:10px}.customer-summary b{font-size:13px}.section-title{font-size:18px}.invoice-title{font-size:21px}.invoice-total{font-size:20px}.product-controls{grid-template-columns:145px minmax(0,1fr)}.tax-grid>div{padding:7px}.tax-grid b{font-size:13px}.tax-grid span{font-size:10px}}
@media(max-width:430px){.container{padding:0 9px}.card{margin-bottom:9px}.customer-head{padding:10px}.customer-title{font-size:21px}.customer-summary{gap:5px}.customer-summary>div{padding:6px 5px}.customer-summary b{font-size:12px}.compact-section-head{margin-top:11px}.list-help{max-width:245px}.invoice-list-compact{gap:5px}.invoice-select-card.compact{padding:7px 8px}.invoice-select-card.compact .invoice-code{font-size:14px}.invoice-select-card.compact .invoice-amount b{font-size:14px}.batch-box{padding:10px}.product-controls{grid-template-columns:132px minmax(0,1fr);gap:6px}.compact-product{padding:8px 9px}.compact-product .product-name{font-size:13px}.product-line-amount{font-size:12px}.compact-reason{font-size:12px;padding-left:6px}.compact-fiscal{padding:8px 10px}.fiscal-total{font-size:18px}.compact-save{padding:7px 14px;min-height:36px}.top{padding:6px 8px}.brand img{width:125px;height:38px}}
