:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;color:#17324d;background:#eef6fc;--navy:#123b68;--blue:#216fd1;--blue-dark:#1556a8;--sky:#e8f3ff;--cyan:#28a9e0;--danger:#c03948;--muted:#71869a;--line:#d8e6f0;--soft:#f7fbfe;--white:#fff}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:linear-gradient(135deg,#edf7ff 0%,#eaf3fa 55%,#f9fcff 100%);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:10px;padding:10px 14px;font-weight:750;transition:background .18s ease,box-shadow .18s ease,transform .18s ease}button:active{transform:translateY(1px)}button:disabled{opacity:.45;cursor:not-allowed}.primary{background:var(--blue);color:#fff;box-shadow:0 5px 14px #216fd132}.primary:hover{background:var(--blue-dark)}.secondary{background:#e7f1f8;color:var(--navy)}.secondary:hover{background:#d9e9f5}.danger{background:var(--danger);color:#fff}.ghost{background:transparent;color:var(--danger);border:1px solid #e4a4ad}.large{width:100%;padding:15px;font-size:17px}.topbar{height:72px;display:flex;justify-content:space-between;align-items:center;padding:10px 24px;background:var(--navy);color:#fff;box-shadow:0 5px 20px #123b6830;position:relative;z-index:30}.brand{display:flex;align-items:center;gap:10px}.brand strong{display:block;letter-spacing:1.5px}.brand small{display:block;color:#b9d8ee;margin-top:3px}.brand-mark{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(145deg,var(--cyan),#55d7ee);color:#fff;font-weight:900;font-size:26px;box-shadow:0 7px 18px #0b315466}.brand-mark.small{width:38px;height:38px;font-size:21px;border-radius:11px}.top-actions{display:flex;gap:10px;align-items:center;position:relative}.user-menu-button{display:flex;align-items:center;gap:9px;background:transparent;color:#fff;padding:5px 8px 5px 5px;border-radius:14px}.user-menu-button:hover,.user-menu-button[aria-expanded=true]{background:#ffffff16}.user-avatar{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#d9efff;color:var(--navy);font-weight:900}.user-summary{text-align:left;line-height:1.2}.user-summary strong,.user-summary small{display:block}.user-summary strong{font-size:13px}.user-summary small{font-size:11px;color:#b9d8ee;margin-top:3px}.chevron{font-size:18px;color:#b9d8ee;margin-left:4px}.user-menu{position:absolute;right:0;top:52px;width:220px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 42px #102f4b2b;padding:6px;z-index:40}.user-menu button{display:flex;align-items:center;gap:9px;width:100%;background:transparent;color:var(--navy);text-align:left;padding:11px 12px}.user-menu button:hover{background:var(--sky)}.user-menu .logout-menu-item{color:var(--danger);border-top:1px solid var(--line);margin-top:5px}.menu-icon{width:22px;text-align:center;font-size:18px}.tabs{display:flex;gap:6px;align-items:center;padding:10px 24px;background:#fff;position:sticky;top:0;z-index:20;border-bottom:1px solid var(--line);overflow:auto}.tabs button{background:transparent;color:var(--muted);white-space:nowrap;padding:10px 14px}.tabs button.active{background:var(--sky);color:var(--navy);box-shadow:inset 0 0 0 1px #cfe5f6}main{padding:24px;max-width:1500px;margin:auto}.view{display:none}.view.active{display:block}.pos-grid{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:22px}.section-title,.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:18px}.section-title h2,.page-heading h2,.cart-panel h2{margin:3px 0 0;color:var(--navy)}.eyebrow{font-size:11px;letter-spacing:1.7px;font-weight:800;color:var(--blue)}.section-title input{max-width:300px}.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:14px}.product-card,.cart-panel,.form-card,.metric,.table-wrap{background:#fff;border:1px solid #e0edf5;border-radius:17px;box-shadow:0 9px 25px #2d75a312}.product-card{padding:16px;min-height:145px;display:flex;flex-direction:column;justify-content:space-between}.price{font-size:21px;color:var(--blue);font-weight:850;margin:9px 0}.stock-low{color:var(--danger);font-weight:750}.cart-panel{padding:20px;position:sticky;top:84px;height:max-content}.cart-heading{display:flex;justify-content:space-between;align-items:start}.cart-items{max-height:280px;overflow:auto;margin:12px 0}.cart-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.qty-controls{display:flex;align-items:center;gap:6px}.qty-controls button{padding:4px 9px;background:var(--sky);color:var(--navy)}.badge{font-size:12px;font-weight:800;color:var(--danger);background:#fff0f1;border-radius:20px;padding:7px 10px}.badge.success{color:#168257;background:#e7f8f0}.customer-picker{border-top:1px solid var(--line);padding-top:12px}.customer-picker label{margin-bottom:4px}.totals{border-top:1px solid var(--line);margin-top:15px;padding-top:10px}.totals>div{display:flex;justify-content:space-between;margin:8px 0}.grand{font-size:25px;color:var(--navy)}.payment-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}.payment{background:#eef5fa;color:var(--navy)}.payment.active{background:var(--navy);color:#fff}.change{font-size:19px;color:var(--blue);margin:8px 0}.inline{display:flex}.inline input{flex:1}.inline select{width:62px}label{display:block;color:#436078;font-size:13px;font-weight:700;margin:10px 0}input,select{width:100%;border:1px solid #c9dce9;border-radius:9px;padding:10px 11px;background:#fff;color:var(--navy);margin-top:5px;outline:none}input:focus,select:focus{border-color:var(--blue);box-shadow:0 0 0 3px #216fd11c}.form-message{min-height:18px;font-size:13px}.form-message.error,.error{color:var(--danger)}.form-message.success{color:#168257}.muted{color:var(--muted)}.cards{display:grid;grid-template-columns:1fr 1fr;gap:18px}.form-card{padding:20px}.form-card h3{margin:0;color:var(--navy)}.form-card h4{color:var(--navy);margin:0 0 10px}.card-heading{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}.card-heading h3{margin:0 0 4px}.card-heading p{margin:0;font-size:13px}.settings-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:var(--sky);color:var(--blue);font-size:20px;flex:none}.settings-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.users-card{grid-column:1/-1}.cash-visibility-card{min-height:220px}.toggle-row{display:flex;align-items:center;gap:12px;position:relative;cursor:pointer;margin:20px 0}.toggle-row>span:first-child{flex:1}.toggle-row strong,.toggle-row small{display:block}.toggle-row small{font-weight:500;color:var(--muted);margin-top:5px;line-height:1.35}.toggle-row input{position:absolute;opacity:0;width:1px;height:1px}.toggle-control{width:48px;height:27px;border-radius:30px;background:#c9d8e4;position:relative;flex:none;transition:.2s}.toggle-control:after{content:"";position:absolute;width:21px;height:21px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 2px 5px #17324d2b;transition:.2s}.toggle-row input:checked~.toggle-control{background:var(--blue)}.toggle-row input:checked~.toggle-control:after{transform:translateX(21px)}.user-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:14px 0 20px}.user-card{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;padding:13px;background:linear-gradient(145deg,#fff,#f6fbff)}.user-card-avatar{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:var(--navy);color:#fff;font-weight:900;flex:none}.user-card-content{min-width:0;flex:1}.user-card-content strong,.user-card-content small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-card-content strong{color:var(--navy)}.user-card-content small{color:var(--muted);margin-top:3px}.role-badge{font-size:10px;font-weight:850;border-radius:20px;padding:5px 7px;background:#e7f8f0;color:#168257;white-space:nowrap}.role-badge.admin{background:#eeeaff;color:#5b43a4}.user-create-panel{border-top:1px solid var(--line);padding-top:18px}.table-wrap{overflow:auto;margin:16px 0}table{width:100%;border-collapse:collapse;min-width:720px}th,td{text-align:left;padding:12px 14px;border-bottom:1px solid #edf3f7;font-size:13px}th{color:#5e7a90;background:#f7fbfe;font-size:12px;letter-spacing:.3px}td{color:#29455d}.metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:18px}.metric{padding:18px}.metric span{color:var(--muted);font-size:13px}.metric strong{display:block;font-size:25px;color:var(--navy);margin-top:8px}.export-actions{display:flex;gap:8px}.icon-button{display:flex;align-items:center;gap:7px}.icon-button span{font-size:18px}.dialog-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:var(--sky);color:var(--blue);font-size:22px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}dialog{border:0;border-radius:18px;padding:0;width:min(620px,92vw);box-shadow:0 25px 90px #123b6850}dialog::backdrop{background:#123b6880}dialog form{padding:24px}dialog h2{color:var(--navy);margin:14px 0 5px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px}.wide{grid-column:1/-1}.login-shell{min-height:100vh;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 20% 20%,#bce9ff 0,#dff4ff 24%,transparent 50%),linear-gradient(145deg,#eef8ff,#cfe8f8)}.login-card{width:min(400px,100%);background:#fff;border:1px solid #e0edf5;border-radius:24px;padding:34px;box-shadow:0 25px 80px #19517b25;text-align:center}.login-card .brand-mark{margin:auto}.login-card h1{color:var(--navy);margin:16px 0 5px}.login-card p{color:var(--muted);margin-top:0}.login-card form{text-align:left;margin-top:24px}@media(max-width:1000px){.pos-grid{grid-template-columns:1fr}.cart-panel{position:static}.cards,.settings-layout{grid-template-columns:1fr}.users-card{grid-column:auto}}@media(max-width:600px){main{padding:14px}.topbar{padding:10px 12px;height:66px}.brand strong{font-size:13px}.brand small{font-size:10px}.top-actions{gap:4px}.user-summary{display:none}.user-menu-button{padding:5px}.chevron{font-size:16px}.user-menu{right:-4px;top:49px}.tabs{padding:8px 12px}.tabs button{padding:9px 11px;font-size:13px}.form-grid{grid-template-columns:1fr}.wide{grid-column:auto}.section-title,.page-heading{align-items:stretch;flex-direction:column}.section-title input{max-width:none}.page-heading{gap:10px}.export-actions{width:100%}.export-actions button{flex:1;justify-content:center}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.product-card{padding:12px}.product-card button{padding:9px 7px;font-size:12px}.cart-panel{padding:16px}.user-grid{grid-template-columns:1fr}.table-wrap{margin-left:-2px;margin-right:-2px}dialog{width:calc(100vw - 24px)}}
:root{--unused:0}
.privacy-note{padding:12px 14px;border:1px solid #cfe5f6;border-radius:12px;background:var(--sky);color:var(--navy);font-size:13px;line-height:1.4}
.compact{padding:8px 11px;font-size:12px;white-space:nowrap}.card-heading .compact{margin-left:auto}.section-note{color:var(--muted);font-size:13px}.expense-entry-card{max-width:920px}.expense-icon{background:#e8f8f0;color:#168257}.product-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.product-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:var(--sky);font-size:22px}.stock-pill{font-size:10px;font-weight:800;color:#168257;background:#e7f8f0;border-radius:20px;padding:5px 8px;white-space:nowrap}.stock-pill.low{color:var(--danger);background:#fff0f1}.product-card-body{margin:12px 0 14px}.product-card-body strong{display:block;color:var(--navy);font-size:15px;margin-top:4px}.product-category{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.7px}.product-card .price{margin:8px 0 0;font-size:20px}.product-add{width:100%;font-size:12px;padding:10px 8px}.empty-state{display:grid;place-items:center;gap:6px;min-height:190px;padding:30px;text-align:center;color:var(--muted);background:#fff;border:1px dashed #c9dce9;border-radius:17px}.empty-state span{font-size:30px}.empty-state strong{color:var(--navy)}.empty-state small{max-width:280px;line-height:1.4}.empty-table{text-align:center!important;color:var(--muted);padding:28px!important}
@media(max-width:600px){.card-heading .compact{padding:8px 9px}.section-note{font-size:12px}.product-card-body{margin-bottom:10px}.stock-pill{font-size:9px;padding:4px 6px}}
.user-create-empty{display:flex;align-items:center;gap:12px;border:1px dashed #c9dce9;border-radius:14px;padding:14px;background:#f8fcff}.user-create-empty-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:var(--sky);color:var(--blue);font-size:22px;font-weight:800}.user-create-empty strong{color:var(--navy)}.user-create-empty p{margin:4px 0 0;font-size:12px}
.filter-bar{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin:0 0 16px;padding:13px 15px;background:#f7fbfe;border:1px solid var(--line);border-radius:14px}.filter-bar label{margin:0;min-width:150px;flex:1}.filter-bar button{margin-bottom:0}.pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin:14px 0;color:var(--muted);font-size:13px}.search-results{position:absolute;left:0;right:0;top:76px;z-index:25;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 15px 35px #123b6825;padding:5px}.customer-picker label{position:relative}.search-result{display:flex;justify-content:space-between;gap:10px;width:100%;padding:10px 11px;background:#fff;color:var(--navy);text-align:left;border-radius:8px}.search-result:hover{background:var(--sky)}.search-result small{color:var(--muted)}.search-empty{padding:12px;color:var(--muted);font-size:13px}.payment-hint{font-size:12px;margin:0 0 8px}.payment-summary{border:1px solid var(--line);border-radius:14px;padding:13px;background:#f8fcff}.summary-lines>div,.summary-total{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #e6f0f6}.summary-total.grand{border-bottom:0;padding-top:13px;font-size:20px;color:var(--navy)}.payment-change{padding:10px 0}.report-filters{margin-top:2px}.report-filters label{min-width:140px}.expense-entry-card{max-width:none}
@media(max-width:600px){.filter-bar{align-items:stretch}.filter-bar label{min-width:100%}.filter-bar button{width:100%}.pagination{flex-wrap:wrap}.search-results{top:74px}.dialog-actions{flex-wrap:wrap}.dialog-actions button{flex:1}.summary-total.grand{font-size:18px}}
.field-hint{display:block;color:var(--muted);font-size:11px;font-weight:500;line-height:1.3;margin-top:5px}
.denomination-box{margin:12px 0 14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#f8fcff}.denomination-box>strong,.denomination-box>small{display:block}.denomination-box>small{margin-top:4px}.denomination-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:10px}.denomination-field{margin:0;font-size:11px}.denomination-field input{padding:7px 8px;margin-top:3px}.denomination-total{margin-top:10px;text-align:right;color:var(--blue);font-weight:800;font-size:13px}.payment-settings-card{min-height:220px}
@media(max-width:600px){.denomination-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.section-tabs{display:flex;gap:6px;align-items:center;margin:4px 0 12px;padding:5px;background:#f2f8fc;border:1px solid var(--line);border-radius:13px;width:max-content;max-width:100%;overflow:auto}.section-tab{background:transparent;color:var(--muted);padding:9px 13px;font-size:13px;white-space:nowrap}.section-tab.active{background:#fff;color:var(--navy);box-shadow:0 3px 10px #123b6816}.pagination .secondary{padding:8px 11px;font-size:12px}

/* POS tablet: catálogo y carrito visibles al mismo tiempo en pantallas de 8 pulgadas. */
@media (min-width:601px) and (max-width:1000px){
  main{padding:14px}
  .pos-grid{grid-template-columns:minmax(0,1fr) 300px;gap:14px;align-items:start}
  .cart-panel{position:sticky;top:78px;max-height:calc(100vh - 92px);overflow:auto;padding:14px}
  .cart-items{max-height:clamp(150px,25vh,220px)}
  .product-grid{grid-template-columns:repeat(2,minmax(130px,1fr));gap:10px}
  .product-card{min-height:128px;padding:12px}
  .product-card-body{margin:9px 0 10px}
  .product-card .price{font-size:18px}
  .product-add{padding:9px 7px}
  .section-title{align-items:center;margin-bottom:12px}
  .section-title input{max-width:210px}
  .cart-panel h2{font-size:19px}
}
/* Algunas tablets de 8 pulgadas reportan alrededor de 600px en vertical. */
@media (min-width:520px) and (max-width:600px){
  main{padding:10px}
  .pos-grid{grid-template-columns:minmax(0,1fr) 244px;gap:8px;align-items:start}
  .cart-panel{position:sticky;top:72px;max-height:calc(100vh - 84px);overflow:auto;padding:12px}
  .cart-items{max-height:180px}
  .product-grid{grid-template-columns:1fr;gap:8px}
  .product-card{min-height:118px;padding:10px}
  .product-card-body{margin:7px 0 8px}
  .product-card .price{font-size:17px}
  .product-add{padding:8px 6px;font-size:11px}
  .section-title{align-items:center;flex-direction:row;margin-bottom:10px;gap:8px}
  .section-title h2{font-size:19px}
  .section-title input{max-width:155px}
  .cart-panel h2{font-size:17px}
  .cart-heading{gap:5px}
  .cart-heading .badge{font-size:10px;padding:5px 7px}
  .payment-buttons{gap:5px;margin:10px 0}
  .payment{padding:8px 5px;font-size:12px}
  .grand{font-size:21px}
}
.payment-change{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:2px;min-height:82px;margin:0;padding:12px 15px;border:1px solid #b9e5cd;border-radius:14px;background:linear-gradient(145deg,#f2fff7,#e3f8ed);color:#157347;box-shadow:0 5px 14px #16825714}.payment-change .change-label{font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#168257}.payment-change .change-amount{font-size:25px;line-height:1.05;color:#0f6d42}.payment-change small{font-size:11px;line-height:1.25;color:#4f8069}
@media(max-width:600px){#paymentDialog .form-grid{grid-template-columns:1fr}#paymentDialog .payment-change{min-height:74px}}
.header-left{display:flex;align-items:center;gap:12px;min-width:0}.nav-menu-button,.nav-backdrop,.drawer-heading,.nav-icon{display:none}
@media(max-width:1100px){.nav-menu-button{display:block;position:relative;flex:none;width:44px;height:44px;padding:0;background:linear-gradient(145deg,#2b7ad5,#1a5ba8);color:#fff;border:1px solid #72b7ed;border-radius:13px;box-shadow:0 7px 16px #081f385c}.nav-menu-button span{position:absolute;left:11px;width:20px;height:2px;background:currentColor;border-radius:3px;transition:top .2s ease,transform .2s ease,opacity .2s ease}.nav-menu-button span:nth-child(1){top:13px}.nav-menu-button span:nth-child(2){top:20px}.nav-menu-button span:nth-child(3){top:27px}.nav-menu-button[aria-expanded=true] span:nth-child(1){top:20px;transform:rotate(45deg)}.nav-menu-button[aria-expanded=true] span:nth-child(2){opacity:0}.nav-menu-button[aria-expanded=true] span:nth-child(3){top:20px;transform:rotate(-45deg)}.tabs{position:fixed;top:72px;bottom:0;left:0;width:min(310px,calc(100vw - 42px));display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:17px 14px;background:linear-gradient(180deg,#fff 0%,#f6fbff 100%);border:0;border-right:1px solid #d5e6f2;border-radius:0 22px 22px 0;box-shadow:18px 0 45px #102f4b2e;overflow:auto;transform:translateX(-105%);opacity:0;visibility:hidden;pointer-events:none;transition:transform .22s ease,opacity .22s ease,visibility .22s;z-index:60}.tabs.open{transform:translateX(0);opacity:1;visibility:visible;pointer-events:auto}.drawer-heading{display:block;padding:3px 10px 15px;margin-bottom:4px;border-bottom:1px solid var(--line)}.drawer-heading span,.drawer-heading strong{display:block}.drawer-heading span{font-size:10px;font-weight:850;letter-spacing:1.5px;color:var(--blue)}.drawer-heading strong{margin-top:4px;font-size:19px;color:var(--navy)}.tabs button{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;padding:8px 10px;text-align:left;font-size:14px;border:1px solid transparent;border-radius:13px}.nav-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:11px;background:#eaf3fa;color:#315d83;font-size:17px;font-weight:900}.tabs button:hover{background:#eef7fd;color:var(--navy)}.tabs button.active{background:linear-gradient(135deg,#eaf4ff,#deedfb);color:var(--navy);border-color:#c5dff2;box-shadow:0 5px 14px #216fd112}.tabs button.active .nav-icon{background:linear-gradient(145deg,var(--blue),var(--blue-dark));color:#fff;box-shadow:0 5px 12px #216fd137}.nav-backdrop{display:block;position:fixed;inset:0;border:0;border-radius:0;background:#102f4b73;backdrop-filter:blur(2px);z-index:50}.topbar{z-index:70}.user-menu{z-index:80}}
@media(max-width:600px){.header-left{gap:8px}.nav-menu-button{width:40px;height:40px}.nav-menu-button span{left:10px}.tabs{top:66px;width:min(292px,calc(100vw - 34px));padding:15px 12px}.tabs button{min-height:52px}}
@media(max-width:1100px){.topbar{height:60px;padding:7px 12px}.brand-mark.small{width:34px;height:34px;border-radius:10px;font-size:18px}.brand strong{font-size:13px;letter-spacing:1px}.brand small{margin-top:1px;font-size:9px}.header-left{gap:8px}.nav-menu-button{width:38px;height:38px;border-radius:11px}.nav-menu-button span{left:9px;width:18px}.nav-menu-button span:nth-child(1){top:11px}.nav-menu-button span:nth-child(2){top:18px}.nav-menu-button span:nth-child(3){top:25px}.nav-menu-button[aria-expanded=true] span:nth-child(1),.nav-menu-button[aria-expanded=true] span:nth-child(3){top:18px}.tabs{top:60px;width:min(264px,calc(100vw - 44px));gap:3px;padding:10px 9px;border-radius:0 17px 17px 0}.drawer-heading{padding:3px 8px 9px;margin-bottom:3px}.drawer-heading span{display:none}.drawer-heading strong{margin:0;font-size:15px}.tabs button{min-height:44px;gap:9px;padding:6px 8px;font-size:13px;border-radius:11px}.nav-icon{width:30px;height:30px;border-radius:9px;font-size:14px}.user-avatar{width:34px;height:34px}.user-menu-button{padding:3px 6px 3px 3px}main{padding:12px}}
@media(max-width:600px){.topbar{height:58px;padding:6px 10px}.brand-mark.small{width:32px;height:32px}.brand small{display:none}.nav-menu-button{width:36px;height:36px}.nav-menu-button span{left:8px}.nav-menu-button span:nth-child(1){top:10px}.nav-menu-button span:nth-child(2){top:17px}.nav-menu-button span:nth-child(3){top:24px}.nav-menu-button[aria-expanded=true] span:nth-child(1),.nav-menu-button[aria-expanded=true] span:nth-child(3){top:17px}.tabs{top:58px;width:min(250px,calc(100vw - 40px));padding:9px 8px}.tabs button{min-height:42px}.nav-icon{width:29px;height:29px}main{padding:10px}}
@media(max-width:1100px){.topbar{position:sticky;top:0}.section-title,.page-heading{margin-bottom:8px}main{padding:7px 8px 10px}}
@media(min-width:601px) and (max-width:1100px){.cart-panel{top:66px;max-height:calc(100vh - 72px)}}
@media(min-width:520px) and (max-width:600px){.cart-panel{top:64px;max-height:calc(100vh - 69px)}}
@media(max-width:600px){main{padding:6px 7px 9px}.section-title,.page-heading{margin-bottom:7px}}

/* Toolbar tipo aplicación nativa: permanece fija durante todo el desplazamiento. */
@media(max-width:1100px){
  #appView{padding-top:calc(60px + env(safe-area-inset-top,0px))}
  .topbar{position:fixed;top:0;right:0;left:0;width:100%;height:calc(60px + env(safe-area-inset-top,0px));padding-top:calc(7px + env(safe-area-inset-top,0px))}
  .tabs{top:calc(60px + env(safe-area-inset-top,0px))}
}
@media(max-width:600px){
  #appView{padding-top:calc(58px + env(safe-area-inset-top,0px))}
  .topbar{height:calc(58px + env(safe-area-inset-top,0px));padding:calc(6px + env(safe-area-inset-top,0px)) 10px 6px}
  .tabs{top:calc(58px + env(safe-area-inset-top,0px))}
}

/* Renovación visual y de experiencia */
:root{
  --navy:#1d3567;
  --blue:#3862d6;
  --blue-dark:#294db4;
  --sky:#edf3ff;
  --cyan:#4aa8da;
  --danger:#c43f4d;
  --muted:#687b91;
  --line:#dce5ee;
  --soft:#f7f9fc;
}
body{color:#1e3149;background:radial-gradient(circle at 12% 0,#f6fbff 0,transparent 30%),linear-gradient(145deg,#edf5fb,#f6f9fc)}
.topbar{background:linear-gradient(115deg,#17335f,#263a70);box-shadow:0 6px 22px #17335f26}
.tabs{box-shadow:0 5px 18px #263a7008}
.tabs button{border-radius:11px}
.tabs button.active{background:#eef3ff;color:var(--navy);box-shadow:inset 0 0 0 1px #cfdbf3}
button{min-height:40px;border-radius:11px;letter-spacing:-.01em}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #7da5ff66;outline-offset:2px}
.primary{background:var(--blue);box-shadow:0 7px 18px #3862d62a}
.primary:hover{background:var(--blue-dark);box-shadow:0 9px 22px #294db435}
.secondary{background:#edf2f7;color:#263c5c}
.secondary:hover{background:#e2eaf3}
.compact{min-height:34px;padding:7px 12px;font-size:12px}
input,select{min-height:42px;border-color:#cbd8e4;background:#fff;transition:border-color .18s ease,box-shadow .18s ease}
input[readonly],input:disabled,select:disabled{background:#f1f4f7;color:#738398}
.page-heading h2,.section-title h2{letter-spacing:-.035em}
.eyebrow{color:#315fc7}
.product-card,.cart-panel,.form-card,.metric,.table-wrap{border-color:#dfe7ef;box-shadow:0 10px 28px #274d7b0d}
.product-card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.product-card:hover{transform:translateY(-2px);border-color:#cddcf0;box-shadow:0 14px 30px #274d7b16}
.product-card-body strong{letter-spacing:-.015em}
.cart-heading-actions{display:flex;align-items:center;gap:7px}
.cart-close{display:none;width:36px;height:36px;min-height:36px;padding:0;border-radius:50%;background:#edf2f7;color:var(--navy);font-size:23px;line-height:1}
.cart-empty{display:grid;place-items:center;gap:5px;padding:25px 12px;text-align:center;color:var(--muted)}
.cart-empty>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--sky);color:var(--blue);font-size:21px}
.cart-empty strong{color:var(--navy)}
.cart-empty small{font-size:12px}
.compact-empty{padding:22px 10px}
.status-chip{display:inline-flex;align-items:center;justify-content:center;min-height:25px;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.status-chip.success{color:#11734a;background:#e8f7ef}
.status-chip.danger{color:#a93240;background:#fff0f2}
.status-chip.info{color:#245da8;background:#eaf3ff}
.status-chip.neutral{color:#54677e;background:#eef2f6}
.stock-value{display:inline-flex;min-width:32px;justify-content:center;padding:4px 7px;border-radius:8px;background:#edf7f2;color:#14704b;font-weight:800}
.stock-value.low{background:#fff0f2;color:var(--danger)}
.positive{color:#14704b}.negative{color:var(--danger)}
.table-wrap{border-radius:16px;overflow:auto}
tbody tr{transition:background .16s ease}
tbody tr:hover{background:#f8fbff}
th{color:#5b6f86;background:#f6f9fc;text-transform:none}
.metric{position:relative;overflow:hidden;min-height:92px;padding:18px 18px 16px}
.metric-icon{position:absolute;right:15px;top:13px;display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:var(--sky);color:var(--blue);font-size:14px;font-weight:900}
.metric strong{font-size:24px;letter-spacing:-.035em}
.settings-layout{align-items:start}
.cash-visibility-card,.payment-settings-card{min-height:0}
.cash-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}
.cash-summary-grid span{display:flex;flex-direction:column;gap:4px;padding:11px;border-radius:11px;background:#f4f7fa;color:var(--muted);font-size:12px}
.cash-summary-grid b{color:var(--navy);font-size:16px}
.cash-summary-grid .expected{grid-column:1/-1;background:#edf4ff}
.mobile-cart-bar{display:none}
.toast-region{position:fixed;right:18px;bottom:18px;z-index:120;display:grid;gap:9px;width:min(360px,calc(100vw - 24px));pointer-events:none}
.toast{display:grid;grid-template-columns:10px 1fr;align-items:center;gap:10px;padding:13px 15px;border:1px solid #dce5ee;border-radius:13px;background:#fff;color:#263c5c;box-shadow:0 18px 46px #1d35672b;opacity:0;transform:translateY(10px);transition:.2s ease;font-size:13px;font-weight:700}
.toast.visible{opacity:1;transform:none}
.toast-dot{width:8px;height:8px;border-radius:50%;background:#5f7894}
.toast.success .toast-dot{background:#20a46b}.toast.error .toast-dot{background:var(--danger)}.toast.info .toast-dot{background:var(--blue)}
.printer-settings-card{grid-column:1/-1;padding:22px}
.printer-card-heading{align-items:center}
.printer-card-heading>div{flex:1}
.printer-status-panel{display:flex;align-items:center;gap:13px;padding:14px 16px;margin:4px 0 18px;border:1px solid #f0d8aa;border-radius:14px;background:#fff9ec}
.printer-status-panel.ready{border-color:#b9e2cd;background:#effaf4}
.printer-status-panel.error{border-color:#f1c2c7;background:#fff4f5}
.printer-status-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:12px;background:#f3b746;color:#fff;font-weight:900}
.printer-status-panel.ready .printer-status-icon{background:#20a46b}
.printer-status-panel.error .printer-status-icon{background:var(--danger)}
.printer-status-panel strong,.printer-status-panel small{display:block}
.printer-status-panel strong{color:var(--navy)}
.printer-status-panel small{margin-top:3px;color:var(--muted)}
.printer-section{padding:17px 0;border-top:1px solid var(--line)}
.printer-section-title{display:flex;align-items:center;gap:11px;margin-bottom:8px}
.printer-section-title>span{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:9px;background:#edf2ff;color:var(--blue);font-size:12px;font-weight:900}
.printer-section-title strong,.printer-section-title small{display:block}
.printer-section-title strong{color:var(--navy)}
.printer-section-title small{margin-top:2px;color:var(--muted);font-size:12px}
.printer-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.printer-grid .wide{grid-column:span 2}
.printer-toggle-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}
.compact-toggle{min-height:58px;margin:5px 0;padding:8px 10px;border:1px solid #e4ebf2;border-radius:12px;background:#f9fbfd}
.compact-toggle small{font-size:11px}
.separate-printer-toggle{max-width:620px}
.printer-test-panel{display:flex;flex-wrap:wrap;align-items:center;gap:18px;padding:16px;margin-top:4px;border:1px solid #cfdbef;border-radius:15px;background:linear-gradient(135deg,#f5f8ff,#edf3ff)}
.printer-test-panel>div:first-child{flex:1}
.printer-test-panel strong,.printer-test-panel small{display:block}
.printer-test-panel strong{color:var(--navy)}
.printer-test-panel small{margin-top:4px;color:var(--muted);line-height:1.35}
.printer-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.printer-actions button{white-space:nowrap}
.printer-test-panel .form-message{flex:0 0 100%;width:100%;margin:0}

@media(max-width:900px){
  .printer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .printer-grid .wide{grid-column:span 2}
}

@media(max-width:600px){
  body.mobile-cart-open{overflow:hidden}
  #pos{padding-bottom:78px}
  .mobile-cart-bar{position:fixed;right:7px;bottom:calc(7px + env(safe-area-inset-bottom,0px));left:7px;z-index:45;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:11px;min-height:64px;padding:9px 12px;border:1px solid #7d9be5;border-radius:17px;background:linear-gradient(120deg,#1d3567,#345bc8);color:#fff;box-shadow:0 15px 38px #162b5a55;text-align:left}
  .mobile-cart-copy{display:flex;flex-direction:column;gap:2px}
  .mobile-cart-copy small{font-size:9px;letter-spacing:1.2px;color:#bfd3ff}
  .mobile-cart-copy strong{font-size:13px}
  .mobile-cart-action{padding:7px 9px;border-radius:9px;background:#ffffff18;font-size:11px;font-weight:850}
  #pos.cart-open .mobile-cart-bar{display:none}
  #pos .cart-panel{position:fixed;top:calc(58px + env(safe-area-inset-top,0px));right:0;bottom:0;left:0;z-index:65;display:block;max-height:none;height:auto;padding:14px 14px calc(18px + env(safe-area-inset-bottom,0px));overflow-y:auto;border:0;border-radius:0;background:#fff;box-shadow:none;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(105%);transition:transform .24s ease,opacity .2s ease,visibility .24s}
  #pos.cart-open .cart-panel{opacity:1;visibility:visible;pointer-events:auto;transform:none}
  #pos .cart-heading{position:sticky;top:-14px;z-index:2;margin:0 -14px 8px;padding:13px 14px 11px;background:#fff;border-bottom:1px solid var(--line)}
  #pos .cart-close{display:grid;place-items:center}
  #pos .cart-items{max-height:none}
  #pos .cart-row{grid-template-columns:minmax(0,1fr) auto auto}
  .settings-layout{gap:10px}
  .form-card{padding:14px;border-radius:15px}
  .card-heading{gap:10px;margin-bottom:12px}
  .card-heading h3{font-size:17px}
  .toggle-row{margin:14px 0}
  .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .metric{min-height:88px;padding:14px}
  .metric strong{font-size:20px}
  .metric-icon{right:10px;top:10px;width:27px;height:27px}
  .cash-summary-grid{grid-template-columns:1fr}
  .cash-summary-grid .expected{grid-column:auto}
  .toast-region{right:12px;bottom:calc(82px + env(safe-area-inset-bottom,0px));left:12px;width:auto}
  .printer-settings-card{padding:14px}
  .printer-card-heading{align-items:flex-start;flex-wrap:wrap}
  .printer-card-heading #printerRuntimeBadge{margin-left:48px}
  .printer-status-panel{align-items:flex-start;padding:12px}
  .printer-grid{grid-template-columns:1fr}
  .printer-grid .wide{grid-column:auto}
  .printer-toggle-grid{grid-template-columns:1fr}
  .printer-test-panel{align-items:stretch;flex-direction:column}
  .printer-actions{display:grid;grid-template-columns:1fr}
  .printer-actions button{width:100%}

  .view:not(#pos) .table-wrap{overflow:visible;margin:12px 0;border:0;background:transparent;box-shadow:none}
  .view:not(#pos) table{min-width:0;border-collapse:separate;border-spacing:0}
  .view:not(#pos) thead{display:none}
  .view:not(#pos) tbody{display:grid;gap:9px}
  .view:not(#pos) tbody tr{display:block;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 7px 20px #274d7b0c}
  .view:not(#pos) tbody td{display:grid;grid-template-columns:108px minmax(0,1fr);align-items:center;gap:10px;min-height:38px;padding:8px 11px;border-bottom:1px solid #edf2f6;font-size:12px;overflow-wrap:anywhere}
  .view:not(#pos) tbody td:last-child{border-bottom:0}
  .view:not(#pos) tbody td::before{color:#718197;font-size:10px;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
  .view:not(#pos) tbody td.empty-table{display:block;padding:24px 14px;text-align:center}
  .view:not(#pos) tbody td.empty-table::before{content:none!important}
  .view:not(#pos) tbody td button{width:100%}

  #customersBody td:nth-child(1)::before{content:"Nombre"}#customersBody td:nth-child(2)::before{content:"Tipo"}#customersBody td:nth-child(3)::before{content:"Identificación"}#customersBody td:nth-child(4)::before{content:"Correo"}#customersBody td:nth-child(5)::before{content:"Teléfono"}
  #inventoryBody td:nth-child(1)::before{content:"Producto"}#inventoryBody td:nth-child(2)::before{content:"Categoría"}#inventoryBody td:nth-child(3)::before{content:"Precio"}#inventoryBody td:nth-child(4)::before{content:"Costo"}#inventoryBody td:nth-child(5)::before{content:"Existencias"}#inventoryBody td:nth-child(6)::before{content:"Mínimo"}#inventoryBody td:nth-child(7)::before{content:"Control"}#inventoryBody td:nth-child(8)::before{content:"Receta"}#inventoryBody td:nth-child(9)::before{content:"Estado"}#inventoryBody td:nth-child(10)::before{content:"Acciones"}
  #movementBody td:nth-child(1)::before{content:"Fecha"}#movementBody td:nth-child(2)::before{content:"Producto"}#movementBody td:nth-child(3)::before{content:"Tipo"}#movementBody td:nth-child(4)::before{content:"Cantidad"}#movementBody td:nth-child(5)::before{content:"Motivo"}#movementBody td:nth-child(6)::before{content:"Usuario"}
  #expenseBody td:nth-child(1)::before{content:"Fecha"}#expenseBody td:nth-child(2)::before{content:"Categoría"}#expenseBody td:nth-child(3)::before{content:"Descripción"}#expenseBody td:nth-child(4)::before{content:"Pago"}#expenseBody td:nth-child(5)::before{content:"Valor"}
  #salesBody td:nth-child(1)::before{content:"N.º"}#salesBody td:nth-child(2)::before{content:"Fecha"}#salesBody td:nth-child(3)::before{content:"Estado"}#salesBody td:nth-child(4)::before{content:"Pago"}#salesBody td:nth-child(5)::before{content:"Total"}#salesBody td:nth-child(6)::before{content:"Cliente"}#salesBody td:nth-child(7)::before{content:"Usuario"}#salesBody td:nth-child(8)::before{content:"Acciones"}
  #cashHistoryBody td:nth-child(1)::before{content:"Fecha"}#cashHistoryBody td:nth-child(2)::before{content:"Fondo"}#cashHistoryBody td:nth-child(3)::before{content:"Efectivo"}#cashHistoryBody td:nth-child(4)::before{content:"Transferencia"}#cashHistoryBody td:nth-child(5)::before{content:"Gastos"}#cashHistoryBody td:nth-child(6)::before{content:"Esperado"}#cashHistoryBody td:nth-child(7)::before{content:"Contado"}#cashHistoryBody td:nth-child(8)::before{content:"Diferencia"}
  #purchaseBody td:nth-child(1)::before{content:"Recepción"}#purchaseBody td:nth-child(2)::before{content:"Proveedor"}#purchaseBody td:nth-child(3)::before{content:"Factura"}#purchaseBody td:nth-child(4)::before{content:"Estado"}#purchaseBody td:nth-child(5)::before{content:"Pago"}#purchaseBody td:nth-child(6)::before{content:"IVA"}#purchaseBody td:nth-child(7)::before{content:"Total"}#purchaseBody td:nth-child(8)::before{content:"Acciones"}
  #productionBody td:nth-child(1)::before{content:"N.º"}#productionBody td:nth-child(2)::before{content:"Fecha"}#productionBody td:nth-child(3)::before{content:"Preparación"}#productionBody td:nth-child(4)::before{content:"Salida"}#productionBody td:nth-child(5)::before{content:"Merma"}#productionBody td:nth-child(6)::before{content:"Costo"}#productionBody td:nth-child(7)::before{content:"Responsable"}#productionBody td:nth-child(8)::before{content:"Estado"}#productionBody td:nth-child(9)::before{content:"Acciones"}
  #countBody td:nth-child(1)::before{content:"N.º"}#countBody td:nth-child(2)::before{content:"Fecha"}#countBody td:nth-child(3)::before{content:"Nombre"}#countBody td:nth-child(4)::before{content:"Alcance"}#countBody td:nth-child(5)::before{content:"Estado"}#countBody td:nth-child(6)::before{content:"Acciones"}
  #wasteBody td:nth-child(1)::before{content:"N.º"}#wasteBody td:nth-child(2)::before{content:"Fecha"}#wasteBody td:nth-child(3)::before{content:"Producto"}#wasteBody td:nth-child(4)::before{content:"Cantidad"}#wasteBody td:nth-child(5)::before{content:"Motivo"}#wasteBody td:nth-child(6)::before{content:"Valor"}#wasteBody td:nth-child(7)::before{content:"Responsable"}
  #inventoryAlertsBody td:nth-child(1)::before{content:"Producto"}#inventoryAlertsBody td:nth-child(2)::before{content:"Política"}#inventoryAlertsBody td:nth-child(3)::before{content:"Existencia"}#inventoryAlertsBody td:nth-child(4)::before{content:"Mínimo"}#inventoryAlertsBody td:nth-child(5)::before{content:"Unidad"}#inventoryAlertsBody td:nth-child(6)::before{content:"Valor"}
}

/* Terminal de venta ultracompacta para operación rápida en tablet. */
#pos .pos-grid{grid-template-columns:minmax(0,1fr) 360px;gap:12px;align-items:start}
#pos .product-catalog{min-width:0}
#pos .section-title{align-items:center;margin-bottom:10px}
#pos .section-title h2{font-size:22px}
#pos .section-title input{max-width:250px;min-height:38px;margin:0;padding:8px 11px}
#pos .product-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
#pos .product-card{
  appearance:none;
  min-width:0;
  min-height:144px;
  padding:10px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  color:inherit;
  text-align:left;
  border-radius:14px;
}
#pos .product-card:active{transform:scale(.985)}
#pos .product-card-top{width:100%;gap:5px}
#pos .product-icon{width:32px;height:32px;border-radius:10px;font-size:17px}
#pos .stock-pill{max-width:76px;padding:4px 6px;font-size:9px;overflow:hidden;text-overflow:ellipsis}
#pos .stock-pill b{font-size:10px}
#pos .product-card-body{display:block;width:100%;margin:7px 0 5px}
#pos .product-category{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;letter-spacing:.55px}
#pos .product-card-body strong{
  min-height:30px;
  margin-top:3px;
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  font-size:12px;
  line-height:1.22;
}
#pos .product-card .price{display:block;margin:4px 0 0;font-size:17px;line-height:1}
#pos .product-add{
  display:block;
  width:100%;
  padding:6px 7px;
  border-radius:9px;
  background:#edf2ff;
  color:var(--blue);
  font-size:10px;
  font-weight:850;
  text-align:center;
}
#pos .product-card:hover .product-add{background:var(--blue);color:#fff}

#pos .cart-panel{
  display:flex;
  flex-direction:column;
  height:calc(100dvh - 176px);
  max-height:none;
  padding:12px;
  overflow:hidden;
  border-radius:16px;
}
#pos .cart-heading{flex:none;align-items:center;padding-bottom:7px;border-bottom:1px solid var(--line)}
#pos .cart-heading h2{font-size:19px;line-height:1.1}
#pos .cart-heading .eyebrow{font-size:9px}
#pos .cart-heading .badge{padding:5px 7px;font-size:10px}
#pos .cart-items{flex:1;min-height:76px;max-height:none;margin:5px 0;overflow:auto;overscroll-behavior:contain}
#pos .cart-items:has(.cart-empty){flex:0 0 auto;min-height:0}
#pos .cart-empty{padding:12px 8px;grid-template-columns:34px 1fr;justify-items:start;text-align:left}
#pos .cart-empty>span{grid-row:1/3;width:34px;height:34px;border-radius:10px;font-size:16px}
#pos .cart-empty strong{font-size:13px}
#pos .cart-empty small{font-size:10px}
#pos .cart-row{grid-template-columns:minmax(0,1fr) auto 54px;gap:6px;min-height:44px;padding:5px 1px}
#pos .cart-item-main{min-width:0}
#pos .cart-item-main strong,#pos .cart-item-main small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#pos .cart-item-main strong{color:var(--navy);font-size:11px}
#pos .cart-item-main small{margin-top:2px;color:var(--muted);font-size:9px}
#pos .qty-controls{gap:3px}
#pos .qty-controls button{width:27px;height:27px;min-height:27px;padding:0;border-radius:8px;font-size:16px}
#pos .qty-controls b{min-width:15px;font-size:11px;text-align:center}
#pos .line-total{font-size:11px;text-align:right}
#pos .cart-controls{flex:none;border-top:1px solid var(--line);padding-top:6px}
#pos .customer-picker{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:6px;padding:0;border:0}
#pos .customer-picker label{min-width:0;margin:0;font-size:10px}
#pos .customer-picker input{min-height:34px;margin-top:3px;padding:7px 8px;font-size:11px}
#pos .customer-add{min-height:34px;padding:6px 9px;font-size:10px}
#pos .search-results{top:51px}
#pos .cart-summary{display:grid;grid-template-columns:82px minmax(0,1fr);gap:4px 10px;margin-top:7px;padding-top:6px;border-top:1px solid var(--line)}
#pos .discount-field{grid-row:1/3;margin:0;font-size:10px}
#pos .discount-field select{min-height:34px;margin-top:3px;padding:6px 8px;font-size:11px}
#pos .cart-subtotals{align-self:center}
#pos .cart-subtotals>div{display:flex;justify-content:space-between;gap:8px;margin:1px 0;color:var(--muted);font-size:10px}
#pos .cart-subtotals strong{color:var(--navy)}
#pos .cart-summary .grand{display:flex;justify-content:space-between;align-items:center;grid-column:2;margin:1px 0;color:var(--navy);font-size:17px;font-weight:850}
#pos .cart-summary .grand strong{font-size:20px}
#pos .payment-buttons{gap:5px;margin:6px 0 3px}
#pos .payment{min-height:34px;padding:6px;font-size:10px}
#pos .payment-hint{margin:0 0 5px;font-size:9px;line-height:1.2}
#pos .cart-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
#pos .cart-actions button{min-height:38px;padding:7px 10px;font-size:11px}
#pos #completeSale{font-size:12px}
#pos #saleMessage{min-height:13px;margin:4px 0 0;font-size:10px;line-height:1.2}

.cash-history-section{margin-top:20px}
.history-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
.history-heading h3{margin:3px 0 0;color:var(--navy)}
.history-heading>.muted{font-size:12px}
.ticket-search{min-width:230px!important;flex:1.4!important}
.tickets-table table{min-width:1040px}
.print-status-stack{display:grid;gap:4px;justify-items:start}
.ticket-actions{display:flex;gap:5px;align-items:center}
.ticket-actions button{min-width:58px}

@media(min-width:1400px){
  #pos .product-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
}

@media(min-width:701px) and (max-width:1100px){
  #pos .pos-grid{grid-template-columns:minmax(0,1fr) 270px;gap:8px}
  #pos .product-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  #pos .product-card{min-height:132px;padding:8px}
  #pos .product-card-body strong{font-size:11px}
  #pos .product-card .price{font-size:16px}
  #pos .cart-panel{top:66px;height:calc(100dvh - 73px);padding:10px}
}

@media(min-width:601px) and (max-width:700px){
  #pos .pos-grid{grid-template-columns:minmax(0,1fr) 246px;gap:7px}
  #pos .product-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  #pos .product-card{min-height:130px;padding:8px}
  #pos .cart-panel{top:64px;height:calc(100dvh - 70px);padding:9px}
  #pos .cart-summary{grid-template-columns:74px minmax(0,1fr);gap:4px 7px}
}

@media(max-width:600px){
  #pos .pos-grid{grid-template-columns:1fr;gap:7px}
  #pos .section-title{flex-direction:row}
  #pos .section-title h2{font-size:19px}
  #pos .section-title input{max-width:52%;min-height:36px}
  #pos .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #pos .product-card{min-height:132px;padding:9px}
  #pos .cart-panel{display:block;height:auto;max-height:none;overflow-y:auto}
  #pos .cart-items{max-height:none}
  #pos .cart-items:has(.cart-empty){min-height:0}
  #pos .cart-row{grid-template-columns:minmax(0,1fr) auto 54px}
  #pos .cart-controls{border-top:1px solid var(--line)}
  .history-heading{align-items:flex-start;flex-direction:column;gap:3px}
  .ticket-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  .ticket-actions button{min-width:0}
  #salesBody td:nth-child(7)::before{content:"Impresión"}
  #salesBody td:nth-child(8)::before{content:"Acciones"}
}

/* Diseñador visual de documentos ESC/POS */
.receipt-designer-section{padding-bottom:4px}
.receipt-designer{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;align-items:start;margin-top:14px}
.receipt-controls{min-width:0}
.receipt-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 12px}
.receipt-fields label{margin:5px 0}
.receipt-fields input,.receipt-fields select{min-height:39px;margin-top:4px}
.receipt-options-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 9px;padding-top:14px;border-top:1px solid var(--line)}
.receipt-options-heading strong,.receipt-options-heading small{display:block}
.receipt-options-heading strong{color:var(--navy)}
.receipt-options-heading small{margin-top:3px;color:var(--muted);font-size:12px}
.receipt-options-heading>span{padding:5px 8px;border-radius:999px;background:var(--sky);color:var(--blue);font-size:10px;font-weight:850;letter-spacing:.6px;text-transform:uppercase}
.receipt-option-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.receipt-option{display:flex;align-items:center;gap:9px;min-height:58px;margin:0;padding:9px 10px;border:1px solid var(--line);border-radius:12px;background:#fbfdff;cursor:pointer;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.receipt-option:hover{border-color:#aac9e4;background:#f6fbff}
.receipt-option:has(input:checked){border-color:#81b4e5;background:#eef7ff;box-shadow:inset 0 0 0 1px #d4eaff}
.receipt-option input{width:18px;height:18px;flex:none;margin:0;accent-color:var(--blue)}
.receipt-option span{min-width:0}
.receipt-option strong,.receipt-option small{display:block}
.receipt-option strong{color:var(--navy);font-size:11px;line-height:1.2}
.receipt-option small{margin-top:3px;color:var(--muted);font-size:9px;line-height:1.2}
.comanda-options{margin-top:14px;padding:0 14px 14px;border:1px solid #d9e4f6;border-radius:14px;background:linear-gradient(145deg,#f9fbff,#f2f6ff)}
.comanda-options .receipt-options-heading{margin-top:0;border-top:0}
.compact-options{grid-template-columns:repeat(3,minmax(0,1fr))}
.compact-options .receipt-option{min-height:46px}
.receipt-save-row{display:flex;align-items:center;gap:12px;margin-top:14px}
.receipt-save-row .form-message{flex:1;margin:0}
.receipt-preview-panel{position:sticky;top:76px;overflow:hidden;border:1px solid #cfddec;border-radius:17px;background:#e8eef5;box-shadow:0 12px 28px #123b6818}
.receipt-preview-header{display:flex;justify-content:space-between;align-items:center;gap:9px;padding:11px 12px;background:#fff;border-bottom:1px solid var(--line)}
.receipt-preview-header strong,.receipt-preview-header small{display:block}
.receipt-preview-header strong{color:var(--navy);font-size:13px}
.receipt-preview-header small{margin-top:2px;color:var(--muted);font-size:9px}
.receipt-preview-tabs{display:flex;padding:3px;border-radius:10px;background:#edf3f8}
.receipt-preview-tabs button{padding:6px 9px;border-radius:8px;background:transparent;color:var(--muted);font-size:10px}
.receipt-preview-tabs button.active{background:#fff;color:var(--navy);box-shadow:0 2px 8px #17324d16}
.receipt-paper-wrap{max-height:590px;overflow:auto;padding:18px}
.receipt-paper{width:100%;min-height:460px;padding:24px 18px 34px;background:#fff;color:#131313;box-shadow:0 6px 19px #17324d26;font-family:"Courier New",ui-monospace,monospace;font-size:10px;line-height:1.35}
.receipt-paper-line{min-height:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.receipt-paper-line.center{text-align:center}
.receipt-paper-line.right{text-align:right}
.receipt-paper-line.bold{font-weight:900}
.receipt-paper-line.large{font-size:14px;line-height:1.2}
.receipt-preview-note{display:block;padding:0 14px 12px;color:#61758a;font-size:9px;text-align:center}

@media(max-width:1050px){
  .receipt-designer{grid-template-columns:1fr}
  .receipt-preview-panel{position:static}
  .receipt-paper-wrap{max-height:520px}
  .receipt-paper{width:min(390px,100%);margin:auto}
}

@media(max-width:760px){
  .receipt-option-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .compact-options{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:520px){
  .receipt-fields{grid-template-columns:1fr}
  .receipt-fields .wide{grid-column:auto}
  .receipt-option-grid,.compact-options{grid-template-columns:1fr}
  .receipt-save-row{align-items:stretch;flex-direction:column}
  .receipt-save-row button{width:100%}
  .receipt-preview-header{align-items:flex-start;flex-direction:column}
  .receipt-paper-wrap{padding:10px}
  .receipt-paper{min-height:390px;padding:18px 12px 28px;font-size:9px}
}

.deployment-badge{display:inline-flex;align-items:center;min-height:24px;padding:4px 9px;border:1px solid #ffd66b;border-radius:999px;background:#fff4c7;color:#6e4b00;font-size:10px;font-weight:900;letter-spacing:.7px;white-space:nowrap}
.user-card.inactive{opacity:.68;background:#f3f5f7}
.user-card .compact{flex:none}
@media(max-width:700px){.deployment-badge{display:none!important}.user-card{flex-wrap:wrap}.user-card .compact{margin-left:54px}}

/* Configuración dividida en secciones rápidas y enlazables. */
.settings-tabs{
  position:sticky;
  top:64px;
  z-index:18;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin:-3px 0 14px;
  padding:6px;
  border:1px solid #d6e3ee;
  border-radius:16px;
  background:#f4f8fcf2;
  box-shadow:0 8px 22px #17324d12;
  backdrop-filter:blur(12px);
}
.settings-tab{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:12px;
  background:transparent;
  color:var(--muted);
  text-align:left;
}
.settings-tab:hover{background:#fff;color:var(--navy)}
.settings-tab.active{
  border-color:#c7daf0;
  background:linear-gradient(135deg,#fff,#edf4ff);
  color:var(--navy);
  box-shadow:0 5px 15px #203d7014;
}
.settings-tab-icon{
  display:grid;
  place-items:center;
  flex:none;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#e7eef9;
  color:var(--blue);
  font-size:17px;
  font-weight:900;
}
.settings-tab.active .settings-tab-icon{background:var(--blue);color:#fff}
.settings-tab strong,.settings-tab small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.settings-tab strong{font-size:13px}
.settings-tab small{margin-top:2px;font-size:10px;font-weight:600;color:var(--muted)}
.output-mode-badge{
  display:inline-flex!important;
  width:max-content;
  margin-top:7px!important;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px!important;
  font-style:normal;
  font-weight:850!important;
  line-height:1;
}
.output-mode-badge.enabled{background:#e5f7ed;color:#137a50}
.output-mode-badge.disabled{background:#edf1f5;color:#61758a}

@media(max-width:1100px){
  .settings-tabs{top:calc(64px + env(safe-area-inset-top,0px));margin-bottom:10px}
}

@media(max-width:600px){
  .settings-tabs{top:calc(61px + env(safe-area-inset-top,0px));gap:4px;padding:4px;border-radius:13px}
  .settings-tab{justify-content:center;gap:6px;padding:7px 5px;text-align:center}
  .settings-tab-icon{width:29px;height:29px;border-radius:9px;font-size:14px}
  .settings-tab strong{font-size:11px}
  .settings-tab small{display:none}
}

/* Cobro táctil: evita abrir el teclado virtual dentro de la APK. */
#paymentDialog{width:min(1080px,calc(100vw - 20px));height:min(500px,calc(100dvh - 12px));max-width:none;max-height:none;overflow:hidden}
#paymentDialog form{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(500px,1.45fr);grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"header header" "summary input" "message actions";gap:10px 14px;height:100%;max-height:none;padding:14px 16px;overflow:hidden}
.payment-dialog-header{grid-area:header;display:flex;align-items:center;gap:11px;min-width:0}
.payment-dialog-header .dialog-icon{width:38px;height:38px;border-radius:11px;font-size:19px}
#paymentDialog .payment-dialog-header h2{margin:0;font-size:22px;line-height:1.05}
.payment-dialog-header p{margin:3px 0 0;font-size:12px;line-height:1.2}
#paymentDialog .payment-summary{grid-area:summary;display:flex;flex-direction:column;min-width:0;min-height:0;margin:0;padding:10px 12px;overflow:hidden}
#paymentDialog .summary-lines{min-height:0}
#paymentDialog .summary-lines>div{display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:27px;padding:4px 0;border-bottom:1px solid #e6f0f6;font-size:13px}
#paymentDialog .summary-item-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#paymentDialog .summary-item-name>span,#paymentDialog .summary-item-name>small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#paymentDialog .summary-item-name>small,.summary-item-options{margin-top:1px;color:var(--blue);font-size:9px}
.summary-item-options{display:block}
#paymentDialog .summary-item-name b{color:var(--navy)}
#paymentDialog .summary-lines .summary-more{color:var(--blue);font-size:11px;font-weight:800}
#paymentDialog .summary-totals{padding-top:4px}
#paymentDialog .summary-total{display:flex;justify-content:space-between;gap:10px;padding:4px 0;border:0;font-size:13px}
#paymentDialog .summary-total.grand{margin-top:3px;padding-top:7px;border-top:1px solid #dbe8f1;font-size:21px;font-weight:850}
#paymentDialog .payment-customer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:7px 0 0;padding-top:7px;border-top:1px solid #e6f0f6;font-size:11px}
#paymentDialog .payment-customer span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#paymentDialog .payment-customer strong{flex:none;padding:4px 7px;border-radius:8px;background:#e8efff;color:var(--blue);font-size:10px}
.payment-input-grid{grid-area:input;display:grid;grid-template-columns:minmax(330px,1.35fr) minmax(210px,.85fr);align-items:stretch;align-self:center;gap:8px 10px;min-width:0;width:100%;margin:0}
.payment-keypad-panel{min-width:0}
.payment-keypad-panel>label{margin:0 0 5px}
.touch-amount{display:grid;grid-template-columns:auto minmax(0,1fr) 40px;align-items:center;overflow:hidden;margin-top:4px;border:2px solid #a8bfea;border-radius:12px;background:#f9fbff;box-shadow:0 4px 12px #315fcf12}
.touch-currency{padding-left:11px;color:var(--blue);font-size:20px;font-weight:900}
.touch-amount input{height:43px;margin:0;padding:5px 5px;border:0;background:transparent;box-shadow:none!important;color:var(--navy);font-size:22px;font-weight:850}
.keypad-clear{height:35px;margin-right:4px;padding:0;border-radius:8px;background:#fbeaec;color:var(--danger)}
.payment-keypad{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.payment-keypad button{min-height:42px;padding:4px;border:1px solid #d7e1ec;border-radius:9px;background:#f4f7fb;color:var(--navy);box-shadow:0 2px 5px #17324d0b;font-size:15px;font-weight:850;touch-action:manipulation}
.payment-keypad button:active{background:#dfe9fb;transform:scale(.97)}
.payment-keypad button[data-keypad="exact"]{background:#e8efff;color:var(--blue);font-size:11px}
.payment-keypad button[data-keypad="backspace"]{color:var(--danger)}
.cash-feedback{display:flex;flex-direction:column;gap:6px;min-width:0}
.cash-feedback .payment-change{flex:1;min-height:0;margin:0;padding:11px 13px}
.cash-feedback .change-amount{font-size:28px}
.quick-cash{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.quick-cash button{min-height:38px;padding:4px;background:#e9f0f8;color:var(--navy)}
.payment-input-grid>#transferRefField,.payment-input-grid>#transferProofField{grid-column:1/-1}
#paymentDialog #paymentMessage{grid-area:message;align-self:end;display:flex;align-items:center;min-height:40px;max-height:40px;margin:0;overflow:hidden;line-height:1.2}
#paymentDialog .dialog-actions{grid-area:actions;align-self:end;justify-self:end;margin:0}
#paymentDialog .dialog-actions button{min-height:40px;padding:8px 14px}
#paymentDialog #confirmPaymentBtn{min-width:230px}

@media(min-width:701px) and (max-height:720px){
  #paymentDialog{height:min(430px,calc(100dvh - 8px))}
  #paymentDialog form{gap:7px 12px;padding:10px 12px}
  .payment-dialog-header .dialog-icon{width:34px;height:34px;font-size:17px}
  #paymentDialog .payment-dialog-header h2{font-size:20px}
  .payment-dialog-header p{font-size:11px}
  #paymentDialog .payment-summary{padding:8px 10px}
  #paymentDialog .summary-lines>div{min-height:24px;padding:3px 0;font-size:12px}
  #paymentDialog .summary-total{padding:3px 0;font-size:12px}
  #paymentDialog .summary-total.grand{padding-top:5px;font-size:19px}
  #paymentDialog .payment-customer{margin-top:5px;padding-top:5px}
  .touch-amount input{height:40px;font-size:21px}
  .keypad-clear{height:32px}
  .payment-keypad button{min-height:39px}
  .quick-cash button{min-height:35px}
  #paymentDialog #paymentMessage{min-height:36px;max-height:36px}
  #paymentDialog .dialog-actions button{min-height:36px;padding:6px 12px}
}

/* Herramientas administrativas de inventario y recetas. */
.page-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}
#inventory .table-wrap table{min-width:1120px}
.inventory-actions{display:flex;flex-wrap:wrap;gap:5px;min-width:188px}
.inventory-actions button{padding:7px 8px;font-size:10px}
.stock-pill.untracked{background:#edf1f5;color:#62768a}
.product-control-toggle{margin:6px 0;padding:10px 12px;border:1px solid var(--line);border-radius:13px;background:#f8fbfd}
.recipe-dialog{width:min(720px,94vw)}
.recipe-builder{display:grid;grid-template-columns:minmax(0,1fr) 150px auto;align-items:end;gap:9px;margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:14px;background:#f7faff}
.recipe-builder label{margin:0}
.recipe-builder button{min-height:41px}
.recipe-items{display:grid;gap:7px;max-height:290px;overflow:auto}
.recipe-item{display:grid;grid-template-columns:minmax(0,1fr) auto 34px;align-items:center;gap:10px;padding:10px 11px;border:1px solid var(--line);border-radius:12px;background:#fff}
.recipe-item strong,.recipe-item small{display:block}
.recipe-item strong{color:var(--navy)}
.recipe-item small{margin-top:3px;color:var(--muted)}
.recipe-quantity{padding:5px 8px;border-radius:9px;background:#edf3ff;color:var(--blue);font-size:11px;font-weight:850}
.recipe-item button{width:32px;height:32px;padding:0}
.recipe-empty{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border:1px dashed #cbd9e5;border-radius:12px;color:var(--muted)}
.recipe-empty strong{color:var(--navy)}
.recipe-help{display:flex;gap:8px;margin-top:12px;padding:10px 12px;border-radius:11px;background:#edf7ff;color:#49677f;font-size:11px;line-height:1.35}
.recipe-help strong{flex:none;color:var(--blue)}

@media(max-width:700px){
  #paymentDialog{width:calc(100vw - 12px);height:min(880px,calc(100dvh - 8px))}
  #paymentDialog form{grid-template-columns:1fr;grid-template-rows:auto auto minmax(0,1fr) auto auto;grid-template-areas:"header" "summary" "input" "message" "actions";gap:6px;padding:12px}
  #paymentDialog .payment-summary{padding:8px 10px}
  #paymentDialog .summary-lines>div{min-height:24px;padding:3px 0;font-size:12px}
  #paymentDialog .summary-total{padding:3px 0;font-size:12px}
  #paymentDialog .summary-total.grand{padding-top:5px;font-size:19px}
  #paymentDialog .payment-customer{margin-top:4px;padding-top:4px}
  .payment-input-grid{grid-template-columns:1fr;align-self:start;gap:6px}
  .cash-feedback{display:grid;grid-template-columns:1fr auto}
  .cash-feedback .payment-change{min-height:68px}
  .quick-cash{grid-template-columns:1fr}
  .quick-cash button{min-height:25px;padding:3px 8px}
  #paymentDialog #paymentMessage{min-height:28px;max-height:28px;font-size:11px}
  #paymentDialog .dialog-actions{justify-self:stretch}
  #paymentDialog .dialog-actions button{flex:1}
  #paymentDialog #confirmPaymentBtn{min-width:0}
  .recipe-builder{grid-template-columns:1fr 115px}
  .recipe-builder button{grid-column:1/-1}
}

@media(max-width:520px){
  .page-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .page-actions button{padding:9px 7px;font-size:11px}
  #paymentDialog form{padding:10px}
  .payment-dialog-header .dialog-icon{width:32px;height:32px;font-size:16px}
  #paymentDialog .payment-dialog-header h2{font-size:19px}
  .payment-dialog-header p{font-size:10px}
  .touch-amount input{height:43px;font-size:22px}
  .payment-keypad button{min-height:39px}
  .cash-feedback .payment-change{min-height:64px}
  .cash-feedback{grid-template-columns:1fr}
  .quick-cash{grid-template-columns:repeat(3,1fr)}
  #paymentDialog .dialog-actions{margin:0}
  .recipe-builder{grid-template-columns:1fr}
  .recipe-builder button{grid-column:auto}
  .recipe-item{grid-template-columns:minmax(0,1fr) 34px}
  .recipe-quantity{grid-column:1}
  .recipe-item button{grid-column:2;grid-row:1/3}
  .recipe-help{flex-direction:column}
}

@media(max-width:700px) and (max-height:760px){
  .payment-dialog-header p{display:none}
  #paymentDialog .payment-summary{padding:6px 9px}
  #paymentDialog .summary-lines>div{min-height:21px;padding:2px 0}
  #paymentDialog .summary-totals{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
  #paymentDialog .summary-total.grand{grid-column:1/-1}
  .touch-amount input{height:38px;font-size:20px}
  .keypad-clear{height:30px}
  .payment-keypad button{min-height:34px}
  .cash-feedback .payment-change{min-height:56px;padding:7px 10px}
  .cash-feedback .change-amount{font-size:23px}
  .quick-cash button{min-height:24px}
  #paymentDialog #paymentMessage{min-height:24px;max-height:24px}
  #paymentDialog .dialog-actions button{min-height:34px;padding:5px 8px;font-size:11px}
}

/* Operación administrativa: compras, producción, mermas y conteos. */
textarea{width:100%;margin-top:5px;padding:10px 11px;resize:vertical;border:1px solid #cbd8e4;border-radius:9px;background:#fff;color:var(--navy);font:inherit;outline:none}
textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px #216fd11c}
.setup-badge{width:max-content;margin:12px auto 4px;padding:5px 9px;border-radius:999px;background:#e8f7ef;color:#11734a;font-size:10px;font-weight:900;letter-spacing:1px}
.operations-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.operations-toolbar .filter-bar{flex:1;margin:0}
.operations-toolbar .section-note{max-width:760px;margin:0;line-height:1.45}
.operations-metrics{grid-template-columns:repeat(2,minmax(150px,240px))}
.operations-dialog{width:min(1120px,calc(100vw - 24px));max-height:calc(100dvh - 18px);overflow:auto}
.operations-dialog form{padding:19px}
.purchase-header-fields label{margin:5px 0}
.line-builder{display:grid;grid-template-columns:minmax(150px,1.5fr) 90px 100px 125px 110px 95px 80px auto;align-items:end;gap:7px;margin:14px 0;padding:11px;border:1px solid #d9e4ee;border-radius:14px;background:#f6f9fc}
.line-builder label{min-width:0;margin:0;font-size:10px}
.line-builder input,.line-builder select{min-height:37px;margin-top:3px;padding:7px 8px;font-size:11px}
.line-builder button{min-height:37px;padding:7px 10px;white-space:nowrap}
.document-lines{display:grid;gap:6px;max-height:230px;overflow:auto}
.document-line{display:grid;grid-template-columns:minmax(0,1fr) auto 32px;align-items:center;gap:9px;padding:8px 10px;border:1px solid var(--line);border-radius:11px;background:#fff}
.document-line strong,.document-line small{display:block}
.document-line span>strong{overflow:hidden;color:var(--navy);text-overflow:ellipsis;white-space:nowrap}
.document-line small{margin-top:2px;color:var(--muted);font-size:10px}
.document-line button{width:30px;height:30px;min-height:30px;padding:0}
.document-total{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:11px;background:#edf3ff;color:var(--navy);font-size:14px;font-weight:850}
.control-export{justify-content:flex-end;margin-top:10px}
.alert-summary{display:flex;align-items:center;gap:11px;margin-bottom:10px;padding:12px 14px;border:1px solid #cfe0ef;border-radius:14px;background:linear-gradient(135deg,#f8fbff,#edf5ff)}
.alert-summary>span{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:11px;background:#fff;color:var(--blue);font-weight:900;box-shadow:0 4px 12px #264d7a12}
.alert-summary strong,.alert-summary small{display:block}
.alert-summary strong{color:var(--navy);font-size:13px}
.alert-summary small{margin-top:3px;color:var(--muted);font-size:11px}
.count-capture-dialog{width:min(1040px,calc(100vw - 20px))}
.count-capture-items{display:grid;gap:6px;max-height:calc(100dvh - 245px);overflow:auto}
.count-capture-row{display:grid;grid-template-columns:minmax(180px,1fr) 120px 120px minmax(170px,.8fr);align-items:end;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:11px;background:#f9fbfd}
.count-capture-row>span{align-self:center;min-width:0}
.count-capture-row strong,.count-capture-row small{display:block}
.count-capture-row strong{overflow:hidden;color:var(--navy);text-overflow:ellipsis;white-space:nowrap}
.count-capture-row small{margin-top:3px;color:var(--muted);font-size:10px}
.count-capture-row label{margin:0;font-size:10px}
.count-capture-row input{min-height:36px;margin-top:3px;padding:7px 8px;font-size:11px}
.production-ingredients-heading{display:flex;justify-content:space-between;gap:10px;margin:13px 0 7px;padding-top:11px;border-top:1px solid var(--line)}
.production-ingredients-heading strong{color:var(--navy);font-size:13px}
.production-ingredients-heading small{color:var(--muted);font-size:10px}
.production-ingredients{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:235px;overflow:auto}
.production-ingredient{display:grid;grid-template-columns:minmax(0,1fr) 90px;align-items:center;gap:7px;margin:0;padding:7px 8px;border:1px solid var(--line);border-radius:10px;background:#f9fbfd}
.production-ingredient strong,.production-ingredient small{display:block}
.production-ingredient strong{overflow:hidden;color:var(--navy);font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.production-ingredient small{margin-top:2px;color:var(--muted);font-size:9px}
.production-ingredient input{min-height:33px;margin:0;padding:6px 7px;font-size:10px}
.product-options-dialog{width:min(480px,calc(100vw - 20px))}
.product-option-groups{display:grid;gap:10px;margin-top:15px}
.product-option-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0;padding:10px;border:1px solid var(--line);border-radius:13px}
.product-option-group legend{padding:0 6px;color:var(--navy);font-size:12px;font-weight:850}
.product-option-choice{display:flex;align-items:center;gap:8px;margin:0;padding:9px;border:1px solid #dbe5ef;border-radius:10px;background:#f8fafc;cursor:pointer}
.product-option-choice:has(input:checked){border-color:#8caae9;background:#edf3ff;box-shadow:inset 0 0 0 1px #cad8f7}
.product-option-choice input{width:18px;height:18px;min-height:0;margin:0;accent-color:var(--blue)}
.product-option-choice span{min-width:0}
.product-option-choice strong,.product-option-choice small{display:block}
.product-option-choice strong{color:var(--navy);font-size:12px}
.product-option-choice small{margin-top:2px;color:var(--muted);font-size:10px}
#pos .cart-item-main em{display:block;overflow:hidden;margin-top:1px;color:#315fc7;font-size:8px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}
.order-type-buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-top:6px;padding:3px;border-radius:10px;background:#edf2f7}
.order-type-buttons button{min-height:29px;padding:4px 7px;border-radius:8px;background:transparent;color:var(--muted);font-size:9px}
.order-type-buttons button.active{background:#fff;color:var(--blue);box-shadow:0 2px 7px #17324d12}
.mixed-payment-fields{grid-column:1/-1;padding:9px 10px;border:1px solid #cfdcf1;border-radius:12px;background:#f6f8ff}
.mixed-payment-fields>strong{display:block;color:var(--navy);font-size:12px}
.mixed-payment-fields .form-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.mixed-payment-fields label{margin:4px 0 0;font-size:9px}
.mixed-payment-fields input{min-height:34px;margin-top:2px;padding:6px 7px;font-size:11px}
.mixed-payment-fields .field-hint.success{color:#11734a}
.mixed-payment-fields .field-hint.error{color:var(--danger)}

@media(min-width:701px) and (max-width:1100px){
  .operations-toolbar{margin-bottom:8px}
  .operations-toolbar .filter-bar{padding:8px 9px}
  .operations-toolbar .filter-bar label{font-size:10px}
  .operations-toolbar .filter-bar input,.operations-toolbar .filter-bar select{min-height:35px;padding:6px 8px;font-size:11px}
  .operations-toolbar .filter-bar button{min-height:35px;padding:6px 10px;font-size:11px}
  .operations-metrics{margin-bottom:8px}
  .operations-metrics .metric{min-height:72px;padding:11px}
  .operations-metrics .metric strong{font-size:18px}
  .view:not(#pos) .table-wrap{margin:9px 0}
  .view:not(#pos) th,.view:not(#pos) td{padding:8px 9px;font-size:11px}
  .line-builder{grid-template-columns:repeat(4,minmax(0,1fr))}
  .line-builder button{grid-column:4}
  .count-capture-row{grid-template-columns:minmax(160px,1fr) 100px 100px minmax(150px,.8fr)}
}

@media(max-width:700px){
  .operations-toolbar{align-items:stretch;flex-direction:column}
  .operations-toolbar .export-actions{width:100%}
  .operations-metrics{grid-template-columns:1fr 1fr}
  .line-builder{grid-template-columns:1fr 1fr}
  .line-builder label:first-child{grid-column:1/-1}
  .line-builder button{grid-column:1/-1}
  .count-capture-row{grid-template-columns:1fr 1fr}
  .count-capture-row>span,.count-capture-row>input{grid-column:1/-1}
  .mixed-payment-fields .form-grid{grid-template-columns:1fr 1fr}
  .production-ingredients{grid-template-columns:1fr 1fr}
}

@media(max-width:520px){
  .product-option-group{grid-template-columns:1fr}
  .operations-metrics{grid-template-columns:1fr 1fr}
  .document-line{grid-template-columns:minmax(0,1fr) 32px}
  .document-line>strong{grid-column:1}
  .document-line>button{grid-column:2;grid-row:1/3}
  .count-capture-row{grid-template-columns:1fr}
  .count-capture-row>*{grid-column:1!important}
  .production-ingredients{grid-template-columns:1fr}
}

/* Un solo módulo de inventario con navegación compacta tipo aplicación. */
.inventory-module-tabs{width:100%;margin:0 0 12px;padding:4px}
.inventory-module-tabs .section-tab{flex:1;min-width:max-content;min-height:38px;padding:7px 10px}
#inventory [data-inventory-panel]{min-width:0}
#inventory [data-inventory-panel]>.table-wrap:first-child{margin-top:0}
@media(max-width:1100px){
  .inventory-module-tabs{position:sticky;top:calc(60px + env(safe-area-inset-top,0px));z-index:14;margin-bottom:8px;background:#f2f8fcf2;box-shadow:0 5px 15px #17335f0d;backdrop-filter:blur(10px)}
  .inventory-module-tabs .section-tab{min-height:34px;padding:5px 8px;font-size:11px}
  #inventory .alert-summary{margin-bottom:7px;padding:9px 11px}
}
@media(max-width:600px){
  .inventory-module-tabs{top:calc(58px + env(safe-area-inset-top,0px))}
  .inventory-module-tabs .section-tab{flex:0 0 auto}
}
