/* Draxen mobile shell; desktop layout is preserved at tablet and desktop widths. */
#mobile-topbar,#mobile-bottom-nav,#mobile-more-overlay{display:none}
.mobile-quick-actions,.mobile-page-heading,.mobile-client-tools,.mobile-client-filters,#mobile-client-list,.mobile-role-picker{display:none}
@media(max-width:767px), (max-width:1023px) and (max-height:500px){
/* Customer directory cards and dashboard shortcuts. */
#view-clientes>.bg-white{padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
.mobile-page-heading{margin:2px 2px 14px}.mobile-page-heading h2{color:#111c3b;font-size:27px;font-weight:900;line-height:1.08}.mobile-page-heading p{margin-top:5px;color:#71809a;font-size:13px}
.mobile-client-tools{display:flex;flex-direction:column;gap:9px;margin-bottom:11px}.mobile-client-search{width:100%;height:47px;padding:0 14px;border:1px solid #e1e7f0;border-radius:15px;outline:none;background:white;font-size:13px}.mobile-client-add{min-height:45px;border:0;border-radius:14px;background:#1764e8;color:white;font-weight:800}
.mobile-client-filters{display:flex;gap:7px;overflow-x:auto;padding:1px 0 12px;scrollbar-width:none}.mobile-client-filters button{flex:0 0 auto;padding:9px 13px;border:1px solid #e5eaf1;border-radius:22px;background:white;color:#59677e;font-size:11px;font-weight:800}.mobile-client-filters button.active{border-color:#1764e8;background:#edf3ff;color:#1764e8}
#mobile-client-list{display:grid;gap:9px}.mobile-client-card{overflow:hidden;border:1px solid #e9eef5;border-radius:17px;background:white;box-shadow:0 3px 12px #1b304e0a}.mobile-client-summary{width:100%;display:grid;grid-template-columns:42px minmax(0,1fr) auto 13px;align-items:center;gap:8px;padding:12px 10px;border:0;background:transparent;color:#111c3b;text-align:left}
.mobile-client-avatar{width:41px;height:41px;display:grid;place-items:center;border-radius:50%;background:#eaf1ff;color:#1764e8;font-size:13px;font-weight:900}.mobile-client-main{min-width:0;display:flex;flex-direction:column;gap:4px}.mobile-client-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.mobile-client-main small{color:#71809a;font-size:10px}.mobile-client-balance{text-align:right}.mobile-client-balance strong{display:block;font-size:12px}.mobile-client-balance small{display:inline-block;margin-top:4px;padding:3px 8px;border-radius:15px;background:#fff4d5;color:#b66a00;font-size:9px;font-weight:900}.mobile-client-balance small.clear{background:#e4f9ef;color:#11885c}
.mobile-client-detail{display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:0 11px 11px 60px}.mobile-client-card.expanded .mobile-client-detail{display:grid}.mobile-client-metric{padding-top:7px;border-top:1px solid #edf0f5}.mobile-client-metric small{display:block;color:#71809a;font-size:9px}.mobile-client-metric strong{display:block;margin-top:3px;font-size:12px}.mobile-client-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:7px}.mobile-client-actions button{min-height:39px;border:1px solid #d5e3fb;border-radius:12px;background:#f4f8ff;color:#175ac2;font-size:11px;font-weight:800}.mobile-client-actions button.primary{border-color:#1764e8;background:#1764e8;color:white}
.mobile-quick-actions{padding:15px;border:1px solid #e8edf4;border-radius:17px;background:white;box-shadow:0 3px 12px #1b304e09}.mobile-quick-actions h3{margin-bottom:10px;font-size:15px;font-weight:900;color:#111c3b}.mobile-quick-actions>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mobile-quick-actions button{min-height:68px;display:flex;align-items:center;gap:9px;padding:10px;border:0;border-radius:13px;background:#eef4ff;color:#175ac2;text-align:left;font-size:11px;font-weight:800}.mobile-quick-actions button i{font-size:19px}
.mobile-role-picker{padding:10px 0 14px}.mobile-role-picker>p{margin-bottom:8px;font-size:12px;font-weight:900}.mobile-role-picker small{display:block;margin-top:4px;color:#71809a;font-size:10px;font-weight:500}.mobile-role-picker>div{display:flex;gap:6px;overflow-x:auto}.mobile-role-picker button{flex:0 0 auto;padding:8px 11px;border:1px solid #dce5f2;border-radius:20px;background:#f7f9fc;color:#263657;font-size:10px;font-weight:800}.mobile-role-picker button:hover{border-color:#1764e8;color:#1764e8}
:root{--m-blue:#1764e8;--m-ink:#111c3b;--m-muted:#71809a;--m-page:#f4f7fb}
html,body{width:100%;height:100%;min-height:100%;overflow:hidden}
body{position:relative;display:block!important;background:var(--m-page);color:var(--m-ink)}
#sidebar,#sidebar-overlay,#desktop-header{display:none!important}
body>main{position:fixed;inset:0;width:100%;height:100dvh!important;min-width:0;background:var(--m-page)}
#mobile-topbar{position:fixed;z-index:60;inset:0 0 auto;height:calc(66px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 14px 0;display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.97);border-bottom:1px solid #e7edf5;box-shadow:0 3px 15px #1830530a}
.mobile-brand{min-width:0;flex:1;display:flex;align-items:center;gap:9px;border:0;background:transparent;color:var(--m-ink);text-align:left}
.mobile-brand-mark{width:38px;height:38px;border-radius:12px;background:#e8f0ff;color:var(--m-blue);display:grid;place-items:center;font-size:19px}
.mobile-brand-copy{display:flex;flex-direction:column;min-width:0;line-height:1.08}.mobile-brand-copy strong{font-size:17px;font-weight:900;letter-spacing:-.04em;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-brand-copy small{margin-top:4px;color:var(--m-muted);font-size:10px;font-weight:700;white-space:nowrap}
.mobile-status{display:flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid #d9f1e4;border-radius:22px;background:#f1fbf5;color:#139360;text-align:left}.mobile-status>i{font-size:17px}.mobile-status span{display:flex;flex-direction:column;line-height:1.05}.mobile-status strong{font-size:10px;font-weight:900}.mobile-status small{margin-top:3px;color:#688078;font-size:9px;white-space:nowrap}
.mobile-profile{flex:0 0 38px;height:38px;border:0;border-radius:50%;background:#172340;color:white;font-size:16px}
body>main>.flex-1.overflow-auto{position:absolute;inset:calc(66px + env(safe-area-inset-top)) 0 calc(68px + env(safe-area-inset-bottom));height:auto;padding:14px 14px 24px!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}
.view-section.active{min-height:100%;height:auto!important}.view-section>.max-w-7xl,.view-section>.max-w-\[1600px\]{width:100%;max-width:none}
#mobile-bottom-nav{position:fixed;z-index:65;inset:auto 0 0;height:calc(66px + env(safe-area-inset-bottom));padding:5px 7px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;background:rgba(255,255,255,.98);border-top:1px solid #e7edf5;box-shadow:0 -5px 20px #1428460f}
#mobile-bottom-nav button{min-width:0;height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;border-radius:17px;color:#69758a;background:transparent;font-weight:700}#mobile-bottom-nav button i{font-size:19px}#mobile-bottom-nav button span{font-size:10px}#mobile-bottom-nav button.active{background:#eaf1ff;color:var(--m-blue)}
#mobile-more-overlay{position:fixed;z-index:80;inset:0;display:none;align-items:flex-end;background:#0f1b5261;backdrop-filter:blur(3px)}#mobile-more-overlay.open{display:flex}
.mobile-more-sheet{width:100%;max-height:76dvh;overflow:auto;padding:10px 18px calc(22px + env(safe-area-inset-bottom));border-radius:25px 25px 0 0;background:white;box-shadow:0 -12px 36px #101f3c33}.mobile-sheet-handle{width:38px;height:4px;margin:0 auto 17px;border-radius:9px;background:#d8deea}.mobile-more-sheet h2{margin:0 0 12px;font-size:19px;font-weight:900}.mobile-more-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.mobile-more-links button{min-height:64px;display:flex;align-items:center;gap:10px;padding:11px;border:1px solid #e9eef5;border-radius:16px;background:#fbfcfe;color:#233150;text-align:left;font-size:12px;font-weight:800}.mobile-more-links button i{width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;border-radius:12px;background:#edf3ff;color:var(--m-blue)}
}
@media(min-width:768px) and (max-width:1023px){#sidebar{width:220px}#sidebar nav button{font-size:12px}}

@media(max-width:767px), (max-width:1023px) and (max-height:500px){
/* Home: compact two-column metrics and quick actions. */
#view-dashboard>.max-w-7xl{gap:14px}#view-dashboard h2{font-size:24px;line-height:1.1}#view-dashboard>.max-w-7xl>:first-child p{margin-top:5px;font-size:12px}#view-dashboard>.max-w-7xl>:first-child button{display:none}
#view-dashboard .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#view-dashboard .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4>div{min-height:100px;padding:13px;border-left-width:3px;border-radius:16px}
#view-dashboard .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 p{font-size:9px;letter-spacing:.03em}#view-dashboard .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 h3{margin-top:5px;font-size:clamp(19px,6vw,27px);overflow-wrap:anywhere}
#view-dashboard .grid.grid-cols-1.lg\:grid-cols-3{grid-template-columns:1fr;gap:10px}#view-dashboard .grid.grid-cols-1.lg\:grid-cols-3>div{padding:15px;border-radius:17px}#view-dashboard .grid.grid-cols-1.lg\:grid-cols-3>div:first-child{order:2}#view-dashboard .grid.grid-cols-1.lg\:grid-cols-3>div:last-child{order:1}
/* POS cards and checkout remain connected to the existing cart actions. */
#view-ventas{height:100%!important;min-height:0!important}#view-ventas>div{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:9px;height:100%!important;min-height:0;overflow:hidden}#view-ventas>div>div:first-child{min-height:0;overflow:hidden}#view-ventas>div>div:first-child>div:first-child{position:relative;top:auto;padding:10px;border-radius:14px}#view-ventas>div>div:first-child>div:nth-child(2){min-height:0;overflow-y:auto;padding-bottom:8px}#pos-search{font-size:14px}
#pos-products-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#pos-products-grid>div{height:198px;border-radius:14px}#pos-products-grid>div>div:first-child{height:96px}#pos-products-grid>div>div:last-child{padding:9px}#pos-products-grid h4{font-size:11px}#pos-products-grid .text-xl{font-size:15px}
#cart-panel{width:100%!important;height:auto!important;min-height:0;max-height:36dvh;position:relative;bottom:auto;z-index:5;overflow-y:auto;border-radius:16px 16px 0 0;box-shadow:0 -7px 22px #172b4924}#cart-panel>div:first-child{padding:8px 12px;border-radius:16px 16px 0 0}#cart-items{max-height:64px;min-height:0}#cart-panel>div:last-child{padding:8px 11px calc(8px + env(safe-area-inset-bottom))}#cart-panel #cart-total{font-size:23px}#btn-checkout{padding:9px;font-size:14px}
/* Inventory table becomes a scannable card list. */
#view-inventario>div{padding:13px!important;border-radius:16px}#view-inventario table{min-width:0!important}#view-inventario thead{display:none}#view-inventario tbody{display:grid;gap:8px}#view-inventario tbody tr{display:grid;grid-template-columns:1fr 1fr;padding:9px;border:1px solid #e8edf4;border-radius:14px;background:white}#view-inventario tbody td{display:block;padding:4px!important;text-align:left!important;border:0;font-size:11px}#view-inventario tbody td:first-child{grid-column:1/-1;display:flex}#view-inventario tbody td:last-child{grid-column:1/-1;text-align:right!important}#view-inventario tbody td:nth-child(2)::before{content:'Ubicación · ';color:#8894a8}#view-inventario tbody td:nth-child(3)::before{content:'Costo · ';color:#8894a8}#view-inventario tbody td:nth-child(4)::before{content:'Venta · ';color:#8894a8}#view-inventario tbody td:nth-child(5)::before{content:'Stock · ';color:#8894a8}#view-inventario tbody td:nth-child(6){display:none}
#view-caja>.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#view-caja .text-4xl{font-size:24px}#view-caja .rounded-2xl{padding:13px}#view-facturacion>div,#view-remisiones>div,#view-creditos>div,#view-separe>div,#view-configuracion>div{padding:12px!important}.overflow-x-auto{-webkit-overflow-scrolling:touch}
#toast-container{right:12px;bottom:calc(76px + env(safe-area-inset-bottom));left:12px;align-items:stretch}#toast-container .toast{max-width:none;padding:10px 13px}
.fixed.inset-0.z-50,.fixed.inset-0.z-\[55\],.fixed.inset-0.z-\[56\],.fixed.inset-0.z-\[60\]{z-index:100!important;align-items:flex-end!important;justify-content:center!important;padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain}
.fixed.inset-0.z-50>div,.fixed.inset-0.z-\[55\]>div,.fixed.inset-0.z-\[56\]>div,.fixed.inset-0.z-\[60\]>div{width:100%;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);overflow-y:auto;overscroll-behavior:contain;border-radius:22px 22px 14px 14px}
.fixed.inset-0.z-50>div>.p-6,.fixed.inset-0.z-\[55\]>div>.p-6,.fixed.inset-0.z-\[56\]>div>.p-6{padding:16px!important}
#modal-plan-separe input,#modal-separe-payment input{font-size:20px}
.mobile-role-picker{display:block}#view-clientes>.bg-white>.flex.flex-col{display:none}#view-clientes .overflow-x-auto{display:none}.mobile-page-heading{display:block}.mobile-client-tools{display:flex}.mobile-client-filters{display:flex}#mobile-client-list{display:grid}.mobile-quick-actions{display:block}
}

@media(min-width:769px){#view-clientes .mobile-client-tools{display:flex;gap:12px;margin:14px 0}#view-clientes .mobile-client-search{min-width:260px;max-width:480px;padding:10px;border:1px solid #dce4ef;border-radius:10px}#view-clientes .mobile-client-add{display:none}#view-clientes .mobile-client-filters{display:flex;gap:8px;margin-bottom:12px}#view-clientes .mobile-client-filters button{padding:8px 14px;border:1px solid #dce4ef;border-radius:20px}#view-clientes .mobile-client-filters button.active{background:#e5f7f6;color:#008b8b}}
