:root{--green:#16a34a;--green-dark:#087c39;--leaf:#63bb37;--brown:#a57342;--bg:#f4f8f5;--text:#1f2a24;--muted:#6b7280;--card:#fff;--line:#dcebe1;--sidebar-w:222px;}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:linear-gradient(180deg,#edf9f1 0,#f7fbf7 100%);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--text);font-size:14px}a{text-decoration:none}.app-shell{height:100vh;display:flex;overflow:hidden}.sidebar{width:var(--sidebar-w);background:linear-gradient(180deg,#ffffff 0,#f3fbf5 100%);border-right:1px solid var(--line);position:fixed;top:0;bottom:0;left:0;overflow-y:auto;padding:10px 10px 12px}.brand{display:block;text-align:center;padding:4px 4px 8px}.brand img{max-width:172px;max-height:46px;object-fit:contain}.empresa-box{background:linear-gradient(135deg,#ecfdf5,#fff);border:1px solid var(--line);border-radius:14px;padding:9px 10px;margin-bottom:8px;font-size:12px}.empresa-box strong{font-size:13px;line-height:1.15}.empresa-box .badge{font-size:10px;padding:4px 7px}.nav-title{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:10px 8px 4px}.nav-link{display:flex;gap:8px;align-items:center;color:#334155;border-radius:10px;padding:7px 9px;margin:1px 0;font-weight:700;font-size:13px;line-height:1.15}.nav-link i{width:17px;text-align:center;color:var(--green);font-size:13px}.nav-link:hover,.nav-link.active{background:linear-gradient(135deg,var(--green),var(--leaf));color:#fff;box-shadow:0 7px 18px rgba(22,163,74,.16)}.nav-link:hover i,.nav-link.active i{color:#fff}.main{margin-left:var(--sidebar-w);width:calc(100% - var(--sidebar-w));height:100vh;overflow:hidden}.topbar{height:62px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:9px 18px;position:sticky;top:0;z-index:10;backdrop-filter:blur(12px)}.topbar h1{font-size:19px;margin:0;font-weight:900;letter-spacing:-.02em}.topbar .text-muted{font-size:12px}.content{height:calc(100vh - 62px);overflow:auto;padding:12px}.card-soft{background:rgba(255,255,255,.95);border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(23,52,34,.055)}.stat-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:15px;box-shadow:0 8px 24px rgba(23,52,34,.055);height:100%}.stat-card .icon{height:38px;width:38px;border-radius:12px;display:grid;place-items:center;background:#ecfdf5;color:var(--green);font-size:17px}.stat-card .value{font-size:22px;font-weight:900;margin-top:8px}.btn{border-radius:11px;font-weight:800}.btn:hover{transform:translateY(-1px)}.btn-primary{background:var(--green);border-color:var(--green)}.btn-primary:hover{background:var(--green-dark);border-color:var(--green-dark)}.btn-outline-primary{border-color:var(--green);color:var(--green)}.btn-outline-primary:hover{background:var(--green);border-color:var(--green)}.table{vertical-align:middle}.table>:not(caption)>*>*{padding:.48rem .55rem}.badge-stock{font-variant-numeric:tabular-nums}.form-label{margin-bottom:.22rem;font-weight:800;font-size:12px;color:#24472d}.form-control,.form-select{border-radius:10px;border-color:#cfe2d4;padding:.45rem .62rem;font-size:13px}.input-group-text{border-radius:10px;border-color:#cfe2d4;padding:.45rem .62rem}.form-control:focus,.form-select:focus{border-color:var(--green);box-shadow:0 0 0 .16rem rgba(22,163,74,.13)}.product-row{border:1px solid var(--line);border-radius:12px;padding:8px;margin-bottom:7px;background:#fff}.search-result{cursor:pointer}.search-result:hover{background:#ecfdf5}.invoice-total{font-size:29px;font-weight:950;color:var(--green-dark);line-height:1}.pill{display:inline-flex;gap:6px;align-items:center;padding:4px 8px;border-radius:999px;background:#ecfdf5;color:var(--green-dark);font-weight:800;font-size:11px}.print-area{background:#fff;border-radius:12px;padding:20px}.empty-state{border:1px dashed #cbd5e1;border-radius:14px;padding:18px;text-align:center;color:#64748b;background:#fff}.content-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.content-toolbar .btn{border-radius:11px;font-weight:800}.data-card{padding:14px}.table thead th{background:#f0fbf3;color:#214b2e;border-bottom:1px solid var(--line);font-weight:900;font-size:12px}.table-hover tbody tr:hover{background:#f8fff9}.action-buttons{display:flex;justify-content:flex-end;gap:5px}.modal-content{border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 60px rgba(8,124,57,.18);overflow:hidden}.modal-header{background:linear-gradient(135deg,#ecfdf5,#fffaf1);border-bottom:1px solid var(--line);padding:14px 18px}.modal-body{padding:17px}.modal-footer{background:#fbfffb;border-top:1px solid var(--line);padding:12px 18px}.modal .form-label{font-weight:800;color:#254e31}.modal .form-control,.modal .form-select{border-radius:11px;border-color:#cfe2d4}.modal .select2-container--default .select2-selection--single{height:38px;border:1px solid #cfe2d4;border-radius:11px;padding:.18rem .35rem}.select2-container--default .select2-selection--single .select2-selection__arrow{height:36px}.select2-dropdown{border-color:#cfe2d4}.dataTables_wrapper .dt-search input,.dataTables_wrapper .dt-length select{border-radius:10px;border:1px solid #cfe2d4;padding:.35rem .55rem}.dataTables_wrapper .dt-info,.dataTables_wrapper .dt-length,.dataTables_wrapper .dt-search,.dataTables_wrapper .dt-paging{font-size:12px}.page-wrapper-title{display:flex;align-items:center;gap:8px}.status-badge{min-width:66px}.btn-icon{width:30px;height:30px;border-radius:9px;display:inline-grid;place-items:center;padding:0}.btn-soft-success{background:#ecfdf5;border:1px solid #bbebc7;color:#087c39}.btn-soft-warning{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412}.btn-soft-danger{background:#fff1f2;border:1px solid #fecdd3;color:#be123c}.btn-soft-success:hover,.btn-soft-warning:hover,.btn-soft-danger:hover{transform:translateY(-1px);filter:brightness(.98)}.gap-after-button{margin-top:14px}.category-chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;background:#ecfdf5;border:1px solid #caead2;color:#087c39;padding:3px 8px;font-weight:800;font-size:11px}.product-toolbar-spacer{height:5px}
/* Facturación compacta: una sola pantalla desktop */
.billing-page{height:calc(100vh - 86px);display:flex;flex-direction:column;gap:8px;overflow:hidden}.billing-card{border-radius:14px;padding:10px}.billing-card h5,.billing-card h6{margin:0 0 7px;font-size:14px;font-weight:900}.billing-grid-top{flex:0 0 auto}.billing-workspace{flex:1 1 auto;min-height:0}.billing-workspace>.row{height:100%}.billing-panel{height:100%;display:flex;flex-direction:column;min-height:0}.billing-items-scroll{flex:1 1 auto;min-height:0;overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff}.billing-items-scroll .table{margin-bottom:0}.billing-summary-card{height:100%;display:flex;flex-direction:column;gap:8px}.billing-total-box{background:linear-gradient(135deg,#ecfdf5,#fff);border:1px solid #cdebd2;border-radius:14px;padding:12px;text-align:center}.billing-total-box small{font-weight:800;color:#53715b}.billing-total-box .invoice-total{font-size:34px}.billing-actions{margin-top:auto;display:grid;gap:7px}.billing-results{position:absolute;left:0;right:0;top:100%;z-index:50;max-height:210px;overflow:auto;border-radius:12px;box-shadow:0 15px 34px rgba(23,52,34,.16)}.product-search-wrap{position:relative}.compact-muted{font-size:11px;color:var(--muted)}.input-xs{padding:.33rem .5rem;font-size:12.5px}.btn-compact{padding:.42rem .65rem;font-size:13px;border-radius:10px}.welcome-actions{display:flex;align-items:center;justify-content:center;gap:28px;flex-wrap:wrap;margin-top:18px}.welcome-actions .btn{min-width:170px}
@media(max-width:1120px){.app-shell{height:auto;min-height:100vh;overflow:visible}.main{height:auto;overflow:visible}.content{height:auto;overflow:visible}.billing-page{height:auto;overflow:visible}.billing-summary-card,.billing-panel{height:auto}.billing-items-scroll{max-height:360px}.sidebar{position:relative;width:100%;height:auto}.app-shell{display:block}.main{margin-left:0;width:100%}.topbar{height:auto;gap:10px;align-items:flex-start;flex-direction:column}.content{padding:10px}.content-toolbar{align-items:stretch;flex-direction:column}.action-buttons{justify-content:flex-start}.data-card{padding:12px}}

/* Ventanas tipo tienda.zip: toolbar, datatable, modal y acciones */
.window-card{padding:12px;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:0 8px 24px rgba(23,52,34,.055)}
#toolbar{margin-bottom:10px}.toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.toolbar-title{font-weight:900;color:#214b2e}.toolbar-title small{display:block;color:var(--muted);font-weight:600;font-size:11px}.table-window{width:100%!important}.table-window thead th{white-space:nowrap}.modal-md2{max-width:1040px}.modal-sm2{max-width:620px}.btn-row-actions{display:flex;gap:4px;justify-content:center;flex-wrap:wrap}.icon-preview{min-width:44px;display:grid;place-items:center;background:#ecfdf5;color:#087c39;font-size:16px}.dt-layout-row{margin:4px 0!important}.dt-layout-cell{padding:0!important}.dataTables_wrapper .row{--bs-gutter-y:.35rem}.compact-table .table>:not(caption)>*>*{padding:.34rem .45rem;font-size:12.5px}.modal-body.compact-modal{max-height:calc(100vh - 180px);overflow-y:auto}.modal-footer-left{margin-right:auto}.badge-estado{min-width:72px}.td-nowrap{white-space:nowrap}.membrete-preview{max-width:360px;max-height:42px;overflow:hidden;font-size:11px;color:#475569}.btn-f1 sup{font-size:10px;margin-left:4px}

/* =========================================================
   Base visual tienda.zip para TODAS las pantallas Ñamandu-E
   ========================================================= */
body.tienda-layout{background:#edf5ef;font-size:13px;overflow:hidden}.tienda-layout #main-wrapper{min-height:100vh;width:100%;overflow:hidden}.tienda-layout .topbar{position:fixed;top:0;right:0;left:0;height:55px;z-index:1000;background:linear-gradient(90deg,var(--green-dark),var(--green));border-bottom:0;box-shadow:0 4px 14px rgba(0,0,0,.12);padding:0 10px;color:#fff}.tienda-layout .topbar .navbar{height:55px;padding:0}.tienda-layout .topbar .titulo{font-size:18px;font-weight:900;color:#fff;line-height:1}.tienda-layout .titulo-establecimiento{font-size:12px;font-weight:600;opacity:.9}.tienda-layout .topbar .btn{border-radius:8px;padding:.25rem .55rem}.tienda-layout .left-sidebar{position:fixed;top:55px;left:0;bottom:0;width:220px;background:#fff;border-right:1px solid #dbeadf;box-shadow:3px 0 18px rgba(20,70,36,.06);z-index:999;overflow:hidden;transition:.2s}.tienda-layout .nav-text-box{height:62px;padding:6px 10px;border-bottom:1px solid #e0ece3;background:#fff}.tienda-layout .brand-tienda{display:block;width:100%}.tienda-layout .brand-tienda img{width:100%;height:48px;object-fit:contain;background:#fff;border-radius:8px}.tienda-layout .empresa-mini{margin:8px 10px 6px;padding:8px 9px;border:1px solid #d7eade;border-radius:10px;background:linear-gradient(135deg,#ecfdf5,#fff);line-height:1.1}.tienda-layout .empresa-mini small{display:block;font-size:10px;color:#6b7280;text-transform:uppercase;font-weight:800}.tienda-layout .empresa-mini strong{display:block;font-size:12px;color:#183c25;margin-top:2px}.tienda-layout .empresa-mini span{display:inline-block;font-size:10px;margin-top:5px;padding:3px 7px;border-radius:999px;background:#dff7e6;color:#087c39;font-weight:900}.tienda-layout .scroll-sidebar{height:calc(100vh - 55px - 62px - 68px);overflow-y:auto;padding:3px 8px 10px}.tienda-layout #sidebarnav{list-style:none;margin:0;padding:0}.tienda-layout #sidebarnav li{margin:1px 0}.tienda-layout #sidebarnav a{display:flex;align-items:center;gap:9px;color:#23382b;border-radius:8px;padding:7px 9px;font-size:12.5px;font-weight:800;text-decoration:none;line-height:1.12}.tienda-layout #sidebarnav a i{width:17px;text-align:center;color:var(--green);font-size:13px}.tienda-layout #sidebarnav a:hover,.tienda-layout #sidebarnav a.active{background:linear-gradient(135deg,var(--green),var(--leaf));color:#fff;box-shadow:0 5px 14px rgba(22,163,74,.16)}.tienda-layout #sidebarnav a:hover i,.tienda-layout #sidebarnav a.active i{color:#fff}.tienda-layout .nav-small-cap{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:900;margin:9px 9px 3px}.tienda-layout .page-wrapper{margin-left:220px;padding-top:55px;height:100vh;overflow:hidden;background:#edf5ef}.tienda-layout .container-fluid.compact-container{height:calc(100vh - 55px);overflow:auto;padding:10px 12px}.tienda-layout .window-card,.tienda-layout .card-soft{border-radius:10px!important;border:1px solid #d9e9de!important;box-shadow:0 5px 15px rgba(20,70,36,.05)!important}.tienda-layout #toolbar{margin-bottom:7px}.tienda-layout .toolbar-row{min-height:36px}.tienda-layout .toolbar-title{font-size:14px}.tienda-layout .toolbar-title small{font-size:10px}.tienda-layout .btn{border-radius:8px}.tienda-layout .btn-sm{padding:.2rem .38rem;font-size:11px}.tienda-layout .form-control,.tienda-layout .form-select{border-radius:7px;padding:.32rem .48rem;font-size:12.5px}.tienda-layout .form-label{font-size:11px;margin-bottom:2px}.tienda-layout .table>:not(caption)>*>*{padding:.28rem .38rem;font-size:12px}.tienda-layout .table thead th{font-size:11px;padding:.34rem .4rem}.tienda-layout .modal-content{border-radius:10px}.tienda-layout .modal-header{padding:9px 13px;background:linear-gradient(135deg,var(--green),var(--green-dark));color:#fff}.tienda-layout .modal-header .btn-close{filter:invert(1);opacity:.9}.tienda-layout .modal-body{padding:12px}.tienda-layout .modal-footer{padding:9px 12px}.tienda-layout .preloader{position:fixed;inset:0;background:rgba(255,255,255,.96);z-index:99999;display:flex;align-items:center;justify-content:center}.tienda-layout .loader{text-align:center;color:var(--green-dark);font-weight:900}.tienda-layout .loader__figure{width:34px;height:34px;border-radius:50%;border:4px solid #d5f0dd;border-top-color:var(--green);animation:spin .8s linear infinite;margin:0 auto 8px}@keyframes spin{to{transform:rotate(360deg)}}.tienda-layout .loader__label{font-size:12px;margin:0}.tienda-layout .dataTables_wrapper .dt-search input,.tienda-layout .dataTables_wrapper .dt-length select{height:31px;border-radius:7px}.tienda-layout .dataTables_wrapper .dt-info,.tienda-layout .dataTables_wrapper .dt-length,.tienda-layout .dataTables_wrapper .dt-search,.tienda-layout .dataTables_wrapper .dt-paging{font-size:11px}.tienda-layout .dt-layout-row{margin:2px 0!important}.tienda-layout .btn-row-actions{gap:3px}.tienda-layout .btn-row-actions .btn{width:28px;height:27px;display:inline-grid;place-items:center;padding:0}.tienda-layout .billing-page{height:calc(100vh - 78px);gap:6px}.tienda-layout .billing-card{padding:8px}.tienda-layout .billing-card h5,.tienda-layout .billing-card h6{font-size:13px;margin-bottom:5px}.tienda-layout .billing-total-box{padding:9px}.tienda-layout .billing-total-box .invoice-total{font-size:29px}.tienda-layout .invoice-total{font-size:26px}.tienda-layout .content-toolbar{margin-bottom:8px}.tienda-layout .stat-card{padding:10px;border-radius:10px}.tienda-layout .stat-card .value{font-size:19px}.tienda-layout .stat-card .icon{height:31px;width:31px;border-radius:9px;font-size:14px}
@media(max-width:900px){body.tienda-layout{overflow:auto}.tienda-layout .left-sidebar{transform:translateX(-105%)}.tienda-layout.show-sidebar .left-sidebar{transform:translateX(0)}.tienda-layout .page-wrapper{margin-left:0;height:auto;min-height:100vh;overflow:visible}.tienda-layout .container-fluid.compact-container{height:auto;overflow:visible}.tienda-layout .topbar .titulo{font-size:15px}.tienda-layout .titulo-establecimiento{display:none}.tienda-layout .billing-page{height:auto}.tienda-layout .left-sidebar{top:55px}}

/* Fix preloader: nunca debe tapar el sistema si un JS externo tarda o falla */
.tienda-layout .preloader.preloader-hide{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility .2s ease}
.tienda-layout .empresa-mini em{display:block;font-size:10px;color:#4b5563;font-style:normal;margin-top:4px;font-weight:700}.tienda-layout .empresa-mini .btn-support{background:#fff;border:1px solid #bbebc7;color:#087c39;font-size:10.5px;padding:.22rem .35rem}.tienda-layout .empresa-mini .btn-support:hover{background:#ecfdf5;color:#065f2c}.compact-muted.ok{color:#087c39;font-weight:800}.compact-muted.bad{color:#b91c1c;font-weight:800}

/* Ajuste solicitado: sacar bloque de plan del lateral y mostrarlo arriba */
.tienda-layout .topbar-user-box{gap:7px!important;white-space:nowrap;min-width:0}.tienda-layout .topbar-plan-badge{display:inline-flex;align-items:center;gap:3px;background:rgba(255,255,255,.96);color:#0f3d24;border:1px solid rgba(255,255,255,.55);border-radius:999px;padding:5px 10px;font-size:11px;font-weight:900;box-shadow:0 3px 10px rgba(0,0,0,.08)}.tienda-layout .btn-support-top{background:#ffffff;color:#087c39;border:1px solid rgba(255,255,255,.72);font-weight:900}.tienda-layout .btn-support-top:hover{background:#ecfdf5;color:#065f2c}.tienda-layout .scroll-sidebar{height:calc(100vh - 55px - 62px);overflow-y:hidden!important;padding:4px 7px 8px}.tienda-layout #sidebarnav a{padding:6px 8px;font-size:12px;gap:8px}.tienda-layout #sidebarnav a i{font-size:12px;width:16px}.tienda-layout .nav-small-cap{font-size:8.5px;margin:7px 8px 2px}.tienda-layout #sidebarnav li{margin:0}
@media(max-height:680px){.tienda-layout .scroll-sidebar{overflow-y:auto!important}.tienda-layout #sidebarnav a{padding:5px 7px;font-size:11.4px}.tienda-layout .nav-small-cap{margin:5px 7px 1px}}
@media(max-width:1180px){.tienda-layout .topbar-plan-badge{font-size:10.5px;padding:4px 8px}.tienda-layout .topbar-plan-badge .mx-1{margin-left:.18rem!important;margin-right:.18rem!important}}


.product-dropzone{border:2px dashed #9ad7ad;background:#f5fff7;border-radius:14px;padding:16px;text-align:center;cursor:pointer;transition:.18s ease;min-height:108px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;color:#2f6b3e}
.product-dropzone:hover,.product-dropzone.dragover{background:#eaffef;border-color:#16a34a;transform:translateY(-1px)}
.product-dropzone i{font-size:28px;color:#16a34a}.product-dropzone small{color:#64748b}
.product-photos-grid{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.product-photo-item{width:86px;height:86px;border-radius:12px;overflow:hidden;position:relative;background:#eef2f7;border:1px solid #dbe3ef}.product-photo-item img{width:100%;height:100%;object-fit:cover}.product-photo-item button{position:absolute;right:4px;top:4px;border:0;border-radius:50%;width:24px;height:24px;background:#dc3545;color:#fff;line-height:22px;font-size:12px}.ruc-status{min-width:118px;justify-content:center;font-size:11px}.ruc-status.ok{color:#0a7a2f;background:#ecfff2}.ruc-status.bad{color:#b42318;background:#fff1f1}.money-input{text-align:right}.input-money-table{min-width:110px}.billing-actions{margin-top:12px}.table-photo-thumb{width:38px;height:38px;border-radius:8px;object-fit:cover;border:1px solid #e2e8f0;background:#f8fafc}
