:root{--blue:#0b1c72;--accent:#2f6df6;--bg:#f3f7ff;--card:#fff;--line:#e3ebfb;--text:#0d1730;--muted:#68758e;--green:#16a34a;--red:#ef4444;--yellow:#f59e0b;--shadow:0 14px 35px rgba(32,54,96,.10)}*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}.app{display:flex;min-height:100vh}.sidebar{width:290px;background:#fff;border-right:1px solid var(--line);padding:22px 18px;position:fixed;top:0;bottom:0;overflow:auto}.brand{display:flex;gap:12px;align-items:center;margin-bottom:24px}.logo{width:52px;height:52px;border-radius:16px;background:#eaf1ff;display:grid;place-items:center;font-size:26px}.brand h1{font-size:22px;margin:0}.brand p{margin:4px 0 0;color:var(--muted)}.nav-title{font-size:12px;letter-spacing:.08em;color:#536181;font-weight:800;margin:22px 12px 10px}.nav-btn,.nav-link{width:100%;border:0;background:transparent;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:13px 14px;border-radius:14px;color:#1c2b4a;font-weight:800;cursor:pointer;text-decoration:none;font-size:15px}.nav-btn:hover,.nav-link:hover,.nav-btn.active{background:#e8f1ff;color:#1457d9}.subnav{display:none;margin:4px 0 6px 14px;border-left:3px solid #e8eef9;padding-left:8px}.subnav.open{display:block}.subnav a{display:block;padding:10px 12px;border-radius:10px;color:#40516d;text-decoration:none;font-weight:700}.subnav a:hover{background:#f2f6ff;color:#1457d9}.main{margin-left:290px;width:calc(100% - 290px)}.topbar{height:82px;background:var(--blue);display:flex;gap:18px;align-items:center;padding:0 32px;position:sticky;top:0;z-index:5;box-shadow:var(--shadow)}.master{position:relative;flex:1;max-width:620px}.master input{width:100%;height:50px;border:0;border-radius:16px;padding:0 18px 0 46px;font-size:16px}.master:before{content:'🔎';position:absolute;left:16px;top:14px}.master-results{position:absolute;top:58px;left:0;right:0;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);overflow:hidden;display:none;max-height:420px;overflow-y:auto}.master-results.show{display:block}.mrow{display:flex;gap:12px;padding:12px 14px;border-bottom:1px solid #eef3ff;cursor:pointer}.mrow:hover{background:#f6f9ff}.mrow img{width:44px;height:44px;object-fit:cover;border-radius:10px}.mrow small{display:block;color:#858fa3;font-size:12px;margin-top:2px}.status{margin-left:auto;background:#e9fff3;color:#07723f;border:2px solid #4ade80;border-radius:999px;padding:12px 18px;font-weight:900}.topbtn{background:#2f6df6;color:#fff;text-decoration:none;border-radius:12px;padding:14px 18px;font-weight:900}.content{padding:32px}.hero{background:linear-gradient(135deg,#fff,#eaf2ff);border:1px solid #d9e5fb;border-radius:28px;padding:34px;margin-bottom:26px}.pill{display:inline-block;background:#dfeaff;color:#1251d5;font-weight:900;padding:10px 16px;border-radius:999px;font-size:13px;letter-spacing:.04em}.hero h2{font-size:38px;margin:18px 0 8px}.muted{color:var(--muted)}.grid{display:grid;gap:22px}.grid2{grid-template-columns:1.2fr .8fr}.grid3{grid-template-columns:repeat(3,1fr)}.card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px;box-shadow:var(--shadow);margin-bottom:22px}.card h3{margin-top:0}.filters{display:grid;grid-template-columns:repeat(6,minmax(130px,1fr));gap:14px;align-items:end}.field label{display:block;color:#64748b;margin-bottom:7px;font-weight:700}.field input,.field select,.field textarea{width:100%;border:1px solid #dae4f5;border-radius:12px;padding:12px 14px;font-size:15px;background:#fff}.btn{border:0;border-radius:12px;padding:13px 16px;font-weight:900;cursor:pointer;background:#2f6df6;color:white}.btn.green{background:#12b981}.btn.red{background:#ef4444}.btn.yellow{background:#f8c98e;color:#382000}.btn.dark{background:#0d1730}.products-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:18px}.bulkbar{display:flex;gap:12px;align-items:center;margin-bottom:18px}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{border-bottom:1px solid #edf2fb;text-align:left;padding:14px 12px;vertical-align:middle}.table th{font-size:13px;color:#64748b;background:#f8fbff}.thumb{width:64px;height:64px;border-radius:12px;object-fit:cover;border:1px solid var(--line)}.product-name{font-weight:800;color:#2463ed;text-decoration:none}.badge{display:inline-block;padding:7px 10px;border-radius:999px;background:#eef5ff;font-weight:800;font-size:12px}.colorchip{display:inline-flex;align-items:center;gap:8px}.swatch{width:22px;height:22px;border-radius:50%;border:1px solid #cfd8e8}.view{display:none}.view.active{display:block}.catalog-tree{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.tree-col{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px}.tree-item{border:1px solid #edf2fb;border-radius:12px;padding:10px;margin:9px 0;background:#f9fbff}.tree-item small{color:#7b879a}.toastbox{position:fixed;right:24px;bottom:22px;display:grid;gap:10px;z-index:20}.toast{padding:16px 18px;border-radius:14px;color:#fff;font-weight:900;box-shadow:var(--shadow)}.toast.success{background:var(--green)}.toast.error{background:var(--red)}.toast.warn{background:var(--yellow);color:#211500}.scan-result{display:grid;grid-template-columns:100px 1fr;gap:18px;align-items:center}.scan-result img{width:100px;height:100px;object-fit:cover;border-radius:14px}.qtyline{display:flex;gap:10px;flex-wrap:wrap}.qred{color:#dc2626}.qyel{color:#ca8a04}.qgreen{color:#16a34a}.edit-layout{display:grid;grid-template-columns:1fr 1.2fr;gap:22px}.image-grid{display:flex;gap:10px;flex-wrap:wrap}.image-grid img{width:90px;height:90px;object-fit:cover;border-radius:12px} @media(max-width:1000px){.sidebar{position:relative;width:100%;height:auto}.app{display:block}.main{margin-left:0;width:100%}.filters,.grid2,.grid3,.catalog-tree,.edit-layout{grid-template-columns:1fr}.topbar{height:auto;flex-wrap:wrap;padding:18px}.content{padding:18px}}
.hidden{display:none!important}.variation-form{border:1px solid var(--line);background:#f8fbff;border-radius:18px;padding:18px;margin-bottom:18px}.prodcell{display:flex;gap:12px;align-items:center}.mini{width:42px;height:42px;border-radius:10px;object-fit:cover;border:1px solid var(--line)}.clickrow{cursor:pointer}.clickrow:hover{background:#f8fbff}.thumb.empty{display:grid;place-items:center;background:#edf4ff}.stat h2{font-size:34px;margin:8px 0 0}.product-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;text-align:center;box-shadow:var(--shadow)}.product-card .pic{height:135px;border-radius:14px;background:#f7faff;display:grid;place-items:center;overflow:hidden;margin-bottom:10px}.product-card img{width:100%;height:100%;object-fit:cover}.product-card b{display:block;min-height:40px}.product-card small{display:block;color:var(--muted);min-height:18px}.btn.small{padding:9px 12px;font-size:13px}.sub{margin-left:14px;background:#fff}.sidebar{z-index:10}.main{min-width:0}.table-wrap{max-width:100%}.field input:focus,.field select:focus,.field textarea:focus,.master input:focus{outline:2px solid #99b9ff;border-color:#99b9ff}@media(max-width:1200px){.filters{grid-template-columns:repeat(3,minmax(130px,1fr))}.grid3{grid-template-columns:repeat(2,1fr)}}
.sep{border:0;border-top:1px solid var(--line);margin:18px 0}.sticky-actions-row{position:sticky;bottom:0;z-index:4;display:flex;gap:12px;justify-content:flex-end}.color-preview{margin:10px 0 0;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#f8fbff}.camera-box{border:1px dashed #bfd0ee;border-radius:18px;background:#f8fbff;min-height:260px;display:grid;place-items:center;overflow:hidden}.camera-box video{width:100%;max-height:360px;object-fit:cover;background:#000}.cartqty{width:74px;border:1px solid var(--line);border-radius:10px;padding:8px}.nav-link.active{background:#e8f1ff;color:#1457d9}.field textarea{resize:vertical}.product-card .colorchip{justify-content:center}.mini.empty{display:grid;place-items:center;background:#edf4ff;border-radius:10px;width:42px;height:42px}.products-head p{margin:4px 0 0}.variation-form .grid{align-items:end}@media(max-width:1350px){.filters{grid-template-columns:repeat(3,minmax(130px,1fr))}}@media(max-width:760px){.grid,.grid2,.grid3,.filters{grid-template-columns:1fr!important}.sticky-actions-row{position:static;display:block}.sticky-actions-row .btn{width:100%;margin-bottom:10px}}

.field.compact{margin:10px 0 6px;text-align:left}.field.compact label{font-size:12px;margin-bottom:4px}.field.compact select{padding:9px 10px;font-size:13px}.product-card .posPrice{font-weight:900;margin:8px 0}.posVariantInfo{min-height:22px}.posVariationSelect{cursor:pointer}

/* POS product modal like Mardieli admin selector */
.pos-open-card{cursor:pointer;transition:.15s transform,.15s box-shadow}.pos-open-card:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(32,54,96,.16)}
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:60;display:grid;place-items:center;padding:24px}.pos-modal{width:min(760px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.28);position:relative;padding:32px}.modal-close{position:absolute;right:18px;top:16px;border:0;background:#fff;color:#64748b;font-size:26px;font-weight:900;cursor:pointer}.pos-modal-main{display:grid;grid-template-columns:220px 1fr;gap:28px;align-items:start}.pos-modal-image{width:220px;height:220px;border-radius:18px;background:#f3f7ff;display:grid;place-items:center;overflow:hidden;border:1px solid var(--line)}.pos-modal-image img{width:100%;height:100%;object-fit:cover}.modal-empty{font-size:58px}.pos-modal-info h2{font-size:24px;line-height:1.15;margin:8px 0 4px;text-transform:uppercase}.modal-price{font-size:22px;font-weight:800;margin:0 0 20px}.pos-modal-info h3{font-size:24px;margin:18px 0 8px}.modal-row{margin:12px 0}.variation-pills{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 16px}.variation-pill{border:1px solid #cbd5e1;background:#eef2f7;color:#0f172a;border-radius:9px;padding:9px 14px;min-width:120px;cursor:pointer;text-align:center;font-weight:800}.variation-pill small{display:block;color:#64748b;font-size:12px;font-weight:700;margin-top:3px}.variation-pill.active{background:#2f6df6;color:#fff;border-color:#2f6df6}.variation-pill.active small{color:#e7efff}.qty-section{display:flex;align-items:center;justify-content:space-between;gap:14px}.qty-control{display:flex;border:1px solid #d9e3f4;border-radius:10px;overflow:hidden;height:44px}.qty-control button{width:48px;border:0;background:#fff;font-size:20px;font-weight:900;cursor:pointer}.qty-control input{width:72px;text-align:center;border:0;border-left:1px solid #d9e3f4;border-right:1px solid #d9e3f4;font-size:16px}.modal-total{font-weight:800;margin:16px 0}.modal-add{width:260px;max-width:100%;font-size:16px}.pos-modal .field{max-width:260px}.pos-modal .colorchip .swatch{border-radius:7px;width:34px;height:24px;border:3px solid #e60012;background-clip:padding-box}.product-card select{display:none!important}@media(max-width:760px){.pos-modal{padding:22px}.pos-modal-main{grid-template-columns:1fr}.pos-modal-image{width:100%;height:260px}.qty-section{display:block}.qty-control{margin-top:8px;width:max-content}}
.image-uploader{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:14px 0 18px}.image-uploader input{background:#f8fbff;border:1px solid #d7e3f8;border-radius:14px;padding:12px;flex:1;min-width:220px}.manage-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}.gallery-item{border:1px solid #dbe6f7;border-radius:18px;background:#f8fbff;padding:10px;box-shadow:0 12px 24px rgba(15,37,80,.08)}.gallery-item img{width:100%;height:130px;object-fit:cover;border-radius:14px;background:#eef4ff}.gallery-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px;font-size:12px;color:#667792}.btn.small{padding:8px 10px;border-radius:10px;font-size:12px}.btn.danger{background:#ef4444;color:#fff;border:0}.btn.danger:hover{filter:brightness(.95)}
.orders-list{display:grid;gap:14px}.order-card{border:1px solid var(--line);border-radius:18px;background:#fff;overflow:hidden;box-shadow:0 10px 24px rgba(32,54,96,.06)}.order-card summary{list-style:none;display:grid;grid-template-columns:1.5fr auto auto auto;gap:18px;align-items:center;padding:18px;cursor:pointer}.order-card summary::-webkit-details-marker{display:none}.order-card[open] summary{border-bottom:1px solid var(--line);background:#f8fbff}.order-card summary small{display:block;color:var(--muted);margin-top:4px}.open-hint{color:#2f6df6;font-weight:900}.order-detail-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;padding:18px}.detail-box{border:1px solid #e6eefc;border-radius:16px;background:#f9fbff;padding:14px}.detail-box h3{margin:0 0 8px}.detail-box p{margin:6px 0}.order-actions{display:grid;grid-template-columns:90px 180px 80px 220px 110px 1fr auto;gap:10px;align-items:center;padding:0 18px 18px}.order-actions select,.order-actions input{border:1px solid #dae4f5;border-radius:10px;padding:10px;background:#fff}.order-card h3{padding:0 18px;margin:14px 0 8px}.order-card .table-wrap{padding:0 18px 14px}.steps-list{padding:0 18px 14px;display:flex;gap:10px;flex-wrap:wrap}.step-chip{border:1px solid var(--line);background:#f8fbff;border-radius:14px;padding:10px 12px;display:grid;gap:3px;min-width:180px}.step-chip small{color:var(--muted)}.redsoft{background:#fee2e2;color:#991b1b}.status-pendiente{background:#eaf2ff}.status-confirmado{background:#dcfce7;color:#166534}.status-procesando{background:#fef3c7;color:#92400e}.status-en_camino{background:#dbeafe;color:#1d4ed8}.status-entregado{background:#dcfce7;color:#166534}.status-devuelto,.status-cancelado{background:#fee2e2;color:#991b1b}@media(max-width:1100px){.order-card summary{grid-template-columns:1fr}.order-detail-grid{grid-template-columns:1fr}.order-actions{grid-template-columns:1fr}}
/* V13 mejoras visuales */
.status-dashboard{grid-column:1/-1;display:grid;grid-template-columns:repeat(7,minmax(130px,1fr));gap:12px;margin-top:8px}.status-card{border:0;border-radius:18px;padding:16px;text-align:left;color:#fff;font-weight:900;box-shadow:var(--shadow);cursor:pointer}.status-card span{display:block;font-size:12px;letter-spacing:.06em}.status-card b{font-size:32px}.status-badge,.status-select{font-weight:900;border-radius:999px}.status-badge{display:inline-block;padding:9px 13px;font-size:12px;color:#fff}.status-select{border:0!important;color:#fff!important}.st-pendiente{background:#f59e0b!important;color:#fff!important}.st-confirmado{background:#2563eb!important;color:#fff!important}.st-procesando{background:#8b5cf6!important;color:#fff!important}.st-en_camino{background:#06b6d4!important;color:#fff!important}.st-entregado{background:#16a34a!important;color:#fff!important}.st-devuelto{background:#ef4444!important;color:#fff!important}.st-cancelado{background:#991b1b!important;color:#fff!important}.doc-actions{padding:0 18px 18px;display:flex;gap:14px;flex-wrap:wrap}.doc-actions>div{border:1px solid var(--line);background:#f8fbff;border-radius:14px;padding:12px;display:flex;gap:10px;align-items:center}.doc-actions select{border:1px solid #dae4f5;border-radius:10px;padding:9px;background:#fff}.movement-list{display:grid;gap:10px}.movement-row{display:grid;grid-template-columns:120px 1fr 150px 180px;gap:12px;align-items:center;border:1px solid var(--line);border-radius:16px;padding:14px;background:#fff;cursor:pointer}.movement-row:hover{background:#f8fbff}.movement-row small{display:block;color:var(--muted);margin-top:3px}.movement-type{background:#eaf2ff;color:#1251d5;border-radius:999px;padding:8px 10px;font-weight:900;text-align:center;font-size:12px}.mini.square,.thumb,.product-card .pic img,.pos-modal-image img,.mrow img,.scan-result img,.image-grid img{object-fit:cover;object-position:center;aspect-ratio:1/1}.product-card .pic{aspect-ratio:1/1;height:auto}.product-card{max-width:230px}.billing-form{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.billing-form .btn{grid-column:1/-1}.order-note{padding:0 18px 18px}.status-dashboard .st-pendiente,.status-dashboard .st-confirmado,.status-dashboard .st-procesando,.status-dashboard .st-en_camino,.status-dashboard .st-entregado,.status-dashboard .st-devuelto,.status-dashboard .st-cancelado{color:#fff!important}@media(max-width:1200px){.status-dashboard{grid-template-columns:repeat(3,1fr)}.movement-row{grid-template-columns:1fr}.billing-form{grid-template-columns:1fr}}@media(max-width:760px){.status-dashboard{grid-template-columns:1fr}.doc-actions>div{width:100%;display:grid}.order-actions{grid-template-columns:1fr!important}}

/* V18 edición directa e interfaz más guiada */
.inline-input{width:120px;max-width:100%;border:1px solid #d7e3f8;border-radius:12px;padding:10px 12px;background:#fff;font-weight:800;color:#0d1730}.inline-input:focus{outline:3px solid #cfe0ff;border-color:#2f6df6}.qty-input{width:95px}.price-input{width:120px}.editable-variation-table tbody tr{background:#fff}.editable-variation-table input{box-shadow:0 6px 14px rgba(47,109,246,.06)}.mini-help{margin:12px 0 0;font-size:13px}.row-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.sidebar .nav-title{letter-spacing:.08em;color:#41516f}.hero{position:relative}.hero:after{content:"";position:absolute;right:28px;top:28px;width:88px;height:88px;border-radius:28px;background:linear-gradient(135deg,#dbeafe,#eef6ff);opacity:.65}.products-head{align-items:center}.variation-form{background:#f8fbff;border:1px solid #dbe6f7;border-radius:18px;padding:18px;margin:14px 0}.card h3{display:flex;align-items:center;gap:8px}.card h3:before{content:"";width:8px;height:24px;border-radius:99px;background:#2f6df6;display:inline-block}.sticky-actions-row .btn{min-width:210px}.table td,.table th{vertical-align:middle}.status{white-space:nowrap}.topbar{gap:16px}.master input{font-weight:700}.field label{font-weight:900}.muted{line-height:1.45}

/* V19 logo empresa y sidebar colapsable */
.brand{cursor:pointer;user-select:none}.brand .logo,.brand-logo{width:58px!important;height:58px!important;border-radius:16px!important;background:#eef6ff!important;display:grid;place-items:center;overflow:hidden;flex:0 0 58px}.brand-logo-img{width:54px;height:54px;object-fit:contain;display:block}.sidebar.collapsed{width:92px}.sidebar.collapsed .brand h1,.sidebar.collapsed .brand p,.sidebar.collapsed .nav-title,.sidebar.collapsed .nav-btn:not(.page-link) span,.sidebar.collapsed .subnav{display:none!important}.sidebar.collapsed .brand{justify-content:center}.sidebar.collapsed + .main{margin-left:92px}.sidebar.collapsed ~ .content{margin-left:92px}.app.sidebar-collapsed .main{margin-left:92px}.app.sidebar-collapsed .sidebar{width:92px}.app.sidebar-collapsed .sidebar .brand h1,.app.sidebar-collapsed .sidebar .brand p,.app.sidebar-collapsed .sidebar .nav-title,.app.sidebar-collapsed .sidebar .subnav{display:none!important}.app.sidebar-collapsed .sidebar .brand{justify-content:center}.app.sidebar-collapsed .sidebar .nav-btn{justify-content:center;font-size:0}.app.sidebar-collapsed .sidebar .nav-btn::first-letter{font-size:18px}.print-logo{width:70px;height:70px;object-fit:contain}.ticket-logo{width:46px;height:46px;object-fit:contain;margin:0 auto 4px;display:block}

/* V20 visual cleanup */
body{overflow-x:hidden}.content{max-width:1480px;margin:0 auto;width:100%;padding:28px 34px 48px}.sidebar{transition:width .18s ease,padding .18s ease}.brand{cursor:pointer;min-height:64px}.brand-logo-img{width:56px;height:56px;object-fit:contain;display:block}.logo{background:#eef5ff;box-shadow:none;overflow:hidden}.app.sidebar-collapsed .sidebar{width:92px;padding:22px 14px;overflow:hidden}.app.sidebar-collapsed .main{margin-left:92px;width:calc(100% - 92px)}.app.sidebar-collapsed .brand{justify-content:center}.app.sidebar-collapsed .brand>div:last-child,.app.sidebar-collapsed .nav-title,.app.sidebar-collapsed .nav-btn span,.app.sidebar-collapsed .subnav{display:none}.app.sidebar-collapsed .nav-btn,.app.sidebar-collapsed .nav-link{justify-content:center;font-size:0}.app.sidebar-collapsed .nav-btn::first-letter{font-size:20px}.topbar{left:0;width:100%;padding:0 36px}.hero{position:relative;overflow:hidden}.hero::after{content:'';position:absolute;right:34px;top:28px;width:76px;height:76px;border-radius:24px;background:rgba(47,109,246,.06)}.card{overflow:hidden}.clean-form{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:16px}.clean-form .btn{grid-column:1/-1;justify-self:start}.billing-form{grid-template-columns:repeat(2,minmax(180px,1fr))}.field label{line-height:1.25}.field input,.field select,.field textarea{min-height:46px;line-height:1.25}.table th,.table td{line-height:1.3}.tree-item{line-height:1.4}.orders-filter{grid-template-columns:minmax(220px,360px) 150px 130px!important}.customer-card{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:start;padding:16px;border:1px solid var(--line);border-radius:16px;background:#f9fbff;margin-bottom:12px}.customer-card b{font-size:16px}.customer-card small{display:block;color:var(--muted);margin-top:4px}.order-card{border:1px solid var(--line);border-radius:18px;background:#fff;margin-bottom:14px;overflow:hidden}.order-card summary{display:grid;grid-template-columns:1fr auto auto auto;gap:16px;align-items:center;padding:18px 20px;cursor:pointer;list-style:none}.order-card summary::-webkit-details-marker{display:none}.order-card summary small{display:block;color:var(--muted);margin-top:4px}.open-hint{font-size:12px;color:#2f6df6;font-weight:900}.order-detail-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;padding:0 20px 18px}.detail-box{border:1px solid var(--line);border-radius:16px;background:#f8fbff;padding:16px;line-height:1.45}.detail-box h3{margin:0 0 10px}.order-actions,.doc-actions{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:0 20px 18px}.order-actions label{font-weight:800;color:#64748b}.status-badge,.status-select{font-weight:900;border-radius:999px;border:0;padding:8px 12px;font-size:12px}.st-pendiente{background:#fff7cc!important;color:#a16207!important}.st-confirmado{background:#dbeafe!important;color:#1d4ed8!important}.st-procesando{background:#ede9fe!important;color:#6d28d9!important}.st-en_camino{background:#cffafe!important;color:#0e7490!important}.st-entregado{background:#dcfce7!important;color:#15803d!important}.st-devuelto{background:#fee2e2!important;color:#b91c1c!important}.st-cancelado{background:#fecaca!important;color:#7f1d1d!important}.redsoft{background:#fee2e2;color:#991b1b}.mini.square,.thumb{aspect-ratio:1/1;object-fit:cover}.topbar+.content{padding-top:28px}@media(max-width:1100px){.order-detail-grid{grid-template-columns:1fr 1fr}.clean-form{grid-template-columns:1fr}.content{padding:22px}.order-card summary{grid-template-columns:1fr}.orders-filter{grid-template-columns:1fr!important}}@media(max-width:760px){.app.sidebar-collapsed .main,.main{margin-left:0;width:100%}.app.sidebar-collapsed .sidebar,.sidebar{position:relative;width:100%}.order-detail-grid{grid-template-columns:1fr}.topbar{padding:16px;flex-wrap:wrap;height:auto}.content{padding:16px}.hero h2{font-size:30px}}

/* V21 pulido integral */
.status-dashboard .status-card.solid{opacity:1!important;color:#fff!important;background-image:none!important;min-height:96px;border-radius:20px}.status-dashboard .st-pendiente{background:#f59e0b!important}.status-dashboard .st-confirmado{background:#2563eb!important}.status-dashboard .st-procesando{background:#7c3aed!important}.status-dashboard .st-en_camino{background:#0891b2!important}.status-dashboard .st-entregado{background:#16a34a!important}.status-dashboard .st-devuelto{background:#ef4444!important}.status-dashboard .st-cancelado{background:#991b1b!important}.embedded-page{width:100%;height:calc(100vh - 210px);min-height:760px;border:0;border-radius:24px;background:#fff;box-shadow:var(--shadow)}.pos-search{grid-template-columns:2fr 1fr 1fr 1fr 130px;margin-bottom:18px}.qr-quick{background:#f8fbff;border:1px solid var(--line);border-radius:18px;padding:14px;margin:0 0 18px}.qr-quick h3{margin:0 0 10px}.qr-quick input:not([type=checkbox]){border:1px solid #dae4f5;border-radius:12px;padding:12px 14px;margin:6px 8px 6px 0}.checkline{display:inline-flex;align-items:center;gap:8px;font-weight:800;color:#40516d;margin:6px 10px 6px 0}.icon-btn{border:0;background:#eaf2ff;color:#1457d9;border-radius:12px;padding:10px 12px;font-weight:900;cursor:pointer}.icon-btn:hover{background:#2f6df6;color:#fff}.brand-row{display:grid;grid-template-columns:54px 1fr auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:16px;padding:12px;margin-bottom:10px;background:#f9fbff}.brand-row img{width:54px;height:54px;object-fit:cover;border-radius:12px}.app.sidebar-collapsed .sidebar .nav-btn{font-size:0}.app.sidebar-collapsed .sidebar .nav-btn::first-letter{font-size:22px}.app.sidebar-collapsed .sidebar .brand-logo-img{width:54px;height:54px}.field select{appearance:none;background-image:linear-gradient(45deg, transparent 50%, #2f6df6 50%),linear-gradient(135deg, #2f6df6 50%, transparent 50%);background-position:calc(100% - 18px) 50%,calc(100% - 12px) 50%;background-size:6px 6px,6px 6px;background-repeat:no-repeat;padding-right:36px}.colorchip .swatch{box-shadow:0 0 0 3px rgba(255,255,255,.8),0 0 0 4px #d7e3f8}.topbar{background:#061a77}.hero{background:#fff;border-color:#d8e6ff}.main{background:#eef4ff}.card{border-color:#dbe7fb}.customer-card{grid-template-columns:1fr auto}.product-card{width:230px}.products-head .btn{text-decoration:none}@media(max-width:1150px){.pos-search{grid-template-columns:1fr 1fr}.embedded-page{height:900px}}@media(max-width:760px){.pos-search{grid-template-columns:1fr}.brand-row{grid-template-columns:44px 1fr}.embedded-page{height:980px}}

/* V23: alta integrada sin iframe */
.integrated-product-form{display:block;width:100%;}
#addProduct .grid{align-items:start;}
#addProduct .card{margin-bottom:22px;}
#addProduct form{display:block;}
#addProduct .sticky-actions-row{position:sticky;bottom:14px;z-index:20;display:flex;justify-content:flex-end;gap:14px;box-shadow:0 14px 34px rgba(15,23,42,.10);}
#addProduct .variation-form{background:#f8fbff;border:1px solid var(--line);border-radius:18px;padding:18px;margin-top:14px;}
#addProduct .products-head{display:flex;justify-content:space-between;gap:14px;align-items:center;}
#addProduct .table-wrap{overflow:auto;}
.embedded-page{display:none!important;}

/* V24 ajustes solicitados */
.hidden{display:none!important}
#posAddProductPanel{margin-bottom:22px;border:2px solid #dbeafe;background:#fff}
#posAddProductPanel .integrated-product-form{margin-top:12px}
.cart-extras{display:grid;grid-template-columns:1fr;gap:12px;margin:12px 0;padding:12px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fbff}
.inline-fields{display:grid;grid-template-columns:130px 1fr;gap:8px}
.cart-summary{margin-top:12px;border-top:1px solid #e5e7eb;padding-top:12px;display:grid;gap:7px}
.cart-summary div{display:flex;justify-content:space-between;align-items:center;color:#334155}
.cart-summary .grand{font-size:18px;color:#00133f;border-top:1px solid #dbeafe;padding-top:10px}
.qr-panel.compact{margin-top:12px;padding:12px;background:#fff;border:1px dashed #bfdbfe;border-radius:14px}
.qr-video{width:100%;max-height:260px;border-radius:16px;background:#0f172a;object-fit:cover;margin-top:10px}
.inline-input.qty-input{max-width:90px}
#posScanInput{min-width:230px}
.product-card .pic img,.thumb,.mini{object-fit:cover;aspect-ratio:1/1}

/* V25: valor unitario editable dentro del desglose del carrito POS */
.cart-table th:nth-child(3),.cart-table td:nth-child(3){min-width:150px}.money-input{display:flex;align-items:center;gap:6px;width:132px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:0 8px}.money-input span{font-weight:900;color:#64748b}.cartprice{width:100%;border:0;padding:8px 0;font-weight:900;background:transparent;color:#0d1730}.cartprice:focus{outline:0}.money-input:focus-within{outline:2px solid #99b9ff;border-color:#99b9ff}

/* V26: endpoint QR por producto y variación */
.qr-product-link{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#eaf2ff;color:#1457d9;text-decoration:none;font-size:22px;font-weight:900;border:1px solid #cfe0ff}.qr-product-link:hover{background:#2f6df6;color:#fff}.qr-variation-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:18px}.qr-product-summary{display:grid;grid-template-columns:92px 1fr;gap:18px;align-items:center}.qr-product-summary img{width:92px;height:92px;border-radius:18px;object-fit:cover;border:1px solid var(--line)}.qr-var-card .products-head{align-items:flex-start}.qr-actions-panel{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:end;margin-bottom:14px}.qr-output{border:1px dashed #bfdbfe;border-radius:16px;background:#f8fbff;padding:14px;min-height:84px}.generated-qr{display:grid;grid-template-columns:150px 1fr;gap:16px;align-items:center}.generated-qr img{width:150px;height:150px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px}.copy-code{width:100%;border:1px solid #dbeafe;border-radius:12px;padding:12px 14px;margin:8px 0;font-weight:900}.row-actions{display:flex;gap:10px;flex-wrap:wrap}.btn.small{padding:9px 12px;font-size:12px}.thumb.empty{display:grid;place-items:center;background:#eef5ff;color:#64748b}
@media(max-width:760px){.qr-actions-panel{grid-template-columns:1fr}.generated-qr{grid-template-columns:1fr;text-align:center}.generated-qr img{margin:auto}}


/* ==== V27 UI polish / QR experience ==== */
:root{--soft-blue:#eff5ff;--soft-blue-2:#f7faff;--soft-border:#d6e2fb;--soft-shadow:0 18px 40px rgba(23,44,88,.10)}
body{background:linear-gradient(180deg,#eef4ff 0%,#f7faff 100%)}
.content{padding:30px 34px 60px}
.hero,.card,.tree-col,.order-card,.customer-card,.product-card,.pos-modal{box-shadow:var(--soft-shadow)!important}
.hero h2,#title{text-wrap:balance}
.field label{font-size:13px;font-weight:900;letter-spacing:.01em;color:#43526f}
.field input,.field select,.field textarea,.cartqty,.money-input input{min-height:52px;border-radius:14px!important;border:1.5px solid #d9e4f7!important;background:#fff;transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;font-size:15px}
.field input:focus,.field select:focus,.field textarea:focus,.cartqty:focus,.money-input input:focus{box-shadow:0 0 0 4px rgba(47,109,246,.12)!important;border-color:#5e8dff!important;transform:translateY(-1px)}
.btn{border-radius:14px!important;min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 10px 22px rgba(47,109,246,.18)}
.btn.small{min-height:40px;padding:10px 14px;font-size:13px}
.products-head{align-items:center}
.table th{font-size:12px;text-transform:uppercase;letter-spacing:.05em}
.table td{font-size:14px}
.size-stack,.sku-base-cell{display:inline-block;line-height:1.35}
.stock-badge{background:#ebf8ef;color:#15803d}
.qr-svg{width:20px;height:20px;display:block}
.qr-product-link{width:44px;height:44px;border-radius:14px;font-size:0;box-shadow:0 8px 18px rgba(20,87,217,.12)}
.qr-product-link:hover{transform:translateY(-1px)}
.product-card{padding:14px;border-radius:22px;border:1px solid var(--soft-border);background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);display:flex;flex-direction:column;gap:10px}
.product-card .pic{border-radius:18px;background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);border:1px solid #e0eafb;margin-bottom:0}
.product-card-body{display:grid;gap:8px;align-content:start}
.pc-title{min-height:auto!important;font-size:18px;line-height:1.15;text-transform:uppercase}
.pc-cat{font-size:13px!important;min-height:auto!important}
.pc-colorline{display:flex;align-items:center;justify-content:center;gap:8px;font-weight:800;color:#27426f}
.pc-sizes{display:block;line-height:1.45;font-size:13px!important;min-height:auto!important}
.posPrice{font-size:28px;line-height:1;font-weight:900;color:#0c225b;margin:6px 0 2px!important}
.pos-card-btn{width:100%}
#posProducts{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:18px}
.pos-open-card{cursor:pointer;transition:transform .16s ease, box-shadow .16s ease}
.pos-open-card:hover{transform:translateY(-4px)}
#cartBox{border:1px solid #dbe7fb;border-radius:20px;background:#fbfdff;padding:8px}
.cart-table th,.cart-table td{padding:12px 10px}
.cart-summary{display:grid;gap:10px;margin-top:14px;padding:16px;border-radius:16px;background:#eff5ff}
.cart-summary > div{display:flex;justify-content:space-between;align-items:center;font-size:15px}
.cart-summary .grand{font-size:18px;font-weight:900;padding-top:10px;border-top:1px solid #cfe0ff}
#cartExtras{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:14px;margin-top:14px}
.order-card summary{background:linear-gradient(180deg,#fff 0%,#f8fbff 100%)}
.order-card summary b{font-size:18px}
.status-badge,.status-select{padding:12px 16px!important;border:1px solid transparent!important;font-size:13px!important;min-height:46px}
.st-pendiente{background:#e0edff!important;color:#1d4ed8!important;border-color:#bfd4ff!important}
.status-dashboard .st-pendiente{background:#2563eb!important;color:#fff!important}
.intuitive-form{display:grid!important;grid-template-columns:repeat(4,minmax(180px,1fr));gap:14px;padding:0 20px 20px}
.action-field{display:grid;gap:6px}
.action-field-btn .btn{width:100%}
.doc-grid{display:grid!important;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;padding:0 20px 20px}
.doc-card{border:1px solid #dbe7fb;border-radius:16px;background:#f8fbff;padding:14px;display:grid;gap:10px}
.doc-card b{font-size:15px}
.order-detail-grid .detail-box p{margin:8px 0}
.qr-variation-grid{grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:20px}
.qr-var-card{border-radius:22px;border:1px solid #dbe7fb;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.qr-card-head{justify-content:space-between;border-bottom:1px solid #e7efff;margin-bottom:16px;padding-bottom:14px}
.qr-card-head h3{margin:0 0 8px;text-align:center;line-height:1.15;font-size:22px;word-break:break-word}
.centerish{text-align:center}
.qr-form-grid{display:grid;grid-template-columns:repeat(2,minmax(160px,1fr));gap:14px;align-items:end}
.fullw{width:100%}
.centered-output{display:grid;place-items:center;min-height:250px;background:radial-gradient(circle at top,#f9fbff 0%,#eef5ff 100%);border:1px dashed #bfd5ff;border-radius:18px}
.generated-qr.minimal{display:grid;justify-items:center;gap:14px;width:100%}
.qr-image-only{width:min(240px,72vw);height:auto;aspect-ratio:1/1;background:#fff;border-radius:18px;border:1px solid #dbe7fb;padding:10px}
.qr-row-actions{justify-content:center}
.summary-pills{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.qr-product-summary{align-items:center}
.qr-product-summary h3{margin:0 0 10px;font-size:28px;text-align:left}
.qr-product-summary .badge{font-size:12px}
.topbar .status{min-height:54px;display:inline-flex;align-items:center}
.topbtn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-height:52px}
.table .prodcell b{line-height:1.25}
.select-wide select, .order-actions select{min-height:50px}
@media (max-width:1100px){.intuitive-form{grid-template-columns:repeat(2,minmax(180px,1fr))}.doc-grid{grid-template-columns:repeat(2,minmax(220px,1fr))}.qr-form-grid{grid-template-columns:1fr 1fr}}
@media (max-width:760px){.content{padding:18px 14px 40px}.hero{padding:24px 20px}.hero h2{font-size:28px}.products-head{flex-direction:column;align-items:flex-start;gap:12px}.intuitive-form,.doc-grid,#cartExtras,.qr-form-grid{grid-template-columns:1fr!important}.order-card summary{gap:10px}.order-card summary b{font-size:16px}.product-card{max-width:none;width:100%}.pc-title{font-size:17px}.posPrice{font-size:24px}.qr-card-head h3{font-size:18px}.qr-product-summary{grid-template-columns:1fr;justify-items:center;text-align:center}.qr-product-summary h3{text-align:center;font-size:22px}.qr-image-only{width:min(220px,78vw)}}

/* V29: historial persistente de carrito por cliente */
.cart-history-note{display:grid;gap:4px;margin:4px 4px 12px;padding:12px 14px;border:1px solid #cfe0ff;border-radius:16px;background:#eef5ff;color:#0f2f73;line-height:1.3}
.cart-history-note b{font-size:14px}.cart-history-note small{color:#5f6f8b;font-weight:700}
@media(max-width:760px){.cart-history-note{font-size:13px}}

/* ==== V30 usuarios, permisos y correos ==== */
.full-row{grid-column:1/-1}
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0 16px}
.permission-check{border:1px solid #dbe7fb;border-radius:14px;background:#f8fbff;padding:12px;display:flex;align-items:center;gap:10px;font-weight:800;color:#243755;cursor:pointer}
.permission-check input{width:18px;height:18px}
.user-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.user-card{border:1px solid #dbe7fb;border-radius:18px;background:#fff;display:grid;grid-template-columns:54px 1fr auto;gap:14px;padding:16px;align-items:start;box-shadow:0 10px 24px rgba(23,44,88,.07)}
.user-card.inactive{opacity:.72;background:#f8fafc}
.user-avatar{width:54px;height:54px;border-radius:16px;background:#eaf2ff;display:grid;place-items:center;font-size:26px}
.user-info b{display:block;font-size:17px;line-height:1.2}
.user-info small{display:block;color:#64748b;margin-top:4px}
.permission-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.permission-chips span{background:#edf4ff;color:#1d4ed8;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900}
.user-actions{display:grid;gap:8px;justify-items:end}
.email-row{border:1px solid #dbe7fb;border-radius:16px;background:#f8fbff;margin-bottom:10px;padding:14px;display:grid;grid-template-columns:1fr auto;gap:12px;align-items:start}
.email-row small{display:block;color:#64748b;margin-top:4px}.email-row p{margin:8px 0 0;white-space:pre-wrap;color:#27354f}
@media(max-width:760px){.user-card{grid-template-columns:44px 1fr}.user-actions{grid-column:1/-1;justify-items:stretch}.email-row{grid-template-columns:1fr}.permission-grid{grid-template-columns:1fr}}

.driver-truck-hint{display:block;margin-top:6px;color:#94a3b8!important;font-size:12px;font-weight:700;line-height:1.3}.field select#posDriver{font-weight:900;color:#0f172a}


/* V38: historial de productos omitidos por coincidencia de siglas SKU */
.excel-sku-history{margin-top:16px;border:1px solid #dbe7fb;border-radius:18px;background:#fff;padding:16px}
.excel-sku-history h3{margin:0 0 6px;font-size:18px}
.excel-sku-history .table td,.excel-sku-history .table th{font-size:13px;vertical-align:top}
.excel-sku-history .table tbody tr{background:#fff}
.excel-sku-history .table tbody tr:hover{background:#f8fbff}

/* V40: filas editables para choferes y cuentas */
.editable-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.editable-row small{display:block;color:#64748b;margin-top:4px}
.row-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.btn.red,.btn.small.red{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;box-shadow:none}
@media(max-width:760px){.editable-row{align-items:flex-start;flex-direction:column}.row-actions{justify-content:flex-start;width:100%}.row-actions .btn{flex:1}}


/* V46 PERFORMANCE + POS CARDS */
#productsCountHint{display:block;margin:8px 0 0;color:#64748b;font-weight:800}
#posProducts{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important;
  gap:14px!important;
  align-items:stretch;
}
.product-card{
  min-width:0!important;
  padding:12px!important;
  border-radius:18px!important;
  display:grid!important;
  grid-template-rows:auto 1fr!important;
  gap:10px!important;
  text-align:center!important;
  overflow:hidden!important;
  contain:content;
}
.product-card .pic{
  width:100%!important;
  height:auto!important;
  aspect-ratio:1/1!important;
  min-height:0!important;
  max-height:185px!important;
  margin:0!important;
  border-radius:16px!important;
  background:#f1f6ff!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  position:relative;
}
.product-card .pic img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}
.product-card .pic.img-missing::after,
.product-card .pic:empty::after{
  content:"📦";
  font-size:42px;
  opacity:.65;
}
.pic-placeholder{font-size:42px;opacity:.7}
.product-card-body{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  min-height:0!important;
}
.pc-title{
  font-size:15px!important;
  line-height:1.12!important;
  min-height:34px!important;
  max-height:52px!important;
  overflow:hidden!important;
  display:-webkit-box!important;
  -webkit-line-clamp:3!important;
  -webkit-box-orient:vertical!important;
}
.pc-cat{
  font-size:11px!important;
  line-height:1.15!important;
  min-height:26px!important;
  max-height:40px!important;
  overflow:hidden!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
}
.pc-colorline{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  font-size:12px!important;
  min-height:24px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.pc-sizes{
  font-size:11px!important;
  line-height:1.15!important;
  min-height:16px!important;
  max-height:30px!important;
  overflow:hidden!important;
}
.product-card .posPrice{
  font-size:22px!important;
  line-height:1!important;
  margin:4px 0!important;
  color:#08235f!important;
}
.pos-card-btn{
  margin-top:auto!important;
  width:100%!important;
  min-height:38px!important;
  border-radius:12px!important;
}
.thumb{
  width:54px!important;
  height:54px!important;
  min-width:54px!important;
  border-radius:14px!important;
  background:#eef4ff!important;
}
.prodcell>div:last-child{min-width:0}
.product-name{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  line-height:1.15;
}
@media(max-width:1100px){
  #posProducts{grid-template-columns:repeat(auto-fill,minmax(165px,1fr))!important;gap:12px!important}
  .product-card .pic{max-height:160px!important}
  .pc-title{font-size:14px!important}
  .product-card .posPrice{font-size:20px!important}
}
@media(max-width:760px){
  #posProducts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .product-card{padding:9px!important;border-radius:16px!important}
  .product-card .pic{max-height:none!important}
  .pc-title{font-size:13px!important;min-height:30px!important}
  .pc-cat,.pc-sizes{font-size:10px!important}
  .product-card .posPrice{font-size:18px!important}
}

/* V48 paginación real de productos */
.pagination-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 16px;padding:12px 14px;border:1px solid var(--line);border-radius:16px;background:#f8fbff}
.pagination-info{color:#40516d;font-weight:800}
.pagination-buttons{display:flex;gap:8px;flex-wrap:wrap}
.pagination-buttons .btn[disabled]{opacity:.45;cursor:not-allowed}
.pagination-buttons .active-page{background:#0b1c72!important;color:#fff!important}
@media(max-width:760px){.pagination-bar{align-items:flex-start}.pagination-buttons .btn{flex:1;min-width:92px}}

/* V49 corrección miniaturas + color duplicado */
.image-fallback{object-fit:contain!important;padding:18%!important;background:#eef4ff!important}
.product-card .pic .image-fallback{padding:26%!important}
.prodcell .thumb.image-fallback{padding:10px!important}
.pc-colorline .colorchip{margin:0 auto}
.pc-colorline .colorchip + span{display:none!important}

/* V50 filtros por cantidad de piezas */
.filters .field input[type=number]{min-width:0}

/* V52 selector de cliente buscable */
.customer-picker-field{position:relative}
.customer-combobox{position:relative}
.customer-combobox input[type=text]{
  width:100%;
  min-height:54px;
  border:1px solid #dbe7fb;
  border-radius:16px;
  background:#fff;
  padding:0 46px 0 16px;
  font-weight:800;
  color:#0d1730;
  box-shadow:0 8px 20px rgba(32,54,96,.06);
}
.customer-combobox input[type=text]:focus{
  outline:3px solid rgba(47,109,246,.18);
  border-color:#7ea5ff;
}
.customer-clear{
  position:absolute;
  right:10px;
  top:10px;
  width:34px;
  height:34px;
  border:0;
  border-radius:11px;
  background:#eef4ff;
  color:#1d4ed8;
  font-size:22px;
  font-weight:900;
  cursor:pointer;
}
.customer-clear:hover{background:#dbeafe}
.customer-options{
  position:absolute;
  z-index:80;
  top:62px;
  left:0;
  right:0;
  max-height:320px;
  overflow:auto;
  background:#fff;
  border:1px solid #cfe0ff;
  border-radius:18px;
  box-shadow:0 22px 60px rgba(15,23,42,.20);
  padding:8px;
}
.customer-option{
  width:100%;
  display:grid;
  grid-template-columns:38px 1fr;
  gap:10px;
  align-items:center;
  border:0;
  background:transparent;
  text-align:left;
  border-radius:14px;
  padding:10px;
  cursor:pointer;
  color:#0d1730;
}
.customer-option:hover{background:#eef5ff}
.customer-option b{display:block;font-size:14px;line-height:1.15}
.customer-option small{display:block;color:#68758e;font-weight:700;margin-top:3px}
.customer-avatar{
  width:38px;
  height:38px;
  border-radius:13px;
  background:#e8f1ff;
  color:#1457d9;
  display:grid;
  place-items:center;
  font-weight:900;
}
.customer-walkin{
  grid-template-columns:1fr;
  font-weight:900;
  background:#f8fbff;
  color:#1457d9;
}
.customer-no-results{padding:14px;color:#68758e;font-weight:800;text-align:center}
#posCustomerHint{display:block;margin-top:7px;font-size:12px;font-weight:800}

/* V53 selectores visuales unificados */
select.select-pro{
  appearance:none;
  -webkit-appearance:none;
  background:
    linear-gradient(45deg,transparent 50%,#2563eb 50%) calc(100% - 22px) 50%/7px 7px no-repeat,
    linear-gradient(135deg,#2563eb 50%,transparent 50%) calc(100% - 16px) 50%/7px 7px no-repeat,
    #fff;
  border:1px solid #dbe7fb;
  border-radius:16px;
  min-height:54px;
  padding:0 44px 0 16px;
  font-weight:800;
  color:#0d1730;
  box-shadow:0 8px 20px rgba(32,54,96,.05);
}
select.select-pro:focus{
  outline:3px solid rgba(47,109,246,.18);
  border-color:#7ea5ff;
}
.select-helper{
  margin-top:7px;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:22px;
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.select-helper .dot{
  width:20px;
  height:20px;
  min-width:20px;
  border-radius:999px;
  border:2px solid #d7e4ff;
  box-shadow:inset 0 0 0 2px #fff;
  background:#eef4ff;
}
.select-helper .mini-logo{
  width:28px;
  height:28px;
  border-radius:10px;
  object-fit:cover;
  background:#eef4ff;
  border:1px solid #dbe7fb;
}
.status-select{
  border-width:2px!important;
  font-weight:900!important;
}
.status-pendiente{background-color:#fff7e6!important;border-color:#f4b740!important;color:#92400e!important}
.status-confirmado{background-color:#eaf2ff!important;border-color:#2f6df6!important;color:#1d4ed8!important}
.status-procesando{background-color:#f3e8ff!important;border-color:#8b5cf6!important;color:#6d28d9!important}
.status-en-camino{background-color:#e0f7ff!important;border-color:#06b6d4!important;color:#0e7490!important}
.status-entregado{background-color:#e9fbf2!important;border-color:#10b981!important;color:#047857!important}
.status-devuelto{background-color:#fff1e8!important;border-color:#f97316!important;color:#c2410c!important}
.status-cancelado{background-color:#fee2e2!important;border-color:#ef4444!important;color:#b91c1c!important}
@media(max-width:760px){
  select.select-pro{min-height:50px;border-radius:14px}
}

/* V54 Smart Select buscable con miniaturas dentro del desglose */
.smart-native-select{
  position:absolute!important;
  opacity:0!important;
  pointer-events:none!important;
  width:1px!important;
  height:1px!important;
}
.smart-select-wrap{position:relative;width:100%}
.smart-select-button{
  width:100%;
  min-height:56px;
  border:1px solid #dbe7fb;
  border-radius:16px;
  background:#fff;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 44px 10px 14px;
  text-align:left;
  font-weight:900;
  color:#0d1730;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(32,54,96,.05);
  position:relative;
}
.smart-select-button:after{
  content:"⌄";
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  color:#2563eb;
  font-size:20px;
  font-weight:900;
}
.smart-select-button:focus{
  outline:3px solid rgba(47,109,246,.18);
  border-color:#7ea5ff;
}
.smart-select-button span:last-child{min-width:0}
.smart-select-button b,.smart-option b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height:1.15;
}
.smart-select-button small,.smart-option small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-weight:800;
  font-size:11px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.smart-select-panel{
  display:none;
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 8px);
  z-index:999;
  background:#fff;
  border:1px solid #cfe0ff;
  border-radius:18px;
  box-shadow:0 22px 60px rgba(15,23,42,.22);
  padding:10px;
}
.smart-select-panel.open{display:block}
.smart-select-search{
  width:100%;
  min-height:44px;
  border:1px solid #dbe7fb;
  border-radius:14px;
  padding:0 14px;
  font-weight:800;
  margin-bottom:8px;
}
.smart-select-search:focus{
  outline:3px solid rgba(47,109,246,.16);
  border-color:#7ea5ff;
}
.smart-select-options{
  max-height:310px;
  overflow:auto;
  display:grid;
  gap:6px;
}
.smart-option{
  border:0;
  width:100%;
  background:transparent;
  border-radius:14px;
  padding:10px;
  display:grid;
  grid-template-columns:38px 1fr;
  align-items:center;
  gap:10px;
  text-align:left;
  cursor:pointer;
  color:#0d1730;
}
.smart-option:hover,.smart-option.active{background:#eef5ff}
.smart-option.active{box-shadow:inset 0 0 0 2px #2f6df6}
.smart-option:has(.smart-account-thumb){grid-template-columns:50px 1fr;}
.smart-select-button:has(.smart-account-thumb){align-items:center;}
.smart-dot{
  width:34px;
  height:34px;
  border-radius:999px;
  border:2px solid #d7e4ff;
  box-shadow:inset 0 0 0 3px #fff;
}
.smart-img{
  width:38px;
  height:38px;
  border-radius:12px;
  object-fit:cover;
  background:#eef4ff;
  border:1px solid #dbe7fb;
}
.smart-thumb{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid #dbe7fb;
  background:#fff;
  display:grid;
  place-items:center;
  overflow:hidden;
  flex:none;
}
.smart-account-thumb{
  width:50px;
  height:38px;
  border-radius:12px;
  padding:4px;
  background:#fff;
}
.smart-account-img{
  width:100%;
  height:100%;
  object-fit:contain;
  border:0;
  background:transparent;
  border-radius:8px;
}
.smart-select-button .smart-account-thumb{
  width:54px;
  height:40px;
}
.smart-option .smart-account-thumb{
  width:50px;
  height:38px;
}
.smart-avatar{
  width:38px;
  height:38px;
  border-radius:13px;
  background:#e8f1ff;
  color:#1457d9;
  display:grid;
  place-items:center;
  font-weight:900;
}
.smart-status-dot{
  width:34px;
  height:34px;
  border-radius:13px;
  display:grid;
  place-items:center;
  border:2px solid #dbe7fb;
}
.smart-status-dot.status-pendiente{background:#f4b740}
.smart-status-dot.status-confirmado{background:#2f6df6}
.smart-status-dot.status-procesando{background:#8b5cf6}
.smart-status-dot.status-en-camino{background:#06b6d4}
.smart-status-dot.status-entregado{background:#10b981}
.smart-status-dot.status-devuelto{background:#f97316}
.smart-status-dot.status-cancelado{background:#ef4444}
.smart-empty{text-align:center;color:#64748b;font-weight:900;padding:16px}
.select-helper{display:none!important}
@media(max-width:760px){
  .smart-select-panel{position:fixed;left:12px;right:12px;top:auto;bottom:16px;max-height:70vh}
  .smart-select-options{max-height:48vh}
}

/* V57 fix: los selectores se sobreponen fuera de cards */
.card,.hero,.view,.content,.main,.grid,.filters,.field{overflow:visible!important}
.smart-select-panel{
  position:fixed!important;
  z-index:99999!important;
  overflow:hidden!important;
}
.smart-select-options{
  max-height:calc(100% - 56px)!important;
  overflow:auto!important;
}

.smart-select-panel{
  max-height:min(420px,calc(100vh - 40px))!important;
  overflow-y:auto!important;
  scrollbar-width:thin;
  scrollbar-gutter:stable both-edges;
}
.smart-select-search{
  position:sticky;
  top:0;
  z-index:2;
  background:#fff;
}
.smart-select-options{
  overflow-y:auto!important;
  scrollbar-width:thin;
  scrollbar-gutter:stable both-edges;
  overscroll-behavior:contain;
}
.smart-select-panel::-webkit-scrollbar,
.smart-select-options::-webkit-scrollbar{
  width:10px;
}
.smart-select-panel::-webkit-scrollbar-thumb,
.smart-select-options::-webkit-scrollbar-thumb{
  background:#bfd2ff;
  border-radius:999px;
  border:2px solid #fff;
}
.smart-select-panel::-webkit-scrollbar-track,
.smart-select-options::-webkit-scrollbar-track{
  background:transparent;
}
.smart-select-wrap{z-index:20}
.smart-select-wrap:has(.smart-select-panel.open){z-index:99998}

/* V58 POS cards más espaciosos y sin encimarse */
#posProducts{
  grid-template-columns:repeat(auto-fill,minmax(245px,1fr))!important;
  gap:18px!important;
}
.product-card{
  padding:14px!important;
  border-radius:20px!important;
  min-height:420px!important;
}
.product-card .pic{
  max-height:none!important;
  height:210px!important;
  aspect-ratio:auto!important;
}
.product-card-body{gap:9px!important}
.pc-title{
  font-size:16px!important;
  line-height:1.18!important;
  min-height:40px!important;
  max-height:58px!important;
}
.pc-cat{
  font-size:11px!important;
  min-height:28px!important;
  max-height:34px!important;
}
.pc-colorline{min-height:28px!important}
.pc-sizes{
  min-height:30px!important;
  max-height:36px!important;
}
.product-card .posPrice{
  margin-top:auto!important;
  font-size:24px!important;
}
.pos-card-btn{min-height:42px!important;font-size:14px!important}
@media(max-width:1200px){
  #posProducts{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))!important}
  .product-card{min-height:395px!important}
  .product-card .pic{height:190px!important}
}
@media(max-width:760px){
  #posProducts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  .product-card{min-height:330px!important;padding:10px!important}
  .product-card .pic{height:145px!important}
  .pc-title{font-size:13px!important;min-height:34px!important}
  .product-card .posPrice{font-size:18px!important}
}

/* V59: el selector no debe tapar topbar/sidebar y POS solo stock */
.sidebar{z-index:100050!important}
.topbar,.header,.appbar{z-index:100040!important}
.smart-select-panel{z-index:90000!important}
.smart-select-wrap{z-index:auto!important}
.smart-select-wrap:has(.smart-select-panel.open){z-index:90000!important}

/* V61 árbol de categorías limpio */
#catalogTree{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr))!important;
  gap:16px!important;
  align-items:start!important;
}
.category-tree-card{
  border:1px solid #dbe7fb;
  background:#fff;
  border-radius:18px;
  padding:12px;
  box-shadow:0 12px 28px rgba(32,54,96,.06);
}
.category-tree-card>summary,
.tree-node>summary{
  list-style:none;
  cursor:pointer;
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:10px;
  border-radius:14px;
  padding:10px;
}
.category-tree-card>summary::-webkit-details-marker,
.tree-node>summary::-webkit-details-marker{display:none}
.category-tree-card>summary{
  background:#f3f7ff;
}
.category-tree-card>summary b{
  font-size:18px;
  color:#06153d;
}
.category-tree-card small,
.tree-node small{
  display:block;
  color:#60708b;
  font-size:11px;
  font-weight:800;
  margin-top:2px;
}
.tree-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  background:#e8f1ff;
  display:grid;
  place-items:center;
}
.tree-children{
  display:grid;
  gap:8px;
  margin-top:10px;
}
.tree-children.level2{
  margin-left:16px;
  padding-left:12px;
  border-left:2px dashed #d8e5ff;
}
.tree-node{
  border:1px solid #e5eefc;
  background:#f9fbff;
  border-radius:14px;
  padding:2px;
}
.tree-node.sub{
  background:#fff;
}
.tree-node>summary{
  grid-template-columns:auto 1fr auto;
}
.tree-node>summary b{
  color:#0c1d46;
  font-size:14px;
}
.tree-dot{
  width:14px;
  height:14px;
  border-radius:999px;
  display:inline-block;
  box-shadow:inset 0 0 0 3px #fff;
  border:1px solid #cfe0ff;
}
.tree-dot.blue{background:#2f6df6}
.tree-dot.green{background:#10b981}
.tree-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:8px 10px 10px 36px;
}
.tree-tags span{
  background:#eef5ff;
  color:#24406f;
  border:1px solid #dbe7fb;
  border-radius:999px;
  padding:6px 9px;
  font-size:11px;
  font-weight:900;
}
.tree-empty{
  color:#64748b;
  font-weight:800;
  padding:10px;
  margin:0;
}
@media(max-width:760px){
  #catalogTree{grid-template-columns:1fr!important}
}

/* V62 sidebar compacto con emojis visibles */
.app.sidebar-collapsed .sidebar,
.sidebar.collapsed{
  width:92px!important;
  padding:22px 12px!important;
  overflow-x:hidden!important;
}
.app.sidebar-collapsed .main,
.sidebar.collapsed + .main{
  margin-left:92px!important;
  width:calc(100% - 92px)!important;
}
.app.sidebar-collapsed .sidebar .nav-title,
.sidebar.collapsed .nav-title{
  display:none!important;
}
.app.sidebar-collapsed .sidebar .subnav,
.sidebar.collapsed .subnav{
  display:block!important;
  margin:8px 0!important;
  padding:0!important;
  border-left:0!important;
}
.app.sidebar-collapsed .sidebar .subnav a,
.sidebar.collapsed .subnav a{
  width:56px!important;
  height:46px!important;
  padding:0!important;
  margin:6px auto!important;
  border-radius:16px!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
  background:transparent;
}
.app.sidebar-collapsed .sidebar .subnav a:hover,
.sidebar.collapsed .subnav a:hover{
  background:#e8f1ff!important;
}
.app.sidebar-collapsed .sidebar .subnav a .nav-emoji,
.sidebar.collapsed .subnav a .nav-emoji{
  display:block!important;
  font-size:21px!important;
  line-height:1!important;
}
.app.sidebar-collapsed .sidebar .subnav a .nav-text,
.sidebar.collapsed .subnav a .nav-text{
  display:none!important;
}
.app.sidebar-collapsed .sidebar .nav-btn,
.sidebar.collapsed .nav-btn{
  width:56px!important;
  height:46px!important;
  margin:6px auto!important;
  padding:0!important;
  border-radius:16px!important;
  justify-content:center!important;
  font-size:0!important;
}
.app.sidebar-collapsed .sidebar .nav-btn::first-letter,
.sidebar.collapsed .nav-btn::first-letter{
  font-size:21px!important;
}
.app.sidebar-collapsed .sidebar .nav-btn span,
.sidebar.collapsed .nav-btn span{
  display:none!important;
}
.app.sidebar-collapsed .sidebar .brand,
.sidebar.collapsed .brand{
  margin-bottom:20px!important;
  justify-content:center!important;
}
.app.sidebar-collapsed .sidebar .brand .logo,
.sidebar.collapsed .brand .logo{
  width:58px!important;
  height:58px!important;
}
.app.sidebar-collapsed .sidebar .brand h1,
.app.sidebar-collapsed .sidebar .brand p,
.sidebar.collapsed .brand h1,
.sidebar.collapsed .brand p{
  display:none!important;
}

/* V63 interfaz más compacta al 80%-85% y edición de pedidos */
:root{--ui-scale:.86}
body{font-size:calc(15px * var(--ui-scale))}
.sidebar{width:250px!important;padding:18px 14px!important}
.main{margin-left:250px!important;width:calc(100% - 250px)!important}
.hero{padding:28px!important}
.card{padding:18px!important}
.topbar{padding:12px 24px!important}
.nav-btn,.nav-link{padding:10px 12px!important;font-size:13px!important}
.subnav a{padding:8px 10px!important;font-size:13px!important}
.brand h1{font-size:19px!important}
.brand p{font-size:13px!important}
h1,h2{transform-origin:left center}
h2{font-size:calc(34px * var(--ui-scale))!important}
.table th,.table td{padding:10px 9px!important;font-size:12px!important}
.field input,.field select,.smart-select-button{min-height:44px!important}
.btn{padding:10px 14px!important}
.order-mini-input{
  width:92px;
  min-height:36px;
  border:1px solid #dbe7fb;
  border-radius:12px;
  padding:6px 9px;
  font-weight:900;
  background:#fff;
}
.order-mini-input.qty{width:70px}
.order-mini-input.price{width:96px}
.order-card .info-card p{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
@media(max-width:900px){
  :root{--ui-scale:.94}
  .sidebar{width:92px!important}
  .main{margin-left:92px!important;width:calc(100% - 92px)!important}
}

/* V64 replace quantity */
.order-mini-input{max-width:110px}

/* V65 responsive real + interfaz flexible */
*{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
.main{min-width:0}
.content,.view,.hero,.card{max-width:100%}
.intuitive-form,.filters,.order-actions,.doc-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;
  gap:12px!important;
  align-items:end!important;
}
.order-detail-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important;
  gap:12px!important;
}
.table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.table{min-width:760px}
#posProducts{
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;
}
.product-card{min-width:0!important}
.pos-layout,.pos-grid,.two-col,.dashboard-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(300px,420px)!important;
  gap:16px!important;
  align-items:start!important;
}
.cart-panel,.cart,.side-panel{min-width:0!important}
#posQrVideo{
  width:100%!important;
  max-height:320px!important;
  object-fit:cover!important;
  border-radius:16px!important;
}
.toast{
  max-width:min(520px,calc(100vw - 24px))!important;
  right:12px!important;
}
@media(max-width:1180px){
  .pos-layout,.pos-grid,.two-col,.dashboard-grid{
    grid-template-columns:1fr!important;
  }
  .cart-panel,.cart,.side-panel{
    position:static!important;
    width:100%!important;
  }
}
@media(max-width:760px){
  :root{--ui-scale:.92}
  .sidebar{
    position:fixed!important;
    left:0; top:0; bottom:0;
    width:78px!important;
    padding:12px 8px!important;
    z-index:100050!important;
  }
  .main{
    margin-left:78px!important;
    width:calc(100% - 78px)!important;
  }
  .topbar{
    position:sticky!important;
    top:0;
    z-index:100040!important;
    padding:10px 12px!important;
    gap:8px!important;
    flex-wrap:wrap!important;
  }
  #masterSearch,.searchbox{
    width:100%!important;
    min-width:0!important;
  }
  .hero{
    padding:18px!important;
    border-radius:20px!important;
  }
  h1{font-size:28px!important}
  h2{font-size:24px!important}
  .card{padding:14px!important;border-radius:18px!important}
  .filters,.intuitive-form,.order-actions,.doc-grid{
    grid-template-columns:1fr!important;
  }
  #posProducts{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .product-card{min-height:300px!important;padding:9px!important}
  .product-card .pic{height:132px!important}
  .pc-title{font-size:12px!important}
  .pc-cat,.pc-sizes{font-size:10px!important}
  .product-card .posPrice{font-size:17px!important}
  .btn{width:100%;justify-content:center}
  .order-mini-input{width:100%!important;max-width:none!important}
  .smart-select-panel{
    left:86px!important;
    right:8px!important;
    width:auto!important;
    max-width:calc(100vw - 96px)!important;
  }
}
@media(max-width:480px){
  .main{margin-left:70px!important;width:calc(100% - 70px)!important}
  .sidebar{width:70px!important}
  #posProducts{grid-template-columns:1fr!important}
  .table{min-width:680px}
}

/* ===== Dashboard advanced metrics ===== */
.dashboard-analytics{margin-top:18px}
.metrics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.metric-panel{padding:18px;border-radius:22px;display:flex;flex-direction:column;gap:14px;overflow:hidden}
.metric-panel-wide,.metric-panel-full{grid-column:1/-1}
.metric-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.metric-head h3{margin:0;font-size:1.08rem}
.metric-head p{margin:6px 0 0}
.metric-head-inline{align-items:center}
.metric-inline-control{display:flex;align-items:center;gap:10px;font-size:.92rem;color:var(--muted,#64748b);font-weight:700}
.metric-inline-control select{border:1px solid rgba(37,99,235,.18);border-radius:12px;padding:8px 10px;background:#fff;font-weight:700}
.chart-host{position:relative;min-height:280px}
.chart-host.compact{min-height:200px}
.line-chart-wrap{position:relative;width:100%;height:280px}
.line-chart-wrap.compact{height:200px}
.line-chart-svg{width:100%;height:100%;display:block}
.chart-grid-line{stroke:rgba(148,163,184,.28);stroke-width:1}
.chart-axis-y,.chart-axis-x{fill:#64748b;font-size:11px;font-weight:600}
.chart-line{fill:none;stroke:#2563eb;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.chart-area{fill:rgba(37,99,235,.14)}
.chart-dot{fill:#2563eb;stroke:#fff;stroke-width:3;cursor:pointer;transition:transform .18s ease}
.chart-dot:hover,.chart-dot:focus{transform:scale(1.14);outline:none}
.line-chart-tooltip{position:absolute;left:0;top:0;transform:translate(-50%,-110%);background:#ffffff;border:1px solid rgba(148,163,184,.32);box-shadow:0 18px 50px rgba(15,23,42,.18);border-radius:16px;padding:12px 14px;min-width:230px;max-width:320px;pointer-events:none;opacity:0;transition:opacity .16s ease;z-index:5}
.line-chart-tooltip.show{opacity:1}
.tooltip-title{font-weight:800;color:#0f172a;margin-bottom:8px}
.tooltip-subtitle{font-size:.78rem;font-weight:800;color:#2563eb;text-transform:uppercase;letter-spacing:.04em;margin:10px 0 8px}
.tooltip-stat{display:flex;justify-content:space-between;gap:10px;margin:5px 0;font-size:.92rem}
.tooltip-stat span{color:#475569}
.tooltip-stat b{color:#0f172a}
.tooltip-item{display:flex;align-items:center;gap:10px;margin:8px 0}
.tooltip-item img,.tooltip-thumb{width:36px;height:36px;border-radius:10px;object-fit:cover;background:#f1f5f9;border:1px solid rgba(148,163,184,.25)}
.tooltip-item div{display:flex;flex-direction:column}
.tooltip-item b{font-size:.9rem;color:#0f172a}
.tooltip-item span,.tooltip-more{font-size:.78rem;color:#64748b}
.rank-list,.color-list,.account-cards,.employee-grid{display:grid;gap:12px}
.rank-row,.color-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(148,163,184,.18);border-radius:16px;padding:12px 14px;background:#fff}
.rank-main,.color-main{display:flex;align-items:center;gap:12px;min-width:0}
.rank-main b,.color-main b{display:block;color:#0f172a}
.rank-main small,.color-main small{display:block;color:#64748b;margin-top:3px}
.rank-side{display:flex;flex-direction:column;align-items:flex-end;color:#0f172a;white-space:nowrap}
.rank-side small{color:#64748b}
.rank-badge{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:0 10px;border-radius:999px;background:#eff6ff;color:#2563eb;font-weight:800;font-size:.86rem}
.rank-thumb{width:42px;height:42px;border-radius:12px;object-fit:cover;border:1px solid rgba(148,163,184,.18);background:#f8fafc}
.rank-thumb.empty,.tooltip-thumb.empty{display:flex;align-items:center;justify-content:center;color:#64748b}
.color-swatch{width:22px;height:22px;border-radius:999px;border:2px solid rgba(15,23,42,.12);display:inline-block}
.account-cards{grid-template-columns:repeat(auto-fit,minmax(230px,1fr));margin-top:4px}
.account-card{border:1px solid rgba(148,163,184,.18);border-radius:18px;padding:14px 16px;background:#fff}
.account-card h4{margin:0 0 8px;color:#0f172a}
.account-total{font-size:1.35rem;font-weight:800;color:#2563eb;margin-bottom:10px}
.account-meta{display:grid;gap:6px;color:#475569;font-size:.9rem}
.employee-grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.employee-card{border:1px solid rgba(148,163,184,.18);border-radius:18px;padding:14px 16px;background:#fff;display:flex;flex-direction:column;gap:12px}
.employee-card-head h4{margin:0 0 4px;color:#0f172a}
.employee-card-head p{margin:0}
.chart-empty{display:flex;align-items:center;justify-content:center;height:100%;min-height:200px;border:1px dashed rgba(148,163,184,.4);border-radius:18px;color:#64748b;background:#fff}

@media (max-width: 1024px){
  .metrics-grid{grid-template-columns:1fr}
  .metric-panel-wide,.metric-panel-full{grid-column:auto}
}
@media (max-width: 640px){
  .metric-panel{padding:15px}
  .metric-head,.metric-head-inline{flex-direction:column;align-items:flex-start}
  .line-chart-wrap{height:250px}
  .line-chart-wrap.compact{height:190px}
  .rank-row,.color-row{flex-direction:column;align-items:flex-start}
  .rank-side{align-items:flex-start}
  .line-chart-tooltip{min-width:210px;max-width:260px}
}

.api-help{padding:12px 14px;border-radius:14px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-weight:800}.api-help code{background:#111827;color:#fff;padding:2px 6px;border-radius:6px}

/* V71 Fábrica completa */
.factory-page .factory-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:18px 0}
.factory-card{background:#fff;border:1px solid #d8e6ff;border-radius:24px;padding:18px;box-shadow:0 16px 42px rgba(9,31,89,.08)}
.factory-card span{color:#64748b;font-weight:900}.factory-card strong{display:block;font-size:34px;color:#073a91;margin-top:8px;letter-spacing:-.04em}
.factory-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:18px}.factory-wide{grid-column:1/-1}
.factory-list{display:grid;gap:10px}.factory-row{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#f8fbff;border:1px solid #dbe8ff;border-radius:16px;padding:12px}.factory-row b{color:#06133c}.factory-row small{display:block}
.factory-prod{display:flex;align-items:center;gap:10px}.mini-thumb{width:42px;height:42px;border-radius:12px;object-fit:cover;background:#eef4ff;border:1px solid #d8e6ff}.color-dot{width:22px;height:22px;border-radius:50%;border:3px solid #e8f0ff;display:inline-block;vertical-align:middle;margin-right:6px}
.factory-tabs{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.factory-tab{border:1px solid #d8e6ff;background:#fff;border-radius:15px;padding:12px 14px;font-weight:900;color:#10244d;cursor:pointer}.factory-tab.active{background:#2f6df6;color:#fff;box-shadow:0 12px 30px rgba(47,109,246,.25)}
.factory-tab-panel{display:none}.factory-tab-panel.active{display:block}
.factory-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.factory-form.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
.factory-form .field{display:grid;gap:7px}.factory-form label{font-weight:900;color:#24385f}.factory-form input,.factory-form select,.factory-form textarea{width:100%;min-height:46px;border:1px solid #dbe7fb;border-radius:14px;padding:10px 12px;background:#fff;font-weight:800}.factory-form textarea{min-height:84px;resize:vertical}.factory-form .full{grid-column:1/-1}
.factory-upload-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.upload-card{border:1px dashed #b8d1ff;border-radius:18px;background:#f8fbff;padding:14px;display:grid;gap:8px}.upload-card label{font-weight:900}
.factory-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0}.factory-section-head h4{margin:0}
.factory-color-step{display:grid;grid-template-columns:auto 1fr 1fr 1.2fr auto;gap:10px;align-items:center;border:1px solid #dbe7fb;border-radius:16px;background:#f8fbff;padding:12px;margin-bottom:8px}.factory-color-step select,.factory-color-step input{min-height:42px;border:1px solid #dbe7fb;border-radius:12px;padding:8px 10px}
.factory-orders{display:grid;gap:12px}.factory-order-card{border:1px solid #dbe7fb;border-radius:18px;background:#fff;box-shadow:0 10px 30px rgba(9,31,89,.06);overflow:hidden}.factory-order-card summary{list-style:none;display:flex;justify-content:space-between;gap:12px;cursor:pointer;padding:14px 16px;background:#f8fbff}.factory-order-card summary::-webkit-details-marker{display:none}.factory-order-card summary b{color:#06133c}.factory-order-card summary small{display:block;color:#64748b;margin-top:3px;font-weight:800}
.factory-order-edit{padding:16px}.factory-file-strip{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.factory-file-strip a{background:#eef5ff;border:1px solid #dbe7fb;border-radius:999px;padding:8px 12px;font-weight:900;color:#1553c7;text-decoration:none}.factory-step-chips{display:flex;flex-wrap:wrap;gap:8px}.factory-step-chips span{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:8px 10px;color:#334155;font-weight:800;font-size:12px}
.btn.warn{background:#f59e0b;color:#fff}.btn.danger{background:#ef4444;color:#fff}.btn.small{padding:8px 10px;min-height:34px;font-size:12px}
.api-help{padding:12px 14px;border-radius:14px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-weight:800}.api-help code{background:#111827;color:#fff;padding:2px 6px;border-radius:6px}
@media(max-width:1000px){.factory-page .factory-kpis{grid-template-columns:1fr 1fr}.factory-grid,.factory-form,.factory-upload-grid{grid-template-columns:1fr}.factory-color-step{grid-template-columns:1fr}.factory-wide{grid-column:auto}}
@media(max-width:560px){.factory-page .factory-kpis{grid-template-columns:1fr}.factory-card strong{font-size:28px}.factory-tabs{display:grid}.factory-row,.factory-order-card summary{flex-direction:column;align-items:flex-start}}

/* V72 páginas separadas de fábrica + apartados completos */
.factory-quick-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:18px 0}
.factory-quick-links a{background:#fff;border:1px solid #dbe7fb;border-radius:18px;padding:16px;text-align:center;text-decoration:none;color:#0b2c70;font-weight:900;box-shadow:0 12px 28px rgba(9,31,89,.06)}
.factory-filter-card{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.factory-filter-card input{flex:1;min-width:240px;min-height:52px;border:1px solid #dbe7fb;border-radius:18px;padding:12px 16px;font-weight:800}
.factory-order-big{display:grid;gap:16px}.factory-section-card{border:1px solid #dbe7fb;border-radius:20px;background:#fff;padding:16px;margin:14px 0;display:grid;gap:12px;box-shadow:0 10px 28px rgba(9,31,89,.05)}
.factory-section-card h4{margin:0;font-size:13px;color:#06133c;letter-spacing:.03em}
.section-preview{min-height:150px;border:1px solid #dbe7fb;border-radius:16px;background:#f8fbff;display:grid;place-items:center;overflow:hidden}.section-cap-img{max-width:100%;max-height:180px;object-fit:contain}.empty-preview{width:100%;height:100%;display:grid;place-items:center;color:#64748b;font-weight:900}
.metric-mini{border:1px solid #dbe7fb;border-radius:14px;background:#f8fbff;padding:10px;display:grid;align-content:center}.metric-mini b{font-size:11px;color:#2563eb}.metric-mini strong{font-size:18px;color:#06133c}
.thread-box{border:1px solid #dbe7fb;border-radius:16px;background:#f8fbff;padding:12px}.thread-step{display:grid;grid-template-columns:36px 1fr 1fr 1fr auto;gap:8px;align-items:center;margin:8px 0}.thread-step select,.thread-step input{min-height:42px;border:1px solid #dbe7fb;border-radius:12px;padding:8px 10px}
.chip-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.pill.small{font-size:12px;padding:7px 10px}
.order-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.order-thumb{width:70px;height:70px;object-fit:cover;border-radius:14px;border:1px solid #dbe7fb;background:#f8fbff}
.order-expanded{padding:16px;display:grid;gap:16px}.apartado-view{border:1px solid #dbe7fb;border-radius:18px;background:#f8fbff;padding:14px;display:grid;gap:12px}.apartado-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.apartado-head h4{margin:6px 0 0;color:#06133c}
.apartado-grid{display:grid;grid-template-columns:minmax(240px,.9fr) 1.3fr;gap:12px}.apartado-image{background:#eef4ff;border:1px solid #dbe7fb;border-radius:16px;min-height:210px;display:grid;place-items:center;overflow:hidden}.apartado-image img{max-width:100%;max-height:300px;object-fit:contain}.apartado-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.apartado-fields div{background:#fff;border:1px solid #dbe7fb;border-radius:12px;padding:10px;display:grid;gap:4px}.apartado-fields b{font-size:11px;color:#2563eb}.apartado-fields span{font-weight:900;color:#06133c}
.step-line{display:flex;flex-wrap:wrap;gap:8px}.step-line span{background:#fff;border:1px solid #dbe7fb;border-radius:999px;padding:8px 10px;font-weight:800}.step-line i{display:inline-block;width:14px;height:14px;border-radius:50%;margin:0 6px;vertical-align:middle}
.note-box{background:#fff7ed;border:1px solid #fed7aa;color:#7c2d12;border-radius:14px;padding:12px;font-weight:800}
.finish-box{border:1px dashed #b8d1ff;background:#f8fbff;border-radius:16px;padding:14px;display:grid;gap:8px}
.inventory-row{display:flex;align-items:center;gap:16px;border:1px solid #dbe7fb;border-radius:18px;background:#fff;padding:14px}.inventory-row img,.inventory-row .logo{width:70px;height:70px;object-fit:cover;border-radius:16px;background:#f8fbff;display:grid;place-items:center}.inventory-row div:nth-child(2){flex:1}.inventory-row h3{margin:0;color:#06133c}.inventory-row p{margin:4px 0 0;color:#64748b;font-weight:800}.stock-badge{min-width:86px;border-radius:16px;padding:10px 14px;text-align:center;font-weight:900}.stock-badge b{display:block;font-size:24px}.stock-badge.ok{background:#dcfce7;color:#057a32}.stock-badge.low{background:#fee2e2;color:#b91c1c}
.factory-tabs.compact{margin:0 0 14px}
@media(max-width:900px){.thread-step,.apartado-grid,.apartado-fields{grid-template-columns:1fr}.apartado-head,.order-actions{flex-direction:column;align-items:flex-start}.factory-form{grid-template-columns:1fr!important}.factory-upload-grid{grid-template-columns:1fr!important}.inventory-row{align-items:flex-start}.stock-badge{align-self:center}}

/* V73 prioridad, búsquedas y procesos */
.search-results{display:grid;gap:8px;margin-top:8px;max-height:280px;overflow:auto}.search-result{display:grid;grid-template-columns:44px 1fr;gap:10px;text-align:left;align-items:center;border:1px solid #dbe7fb;background:#fff;border-radius:14px;padding:10px;cursor:pointer}.search-result img,.search-result span{width:44px;height:44px;border-radius:12px;object-fit:cover;background:#eef4ff;display:grid;place-items:center}.search-result b{display:block;color:#06133c}.search-result small{color:#64748b;font-weight:800}.read-only-info{border:1px solid #dbe7fb;border-radius:14px;background:#f8fbff;padding:12px;font-weight:900;color:#334155}
.priority-note{border-radius:999px;padding:7px 10px;font-weight:900}.priority-note.alta,.factory-order-card.priority-alta{border-color:#ef4444!important}.priority-note.alta{background:#fee2e2;color:#b91c1c}.priority-note.media,.factory-order-card.priority-media{border-color:#f59e0b!important}.priority-note.media{background:#fef3c7;color:#a16207}.priority-note.baja,.factory-order-card.priority-baja{border-color:#22c55e!important}.priority-note.baja{background:#dcfce7;color:#057a32}.process-controls{display:grid;grid-template-columns:1fr 120px auto;gap:10px}.process-controls select,.process-controls input{min-height:42px;border:1px solid #dbe7fb;border-radius:12px;padding:8px 10px}.factory-order-card.priority-alta{box-shadow:inset 5px 0 #ef4444,0 10px 30px rgba(9,31,89,.06)}.factory-order-card.priority-media{box-shadow:inset 5px 0 #f59e0b,0 10px 30px rgba(9,31,89,.06)}.factory-order-card.priority-baja{box-shadow:inset 5px 0 #22c55e,0 10px 30px rgba(9,31,89,.06)}
@media(max-width:700px){.process-controls{grid-template-columns:1fr}}

/* V74 DST real, buscador diseño POS y procesos inventario */
.pos-design-result{grid-template-columns:72px 1fr!important;align-items:start!important}
.pos-design-result img,.pos-design-result>span{width:72px!important;height:72px!important;border-radius:16px!important;object-fit:cover}
.pos-design-result em{display:block;font-style:normal;color:#64748b;font-size:12px;font-weight:800;margin-top:3px}
.thread-step select option{font-weight:800}
.inventory-process-card{border:1px solid #dbe7fb;border-radius:20px;background:#fff;padding:16px;margin:12px 0;box-shadow:0 10px 28px rgba(9,31,89,.05)}
.inventory-process-head{display:flex;align-items:center;gap:16px;margin-bottom:14px}
.inventory-process-head img,.inventory-process-head .logo{width:70px;height:70px;border-radius:16px;object-fit:cover;background:#eef4ff;display:grid;place-items:center}
.inventory-process-head .color-dot{width:70px;height:70px;border-radius:16px;margin:0}
.inventory-process-head div:nth-child(2){flex:1}
.inventory-process-head h3{margin:0;color:#06133c}
.inventory-process-head p{margin:4px 0 0;color:#64748b;font-weight:800}
.process-stock-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr)) auto;gap:10px;align-items:end;border:1px solid #dbe7fb;background:#f8fbff;border-radius:16px;padding:12px}
.process-stock-grid label{display:grid;gap:6px;color:#24385f;font-weight:900}
.process-stock-grid input{min-height:42px;border:1px solid #dbe7fb;border-radius:12px;padding:8px 10px;font-weight:800}
@media(max-width:1100px){.process-stock-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.process-stock-grid button{grid-column:1/-1}}
@media(max-width:640px){.process-stock-grid{grid-template-columns:1fr}.inventory-process-head{align-items:flex-start;flex-direction:column}}

/* V78 vista de pedidos igual a Mardieli web: detalle amplio, descarga y terminado */
.ay-order summary{padding:0!important}
.ay-order-summary{display:flex;justify-content:space-between;gap:18px;width:100%;padding:26px 18px;align-items:flex-start;min-height:120px}
.ay-order-summary h3{font-size:20px;margin:0 0 12px;color:#06133c}
.ay-expanded{background:#fff;border-top:1px solid #e5eefb;padding:24px!important}
.ay-order-general{display:grid;grid-template-columns:300px 1fr;gap:20px;margin-bottom:22px}
.ay-cap-image{border:1px solid #dbe7fb;border-radius:20px;background:#f8fbff;min-height:190px;display:grid;place-items:center;overflow:hidden}
.ay-cap-image img{width:100%;height:220px;object-fit:contain}
.ay-order-fields{display:grid;gap:16px;align-content:start}
.ay-order-fields>div{border:1px solid #dbe7fb;background:#f8fbff;border-radius:16px;padding:18px 22px;display:grid;gap:8px}
.ay-order-fields b,.ay-design-info b{font-size:12px;color:#64748b;letter-spacing:.04em}
.ay-order-fields strong,.ay-design-info strong{font-size:24px;color:#06133c}
.edit-form{margin:0 0 22px;border:1px solid #dbe7fb;background:#fff;border-radius:18px;padding:16px}
.ay-apartado-card{border:1px solid #dbe7fb;border-radius:24px;background:#fff;padding:20px;margin:22px 0;box-shadow:0 12px 32px rgba(9,31,89,.04)}
.ay-apartado-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}
.ay-apartado-top h2{font-size:26px;line-height:1.1;margin:10px 0 4px;color:#06133c}
.ay-apartado-top p{font-weight:900;color:#64748b;margin:0;font-size:17px}
.apartado-actions{display:flex;gap:12px;align-items:center}
.metric-pill{border:1px solid #dbe7fb;background:#f8fbff;border-radius:18px;padding:14px 18px;color:#64748b;font-weight:900}
.metric-pill b{font-size:22px;color:#06133c}
.file-icon{background:#eef4ff;border-radius:16px;width:54px;height:54px;display:grid;place-items:center;font-size:22px}
.ay-apartado-main{display:grid;grid-template-columns:1.05fr 1.45fr;gap:18px}
.ay-design-image{border:1px solid #dbe7fb;background:#f8fbff;border-radius:20px;min-height:330px;display:grid;place-items:center;overflow:hidden}
.ay-design-image img{width:100%;height:360px;object-fit:contain}
.ay-design-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ay-design-info>div{border:1px solid #dbe7fb;background:#f8fbff;border-radius:16px;padding:16px 18px;display:grid;gap:8px;align-content:center;min-height:78px}
.factory-steps-list{display:grid;gap:10px;margin:20px 0}
.factory-step-row{display:grid;grid-template-columns:46px 36px 1fr auto;align-items:center;gap:14px;border:1px solid #dbe7fb;background:#fff;border-radius:18px;padding:12px}
.step-num{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#eaf2ff;color:#2563eb;font-size:20px;font-weight:900}
.factory-step-row .color-dot{width:34px;height:34px;border-radius:50%;border:1px solid #cbd5e1;margin:0}
.factory-step-row b{font-size:18px;color:#06133c}
.factory-step-row small{display:block;color:#64748b;font-weight:800;margin-top:4px}
.mini-code{background:#edf3ff;color:#64748b;border-radius:999px;padding:4px 10px;font-weight:900;margin-left:8px}
.eva-badge{display:flex;align-items:center;gap:8px;background:#f8fbff;border-radius:16px;padding:10px 12px;font-weight:900;color:#06133c}
.eva-badge .color-dot{width:30px;height:30px}
.ay-notes-download{display:grid;grid-template-columns:1.35fr .9fr;gap:18px;margin-top:18px}
.note-box.big{padding:20px;font-size:18px}
.download-box{border:1px solid #dbe7fb;background:#f8fbff;border-radius:20px;padding:20px;display:grid;gap:16px;align-content:center}
.download-box .btn{width:100%;border-radius:18px}
.factory-download-chips{display:flex;flex-wrap:wrap;gap:10px}
.download-chip{display:inline-block;border:1px solid #dbe7fb;background:#fff;border-radius:999px;padding:10px 16px;color:#06133c;text-decoration:none;font-weight:900}
.ay-finish{display:grid;grid-template-columns:1fr 1.7fr auto;gap:16px;align-items:end;border-top:1px solid #e5eefb;margin-top:24px;padding-top:22px}
.admin-check{display:flex;align-items:center;gap:8px;font-weight:900}
.finish-wide{grid-column:1/-1;font-size:18px;padding:18px;border-radius:18px}
@media(max-width:1100px){.ay-order-general,.ay-apartado-main,.ay-notes-download{grid-template-columns:1fr}.ay-design-info{grid-template-columns:1fr}.ay-finish{grid-template-columns:1fr}.factory-step-row{grid-template-columns:42px 34px 1fr}.eva-badge{grid-column:1/-1}.ay-order-summary{flex-direction:column}.order-actions{width:100%}}

/* V79 editor completo y pedidos cerrados con prioridad */
.ay-order.priority-alta{border-color:#ef4444!important;box-shadow:inset 5px 0 #ef4444,0 14px 34px rgba(239,68,68,.08)}
.ay-order.priority-media{border-color:#f59e0b!important;box-shadow:inset 5px 0 #f59e0b,0 14px 34px rgba(245,158,11,.08)}
.ay-order.priority-baja{border-color:#22c55e!important;box-shadow:inset 5px 0 #22c55e,0 14px 34px rgba(34,197,94,.08)}
.editor-panel{border:1px solid #dbe7fb;border-radius:22px;background:#f8fbff;padding:18px;margin:16px 0 24px}
.editor-panel h3{margin:0 0 14px;color:#06133c;font-size:20px}
.section-edit-card{border:1px solid #dbe7fb;background:#fff;border-radius:20px;padding:16px;margin:14px 0}
.section-edit-title{font-weight:900;color:#06133c;margin:4px 0 12px;font-size:16px}
.section-edit-form{box-shadow:none!important;margin:0!important}
.section-edit-steps{display:grid;gap:8px}
.section-edit-step{display:grid;grid-template-columns:42px repeat(6,minmax(0,1fr));gap:8px;align-items:center;border:1px solid #e5eefb;background:#f8fbff;border-radius:14px;padding:8px}
.section-edit-step span{font-weight:900;color:#2563eb;text-align:center}
.section-edit-step input{min-height:40px;border:1px solid #dbe7fb;border-radius:10px;padding:8px;font-weight:800;background:#fff}
.save-full{width:100%;min-height:54px;margin-top:12px;border-radius:16px!important}
@media(max-width:1200px){.section-edit-step{grid-template-columns:42px repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.section-edit-step{grid-template-columns:1fr}.section-edit-step span{text-align:left}}

/* V80 miniatura grande y editor controlado solo por botón */
.ay-order > summary{cursor:default;list-style:none}
.ay-order > summary::-webkit-details-marker{display:none}
.ay-order-summary{
  min-height:190px;
  align-items:center!important;
  background:linear-gradient(135deg,#ffffff 0%,#f8fbff 100%);
  border-radius:24px;
}
.ay-order-summary .order-actions{
  display:grid;
  grid-template-columns:170px 118px;
  grid-auto-rows:min-content;
  align-items:center;
  gap:12px;
}
.ay-order-summary .order-actions .btn{
  width:170px;
  min-height:52px;
  border-radius:14px;
}
.order-thumb{
  grid-column:2;
  grid-row:1 / span 3;
  width:118px!important;
  height:118px!important;
  border-radius:18px!important;
  object-fit:cover!important;
  background:#eef4ff;
  border:1px solid #dbe7fb;
  padding:3px;
}
.ay-order:not([open]) .ay-expanded{display:none!important}
.ay-order.is-editing .editor-panel{
  border:2px solid #c7dbff;
  box-shadow:0 18px 42px rgba(37,99,235,.10);
}
.editor-panel{
  background:linear-gradient(180deg,#f8fbff 0%,#ffffff 100%);
}
.editor-panel h3{
  background:#eaf2ff;
  display:inline-flex;
  padding:10px 16px;
  border-radius:999px;
  color:#0b57d0;
}
.section-edit-card{
  border-left:5px solid #2f6df6;
}
.section-edit-title{
  display:flex;
  align-items:center;
  gap:8px;
}
.section-edit-title::before{
  content:'';
  width:6px;
  height:24px;
  border-radius:999px;
  background:#2f6df6;
  display:inline-block;
}
.ay-apartado-card{
  box-shadow:0 12px 36px rgba(9,31,89,.07);
}
@media(max-width:900px){
  .ay-order-summary{min-height:auto;align-items:flex-start!important}
  .ay-order-summary .order-actions{grid-template-columns:1fr; width:100%}
  .ay-order-summary .order-actions .btn{width:100%}
  .order-thumb{grid-column:auto;grid-row:auto;width:100%!important;height:180px!important}
}

/* V81: click tarjeta = detalle; botón editar = editor */
.ay-order.no-edit .editor-panel{display:none!important}
.ay-order[open].no-edit .ay-expanded{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
.ay-order[open].no-edit .ay-apartado-card{
  border-radius:28px;
  border:1px solid #d8e6fb;
  box-shadow:0 18px 45px rgba(9,31,89,.08);
}
.ay-order.is-editing .editor-panel{
  display:block!important;
}
.ay-order.is-editing .ay-expanded{
  background:linear-gradient(180deg,#f4f8ff 0%,#ffffff 100%);
}
.editor-panel{
  margin-bottom:28px!important;
  padding:22px!important;
}
.editor-panel h3::before{
  content:'✏️';
  margin-right:8px;
}
.ay-order-summary{
  cursor:pointer;
}
.ay-order-summary .order-actions{
  cursor:default;
}
.order-thumb{
  width:132px!important;
  height:132px!important;
}
@media(max-width:900px){
  .order-thumb{height:190px!important}
}

/* V82: desglosador más limpio y reenvío editable */
.ay-order-summary{
  min-height:150px!important;
  padding:22px 24px!important;
}
.ay-order-summary h3{
  font-size:22px!important;
  line-height:1.15;
}
.ay-order-summary .order-actions{
  grid-template-columns:180px 132px!important;
  gap:10px 16px!important;
}
.ay-order-summary .order-actions .btn{
  width:180px!important;
  box-shadow:0 12px 24px rgba(37,99,235,.16);
}
.detail-toggle{
  background:#fff!important;
  color:#0b57d0!important;
  border:1px solid #cfe0ff!important;
  position:relative;
}
.detail-toggle::after{
  content:'⌄';
  margin-left:10px;
  font-size:18px;
}
.ay-order[open] .detail-toggle::after{
  content:'⌃';
}
.ay-order[open].no-edit .detail-toggle{
  background:#eaf2ff!important;
  border-color:#2f6df6!important;
}
.ay-order .resend-editor{
  display:none;
}
.ay-order.is-editing .resend-editor{
  display:block!important;
}
.ay-order.resend-mode .resend-editor{
  border-color:#f59e0b!important;
  box-shadow:0 18px 45px rgba(245,158,11,.12)!important;
}
.ay-order.resend-mode .resend-editor h3{
  background:#fff3d7!important;
  color:#a05a00!important;
}
.ay-order.resend-mode .save-full{
  background:#f59e0b!important;
  color:#fff!important;
}
.order-thumb{
  width:140px!important;
  height:140px!important;
}
.order-actions .btn.warn{
  background:#f59e0b!important;
}
@media(max-width:900px){
  .ay-order-summary .order-actions{grid-template-columns:1fr!important}
  .ay-order-summary .order-actions .btn{width:100%!important}
  .order-thumb{width:100%!important;height:190px!important}
}

/* V83: tarjetas de pedidos más compactas, delgadas y estilizadas */
.ay-order-summary.compact-card{
  min-height:auto!important;
  padding:18px 22px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px 22px;
  align-items:center!important;
  background:#fbfdff!important;
  border-radius:22px;
}
.ay-order-summary.compact-card h3{
  margin:0 0 12px!important;
  font-size:20px!important;
  line-height:1.18;
  letter-spacing:-.01em;
}
.order-copy{
  min-width:0;
}
.summary-tags{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.summary-tags .pill.small,
.summary-tags .priority-note{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  padding:0 14px;
  border-radius:999px;
  font-size:13px;
  line-height:1;
  box-shadow:none!important;
}
.summary-tags .pill.small{
  border:1px solid #dbe7fb;
  background:#f7fbff;
  color:#2454bb;
  font-weight:900;
}
.summary-tags .sku-tag{
  max-width:min(100%, 740px);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.summary-tags .priority-note{
  border:1px solid transparent;
}
.ay-order-summary.compact-card .order-actions{
  display:grid!important;
  gap:10px 12px!important;
  align-items:center;
  justify-content:end;
  width:auto!important;
}
.ay-order-summary.compact-card .order-actions.process.with-thumb{
  grid-template-columns:150px 150px 92px;
  grid-template-rows:44px 44px;
}
.ay-order-summary.compact-card .order-actions.finished.with-thumb{
  grid-template-columns:150px 150px 92px;
  grid-template-rows:44px;
}
.ay-order-summary.compact-card .order-actions.no-thumb.process{
  grid-template-columns:150px 150px;
  grid-template-rows:44px 44px;
}
.ay-order-summary.compact-card .order-actions.no-thumb.finished{
  grid-template-columns:150px 150px;
  grid-template-rows:44px;
}
.ay-order-summary.compact-card .order-actions .btn{
  width:150px!important;
  min-height:44px!important;
  height:44px;
  padding:0 14px!important;
  border-radius:14px!important;
  font-size:14px;
  box-shadow:none!important;
}
.ay-order-summary.compact-card .order-actions.process.with-thumb .detail-toggle{grid-column:1;grid-row:1}
.ay-order-summary.compact-card .order-actions.process.with-thumb [data-open],
.ay-order-summary.compact-card .order-actions.process.with-thumb [data-prepare-resend]{grid-column:2;grid-row:1}
.ay-order-summary.compact-card .order-actions.process.with-thumb [data-finish]{grid-column:1;grid-row:2}
.ay-order-summary.compact-card .order-actions.process.with-thumb [data-finish-admin]{grid-column:2;grid-row:2}
.ay-order-summary.compact-card .order-actions.process.with-thumb .order-thumb,
.ay-order-summary.compact-card .order-actions.finished.with-thumb .order-thumb{
  grid-column:3;
  grid-row:1 / span 2;
}
.ay-order-summary.compact-card .order-actions.finished.with-thumb .detail-toggle{grid-column:1;grid-row:1}
.ay-order-summary.compact-card .order-actions.finished.with-thumb [data-prepare-resend]{grid-column:2;grid-row:1}
.ay-order-summary.compact-card .order-actions.no-thumb.process .detail-toggle{grid-column:1;grid-row:1}
.ay-order-summary.compact-card .order-actions.no-thumb.process [data-open],
.ay-order-summary.compact-card .order-actions.no-thumb.process [data-prepare-resend]{grid-column:2;grid-row:1}
.ay-order-summary.compact-card .order-actions.no-thumb.process [data-finish]{grid-column:1;grid-row:2}
.ay-order-summary.compact-card .order-actions.no-thumb.process [data-finish-admin]{grid-column:2;grid-row:2}
.ay-order-summary.compact-card .order-actions.no-thumb.finished .detail-toggle{grid-column:1;grid-row:1}
.ay-order-summary.compact-card .order-actions.no-thumb.finished [data-prepare-resend]{grid-column:2;grid-row:1}
.detail-toggle{
  background:#fff!important;
  color:#2051be!important;
  border:1px solid #d6e5ff!important;
}
.detail-toggle::after{
  margin-left:8px;
  font-size:14px;
}
.ay-order-summary.compact-card .order-thumb{
  width:92px!important;
  height:92px!important;
  border-radius:18px!important;
  border:1px solid #dbe7fb;
  background:#f8fbff;
  object-fit:cover!important;
  padding:3px;
}
.factory-order-card.ay-order{
  overflow:hidden;
}
.factory-order-card.ay-order.priority-alta,
.factory-order-card.ay-order.priority-media,
.factory-order-card.ay-order.priority-baja{
  box-shadow:0 10px 26px rgba(9,31,89,.05)!important;
}
.factory-order-card.ay-order.priority-alta{border:1.5px solid #ef4444!important}
.factory-order-card.ay-order.priority-media{border:1.5px solid #f59e0b!important}
.factory-order-card.ay-order.priority-baja{border:1.5px solid #22c55e!important}
@media(max-width:1220px){
  .ay-order-summary.compact-card{
    grid-template-columns:1fr;
  }
  .ay-order-summary.compact-card .order-actions{
    justify-content:start;
  }
}
@media(max-width:760px){
  .ay-order-summary.compact-card{
    padding:16px!important;
  }
  .ay-order-summary.compact-card h3{
    font-size:18px!important;
  }
  .ay-order-summary.compact-card .order-actions.process.with-thumb,
  .ay-order-summary.compact-card .order-actions.finished.with-thumb,
  .ay-order-summary.compact-card .order-actions.no-thumb.process,
  .ay-order-summary.compact-card .order-actions.no-thumb.finished{
    grid-template-columns:1fr!important;
    grid-template-rows:none!important;
    width:100%!important;
  }
  .ay-order-summary.compact-card .order-actions .btn{
    width:100%!important;
  }
  .ay-order-summary.compact-card .order-thumb{
    grid-column:auto!important;
    grid-row:auto!important;
    width:100%!important;
    height:150px!important;
  }
  .summary-tags .sku-tag{
    max-width:100%;
  }
}


/* V84: corregir encimado de miniatura y mantener separación limpia */
.ay-order-summary.compact-card{
  grid-template-columns:minmax(0,1fr) 416px!important;
}
.order-copy,
.order-copy h3,
.summary-tags{
  min-width:0;
  overflow:hidden;
}
.summary-tags > *{
  min-width:0;
}
.summary-tags .sku-tag{
  flex:0 1 660px;
  min-width:0;
  max-width:100%;
}
.ay-order-summary.compact-card .order-actions{
  width:416px!important;
  min-width:416px!important;
}
.ay-order-summary.compact-card .order-actions.process.with-thumb{
  grid-template-columns:146px 146px 100px!important;
  column-gap:10px!important;
}
.ay-order-summary.compact-card .order-actions.finished.with-thumb{
  grid-template-columns:146px 146px 100px!important;
  column-gap:10px!important;
}
.ay-order-summary.compact-card .order-actions .btn{
  width:146px!important;
}
.ay-order-summary.compact-card .order-thumb{
  width:100px!important;
  height:100px!important;
  justify-self:end;
  align-self:center;
}
@media(max-width:1300px){
  .ay-order-summary.compact-card{
    grid-template-columns:1fr!important;
  }
  .ay-order-summary.compact-card .order-actions{
    width:auto!important;
    min-width:0!important;
  }
}

/* V85: en el detalle se muestra la gorra real; la miniatura del diseño queda solo en el header */
.ay-order-general .ay-cap-image{
  background:#fff!important;
  min-height:210px!important;
}
.ay-order-general .ay-cap-image img{
  object-fit:contain!important;
  padding:14px;
}
.cap-sku-line{
  display:block;
  margin-top:8px;
  color:#64748b;
  font-weight:900;
  font-size:13px;
}


/* V88 filtro por fecha en pedidos terminados */
.finished-search-card{
  display:grid;
  gap:14px;
}
.finished-search-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
}
.finished-date-tools{
  display:grid;
  gap:14px;
}
.finished-quick-ranges{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
.finished-quick-ranges .btn.ghost,
.finished-date-actions .btn.ghost{
  background:#fff;
  color:#18315f;
  border:1px solid #cfe0ff;
}
.finished-quick-ranges .btn.active{
  background:#2f6df6;
  color:#fff;
  border-color:#2f6df6;
}
.finished-date-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,240px)) auto;
  gap:14px;
  align-items:end;
}
.finished-date-grid .field{
  display:grid;
  gap:8px;
}
.finished-date-grid .field label{
  font-size:12px;
  font-weight:900;
  color:#5c6f8f;
}
.finished-date-grid input{
  min-height:50px;
  border:1px solid #dbe7fb;
  border-radius:18px;
  padding:12px 14px;
  font-weight:800;
  background:#fff;
}
.finished-date-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
@media(max-width:900px){
  .finished-search-top,
  .finished-date-grid{
    grid-template-columns:1fr;
  }
}


/* V89 resumen de fábrica con gráficas y drilldown */
.factory-kpis{
  display:grid;
  grid-template-columns:repeat(2,minmax(280px,1fr));
  gap:18px;
}
.factory-chart-card{
  background:#fff;
  border:1px solid #d8e5fb;
  border-radius:24px;
  padding:18px;
}
.chart-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.chart-card-head h3{ margin:0; font-size:22px; }
.chart-more{
  border:none;
  background:#edf4ff;
  color:#2850c7;
  font-weight:800;
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
}
.summary-bars{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  align-items:end;
  min-height:240px;
}
.summary-bar{
  border:none;
  background:#f6f9ff;
  border-radius:18px;
  padding:14px 10px;
  min-height:200px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  cursor:pointer;
}
.summary-bar strong{ font-size:28px; color:#173569; }
.summary-bar-fill{
  width:100%;
  max-width:54px;
  min-height:10px;
  border-radius:16px 16px 8px 8px;
  background:linear-gradient(180deg,#2f6df6 0%, #8cb2ff 100%);
  display:block;
}
.rank-chart{ display:grid; gap:12px; }
.rank-row{
  width:100%;
  border:none;
  background:#f8fbff;
  border:1px solid #d8e5fb;
  border-radius:18px;
  padding:12px 14px;
  text-align:left;
  cursor:pointer;
  display:grid;
  gap:10px;
}
.rank-row:hover{ transform:translateY(-1px); box-shadow:0 10px 24px rgba(24,49,95,.08); }
.rank-row-plain{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rank-labels{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rank-labels b{ color:#12284d; }
.rank-labels small{ display:block; margin-top:3px; }
.rank-with-thumb{ align-items:center; }
.rank-with-thumb > div{ flex:1; }
.rank-track{
  height:10px;
  border-radius:999px;
  background:#eaf1ff;
  overflow:hidden;
}
.rank-track span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#2f6df6 0%, #7fb1ff 100%);
}
.line-chart-wrap{ display:grid; gap:12px; }
.line-chart{ width:100%; height:260px; overflow:visible; }
.line-chart .axis{ stroke:#c8d7f4; stroke-width:2; }
.line-chart .line-path{ stroke:#2f6df6; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.line-chart .line-point{ fill:#2f6df6; stroke:#fff; stroke-width:3; cursor:pointer; }
.line-chart .line-point:hover{ r:8; }
.line-labels{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(84px,1fr);
  gap:8px;
  text-align:center;
  font-size:12px;
  color:#6b7d99;
  overflow:auto;
}
.chart-drilldown{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.36);
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  z-index:60;
}
.chart-drilldown.show{ display:flex; }
.chart-drilldown-panel{
  width:min(860px,100%);
  max-height:85vh;
  overflow:auto;
  background:#fff;
  border-radius:24px;
  padding:22px;
  box-shadow:0 24px 80px rgba(15,23,42,.24);
}
.chart-drilldown-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.chart-drilldown-head h3{ margin:0 0 6px 0; font-size:26px; }
.drill-stats{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  margin-bottom:18px;
}
.drill-stat{
  background:#f6f9ff;
  border:1px solid #dbe7fb;
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:4px;
}
.drill-stat span{ font-size:12px; color:#677b98; font-weight:800; }
.drill-stat strong{ font-size:24px; color:#173569; }
.drill-list{ display:grid; gap:10px; }
.drill-item{ align-items:center; grid-template-columns:auto 1fr auto; gap:12px; }
@media(max-width:980px){
  .factory-kpis{ grid-template-columns:1fr; }
}
@media(max-width:700px){
  .summary-bars{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .chart-drilldown{ padding:10px; }
  .chart-drilldown-head{ flex-direction:column; }
}


/* V90 meta semanal y sidebar fábrica desplegable */
.sidebar-toggle{width:46px;height:46px;border:0;border-radius:14px;background:#fff;color:#0b1c72;font-weight:900;font-size:20px;cursor:pointer;box-shadow:0 8px 20px rgba(15,23,42,.12)}
.app.sidebar-collapsed .sidebar{width:92px;padding:22px 12px;overflow:hidden}.app.sidebar-collapsed .main{margin-left:92px;width:calc(100% - 92px)}.app.sidebar-collapsed .brand{justify-content:center}.app.sidebar-collapsed .brand h1,.app.sidebar-collapsed .brand p,.app.sidebar-collapsed .nav-title{display:none!important}.app.sidebar-collapsed .nav-btn{justify-content:center;font-size:0;padding:14px 10px}.app.sidebar-collapsed .nav-btn::first-letter{font-size:20px}
.meta-card{margin:18px 0 22px;transition:border-color .2s ease,box-shadow .2s ease,background .2s ease}.meta-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}.meta-card h3{margin:0 0 4px 0}.meta-card.goal-reached{border-color:#22c55e!important;box-shadow:0 0 0 2px rgba(34,197,94,.16),0 18px 36px rgba(34,197,94,.12);background:linear-gradient(135deg,#fff 0%,#f0fff6 100%)}.meta-card.goal-reached .status{border-color:#22c55e}.goal-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(280px,.8fr);gap:18px;align-items:center}.goal-main{border:1px solid #d8e5fb;border-radius:22px;padding:16px;background:#f8fbff;display:flex;gap:18px;align-items:center;cursor:pointer;text-align:left;width:100%}.goal-ring{--goal:0;width:92px;height:92px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#2f6df6 calc(var(--goal)*1%),#e6efff 0);flex:0 0 92px}.goal-reached .goal-ring{background:conic-gradient(#22c55e calc(var(--goal)*1%),#dff9e8 0)}.goal-ring span{width:68px;height:68px;border-radius:50%;background:#fff;display:grid;place-items:center;font-weight:1000;color:#173569}.goal-main b{display:block;font-size:22px;color:#10264d}.goal-main p{margin:5px 0 10px;color:#637693;font-weight:700}.goal-track{height:12px;border-radius:999px;overflow:hidden;background:#e9f1ff;max-width:520px}.goal-track span{height:100%;display:block;border-radius:999px;background:linear-gradient(90deg,#2f6df6,#78a8ff)}.goal-reached .goal-track span{background:linear-gradient(90deg,#16a34a,#86efac)}.goal-form{border:1px solid #d8e5fb;border-radius:22px;padding:16px;background:#fff}.goal-form label{display:block;font-size:13px;font-weight:1000;color:#50627f;margin-bottom:8px}.goal-input-row{display:grid;grid-template-columns:1fr auto;gap:10px}.goal-input-row input{height:48px;border:1px solid #d8e5fb;border-radius:16px;padding:0 14px;font-weight:900;font-size:16px}@media(max-width:900px){.goal-grid{grid-template-columns:1fr}.meta-card-head{flex-direction:column}}@media(max-width:720px){.sidebar{width:92px;padding:18px 10px;overflow:hidden}.main{margin-left:92px;width:calc(100% - 92px)}.brand h1,.brand p,.nav-title{display:none!important}.nav-btn{justify-content:center;font-size:0}.nav-btn::first-letter{font-size:20px}.topbar{padding:0 14px}.goal-input-row{grid-template-columns:1fr}}


/* V91 resumen semanal con meta y API integrados */
.summary-bars.summary-bars-extended{
  grid-template-columns:repeat(6,minmax(110px,1fr));
  align-items:stretch;
  min-height:0;
}
.summary-bar{
  min-height:208px;
  justify-content:flex-end;
  align-items:center;
  text-align:center;
}
.summary-bar small{font-weight:1000;color:#173569;font-size:14px}
.summary-bar em{font-style:normal;color:#64748b;font-weight:800;font-size:12px}
.summary-bar-panel{
  border:none;background:transparent;padding:0;width:100%;height:100%;
  display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px;cursor:pointer;
}
.summary-bar-panel .summary-bar-fill{margin-bottom:4px}
.summary-bar-meta,.summary-bar-api{justify-content:space-between;padding:12px 10px 14px}
.summary-bar-meta .summary-bar-panel,.summary-bar-api .summary-bar-panel{justify-content:flex-start;gap:8px}
.summary-bar-meta .summary-bar-fill,.summary-bar-api .summary-bar-fill{max-width:62px}
.summary-bar-controls{display:grid;gap:8px;width:100%;margin-top:8px}
.summary-bar-controls input{
  width:100%;height:38px;border:1px solid #d8e5fb;border-radius:12px;padding:0 10px;
  text-align:center;font-weight:900;background:#fff;color:#173569;
}
.mini-btn{
  width:100%;height:38px;border:none;border-radius:12px;background:#2f6df6;color:#fff;
  font-weight:900;cursor:pointer;box-shadow:0 10px 20px rgba(47,109,246,.18);
}
.summary-bar-meta.goal-reached{border-color:#22c55e;background:linear-gradient(180deg,#f7fff9 0%,#eefcf3 100%);box-shadow:0 0 0 2px rgba(34,197,94,.14)}
.summary-bar-meta.goal-reached .summary-bar-fill{background:linear-gradient(180deg,#22c55e 0%,#86efac 100%)}
.summary-bar-api.api-ok{border-color:#22c55e;background:linear-gradient(180deg,#f7fff9 0%,#effcf3 100%)}
.summary-bar-api.api-off{border-color:#f59e0b;background:linear-gradient(180deg,#fffaf0 0%,#fff6df 100%)}
.api-dot{width:16px;height:16px;border-radius:999px;background:#22c55e;display:block;box-shadow:0 0 0 6px rgba(34,197,94,.12);margin:2px auto 8px}
.summary-bar-api.api-off .api-dot{background:#f59e0b;box-shadow:0 0 0 6px rgba(245,158,11,.12)}
@media(max-width:1400px){
  .summary-bars.summary-bars-extended{grid-template-columns:repeat(3,minmax(140px,1fr));}
}
@media(max-width:820px){
  .summary-bars.summary-bars-extended{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:520px){
  .summary-bars.summary-bars-extended{grid-template-columns:1fr;}
}


/* V92 cards laterales separadas + sidebar con emojis clicables */
.sidebar .nav-btn,.sidebar .nav-link{justify-content:flex-start!important;gap:12px!important}
.sidebar .nav-btn .nav-emoji,.sidebar .nav-link .nav-emoji{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;font-size:18px;line-height:1}
.sidebar .nav-btn .nav-text,.sidebar .nav-link .nav-text{flex:1;min-width:0}
.app.sidebar-collapsed .sidebar .nav-btn,
.app.sidebar-collapsed .sidebar .nav-link,
.sidebar.collapsed .nav-btn,
.sidebar.collapsed .nav-link{font-size:13px!important;justify-content:center!important;gap:0!important;padding:14px 8px!important}
.app.sidebar-collapsed .sidebar .nav-btn .nav-text,
.app.sidebar-collapsed .sidebar .nav-link .nav-text,
.sidebar.collapsed .nav-btn .nav-text,
.sidebar.collapsed .nav-link .nav-text{display:none!important}
.app.sidebar-collapsed .sidebar .nav-btn .nav-emoji,
.app.sidebar-collapsed .sidebar .nav-link .nav-emoji,
.sidebar.collapsed .nav-btn .nav-emoji,
.sidebar.collapsed .nav-link .nav-emoji{font-size:22px!important;flex:0 0 auto!important}
.app.sidebar-collapsed .sidebar .nav-btn::first-letter,
.app.sidebar-collapsed .sidebar .nav-link::first-letter,
.sidebar.collapsed .nav-btn::first-letter,
.sidebar.collapsed .nav-link::first-letter{font-size:0!important}

.factory-page .factory-kpis,
.factory-kpis{display:grid;grid-template-columns:repeat(12,minmax(0,1fr))!important;gap:18px!important;align-items:stretch}
.kpi-card{min-height:260px;display:flex;flex-direction:column}
.kpi-status{grid-column:span 4}
.kpi-summary{grid-column:span 4}
.kpi-goal{grid-column:span 2}
.kpi-api{grid-column:span 2}
.summary-bars.summary-bars-mainonly{grid-template-columns:repeat(4,minmax(0,1fr));min-height:196px;align-items:end}
.summary-bars.summary-bars-mainonly .summary-bar{min-height:196px}
.kpi-side-main{border:none;background:#f7faff;border-radius:20px;padding:16px;width:100%;display:grid;justify-items:center;align-content:start;gap:12px;cursor:pointer;text-align:center;flex:1}
.kpi-side-copy{display:grid;gap:6px;justify-items:center}
.kpi-side-copy strong{font-size:34px;line-height:1;color:#173569}
.kpi-side-copy small{font-size:15px;font-weight:1000;color:#173569}
.kpi-side-copy em{font-style:normal;color:#64748b;font-weight:800;font-size:12px;line-height:1.35}
.kpi-side-form{display:grid;gap:8px;margin-top:12px}
.kpi-side-form label{font-size:13px;font-weight:1000;color:#50627f}
.kpi-side-form input{width:100%;height:42px;border:1px solid #d8e5fb;border-radius:14px;padding:0 12px;text-align:center;font-weight:900;background:#fff;color:#173569}
.kpi-goal.goal-reached{border-color:#22c55e!important;background:linear-gradient(180deg,#f7fff9 0%,#effcf4 100%);box-shadow:0 0 0 2px rgba(34,197,94,.12)}
.kpi-goal.goal-reached .kpi-side-main{background:linear-gradient(180deg,#f6fff9 0%,#eefcf3 100%)}
.goal-ring.large{width:112px;height:112px;flex:0 0 112px}
.goal-ring.large span{width:82px;height:82px;font-size:18px}
.kpi-api.api-ok{border-color:#22c55e!important;background:linear-gradient(180deg,#f7fff9 0%,#effcf3 100%)}
.kpi-api.api-off{border-color:#f59e0b!important;background:linear-gradient(180deg,#fffaf0 0%,#fff6df 100%)}
.kpi-api .kpi-side-main{height:100%}
.api-dot.large{width:18px;height:18px;margin-top:8px;margin-bottom:4px}
@media(max-width:1320px){
  .factory-page .factory-kpis,.factory-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpi-status,.kpi-summary,.kpi-goal,.kpi-api{grid-column:span 1}
}
@media(max-width:760px){
  .factory-page .factory-kpis,.factory-kpis{grid-template-columns:1fr!important}
  .kpi-status,.kpi-summary,.kpi-goal,.kpi-api{grid-column:span 1}
  .summary-bars.summary-bars-mainonly{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .summary-bars.summary-bars-mainonly{grid-template-columns:1fr}
}


/* V93 drilldown POS + sidebar iconos colapsados */
.nav-btn .nav-emoji{font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;min-width:22px}
.nav-btn .nav-text{white-space:nowrap}
.nav-btn{gap:10px}
.app.sidebar-collapsed .nav-btn{justify-content:center;gap:0;font-size:inherit;padding:12px 10px;min-height:46px}
.app.sidebar-collapsed .nav-btn::first-letter{font-size:inherit}
.app.sidebar-collapsed .nav-btn .nav-text{display:none!important}
.app.sidebar-collapsed .nav-btn .nav-emoji{font-size:20px;min-width:24px}
.app.sidebar-collapsed .subnav{display:grid!important;gap:8px;padding-top:8px}
.app.sidebar-collapsed .subnav .nav-btn{padding:10px 8px}
.app.sidebar-collapsed .subnav.open,.app.sidebar-collapsed #catGroup.open,.app.sidebar-collapsed #sizeRulesGroup.open{display:grid!important}
.metric-drill-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-bottom:18px}
.metric-drill-card{cursor:pointer;text-align:left;width:100%}
.metric-drill-card:hover,.metric-panel.is-drillable:hover,.account-card.is-drillable:hover,.employee-card.is-drillable:hover,.color-row.is-drillable:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(24,49,95,.08)}
.metric-drill-card,.account-card.is-drillable,.employee-card.is-drillable,.color-row.is-drillable{transition:transform .18s ease,box-shadow .18s ease}
.color-row.is-drillable,.account-card.is-drillable,.employee-card.is-drillable{cursor:pointer;border-radius:18px;border:1px solid #d8e5fb;background:#f8fbff;padding:12px 14px}
.drill-mini-chart{background:#f8fbff;border:1px solid #dbe7fb;border-radius:20px;padding:16px;margin-bottom:16px}
.drill-mini-chart h4{margin:0 0 12px;font-size:15px;color:#173569}
.drill-mini-bars{display:grid;grid-template-columns:repeat(auto-fit,minmax(70px,1fr));gap:10px;align-items:end;min-height:180px}
.drill-mini-bar{display:flex;flex-direction:column;align-items:center;gap:8px;min-height:150px;justify-content:flex-end}
.drill-mini-bar-fill{width:100%;max-width:44px;min-height:12px;border-radius:14px 14px 8px 8px;background:linear-gradient(180deg,#2f6df6 0%,#8cb2ff 100%)}
.drill-mini-bar.active .drill-mini-bar-fill{background:linear-gradient(180deg,#16a34a 0%,#86efac 100%)}
.drill-mini-bar strong{font-size:14px;color:#173569;text-align:center}
.drill-mini-bar span{font-size:12px;color:#6b7d99;text-align:center}
.drill-item-thumb{width:42px;height:42px;border-radius:12px;object-fit:cover;background:#eef4ff;display:grid;place-items:center;font-size:22px;overflow:hidden}
.drill-item-body{display:grid;gap:3px}
.drill-item-body small{color:#6b7d99}
.drill-item-value{font-weight:900;color:#173569;text-align:right}
@media(max-width:700px){.metric-drill-grid{grid-template-columns:1fr}.drill-mini-bars{grid-template-columns:repeat(3,minmax(0,1fr))}}


/* V94 POS sidebar + dashboard polish */
.sidebar .nav-btn,.sidebar .subnav a{display:flex;align-items:center;gap:10px}
.sidebar .nav-btn .nav-emoji,.sidebar .subnav a .nav-emoji{font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;min-width:22px}
.sidebar .nav-btn .nav-text,.sidebar .subnav a .nav-text{white-space:nowrap}
.sidebar .nav-btn .nav-caret{margin-left:auto;font-size:12px;opacity:.75}
.sidebar .subnav a{padding:10px 12px;border-radius:12px}
.sidebar .subnav a:hover{background:#eef4ff}
.app.sidebar-collapsed .sidebar{width:92px!important;padding:22px 10px!important}
.app.sidebar-collapsed .main{margin-left:92px!important;width:calc(100% - 92px)!important}
.app.sidebar-collapsed .sidebar .brand{justify-content:center}
.app.sidebar-collapsed .sidebar .brand>div:last-child,.app.sidebar-collapsed .sidebar .nav-title{display:none!important}
.app.sidebar-collapsed .sidebar .nav-btn{justify-content:center!important;padding:12px 10px!important;gap:0!important;font-size:inherit!important}
.app.sidebar-collapsed .sidebar .nav-btn .nav-text,.app.sidebar-collapsed .sidebar .nav-btn .nav-caret{display:none!important}
.app.sidebar-collapsed .sidebar .nav-btn .nav-emoji{font-size:20px!important;min-width:24px!important}
.app.sidebar-collapsed .sidebar .subnav{display:grid!important;gap:8px;margin:8px 0 12px!important;padding:0!important;border-left:0!important}
.app.sidebar-collapsed .sidebar .subnav a{justify-content:center!important;padding:10px 8px!important}
.app.sidebar-collapsed .sidebar .subnav a .nav-text{display:none!important}
.app.sidebar-collapsed .sidebar .subnav a .nav-emoji{font-size:18px!important;min-width:20px!important}
.dashboard-analytics .metrics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.dashboard-analytics .metric-panel{background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #dbe7fb;box-shadow:0 14px 30px rgba(32,54,96,.08)}
.dashboard-analytics .metric-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.dashboard-analytics .metric-head h3{margin:0 0 6px;font-size:18px;color:#10264d}
.dashboard-analytics .metric-head p{margin:0;color:#637693}
.dashboard-analytics .chart-host{background:#fff;border:1px solid #e7eefb;border-radius:20px;padding:14px}
.dashboard-analytics .account-cards,.dashboard-analytics .employee-grid,.dashboard-analytics .rank-list,.dashboard-analytics .color-list{margin-top:12px}
.dashboard-analytics .account-card,.dashboard-analytics .employee-card,.dashboard-analytics .color-row{background:#fff;border:1px solid #dbe7fb;box-shadow:0 8px 18px rgba(24,49,95,.05)}
.dashboard-analytics .employee-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
.dashboard-analytics .chart-empty{background:#f8fbff;border:1px dashed #d7e5fb;color:#6880a0}
#posChartDrilldown .chart-drilldown-panel{max-width:1040px}
@media(max-width:980px){.dashboard-analytics .metrics-grid{grid-template-columns:1fr}}


/* V95 tighter POS top metrics row */
#stats .metric-drill-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;align-items:stretch}
#stats .metric-drill-card{margin-bottom:0!important;min-height:116px;display:flex;flex-direction:column;justify-content:center}
#stats .metric-drill-card h2{margin:6px 0 0}
#stats .status-dashboard{margin-top:14px}
@media(max-width:980px){#stats .metric-drill-grid{grid-template-columns:1fr!important}}


/* V96 factory sidebar collapsed icons visible like POS */
.factory-page.sidebar-collapsed .sidebar .nav-btn span{display:none!important}
.factory-page.sidebar-collapsed .sidebar .nav-btn .nav-emoji{display:inline-flex!important;align-items:center!important;justify-content:center!important;visibility:visible!important;opacity:1!important;font-size:20px!important;line-height:1!important;min-width:24px!important;width:24px!important}
.factory-page.sidebar-collapsed .sidebar{width:92px!important;padding:22px 10px!important;overflow-y:auto!important}
.factory-page.sidebar-collapsed .sidebar .brand{justify-content:center!important}
.factory-page.sidebar-collapsed .sidebar .brand>div:last-child,.factory-page.sidebar-collapsed .sidebar .nav-title{display:none!important}
.factory-page.sidebar-collapsed .sidebar .nav-btn{width:44px!important;min-height:44px!important;margin:0 auto 8px!important;padding:10px!important;justify-content:center!important;align-items:center!important;gap:0!important;border-radius:14px!important;font-size:0!important}
.factory-page.sidebar-collapsed .sidebar .nav-btn.active,.factory-page.sidebar-collapsed .sidebar .nav-btn:hover{background:#e8f1ff!important;color:#1457d9!important}
.factory-page.sidebar-collapsed .sidebar .nav-btn.page-link:not(.active){background:transparent!important;color:#586684!important}

/* V97 suite móvil teléfono */
body.phone-body{background:#eaf2ff;min-height:100vh;overflow-x:hidden}.phone-shell{width:min(520px,100%);margin:0 auto;min-height:100vh;background:#f8fbff;box-shadow:0 0 0 1px #d8e6ff}.phone-shell-wide{width:min(760px,100%)}.phone-header{position:sticky;top:0;background:#071a80;color:#fff;padding:14px 16px;z-index:30;display:flex;align-items:center;justify-content:space-between}.phone-brand{display:flex;align-items:center;gap:10px}.phone-header img{width:44px;height:44px;border-radius:14px;background:#fff;padding:4px}.phone-header h1{font-size:18px;margin:0}.phone-header a{color:#fff;text-decoration:none;font-weight:1000}.phone-search-wrap{position:sticky;top:72px;z-index:28;padding:12px 14px;background:#071a80}.phone-search-wrap input{width:100%;height:48px;border:0;border-radius:16px;padding:0 16px;font-weight:900}.phone-search-results{display:none;position:absolute;left:14px;right:14px;top:64px;background:#fff;border:1px solid #d8e6ff;border-radius:18px;box-shadow:0 16px 36px rgba(15,35,80,.18);max-height:420px;overflow:auto;z-index:50}.phone-search-results.show{display:block}.phone-search-row{width:100%;border:0;background:#fff;display:grid;grid-template-columns:44px 1fr;gap:10px;text-align:left;padding:12px;border-bottom:1px solid #edf4ff}.phone-search-row img,.phone-search-row span{width:44px;height:44px;border-radius:12px;object-fit:cover;background:#eef4ff;display:grid;place-items:center}.phone-search-row b{align-self:end}.phone-search-row small{grid-column:2;color:#64748b}.phone-main{padding:16px;display:grid;gap:14px;padding-bottom:132px}.phone-card{background:#fff;border:1px solid #d8e6ff;border-radius:22px;padding:18px;box-shadow:0 12px 34px rgba(8,31,86,.08)}.phone-card h2{margin:0 0 8px;font-size:24px}.phone-card h3{margin:14px 0 8px}.phone-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.phone-action{border:1px solid #cfe0ff;border-radius:18px;padding:16px;text-decoration:none;color:#06133c;background:#f8fbff;font-weight:1000}.phone-action span{display:block;font-size:28px;margin-bottom:8px}.phone-list{display:grid;gap:10px}.phone-row{background:#f7fbff;border:1px solid #dce8ff;border-radius:16px;padding:12px;font-weight:800}.phone-row small{display:block;color:#64748b;margin-top:4px}.phone-row.error{background:#fff1f2;border-color:#fecdd3;color:#991b1b}.phone-bottom{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:min(520px,100%);background:#fff;border-top:1px solid #d8e6ff;padding:12px 12px calc(18px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,1fr);gap:8px;z-index:35;min-height:82px;box-shadow:0 -10px 30px rgba(8,31,86,.08)}.phone-bottom a{text-align:center;text-decoration:none;color:#0b5cff;font-weight:1000;font-size:12px;line-height:1.15;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:48px;border-radius:14px;touch-action:manipulation}.phone-bottom a:active{background:#eaf2ff}.phone-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.phone-tabs button{border:1px solid #cfe0ff;background:#f8fbff;border-radius:14px;padding:12px 8px;font-weight:1000;color:#173569}.phone-tabs button.active{background:#2f6df6;color:#fff;border-color:#2f6df6}.phone-scan-line{display:grid;grid-template-columns:1fr auto;gap:10px;margin:12px 0}.phone-scan-line input,.phone-form input{border:1px solid #d8e6ff;border-radius:14px;padding:12px 14px;font-weight:800;background:#fff}.scan-box{background:#0d1730;border-radius:18px;min-height:220px;display:grid;place-items:center;overflow:hidden;margin:10px 0}.scan-box video{width:100%;max-height:280px;object-fit:cover}.phone-empty,.phone-loading{padding:16px;color:#64748b;text-align:center}.phone-detail-card{border:1px solid #d8e6ff;border-radius:20px;background:#fff;margin-top:14px;overflow:hidden}.phone-detail-card summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:74px 1fr;gap:12px;align-items:center;padding:14px}.phone-detail-card summary::-webkit-details-marker{display:none}.phone-detail-card summary img,.phone-photo-empty{width:74px;height:74px;border-radius:16px;object-fit:cover;background:#eef4ff;display:grid;place-items:center}.phone-detail-card summary b{display:block;font-size:16px}.phone-detail-card summary small{display:block;color:#64748b}.stars{display:block;color:#f59e0b;letter-spacing:2px;margin-top:4px}.phone-detail-body{border-top:1px solid #eef4ff;padding:14px;display:grid;gap:10px}.phone-kv{display:flex;justify-content:space-between;gap:10px;background:#f8fbff;border:1px solid #dce8ff;border-radius:14px;padding:12px}.phone-trace-grid{display:grid;gap:10px;margin-top:12px}.phone-gallery-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.phone-product-card{background:#fff;border:2px solid #d8e6ff;border-radius:20px;padding:12px;box-shadow:0 10px 22px rgba(8,31,86,.06)}.phone-product-card.stock-high{border-color:#22c55e}.phone-product-card.stock-mid{border-color:#f59e0b}.phone-product-card.stock-low{border-color:#ef4444}.phone-product-img{height:150px;border-radius:16px;background:#eef4ff;display:grid;place-items:center;overflow:hidden;margin-bottom:10px}.phone-product-img img{width:100%;height:100%;object-fit:cover}.phone-product-card b{display:block;line-height:1.15}.phone-product-card small{display:block;color:#64748b;margin:4px 0}.phone-card-foot{display:flex;justify-content:space-between;gap:8px;font-weight:1000;color:#173569}.phone-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.btn.ghost{background:#eef4ff;color:#1350c5}.btn.wide{display:block;text-align:center;width:100%;text-decoration:none}.phone-form{display:grid;gap:10px}.phone-person{display:grid;grid-template-columns:56px 1fr auto;gap:10px;align-items:center;background:#f8fbff;border:1px solid #dce8ff;border-radius:16px;padding:10px}.phone-person img{width:56px;height:56px;border-radius:14px;object-fit:cover}.phone-person small{display:block;color:#64748b}.dash-card.admin{border-color:#d8e6ff;background:linear-gradient(180deg,#fff,#f4f8ff)}
@media(max-width:430px){.phone-gallery-grid{grid-template-columns:1fr}.phone-actions{grid-template-columns:1fr}.phone-scan-line{grid-template-columns:1fr}.phone-person{grid-template-columns:48px 1fr}.phone-person button{grid-column:1/-1}}

/* V95 sesiones, teléfono y filtros */
.session-chip{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #dbe7fb;border-radius:999px;padding:8px 13px;font-weight:900;color:#071b4a;box-shadow:0 8px 18px rgba(17,44,90,.08);white-space:nowrap}
.session-chip img{width:34px;height:34px;border-radius:50%;object-fit:cover;background:#eef4ff;border:1px solid #dbe7fb}.topbar .home-general{white-space:nowrap}.factory-status-card{margin:14px 0 16px}.factory-status-card select{border:1px solid #d7e5ff;border-radius:14px;padding:11px 14px;font-weight:800;background:#fff;color:#08245b}.sessions-desktop{display:grid;grid-template-columns:280px 1fr;min-height:100vh;background:#eaf2ff}.sessions-sidebar{background:#fff;padding:32px 26px;border-right:1px solid #dbe7fb}.sessions-logo{width:82px;height:82px;object-fit:contain}.sessions-sidebar h1{font-size:30px;margin:18px 0 4px}.sessions-sidebar p{color:#667894;margin:0 0 28px}.sessions-sidebar a{display:flex;gap:10px;align-items:center;padding:14px 16px;margin:10px 0;border:1px solid #dbe7fb;border-radius:16px;background:#f5f9ff;font-weight:900;color:#1156d9;text-decoration:none}.sessions-main{padding:30px}.sessions-grid{display:grid;grid-template-columns:minmax(320px,520px) 1fr;gap:24px}.session-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}.session-form textarea,.session-form .wide{grid-column:1/-1}.session-form input,.session-form textarea,.file-pill{border:1px solid #d7e5ff;border-radius:16px;padding:14px;font-weight:800;background:#f8fbff}.file-pill input{display:block;margin-top:8px;padding:0;border:0;background:transparent}.session-list{display:grid;gap:12px}.session-person{display:grid;grid-template-columns:56px 1fr auto auto;gap:12px;align-items:center;border:1px solid #dbe7fb;border-radius:18px;padding:12px;background:#f8fbff}.session-person img{width:56px;height:56px;border-radius:50%;object-fit:cover;background:#eaf2ff}.session-person small{display:block;color:#61738f;margin-top:3px}.phone-header-actions{display:flex;align-items:center;gap:8px}.phone-user-mini,.phone-session-chip{display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:6px 8px;color:#fff;font-weight:900;font-size:11px}.phone-user-mini img,.phone-session-chip img{width:24px;height:24px;border-radius:50%;object-fit:cover;background:#fff}.phone-head-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.phone-session-chip{background:#eef5ff;color:#08245b;border-color:#dbe7fb;font-size:12px}.phone-tabs button{border:1px solid #cfe0ff;background:#fff}.phone-filter-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.phone-filter-grid input,.phone-filter-grid select,.phone-order-card input{width:100%;border:1px solid #d7e5ff;border-radius:14px;padding:11px;font-weight:800;background:#fff}.phone-product-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.phone-product-card{text-align:left;border:2px solid #dbe7fb;border-radius:18px;background:#fff;padding:10px;min-height:230px;display:flex;flex-direction:column;gap:5px}.phone-product-card img,.phone-img-empty{width:100%;height:126px;border-radius:14px;background:#eef4ff;object-fit:cover;display:flex;align-items:center;justify-content:center}.phone-product-card b{font-size:12px;line-height:1.05}.phone-product-card small{color:#667894}.phone-product-card div:last-child{display:flex;justify-content:space-between;align-items:center;font-weight:900}.phone-product-card.stock-high{border-color:#27c16f}.phone-product-card.stock-mid{border-color:#f7c948}.phone-product-card.stock-low{border-color:#ff4d4f}.phone-row.phone-order-card,.phone-row.phone-client-card{display:grid;grid-template-columns:1fr auto;cursor:pointer}.phone-expand{display:none;grid-column:1/-1;margin-top:10px;background:#f8fbff;border:1px solid #e3edff;border-radius:14px;padding:10px}.phone-order-card.open .phone-expand,.phone-client-card.open .phone-expand{display:block}.phone-modal{position:fixed;inset:0;background:rgba(4,20,55,.42);z-index:9999;display:none;padding:18px;overflow:auto}.phone-modal.show{display:block}.phone-modal-panel{max-width:430px;margin:20px auto;background:#fff;border-radius:24px;border:1px solid #dbe7fb;padding:18px;position:relative}.phone-modal-close{position:absolute;right:14px;top:14px;border:0;background:#eef4ff;border-radius:50%;width:36px;height:36px;font-size:20px;font-weight:900}@media(max-width:860px){.sessions-desktop{grid-template-columns:1fr}.sessions-sidebar{border-right:0}.sessions-grid{grid-template-columns:1fr}.session-form{grid-template-columns:1fr}.session-person{grid-template-columns:48px 1fr}.session-person button{grid-column:auto}}

/* phone POS mobile create order expansion */
.phone-block{display:grid;gap:12px}.phone-block label span{display:block;font-size:13px;font-weight:900;color:#31456d;margin:0 0 6px}.phone-block input,.phone-block select,.phone-block textarea{width:100%;border:1px solid #d7e5ff;border-radius:14px;padding:12px 14px;font-weight:800;background:#fff;color:#0b1d4d}.phone-block textarea{min-height:86px;resize:vertical}.phone-create-grid{grid-template-columns:1fr 1fr}.phone-create-grid .wide{grid-column:1/-1}.phone-soft-panel{background:#f8fbff;border:1px solid #dbe7fb;border-radius:18px;padding:14px}.phone-scanner-panel h3{margin:0 0 10px}.phone-scanner-row{display:grid;grid-template-columns:1.2fr 92px 1.8fr;gap:10px;align-items:center}.phone-check{display:flex;gap:8px;align-items:center;font-weight:900;color:#0b1d4d}.phone-check input{width:auto}.phone-scanner-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.phone-upload-btn{cursor:pointer}.phone-scanner-box{margin-top:12px;border:1px dashed #bfd4ff;border-radius:18px;min-height:88px;display:grid;place-items:center;text-align:center;color:#60728e;background:#fff;padding:16px}.create-product-grid{max-height:720px;overflow:auto;padding-right:4px}.phone-inline-note{background:#eef5ff;border:1px solid #d7e5ff;border-radius:16px;padding:10px 12px;color:#15366f}.phone-inline-note small{display:block;color:#60728e;margin-top:4px}.phone-suggest-row{width:100%;border:1px solid #dce8ff;background:#fff;border-radius:14px;padding:11px 12px;text-align:left;font-weight:900;color:#0b1d4d}.phone-suggest-row small{display:block;color:#60728e;margin-top:4px}.phone-cart-note{background:#eef5ff;border:1px solid #cfe0ff;border-radius:18px;padding:14px}.phone-cart-note b{display:block;color:#143e90}.phone-cart-note small{display:block;color:#4a6388;margin-top:5px}.phone-cart-list{display:grid;gap:12px}.phone-empty-state{background:#f7fbff;border:1px solid #dce8ff;border-radius:16px;padding:16px;font-weight:900;color:#4a6388}.phone-cart-item{background:#f7fbff;border:1px solid #dce8ff;border-radius:18px;padding:12px}.phone-cart-top{display:flex;justify-content:space-between;gap:10px}.phone-cart-top b{display:block}.phone-cart-top small{display:block;color:#64748b;margin-top:4px}.phone-remove-item{border:0;background:#fee2e2;color:#b91c1c;border-radius:12px;width:34px;height:34px;font-weight:1000;cursor:pointer}.phone-cart-controls{display:grid;grid-template-columns:160px 1fr;gap:12px;align-items:end;margin-top:12px}.phone-cart-controls label span{display:block;font-size:12px;margin-bottom:6px;color:#50688f;font-weight:900}.phone-qty-stepper{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;border:1px solid #d7e5ff;border-radius:14px;overflow:hidden;background:#fff}.phone-qty-stepper button{border:0;background:#eef4ff;color:#0b1d4d;font-size:20px;font-weight:1000;height:42px;cursor:pointer}.phone-qty-stepper input{border:0!important;border-radius:0!important;text-align:center;padding:0 8px!important;height:42px}.phone-cart-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px;font-weight:1000;color:#0b1d4d}.phone-totals-box{background:#f3f8ff;border:1px solid #dbe7fb;border-radius:20px;padding:14px;display:grid;gap:8px}.phone-totals-box>div{display:flex;justify-content:space-between;gap:10px;color:#36527c}.phone-totals-box>div b{color:#0b1d4d}.phone-totals-box .grand{padding-top:8px;border-top:1px solid #d7e5ff;font-size:18px;font-weight:1000;color:#08245b}.phone-action-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.btn.success{background:#11b981}.btn.danger.ghost-soft{background:#fdecec;color:#b42318;border:1px solid #f4caca}.hidden{display:none!important}.phone-create-modal{max-width:760px}.phone-modal-grid{display:grid;grid-template-columns:220px 1fr;gap:22px;align-items:start}.phone-modal-image img,.phone-modal-image .phone-img-empty{width:100%;height:220px;border-radius:18px;object-fit:cover;background:#eef4ff;display:grid;place-items:center}.phone-modal-info h2{margin:0 0 10px;font-size:22px;line-height:1.1}.phone-modal-price{font-size:18px;font-weight:1000;color:#0b1d4d;margin-bottom:10px}.phone-modal-info p{margin:0 0 12px;color:#536987}.phone-color-row{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#f8fbff;border:1px solid #dbe7fb;border-radius:14px;padding:10px 12px}.phone-color-row b{display:flex;align-items:center;gap:8px}.phone-color-row i{display:inline-block;width:24px;height:24px;border-radius:8px;border:2px solid #fff;box-shadow:0 0 0 2px #d7e5ff}.phone-variant-wrap{display:grid;gap:8px;margin-top:12px}.phone-variant-wrap>span{font-weight:900;color:#31456d}.phone-variant-list{display:flex;flex-wrap:wrap;gap:8px}.phone-variant-pill{border:1px solid #cfe0ff;background:#f8fbff;color:#173569;border-radius:999px;padding:8px 12px;font-weight:900;cursor:pointer}.phone-variant-pill.active{background:#2f6df6;color:#fff;border-color:#2f6df6}.phone-modal-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.phone-modal-form label span{display:block;font-size:12px;margin-bottom:6px;color:#50688f;font-weight:900}@media(max-width:640px){.phone-scanner-row,.phone-cart-controls,.phone-modal-grid,.phone-modal-form,.phone-action-pair{grid-template-columns:1fr}.phone-create-grid,.phone-filter-grid{grid-template-columns:1fr}.phone-create-modal{max-width:430px}.phone-scanner-actions{display:grid;grid-template-columns:1fr}.create-product-grid{max-height:none}}

/* V99 clientes móviles: render total + pedidos desplegables */
.phone-mobile-search{width:100%!important;border:1px solid #d7e5ff!important;border-radius:16px!important;padding:13px 14px!important;font-weight:900!important;background:#fff!important;color:#08245b!important;margin:8px 0 12px!important}.phone-client-list{gap:12px}.phone-row.phone-client-card{display:grid!important;grid-template-columns:1fr auto!important;gap:10px!important;align-items:center!important;padding:12px!important}.phone-client-main{display:grid;grid-template-columns:46px 1fr;gap:10px;align-items:center;min-width:0}.phone-client-main b{display:block;font-size:14px;line-height:1.15}.phone-client-avatar{width:46px;height:46px;border-radius:14px;background:#eaf2ff;color:#0b5cff;display:grid;place-items:center;font-weight:1000;border:1px solid #d7e5ff}.phone-order-count{background:#edf4ff;border:1px solid #d7e5ff;border-radius:999px;padding:8px 10px;font-weight:1000;color:#0b5cff;font-size:12px;white-space:nowrap}.phone-client-card .phone-expand h3{margin:0 0 10px;font-size:16px;color:#08245b}.phone-client-order{background:#fff!important}.phone-client-order b{display:block;color:#08245b}@media(max-width:430px){.phone-row.phone-client-card{grid-template-columns:1fr!important}.phone-order-count{width:max-content}.phone-client-main{grid-template-columns:42px 1fr}.phone-client-avatar{width:42px;height:42px}}

/* v101 mobile gallery fixes: filters + details render downward */
.phone-gallery-filter-card{overflow:visible}.phone-gallery-filters{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.phone-gallery-filters input,.phone-gallery-filters select{min-width:0;width:100%;border:1px solid #d8e6ff;border-radius:14px;padding:12px 14px;font-weight:900;background:#fff;color:#071a40}.phone-gallery-filters #galleryFilter{grid-column:1/-1}.phone-gallery-filters #reloadGallery{grid-column:1/-1}.phone-gallery-grid{align-items:start}.phone-product-card{min-width:0;overflow:hidden;transition:box-shadow .18s ease,transform .18s ease}.phone-product-card.expanded{grid-column:1/-1}.phone-product-main{display:grid;grid-template-columns:1fr;gap:8px;min-width:0}.phone-product-info{min-width:0}.phone-product-info b,.phone-product-info small{overflow-wrap:anywhere}.phone-detail-slot{min-width:0;overflow:hidden}.phone-product-card.expanded .phone-product-main{grid-template-columns:118px 1fr;align-items:start}.phone-product-card.expanded .phone-product-img{height:118px}.phone-product-card.expanded .phone-detail-card{margin-top:12px;width:100%;max-width:100%;box-sizing:border-box}.phone-product-card.expanded .phone-detail-card summary{grid-template-columns:54px 1fr}.phone-product-card.expanded .phone-detail-card summary img,.phone-product-card.expanded .phone-photo-empty{width:54px;height:54px}.phone-detail-body{min-width:0}.phone-detail-body p{overflow-wrap:anywhere}.phone-kv{min-width:0;align-items:center}.phone-kv b,.phone-kv span{min-width:0;overflow-wrap:anywhere}.phone-list{min-width:0}.phone-row{min-width:0;overflow-wrap:anywhere}@media(max-width:430px){.phone-gallery-filters{grid-template-columns:1fr 1fr}.phone-gallery-filters #galleryFilter,.phone-gallery-filters #reloadGallery{grid-column:1/-1}.phone-product-card.expanded .phone-product-main{grid-template-columns:92px 1fr}.phone-product-card.expanded .phone-product-img{height:92px}.phone-product-card.expanded .phone-detail-card summary{grid-template-columns:48px 1fr}.phone-product-card.expanded .phone-detail-card summary img,.phone-product-card.expanded .phone-photo-empty{width:48px;height:48px}.phone-detail-body{gap:8px}.phone-kv{display:grid;grid-template-columns:1fr}.phone-card h2{font-size:22px}}

/* v102: galería móvil - texto dentro de cards sin romperse ni encimarse */
.phone-gallery-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:start;
}
.phone-product-card{
  min-width:0;
  overflow:hidden;
  display:block !important;
  padding:10px;
  border-radius:18px;
  box-sizing:border-box;
}
.phone-product-card:not(.expanded){
  min-height:272px;
}
.phone-product-main{
  display:block !important;
  min-width:0;
}
.phone-product-img{
  width:100%;
  height:138px;
  margin:0 0 9px;
  border-radius:14px;
  background:#eef4ff;
  overflow:hidden;
}
.phone-product-img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.phone-product-info{
  min-width:0;
  width:100%;
  display:grid;
  gap:3px;
}
.phone-product-info b{
  display:-webkit-box !important;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
  overflow-wrap:normal !important;
  word-break:normal !important;
  white-space:normal;
  font-size:12px;
  line-height:1.08;
  min-height:39px;
  letter-spacing:-.2px;
}
.phone-product-info small{
  display:block !important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow-wrap:normal !important;
  word-break:normal !important;
  font-size:10px;
  line-height:1.15;
  color:#65748b;
  margin:0;
}
.phone-card-foot{
  display:flex !important;
  justify-content:space-between;
  align-items:flex-end;
  gap:8px;
  width:100%;
  margin-top:5px;
  font-weight:1000;
  color:#06133c;
}
.phone-card-foot span{
  display:block;
  white-space:nowrap;
  font-size:12px;
  line-height:1.1;
}
.phone-actions-row{
  width:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.phone-actions-row.hidden{display:none !important;}
.phone-product-card.expanded{
  grid-column:1/-1;
  min-height:auto;
  overflow:visible;
}
.phone-product-card.expanded .phone-product-main{
  display:grid !important;
  grid-template-columns:96px minmax(0,1fr);
  gap:10px;
  align-items:start;
}
.phone-product-card.expanded .phone-product-img{
  height:96px;
  margin:0;
}
.phone-product-card.expanded .phone-product-info b{
  -webkit-line-clamp:4;
  min-height:auto;
  font-size:13px;
}
.phone-detail-slot{
  display:block !important;
  width:100%;
  min-width:0;
  overflow:visible;
}
.phone-detail-slot .phone-detail-card{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}
@media(max-width:390px){
  .phone-gallery-grid{gap:10px;}
  .phone-product-card{padding:8px;}
  .phone-product-img{height:124px;}
  .phone-product-info b{font-size:11px;min-height:36px;}
  .phone-card-foot span{font-size:11px;}
}

/* v103: galería móvil - corrección real del acomodo de textos
   El CSS viejo tenía .phone-product-card div:last-child { display:flex } y eso estaba
   convirtiendo .phone-product-info en flex, por eso el título/SKU/stock/precio se encimaban. */
.phone-gallery-grid .phone-product-card .phone-product-main{
  display:flex !important;
  flex-direction:column !important;
  gap:0 !important;
  min-width:0 !important;
  width:100% !important;
}
.phone-gallery-grid .phone-product-card .phone-product-info{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:4px !important;
  width:100% !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}
.phone-gallery-grid .phone-product-card .phone-product-info > b,
.phone-gallery-grid .phone-product-card .phone-product-info > small,
.phone-gallery-grid .phone-product-card .phone-product-info > .phone-card-foot{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  flex:none !important;
}
.phone-gallery-grid .phone-product-card .phone-product-info > b{
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:3 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
  hyphens:none !important;
  font-size:12px !important;
  line-height:1.12 !important;
  min-height:41px !important;
  margin:0 !important;
  color:#06133c !important;
}
.phone-gallery-grid .phone-product-card .phone-product-info > small{
  display:block !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  font-size:10px !important;
  line-height:1.2 !important;
  margin:0 !important;
  color:#64748b !important;
}
.phone-gallery-grid .phone-product-card .phone-card-foot{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  margin-top:7px !important;
  padding-top:3px !important;
  width:100% !important;
  color:#06133c !important;
}
.phone-gallery-grid .phone-product-card .phone-card-foot span{
  display:block !important;
  width:auto !important;
  min-width:max-content !important;
  white-space:nowrap !important;
  font-size:12px !important;
  line-height:1.1 !important;
  font-weight:1000 !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded){
  min-height:292px !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-img{
  height:140px !important;
  flex:none !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-main{
  display:grid !important;
  grid-template-columns:96px minmax(0,1fr) !important;
  gap:10px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-info{
  display:flex !important;
  flex-direction:column !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-info > b{
  -webkit-line-clamp:4 !important;
  min-height:auto !important;
  font-size:13px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-info > small{
  white-space:normal !important;
}
@media(max-width:390px){
  .phone-gallery-grid .phone-product-card{padding:8px !important;}
  .phone-gallery-grid .phone-product-card:not(.expanded){min-height:282px !important;}
  .phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-img{height:130px !important;}
  .phone-gallery-grid .phone-product-card .phone-product-info > b{font-size:11px !important;min-height:38px !important;}
  .phone-gallery-grid .phone-product-card .phone-product-info > small{font-size:9.5px !important;}
  .phone-gallery-grid .phone-product-card .phone-card-foot span{font-size:11px !important;}
}

/* v104: Galería móvil - detalles siempre hacia abajo, sin textos encimados */
.phone-gallery-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
}
.phone-gallery-grid .phone-product-card{
  position:relative !important;
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-main{
  display:flex !important;
  flex-direction:column !important;
  width:100% !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-info{
  display:flex !important;
  flex-direction:column !important;
  width:100% !important;
  min-width:0 !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-info > b{
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:3 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:normal !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  font-size:11px !important;
  line-height:1.1 !important;
  min-height:37px !important;
  max-height:37px !important;
}
.phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-info > small{
  display:block !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  max-width:100% !important;
}
.phone-gallery-grid .phone-product-card.expanded{
  grid-column:1 / -1 !important;
  width:100% !important;
  overflow:visible !important;
  padding:12px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-main{
  display:grid !important;
  grid-template-columns:112px minmax(0,1fr) !important;
  gap:12px !important;
  align-items:start !important;
  width:100% !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-img{
  width:112px !important;
  height:112px !important;
  margin:0 !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-info{
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
  width:100% !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-product-info > b{
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:4 !important;
  overflow:hidden !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
  font-size:13px !important;
  line-height:1.15 !important;
  min-height:auto !important;
  max-height:none !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-actions-row{
  margin-top:12px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-slot{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
  margin-top:12px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
  margin:0 !important;
  box-sizing:border-box !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-card summary{
  display:grid !important;
  grid-template-columns:56px minmax(0,1fr) !important;
  gap:10px !important;
  padding:12px !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-card summary b,
.phone-gallery-grid .phone-product-card.expanded .phone-detail-card summary small{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-body{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  padding:12px !important;
  box-sizing:border-box !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-body p{
  margin:0 !important;
  line-height:1.35 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-kv{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:4px !important;
  align-items:start !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  padding:10px !important;
  box-sizing:border-box !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-kv b,
.phone-gallery-grid .phone-product-card.expanded .phone-kv span{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-list,
.phone-gallery-grid .phone-product-card.expanded .phone-row{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-row b,
.phone-gallery-grid .phone-product-card.expanded .phone-row small{
  white-space:normal !important;
  overflow-wrap:break-word !important;
  word-break:normal !important;
}
@media(max-width:430px){
  .phone-gallery-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .phone-gallery-grid .phone-product-card{padding:8px !important;}
  .phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-img{height:122px !important;}
  .phone-gallery-grid .phone-product-card:not(.expanded) .phone-product-info > b{
    font-size:10.5px !important;
    line-height:1.08 !important;
    min-height:35px !important;
    max-height:35px !important;
  }
  .phone-gallery-grid .phone-product-card.expanded .phone-product-main{
    grid-template-columns:96px minmax(0,1fr) !important;
  }
  .phone-gallery-grid .phone-product-card.expanded .phone-product-img{
    width:96px !important;
    height:96px !important;
  }
}

/* v105 galería móvil agrupada por producto */
.phone-gallery-grid .phone-product-card.expanded{
  grid-column:1 / -1 !important;
  width:100% !important;
  max-width:100% !important;
}
.phone-gallery-grid .phone-product-card.expanded .phone-detail-slot{
  display:block !important;
  width:100% !important;
  overflow:visible !important;
}
.gallery-product-detail{
  width:100% !important;
  max-width:100% !important;
}
.gallery-product-detail summary{
  display:grid !important;
  grid-template-columns:58px minmax(0,1fr) !important;
  gap:12px !important;
  align-items:center !important;
}
.gallery-product-detail summary b,
.gallery-product-detail summary small{
  display:block !important;
  min-width:0 !important;
  overflow-wrap:anywhere !important;
  white-space:normal !important;
}
.phone-variation-list{
  display:grid;
  gap:10px;
  width:100%;
  min-width:0;
}
.phone-variation-row{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  align-items:start;
  background:#f7fbff;
  border:1px solid #dce8ff;
  border-radius:16px;
  padding:12px;
  min-width:0;
}
.phone-variation-head,
.phone-variation-badges{
  min-width:0;
}
.phone-variation-row b,
.phone-variation-row small{
  display:block;
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
  word-break:break-word;
}
.phone-variation-row b{font-size:14px;line-height:1.25;color:#071a40;}
.phone-variation-row small{color:#64748b;margin-top:4px;font-size:11px;line-height:1.35;}
.phone-variation-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.phone-variation-row i{width:16px;height:16px;border-radius:50%;border:1px solid #d4deef;box-shadow:0 0 0 2px #fff;display:block;flex:0 0 auto;}
.phone-variation-color,
.phone-variation-row strong,
.phone-price-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  max-width:100%;
  min-width:0;
  padding:7px 10px;
  border-radius:999px;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.25;
  font-size:12px;
  font-weight:1000;
}
.phone-variation-color{background:#fff;border:1px solid #dce8ff;color:#334155;}
.phone-variation-row strong{background:#eef5ff;color:#0b5cff;}
.phone-price-badge{background:#eefbf5;border:1px solid #c9f0dc;color:#166534;}
@media(max-width:430px){
  .phone-variation-badges{display:grid;grid-template-columns:1fr;}
  .phone-variation-color,
  .phone-variation-row strong,
  .phone-price-badge{justify-content:flex-start;}
}


/* v107 FIX REAL: variaciones de galería móvil en lista vertical, sin columnas comprimidas */
.phone-gallery-grid .phone-product-card.expanded .phone-detail-body,
.phone-gallery-grid .phone-product-card.expanded .gallery-product-detail .phone-detail-body {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-list,
.gallery-product-detail .phone-variation-list {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-row,
.gallery-product-detail .phone-variation-row {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
  justify-items: stretch !important;
  box-sizing: border-box !important;
  padding: 12px !important;
  overflow: visible !important;
  white-space: normal !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-head,
.phone-gallery-grid .phone-product-card.expanded .phone-variation-badges,
.gallery-product-detail .phone-variation-head,
.gallery-product-detail .phone-variation-badges {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-head b,
.phone-gallery-grid .phone-product-card.expanded .phone-variation-head small,
.gallery-product-detail .phone-variation-head b,
.gallery-product-detail .phone-variation-head small {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.35 !important;
  text-align: left !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-badges,
.gallery-product-detail .phone-variation-badges {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-color,
.phone-gallery-grid .phone-product-card.expanded .phone-variation-row strong,
.phone-gallery-grid .phone-product-card.expanded .phone-price-badge,
.gallery-product-detail .phone-variation-color,
.gallery-product-detail .phone-variation-row strong,
.gallery-product-detail .phone-price-badge {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: inline-flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.25 !important;
  box-sizing: border-box !important;
}

.phone-gallery-grid .phone-product-card.expanded .phone-variation-color,
.gallery-product-detail .phone-variation-color {
  grid-column: 1 / -1 !important;
}

@media (max-width: 520px) {
  .phone-gallery-grid .phone-product-card.expanded .phone-variation-badges,
  .gallery-product-detail .phone-variation-badges {
    grid-template-columns: 1fr !important;
  }
}


.phone-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
.phone-stat{background:#f7fbff;border:1px solid #dce8ff;border-radius:16px;padding:14px;text-align:left}
.phone-stat strong{display:block;font-size:18px;line-height:1.05;color:#0b1c72}
.phone-stat span{display:block;margin-top:6px;font-weight:900;color:#173569}
.phone-stat small{display:block;margin-top:4px;color:#64748b;font-weight:700}
.phone-subsection{border:1px solid #dce8ff;border-radius:18px;background:#fbfdff;padding:14px;margin-bottom:14px}
.phone-subsection h3{margin:0 0 10px;font-size:18px;color:#0d1730}
.phone-goal-card{background:linear-gradient(135deg,#f8fbff,#eef4ff)}
.phone-goal-copy{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.phone-goal-copy b{display:block;font-size:18px;color:#0b1c72}
.phone-goal-copy small{display:block;color:#64748b;margin-top:4px}
.phone-goal-pill{min-width:68px;height:68px;border-radius:999px;background:#2f6df6;color:#fff;display:grid;place-items:center;font-weight:1000;font-size:18px;box-shadow:0 10px 22px rgba(47,109,246,.24)}
.phone-goal-inputs{display:grid;grid-template-columns:1fr auto;gap:10px}
.phone-goal-inputs input{border:1px solid #d8e6ff;border-radius:14px;padding:12px 14px;font-weight:800;background:#fff;min-width:0}
.phone-goal-inputs .btn{padding:12px 14px;border-radius:14px}
.phone-subsection .phone-list{gap:8px}
.phone-subsection .phone-row{padding:11px 12px}

/* v108 fábrica móvil: tarjetas desplegables de proceso y terminados */
.phone-order-details-card{
  border:1px solid #dce8ff;
  border-radius:18px;
  background:#fbfdff;
  overflow:hidden;
}
.phone-order-details-card + .phone-order-details-card{margin-top:12px;}
.phone-order-details-card summary{
  list-style:none;
  cursor:pointer;
  padding:14px;
}
.phone-order-details-card summary::-webkit-details-marker{display:none;}
.phone-order-summary-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.phone-order-summary-copy{min-width:0;display:grid;gap:8px;}
.phone-order-summary-copy h3{
  margin:0;
  font-size:17px;
  line-height:1.2;
  color:#0d1730;
  overflow-wrap:anywhere;
}
.phone-order-summary-copy small{
  color:#64748b;
  font-weight:800;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.phone-expand-indicator{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #dbe7ff;
  background:#eef4ff;
  color:#2353d1;
  font-weight:1000;
  font-size:12px;
}
.phone-order-details-card[open] .phone-expand-indicator::after{content:'▲';font-size:9px;margin-left:6px;}
.phone-order-details-card:not([open]) .phone-expand-indicator::after{content:'▼';font-size:9px;margin-left:6px;}
.phone-order-context{
  display:grid;
  gap:12px;
  padding:0 14px 14px;
  border-top:1px solid #e7eefc;
}
.phone-order-topcard,
.phone-order-general-card,
.phone-order-section-card,
.phone-order-empty-card{
  border:1px solid #dce8ff;
  border-radius:18px;
  background:#fff;
}
.phone-order-topcard{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  padding:12px;
  align-items:start;
}
.phone-order-topcopy{min-width:0;display:grid;gap:10px;}
.phone-order-topcopy h4{
  margin:0;
  font-size:18px;
  line-height:1.2;
  color:#0b1c72;
  overflow-wrap:anywhere;
}
.phone-order-thumb{
  width:68px;
  height:68px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid #dce8ff;
  background:#f3f6fb;
}
.phone-order-chip-row{display:flex;flex-wrap:wrap;gap:8px;}
.phone-chip-soft,
.phone-mini-pill,
.phone-download-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:999px;
  background:#f4f8ff;
  border:1px solid #dbe7ff;
  color:#173569;
  font-size:12px;
  font-weight:1000;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.phone-mini-pill{background:#eef4ff;color:#2353d1;}
.phone-download-chip{text-decoration:none;background:#fff;}
.phone-order-general-card{padding:12px;display:grid;gap:12px;}
.phone-order-cap-image,
.phone-order-section-image{
  border:1px solid #dce8ff;
  border-radius:16px;
  background:#f7fbff;
  overflow:hidden;
  min-height:132px;
  display:grid;
  place-items:center;
}
.phone-order-cap-image img,
.phone-order-section-image img{width:100%;height:100%;object-fit:cover;display:block;}
.phone-order-grid{display:grid;grid-template-columns:1fr;gap:10px;}
.phone-order-kv,
.phone-order-note-card,
.phone-order-files-card{
  border:1px solid #dce8ff;
  border-radius:16px;
  background:#f9fbff;
  padding:12px;
  display:grid;
  gap:6px;
}
.phone-order-kv b,
.phone-order-note-card b,
.phone-order-files-card b{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#63789d;margin:0;}
.phone-order-kv small,
.phone-order-note-card small,
.phone-order-files-card small{font-size:15px;line-height:1.3;color:#071a40;font-weight:1000;overflow-wrap:anywhere;}
.phone-order-note-card{background:#fff8f0;border-color:#f1d0a7;}
.phone-order-files-wrap{display:flex;flex-wrap:wrap;gap:8px;}
.phone-order-sections-wrap{display:grid;gap:12px;}
.phone-order-section-card{padding:12px;display:grid;gap:12px;}
.phone-order-section-head{display:grid;gap:10px;}
.phone-order-section-head h4{margin:0;font-size:17px;line-height:1.2;color:#0d1730;overflow-wrap:anywhere;}
.phone-order-section-head p{margin:0;color:#5f728f;font-weight:1000;line-height:1.3;}
.phone-order-metric{
  justify-self:start;
  padding:8px 12px;
  border-radius:14px;
  background:#f4f8ff;
  border:1px solid #dbe7ff;
  color:#0b1c72;
  font-weight:1000;
}
.phone-order-steps{display:grid;gap:10px;}
.phone-order-step{
  display:grid;
  grid-template-columns:36px 18px minmax(0,1fr);
  gap:10px;
  align-items:start;
  border:1px solid #dce8ff;
  border-radius:16px;
  background:#fbfdff;
  padding:10px;
}
.phone-step-num{
  width:36px;
  height:36px;
  border-radius:999px;
  background:#eef4ff;
  color:#2f6df6;
  font-weight:1000;
  display:grid;
  place-items:center;
}
.phone-color-dot{
  width:18px;
  height:18px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.16);
  box-shadow:0 0 0 2px #fff;
  margin-top:9px;
}
.phone-order-step-copy{min-width:0;display:grid;gap:3px;}
.phone-order-step-copy b{font-size:15px;color:#071a40;overflow-wrap:anywhere;}
.phone-order-step-copy small{font-size:12px;color:#63789d;font-weight:900;overflow-wrap:anywhere;}
.phone-eva-badge{
  grid-column:1 / -1;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid #dce8ff;
  background:#fff;
}
.phone-eva-badge small{font-size:12px;color:#071a40;font-weight:1000;overflow-wrap:anywhere;}
.phone-order-bottom-grid{gap:10px;}
.phone-order-empty,
.phone-order-empty-card{
  color:#64748b;
  font-weight:900;
  text-align:center;
}
.phone-order-empty{padding:18px;}
.phone-order-empty-card{padding:16px;background:#f7fbff;}
@media (min-width: 520px){
  .phone-order-grid,
  .phone-order-bottom-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* v109 fábrica móvil: acciones de terminar/reenvío dentro de tarjetas responsive */
.phone-summary-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  flex:0 0 auto;
}
.phone-summary-btn{
  border:1px solid #dbe7ff;
  border-radius:999px;
  padding:8px 12px;
  background:#2f6df6;
  color:#fff;
  font-weight:1000;
  font-size:12px;
  line-height:1;
  box-shadow:0 8px 18px rgba(47,109,246,.18);
}
.phone-summary-btn.phone-resend-order{
  background:#fff7ed;
  color:#9a3412;
  border-color:#fed7aa;
  box-shadow:none;
}
.phone-order-mobile-actions{
  border:1px solid #dce8ff;
  border-radius:18px;
  background:#f8fbff;
  padding:12px;
  display:grid;
  gap:12px;
}
.phone-finish-title{
  display:grid;
  gap:4px;
}
.phone-finish-title b{
  color:#0b1c72;
  font-size:16px;
  line-height:1.2;
}
.phone-finish-title small{
  color:#64748b;
  font-weight:800;
  line-height:1.3;
}
.phone-finish-box label{
  display:grid;
  gap:7px;
  color:#173569;
  font-size:13px;
  font-weight:1000;
}
.phone-finish-box input[type="number"],
.phone-finish-box input[type="file"]{
  width:100%;
  min-width:0;
  border:1px solid #d8e6ff;
  border-radius:14px;
  background:#fff;
  color:#071a40;
  padding:11px 12px;
  font-weight:900;
  box-sizing:border-box;
}
.phone-admin-check{
  display:flex !important;
  grid-template-columns:none !important;
  align-items:center;
  gap:10px !important;
  border:1px dashed #b7c9ef;
  border-radius:14px;
  background:#fff;
  padding:11px 12px;
}
.phone-admin-check input{width:18px;height:18px;accent-color:#2f6df6;}
.phone-finish-submit,
.phone-resend-box .phone-resend-order{
  width:100%;
  min-height:46px;
  border-radius:14px;
  justify-content:center;
}
.phone-resend-box{
  background:#fff7ed;
  border-color:#fed7aa;
}
@media (max-width: 430px){
  .phone-order-summary-head{align-items:stretch;}
  .phone-summary-actions{align-items:flex-end;min-width:82px;}
  .phone-summary-btn,.phone-expand-indicator{padding:8px 10px;font-size:11px;}
}

/* v113 fábrica móvil: flotante editable antes de reenviar */
body.phone-modal-open{overflow:hidden}
.phone-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(2,12,38,.58);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px;
}
.phone-resend-modal{
  width:min(440px,100%);
  max-height:94vh;
  background:#f8fbff;
  border:1px solid #cfe0ff;
  border-radius:24px 24px 18px 18px;
  box-shadow:0 22px 70px rgba(10,30,80,.30);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.phone-resend-modal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:16px;
  background:linear-gradient(135deg,#0a1c86,#286ff4);
  color:white;
}
.phone-resend-modal-head h3{margin:6px 0 2px;font-size:18px;line-height:1.12}
.phone-resend-modal-head small{color:rgba(255,255,255,.85);font-weight:800}
.phone-modal-close{
  border:0;
  width:36px;
  height:36px;
  border-radius:14px;
  background:rgba(255,255,255,.16);
  color:white;
  font-size:26px;
  line-height:1;
  font-weight:900;
}
.phone-resend-modal-body{
  overflow:auto;
  padding:14px;
  display:grid;
  gap:12px;
}
.phone-resend-general-editor,
.phone-resend-section-editor,
.phone-resend-step-editor{
  background:white;
  border:1px solid #d7e5ff;
  border-radius:18px;
  padding:12px;
  display:grid;
  gap:10px;
}
.phone-resend-general-editor h4,
.phone-resend-sections-editor h4,
.phone-resend-section-editor h5{margin:0;color:#071d67}
.phone-resend-sections-editor{display:grid;gap:12px}
.phone-resend-section-title,
.phone-resend-step-head{display:flex;align-items:center;gap:8px;color:#06184d}
.phone-resend-modal label{
  display:grid;
  gap:5px;
  color:#60739a;
  font-size:11px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.phone-resend-modal input,
.phone-resend-modal select,
.phone-resend-modal textarea{
  width:100%;
  border:1px solid #cfe0ff;
  border-radius:13px;
  padding:11px 12px;
  background:#f9fcff;
  color:#06184d;
  font-size:14px;
  font-weight:850;
  outline:none;
}
.phone-resend-modal textarea{min-height:74px;resize:vertical;text-transform:none;letter-spacing:0;font-weight:750}
.phone-resend-modal input[type="color"]{height:44px;padding:5px}
.phone-resend-grid-2,
.phone-resend-files{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.phone-resend-step-editor{background:#f8fbff}
.phone-resend-modal-footer{
  border-top:1px solid #d7e5ff;
  background:white;
  padding:12px;
  display:grid;
  grid-template-columns:1fr 1.4fr;
  gap:10px;
}
.phone-resend-modal-footer .btn{width:100%;border-radius:15px;padding:13px 12px}
@media(max-width:430px){
  .phone-modal-backdrop{padding:0;align-items:stretch}
  .phone-resend-modal{max-height:100vh;border-radius:0;width:100%}
  .phone-resend-grid-2,.phone-resend-files{grid-template-columns:1fr}
  .phone-resend-modal-footer{grid-template-columns:1fr}
}

/* v115: pasos de color en reenvío mobile: solo lectura + opción borrar */
.phone-resend-step-readonly{
  background:#f8fbff;
  border-style:dashed;
}
.phone-resend-step-head{
  justify-content:space-between;
  align-items:flex-start;
}
.phone-resend-step-title{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.phone-step-delete{
  border:1px solid #fecaca;
  background:#fff5f5;
  color:#b91c1c;
  border-radius:12px;
  padding:8px 10px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.phone-resend-step-static-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.phone-resend-static-card{
  border:1px solid #d7e5ff;
  background:white;
  border-radius:14px;
  padding:10px;
  display:grid;
  gap:4px;
  min-width:0;
}
.phone-resend-static-card small{
  color:#60739a;
  font-size:10px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.phone-resend-static-card b{
  color:#06184d;
  font-size:13px;
  line-height:1.15;
  overflow-wrap:anywhere;
  display:flex;
  align-items:center;
  gap:7px;
}
.phone-resend-static-card span{
  color:#60739a;
  font-size:11px;
  font-weight:800;
  overflow-wrap:anywhere;
}
.phone-resend-color-dot{
  width:16px;
  height:16px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.18);
  box-shadow:0 1px 3px rgba(0,0,0,.12);
  flex:0 0 auto;
}
.phone-resend-step-deleted{
  border:1px solid #fecaca;
  background:#fff5f5;
  border-radius:14px;
  padding:12px;
  display:grid;
  gap:4px;
  color:#991b1b;
}
.phone-resend-step-deleted small{
  color:#b45309;
  font-weight:800;
}
@media(max-width:430px){
  .phone-resend-step-static-grid{grid-template-columns:1fr}
  .phone-resend-step-head{display:grid;gap:8px}
  .phone-step-delete{width:100%}
}
.phone-scan-options{display:grid;grid-template-columns:1fr 120px;gap:10px;align-items:end;margin:12px 0}.phone-check-card{background:#f8fbff;border:1px solid #dce8ff;border-radius:14px;padding:12px}.phone-mini-field span{display:block;font-size:12px;font-weight:900;color:#50688f;margin-bottom:6px}.phone-mini-field input{width:100%;border:1px solid #d8e6ff;border-radius:14px;padding:12px 14px;font-weight:900}.phone-row.success{background:#ecfdf5;border-color:#bbf7d0;color:#065f46}.phone-history-item{display:grid;grid-template-columns:58px 1fr;gap:12px;align-items:center}.phone-history-thumb{width:58px;height:58px}.phone-history-thumb-img,.phone-history-thumb-empty{width:58px;height:58px;border-radius:16px;border:1px solid #dbe7fb;background:#eef4ff;display:grid;place-items:center;object-fit:cover;font-size:22px}.phone-history-content{min-width:0}.phone-history-content b,.phone-history-content small{overflow-wrap:anywhere}@media(max-width:430px){.phone-scan-options{grid-template-columns:1fr}.phone-mini-field input{width:100%}.phone-history-item{grid-template-columns:52px 1fr;gap:10px}.phone-history-thumb,.phone-history-thumb-img,.phone-history-thumb-empty{width:52px;height:52px}}

/* v118 POS móvil: detalle completo de pedidos desplegados */
.phone-pos-order-expand{
  display:none;
  gap:12px;
}
.phone-order-card.open .phone-pos-order-expand{
  display:grid;
}
.phone-pos-order-expand h3{
  margin:0 0 6px;
  font-size:16px;
  color:#0b1c72;
}
.phone-pos-items-list{
  display:grid;
  gap:10px;
}
.phone-pos-item-card{
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:10px;
  align-items:start;
  border:1px solid #dce8ff;
  border-radius:16px;
  background:#fbfdff;
  padding:10px;
}
.phone-pos-item-card img,
.phone-pos-item-empty{
  width:64px;
  height:64px;
  border-radius:14px;
  object-fit:cover;
  background:#eef4ff;
  border:1px solid #dce8ff;
  display:grid;
  place-items:center;
  color:#64748b;
  font-size:10px;
  font-weight:1000;
  text-align:center;
}
.phone-pos-item-card b{
  display:block;
  font-size:14px;
  line-height:1.2;
  color:#071a40;
  overflow-wrap:anywhere;
}
.phone-pos-item-card small{
  color:#63789d;
  font-weight:900;
  overflow-wrap:anywhere;
}
.phone-pos-order-expand label{
  display:grid;
  gap:6px;
  font-weight:1000;
  color:#071a40;
}
.phone-pos-order-expand label + label{margin-top:8px;}

/* v119 POS móvil: desglose de pedido + estado editable */
.phone-pos-products-card{overflow:hidden;}
.phone-pos-items-list{display:grid!important;gap:12px!important;width:100%!important;}
.phone-pos-item-card{
  display:grid!important;
  grid-template-columns:82px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:start!important;
  width:100%!important;
  box-sizing:border-box!important;
  border:1px solid #dce8ff!important;
  border-radius:18px!important;
  background:#fbfdff!important;
  padding:10px!important;
}
.phone-pos-item-media{width:82px!important;min-width:82px!important;}
.phone-pos-item-card img,
.phone-pos-item-empty{
  width:82px!important;
  height:82px!important;
  border-radius:16px!important;
  object-fit:cover!important;
  background:#eef4ff!important;
  border:1px solid #dce8ff!important;
  display:grid!important;
  place-items:center!important;
  color:#64748b!important;
  font-size:10px!important;
  font-weight:1000!important;
  text-align:center!important;
}
.phone-pos-item-info{min-width:0!important;display:grid!important;gap:6px!important;}
.phone-pos-item-info b{font-size:15px!important;line-height:1.15!important;overflow-wrap:anywhere!important;color:#071a40!important;}
.phone-pos-item-info small{font-size:12px!important;line-height:1.25!important;overflow-wrap:anywhere!important;color:#63789d!important;font-weight:900!important;}
.phone-pos-item-sku{color:#0b5cff!important;}
.phone-pos-item-pills{gap:6px!important;margin-top:3px!important;}
.phone-pos-item-pills .phone-mini-pill{font-size:11px!important;padding:6px 8px!important;}
.phone-order-thumb-empty{display:grid;place-items:center;color:#64748b;font-size:10px;font-weight:1000;text-align:center;}
.phone-status-control{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;}
.phone-status-control select{width:100%;border:1px solid #d7e5ff;border-radius:14px;padding:12px;font-weight:1000;background:#fff;color:#08245b;}
.phone-status-warning{color:#8a5b10!important;font-weight:900!important;line-height:1.35!important;}
@media(max-width:430px){
  .phone-pos-item-card{grid-template-columns:76px minmax(0,1fr)!important;gap:10px!important;}
  .phone-pos-item-media{width:76px!important;min-width:76px!important;}
  .phone-pos-item-card img,.phone-pos-item-empty{width:76px!important;height:76px!important;}
  .phone-status-control{grid-template-columns:1fr;}
  .phone-status-control .btn{width:100%;}
}

/* v121: filtros dependientes de galería móvil */
.phone-gallery-filters #galleryCategory{
  grid-column:1/-1;
}
.phone-gallery-filters #gallerySubcategory,
.phone-gallery-filters #gallerySubsubcategory{
  min-width:0;
}
@media(max-width:430px){
  .phone-gallery-filters #gallerySubcategory,
  .phone-gallery-filters #gallerySubsubcategory{
    grid-column:1/-1;
  }
}

/* ===================== V126 HOME ADMIN USUARIOS ===================== */
body.home-admin-body{background:#eaf2ff;min-height:100vh;overflow-x:hidden;color:#06133c;}
.home-admin-shell{display:grid;grid-template-columns:300px minmax(0,1fr);min-height:100vh;background:linear-gradient(90deg,#fff 0,#fff 300px,#eaf2ff 300px,#f7fbff 100%);}
.home-admin-sidebar{position:sticky;top:0;height:100vh;background:#fff;border-right:1px solid #dbe7fb;padding:30px 26px;display:flex;flex-direction:column;gap:22px;}
.home-admin-brand{display:flex;align-items:center;gap:14px;}
.home-admin-brand img{width:74px;height:74px;object-fit:contain;background:#f5f9ff;border-radius:22px;padding:8px;border:1px solid #dbe7fb;}
.home-admin-brand h1{font-size:30px;margin:0;letter-spacing:-.04em;}
.home-admin-brand p{margin:4px 0 0;color:#61738f;font-weight:800;}
.home-admin-nav{display:grid;gap:10px;}
.home-admin-nav a{display:flex;align-items:center;gap:10px;text-decoration:none;color:#1156d9;background:#f5f9ff;border:1px solid #dbe7fb;border-radius:16px;padding:14px 16px;font-weight:1000;}
.home-admin-tip{margin-top:auto;background:#eef5ff;border:1px solid #dbe7fb;border-radius:18px;padding:14px;color:#173569;display:grid;gap:6px;font-weight:800;}
.home-admin-tip span{font-size:12px;color:#61738f;line-height:1.35;}
.home-admin-main{padding:30px;max-width:1440px;width:100%;display:grid;gap:24px;align-content:start;}
.home-admin-hero{position:relative;overflow:hidden;}
.home-admin-hero:after{content:"";position:absolute;right:34px;top:28px;width:76px;height:76px;border-radius:24px;background:#f4f8ff;}
.home-admin-active{margin-top:12px;display:inline-flex;background:#f5f9ff;border:1px solid #dbe7fb;border-radius:999px;padding:10px 14px;color:#173569;font-weight:900;}
.home-admin-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(360px,.85fr);gap:24px;align-items:start;}
.home-admin-card{border-radius:24px;box-shadow:0 18px 55px rgba(8,31,86,.08);overflow:hidden;}
.home-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;}
.home-user-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.home-user-form .full-row{grid-column:1/-1;}
.home-user-form .field{margin:0;}
.home-user-form input,.home-user-form select,.home-user-form textarea,.permission-card input,.permission-card select,.permission-card textarea{width:100%;border:1px solid #d7e5ff;border-radius:14px;padding:13px 14px;background:#fff;font-weight:800;color:#06133c;}
.home-user-form textarea,.permission-card textarea{min-height:86px;resize:vertical;}
.home-form-actions{grid-column:1/-1;display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.home-permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0;}
.permission-check{display:flex;align-items:center;gap:10px;border:1px solid #dbe7fb;background:#f8fbff;border-radius:14px;padding:12px;font-weight:900;min-height:48px;}
.permission-check input{width:18px;height:18px;accent-color:#2f6df6;}
.home-user-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:14px;}
.home-user-card{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:14px;align-items:center;border:1px solid #dbe7fb;border-radius:18px;padding:14px;background:#f8fbff;}
.home-user-card.inactive{opacity:.72;filter:saturate(.8);}
.user-avatar{width:56px;height:56px;border-radius:18px;background:#e8f0ff;display:grid;place-items:center;font-size:24px;}
.user-info{min-width:0;}
.user-info b{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.user-info small{display:block;color:#61738f;font-weight:800;margin-top:3px;}
.permission-chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;}
.permission-chips span{font-size:10px;background:#eaf2ff;border:1px solid #dbe7fb;color:#1156d9;border-radius:999px;padding:5px 8px;font-weight:1000;text-transform:uppercase;}
.user-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;align-items:center;max-width:230px;}
.email-row,.home-email-row{display:flex;justify-content:space-between;gap:14px;border:1px solid #dbe7fb;background:#f8fbff;border-radius:16px;padding:14px;margin:10px 0;}
.email-row small,.home-email-row small{display:block;color:#61738f;margin-top:4px;font-weight:800;}
.email-row p,.home-email-row p{margin:8px 0 0;color:#334155;white-space:pre-wrap;}
.small-note{font-size:12px;line-height:1.35;margin-top:10px;}
@media(max-width:1100px){.home-admin-shell{grid-template-columns:1fr;background:#eaf2ff}.home-admin-sidebar{position:relative;height:auto;border-right:0;border-bottom:1px solid #dbe7fb}.home-admin-grid{grid-template-columns:1fr}.home-admin-nav{grid-template-columns:repeat(2,minmax(0,1fr));}.home-admin-tip{margin-top:0}.home-admin-main{padding:18px}}
@media(max-width:720px){.home-admin-brand h1{font-size:24px}.home-admin-nav{grid-template-columns:1fr}.home-user-form{grid-template-columns:1fr}.home-permission-grid{grid-template-columns:1fr}.home-user-grid{grid-template-columns:1fr}.home-user-card{grid-template-columns:48px 1fr}.user-actions{grid-column:1/-1;justify-content:flex-start;max-width:none}.home-admin-hero:after{display:none}.email-row,.home-email-row{display:grid}}
/* V129 login, token y marca inferior */
.login-body{min-height:100vh;background:#edf4ff;display:grid;place-items:center;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif}.login-wrap{width:min(520px,calc(100% - 32px))}.login-card{background:#fff;border:1px solid #dbe7ff;border-radius:24px;padding:34px;box-shadow:0 28px 80px rgba(14,36,91,.14)}.login-logo{display:block;width:72px;height:72px;object-fit:contain;margin:0 auto 12px}.login-card h1{text-align:center;margin:0 0 18px;color:#07133a;letter-spacing:-.04em}.login-form{display:grid;gap:14px}.login-form label{display:grid;gap:7px;font-weight:800;color:#34415e}.login-form input{width:100%;border:1px solid #d5e3ff;border-radius:14px;padding:14px 16px;font-weight:800;background:#fbfdff}.password-row{display:flex;border:1px solid #d5e3ff;border-radius:14px;overflow:hidden}.password-row input{border:0;border-radius:0}.password-row button{border:0;background:#f5f8ff;color:#2f6df6;font-weight:900;padding:0 14px}.recaptcha-local{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:10px;border:1px solid #d5e3ff;border-radius:14px;background:#f8fbff;padding:14px}.recaptcha-local input{width:auto}.login-submit{border:0;border-radius:18px;padding:15px;background:#3474f6;color:#fff;font-size:18px;font-weight:1000;box-shadow:0 14px 30px rgba(52,116,246,.22)}.login-link{border:0;background:transparent;color:#2f6df6;font-weight:900}.login-message{min-height:20px;margin:0;text-align:center;color:#b91c1c;font-weight:850}.login-message.ok{color:#047857}.mardieli-watermark{position:fixed;left:14px;bottom:10px;z-index:9999;color:rgba(70,80,100,.38);font-size:11px;font-weight:1000;letter-spacing:.08em;pointer-events:none}.bordado-only .bordado-hide{display:none!important}.bordado-only .phone-bottom{display:none!important}.bordado-only .phone-main{padding-bottom:28px!important}.bordado-only .phone-goal-inputs{display:none!important}

/* ===================== V131 FIX HOME USERS RENDER ===================== */
.home-user-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(330px,1fr))!important;
  gap:16px!important;
  align-items:start!important;
}
.home-user-card{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  align-items:stretch!important;
  min-height:auto!important;
  height:auto!important;
  padding:16px!important;
  overflow:hidden!important;
  background:#f8fbff!important;
  border:1px solid #dbe7fb!important;
  border-radius:20px!important;
  box-shadow:0 10px 26px rgba(8,31,86,.055)!important;
}
.home-user-topline{
  display:grid!important;
  grid-template-columns:54px minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  min-width:0!important;
}
.home-user-avatar{
  width:54px!important;
  height:54px!important;
  border-radius:17px!important;
  display:grid!important;
  place-items:center!important;
  background:#e8f0ff!important;
  color:#0d2f8f!important;
  font-size:24px!important;
  border:1px solid #d7e5ff!important;
}
.home-user-maininfo{min-width:0!important;overflow:hidden!important;}
.home-user-maininfo h4{
  margin:0 0 4px!important;
  font-size:17px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:#06133c!important;
}
.home-user-maininfo small{
  display:block!important;
  color:#61738f!important;
  font-weight:850!important;
  line-height:1.25!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.home-status-badge{
  align-self:center!important;
  white-space:nowrap!important;
  font-size:12px!important;
}
.home-user-perms{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  min-height:28px!important;
  max-height:68px!important;
  overflow:hidden!important;
  align-content:flex-start!important;
}
.home-user-perms span{
  font-size:10px!important;
  line-height:1!important;
  padding:7px 9px!important;
  max-width:155px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.home-user-perms span.more{background:#0d1730!important;color:#fff!important;border-color:#0d1730!important;}
.home-user-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr 1fr!important;
  gap:8px!important;
  align-items:center!important;
}
.home-user-actions .btn{
  width:100%!important;
  min-height:40px!important;
  padding:10px 9px!important;
  border-radius:14px!important;
  font-size:12px!important;
  text-align:center!important;
}
.users-list-card{overflow:visible!important;}
@media(max-width:760px){
  .home-user-grid{grid-template-columns:1fr!important;}
  .home-user-topline{grid-template-columns:48px minmax(0,1fr)!important;}
  .home-status-badge{grid-column:1/-1;justify-self:start;}
  .home-user-actions{grid-template-columns:1fr!important;}
}


/* V132 - Home inferior móvil y layout tablet */
@media (min-width: 700px) and (max-width: 1180px){
  body.phone-body{
    background:#eaf2ff;
  }
  body.phone-body .phone-shell{
    width:min(920px,100%);
  }
  body.phone-body .phone-bottom{
    width:min(920px,100%);
    min-height:88px;
    padding:12px 18px calc(20px + env(safe-area-inset-bottom));
  }
  body.phone-body .phone-bottom a{
    font-size:13px;
    min-height:54px;
  }
  .phone-dashboard-main{
    display:flex!important;
    flex-wrap:wrap;
    align-items:stretch;
    gap:16px;
    padding:18px;
    padding-bottom:140px;
  }
  .phone-dashboard-main > .phone-card:first-child{
    flex:1 1 100%;
  }
  .phone-dashboard-main > .phone-actions{
    flex:1 1 360px;
    min-width:320px;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  .phone-dashboard-main > .phone-card:nth-of-type(2){
    flex:1 1 360px;
    min-width:320px;
  }
  .phone-dashboard-main > .phone-card:nth-of-type(3){
    flex:1 1 100%;
  }
  .phone-dashboard-main .phone-action{
    min-height:118px;
    display:flex;
    flex-direction:column;
    justify-content:center;
  }
  .phone-dashboard-main .phone-list{
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  }
}
@media (min-width: 1181px){
  body.phone-body .phone-shell{
    width:min(760px,100%);
  }
  body.phone-body .phone-bottom{
    width:min(760px,100%);
  }
}

/* V139: acciones masivas con paginación inferior e imagen principal a la izquierda */
.bulk-preview-table .bulk-product-cell{min-width:320px;}
.bulk-preview-table .bulk-product-cell .mini{flex:0 0 42px;}
.bulk-pagination-bottom{margin-top:16px;margin-bottom:0;}

/* V140: fix historial de Lectura SKU / QR - imágenes compactas */
.scan-history{
  display:grid;
  gap:12px;
  width:100%;
  max-height:620px;
  overflow:auto;
  padding-right:4px;
}
.scan-history-item{
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  gap:14px;
  align-items:center;
  width:100%;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f8fbff;
  overflow:hidden;
}
.scan-history-item img{
  width:82px!important;
  height:82px!important;
  max-width:82px!important;
  max-height:82px!important;
  min-width:82px!important;
  min-height:82px!important;
  object-fit:cover!important;
  object-position:center!important;
  border-radius:14px!important;
  border:1px solid var(--line);
  display:block;
}
.scan-history-item b,
.scan-history-item p,
.scan-history-item small{
  min-width:0;
  overflow-wrap:anywhere;
}
.scan-history-item p{margin:4px 0 8px;color:var(--muted);}
.scan-history-ok{background:#f8fbff;}
.scan-history-error{
  grid-template-columns:1fr;
  background:#fff5f5;
  border-color:#fecaca;
}
@media(max-width:760px){
  .scan-history-item{grid-template-columns:64px minmax(0,1fr);gap:10px;padding:10px;}
  .scan-history-item img{width:64px!important;height:64px!important;max-width:64px!important;max-height:64px!important;min-width:64px!important;min-height:64px!important;}
}

/* V139: POS llave maestra y carrito en renglones para no apretar el punto de venta */
#posMasterKeyBox{margin:12px 0 14px;}
.master-key-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid #d8e6ff;background:#f8fbff;border-radius:16px;padding:10px 12px;}
.master-key-strip.active{border-color:#22c55e;background:#effdf5;}
.master-key-close{width:34px;height:34px;border-radius:999px;border:0;background:#ef4444;color:#fff;font-size:24px;line-height:1;font-weight:1000;cursor:pointer;display:grid;place-items:center;}
.master-key-modal{max-width:460px!important;}
.cart-item-list{display:grid;gap:12px;margin-top:12px;}
.cart-item-card{border:1px solid #e1eaff;background:#fff;border-radius:18px;padding:12px;display:grid;gap:10px;min-width:0;}
.cart-item-card.master-item{border-color:#fecaca;background:#fff7f7;}
.cart-item-main{display:grid;grid-template-columns:48px minmax(0,1fr);gap:10px;align-items:center;min-width:0;}
.cart-item-main b,.cart-item-main small{display:block;overflow-wrap:anywhere;line-height:1.15;}
.cart-item-main small{color:#64748b;margin-top:3px;}
.cart-item-main .badge{margin-top:6px;width:max-content;max-width:100%;}
.cart-item-controls{display:grid;grid-template-columns:minmax(82px,.7fr) minmax(140px,1.1fr) minmax(80px,.8fr) auto;gap:10px;align-items:end;}
.cart-item-controls label{font-size:12px;color:#64748b;font-weight:900;display:grid;gap:4px;}
.cart-item-controls .money-input{display:grid;grid-template-columns:auto 1fr;align-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden;}
.cart-item-controls .money-input span{padding-left:10px;font-weight:1000;color:#334155;}
.cart-item-controls .money-input input{border:0!important;min-width:0;padding:9px!important;font-weight:900;}
.cart-line-total{display:grid;gap:4px;font-weight:900;}
.cart-line-total span{font-size:12px;color:#64748b;}
.cart-line-total b{white-space:nowrap;}
.badge.redsoft{background:#fee2e2;color:#991b1b;}
@media(max-width:1350px){.grid2:has(#cartBox){grid-template-columns:minmax(0,1fr) minmax(360px,460px);}.cart-item-controls{grid-template-columns:1fr 1fr;}.cart-item-controls .btn{width:100%;}}
@media(max-width:760px){.cart-item-controls{grid-template-columns:1fr;}.cart-item-main{grid-template-columns:42px minmax(0,1fr);}}


.account-management-grid{align-items:start}
.account-preview-wrap{border:1px solid rgba(55,103,199,.18); border-radius:18px; background:#f7f9fe; padding:14px; min-height:340px; display:flex; align-items:center; justify-content:center}
.account-preview-image{max-width:100%; max-height:520px; border-radius:14px; box-shadow:0 10px 30px rgba(20,40,95,.12)}
.account-preview-meta{margin-top:12px}
.account-list-item{display:flex; align-items:center; justify-content:space-between; gap:16px}
.account-list-main{display:flex; align-items:center; gap:14px; min-width:0}
.account-mini-preview{width:112px; height:70px; border-radius:14px; background:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid rgba(55,103,199,.18); flex:none; padding:8px; box-sizing:border-box}
.account-mini-preview img{width:100%; height:100%; object-fit:contain; display:block}
.account-mini-placeholder{font-size:12px; color:#66718a; padding:10px; text-align:center; font-weight:900}
.form-actions-inline{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.order-share-preview{display:grid; grid-template-columns:minmax(220px,360px) 1fr; gap:18px; align-items:start}
.order-share-preview .preview-pane{border:1px solid rgba(55,103,199,.18); border-radius:18px; background:#f7f9fe; padding:14px}
.order-share-preview img{width:100%; border-radius:14px; box-shadow:0 10px 30px rgba(20,40,95,.12)}
.order-share-preview textarea{width:100%; min-height:320px; border:1px solid rgba(55,103,199,.18); border-radius:14px; padding:12px; resize:vertical; font:inherit; background:#fff}
.modal-overlay{position:fixed; inset:0; background:rgba(14,24,45,.55); display:none; align-items:center; justify-content:center; padding:18px; z-index:2000}
.modal-overlay.open{display:flex}
.modal-card{width:min(1100px,100%); max-height:calc(100vh - 40px); overflow:auto; background:#fff; border-radius:22px; box-shadow:0 30px 70px rgba(9,18,44,.28); padding:22px}
.modal-header{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px}
.modal-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:14px; flex-wrap:wrap}
.account-inline-preview{margin-top:10px; display:flex; gap:10px; align-items:center}
.account-inline-preview img{width:88px; height:110px; object-fit:cover; border-radius:12px; border:1px solid rgba(55,103,199,.18)}
@media (max-width: 900px){
  .order-share-preview{grid-template-columns:1fr}
  .account-list-item{flex-direction:column; align-items:stretch}
}


/* V142: documentos de pedido responsivos y botón WhatsApp visible */
.doc-actions.doc-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;align-items:stretch;padding:0 20px 18px}
.doc-actions.doc-grid>.doc-card{width:100%;min-width:0;display:flex!important;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-start}
.doc-actions.doc-grid>.doc-card b{min-width:92px;line-height:1.1}
.doc-actions.doc-grid>.doc-card select{min-width:150px;flex:1 1 150px}
.doc-actions.doc-grid>.doc-card .btn{white-space:nowrap;flex:0 0 auto}
.doc-actions.doc-grid>[data-whatsapp-card],.doc-card.whatsapp-card{background:#effdf6;border-color:#bbf7d0}
@media(max-width:760px){.doc-actions.doc-grid{grid-template-columns:1fr}.doc-actions.doc-grid>.doc-card{display:grid!important}.doc-actions.doc-grid>.doc-card b{min-width:0}.doc-actions.doc-grid>.doc-card .btn,.doc-actions.doc-grid>.doc-card select{width:100%}}

/* V143: documentos de pedido sin desbordarse */
.doc-actions.doc-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:12px;
  width:100%;
  overflow:visible;
}
.doc-actions.doc-grid .doc-card{
  width:100%;
  min-width:0;
  display:grid !important;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
  padding:12px;
}
.doc-actions.doc-grid .doc-card select{
  min-width:120px;
  width:100%;
}
.doc-actions.doc-grid .doc-card .btn{
  white-space:nowrap;
  min-width:max-content;
}
@media(max-width:760px){
  .doc-actions.doc-grid{grid-template-columns:1fr}
  .doc-actions.doc-grid .doc-card{grid-template-columns:1fr;align-items:stretch}
  .doc-actions.doc-grid .doc-card .btn{width:100%;min-width:0}
}

/* V150: acciones de documentos uniformes en columnas compactas */
.doc-actions.doc-grid{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(170px,1fr)) !important;
  gap:12px !important;
  align-items:stretch !important;
  padding:0 20px 18px !important;
  overflow:visible !important;
}
.doc-actions.doc-grid .doc-card{
  width:100% !important;
  min-width:0 !important;
  display:grid !important;
  grid-template-columns:1fr !important;
  grid-template-rows:auto auto auto !important;
  align-items:stretch !important;
  gap:8px !important;
  padding:12px !important;
  text-align:left !important;
}
.doc-actions.doc-grid .doc-card b{min-width:0 !important;line-height:1.1 !important;font-size:14px !important;}
.doc-actions.doc-grid .doc-card select,
.doc-actions.doc-grid .doc-card .btn{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  justify-content:center !important;
  font-size:13px !important;
  padding:10px 12px !important;
}
.doc-actions.doc-grid .doc-card-note{min-height:42px;display:flex;align-items:center;font-size:13px;}
.doc-actions.doc-grid .whatsapp-card{background:#effdf6 !important;border-color:#bbf7d0 !important;}
@media(max-width:1200px){.doc-actions.doc-grid{grid-template-columns:repeat(2,minmax(180px,1fr)) !important;}}
@media(max-width:760px){.doc-actions.doc-grid{grid-template-columns:1fr !important;}}


/* V157 - Carga para imágenes masivas */
.mass-loading-overlay{position:fixed;inset:0;background:rgba(8,18,42,.56);backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;padding:20px;z-index:2500}
.mass-loading-overlay.open{display:flex}
.mass-loading-card{width:min(430px,96vw);background:#fff;border-radius:28px;padding:28px 26px;box-shadow:0 32px 80px rgba(9,18,44,.28);text-align:center;border:1px solid #dbe7fb}
.mass-loading-logo-wrap{width:112px;height:112px;border-radius:999px;margin:0 auto 16px;background:linear-gradient(180deg,#f5f9ff,#e7f0ff);display:grid;place-items:center;border:1px solid #cfe0ff;box-shadow:inset 0 0 0 8px rgba(47,109,246,.06)}
.mass-loading-logo{width:68px;height:68px;object-fit:contain;animation:massLogoSpinPulse 3.2s ease-in-out infinite;transform-origin:center center}
.mass-loading-card h3{margin:0 0 8px;font-size:28px;line-height:1.05;color:#08245b}
.mass-loading-card .muted{margin:0 0 18px;color:#63748f}
.mass-loading-timebox{border:1px solid #dbe7fb;background:#f6f9ff;border-radius:22px;padding:16px;display:grid;gap:6px}
.mass-loading-timebox small{font-size:13px;font-weight:800;color:#56709a;text-transform:uppercase;letter-spacing:.04em}
.mass-loading-timebox b{font-size:34px;line-height:1;font-weight:900;color:#1156d9}
.mass-loading-timebox span{font-size:14px;font-weight:800;color:#667894}
@keyframes massLogoSpinPulse{
  0%{transform:rotate(0deg)}
  14%{transform:rotate(360deg)}
  24%{transform:rotate(360deg)}
  46%{transform:rotate(900deg)}
  58%{transform:rotate(900deg)}
  76%{transform:rotate(1260deg)}
  100%{transform:rotate(1260deg)}
}

/* V158 - progreso real para imágenes masivas por lotes */
.mass-loading-bar{height:10px;border-radius:999px;background:#dbe7fb;overflow:hidden;margin:6px 0 2px}
.mass-loading-bar span{display:block;height:100%;width:0%;border-radius:999px;background:#2f6df6;transition:width .28s ease}
#massLoadingProgress{font-size:14px;font-weight:900;color:#0f2e69;line-height:1.3}


/* V160 Shopify job background */
.shopify-advanced-controls{display:grid;grid-template-columns:1fr 1.4fr;gap:14px;margin:14px 0;padding:14px;border:1px solid #dbe7fb;border-radius:18px;background:#f7fbff}
.shopify-size-grid{display:flex;flex-wrap:wrap;gap:8px}
.shopify-size-grid label{display:flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid #dbe7fb;border-radius:12px;background:#fff;font-weight:800;color:#123}
.shopify-progress{width:100%;height:12px;border-radius:999px;background:#eaf1ff;overflow:hidden;margin:10px 0;border:1px solid #d3e1fb}
.shopify-progress span{display:block;height:100%;background:linear-gradient(90deg,#2f6df6,#19bf7a);border-radius:999px;transition:width .35s ease}
.product-row-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.shopify-product-sync{white-space:nowrap;padding:8px 10px;font-size:12px}
@media(max-width:900px){.shopify-advanced-controls{grid-template-columns:1fr}.product-row-actions{justify-content:flex-start}}

/* V161 Shopify: filtros por categorías e historial de errores */
.shopify-category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:center}
.shopify-category-grid select{width:100%;min-height:54px;border:1px solid #d5e2f8;border-radius:16px;padding:0 14px;font-weight:800;background:#fff;color:#071a44}
.shopify-error-history{margin-top:14px;padding-top:12px;border-top:1px solid #dce8fb}
.shopify-error-history h4{margin:0 0 8px;font-size:16px;color:#9f1d1d}
.shopify-error-history .table-wrap{max-height:360px;overflow:auto;border:1px solid #e3ebfb;border-radius:14px;background:#fff}
.shopify-error-history td{vertical-align:top}
@media(max-width:900px){.shopify-category-grid{grid-template-columns:1fr}}


/* V164 - Bloqueo visual de funciones no utilizables durante sincronización Shopify */
.shopify-lock-overlay{z-index:2800;}
.shopify-lock-card{position:relative;}
.shopify-lock-big{font-size:24px;font-weight:1000;line-height:1.05;color:#dc2626;text-transform:uppercase;letter-spacing:.04em;margin:2px 0 10px;}
.shopify-lock-card .secondary.wide{margin-top:16px;width:100%;justify-content:center;}
@media(max-width:560px){.shopify-lock-big{font-size:20px}.shopify-lock-card h3{font-size:23px}}

/* V165 - Detener sincronización Shopify */
.btn-danger{background:#dc2626!important;color:#fff!important;border-color:#b91c1c!important}
.btn-danger:hover{background:#b91c1c!important}
.btn-danger:disabled{opacity:.55;cursor:not-allowed}
.shopify-stop-row{margin-top:10px;align-items:center;gap:10px;flex-wrap:wrap}
.danger-text{color:#b91c1c;font-weight:900}


/* V176 productos head más uniforme */
.products-head{display:grid;grid-template-columns:minmax(200px,1fr) minmax(420px,760px);align-items:start;gap:18px;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:18px}
.products-head-main{display:grid;gap:6px;align-content:start}
.products-head-main h3{margin:0}
#productsCountHint{display:none!important}
.products-head-tools{display:grid;gap:14px;align-content:start;width:100%}
.products-primary-action,.products-primary-action .btn{width:100%}
.products-primary-action .btn{min-height:58px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:16px;border-radius:16px}
.pagination-bar{display:grid;align-items:stretch;justify-content:stretch;gap:14px;flex-wrap:nowrap;margin:0;padding:16px;border:1px solid var(--line);border-radius:18px;background:#f8fbff;width:100%}
.pagination-info{width:100%;font-size:15px;line-height:1.35}
.pagination-buttons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;width:100%}
.pagination-buttons .btn{width:100%;min-height:54px;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.2;border-radius:14px;font-size:14px;padding:12px 14px;white-space:normal}
.pagination-buttons .btn.active-page{box-shadow:inset 0 0 0 2px rgba(255,255,255,.45)}
@media(max-width:1180px){.products-head{grid-template-columns:1fr}.products-head-tools{width:100%}}
@media(max-width:900px){.pagination-buttons{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.pagination-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.products-primary-action .btn,.pagination-buttons .btn{min-height:52px}}


/* V177 corrección botones productos: no agrandar paginación, restaurar botones */
.products-head.products-head-compact{display:grid!important;grid-template-columns:minmax(220px,1fr) minmax(520px,1.4fr)!important;gap:16px!important;align-items:start!important;border-bottom:1px solid var(--line)!important;padding-bottom:18px!important;margin-bottom:18px!important}
.products-top-tools{display:grid;gap:12px;width:100%;min-width:0}
.products-head-compact #productsCountHint{display:none!important}
.products-head-compact .pagination-bar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;flex-wrap:wrap!important;margin:0!important;padding:12px 14px!important;border:1px solid var(--line)!important;border-radius:16px!important;background:#f8fbff!important;width:100%!important}
.products-head-compact .pagination-buttons{display:flex!important;gap:8px!important;flex-wrap:wrap!important;width:auto!important}
.products-head-compact .pagination-buttons .btn{width:auto!important;min-height:0!important;padding:9px 12px!important;font-size:12px!important;border-radius:12px!important;white-space:nowrap!important}
.products-head-compact .pagination-info{width:auto!important;font-size:14px!important;line-height:1.25!important}
.product-shopify-bulk-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;width:100%!important}
.product-shopify-bulk-actions .btn{width:100%!important;min-height:54px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;line-height:1.15!important;border-radius:14px!important;padding:11px 12px!important;white-space:normal!important}
.shopify-product-actions{display:grid!important;grid-template-columns:minmax(96px,1fr) 46px minmax(96px,1fr)!important;gap:8px!important;align-items:center!important;justify-content:end!important}
.shopify-product-actions .btn{height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;border-radius:12px!important;white-space:nowrap!important}
.shopify-product-actions .qr-product-link{height:42px!important;width:46px!important;display:grid!important;place-items:center!important;border-radius:12px!important;background:#f3f7ff!important;border:1px solid #d6e2f8!important}
.btn.soft{background:#2f6df6;color:#fff}
.btn.small.red{background:#ef4444!important;color:#fff!important;border-color:#ef4444!important}
@media(max-width:1150px){.products-head.products-head-compact{grid-template-columns:1fr!important}.product-shopify-bulk-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:760px){.product-shopify-bulk-actions{grid-template-columns:1fr!important}.shopify-product-actions{grid-template-columns:1fr 46px 1fr!important}}

/* V179: banco de miniaturas desde account_logo_library */
.account-logo-library-card{margin-top:18px}
.section-head-inline{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.section-head-inline h3{margin:0 0 6px;color:#0f172a}
.account-logo-library-form{background:#f8fbff;border:1px solid rgba(55,103,199,.18);border-radius:18px;padding:14px;margin:12px 0 16px;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}
.account-logo-library-form.hidden,.selected-account-logo-box.hidden{display:none!important}
.account-logo-library-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}
.account-logo-library-item{border:1px solid rgba(55,103,199,.18);border-radius:18px;background:#fff;padding:12px;display:grid;gap:10px;transition:.18s ease box-shadow,.18s ease border-color,.18s ease transform}
.account-logo-library-item:hover{border-color:#2f6df6;box-shadow:0 12px 26px rgba(24,49,95,.08);transform:translateY(-1px)}
.account-logo-library-item.selected{border-color:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,.16)}
.account-logo-push{appearance:none;border:0;background:transparent;padding:0;display:grid;gap:8px;text-align:center;cursor:pointer;color:#0f172a}
.account-logo-push-img{height:92px;border-radius:14px;background:#f8fbff;border:1px solid rgba(55,103,199,.14);display:flex;align-items:center;justify-content:center;padding:10px;box-sizing:border-box;overflow:hidden}
.account-logo-push-img img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.account-logo-push b{font-size:.95rem;line-height:1.15;color:#0f172a}
.account-logo-push small{color:#64748b;font-weight:700;line-height:1.2}
.account-logo-library-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.account-logo-library-actions .btn{width:100%;min-height:38px}
.selected-account-logo-box{margin-top:10px;border:1px dashed rgba(55,103,199,.28);border-radius:16px;background:#f8fbff;padding:12px;display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center}
.selected-account-logo-box .account-mini-preview{width:86px;height:58px}
.selected-account-logo-box b{display:block;color:#0f172a;margin-bottom:4px}
.selected-account-logo-box p{margin:0}
@media(max-width:900px){.account-logo-library-form{grid-template-columns:1fr}.selected-account-logo-box{grid-template-columns:1fr}.selected-account-logo-box .account-mini-preview{width:120px;height:74px}.account-logo-library-actions{grid-template-columns:1fr}}

/* V185: agregar productos a pedidos existentes */
.order-extra-actions{display:flex;justify-content:flex-end;margin:12px 0 14px;gap:10px;flex-wrap:wrap}.order-extra-actions .btn{min-width:190px}.order-add-overlay.open{align-items:flex-start;justify-content:center;overflow:auto;padding:18px;z-index:3200}.order-add-modal-card{width:min(1340px,96vw);max-height:none;overflow:visible;margin:0 auto 28px}.order-add-modal-header{position:sticky;top:0;z-index:5;background:#fff;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:14px}.order-add-layout{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px;align-items:start}.order-add-left{min-width:0}.order-add-searchbar{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:10px;margin:10px 0 14px}.order-add-searchbar input{width:100%;border:1px solid var(--line);border-radius:16px;padding:15px 16px;font-weight:800}.order-add-scanner{margin:0 0 16px;padding:14px;border:1px dashed #c9dcff;border-radius:20px;background:#f8fbff}.order-add-scanner h3{margin:0 0 10px}.order-add-scan-top{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.order-add-scanner #orderAddScanInput{width:100%;border:1px solid var(--line);border-radius:16px;padding:14px 16px;font-weight:900;background:#fff;margin-bottom:10px}.order-add-scanner .camera-box.small{min-height:150px}.order-add-scanner .camera-box.small video{max-height:230px}.order-add-products{max-height:50vh;overflow:auto;padding-right:8px;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;align-items:start}.order-add-products .product-card{height:100%;display:flex;flex-direction:column}.order-add-products .product-card .product-card-body{display:flex;flex-direction:column;gap:7px;flex:1}.order-add-products .product-card .pos-card-btn{margin-top:auto;width:100%}.order-add-cart-panel{position:sticky;top:18px;border:1px solid var(--line);border-radius:20px;background:#f8fbff;padding:16px;box-shadow:0 12px 30px rgba(16,42,88,.06)}.order-add-cart-panel h3{margin-top:0}.order-add-save{width:100%;margin-top:14px;min-height:54px}.order-add-cart-list{max-height:46vh;overflow:auto;padding-right:4px}.order-add-controls{grid-template-columns:82px 100px auto auto}.order-add-controls label{font-size:12px;font-weight:900;color:#526987}.order-add-controls input{width:100%;border:1px solid var(--line);border-radius:12px;padding:8px 10px;font-weight:900}.modal-overlay.open #orderAddMasterKeyBox .master-key-strip{margin-bottom:14px}@media(max-width:980px){.order-add-layout{grid-template-columns:1fr}.order-add-cart-panel{position:relative;top:auto}.order-add-products{max-height:none}.order-add-searchbar{grid-template-columns:1fr}.order-extra-actions{justify-content:stretch}.order-extra-actions .btn{width:100%}}@media(max-width:640px){.order-add-modal-card{width:100%;border-radius:18px;padding:16px}.order-add-products{grid-template-columns:1fr}.order-add-scan-top{display:grid;grid-template-columns:1fr 96px}.order-add-scanner .bulkbar{display:grid;grid-template-columns:1fr}.order-add-controls{grid-template-columns:1fr 1fr}.order-add-controls b,.order-add-controls .btn{grid-column:1/-1}}

/* V188 pedidos: desglose, envío editable y modales mejorados */
.order-breakdown-box{margin:12px 0 18px;padding:16px 18px;border:1px solid #d9e6ff;border-radius:20px;background:linear-gradient(180deg,#f9fbff 0%,#f3f7ff 100%);box-shadow:0 14px 32px rgba(33,88,188,.06)}
.order-breakdown-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}.order-breakdown-head h3{margin:0;font-size:20px}.order-breakdown-head span{display:inline-flex;align-items:center;justify-content:center;padding:8px 14px;border-radius:999px;background:#e9f2ff;color:#1f4fe0;font-weight:900}
.order-breakdown-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.order-breakdown-chip{border:1px solid #d8e4ff;border-radius:16px;background:#fff;padding:12px 14px;display:flex;flex-direction:column;gap:4px;min-height:88px;box-shadow:0 8px 20px rgba(29,78,216,.05)}.order-breakdown-chip b{font-size:15px;line-height:1.2;color:#102a57}.order-breakdown-chip span{font-size:22px;font-weight:900;color:#245cf0}.order-breakdown-chip small{color:#6a7a92;font-weight:700}

.modal-overlay{backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:rgba(9,18,44,.58)}
.modal-card,.pos-modal{border:1px solid rgba(189,211,255,.9);background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);box-shadow:0 28px 80px rgba(6,24,74,.30)}
.modal-card{padding:24px}.modal-header,.order-add-modal-header{position:sticky;top:0;background:linear-gradient(180deg,#ffffff 0%,rgba(255,255,255,.98) 100%);backdrop-filter:blur(4px);z-index:4;padding:0 0 14px;border-bottom:1px solid #e6efff}.modal-header h3,.order-add-modal-header h3,.pos-modal-info h2{color:#102a57}
.modal-close,[data-close-order-add]{box-shadow:0 8px 18px rgba(8,26,79,.12)}
.order-add-modal-card{border-radius:26px;overflow:hidden}.order-add-layout{gap:20px}.order-add-left,.order-add-cart-panel{background:#fff;border-radius:20px}.order-add-scanner{border:1px solid #d5e4ff;background:linear-gradient(180deg,#f8fbff 0%,#f2f7ff 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}.order-add-products .product-card{border:1px solid #dfe9ff;border-radius:20px;box-shadow:0 10px 24px rgba(30,64,175,.06)}.order-add-products .product-card .pic{border-radius:18px 18px 0 0;overflow:hidden}.order-add-cart-panel{border:1px solid #dce8ff;box-shadow:0 18px 35px rgba(15,66,165,.08)}.order-add-cart-panel h3{font-size:24px;color:#102a57}.order-add-save{box-shadow:0 12px 24px rgba(16,185,129,.18)}

@media(max-width:760px){.order-breakdown-grid{grid-template-columns:1fr}.order-breakdown-chip span{font-size:20px}}
.order-add-overlay{position:fixed!important;inset:0!important;display:none;align-items:flex-start!important;justify-content:center!important;overflow:auto!important;padding:18px!important;z-index:100200!important}.order-add-overlay.open{display:flex!important}

/* V189: smart selects más limpios + envíos */
.smart-select-panel{padding:12px!important;border-radius:22px!important;border:1px solid #cfe0ff!important;background:linear-gradient(180deg,rgba(255,255,255,.99) 0%,rgba(248,251,255,.98) 100%)!important;box-shadow:0 26px 70px rgba(15,23,42,.24)!important}
.smart-select-search{min-height:48px!important;border-radius:16px!important;font-size:15px!important;box-shadow:inset 0 0 0 1px #d8e4ff}
.smart-select-options{gap:8px!important;padding-right:2px}
.smart-option{padding:12px 12px!important;border:1px solid transparent;grid-template-columns:48px 1fr!important;border-radius:16px!important;min-height:64px}
.smart-option:hover{background:#f4f8ff!important}
.smart-option.active{background:#edf4ff!important;border-color:#b7d0ff!important;box-shadow:0 0 0 1px rgba(47,109,246,.15) inset!important}
.smart-option b{font-size:15px!important;font-weight:900!important}
.smart-option small{font-size:12px!important;white-space:normal!important;line-height:1.2}
.smart-select-button{min-height:58px!important;border-radius:18px!important;padding:10px 44px 10px 14px!important}
.smart-select-button .smart-status-dot,.smart-option .smart-status-dot{width:34px;height:34px;border-radius:999px;border:4px solid #fff;box-shadow:0 0 0 1px #dbe7fb}
.smart-shipping-thumb,.smart-account-thumb{width:52px;height:38px;border-radius:12px;padding:4px;background:#fff;border:1px solid #dbe7fb;display:grid;place-items:center;overflow:hidden}
.smart-shipping-img,.smart-account-img{width:100%;height:100%;object-fit:contain;background:transparent;border:0;border-radius:8px}
.smart-select-button .smart-shipping-thumb,.smart-select-button .smart-account-thumb{width:54px;height:40px}

.shipping-admin-section{margin-top:28px}
.hero-mini{margin-bottom:18px}
#shippingForm textarea{resize:vertical;min-height:110px}
.shipping-preview-card{display:grid;grid-template-columns:88px 1fr;gap:16px;align-items:center;padding:18px;border:1px solid #d9e6ff;border-radius:22px;background:linear-gradient(180deg,#f9fbff 0%,#f3f7ff 100%)}
.shipping-preview-thumb{width:88px;height:88px;border-radius:20px;border:1px solid #dbe7fb;background:#fff;display:grid;place-items:center;font-size:38px;overflow:hidden}
.shipping-preview-thumb img{width:100%;height:100%;object-fit:contain;background:#fff}
.shipping-preview-card b{font-size:22px;color:#102a57;display:block}
.shipping-preview-card small{display:block;margin-top:4px;color:#426091;font-weight:800}
.shipping-preview-card p{margin:8px 0 10px;color:#4f6384}
.shipping-preview-price{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:999px;background:#e9f2ff;color:#1f4fe0;font-size:22px;font-weight:900}
.shipping-list-preview img{width:100%;height:100%;object-fit:contain;background:#fff}
.shipping-logo-library-item.selected,.account-logo-library-item.selected{box-shadow:0 0 0 2px #2f6df6 inset;background:#eef5ff}
@media(max-width:900px){.shipping-preview-card{grid-template-columns:1fr}.shipping-preview-thumb{margin:0 auto}}

/* V190: envios separado + selectores fijos y ordenados */
.order-actions{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;gap:16px!important;align-items:end!important;overflow:visible!important}
.order-actions .action-field{min-width:0!important;width:100%!important;max-width:100%!important;overflow:visible!important}
.order-actions .action-field .smart-select-wrap,.order-actions .action-field .smart-select-button,.order-actions .action-field input,.order-actions .action-field select{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
.order-actions .action-field-btn .btn{width:100%!important;min-height:56px!important}
.smart-select-wrap{min-width:0!important;max-width:100%!important}
.smart-select-button{min-width:0!important;max-width:100%!important;overflow:hidden!important;display:flex!important;align-items:center!important;flex-wrap:nowrap!important}
.smart-select-button > span:last-child,.smart-option > span:last-child{min-width:0!important;max-width:100%!important;overflow:hidden!important}
.smart-select-button b,.smart-select-button small{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.smart-option b{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.smart-option small{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.smart-thumb,.smart-avatar,.smart-status-dot,.smart-dot{flex:0 0 auto!important}
.smart-select-button .smart-status-dot,.smart-option .smart-status-dot{width:36px!important;height:36px!important;border-radius:999px!important;border:4px solid #fff!important;box-shadow:0 0 0 1px #cfe0ff!important;display:block!important}
.smart-select-button:has(.smart-status-dot),.smart-option:has(.smart-status-dot){grid-template-columns:48px minmax(0,1fr)!important}
.smart-option{grid-template-columns:48px minmax(0,1fr)!important;min-width:0!important}
.smart-shipping-thumb,.smart-account-thumb{width:52px!important;height:40px!important;border-radius:12px!important;padding:4px!important;background:#fff!important;border:1px solid #dbe7fb!important;display:grid!important;place-items:center!important;overflow:hidden!important;flex:0 0 52px!important}
.smart-shipping-img,.smart-account-img{width:100%!important;height:100%!important;object-fit:contain!important;background:transparent!important;border:0!important;border-radius:8px!important}
@media(max-width:760px){.order-actions{grid-template-columns:1fr!important}.smart-select-panel{max-width:calc(100vw - 24px)!important}}

/* V191: botones de pedido alineados y miniaturas en cuentas de pago */
.order-buttons-row{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:16px!important;
  flex-wrap:wrap!important;
  margin:12px 0 18px!important;
}
.order-buttons-row .btn{
  min-width:220px!important;
  min-height:58px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:16px!important;
  font-weight:900!important;
}
.order-buttons-row [data-save-order]{
  background:#2f6df6!important;
  color:#fff!important;
}
.order-actions .action-field-btn{display:none!important;}
.smart-select-button .smart-account-thumb,
.smart-option .smart-account-thumb{
  width:52px!important;
  height:40px!important;
  flex:0 0 52px!important;
  border-radius:12px!important;
  background:#fff!important;
}
.smart-select-button .smart-account-img,
.smart-option .smart-account-img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
}
.smart-select-button .smart-avatar,
.smart-option .smart-avatar{
  flex:0 0 48px!important;
}
@media(max-width:760px){
  .order-buttons-row{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;}
  .order-buttons-row .btn{width:100%!important;min-width:0!important;}
}


/* V192: compactar acciones del pedido para eliminar hueco grande */
.order-actions.intuitive-form{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;
  gap:14px!important;
  align-items:end!important;
  padding:0 20px 12px!important;
  margin:0!important;
}
.order-actions .order-buttons-inline{
  min-width:0!important;
  align-self:end!important;
}
.order-actions .order-buttons-inline .actions-spacer-label{
  visibility:hidden!important;
}
.order-actions .order-buttons-inline .order-buttons-row{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
  margin:0!important;
  width:100%!important;
  align-items:stretch!important;
}
.order-actions .order-buttons-inline .order-buttons-row .btn{
  width:100%!important;
  min-width:0!important;
  min-height:58px!important;
  margin:0!important;
}
.order-breakdown-box{
  margin-top:8px!important;
}
@media(max-width:980px){
  .order-actions .order-buttons-inline{grid-column:1/-1!important;}
}
@media(max-width:760px){
  .order-actions.intuitive-form{padding:0 12px 12px!important;}
  .order-actions .order-buttons-inline .actions-spacer-label{display:none!important;}
  .order-actions .order-buttons-inline .order-buttons-row{grid-template-columns:1fr!important;}
}


/* V193: estabiliza puntos de gráficas del dashboard para evitar parpadeo */
.chart-dot,
.line-chart .line-point{
  transition:none!important;
  animation:none!important;
  transform:none!important;
  transform-origin:center center!important;
  transform-box:fill-box!important;
  pointer-events:none!important;
  will-change:auto!important;
}
.chart-dot:hover,
.chart-dot:focus,
.line-chart .line-point:hover,
.line-chart .line-point:focus{
  transform:none!important;
  animation:none!important;
}
.chart-hit{
  fill:transparent!important;
  stroke:transparent!important;
  cursor:pointer;
  pointer-events:all;
  outline:none;
}
.chart-hit:focus{
  stroke:rgba(47,109,246,.22)!important;
  stroke-width:3;
}
.line-chart-tooltip{
  will-change:opacity;
  pointer-events:none!important;
}

/* V195 - Sucursales POS */
.st-sucursal,
.status-badge.st-sucursal,
.status-select.st-sucursal,
.status-card.st-sucursal{
  background:#ecfdf5!important;
  color:#0f766e!important;
  border-color:#99f6e4!important;
}
.branch-card.selected{outline:3px solid rgba(15,118,110,.18);border-color:#0f766e!important}
.branch-detail{background:linear-gradient(135deg,#ecfdf5,#ffffff)!important;border-color:#99f6e4!important}
.check-line{display:flex;align-items:center;gap:10px;font-weight:800;color:#334155;margin:10px 0}
.check-line input{width:18px;height:18px}
.branch-list .order-card{display:block}

/* V208 métricas online sucursales */
.sync-details{border:1px solid #dbe7fb;border-radius:18px;background:#f8fbff;padding:14px;margin-top:14px}
.sync-details summary{cursor:pointer;font-weight:1000;color:#123f9c;font-size:16px;list-style:none}
.sync-details summary::-webkit-details-marker{display:none}
.sync-details summary:before{content:'▾';display:inline-block;margin-right:8px;color:#2f6df6;font-weight:1000}
.sync-details:not([open]) summary:before{content:'▸'}
.mini-progress{height:8px;background:#eef4ff;border-radius:999px;overflow:hidden;margin-top:8px;box-shadow:inset 0 0 0 1px rgba(59,130,246,.12)}
.mini-progress span{display:block;height:100%;background:linear-gradient(90deg,#2563eb,#22c55e);border-radius:999px;transition:width .2s ease}


/* V211: botón editar producto directo desde resultado de lectura SKU */
.scan-history-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0;}
.scan-history-title-row>div{min-width:0;}
.scan-edit-product-btn{white-space:nowrap;align-self:flex-start;padding:8px 10px;font-size:12px;}
.scan-history-main{min-width:0;}
@media(max-width:760px){
  .scan-history-title-row{flex-direction:column;align-items:flex-start;gap:6px;}
  .scan-edit-product-btn{width:100%;text-align:center;}
}

/* V212: selección y cambio masivo de categorías */
.bulk-select-col{width:46px;text-align:center;vertical-align:middle}
.bulk-select-col input{width:18px;height:18px;cursor:pointer}
.bulk-selection-summary{display:flex;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;border-radius:12px;background:#f1f5f9;color:#334155;font-size:13px}
.bulk-category-move-box{margin-top:16px;margin-bottom:14px;padding:14px;border:1px solid #e5e7eb;border-radius:18px;background:#f8fafc}
.bulk-category-move-box h3{margin-top:0}
.bulk-category-move-box .filters{align-items:end}

/* V215: acciones masivas - rama completa legible en selectores */
.bulk-category-move-box .field{min-width:260px!important;}
.bulk-category-move-box .smart-select-button{min-height:66px!important;align-items:flex-start!important;}
.bulk-category-move-box .smart-select-button > span:last-child,
.bulk-category-move-box .smart-option > span:last-child{min-width:0!important;max-width:100%!important;overflow:visible!important;}
.bulk-category-move-box .smart-select-button b,
.bulk-category-move-box .smart-option b{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.25!important;word-break:break-word!important;}
.bulk-category-move-box .smart-option{min-height:56px!important;align-items:flex-start!important;}
.bulk-category-move-box .smart-select-panel{max-width:calc(100vw - 24px)!important;}
@media(max-width:900px){.bulk-category-move-box .field{min-width:0!important}.bulk-category-move-box .smart-select-button{min-height:58px!important}}

/* V216 - Buscador amplio de ramas para acciones masivas */
.bulk-category-move-box .filters{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(185px,1fr));
  gap:12px;
  align-items:start;
}
.bulk-category-move-box .field{
  min-width:0!important;
  width:100%;
}
.bulk-category-move-box .bulk-branch-open{
  margin:8px auto 0;
  width:65%;
  min-width:118px;
  max-width:170px;
  min-height:34px;
  padding:8px 10px;
  border-radius:11px;
  justify-content:center;
  display:flex;
  align-items:center;
  gap:5px;
  font-size:13px;
  line-height:1;
}
.bulk-category-move-box #bulkChangeCategory{
  width:100%;
  max-width:230px;
  align-self:end;
}
.bulk-branch-picker-overlay{position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:6500;display:none;align-items:flex-start;justify-content:center;padding:28px 16px;overflow:auto}
.bulk-branch-picker-overlay.open{display:flex}
.bulk-branch-picker-card{width:min(980px,96vw);max-height:calc(100vh - 56px);background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 24px 70px rgba(15,23,42,.25);padding:18px;display:flex;flex-direction:column;gap:14px}
.bulk-branch-picker-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border-bottom:1px solid #edf2fb;padding-bottom:12px}
.bulk-branch-picker-head h3{margin:0 0 6px;color:#0f172a}.bulk-branch-picker-head p{margin:0}.bulk-branch-picker-search{width:100%;border:1px solid var(--line);border-radius:16px;padding:15px 16px;font-weight:900;font-size:15px;outline:none}.bulk-branch-picker-search:focus{border-color:#2f6df6;box-shadow:0 0 0 4px rgba(47,109,246,.12)}
.bulk-branch-picker-list{display:grid;gap:10px;overflow:auto;padding-right:4px;max-height:62vh}.bulk-branch-row{width:100%;border:1px solid #dbe7ff;background:#f8fbff;border-radius:16px;padding:13px 14px;text-align:left;cursor:pointer;display:grid;gap:5px}.bulk-branch-row:hover{border-color:#2f6df6;background:#eef5ff}.bulk-branch-row.selected{border-color:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.12)}.bulk-branch-row b{font-size:15px;color:#102a58;line-height:1.25}.bulk-branch-row small{color:#64748b;font-weight:800;line-height:1.25;white-space:normal;word-break:break-word}.bulk-branch-empty{padding:18px;text-align:center}
@media(max-width:720px){.bulk-branch-picker-overlay{padding:10px}.bulk-branch-picker-card{width:100%;border-radius:18px;max-height:calc(100vh - 20px)}.bulk-branch-picker-head{display:grid}.bulk-branch-picker-list{max-height:58vh}}

/* V218 - Acciones para archivos preparados de WhatsApp */
.account-preview-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.account-preview-actions .btn{flex:1 1 150px;justify-content:center}
.bulk-selection-summary small{display:block;margin-top:4px;color:#64748b;font-weight:600}

/* V219 - Galería móvil: panel de respaldo para compartir todas las imágenes del producto */
.gallery-share-fallback{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(9,18,38,.58);
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding:16px;
}
.gallery-share-fallback.show{display:flex;}
.gallery-share-box{
  width:min(760px,100%);
  max-height:82vh;
  overflow:auto;
  background:#fff;
  border-radius:26px 26px 18px 18px;
  box-shadow:0 24px 80px rgba(15,23,42,.28);
  padding:22px;
  position:relative;
}
.gallery-share-box h3{margin:0 44px 6px 0;color:#07183a;font-size:20px;}
.gallery-share-box p{margin:0 0 14px;color:#64748b;font-weight:700;}
.gallery-share-close{
  position:absolute;
  top:14px;
  right:14px;
  width:38px;
  height:38px;
  border:0;
  border-radius:14px;
  background:#eef4ff;
  color:#0f172a;
  font-size:24px;
  font-weight:900;
}
.gallery-share-images{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
  gap:12px;
}
.gallery-share-images a{
  display:block;
  text-decoration:none;
  color:#07183a;
  font-weight:900;
  border:1px solid #dbeafe;
  border-radius:18px;
  padding:8px;
  background:#f8fbff;
}
.gallery-share-images img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:14px;
  display:block;
  margin-bottom:6px;
}
.gallery-share-images span{display:block;text-align:center;font-size:12px;}

/* ==============================
   V220 - Teléfono ultra rápido + UI moderna
   ============================== */
body.phone-body{
  background:
    radial-gradient(circle at 12% 0%, rgba(47,109,246,.22), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(18,184,134,.18), transparent 32%),
    linear-gradient(180deg,#f7faff 0%,#eef5ff 48%,#f8fbff 100%) !important;
  color:#06133c;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  touch-action:manipulation;
}
.phone-shell{
  width:min(760px,100%) !important;
  background:rgba(248,251,255,.78) !important;
  backdrop-filter:blur(14px);
  box-shadow:none !important;
  border-left:1px solid rgba(216,230,255,.75);
  border-right:1px solid rgba(216,230,255,.75);
}
.phone-header{
  background:linear-gradient(135deg,#061b5f 0%,#0b4ee7 54%,#2563eb 100%) !important;
  border-bottom:1px solid rgba(255,255,255,.16);
  box-shadow:0 10px 28px rgba(15,43,110,.22);
  padding:12px 16px !important;
}
.phone-header h1{font-size:17px !important;letter-spacing:-.02em}.phone-header small{opacity:.82;font-weight:750}.phone-brand img{box-shadow:0 8px 22px rgba(0,0,0,.18)}
.phone-search-wrap{
  top:68px !important;
  background:rgba(247,250,255,.82) !important;
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(216,230,255,.72);
  padding:10px 14px !important;
}
.phone-search-wrap input,
.phone-gallery-filters input,.phone-gallery-filters select,
.phone-filter-grid input,.phone-filter-grid select,.phone-order-card input,
.phone-scan-line input,.phone-form input,.phone-modal-form input,.phone-modal-form select{
  min-height:46px;
  border:1px solid rgba(180,202,241,.95) !important;
  border-radius:16px !important;
  background:rgba(255,255,255,.94) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 6px 18px rgba(15,35,80,.045);
  transition:border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.phone-search-wrap input:focus,
.phone-gallery-filters input:focus,.phone-gallery-filters select:focus,
.phone-filter-grid input:focus,.phone-filter-grid select:focus,.phone-scan-line input:focus{
  outline:none;
  border-color:#2f6df6 !important;
  box-shadow:0 0 0 4px rgba(47,109,246,.13),0 10px 24px rgba(15,35,80,.07);
}
.phone-main{gap:14px !important;padding:14px !important;padding-bottom:112px !important}.phone-card{
  background:rgba(255,255,255,.90) !important;
  border:1px solid rgba(205,222,252,.92) !important;
  border-radius:24px !important;
  box-shadow:0 18px 42px rgba(15,35,80,.08) !important;
  padding:16px !important;
  contain:layout paint;
}.phone-card h2{letter-spacing:-.035em}.phone-card h3{letter-spacing:-.02em}
.btn,.phone-action,.phone-tabs button,.phone-status-control button,.phone-load-more{
  border:0 !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#2f6df6,#0b5cff) !important;
  color:#fff !important;
  box-shadow:0 12px 24px rgba(47,109,246,.24) !important;
  font-weight:1000 !important;
  transform:translateZ(0);
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn.ghost,.phone-action:not(.active){
  background:linear-gradient(135deg,#eef5ff,#ffffff) !important;
  color:#0b4ed8 !important;
  border:1px solid #d8e6ff !important;
  box-shadow:0 10px 22px rgba(15,35,80,.06) !important;
}
.btn:active,.phone-action:active,.phone-tabs button:active{transform:scale(.985);filter:saturate(1.08)}
.phone-tabs{background:rgba(238,245,255,.68);border:1px solid #dce8ff;border-radius:20px;padding:6px}.phone-tabs button{box-shadow:none !important;background:transparent !important;color:#37527b !important}.phone-tabs button.active{background:linear-gradient(135deg,#2f6df6,#0b5cff) !important;color:#fff !important}
.phone-bottom{
  width:min(760px,100%) !important;
  background:rgba(255,255,255,.92) !important;
  backdrop-filter:blur(18px);
  border-top:1px solid rgba(205,222,252,.92) !important;
  box-shadow:0 -18px 34px rgba(15,35,80,.10) !important;
  min-height:74px !important;
  padding:10px 12px calc(12px + env(safe-area-inset-bottom)) !important;
}.phone-bottom a{font-size:12px !important;color:#155be7 !important}.phone-bottom a:hover{background:#eef5ff}
.phone-row,.phone-detail-card,.phone-order-general-card,.phone-pos-item-card,.phone-client-card{
  background:rgba(255,255,255,.92) !important;
  border:1px solid #deebff !important;
  border-radius:18px !important;
  box-shadow:0 8px 20px rgba(15,35,80,.045);
}
.phone-product-grid,.phone-gallery-grid{gap:14px !important}.phone-product-card{
  border:1px solid rgba(208,224,255,.95) !important;
  background:rgba(255,255,255,.94) !important;
  border-radius:24px !important;
  box-shadow:0 16px 34px rgba(15,35,80,.075) !important;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease !important;
  content-visibility:auto;
  contain-intrinsic-size:330px;
}.phone-product-card:active{transform:scale(.992)}.phone-product-card.stock-high{border-color:rgba(34,197,94,.75) !important}.phone-product-card.stock-mid{border-color:rgba(245,158,11,.75) !important}.phone-product-card.stock-low{border-color:rgba(239,68,68,.75) !important}.phone-product-img{border-radius:20px !important;background:linear-gradient(135deg,#eef5ff,#f8fbff) !important;box-shadow:inset 0 0 0 1px rgba(216,230,255,.9)}.phone-product-img img{transform:translateZ(0);will-change:auto}.phone-product-info b{color:#071a40 !important;letter-spacing:-.03em}.phone-product-info small{color:#64748b !important}.phone-card-foot{background:#f5f9ff;border:1px solid #e1ecff;border-radius:999px;padding:7px 9px;margin-top:5px}.phone-card-foot span:first-child{color:#0b5cff}.phone-card-foot span:last-child{color:#071a40}.phone-actions-row{gap:10px !important}.phone-actions-row .btn{min-height:44px !important}.phone-detail-card summary{border-radius:18px}.phone-kv{background:#f7fbff !important}.phone-search-results{border-radius:22px !important;box-shadow:0 22px 50px rgba(15,35,80,.18) !important}.phone-search-row{transition:background .12s ease}.phone-search-row:active{background:#eef5ff}.phone-loading{position:relative;overflow:hidden}.phone-loading::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(47,109,246,.08),transparent);animation:phoneShimmer 1.1s infinite}@keyframes phoneShimmer{to{transform:translateX(100%)}}
.phone-load-more{margin:2px 0 18px;min-height:48px}.gallery-share-fallback{backdrop-filter:blur(10px)}
@media(max-width:520px){
  .phone-shell{width:100% !important;border:0}.phone-main{padding:12px !important;padding-bottom:106px !important}.phone-card{border-radius:22px !important;padding:14px !important}.phone-gallery-grid,.phone-product-grid{grid-template-columns:1fr 1fr !important;gap:12px !important}.phone-product-card{border-radius:20px !important}.phone-product-img{height:132px !important}.phone-gallery-grid .phone-product-card:not(.expanded){min-height:286px !important}.phone-bottom{min-height:72px !important}.phone-header-actions a{display:none}.phone-user-mini span{display:none}.phone-search-wrap{top:66px !important}.phone-gallery-filters{gap:8px !important}.phone-gallery-filters input,.phone-gallery-filters select{font-size:13px;padding:10px !important}.phone-actions{gap:10px !important}
}
@media(max-width:370px){
  .phone-gallery-grid,.phone-product-grid{grid-template-columns:1fr !important}.phone-product-img{height:170px !important}.phone-gallery-grid .phone-product-card:not(.expanded){min-height:auto !important}
}
@media(prefers-reduced-motion:reduce){.phone-product-card,.btn,.phone-action,.phone-tabs button{transition:none !important}.phone-loading::after{animation:none}}

/* V221 - Buscador POS dentro de fábrica sin Shopify/QR/Borrador */
.factory-pos-picker-card{border:1px solid rgba(37,99,235,.14);box-shadow:0 16px 40px rgba(15,23,42,.06)}
.factory-pos-filters{align-items:end}.factory-pos-results{display:grid;gap:12px;margin-top:14px}.factory-pos-product{border:1px solid #dbeafe;border-radius:22px;background:#fff;overflow:hidden;transition:.18s ease;box-shadow:0 8px 24px rgba(15,23,42,.04)}
.factory-pos-product.open,.factory-pos-product.selected{border-color:#22c55e;box-shadow:0 14px 34px rgba(34,197,94,.12)}
.factory-pos-product-head{width:100%;border:0;background:linear-gradient(180deg,#fff,#f8fbff);display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:14px;align-items:center;text-align:left;padding:14px;cursor:pointer;color:#081633;font:inherit}
.factory-pos-product-head:hover{background:#f0f6ff}.factory-pos-thumb{width:70px;height:70px;border-radius:18px;background:#eef5ff;display:grid;place-items:center;overflow:hidden}.factory-pos-thumb img{width:100%;height:100%;object-fit:cover}.factory-pos-main{min-width:0;display:flex;flex-direction:column;gap:4px}.factory-pos-main b{font-size:15px;line-height:1.15}.factory-pos-main small{color:#5b6b86;font-weight:700}.factory-pos-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px;white-space:nowrap}.factory-pos-detail{padding:0 16px 16px;background:#fff}.factory-pos-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:start;padding:16px 0}.factory-pos-detail-grid h4{margin:0 0 6px}.factory-pos-detail-grid p{margin:0 0 8px}.factory-pos-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.factory-selected-source{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:18px;margin-bottom:18px}.factory-selected-source span{font-weight:800;color:#12305f}.factory-send-btn{font-size:18px;padding:16px 20px;border-radius:18px}.compact-table th,.compact-table td{padding:10px 12px}
@media(max-width:780px){.factory-pos-product-head{grid-template-columns:58px 1fr}.factory-pos-side{grid-column:2;align-items:flex-start;flex-direction:row}.factory-pos-thumb{width:58px;height:58px}.factory-pos-detail-grid{grid-template-columns:1fr}.factory-pos-actions{justify-content:stretch}.factory-pos-actions .btn{flex:1}.factory-selected-source{display:block}.factory-selected-source b{display:block;margin-bottom:6px}}

/* V222 - Apartado independiente Producto POS -> Fábrica */
.factory-pos-hero{position:relative;overflow:hidden;background:linear-gradient(135deg,#ffffff 0%,#eef5ff 55%,#e8fff5 100%)}
.factory-pos-picker-premium{border:1px solid #dbe9ff;box-shadow:0 18px 45px rgba(17,55,120,.09);overflow:hidden}
.factory-pos-live-badge{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;border-radius:999px;background:#ecfdf5;color:#047857;font-weight:900;font-size:12px;border:1px solid #bbf7d0}
.factory-pos-smart-filters{grid-template-columns:repeat(6,minmax(140px,1fr));align-items:end;background:linear-gradient(180deg,#f8fbff,#fff);border:1px solid #e0ebff;border-radius:22px;padding:16px;margin:12px 0 18px;box-shadow:inset 0 1px 0 #fff}
.factory-pos-smart-filters .search-wide{grid-column:span 2}
.factory-pos-smart-filters .qty-mini{max-width:180px}
.factory-pos-search-btn{height:54px;border-radius:18px;box-shadow:0 12px 22px rgba(37,99,235,.18)}
.factory-pos-grid{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:16px;align-items:start}
.factory-pos-product.modern{border:1px solid #dbeafe;border-radius:24px;background:#fff;overflow:hidden;box-shadow:0 14px 30px rgba(15,23,42,.06);transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.factory-pos-product.modern:hover{transform:translateY(-2px);border-color:#7db4ff;box-shadow:0 18px 38px rgba(37,99,235,.13)}
.factory-pos-product.modern.selected{border-color:#18c37e;box-shadow:0 0 0 2px rgba(24,195,126,.18),0 18px 38px rgba(24,195,126,.10)}
.factory-pos-product-head.modern{width:100%;display:grid;grid-template-columns:86px 1fr auto;gap:14px;align-items:center;text-align:left;background:transparent;border:0;padding:16px;cursor:pointer;color:#071836}
.factory-pos-thumb.modern{width:86px;height:86px;border-radius:20px;background:#f1f5f9;overflow:hidden;display:flex;align-items:center;justify-content:center}
.factory-pos-thumb.modern img{width:100%;height:100%;object-fit:cover;display:block}
.factory-pos-main.modern b{display:block;font-size:15px;line-height:1.16;letter-spacing:-.01em;color:#071836;text-transform:uppercase}
.factory-pos-main.modern small{display:block;margin-top:6px;color:#58708f;font-weight:800;font-size:12px;line-height:1.25}
.factory-pos-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
.factory-pos-meta em{font-style:normal;background:#f1f5ff;color:#1d4ed8;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.factory-pos-side.modern{display:flex;flex-direction:column;align-items:flex-end;gap:7px;min-width:86px}
.factory-pos-side.modern strong{font-size:15px;color:#071836}.factory-pos-side.modern small{font-weight:900;color:#2563eb}
.factory-pos-detail.modern{border-top:1px solid #e8f0ff;background:linear-gradient(180deg,#f8fbff,#fff);padding:16px}
.factory-pos-detail-grid.modern{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:start}.factory-pos-detail-grid.modern h4{margin:0 0 8px}.factory-pos-detail-grid.modern p{margin:0 0 8px;line-height:1.35}.factory-pos-actions.modern{display:flex;flex-direction:column;gap:10px;min-width:190px}.factory-pos-empty{grid-column:1/-1}.factory-linked-order-card{border:1px solid #d6f5e6;box-shadow:0 18px 45px rgba(16,185,129,.08)}
@media(max-width:1180px){.factory-pos-smart-filters{grid-template-columns:repeat(3,minmax(160px,1fr))}.factory-pos-smart-filters .search-wide{grid-column:span 2}.factory-pos-grid{grid-template-columns:1fr}}
@media(max-width:720px){.factory-pos-smart-filters{grid-template-columns:1fr}.factory-pos-smart-filters .search-wide{grid-column:span 1}.factory-pos-product-head.modern{grid-template-columns:72px 1fr;gap:12px}.factory-pos-side.modern{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between}.factory-pos-thumb.modern{width:72px;height:72px}.factory-pos-detail-grid.modern{grid-template-columns:1fr}.factory-pos-actions.modern{min-width:0}.factory-pos-grid{gap:12px}}

/* V223 - desplegable de imagen grande para miniaturas de producto */
.prodcell img,
.table img.mini,
.table img.thumb,
.mini-thumb,
.order-thumb,
.phone-order-thumb,
.phone-product-card img,
.phone-detail-card summary img,
.phone-gallery-card img,
.phone-pos-product img,
.phone-history-thumb-img,
.factory-prod img,
.factory-list img,
.factory-orders img,
.ay-design-image img,
.ay-cap-image img,
.product-images img,
.rank-thumb,
.drill-item-thumb img{
  cursor: zoom-in;
}
.product-img-preview-active{
  outline: 3px solid rgba(47,109,246,.45);
  outline-offset: 2px;
}
.product-img-preview-row td{
  background: transparent!important;
  padding: 10px 0 18px!important;
  border-bottom: 0!important;
}
.product-img-preview-dropdown{
  position: relative;
  width: min(760px, 100%);
  margin: 10px auto 16px;
  padding: 14px;
  border: 1px solid rgba(47,109,246,.22);
  border-radius: 24px;
  background: linear-gradient(180deg,#ffffff 0%,#f5f8ff 100%);
  box-shadow: 0 18px 45px rgba(15,23,42,.14);
  animation: productPreviewDrop .16s ease-out;
  cursor: zoom-out;
  z-index: 20;
}
.product-img-preview-shell{
  display: grid;
  place-items: center;
  gap: 10px;
}
.product-img-preview-shell img{
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 18px;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px rgba(148,163,184,.35);
}
.product-img-preview-caption{
  width: 100%;
  color: #0b1b3d;
  font-weight: 900;
  font-size: 14px;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
}
.product-img-preview-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #0b1b3d;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(15,23,42,.22);
}
@keyframes productPreviewDrop{
  from{opacity:0; transform:translateY(-6px) scale(.985)}
  to{opacity:1; transform:translateY(0) scale(1)}
}
@media (max-width: 720px){
  .product-img-preview-dropdown{
    width: calc(100vw - 28px);
    margin: 10px auto 14px;
    padding: 10px;
    border-radius: 20px;
  }
  .product-img-preview-shell img{
    max-height: 62vh;
    border-radius: 16px;
  }
}

/* V224 - creador de pedido por producto en Producto POS */
.factory-pos-inline-help{border:1px solid #d6f5e6;background:linear-gradient(135deg,#ffffff,#f0fdf4);margin-top:16px}
.saved-green-text{color:#059669}
.factory-pos-card-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,.55fr);gap:10px;padding:0 16px 16px;background:#fff}
.factory-pos-card-actions .btn{min-height:46px;border-radius:16px;font-weight:900}
.factory-pos-create-btn.saved,.factory-pos-create-btn.sent{background:#dcfce7!important;color:#047857!important;border-color:#86efac!important;box-shadow:0 10px 24px rgba(16,185,129,.12)}
.factory-pos-create-btn.sent{background:#dbeafe!important;color:#1d4ed8!important;border-color:#93c5fd!important}
.factory-pos-send-product{box-shadow:0 12px 24px rgba(16,185,129,.18)}
.factory-pos-order-maker{margin-top:16px;border:1px solid #d6f5e6;border-radius:22px;background:linear-gradient(180deg,#ffffff,#f7fffb);padding:16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 14px 30px rgba(16,185,129,.08)}
.factory-pos-order-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.factory-pos-order-head b{display:block;color:#071836;font-size:16px}.factory-pos-order-head small{display:block;color:#64748b;font-weight:800;margin-top:3px}
.factory-pos-save-chip{display:inline-flex;align-items:center;justify-content:center;min-width:104px;padding:8px 12px;border-radius:999px;background:#eef2ff;color:#1d4ed8;border:1px solid #bfdbfe;font-weight:1000;font-size:12px;text-transform:uppercase;letter-spacing:.02em}
.factory-pos-save-chip.saved{background:#dcfce7;color:#047857;border-color:#86efac}.factory-pos-save-chip.sent{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}
.factory-pos-order-form{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:14px;margin-bottom:14px}
.factory-pos-section-head{margin:10px 0}.factory-pos-inline-section{background:#fff;border-color:#dbeafe;margin:12px 0;box-shadow:0 10px 24px rgba(15,23,42,.04)}
.factory-pos-inline-section .factory-form{margin-top:8px}.factory-pos-order-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.factory-pos-order-actions .btn{min-height:50px;border-radius:16px;font-weight:1000}
@media(max-width:720px){.factory-pos-card-actions,.factory-pos-order-actions{grid-template-columns:1fr}.factory-pos-order-head{align-items:flex-start;flex-direction:column}.factory-pos-save-chip{width:100%}}

/* V225 - creador de pedido POS fábrica en pantalla superpuesta + DST + selector visual de hilo */
.factory-pos-order-modal-backdrop{
  position:fixed; inset:0; z-index:9998; background:rgba(15,23,42,.48);
  backdrop-filter:blur(8px); display:flex; align-items:flex-start; justify-content:center;
  padding:32px 18px; overflow:auto; animation:factoryModalFade .14s ease-out;
}
.factory-pos-order-modal{
  width:min(1180px,calc(100vw - 36px)); max-height:calc(100vh - 64px); overflow:auto;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%); border:1px solid rgba(191,219,254,.9);
  border-radius:28px; box-shadow:0 28px 80px rgba(15,23,42,.28); animation:factoryModalPop .16s ease-out;
}
.factory-pos-order-modal-head{position:sticky;top:0;z-index:5;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:22px 24px;border-bottom:1px solid #e2eaff}.factory-pos-order-modal-head h2{margin:8px 0 4px;color:#071836;letter-spacing:-.03em}.factory-pos-order-modal-head p{margin:0;color:#64748b;font-weight:800}.factory-pos-order-modal-body{padding:20px 24px 10px;display:grid;gap:18px}.factory-pos-order-modal-actions{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px 24px;background:rgba(255,255,255,.95);backdrop-filter:blur(12px);border-top:1px solid #e2eaff}.factory-pos-order-modal-actions .btn{min-height:54px;border-radius:18px;font-weight:1000}.factory-pos-modal-product{display:grid;grid-template-columns:120px minmax(0,1fr);gap:18px;align-items:start;border:1px solid #dbeafe;background:#fff;border-radius:24px;padding:16px;box-shadow:0 12px 28px rgba(15,23,42,.05)}.factory-pos-modal-product .table-wrap{grid-column:1/-1}.factory-pos-modal-img{width:120px;height:120px;border-radius:22px;background:#eef5ff;overflow:hidden;display:grid;place-items:center}.factory-pos-modal-img img{width:100%;height:100%;object-fit:cover}.factory-pos-order-maker.overlay-mode{margin-top:0}.modal-close{width:46px;height:46px;border:0;border-radius:999px;background:#2563eb;color:#fff;font-size:28px;line-height:1;font-weight:900;cursor:pointer;box-shadow:0 14px 26px rgba(37,99,235,.24)}.modern-thread-box{background:linear-gradient(180deg,#ffffff,#f8fbff);border:1px solid #e1ecff;border-radius:22px;padding:14px;margin:12px 0}.factory-thread-rich-row{display:grid;grid-template-columns:42px minmax(260px,1fr) 180px 260px auto;gap:10px;align-items:end;padding:10px;border:1px solid #e5efff;border-radius:18px;background:#fff;margin-top:10px}.thread-index-pill{width:34px;height:34px;border-radius:999px;background:#eaf2ff;color:#1d4ed8;display:grid;place-items:center;font-weight:1000;margin-bottom:10px}.factory-rich-select{position:relative}.factory-rich-select-btn{width:100%;min-height:58px;border:1px solid #dbeafe;border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);display:grid;grid-template-columns:26px minmax(0,1fr) 18px;gap:10px;align-items:center;text-align:left;padding:10px 12px;cursor:pointer;color:#071836}.factory-rich-select-btn b{display:block;font-size:14px;line-height:1.15}.factory-rich-select-btn small{display:block;color:#64748b;font-size:12px;font-weight:700;margin-top:2px;white-space:normal}.thread-color-dot{width:24px;height:24px;border-radius:9px;display:inline-block;border:1px solid rgba(15,23,42,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}.thread-color-dot.empty{background:#e5e7eb}.factory-cap-thumb{width:24px;height:24px;border-radius:9px;border:1px solid rgba(15,23,42,.12);background:#eef4ff;display:grid;place-items:center;overflow:hidden;box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}.factory-cap-thumb img{width:100%;height:100%;object-fit:cover;display:block}.factory-cap-thumb.empty{color:#475569;font-size:14px}.factory-cap-option{grid-template-columns:28px 1fr}.factory-cap-select .factory-rich-select-btn{grid-template-columns:26px minmax(0,1fr) 18px}.factory-rich-select-menu{display:none;position:absolute;left:0;top:calc(100% + 8px);width:min(420px,92vw);max-height:320px;overflow:auto;z-index:10002;background:#fff;border:1px solid #dbeafe;border-radius:20px;box-shadow:0 22px 54px rgba(15,23,42,.20);padding:8px}.factory-rich-select.open .factory-rich-select-menu{display:block}.factory-color-option{width:100%;border:0;background:#fff;display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:center;text-align:left;padding:10px;border-radius:14px;cursor:pointer;color:#071836}.factory-color-option:hover{background:#f1f6ff}.factory-color-option b{display:block;font-size:13px}.factory-color-option small{display:block;color:#64748b;font-size:11px;font-weight:700;margin-top:2px}.field.mini label{font-size:12px}.field.mini input,.field.mini select{min-height:58px}.upload-card small{display:block;color:#64748b;font-weight:800;margin-top:6px;line-height:1.25}@keyframes factoryModalFade{from{opacity:0}to{opacity:1}}@keyframes factoryModalPop{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:980px){.factory-thread-rich-row{grid-template-columns:36px 1fr 1fr;align-items:start}.factory-thread-rich-row .btn{grid-column:1/-1}.factory-thread-rich-row .factory-rich-select{grid-column:2/-1}.factory-pos-modal-product{grid-template-columns:90px 1fr}.factory-pos-modal-img{width:90px;height:90px}}
@media(max-width:720px){.factory-pos-order-modal-backdrop{padding:10px}.factory-pos-order-modal{width:100%;max-height:calc(100vh - 20px);border-radius:22px}.factory-pos-order-modal-head,.factory-pos-order-modal-body,.factory-pos-order-modal-actions{padding-left:14px;padding-right:14px}.factory-pos-order-modal-actions{grid-template-columns:1fr}.factory-thread-rich-row{grid-template-columns:1fr}.thread-index-pill{margin-bottom:0}.factory-thread-rich-row .factory-rich-select{grid-column:auto}.factory-pos-modal-product{grid-template-columns:1fr}.factory-pos-modal-img{width:100%;height:180px}.factory-rich-select-menu{position:fixed;left:14px;right:14px;top:120px;width:auto;max-height:calc(100vh - 170px)}}


/* V227 - Corrección visual puntadas/EVA en modal Producto POS → Fábrica */
.factory-pos-order-modal .modern-thread-box{
  overflow: visible;
}
.factory-pos-order-modal .thread-box,
.factory-pos-order-modal .modern-thread-box{
  overflow: visible;
}
.factory-pos-order-modal .factory-thread-rich-row{
  grid-template-columns:42px minmax(320px,1.5fr) minmax(135px,.48fr) minmax(300px,1.05fr) auto;
  align-items:end;
  gap:12px;
  overflow: visible;
}
.factory-pos-order-modal .factory-thread-rich-row .field.mini,
.factory-pos-order-modal .factory-thread-rich-row .factory-rich-select{
  min-width:0;
}
.factory-pos-order-modal .factory-thread-rich-row .mini-label,
.factory-pos-order-modal .factory-thread-rich-row .field.mini label{
  display:block;
  margin:0 0 7px;
  color:#41516f;
  font-size:13px;
  font-weight:1000;
  line-height:1.15;
}
.factory-pos-order-modal .factory-stitches-field input{
  width:100%;
  min-width:112px;
  height:58px;
  text-align:center;
  font-weight:1000;
  font-size:16px;
  border-radius:16px;
}
.factory-pos-order-modal .factory-eva-select .factory-rich-select-btn,
.factory-pos-order-modal .factory-thread-select .factory-rich-select-btn{
  min-height:58px;
}
.factory-pos-order-modal .factory-thread-remove{
  height:48px;
  align-self:end;
  white-space:nowrap;
  border-radius:16px;
}
.factory-pos-order-modal .factory-rich-select-menu{
  width:min(460px,92vw);
}
.factory-pos-order-modal .factory-eva-select .factory-rich-select-menu{
  right:0;
  left:auto;
}
@media(max-width:1050px){
  .factory-pos-order-modal .factory-thread-rich-row{
    grid-template-columns:38px minmax(260px,1fr) minmax(120px,.45fr);
  }
  .factory-pos-order-modal .factory-eva-select{
    grid-column:2 / -1;
  }
  .factory-pos-order-modal .factory-thread-remove{
    grid-column:1 / -1;
    width:100%;
  }
}
@media(max-width:720px){
  .factory-pos-order-modal .factory-thread-rich-row{
    grid-template-columns:1fr;
  }
  .factory-pos-order-modal .thread-index-pill{
    margin-bottom:0;
  }
  .factory-pos-order-modal .factory-eva-select,
  .factory-pos-order-modal .factory-thread-remove{
    grid-column:auto;
  }
}


/* V228 - Ajuste definitivo fila Hilo / Puntadas / EVA en Producto POS → Fábrica */
.factory-pos-order-modal .modern-thread-box,
.factory-pos-order-modal .thread-box{
  overflow: visible !important;
}

.factory-pos-order-modal .factory-thread-rich-row{
  display:grid !important;
  grid-template-columns:44px minmax(360px,1.45fr) 140px minmax(320px,1fr) 116px !important;
  gap:14px !important;
  align-items:end !important;
  padding:14px !important;
  overflow: visible !important;
}

.factory-pos-order-modal .factory-thread-rich-row > *{
  min-width:0 !important;
}

.factory-pos-order-modal .thread-index-pill{
  align-self:center !important;
  margin:0 !important;
}

.factory-pos-order-modal .factory-thread-select,
.factory-pos-order-modal .factory-eva-select,
.factory-pos-order-modal .factory-stitches-field{
  align-self:end !important;
  width:100% !important;
}

.factory-pos-order-modal .factory-thread-rich-row .mini-label,
.factory-pos-order-modal .factory-thread-rich-row .field.mini label{
  display:block !important;
  height:auto !important;
  min-height:18px !important;
  margin:0 0 8px !important;
  padding:0 !important;
  color:#41516f !important;
  font-size:14px !important;
  font-weight:1000 !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
}

.factory-pos-order-modal .factory-rich-select-btn{
  min-height:64px !important;
  height:64px !important;
  grid-template-columns:32px minmax(0,1fr) 18px !important;
  padding:10px 14px !important;
}

.factory-pos-order-modal .factory-rich-select-btn span:not(.thread-color-dot){
  min-width:0 !important;
  overflow:hidden !important;
}

.factory-pos-order-modal .factory-rich-select-btn b{
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  font-size:15px !important;
}

.factory-pos-order-modal .factory-rich-select-btn small{
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  font-size:12px !important;
}

.factory-pos-order-modal .factory-stitches-field input{
  width:100% !important;
  min-width:0 !important;
  height:64px !important;
  min-height:64px !important;
  text-align:center !important;
  font-weight:1000 !important;
  font-size:20px !important;
  border-radius:18px !important;
  padding:0 10px !important;
}

.factory-pos-order-modal .factory-thread-remove{
  width:100% !important;
  height:64px !important;
  min-height:64px !important;
  align-self:end !important;
  white-space:nowrap !important;
  border-radius:18px !important;
}

.factory-pos-order-modal .factory-rich-select-menu{
  width:min(560px, calc(100vw - 80px)) !important;
  max-height:420px !important;
  overflow:auto !important;
  z-index:10050 !important;
}

.factory-pos-order-modal .factory-eva-select .factory-rich-select-menu{
  left:0 !important;
  right:auto !important;
}

.factory-pos-order-modal .factory-color-option{
  display:grid !important;
  grid-template-columns:34px minmax(0,1fr) !important;
  column-gap:12px !important;
  row-gap:2px !important;
  align-items:center !important;
  width:100% !important;
  padding:12px 14px !important;
}

.factory-pos-order-modal .factory-color-option .thread-color-dot{
  grid-row:1 / span 2 !important;
  grid-column:1 !important;
}
.factory-pos-order-modal .factory-cap-thumb{
  width:32px !important;
  height:32px !important;
  border-radius:10px !important;
}
.factory-pos-order-modal .factory-cap-option{
  display:grid !important;
  grid-template-columns:34px minmax(0,1fr) !important;
  column-gap:12px !important;
  row-gap:2px !important;
  align-items:center !important;
}
.factory-pos-order-modal .factory-cap-select .factory-rich-select-menu{
  width:min(560px, calc(100vw - 80px)) !important;
}

.factory-pos-order-modal .factory-color-option b{
  grid-column:2 !important;
  grid-row:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1.2 !important;
}

.factory-pos-order-modal .factory-color-option small{
  grid-column:2 !important;
  grid-row:2 !important;
  display:block !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1.25 !important;
}

@media(max-width:980px){
  .factory-pos-order-modal .factory-thread-rich-row{
    grid-template-columns:44px minmax(260px,1fr) 130px !important;
  }
  .factory-pos-order-modal .factory-eva-select{
    grid-column:2 / -1 !important;
  }
  .factory-pos-order-modal .factory-thread-remove{
    grid-column:1 / -1 !important;
  }
}

@media(max-width:720px){
  .factory-pos-order-modal .factory-thread-rich-row{
    grid-template-columns:1fr !important;
  }
  .factory-pos-order-modal .thread-index-pill{
    justify-self:start !important;
  }
  .factory-pos-order-modal .factory-eva-select,
  .factory-pos-order-modal .factory-thread-remove{
    grid-column:auto !important;
  }
}


/* V229 - Puntadas dentro de su caja, sin bajarse ni encimarse */
.factory-pos-order-modal .factory-thread-rich-row{
  grid-template-columns:44px minmax(360px,1.45fr) 132px minmax(320px,1fr) 116px !important;
  align-items:center !important;
}

.factory-pos-order-modal .factory-stitches-field{
  align-self:center !important;
  position:relative !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  gap:8px !important;
  margin:0 !important;
  padding:0 !important;
}

.factory-pos-order-modal .factory-stitches-field label{
  position:static !important;
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  height:18px !important;
  min-height:18px !important;
  line-height:18px !important;
  color:#41516f !important;
  font-size:14px !important;
  font-weight:1000 !important;
  white-space:nowrap !important;
}

.factory-pos-order-modal .factory-stitches-field input{
  display:block !important;
  position:static !important;
  transform:none !important;
  margin:0 !important;
  box-sizing:border-box !important;
  width:132px !important;
  max-width:132px !important;
  min-width:132px !important;
  height:64px !important;
  min-height:64px !important;
  line-height:64px !important;
  padding:0 12px !important;
  text-align:center !important;
  font-weight:1000 !important;
  font-size:20px !important;
  border:1px solid #dbeafe !important;
  border-radius:18px !important;
  background:#fff !important;
  color:#0d1730 !important;
}

.factory-pos-order-modal .factory-thread-select,
.factory-pos-order-modal .factory-eva-select,
.factory-pos-order-modal .factory-thread-remove{
  align-self:center !important;
}

.factory-pos-order-modal .factory-thread-remove{
  margin-top:26px !important;
}

@media(max-width:980px){
  .factory-pos-order-modal .factory-stitches-field input{
    width:130px !important;
    max-width:130px !important;
    min-width:130px !important;
  }
}
@media(max-width:720px){
  .factory-pos-order-modal .factory-stitches-field input{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }
  .factory-pos-order-modal .factory-thread-remove{
    margin-top:0 !important;
  }
}


/* V230 - Puntadas alineado arriba con Hilo/color y EVA */
.factory-pos-order-modal .factory-thread-rich-row{
  align-items:start !important;
}

.factory-pos-order-modal .factory-thread-select,
.factory-pos-order-modal .factory-eva-select,
.factory-pos-order-modal .factory-stitches-field{
  align-self:start !important;
}

.factory-pos-order-modal .factory-stitches-field{
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
}

.factory-pos-order-modal .factory-stitches-field label{
  position:static !important;
  display:block !important;
  margin:0 0 8px 0 !important;
  padding:0 !important;
  height:18px !important;
  min-height:18px !important;
  line-height:18px !important;
  transform:none !important;
}

.factory-pos-order-modal .factory-stitches-field input{
  position:static !important;
  display:block !important;
  margin:0 !important;
  transform:none !important;
  top:auto !important;
  left:auto !important;
  bottom:auto !important;
}

.factory-pos-order-modal .factory-thread-remove{
  align-self:start !important;
  margin-top:26px !important;
}

@media(max-width:720px){
  .factory-pos-order-modal .factory-thread-remove{
    margin-top:0 !important;
  }
}


/* V231 mejora fuerte resumen de fábrica */
.factory-hero-pro{background:linear-gradient(135deg,#ffffff 0%,#f7fbff 55%,#eef6ff 100%);border:1px solid #dce9ff;box-shadow:0 20px 54px rgba(14,41,90,.08)}
.factory-hero-pro h2{font-size:50px;letter-spacing:-.04em;max-width:820px}
.factory-hero-pro .muted{max-width:840px;font-size:16px;line-height:1.6}
.factory-overview-strip{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin:18px 0 24px}
.overview-chip{display:flex;align-items:center;gap:14px;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #dbe7fb;border-radius:22px;padding:16px 18px;box-shadow:0 12px 28px rgba(9,31,89,.06)}
.overview-chip.is-ok{border-color:#bbf7d0;background:linear-gradient(180deg,#fbfffd 0%,#f3fff7 100%)}
.overview-chip.is-warn{border-color:#fed7aa;background:linear-gradient(180deg,#fffdf7 0%,#fff7eb 100%)}
.overview-icon{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:#edf4ff;font-size:22px;flex:0 0 48px}
.overview-copy{display:grid;gap:3px;min-width:0}.overview-copy small{font-size:12px;font-weight:1000;color:#5f7394;text-transform:uppercase;letter-spacing:.05em}.overview-copy strong{font-size:28px;line-height:1;color:#10264d}.overview-copy em{font-style:normal;color:#6b7d99;font-size:12px;font-weight:800}
.factory-section-intro.compact{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:8px 0 14px}.factory-section-intro.compact h3{margin:8px 0 4px;color:#10264d;font-size:26px}.factory-section-intro.compact .muted{margin:0}
.pill.subtle{background:#edf4ff;color:#2a55cf}
.factory-status-card{padding:22px;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #d8e5fb;box-shadow:0 18px 42px rgba(9,31,89,.06)}
#factoryStatusFilter{min-height:44px;border-radius:14px;border:1px solid #d8e5fb;padding:0 14px;font-weight:900;color:#173569;background:#fff}
#factoryStatusResults{display:grid;gap:10px;margin-top:12px;max-height:340px;overflow:auto;padding-right:2px}
#factoryStatusResults .factory-row{background:#fff}
.factory-grid-pro{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.factory-grid-pro>.card{border:1px solid #d8e5fb;box-shadow:0 18px 42px rgba(9,31,89,.06);background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.dashboard-list-block{display:grid;gap:14px}.dashboard-list-block .chart-card-head{margin-bottom:2px}.dashboard-list-block .chart-card-head p{margin:4px 0 0}.dashboard-list-stack{display:grid;gap:10px}
.factory-quick-links a{position:relative;overflow:hidden;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.factory-quick-links a::after{content:'›';position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:22px;color:#2f6df6;font-weight:1000;opacity:.65}.factory-quick-links a:hover{transform:translateY(-2px);box-shadow:0 18px 34px rgba(47,109,246,.16);border-color:#bcd4ff}
.factory-chart-card{box-shadow:0 18px 42px rgba(9,31,89,.06);background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);height:100%}
.chart-card-head h3{font-size:24px;line-height:1.1;color:#10264d}.chart-card-head .muted{font-weight:800}
.kpi-card{min-height:320px;display:flex;flex-direction:column}.kpi-side-main{justify-items:stretch;align-content:stretch;text-align:left;gap:14px;padding:18px;height:100%}
.kpi-side-copy{justify-items:start;text-align:left}.kpi-side-copy strong{font-size:36px}.kpi-side-copy small{font-size:15px}.kpi-side-copy em{font-size:12px}
.kpi-api .kpi-side-main,.kpi-goal .kpi-side-main{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch}
.api-side-main{display:flex!important;flex-direction:column;justify-content:space-between;align-items:stretch;min-height:220px}
.api-copy{gap:6px}.api-dot.large{width:18px;height:18px;margin:0;align-self:flex-start}
.api-health-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:auto}.api-health-grid span{display:grid;gap:4px;padding:12px;border-radius:16px;background:rgba(255,255,255,.75);border:1px solid rgba(148,163,184,.18)}.api-health-grid b{font-size:18px;color:#10264d;line-height:1}.api-health-grid small{font-size:12px;color:#64748b;font-weight:900}
.goal-side-main{display:flex!important;flex-direction:column;justify-content:flex-start;align-items:flex-start}.goal-side-main .goal-ring{align-self:center}.goal-side-main .kpi-side-copy{width:100%}
.rank-row{transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.rank-row:hover{border-color:#c3d8ff}.rank-row-plain{padding:14px 16px}
.summary-bars.summary-bars-mainonly{gap:12px;min-height:220px}.summary-bars.summary-bars-mainonly .summary-bar{background:#f6f9ff;min-height:220px;transition:transform .16s ease,box-shadow .16s ease}.summary-bars.summary-bars-mainonly .summary-bar:hover{transform:translateY(-2px);box-shadow:0 16px 30px rgba(47,109,246,.12)}
#lineChart,.line-chart{filter:drop-shadow(0 16px 28px rgba(47,109,246,.1))}
.card .chart-empty{background:#f8fbff}
@media(max-width:1400px){.factory-overview-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1100px){.factory-hero-pro h2{font-size:40px}.factory-grid-pro{grid-template-columns:1fr}.factory-section-intro.compact{flex-direction:column;align-items:flex-start}}
@media(max-width:760px){.factory-overview-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.factory-hero-pro h2{font-size:32px}.factory-hero-pro .muted{font-size:14px}.overview-chip{padding:14px}.overview-copy strong{font-size:22px}.api-health-grid{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.factory-overview-strip{grid-template-columns:1fr}.overview-icon{width:42px;height:42px;flex-basis:42px}.factory-chart-card{padding:16px}.api-health-grid{grid-template-columns:1fr}.chart-card-head h3{font-size:20px}}


/* V232 - Card API corregida en resumen de fábrica */
.factory-page .kpi-api{
  overflow:hidden !important;
}

.factory-page .kpi-api .chart-card-head{
  margin-bottom:10px !important;
}

.factory-page .kpi-api .api-side-main{
  min-height:0 !important;
  height:100% !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:space-between !important;
  align-items:stretch !important;
  gap:14px !important;
  padding:16px !important;
  text-align:left !important;
  background:rgba(255,255,255,.72) !important;
  border:1px solid rgba(187,247,208,.65) !important;
}

.factory-page .kpi-api .api-dot.large{
  width:16px !important;
  height:16px !important;
  margin:0 !important;
  align-self:flex-start !important;
  flex:0 0 16px !important;
}

.factory-page .kpi-api .kpi-side-copy.api-copy{
  display:grid !important;
  justify-items:start !important;
  gap:5px !important;
  min-width:0 !important;
  width:100% !important;
}

.factory-page .kpi-api .kpi-side-copy.api-copy strong{
  font-size:clamp(24px, 2.4vw, 34px) !important;
  line-height:1.02 !important;
  letter-spacing:-.045em !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}

.factory-page .kpi-api .kpi-side-copy.api-copy small{
  font-size:13px !important;
  line-height:1.2 !important;
}

.factory-page .kpi-api .kpi-side-copy.api-copy em{
  font-size:12px !important;
  line-height:1.25 !important;
  max-width:100% !important;
}

.factory-page .kpi-api .api-health-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
  width:100% !important;
  margin-top:4px !important;
}

.factory-page .kpi-api .api-health-grid span{
  min-width:0 !important;
  padding:10px 8px !important;
  border-radius:14px !important;
  text-align:center !important;
  overflow:hidden !important;
}

.factory-page .kpi-api .api-health-grid b{
  display:block !important;
  font-size:16px !important;
  line-height:1.05 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.factory-page .kpi-api .api-health-grid small{
  display:block !important;
  font-size:10.5px !important;
  line-height:1.1 !important;
  margin-top:4px !important;
  white-space:normal !important;
  overflow-wrap:break-word !important;
}

@media(max-width:1320px){
  .factory-page .kpi-api .kpi-side-copy.api-copy strong{
    font-size:32px !important;
  }
}

@media(max-width:760px){
  .factory-page .kpi-api .api-health-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

@media(max-width:420px){
  .factory-page .kpi-api .api-health-grid{
    grid-template-columns:1fr !important;
  }
}


/* V234 - Paginación Producto POS en fábrica igual al POS */
.factory-pos-pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  margin:22px 0 4px;
  padding:16px;
  border:1px solid #dbe7fb;
  border-radius:20px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  box-shadow:0 12px 26px rgba(9,31,89,.06);
}
.factory-pos-pagination .btn[disabled]{
  opacity:.45;
  cursor:not-allowed;
}
.factory-pos-page-numbers{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
}
.factory-pos-page-numbers button,
.factory-pos-page-numbers span{
  min-width:38px;
  height:38px;
  display:inline-grid;
  place-items:center;
  border-radius:12px;
  border:1px solid #dbe7fb;
  background:#fff;
  color:#173569;
  font-weight:1000;
}
.factory-pos-page-numbers button{
  cursor:pointer;
}
.factory-pos-page-numbers button.active{
  background:#2f6df6;
  color:#fff;
  border-color:#2f6df6;
  box-shadow:0 10px 20px rgba(47,109,246,.22);
}
.factory-pos-pagination small{
  color:#64748b;
  font-weight:900;
}
@media(max-width:760px){
  .factory-pos-pagination{
    justify-content:stretch;
  }
  .factory-pos-pagination>.btn{
    flex:1 1 140px;
  }
  .factory-pos-page-numbers{
    width:100%;
  }
}


/* V235 - Producto POS fábrica sin filtro de stock por defecto */
#factoryPosQtyMin::placeholder{
  color:#7b8aa5;
  font-weight:800;
}
.factory-pos-empty{
  color:#44546f;
}


/* V236 - estados captura persistente Producto POS fábrica */
.factory-pos-create-btn.saved{
  background:#16a34a!important;
  color:#fff!important;
  border-color:#16a34a!important;
}
.factory-pos-create-btn.sent{
  background:#0f766e!important;
  color:#fff!important;
  border-color:#0f766e!important;
}


/* V237 - restauración de posición modal fábrica */
.factory-pos-order-modal{
  scroll-behavior:auto !important;
}
.factory-pos-order-modal-backdrop{
  scroll-behavior:auto !important;
}


/* V240 - archivos guardados al seleccionar en Producto POS fábrica */
.fpo-file-saved{
  display:block;
  margin-top:8px;
  padding:8px 10px;
  border-radius:12px;
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  color:#166534;
  font-weight:900;
}
.fpo-file-saved a{
  color:#0f766e;
  text-decoration:underline;
}
.upload-card.uploading{
  opacity:.75;
  outline:2px solid #2f6df6;
  outline-offset:2px;
}


/* V243 - Loader global + toasts fijos abajo derecha */
.toastbox{position:fixed!important;right:18px!important;bottom:18px!important;display:flex!important;flex-direction:column!important;align-items:flex-end!important;gap:12px!important;z-index:3200!important;pointer-events:none!important;max-width:min(420px,calc(100vw - 24px))!important}
.toast{min-width:min(360px,calc(100vw - 36px));max-width:min(420px,calc(100vw - 24px));padding:14px 16px;border-radius:18px;color:#fff;font-weight:800;box-shadow:0 18px 48px rgba(8,18,42,.22);border:1px solid rgba(255,255,255,.2);backdrop-filter:blur(6px);opacity:0;transform:translateY(14px) scale(.98);transition:opacity .22s ease,transform .22s ease;pointer-events:auto}
.toast.show{opacity:1;transform:translateY(0) scale(1)}
.toast.success{background:linear-gradient(180deg,#18a85b,#148447)!important;color:#fff!important}
.toast.error{background:linear-gradient(180deg,#dc3b3b,#b32323)!important;color:#fff!important}
.toast.warn{background:linear-gradient(180deg,#ffdc77,#f4c542)!important;color:#3a2800!important;border-color:#f2d57c!important}
.toast .toast-title{font-size:14px;font-weight:1000;line-height:1.1;margin-bottom:4px;letter-spacing:.02em;text-transform:uppercase}
.toast .toast-body{font-size:14px;font-weight:800;line-height:1.3}
.ay-global-loading-overlay{z-index:3100!important}
.ay-global-loading-card{width:min(440px,96vw)!important}
.ay-global-loading-kicker{font-size:24px;font-weight:1000;line-height:1.05;color:#0f4fd6;text-transform:uppercase;letter-spacing:.04em;margin:2px 0 10px}
.ay-global-loading-card h3{margin:0 0 8px;font-size:30px;line-height:1.04;color:#08245b}
.ay-global-loading-bar span.indeterminate{position:relative;width:42%!important;background:linear-gradient(90deg,#2f6df6,#69a6ff,#2f6df6)!important;animation:ayLoaderMove 1.15s linear infinite}
@keyframes ayLoaderMove{0%{margin-left:-42%}100%{margin-left:100%}}
@media(max-width:640px){.toast{min-width:min(320px,calc(100vw - 30px));padding:13px 14px}.ay-global-loading-kicker{font-size:20px}.ay-global-loading-card h3{font-size:24px}}

/* V243 hotfix - compatibilidad con toasts heredados */
.toast{opacity:1;transform:translateY(0) scale(1)}


/* V246 - Toast fijo abajo derecha sobre todo */
#toastContainer,
.toastbox{
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  left: auto !important;
  top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 12px !important;
  z-index: 99999 !important;
  width: auto !important;
  max-width: min(420px, calc(100vw - 24px)) !important;
  pointer-events: none !important;
}
#toastContainer .toast,
.toastbox .toast{
  pointer-events: auto !important;
  min-width: min(360px, calc(100vw - 32px)) !important;
  max-width: min(420px, calc(100vw - 24px)) !important;
  margin: 0 !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 48px rgba(8,18,42,.24) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}
@media (max-width: 640px){
  #toastContainer,
  .toastbox{right:12px !important;bottom:12px !important;max-width:calc(100vw - 20px) !important}
  #toastContainer .toast,
  .toastbox .toast{min-width:min(320px, calc(100vw - 20px)) !important;max-width:calc(100vw - 20px) !important}
}


/* V247 - eliminar pedido en proceso */
.btn.danger,
.factory-delete-order-btn{
  background:#dc2626!important;
  color:#fff!important;
  border-color:#b91c1c!important;
}
.btn.danger:hover,
.factory-delete-order-btn:hover{
  background:#b91c1c!important;
}


/* V252 - Card bloqueo Shopify restaurado */
.shopify-lock-overlay,
.shopify-cancel-confirm{
  z-index:99998!important;
}
.shopify-lock-card{
  width:min(560px,96vw)!important;
  border:1px solid rgba(248,113,113,.32)!important;
}
.shopify-lock-big{
  color:#dc2626!important;
  font-weight:1000!important;
  font-size:clamp(28px,4vw,44px)!important;
  line-height:1!important;
  letter-spacing:-.04em!important;
  text-transform:uppercase!important;
  margin:4px 0 10px!important;
}
.shopify-lock-big.small{
  font-size:clamp(22px,3vw,34px)!important;
}
.shopify-lock-card h3,
.shopify-confirm-card h3{
  margin:0 0 8px!important;
  color:#0f2248!important;
  font-size:clamp(22px,3vw,32px)!important;
}
.shopify-sync-box{
  text-align:left!important;
}
.shopify-lock-bar span{
  background:linear-gradient(90deg,#dc2626,#f97316,#22c55e)!important;
}
.shopify-lock-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:12px 0 8px;
}
.shopify-lock-grid span{
  display:grid;
  gap:3px;
  padding:10px 8px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e5e7eb;
  text-align:center;
}
.shopify-lock-grid b{
  color:#0f2248;
  font-size:18px;
  line-height:1;
}
.shopify-lock-grid small{
  color:#64748b;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}
.shopify-lock-actions{
  display:flex;
  justify-content:center;
  margin-top:16px;
}
.confirm-actions{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:18px;
}
.btn.danger,
button.danger{
  background:#dc2626!important;
  border-color:#b91c1c!important;
  color:#fff!important;
}
.btn.danger:hover,
button.danger:hover{
  background:#b91c1c!important;
}
@media(max-width:620px){
  .shopify-lock-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* V253 - Inventario móvil tipo galería */
.inventory-swatch-large{width:70px;height:70px;border-radius:18px;display:grid;place-items:center;background:#eef5ff;border:1px solid #d8e6ff}
.inventory-swatch-large .color-dot{width:44px;height:44px;margin:0;border-width:2px}
.inventory-area-strip{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:0 0 12px}
.inventory-area-box{border-radius:16px;padding:12px 10px;background:linear-gradient(180deg,#f3f8ff 0%,#eef5ff 100%);border:1px solid #d8e6ff;text-align:left;box-shadow:inset 0 1px 0 rgba(255,255,255,.92)}
.inventory-area-box span{display:block;font-size:12px;font-weight:900;color:#28406c}
.inventory-area-box strong{display:block;margin-top:6px;font-size:24px;line-height:1;color:#06133c}
.inventory-area-almacen{background:linear-gradient(180deg,#eefbf4,#e3f8eb)}
.inventory-area-fabrica{background:linear-gradient(180deg,#eef5ff,#e4eeff)}
.inventory-area-seguimiento{background:linear-gradient(180deg,#f7f3ff,#efe7ff)}
.inventory-area-terminado{background:linear-gradient(180deg,#ecfeff,#dff9ff)}
.inventory-area-venta{background:linear-gradient(180deg,#fff8e8,#fff1cc)}
.inventory-area-merma{background:linear-gradient(180deg,#fff1f2,#ffe3e7)}
@media(max-width:1100px){.inventory-area-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){
  .inventory-process-card{padding:14px;border-radius:22px}
  .inventory-process-head{align-items:flex-start;flex-direction:column;gap:12px}
  .inventory-process-head img,.inventory-process-head .logo,.inventory-swatch-large{width:100%;height:170px;border-radius:20px}
  .inventory-swatch-large{justify-items:center;align-items:center}
  .inventory-swatch-large .color-dot{width:92px;height:92px;border-width:4px}
  .inventory-process-head div:nth-child(2){width:100%}
  .inventory-process-head h3{font-size:22px;line-height:1.05}
  .inventory-process-head p{font-size:14px}
  .inventory-process-head .stock-badge{align-self:flex-end}
  .inventory-area-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .inventory-area-box{padding:10px 10px}
  .inventory-area-box strong{font-size:22px}
}
.phone-inventory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.phone-inventory-card{background:#fff;border:2px solid #d8e6ff;border-radius:22px;padding:12px;box-shadow:0 12px 26px rgba(8,31,86,.08);display:grid;gap:10px}
.phone-inventory-media{height:148px;border-radius:18px;background:linear-gradient(180deg,#eef5ff,#f8fbff);display:grid;place-items:center;overflow:hidden;border:1px solid #dbe8ff}
.phone-inventory-media img{width:100%;height:100%;object-fit:cover;display:block}
.phone-inventory-swatch{width:92px;height:92px;border-radius:22px;border:4px solid rgba(255,255,255,.95);box-shadow:0 10px 22px rgba(8,31,86,.12), inset 0 0 0 1px rgba(15,23,42,.12);display:block}
.phone-inventory-copy b{display:block;font-size:13px;line-height:1.18;color:#06133c;margin-bottom:4px}
.phone-inventory-copy small{display:block;color:#64748b;font-size:11px;line-height:1.2}
.phone-inventory-total{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,#dff7ea,#ecfff4);border:1px solid #b9eccf;border-radius:16px;padding:10px 12px}
.phone-inventory-total strong{font-size:28px;line-height:1;color:#0a7a36}
.phone-inventory-total span{font-size:12px;font-weight:1000;color:#1f7a44;text-transform:uppercase}
.phone-inventory-chip-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.phone-inventory-chip{background:linear-gradient(180deg,#eef5ff,#f8fbff);border:1px solid #d8e6ff;border-radius:14px;padding:9px 10px;min-height:58px}
.phone-inventory-chip span{display:block;font-size:11px;font-weight:900;color:#3a5481}
.phone-inventory-chip b{display:block;margin-top:5px;font-size:18px;line-height:1;color:#06133c}
.phone-inventory-chip:nth-child(1){background:linear-gradient(180deg,#eefbf4,#e3f8eb)}
.phone-inventory-chip:nth-child(2){background:linear-gradient(180deg,#eef5ff,#e4eeff)}
.phone-inventory-chip:nth-child(3){background:linear-gradient(180deg,#f7f3ff,#efe7ff)}
.phone-inventory-chip:nth-child(4){background:linear-gradient(180deg,#ecfeff,#dff9ff)}
.phone-inventory-chip:nth-child(5){background:linear-gradient(180deg,#fff8e8,#fff1cc)}
.phone-inventory-chip:nth-child(6){background:linear-gradient(180deg,#fff1f2,#ffe3e7)}
@media(max-width:560px){
  .phone-inventory-grid{grid-template-columns:1fr}
  .phone-inventory-media{height:184px}
  .phone-inventory-copy b{font-size:20px}
  .phone-inventory-copy small{font-size:13px}
  .phone-inventory-total strong{font-size:34px}
  .phone-inventory-chip-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}


/* V255 - Subpantallas inventario móvil */
.phone-inventory-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:10px 0 12px;
  padding:6px;
  border:1px solid #d8e6ff;
  border-radius:20px;
  background:#eef5ff;
}
.phone-inventory-tabs button{
  border:0;
  border-radius:15px;
  padding:11px 8px;
  font-weight:1000;
  font-size:12px;
  background:transparent;
  color:#37527b;
}
.phone-inventory-tabs button.active{
  background:linear-gradient(135deg,#2f6df6,#0b5cff);
  color:#fff;
  box-shadow:0 10px 20px rgba(47,109,246,.22);
}
.phone-inventory-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:0 0 12px;
  padding:12px 14px;
  border-radius:17px;
  background:linear-gradient(135deg,#eef5ff,#ffffff);
  border:1px solid #d8e6ff;
}
.phone-inventory-summary b{
  color:#06133c;
  font-weight:1000;
}
.phone-inventory-summary span{
  color:#0b5cff;
  font-size:13px;
  font-weight:1000;
  text-align:right;
}
@media(max-width:460px){
  .phone-inventory-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .phone-inventory-summary{display:grid}
  .phone-inventory-summary span{text-align:left}
}

/* V256 - permisos y modo desarrollador */
.developer-mode-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 18px;border-radius:16px;background:linear-gradient(135deg,#111827,#2563eb);color:#fff;text-decoration:none;font-weight:1000;box-shadow:0 12px 30px rgba(37,99,235,.24);margin-left:auto}.permission-check{align-items:flex-start}.permission-check small{display:block;color:#64748b;font-size:11px;font-weight:750;line-height:1.25;margin-top:3px}.orders-only .phone-search-wrap,.orders-only .phone-header-actions .orders-hide{display:none!important}.orders-only .phone-main{padding-top:16px!important}.permission-denied-card{max-width:720px;margin:40px auto;padding:24px;border-radius:24px;border:1px solid #fecaca;background:#fff1f2;color:#7f1d1d;box-shadow:0 16px 44px rgba(127,29,29,.12)}.permission-denied-card h2{margin:0 0 8px}.permission-denied-card p{font-weight:800;color:#991b1b}
.permission-check{display:grid!important;grid-template-columns:auto 1fr;column-gap:10px;row-gap:2px}.permission-check input{grid-row:1/3}.permission-check span{grid-column:2}.permission-check small{grid-column:2;display:block;color:#64748b;font-size:11px;font-weight:750;line-height:1.25;margin-top:2px}

/* V259 - Producción histórica Firebase + sistema actual */
.production-head{align-items:flex-start;gap:18px}
.production-range-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.production-range-btn{border:1px solid #2f6df6;background:#fff;color:#0b5cff;border-radius:14px;padding:12px 16px;font-weight:1000;cursor:pointer;box-shadow:0 10px 24px rgba(15,23,42,.05)}
.production-range-btn.active{background:#2f7df0;color:#fff;box-shadow:0 12px 26px rgba(47,109,246,.22)}
.production-inline-stats{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.production-inline-stat{min-width:132px;padding:12px 14px;border-radius:16px;border:1px solid #dbe7ff;background:linear-gradient(135deg,#f8fbff,#eef5ff)}
.production-inline-stat b{display:block;color:#06133c;font-size:22px;font-weight:1000;line-height:1.05}
.production-inline-stat span{display:block;margin-top:4px;color:#5b6b86;font-size:12px;font-weight:900;text-transform:none}
.production-history-chart{width:100%;min-height:390px;padding:14px 0 0;overflow-x:auto}
.production-svg{width:100%;min-width:980px;height:390px;display:block;overflow:visible}
.production-grid-line{stroke:rgba(15,23,42,.14);stroke-width:1}
.production-axis-label{fill:#334155;font-size:12px;font-weight:800}
.production-week-label{fill:#334155;font-size:13px;font-weight:900}
.production-area{fill:rgba(47,109,246,.14);stroke:none}
.production-line{stroke:#1d70f7;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 8px 14px rgba(47,109,246,.18))}
.production-point-group{cursor:pointer}
.production-point{fill:#1d70f7;stroke:#fff;stroke-width:3;transition:r .16s ease, filter .16s ease}
.production-point-group:hover .production-point{r:8;filter:drop-shadow(0 8px 14px rgba(47,109,246,.35))}
.production-value-label{fill:#fff;font-size:13px;font-weight:1000;paint-order:stroke;stroke:#1d70f7;stroke-width:6;stroke-linejoin:round;pointer-events:none}
@media(max-width:980px){.production-inline-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:780px){.production-head{display:grid}.production-range-actions{justify-content:flex-start}.production-svg{min-width:860px}.production-history-chart{min-height:340px}.production-inline-stats{grid-template-columns:1fr}}

/* V263 - filtro por medida de imagen principal y compartir producto */
.image-size-invert{
  border:1px solid #dbe7ff;
  border-radius:16px;
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
  padding:11px 13px;
  display:grid!important;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:2px 10px;
}
.image-size-invert span{font-weight:1000;color:#0f2248}
.image-size-invert small{grid-column:1;color:#64748b;font-size:11px;font-weight:800;line-height:1.15}
.image-size-invert input{grid-row:1/3;grid-column:2;width:22px;height:22px;accent-color:#2f6df6}
.product-share-btn{background:#eef5ff!important;color:#0b5cff!important;border:1px solid #bfdbfe!important}
.product-row-actions{gap:6px;flex-wrap:wrap}

/* V265 - acciones compactas en productos y filtro de medida corregido */
.product-row-actions-compact{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px!important;
  align-items:stretch;
  min-width:185px;
  max-width:210px;
}
.product-row-actions-compact .mini-action{
  min-height:38px;
  padding:0 8px!important;
  border-radius:12px!important;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:5px;
  font-size:12px!important;
  line-height:1.05!important;
  font-weight:1000!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  border:1px solid #cfe0ff!important;
  background:#eef5ff!important;
  color:#0b5cff!important;
  box-shadow:0 8px 18px rgba(15,23,42,.05)!important;
  overflow:hidden;
}
.product-row-actions-compact .mini-action svg{width:18px;height:18px}
.product-row-actions-compact .mini-action.draft{background:#1d5ff4!important;color:#fff!important;border-color:#1d5ff4!important}
.product-row-actions-compact .mini-action.danger{background:#ef4444!important;color:#fff!important;border-color:#ef4444!important}
.product-row-actions-compact .product-share-btn{background:#f8fbff!important}
.image-size-invert{min-height:58px}
.image-size-invert small{max-width:130px}
@media(max-width:1180px){
  .product-row-actions-compact{grid-template-columns:1fr;min-width:120px;max-width:140px}
}

/* V266 - tabla productos: color solo hex y acciones alineadas */
.colorchip-only{
  display:inline-flex!important;
  width:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  justify-content:center!important;
  padding:0!important;
  gap:0!important;
}
.colorchip-only .swatch{
  width:28px!important;
  height:28px!important;
  margin:0!important;
}
.product-row-actions-final{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
  min-width:265px!important;
}
.product-row-actions-final .mini-action{
  min-height:42px!important;
  height:42px!important;
  padding:0 15px!important;
  border-radius:13px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:1000!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  border:1px solid #cfe0ff!important;
  background:#1d5ff4!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(29,95,244,.16)!important;
}
.product-row-actions-final .mini-icon-action{
  width:42px!important;
  min-width:42px!important;
  height:42px!important;
  padding:0!important;
  border-radius:13px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-decoration:none!important;
  border:1px solid #cfe0ff!important;
  background:#eef5ff!important;
  color:#0b5cff!important;
  box-shadow:0 8px 18px rgba(15,23,42,.05)!important;
  font-size:18px!important;
  line-height:1!important;
}
.product-row-actions-final .mini-icon-action svg{
  width:20px!important;
  height:20px!important;
}
.product-row-actions-final .share-green{
  background:#16a34a!important;
  color:#fff!important;
  border-color:#16a34a!important;
  box-shadow:0 10px 20px rgba(22,163,74,.18)!important;
}
.product-row-actions-final .mini-action.draft{
  background:#1d5ff4!important;
  color:#fff!important;
  border-color:#1d5ff4!important;
}
.product-row-actions-final .mini-action.danger{
  background:#ef4444!important;
  color:#fff!important;
  border-color:#ef4444!important;
}
@media(max-width:1250px){
  .product-row-actions-final{min-width:230px!important;gap:6px!important}
  .product-row-actions-final .mini-action{padding:0 11px!important;font-size:12px!important}
  .product-row-actions-final .mini-icon-action{width:38px!important;min-width:38px!important;height:38px!important}
}

/* V267 - exportar fotos filtradas */
#exportFilteredImagesZipBtn{
  background:#10b981!important;
  color:#fff!important;
  border-color:#10b981!important;
  box-shadow:0 12px 24px rgba(16,185,129,.18)!important;
}
#exportFilteredImagesZipBtn:disabled{
  opacity:.7;
  cursor:wait;
}

/* V271 - adjuntos removibles en modal WhatsApp */
.whatsapp-modal-card{
  max-width:980px!important;
}
.whatsapp-preview-grid{
  grid-template-columns:minmax(310px,420px) 1fr!important;
}
.whats-attachments{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin:10px 0 12px;
}
.whats-attachment-card{
  position:relative;
  min-height:168px;
  border:1px solid #dbe7ff;
  border-radius:20px;
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
  box-shadow:0 12px 30px rgba(15,23,42,.08);
  padding:14px;
  display:grid;
  align-content:end;
  gap:6px;
  overflow:hidden;
}
.whats-attachment-card img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:.28;
}
.whats-attachment-card b,
.whats-attachment-card small,
.whats-attachment-card .whats-pdf-icon{
  position:relative;
  z-index:2;
}
.whats-attachment-card b{
  color:#0f2248;
  font-size:15px;
  font-weight:1000;
}
.whats-attachment-card small{
  color:#475569;
  font-size:11px;
  font-weight:800;
  word-break:break-word;
}
.whats-pdf-icon{
  width:68px;
  height:78px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:#ef4444;
  color:#fff;
  font-weight:1000;
  font-size:18px;
  box-shadow:0 14px 28px rgba(239,68,68,.22);
}
.bank-icon{
  background:#16a34a;
}
.whats-remove-attachment{
  position:absolute;
  top:8px;
  right:8px;
  z-index:4;
  width:30px;
  height:30px;
  border-radius:999px;
  border:2px solid #fff;
  background:#dc2626;
  color:#fff;
  font-size:22px;
  font-weight:1000;
  line-height:24px;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(220,38,38,.34);
}
.whats-attachment-card.removed{
  opacity:.42;
  filter:grayscale(1);
  border-style:dashed;
}
.whats-attachment-card.removed::after{
  content:"NO SE ENVIARÁ";
  position:absolute;
  inset:auto 10px 10px 10px;
  z-index:5;
  border-radius:12px;
  padding:8px;
  text-align:center;
  background:#dc2626;
  color:#fff;
  font-weight:1000;
  font-size:12px;
}
@media(max-width:820px){
  .whatsapp-preview-grid{grid-template-columns:1fr!important}
  .whats-attachments{grid-template-columns:1fr}
}

/* V272 - WhatsApp Cloud API automático */
#whatsManualBtn{
  border:1px solid #cfe0ff!important;
  background:#eef5ff!important;
  color:#0b5cff!important;
  font-weight:1000!important;
}
#whatsSendBtn{
  box-shadow:0 14px 30px rgba(22,163,74,.22)!important;
}

/* V273 - POS: modal de selección siempre arriba del carrito temporal y sin cierre al agregar */
#posProductModal.open{
  z-index:3005 !important;
}
#posProductModal.over-order-add{
  z-index:3010 !important;
}
#orderAddProductModal.open{
  z-index:2000 !important;
}
#posProductModal .pos-modal{
  position:relative;
  z-index:1;
}

/* V274 - comprobantes múltiples ligados al pedido */
.proof-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-top:8px;
}
.action-field small.muted{
  display:block;
  margin-top:4px;
  font-size:11px;
}

/* V275/V282 - pedidos abiertos, badge pagado/no pagado y saldo pendiente */
.order-card summary{
  grid-template-columns:1.5fr auto auto auto auto auto;
}
.payment-badge,.balance-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:12px 16px;
  border-radius:999px;
  font-size:13px;
  line-height:1;
  font-weight:1000;
  letter-spacing:.02em;
  border:1px solid transparent;
  white-space:nowrap;
}
.payment-badge.pay-paid{
  background:#dcfce7!important;
  color:#166534!important;
  border-color:#86efac!important;
}
.payment-badge.pay-unpaid{
  background:#fee2e2!important;
  color:#991b1b!important;
  border-color:#fecaca!important;
}
.balance-badge.balance-clear{
  background:#dcfce7!important;
  color:#166534!important;
  border-color:#86efac!important;
}
.balance-badge.balance-due{
  background:#fee2e2!important;
  color:#991b1b!important;
  border-color:#fecaca!important;
}
@media(max-width:1100px){
  .order-card summary{grid-template-columns:1fr;}
  .payment-badge,.balance-badge{justify-self:start;}
}

/* V278: desglose de subcategorías con tallas y piezas */
.order-breakdown-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.order-breakdown-title-row > b{
  flex:1;
}
.order-breakdown-title-row > span{
  white-space:nowrap;
  font-size:22px;
  font-weight:900;
  color:#245cf0;
}
.order-breakdown-sizes{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.order-breakdown-size-pill{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 9px;
  border-radius:999px;
  background:#eef5ff;
  border:1px solid #dbe8ff;
  color:#173f8f;
  font-size:12px!important;
  font-weight:800;
  line-height:1.1;
}
.order-breakdown-size-pill b{
  font-size:12px!important;
  color:#0b2e6f;
}

/* V279 POS móvil: carrito temporal en pedidos + tags de estado/pago */
.phone-status-tag{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border-radius:999px;padding:8px 12px;font-size:11px;font-weight:1000;
  letter-spacing:.03em;text-transform:uppercase;border:1px solid transparent;white-space:nowrap;
}
.phone-status-tag.green{background:#e9fbf1;color:#07813f;border-color:#b9efcf;}
.phone-status-tag.red{background:#fff0f0;color:#d21d2b;border-color:#ffc7ca;}
.phone-status-tag.blue{background:#eaf3ff;color:#125ee8;border-color:#c9ddff;}
.phone-status-tag.purple{background:#f2edff;color:#6635d5;border-color:#dfd1ff;}
.phone-status-tag.yellow{background:#fff8dc;color:#9a6a00;border-color:#ffe59a;}
.phone-status-control-with-tag{grid-template-columns:auto minmax(0,1fr) auto;}
.phone-select-live-tag{display:flex;align-items:center;}
.phone-muted-line{margin:0;color:#64748b;font-size:12px;font-weight:900;line-height:1.35;}
.phone-order-add-modal{z-index:10020;}
.phone-order-add-panel{max-width:min(980px,96vw);padding:18px;display:grid;gap:14px;}
.phone-order-add-panel .phone-product-grid{max-height:48vh;overflow:auto;padding-right:4px;}
.phone-order-add-panel .phone-cart-list{max-height:34vh;overflow:auto;display:grid;gap:10px;}
.phone-order-add-panel .phone-block{border:1px solid #dbe7fb;border-radius:18px;background:#f8fbff;padding:12px;display:grid;gap:12px;}
.phone-order-add-panel .phone-soft-panel{background:#fff;border:1px solid #dbe7fb;border-radius:16px;padding:10px;}
.phone-order-add-panel .phone-scanner-row{display:grid;grid-template-columns:auto 90px minmax(0,1fr);gap:8px;align-items:center;}
.phone-order-add-panel .phone-check{display:flex;align-items:center;gap:6px;font-weight:1000;color:#08245b;}
.phone-order-add-panel input,.phone-order-add-panel select{border:1px solid #d7e5ff;border-radius:14px;padding:11px;font-weight:900;background:#fff;color:#08245b;}
@media(max-width:640px){
  .phone-status-control-with-tag{grid-template-columns:1fr;}
  .phone-select-live-tag .phone-status-tag{width:max-content;}
  .phone-order-add-panel{max-width:100%;margin:8px auto;padding:14px;}
  .phone-order-add-panel .phone-product-grid{grid-template-columns:1fr 1fr;max-height:none;}
  .phone-order-add-panel .phone-scanner-row{grid-template-columns:1fr;}
}

/* V281: cámaras QR ocultas hasta presionar Abrir cámara */
.camera-box.hidden,
.phone-camera-box.hidden{display:none!important}
.camera-box.small{min-height:170px;margin-top:10px}
.camera-box.small .qr-video,
.camera-box.small video{width:100%;max-height:260px;border-radius:14px;background:#0f172a;object-fit:cover;margin:0}
.phone-camera-box{margin-top:12px;border:1px dashed #bfd4ff;border-radius:18px;background:#fff;padding:10px;display:grid;gap:8px;place-items:center;position:relative;z-index:3;overflow:hidden}
.phone-camera-box video{width:100%;min-height:220px;max-height:360px;border-radius:14px;background:#0f172a;object-fit:cover}
.phone-camera-box p{margin:0;text-align:center}

/* V288 - Editor pedidos en proceso: cambiar hilo/EVA con selectores */
.section-edit-step.section-edit-step-selectors{
  grid-template-columns:42px minmax(260px,1.25fr) minmax(130px,.45fr) minmax(260px,1.25fr);
  align-items:end;
}
.section-edit-step-selectors .field.mini{
  margin:0;
}
.section-edit-step-selectors .field.mini label{
  display:block;
  margin:0 0 5px;
  color:#41516f;
  font-size:12px;
  font-weight:1000;
}
.section-edit-step-selectors select,
.section-edit-step-selectors input{
  width:100%;
  min-height:44px;
  border:1px solid #dbe7fb;
  border-radius:12px;
  background:#fff;
  padding:8px 10px;
  font-weight:900;
}
.section-edit-step-selectors .selector-current{
  display:flex;
  gap:6px;
  align-items:center;
  margin-top:6px;
  color:#64748b;
  font-weight:800;
  font-size:11px;
  min-height:18px;
}
.section-edit-step-selectors .selector-current .color-dot{
  width:16px;
  height:16px;
  border-radius:6px;
  border:1px solid rgba(15,23,42,.15);
  flex:0 0 auto;
}
@media(max-width:900px){
  .section-edit-step.section-edit-step-selectors{
    grid-template-columns:1fr;
  }
  .section-edit-step.section-edit-step-selectors > span{
    text-align:left;
  }
}


/* V289 - Corrección visual pasos hilo/EVA en editor de pedidos en proceso */
.section-edit-steps{
  display:grid !important;
  gap:12px !important;
  width:100% !important;
  overflow:visible !important;
}
.section-edit-step.section-edit-step-selectors{
  display:grid !important;
  grid-template-columns:54px minmax(360px,1.25fr) minmax(130px,.42fr) minmax(360px,1.25fr) !important;
  gap:14px !important;
  align-items:end !important;
  width:100% !important;
  box-sizing:border-box !important;
  border:1px solid #dbe7fb !important;
  background:linear-gradient(180deg,#ffffff,#f8fbff) !important;
  border-radius:18px !important;
  padding:14px !important;
}
.section-edit-step.section-edit-step-selectors > *{
  min-width:0 !important;
}
.section-edit-step.section-edit-step-selectors .section-step-num{
  width:38px !important;
  height:38px !important;
  border-radius:999px !important;
  display:grid !important;
  place-items:center !important;
  background:#eaf2ff !important;
  color:#2563eb !important;
  font-weight:1000 !important;
  text-align:center !important;
  align-self:center !important;
}
.section-edit-step-selectors .field.mini{
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  display:block !important;
}
.section-edit-step-selectors .field.mini label{
  display:block !important;
  width:100% !important;
  margin:0 0 7px !important;
  color:#41516f !important;
  font-size:13px !important;
  font-weight:1000 !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
}
.section-edit-step-selectors select,
.section-edit-step-selectors input{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  min-height:54px !important;
  height:54px !important;
  border:1px solid #dbe7fb !important;
  border-radius:16px !important;
  background:#fff !important;
  padding:0 12px !important;
  font-weight:900 !important;
  font-size:14px !important;
  color:#06133c !important;
  box-sizing:border-box !important;
}
.section-edit-step-selectors .stitches-picker-field input{
  text-align:center !important;
  font-size:18px !important;
  font-weight:1000 !important;
}
.section-edit-step-selectors .selector-current{
  display:flex !important;
  gap:7px !important;
  align-items:center !important;
  margin-top:7px !important;
  color:#64748b !important;
  font-weight:900 !important;
  font-size:12px !important;
  line-height:1.2 !important;
  min-height:18px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.section-edit-step-selectors .selector-current .color-dot{
  width:17px !important;
  height:17px !important;
  border-radius:6px !important;
  border:1px solid rgba(15,23,42,.16) !important;
  flex:0 0 auto !important;
}
@media(max-width:1180px){
  .section-edit-step.section-edit-step-selectors{
    grid-template-columns:44px minmax(240px,1fr) minmax(115px,.45fr) minmax(240px,1fr) !important;
  }
}
@media(max-width:820px){
  .section-edit-step.section-edit-step-selectors{
    grid-template-columns:1fr !important;
  }
  .section-edit-step.section-edit-step-selectors .section-step-num{
    justify-self:start !important;
  }
}

/* V293 - Ajuste fino: subir cuadro de puntadas en editor de pedidos en proceso */
.process-thread-rich-row .factory-stitches-field{
  align-self:end !important;
  transform:translateY(-6px) !important;
}
.process-thread-rich-row .factory-stitches-field label{
  margin-bottom:8px !important;
}
.process-thread-rich-row .factory-stitches-field input{
  height:64px !important;
  min-height:64px !important;
}
@media(max-width:720px){
  .process-thread-rich-row .factory-stitches-field{
    transform:none !important;
  }
}

/* V294 - Low bar móvil sobrepuesta y siempre visible */
body.phone-body .phone-bottom{
  position:fixed !important;
  left:50% !important;
  right:auto !important;
  bottom:calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  transform:translateX(-50%) translateZ(0) !important;
  width:min(500px, calc(100% - 20px)) !important;
  max-width:calc(100% - 20px) !important;
  z-index:10050 !important;
  border:1px solid rgba(205,222,252,.96) !important;
  border-radius:24px !important;
  overflow:hidden !important;
  pointer-events:auto !important;
  padding:8px 10px !important;
  min-height:66px !important;
  box-shadow:0 18px 45px rgba(7,26,80,.22) !important;
}
body.phone-body .phone-bottom a{
  min-height:50px !important;
}
body.phone-body .phone-main{
  padding-bottom:calc(118px + env(safe-area-inset-bottom, 0px)) !important;
}
@media (min-width:700px){
  body.phone-body .phone-bottom{
    width:min(720px, calc(100% - 24px)) !important;
  }
}
@media (max-width:520px){
  body.phone-body .phone-bottom{
    width:calc(100% - 18px) !important;
    max-width:calc(100% - 18px) !important;
    bottom:calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.phone-body .phone-main{
    padding-bottom:calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* V295 - Low bar móvil realmente fuera del scroll */
body.phone-body > .phone-bottom,
body.phone-body .phone-bottom[data-fixed-body-nav="1"]{
  position:fixed !important;
  left:50% !important;
  right:auto !important;
  bottom:calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  transform:translateX(-50%) !important;
  width:min(500px, calc(100% - 18px)) !important;
  max-width:calc(100% - 18px) !important;
  z-index:2147483000 !important;
  margin:0 !important;
  pointer-events:auto !important;
  isolation:isolate !important;
  will-change:transform !important;
}
body.phone-body .phone-shell{
  transform:none !important;
  contain:none !important;
}
body.phone-body{
  overflow-x:hidden !important;
  padding-bottom:calc(110px + env(safe-area-inset-bottom, 0px)) !important;
}
body.phone-body .phone-main{
  padding-bottom:calc(120px + env(safe-area-inset-bottom, 0px)) !important;
}

/* V296 - Tags cuadrados y desplegables bonitos en visualizador móvil de pedidos */
.phone-pretty-status-card{
  border:1px solid #dbe8ff!important;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
  box-shadow:0 10px 28px rgba(15,47,100,.06)!important;
}
.phone-pretty-status-card h3{
  margin-bottom:10px!important;
  color:#061a4d!important;
  font-size:15px!important;
  letter-spacing:.01em!important;
}
.phone-pretty-status-control{
  grid-template-columns:minmax(0,1fr) auto auto!important;
  gap:10px!important;
  align-items:center!important;
}
.phone-pretty-select-wrap{
  position:relative!important;
  min-width:0!important;
}
.phone-pretty-select-wrap::after{
  content:'⌄';
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  color:#2563eb;
  font-size:16px;
  font-weight:1000;
  pointer-events:none;
}
.phone-pretty-status-control select{
  width:100%!important;
  min-height:46px!important;
  border:1px solid #bfd4ff!important;
  border-radius:16px!important;
  padding:12px 40px 12px 14px!important;
  background:#fff!important;
  color:#08245b!important;
  font-size:13px!important;
  font-weight:1000!important;
  letter-spacing:.02em!important;
  outline:none!important;
  appearance:none!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),0 7px 18px rgba(47,109,246,.08)!important;
}
.phone-pretty-status-control select:focus{
  border-color:#2f6df6!important;
  box-shadow:0 0 0 4px rgba(47,109,246,.13),0 10px 22px rgba(47,109,246,.10)!important;
}
.phone-select-tags-right{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:7px!important;
  min-width:max-content!important;
}
.phone-payment-tags-right{
  flex-wrap:wrap!important;
  max-width:230px!important;
}
.phone-status-tag.phone-status-square{
  border-radius:10px!important;
  min-height:34px!important;
  padding:8px 11px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7)!important;
  font-size:10.5px!important;
  line-height:1!important;
}
.phone-status-tag.phone-status-square.st-pendiente,
.phone-status-tag.phone-status-square.st-confirmado,
.phone-status-tag.phone-status-square.st-procesando,
.phone-status-tag.phone-status-square.st-en_camino,
.phone-status-tag.phone-status-square.st-entregado,
.phone-status-tag.phone-status-square.st-devuelto,
.phone-status-tag.phone-status-square.st-cancelado,
.phone-status-tag.phone-status-square.st-sucursal{
  border:1px solid currentColor!important;
}
.phone-status-tag.phone-status-square.pay-paid{
  background:#dcfce7!important;
  color:#15803d!important;
  border:1px solid #86efac!important;
}
.phone-status-tag.phone-status-square.pay-unpaid{
  background:#fee2e2!important;
  color:#b91c1c!important;
  border:1px solid #fecaca!important;
}
.phone-status-tag.phone-status-square.balance-clear{
  background:#dcfce7!important;
  color:#15803d!important;
  border:1px solid #86efac!important;
}
.phone-status-tag.phone-status-square.balance-due{
  background:#fff1f2!important;
  color:#be123c!important;
  border:1px solid #fecdd3!important;
}
.phone-pretty-status-control .btn{
  min-height:44px!important;
  border-radius:14px!important;
  padding-inline:14px!important;
  box-shadow:0 8px 18px rgba(47,109,246,.12)!important;
}
@media(max-width:640px){
  .phone-pretty-status-control,
  .phone-payment-pretty-control{
    grid-template-columns:1fr!important;
  }
  .phone-select-tags-right{
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
  }
  .phone-payment-tags-right{
    max-width:100%!important;
  }
  .phone-pretty-status-control .btn{
    width:100%!important;
  }
}

/* V297 - Tags visibles en el predesplegable del visualizador móvil de pedidos */
.phone-row.phone-order-card{
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  border:1px solid #dbe8ff!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  border-radius:18px!important;
  padding:13px!important;
  box-shadow:0 8px 22px rgba(15,47,100,.05)!important;
}
.phone-order-predisplay{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  min-width:0!important;
}
.phone-order-predisplay-main{
  min-width:0!important;
  display:grid!important;
  gap:4px!important;
}
.phone-order-predisplay-main b{
  display:block!important;
  color:#061a4d!important;
  font-size:14px!important;
  line-height:1.16!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.phone-order-predisplay-main small{
  display:block!important;
  color:#64748b!important;
  font-weight:900!important;
  line-height:1.2!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.phone-order-predisplay-tags{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  max-width:min(52vw,320px)!important;
}
.phone-order-predisplay-tags .phone-status-tag.phone-status-square{
  border-radius:9px!important;
  min-height:30px!important;
  padding:7px 9px!important;
  font-size:9.5px!important;
  letter-spacing:.02em!important;
  white-space:nowrap!important;
}
.phone-order-caret{
  width:30px!important;
  height:30px!important;
  border-radius:10px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eef4ff!important;
  color:#2353d1!important;
  border:1px solid #dbe7ff!important;
  font-weight:1000!important;
}
.phone-order-card.open .phone-order-caret{transform:rotate(180deg);}

/* V297 - desplegables más limpios dentro del pedido */
.phone-pretty-status-card{
  border-radius:20px!important;
  padding:14px!important;
}
.phone-pretty-status-control{
  background:#f8fbff!important;
  border:1px solid #dbe8ff!important;
  border-radius:18px!important;
  padding:10px!important;
}
.phone-pretty-select-wrap select,
.phone-pretty-status-control select{
  border-radius:14px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%)!important;
}
@media(max-width:640px){
  .phone-order-predisplay{
    grid-template-columns:1fr!important;
    align-items:start!important;
  }
  .phone-order-predisplay-tags{
    justify-content:flex-start!important;
    max-width:100%!important;
  }
  .phone-order-predisplay-tags .phone-status-tag.phone-status-square{
    font-size:9px!important;
    padding:7px 8px!important;
  }
}


/* V298 - desglose por subcategorías y tallas en pedidos móvil */
.phone-order-subcategory-card{
  gap:10px;
}
.phone-order-breakdown-meta{
  margin-top:-4px;
  margin-bottom:2px;
}
.phone-order-subcategory-card .order-breakdown-grid{
  grid-template-columns:1fr;
  gap:10px;
}
.phone-order-subcategory-card .order-breakdown-chip{
  min-height:auto;
}
.phone-order-subcategory-card .order-breakdown-title-row > span{
  white-space:nowrap;
}
@media(min-width:520px){
  .phone-order-subcategory-card .order-breakdown-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}



/* V299 - sucursal en creador móvil */
.phone-branch-note{border-color:#99f6e4;background:linear-gradient(180deg,#ecfdf5,#f0fdfa)}
.phone-branch-zero-note{border-color:#fde68a;background:linear-gradient(180deg,#fffbeb,#fff7ed)}
.phone-branch-zero-note b{color:#92400e}


/* V301 - selectores visuales móviles con miniaturas */
.phone-visual-select{position:relative;margin-top:6px}
.phone-visual-select-btn,.phone-visual-option{
  width:100%;border:1px solid rgba(15,23,42,.10);background:#fff;border-radius:18px;
  padding:12px 14px;display:grid;grid-template-columns:44px minmax(0,1fr) 16px;gap:12px;align-items:center;
  box-shadow:0 10px 24px rgba(15,23,42,.06);text-align:left;
}
.phone-visual-select-btn > span,.phone-visual-option > span{display:flex;flex-direction:column;min-width:0}
.phone-visual-select-btn b,.phone-visual-option b{font-size:14px;line-height:1.15;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phone-visual-select-btn small,.phone-visual-option small{font-size:12px;line-height:1.25;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phone-visual-select-btn em{font-style:normal;color:#64748b;font-size:14px}
.phone-visual-select-menu{position:absolute;left:0;right:0;top:calc(100% + 8px);background:#f8fafc;border:1px solid rgba(15,23,42,.08);border-radius:20px;padding:8px;display:none;z-index:60;box-shadow:0 18px 40px rgba(15,23,42,.16);max-height:300px;overflow:auto}
.phone-visual-select.open .phone-visual-select-menu{display:grid;gap:8px}
.phone-visual-option{grid-template-columns:44px minmax(0,1fr);padding:10px 12px}
.phone-visual-option:hover,.phone-visual-select-btn:hover{border-color:rgba(59,130,246,.28);box-shadow:0 14px 30px rgba(59,130,246,.10)}
.phone-visual-thumb{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;overflow:hidden;position:relative;background:linear-gradient(135deg,#eff6ff,#dbeafe);border:1px solid rgba(59,130,246,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
.phone-visual-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.phone-visual-thumb b{font-size:13px;color:#1d4ed8;position:relative;z-index:1}
.phone-visual-thumb em{position:absolute;right:5px;bottom:3px;font-style:normal;font-size:11px;opacity:.9}
.phone-visual-thumb.icon-branch{background:linear-gradient(135deg,#fee2e2,#fecaca);border-color:rgba(239,68,68,.12)}
.phone-visual-thumb.icon-branch b{color:#b91c1c}
.phone-visual-thumb.icon-driver{background:linear-gradient(135deg,#dcfce7,#bbf7d0);border-color:rgba(34,197,94,.12)}
.phone-visual-thumb.icon-driver b{color:#15803d}
.phone-visual-thumb.icon-shipping{background:linear-gradient(135deg,#fef3c7,#fde68a);border-color:rgba(245,158,11,.15)}
.phone-visual-thumb.icon-shipping b{color:#b45309}
.phone-visual-thumb.icon-payment{background:linear-gradient(135deg,#ede9fe,#ddd6fe);border-color:rgba(139,92,246,.15)}
.phone-visual-thumb.icon-payment b{color:#6d28d9}
.phone-visual-thumb.icon-customer{background:linear-gradient(135deg,#ecfeff,#cffafe);border-color:rgba(6,182,212,.15)}
.phone-visual-thumb.icon-customer b{color:#0f766e}
.phone-suggest-rich{display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;align-items:center}
.phone-suggest-rich > span:last-child{display:flex;flex-direction:column;min-width:0;text-align:left}
.phone-suggest-rich b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phone-suggest-rich small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phone-card .phone-block label > .phone-visual-select{margin-top:8px}
.phone-filter-grid select{border-radius:16px;box-shadow:0 8px 20px rgba(15,23,42,.05)}



/* V302 - ajustes exactos de miniaturas en selectores móviles */
.phone-visual-thumb.emoji-only{display:flex;align-items:center;justify-content:center}
.phone-visual-thumb.emoji-only strong{font-size:23px;line-height:1}
.phone-visual-thumb.thumb-payment,
.phone-visual-thumb.thumb-shipping{background:#fff;border-color:rgba(15,23,42,.08)}
.phone-visual-thumb.thumb-payment img,
.phone-visual-thumb.thumb-shipping img{object-fit:contain;background:#fff;padding:4px}
.phone-visual-thumb.icon-driver{background:linear-gradient(135deg,#dcfce7,#bbf7d0);border-color:rgba(34,197,94,.12)}
.phone-visual-thumb.icon-driver strong{filter:drop-shadow(0 1px 0 rgba(255,255,255,.45))}
.phone-visual-thumb.icon-branch{background:linear-gradient(135deg,#fee2e2,#fecaca);border-color:rgba(239,68,68,.12)}
.phone-visual-thumb.icon-branch strong{filter:drop-shadow(0 1px 0 rgba(255,255,255,.45))}



/* V303 - tallas y mayoreo en precard de productos móvil */
.phone-size-pill-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.phone-size-pill{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#e5e7eb;color:#334155;font-size:11px;line-height:1.1;border:1px solid rgba(15,23,42,.06)}
.phone-size-pill b{font-size:11px;font-weight:700;color:inherit}
.phone-size-pill em{font-style:normal;font-size:11px;color:inherit}
.phone-size-pill.zero{background:#9ca3af;color:#f8fafc;border-color:rgba(15,23,42,.18)}
.phone-size-pill.zero b,.phone-size-pill.zero em{text-decoration:line-through;text-decoration-thickness:1.6px}
.phone-product-card-prices{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:4px}
.phone-wholesale-chip{display:inline-flex;align-items:center;justify-content:center;padding:5px 10px;border-radius:999px;background:rgba(250,204,21,.18);border:1px solid rgba(234,179,8,.28);color:#854d0e;font-size:12px;font-weight:700;margin-top:6px}
.phone-wholesale-chip.inline{margin-top:8px}
.phone-readonly-product-meta{display:flex;flex-direction:column;gap:6px;margin:8px 0 12px}
.phone-product-var-row small{white-space:normal}



/* V304 - mostrar 4 productos y scroll interno en centro */
#productsBox.phone-product-grid,
.create-product-grid,
.phone-order-add-panel .phone-product-grid{
  max-height:560px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-right:6px !important;
  align-content:start;
  scrollbar-gutter:stable;
  overscroll-behavior:contain;
}
#productsBox.phone-product-grid::-webkit-scrollbar,
.create-product-grid::-webkit-scrollbar,
.phone-order-add-panel .phone-product-grid::-webkit-scrollbar{width:8px}
#productsBox.phone-product-grid::-webkit-scrollbar-thumb,
.create-product-grid::-webkit-scrollbar-thumb,
.phone-order-add-panel .phone-product-grid::-webkit-scrollbar-thumb{background:#bfd4ff;border-radius:999px}
#productsBox.phone-product-grid::-webkit-scrollbar-track,
.create-product-grid::-webkit-scrollbar-track,
.phone-order-add-panel .phone-product-grid::-webkit-scrollbar-track{background:transparent}
@media(max-width:640px){
  #productsBox.phone-product-grid,
  .create-product-grid,
  .phone-order-add-panel .phone-product-grid{
    max-height:560px !important;
  }
}



/* V309 - filtros y resumen de pedidos POS */
.orders-filter-panel{
  display:grid;
  gap:14px;
  margin:0 0 18px;
}
.orders-filter-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(180px,1fr));
  gap:12px;
}
.orders-filter-grid label{
  display:grid;
  gap:6px;
  font-weight:900;
  color:#0b1d4d;
}
.orders-filter-grid input,
.orders-filter-grid select{
  width:100%;
  border:1px solid #d7e5ff;
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
  font-weight:800;
}
.orders-period-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.orders-period-kpis{
  margin-bottom:12px;
}
.period-breakdown{
  border:1px solid #dbe7fb;
  border-radius:20px;
  background:#f8fbff;
  padding:14px;
}
.period-breakdown h3{
  margin:0 0 10px;
}
.period-cat-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.period-cat-card{
  border:1px solid #dbe7fb;
  background:#fff;
  border-radius:16px;
  padding:12px;
}
.period-cat-card>div{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
.period-cat-card strong{
  color:#0b5cff;
  white-space:nowrap;
}
.period-cat-card p{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:10px 0 0;
}
.period-cat-card span{
  display:inline-flex;
  border-radius:999px;
  background:#e5e7eb;
  color:#334155;
  padding:5px 8px;
  font-size:12px;
  font-weight:900;
}
.order-admin-card small{
  display:block;
  color:#64748b;
  margin-top:4px;
}
.small-badge.pay-paid{
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}
.small-badge.pay-unpaid{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}
@media(max-width:900px){
  .orders-filter-grid{grid-template-columns:1fr 1fr;}
  .period-cat-grid{grid-template-columns:1fr;}
}
@media(max-width:620px){
  .orders-filter-grid{grid-template-columns:1fr;}
}


/* V310 - filtros reales en POS > Pedidos */
.orders-dashboard-filters{display:grid;gap:14px;}
.orders-filter-expanded{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end;}
.orders-period-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
.orders-summary-card{margin-top:14px;}
.orders-summary-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:14px;}
.orders-summary-kpis>div{background:#f5f9ff;border:1px solid #dbe7fb;border-radius:18px;padding:14px;box-shadow:0 10px 24px rgba(8,31,86,.05);}
.orders-summary-kpis small{display:block;color:#64748b;font-weight:900;margin-bottom:6px;}
.orders-summary-kpis b{font-size:22px;color:#071a40;}
.orders-breakdown-box{background:#f8fbff;border:1px solid #dbe7fb;border-radius:20px;padding:14px;}
.orders-breakdown-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px;}
.orders-breakdown-head span{background:#eaf2ff;color:#0b5cff;border-radius:999px;padding:7px 11px;font-weight:1000;white-space:nowrap;}
.orders-breakdown-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;}
.orders-breakdown-item{background:#fff;border:1px solid #dbe7fb;border-radius:16px;padding:12px;}
.orders-breakdown-item>div{display:flex;justify-content:space-between;gap:10px;align-items:center;}
.orders-breakdown-item>div span{font-weight:1000;color:#0b5cff;white-space:nowrap;}
.orders-breakdown-item p{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0;}
.orders-breakdown-item em{font-style:normal;background:#e5e7eb;border:1px solid rgba(15,23,42,.08);color:#334155;border-radius:999px;padding:5px 8px;font-size:12px;font-weight:900;}


/* V311 - botón de estadísticas y permiso ventas/estadísticas */
.orders-summary-card.hidden{display:none!important;}
.orders-period-actions #orderToggleStatsBtn{box-shadow:0 12px 24px rgba(17,185,129,.16);}
.sales-statistics-locked{display:none!important;}



/* V312 - recuerdame login y logout home */
.remember-row{display:flex!important;align-items:center;gap:9px;margin:-2px 0 2px;font-weight:900;color:#24426f;cursor:pointer}
.remember-row input{width:18px!important;height:18px!important;accent-color:#2563eb;cursor:pointer}
.remember-row span{font-size:14px}


/* V313 - Home estadísticas generales */
.home-general-stats-card{margin-top:22px}.hgs-hero{align-items:flex-start}.hgs-actions{display:flex;gap:10px;flex-wrap:wrap}.hgs-filters{display:grid;grid-template-columns:repeat(2,minmax(160px,1fr)) minmax(240px,1.4fr) auto auto;gap:12px;align-items:end;background:#f8fbff;border:1px solid #dbe7fb;border-radius:22px;padding:14px;margin-bottom:16px}.hgs-filters label{font-size:12px;font-weight:1000;color:#31456d}.hgs-filters input[type=date]{display:block;width:100%;margin-top:6px;border:1px solid #d7e5ff;border-radius:14px;padding:11px 12px;font-weight:900;background:#fff}.hgs-check{display:flex!important;gap:8px;align-items:center;background:#fff;border:1px solid #d7e5ff;border-radius:14px;padding:11px 12px;white-space:nowrap}.hgs-check input{width:auto}.hgs-periods{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.hgs-periods button{border:1px solid #cfe0ff;background:#fff;border-radius:14px;padding:11px 8px;font-weight:1000;color:#0b5cff;cursor:pointer}.hgs-periods button:hover{background:#eef5ff}.hgs-loading,.hgs-error,.hgs-empty{background:#f8fbff;border:1px dashed #cfe0ff;border-radius:18px;padding:18px;color:#64748b;font-weight:900}.hgs-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}.hgs-kpi{background:#fff;border:1px solid #dbe7fb;border-radius:20px;padding:14px;box-shadow:0 10px 28px rgba(7,26,107,.07)}.hgs-kpi small{display:block;color:#64748b;font-weight:900}.hgs-kpi b{display:block;color:#07133a;font-size:24px;margin-top:4px;letter-spacing:-.03em}.hgs-kpi span{display:block;color:#64748b;font-size:12px;font-weight:800;margin-top:2px}.hgs-kpi.money{background:#ecfdf5}.hgs-kpi.debt{background:#fff7ed}.hgs-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.hgs-panel{background:#fff;border:1px solid #dbe7fb;border-radius:24px;padding:16px;box-shadow:0 14px 38px rgba(7,26,107,.08)}.hgs-panel.wide{grid-column:1/-1}.hgs-panel-head h4{margin:0;color:#07133a;font-size:19px}.hgs-panel-head p{margin:4px 0 12px;color:#64748b;font-weight:800;line-height:1.35}.hgs-bar-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid #edf3ff}.hgs-bar-row:last-child{border-bottom:0}.hgs-bar-row div{min-width:0}.hgs-bar-row b{display:block;color:#122554;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hgs-bar-row small{display:block;color:#64748b;font-size:11px;margin-top:1px}.hgs-bar-row span{font-weight:1000;color:#0b1d4d}.hgs-bar-row i{grid-column:1/-1;height:8px;background:#eef4ff;border-radius:999px;overflow:hidden}.hgs-bar-row i em{display:block;height:100%;background:linear-gradient(90deg,#0b5cff,#60a5fa);border-radius:999px}.hgs-dual-row{display:grid;grid-template-columns:220px minmax(0,1fr);gap:12px;align-items:start;padding:12px 0;border-bottom:1px solid #edf3ff}.hgs-dual-row>b{color:#122554}.hgs-dual-lines{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px 10px}.hgs-dual-lines span{font-size:12px;color:#64748b;font-weight:900}.hgs-dual-lines i{height:9px;background:#eef4ff;border-radius:999px;overflow:hidden}.hgs-dual-lines i em{display:block;height:100%;background:#0b5cff;border-radius:999px}.hgs-dual-lines i.stock em{background:#22c55e}.hgs-client{width:100%;border:1px solid #dbe7fb;background:#f8fbff;border-radius:18px;padding:12px;margin-bottom:8px;display:grid;grid-template-columns:44px minmax(0,1fr);text-align:left;gap:10px;cursor:pointer}.hgs-client span{background:#0b5cff;color:#fff;border-radius:13px;display:grid;place-items:center;font-weight:1000}.hgs-client b{color:#07133a}.hgs-client small{color:#64748b;font-weight:850}.hgs-client-orders{margin-top:12px;border-top:1px solid #dbe7fb;padding-top:12px}.hgs-client-orders h4{margin:0 0 10px}.hgs-client-orders button{width:100%;border:1px solid #dbe7fb;background:#fff;border-radius:14px;padding:10px 12px;margin-bottom:8px;text-align:left;cursor:pointer}.hgs-client-orders b{display:block;color:#0b5cff}.hgs-client-orders small{display:block;color:#64748b;font-weight:850;margin-top:2px}@media(max-width:980px){.hgs-filters{grid-template-columns:1fr}.hgs-periods{grid-template-columns:repeat(2,1fr)}.hgs-kpis,.hgs-grid{grid-template-columns:1fr}.hgs-dual-row{grid-template-columns:1fr}.hgs-actions{width:100%}.hgs-actions .btn{flex:1}}

/* V315 - gráficas por puntos en estadísticas generales */
.hgs-panel.point-panel{background:linear-gradient(180deg,#ffffff,#f8fbff)}
.hgs-point-chart{width:100%;overflow:hidden;border:1px solid #e2ecff;border-radius:20px;background:#fff;padding:12px;box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}
.hgs-point-chart svg{width:100%;height:280px;display:block}
.hgs-point-grid{stroke:#dbe7fb;stroke-width:1}
.hgs-point-area{fill:url(#hgsLineFill)}
.hgs-point-line{fill:none;stroke:#0b5cff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 6px 8px rgba(11,92,255,.18))}
.hgs-point-dot{fill:#fff;stroke:#0b5cff;stroke-width:4;cursor:pointer;transition:transform .15s ease,fill .15s ease}
.hgs-point-dot-wrap:hover .hgs-point-dot,.hgs-point-dot-wrap:focus .hgs-point-dot{fill:#dbeafe;transform:scale(1.3);transform-origin:center}
.hgs-point-label,.hgs-point-y{fill:#64748b;font-size:12px;font-weight:900}
.hgs-point-context{margin-top:8px;background:#f8fbff;border:1px solid #e2ecff;border-radius:14px;padding:10px 12px;color:#475569;font-size:12px;font-weight:850;line-height:1.45}
@media(max-width:680px){.hgs-point-chart svg{height:230px}.hgs-point-label{font-size:10px}}

/* V316 - gráficas generales estilo POS/Fábrica con desglose por punto */
.hgs-panel.point-panel{overflow:hidden;background:#fff;border-radius:26px}
.hgs-point-chart.v316{padding:18px 18px 14px;border-radius:22px;overflow:visible;background:#fff;border:1px solid #dbe7fb;box-shadow:inset 0 1px 0 rgba(255,255,255,.85)}
.hgs-point-chart.v316 svg{width:100%;height:330px;display:block;overflow:visible}
.hgs-point-chart.v316 .hgs-point-grid{stroke:#dbe2ee;stroke-width:1.15}
.hgs-point-chart.v316 .hgs-point-area{opacity:.95}
.hgs-point-chart.v316 .hgs-point-line{fill:none;stroke:#2f6df6;stroke-width:4.2;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 5px 7px rgba(47,109,246,.20))}
.hgs-point-chart.v316 .hgs-point-dot{fill:#2f6df6;stroke:#fff;stroke-width:4;cursor:pointer;transition:r .15s ease,filter .15s ease,fill .15s ease}
.hgs-point-chart.v316 .hgs-point-dot-wrap{cursor:pointer;outline:none}
.hgs-point-chart.v316 .hgs-point-dot-wrap:hover .hgs-point-dot,
.hgs-point-chart.v316 .hgs-point-dot-wrap:focus .hgs-point-dot{r:8;fill:#0b5cff;filter:drop-shadow(0 4px 10px rgba(11,92,255,.45))}
.hgs-point-chart.v316 .hgs-point-label{fill:#52627c;font-size:13px;font-weight:1000}
.hgs-point-chart.v316 .hgs-point-y{fill:#52627c;font-size:12px;font-weight:1000}
.hgs-point-chart.v316 .hgs-point-value{fill:#0b5cff;stroke:#fff;stroke-width:3px;paint-order:stroke;font-size:13px;font-weight:1000;pointer-events:none}
.hgs-point-chart.v316 .hgs-point-context{margin:10px 0 0;background:#f8fbff;border:1px solid #e2ecff;border-radius:16px;padding:11px 13px;color:#475569;font-size:12px;font-weight:850;line-height:1.45}
.hgs-point-chart.v316 .hgs-point-context b{color:#08245b}.hgs-point-chart.v316 .hgs-point-context span{display:block;color:#0b5cff;margin-top:3px;font-weight:1000}
.hgs-point-detail{margin-top:12px}.hgs-point-detail-card{border:1px solid #cfe0ff;background:linear-gradient(180deg,#ffffff,#f8fbff);border-radius:20px;padding:14px;box-shadow:0 12px 30px rgba(7,26,107,.08)}
.hgs-point-detail-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;border-bottom:1px solid #e7efff;padding-bottom:10px;margin-bottom:10px}.hgs-point-detail-head h5{font-size:18px;margin:0;color:#07133a}.hgs-point-detail-head p{margin:3px 0 0;color:#64748b;font-weight:850}.hgs-point-detail-head button{border:0;background:#eef5ff;color:#0b5cff;border-radius:12px;width:34px;height:34px;font-size:21px;font-weight:1000;cursor:pointer}
.hgs-detail-row{width:100%;display:block;text-align:left;border:1px solid #e2ecff;background:#fff;border-radius:14px;padding:10px 12px;margin:8px 0;color:#07133a}.hgs-detail-row.clickable{cursor:pointer}.hgs-detail-row.clickable:hover{border-color:#0b5cff;box-shadow:0 8px 20px rgba(11,92,255,.10)}.hgs-detail-row b{display:block;color:#0b5cff;font-size:14px}.hgs-detail-row small{display:block;color:#64748b;font-weight:850;margin-top:3px;line-height:1.35}.hgs-detail-more{display:block;margin-top:8px;color:#64748b;font-weight:900}
@media(max-width:680px){.hgs-point-chart.v316 svg{height:260px}.hgs-point-chart.v316 .hgs-point-value{font-size:10px}.hgs-point-chart.v316 .hgs-point-y,.hgs-point-chart.v316 .hgs-point-label{font-size:10px}.hgs-point-detail-head{align-items:center}.hgs-point-detail-head h5{font-size:15px}}

/* V319 - estado incidencia y Envia.com */
.st-incidencia,.status-incidencia{background:#fee2e2!important;color:#991b1b!important;border-color:#ef4444!important}
.status-dashboard .st-incidencia{background:#dc2626!important;color:#fff!important}
.st-sucursal,.status-sucursal{background:#ccfbf1!important;color:#0f766e!important;border-color:#5eead4!important}
.status-dashboard .st-sucursal{background:#0f766e!important;color:#fff!important}
.envia-order-card{margin:0 20px 18px;border:1px solid #dbeafe;background:#f8fbff;border-radius:18px;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.envia-order-card small{display:block;color:#64748b;margin-top:3px}.envia-modal-card{max-width:820px}.envia-result pre{white-space:pre-wrap;max-height:280px;overflow:auto;background:#0f172a;color:#e5e7eb;border-radius:14px;padding:12px}

/* V320 - Envia guía: modal siempre encima y sin depender del scroll */
#enviaGuideModal.pos-modal,
.pos-modal#enviaGuideModal{
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 24px !important;
  overflow-y: auto !important;
  background: rgba(15, 23, 42, .46) !important;
  backdrop-filter: blur(6px);
}
#enviaGuideModal .envia-modal-card{
  position: relative !important;
  z-index: 1000000 !important;
  width: min(920px, 96vw) !important;
  margin: 32px auto !important;
  max-height: calc(100vh - 64px) !important;
  overflow-y: auto !important;
  border-radius: 24px !important;
}
#enviaGuideModal .modal-close{
  position: sticky !important;
  top: 0 !important;
  float: right;
  z-index: 3;
}


/* V321 - Envia: modal centrado, fondo blanco y blur real */
body.envia-modal-open{
  overflow:hidden !important;
}
#enviaGuideModal.pos-modal,
.pos-modal#enviaGuideModal{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  z-index:2147483000 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:28px !important;
  margin:0 !important;
  overflow:auto !important;
  background:rgba(2,6,23,.62) !important;
  backdrop-filter:blur(10px) saturate(110%) !important;
  -webkit-backdrop-filter:blur(10px) saturate(110%) !important;
}
#enviaGuideModal::before{
  content:"";
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.22);
  pointer-events:none;
}
#enviaGuideModal .envia-modal-card,
#enviaGuideModal .pos-modal-card.envia-modal-card{
  position:relative !important;
  z-index:2147483001 !important;
  width:min(940px, calc(100vw - 32px)) !important;
  max-height:calc(100vh - 56px) !important;
  overflow:auto !important;
  margin:auto !important;
  padding:26px !important;
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid rgba(226,232,240,.95) !important;
  border-radius:28px !important;
  box-shadow:0 34px 95px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.18) inset !important;
  transform:none !important;
  opacity:1 !important;
}
#enviaGuideModal .envia-modal-card h2{
  margin:0 48px 6px 0 !important;
  color:#07183a !important;
  font-size:26px !important;
  line-height:1.1 !important;
}
#enviaGuideModal .envia-modal-card .muted{
  color:#64748b !important;
}
#enviaGuideModal .detail-box{
  background:linear-gradient(180deg,#f8fbff,#ffffff) !important;
  border:1px solid #dbeafe !important;
  border-radius:20px !important;
  padding:16px 18px !important;
  margin:16px 0 !important;
}
#enviaGuideModal .detail-box h3{
  margin:0 0 10px !important;
  color:#07183a !important;
}
#enviaGuideModal .detail-box p{
  margin:6px 0 !important;
  color:#475569 !important;
  font-weight:800 !important;
}
#enviaGuideModal .clean-form{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(110px,1fr)) !important;
  gap:12px !important;
  background:#f8fafc !important;
  border:1px solid #e2e8f0 !important;
  border-radius:22px !important;
  padding:14px !important;
  margin:14px 0 !important;
}
#enviaGuideModal .clean-form .field{
  display:flex !important;
  flex-direction:column !important;
  gap:7px !important;
  min-width:0 !important;
}
#enviaGuideModal .clean-form label{
  font-size:12px !important;
  font-weight:1000 !important;
  color:#475569 !important;
  text-transform:uppercase !important;
  letter-spacing:.04em !important;
}
#enviaGuideModal select,
#enviaGuideModal input{
  width:100% !important;
  height:46px !important;
  border:1px solid #cbd5e1 !important;
  border-radius:14px !important;
  background:#fff !important;
  color:#0f172a !important;
  padding:0 12px !important;
  font-weight:900 !important;
  outline:none !important;
}
#enviaGuideModal select:focus,
#enviaGuideModal input:focus{
  border-color:#2f6df6 !important;
  box-shadow:0 0 0 4px rgba(47,109,246,.12) !important;
}
#enviaGuideModal .order-buttons-row{
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  margin:16px 0 !important;
}
#enviaGuideModal .envia-result{
  background:#f8fbff !important;
  border:1px solid #dbeafe !important;
  border-radius:18px !important;
  padding:14px 16px !important;
  color:#475569 !important;
  font-weight:850 !important;
}
#enviaGuideModal .modal-close{
  position:absolute !important;
  top:16px !important;
  right:16px !important;
  width:42px !important;
  height:42px !important;
  border:0 !important;
  border-radius:14px !important;
  background:#eff6ff !important;
  color:#0b5cff !important;
  font-size:26px !important;
  font-weight:1000 !important;
  line-height:1 !important;
  display:grid !important;
  place-items:center !important;
  cursor:pointer !important;
  float:none !important;
}
#enviaGuideModal .modal-close:hover{
  background:#dbeafe !important;
}
@media(max-width:760px){
  #enviaGuideModal.pos-modal,
  .pos-modal#enviaGuideModal{
    align-items:flex-start !important;
    padding:14px !important;
  }
  #enviaGuideModal .envia-modal-card,
  #enviaGuideModal .pos-modal-card.envia-modal-card{
    width:calc(100vw - 20px) !important;
    max-height:calc(100vh - 28px) !important;
    padding:20px !important;
    border-radius:22px !important;
  }
  #enviaGuideModal .clean-form{
    grid-template-columns:1fr !important;
  }
  #enviaGuideModal .order-buttons-row{
    flex-direction:column !important;
  }
  #enviaGuideModal .order-buttons-row .btn{
    width:100% !important;
  }
}

/* V322 - Cajas POS + modal Envia refinado */
.boxes-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.shipping-box-grid{display:grid;gap:12px}
.shipping-box-card{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:#fff;box-shadow:0 12px 28px rgba(15,23,42,.06)}
.shipping-box-card.inactive{opacity:.65;background:#f8fafc}
.shipping-box-icon{width:54px;height:54px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#eff6ff,#dbeafe);font-size:28px;border:1px solid rgba(59,130,246,.14)}
.shipping-box-info{min-width:0}.shipping-box-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px}.shipping-box-head b{font-size:15px}.shipping-box-info small{display:block;color:#64748b}.shipping-box-measures{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.shipping-box-measures span{font-size:12px;font-weight:800;color:#334155;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:5px 9px}.shipping-box-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.empty-state{padding:24px;border:1px dashed #cbd5e1;border-radius:18px;background:#f8fafc;text-align:center;color:#64748b}.empty-state b{display:block;color:#0f172a;margin-bottom:4px}.empty-state.error{border-color:#fecaca;background:#fff1f2}.shipping-box-modal-overlay.envia-guide-overlay{z-index:999999}.shipping-box-modal-card{max-width:780px}.shipping-box-form{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.shipping-box-form .wide{grid-column:1/-1}.shipping-box-form textarea{min-height:84px;resize:vertical}.envia-guide-overlay{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;background:rgba(15,23,42,.48)!important;backdrop-filter:blur(10px)!important;z-index:999998!important;padding:24px!important}.envia-guide-card{width:min(980px,96vw)!important;max-height:92vh!important;overflow:auto!important;background:#fff!important;border-radius:24px!important;border:1px solid rgba(15,23,42,.10)!important;box-shadow:0 28px 90px rgba(15,23,42,.38)!important;padding:24px!important;position:relative!important;color:#0f172a!important}.modal-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.modal-title-row h2{margin:0}.envia-guide-form{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.envia-guide-form .wide{grid-column:span 2}.envia-result{margin-top:14px;padding:14px;border-radius:16px;background:#f8fafc;border:1px solid #e2e8f0}.envia-result pre{white-space:pre-wrap;word-break:break-word;max-height:280px;overflow:auto;background:#0f172a;color:#dbeafe;padding:12px;border-radius:12px}.envia-modal-open{overflow:hidden}@media(max-width:760px){.shipping-box-card{grid-template-columns:44px 1fr}.shipping-box-actions{grid-column:1/-1;justify-content:stretch}.shipping-box-actions .btn{flex:1}.shipping-box-form,.envia-guide-form{grid-template-columns:1fr}.envia-guide-form .wide{grid-column:1}.envia-guide-card{padding:18px!important;border-radius:20px!important}}


/* V328 - acciones de pedido alineadas y sin texto de comprobantes */
.order-actions.intuitive-form .order-buttons-inline{
  grid-column:span 2;
  min-width:0;
}
.order-actions.intuitive-form .order-buttons-inline .order-buttons-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(150px,1fr));
  gap:12px;
  align-items:stretch;
  width:100%;
}
.order-actions.intuitive-form .order-buttons-inline .btn{
  min-height:64px;
  width:100%;
  white-space:normal;
  text-align:center;
  justify-content:center;
}
.order-actions.intuitive-form .action-field input[type="file"]{
  min-height:54px;
}
@media(max-width:1200px){
  .order-actions.intuitive-form .order-buttons-inline{grid-column:1/-1;}
}
@media(max-width:760px){
  .order-actions.intuitive-form .order-buttons-inline .order-buttons-row{grid-template-columns:1fr;}
}


/* V329 - tarifas Envia seleccionables */
.envia-rate-list{display:grid;gap:10px;margin-top:12px}
.envia-rate-card{width:100%;border:1px solid #dbeafe;background:#fff;border-radius:16px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;box-shadow:0 10px 24px rgba(37,99,235,.08);cursor:pointer}
.envia-rate-card:hover{border-color:#2563eb;box-shadow:0 14px 30px rgba(37,99,235,.14)}
.envia-rate-card.selected{border-color:#2563eb;background:#eff6ff;box-shadow:0 0 0 3px rgba(37,99,235,.14)}
.envia-rate-card span{display:flex;flex-direction:column;min-width:0}
.envia-rate-card b{font-size:14px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.envia-rate-card small{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.envia-rate-card strong{font-size:15px;color:#1d4ed8;white-space:nowrap}
.envia-attempts{margin-top:12px;background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;padding:10px 12px;color:#9a3412}
.envia-attempts summary{font-weight:800;cursor:pointer}
.envia-attempts small{display:block;margin-top:6px;color:#9a3412}

/* V333 - Envia guía generada y botones de rastreo/etiqueta */
.envia-order-card.guia-generada{border-color:rgba(22,163,74,.28);background:linear-gradient(135deg,#f0fdf4,#f8fafc)}
.envia-order-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}
.envia-generated-doc-card{border-color:rgba(37,99,235,.28)!important;background:linear-gradient(135deg,#eff6ff,#ffffff)!important}
.envia-generated-doc-card .btn:not(.dark){background:#2563eb;color:#fff;box-shadow:0 10px 24px rgba(37,99,235,.20)}
.envia-generated-panel{display:grid;gap:14px}
.envia-generated-panel>b{font-size:18px;color:#166534}
.envia-generated-grid{display:grid;grid-template-columns:140px minmax(0,1fr);gap:8px 12px;background:#f8fafc;border:1px solid #dbeafe;border-radius:16px;padding:14px}
.envia-generated-grid span{color:#64748b;font-weight:800;text-transform:uppercase;font-size:11px;letter-spacing:.04em}
.envia-generated-grid strong{color:#0f172a;word-break:break-word}
@media(max-width:720px){.envia-order-actions{justify-content:flex-start}.envia-generated-grid{grid-template-columns:1fr}}


/* V334 - cinco acciones Envia en una sola línea */
.order-actions.intuitive-form .order-buttons-inline{
  grid-column:1 / -1 !important;
}
.order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:12px !important;
  width:100% !important;
  align-items:stretch !important;
}
.order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions .btn{
  width:100% !important;
  min-width:0 !important;
  min-height:60px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  white-space:normal !important;
  padding:12px 10px !important;
}
.order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions .btn[disabled]{
  opacity:.55 !important;
  cursor:not-allowed !important;
  box-shadow:none !important;
}
.order-actions.intuitive-form .order-guide-generated-btn{
  background:#2563eb !important;
  color:#fff !important;
}
.order-actions.intuitive-form .order-guide-track-btn{
  background:#0f172a !important;
  color:#fff !important;
}
.envia-order-card.guia-cancelada{
  border-color:rgba(239,68,68,.18) !important;
  background:linear-gradient(135deg,#fff1f2,#ffffff) !important;
}
@media(max-width:1400px){
  .order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}
@media(max-width:980px){
  .order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media(max-width:760px){
  .order-actions.intuitive-form .order-buttons-inline .order-buttons-row.order-five-actions{
    grid-template-columns:1fr !important;
  }
}


/* V335 - pedidos Shopify en POS */
.st-shopify,
.status-badge.st-shopify,
.status-select.st-shopify,
.status-card.st-shopify{
  background:#edfbd8!important;
  color:#2f6b05!important;
  border-color:#95bf47!important;
}
.status-dashboard .st-shopify{
  background:#95bf47!important;
  color:#0f172a!important;
}
.shopify-sync-btn{
  background:#95bf47!important;
  color:#0f172a!important;
  border-color:#7fa43a!important;
  font-weight:900!important;
}
.shopify-sync-btn:disabled{opacity:.7!important;cursor:wait!important}

/* V337 - scanner móvil: overlay de lectura y opciones de cámara desplegables */
.phone-body .scan-box{
  position:relative;
  background:linear-gradient(180deg,#0f172a,#111f3d)!important;
  border:1px solid rgba(255,255,255,.08)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 18px 36px rgba(15,23,42,.12)!important;
}
.phone-body .scan-box video{
  width:100%!important;
  min-height:260px!important;
  border-radius:18px!important;
  object-fit:cover!important;
  background:#0f172a!important;
}
.phone-scan-main-actions{grid-template-columns:1.25fr 1fr!important;gap:10px!important}
.phone-camera-options{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
  margin:10px 0 12px;
  background:#f4f8ff;
  border:1px solid #dbe7fb;
  border-radius:18px;
  padding:10px;
}
.phone-camera-options .btn{min-width:0!important;padding:12px 8px!important;font-size:14px!important;white-space:normal!important}
.phone-camera-selected{grid-column:1/-1;color:#516a91;font-weight:900;text-align:center;background:#fff;border:1px solid #dbe7fb;border-radius:14px;padding:8px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-scan-success-overlay{
  position:fixed;
  inset:0;
  z-index:999999;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(2,6,23,.38);
  backdrop-filter:blur(7px);
  animation:phoneScanFadeIn .16s ease-out both;
}
.phone-scan-success-overlay.leaving{animation:phoneScanFadeOut .18s ease-in both}
.phone-scan-success-card{
  width:min(430px,94vw);
  display:grid;
  grid-template-columns:116px minmax(0,1fr);
  gap:14px;
  align-items:center;
  padding:16px;
  border-radius:26px;
  background:#fff;
  border:1px solid rgba(37,99,235,.18);
  box-shadow:0 26px 76px rgba(2,6,23,.34);
}
.phone-scan-success-thumb img,.phone-scan-overlay-empty{
  width:116px;
  height:116px;
  border-radius:22px;
  object-fit:cover;
  background:#eef4ff;
  border:1px solid #dbe7fb;
  display:grid;
  place-items:center;
  font-size:42px;
}
.phone-scan-success-info{min-width:0;display:grid;gap:6px}
.phone-scan-ok-pill{display:inline-flex;width:max-content;max-width:100%;align-items:center;gap:4px;background:#dcfce7;color:#166534;border:1px solid #bbf7d0;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:1000;white-space:nowrap}
.phone-scan-success-info h3{margin:0;color:#0b1d4d;font-size:20px;line-height:1.05;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.phone-scan-success-info p{margin:0;color:#64748b;font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phone-scan-success-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:4px}
.phone-scan-success-kpis div{background:#f8fbff;border:1px solid #dbe7fb;border-radius:14px;padding:8px 6px;text-align:center;min-width:0}
.phone-scan-success-kpis small{display:block;color:#64748b;font-size:10px;font-weight:1000;text-transform:uppercase;letter-spacing:.03em}
.phone-scan-success-kpis b{display:block;color:#0b1d4d;font-size:19px;line-height:1.1;margin-top:3px;overflow:hidden;text-overflow:ellipsis}
@keyframes phoneScanFadeIn{from{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}
@keyframes phoneScanFadeOut{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.98)}}
@media(max-width:430px){
  .phone-scan-main-actions{grid-template-columns:1fr!important}
  .phone-camera-options{grid-template-columns:1fr 1fr!important}
  .phone-camera-selected{grid-column:1/-1}
  .phone-scan-success-card{grid-template-columns:92px minmax(0,1fr);padding:14px;border-radius:22px}
  .phone-scan-success-thumb img,.phone-scan-overlay-empty{width:92px;height:92px;border-radius:18px;font-size:34px}
  .phone-scan-success-info h3{font-size:17px}
  .phone-scan-success-kpis b{font-size:16px}
}


/* V338 - Shopify pedidos solo proyectar */
.shopify-project-only-wrap{
  min-height:48px;
  padding:10px 14px;
  border:1px solid #dbeafe;
  border-radius:16px;
  background:#f8fbff;
  display:inline-flex!important;
  align-items:center;
  gap:9px;
  font-weight:900;
  color:#0f172a;
}
.shopify-project-only-wrap input{width:18px;height:18px;accent-color:#95bf47;}
@media(max-width:760px){.shopify-project-only-wrap{width:100%;justify-content:flex-start}}


/* V341 - selección masiva de pedidos */
.order-bulk-toolbar{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:14px 18px;margin:0 0 14px;border:1px solid #dbeafe;border-radius:18px;
  background:linear-gradient(135deg,#f8fbff,#ffffff);box-shadow:0 12px 28px rgba(37,99,235,.08);
}
.order-bulk-toolbar b{color:#0f172a;font-weight:900}
.order-bulk-toolbar select{min-height:42px;border:1px solid #dbe7fb;border-radius:14px;background:#fff;padding:0 12px;font-weight:850;color:#0f172a}
.order-bulk-check,.order-select-wrap{display:inline-flex;align-items:center;gap:8px;font-weight:900;color:#0f172a;cursor:pointer}
.order-select-wrap{justify-content:center;width:42px;height:42px;border-radius:999px;background:#eff6ff;border:1px solid #cfe0ff;flex:0 0 42px}
.order-select-wrap input,.order-bulk-check input{width:20px;height:20px;accent-color:#2563eb;cursor:pointer}
.order-card summary{grid-template-columns:48px 1.5fr auto auto auto auto auto!important}
.order-bulk-toolbar .btn{min-height:42px!important;min-width:0!important;white-space:normal!important}
.order-bulk-toolbar .btn.yellow{background:#f59e0b!important;color:#fff!important}
@media(max-width:1100px){.order-card summary{grid-template-columns:48px 1fr!important}.order-bulk-toolbar{align-items:stretch}.order-bulk-toolbar>*{flex:1 1 160px}}
@media(max-width:760px){.order-bulk-toolbar{display:grid;grid-template-columns:1fr}.order-bulk-toolbar .btn,.order-bulk-toolbar select{width:100%}.order-card summary{grid-template-columns:42px 1fr!important}}


/* V342 - Scanner móvil: cantidad post escaneo */
.phone-scan-options{
  grid-template-columns:minmax(0,1fr) 120px !important;
}
.phone-postscan-check{
  grid-column:1 / -1;
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr);
  gap:4px 10px;
  align-items:center;
}
.phone-postscan-check small{
  grid-column:2;
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.phone-postscan-qty-overlay{
  position:fixed;
  inset:0;
  z-index:1000000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(2,6,23,.48);
  backdrop-filter:blur(8px);
  animation:phoneScanFadeIn .14s ease-out both;
}
.phone-postscan-qty-overlay.leaving{animation:phoneScanFadeOut .16s ease-in both}
.phone-postscan-qty-card{
  width:min(380px,94vw);
  background:#fff;
  border:1px solid rgba(37,99,235,.18);
  border-radius:26px;
  box-shadow:0 26px 76px rgba(2,6,23,.34);
  padding:20px;
  display:grid;
  gap:12px;
  text-align:center;
}
.phone-postscan-icon{
  width:64px;
  height:64px;
  border-radius:20px;
  margin:0 auto;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#eff6ff,#dbeafe);
  border:1px solid #bfdbfe;
  font-size:32px;
}
.phone-postscan-qty-card h3{margin:0;color:#0b1d4d;font-size:22px}
.phone-postscan-qty-card p{margin:0;color:#64748b;font-weight:850;overflow-wrap:anywhere}
.phone-postscan-qty-card input{
  width:100%;
  height:62px;
  border:2px solid #bfdbfe;
  border-radius:18px;
  text-align:center;
  font-size:28px;
  font-weight:1000;
  outline:none;
  color:#0b1d4d;
}
.phone-postscan-qty-card input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 5px rgba(37,99,235,.12);
}
.phone-postscan-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.phone-postscan-qty-card small{color:#64748b;font-weight:800}
@media(max-width:430px){
  .phone-scan-options{grid-template-columns:1fr !important}
  .phone-postscan-check{grid-template-columns:auto minmax(0,1fr)}
}


/* ==== V351 DARK MODE + AJUSTE KPIS DASHBOARD ==== */
:root{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark;--bg:#0b1220;--card:#111a2b;--line:#243247;--text:#e8eefc;--muted:#9fb0ca;--blue:#0f172a;--accent:#60a5fa;--shadow:0 18px 50px rgba(0,0,0,.34)}
html[data-theme="dark"] body{background:var(--bg)!important;color:var(--text)!important}
html[data-theme="dark"] .main,html[data-theme="dark"] .content,html[data-theme="dark"] body.home-admin-body{background:var(--bg)!important;color:var(--text)!important}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .table,
html[data-theme="dark"] .tree-col,
html[data-theme="dark"] .tree-item,
html[data-theme="dark"] .master-results,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .variation-form,
html[data-theme="dark"] .qr-quick,
html[data-theme="dark"] .order-add-cart-panel,
html[data-theme="dark"] .brand-row,
html[data-theme="dark"] .doc-card,
html[data-theme="dark"] .permission-check,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .email-row,
html[data-theme="dark"] .excel-sku-history,
html[data-theme="dark"] .customer-card,
html[data-theme="dark"] .metric-panel,
html[data-theme="dark"] .drill-panel,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .shipping-box-modal-card,
html[data-theme="dark"] .factory-pos-modal-product,
html[data-theme="dark"] .modern-thread-box,
html[data-theme="dark"] .phone-card,
html[data-theme="dark"] .phone-product-card,
html[data-theme="dark"] .phone-detail-card,
html[data-theme="dark"] .phone-search,
html[data-theme="dark"] .phone-kpi,
html[data-theme="dark"] .phone-action-card,
html[data-theme="dark"] .phone-order-card,
html[data-theme="dark"] .phone-client-card,
html[data-theme="dark"] .phone-gallery-card,
html[data-theme="dark"] .phone-photo-card,
html[data-theme="dark"] .phone-filters,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .scan-result,
html[data-theme="dark"] .camera-box,
html[data-theme="dark"] .order-add-scanner,
html[data-theme="dark"] .pos-sheet,
html[data-theme="dark"] .hgs-panel,
html[data-theme="dark"] .hgs-kpi,
html[data-theme="dark"] .hgs-point-detail,
html[data-theme="dark"] .hgs-client-orders,
html[data-theme="dark"] .home-session-card,
html[data-theme="dark"] .factory-rich-select-menu,
html[data-theme="dark"] .factory-color-option,
html[data-theme="dark"] .factory-rich-select-btn,
html[data-theme="dark"] .factory-thread-rich-row,
html[data-theme="dark"] .factory-pos-order-modal-head,
html[data-theme="dark"] .factory-pos-order-modal-actions{background:var(--card)!important;border-color:var(--line)!important;color:var(--text)!important;box-shadow:var(--shadow)!important}
html[data-theme="dark"] .hero{background:linear-gradient(135deg,#111a2b 0%,#16233a 100%)!important}
html[data-theme="dark"] .logo,html[data-theme="dark"] .user-avatar,html[data-theme="dark"] .thumb.empty,html[data-theme="dark"] .mini.empty,html[data-theme="dark"] .product-card .pic,html[data-theme="dark"] .pic,html[data-theme="dark"] .centered-output,html[data-theme="dark"] .factory-pos-modal-img{background:#16233a!important}
html[data-theme="dark"] .nav-btn,html[data-theme="dark"] .nav-link,html[data-theme="dark"] .subnav a,html[data-theme="dark"] .brand h1,html[data-theme="dark"] .hero h2,html[data-theme="dark"] .card h3,html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4,html[data-theme="dark"] b,html[data-theme="dark"] strong,html[data-theme="dark"] .table td,html[data-theme="dark"] .table th,html[data-theme="dark"] .product-name,html[data-theme="dark"] .mrow,html[data-theme="dark"] .mrow small,html[data-theme="dark"] .status,html[data-theme="dark"] .permission-chips span,html[data-theme="dark"] .badge,html[data-theme="dark"] .pill,html[data-theme="dark"] .topbtn,html[data-theme="dark"] .session-chip span,html[data-theme="dark"] .drill-stat strong,html[data-theme="dark"] .drill-stat span,html[data-theme="dark"] .dashboard-list-item,html[data-theme="dark"] .color-row,html[data-theme="dark"] .account-card,html[data-theme="dark"] .employee-card,html[data-theme="dark"] .hgs-panel h3,html[data-theme="dark"] .hgs-kpi b,html[data-theme="dark"] .hgs-client b{color:var(--text)!important}
html[data-theme="dark"] .brand p,html[data-theme="dark"] .muted,html[data-theme="dark"] small,html[data-theme="dark"] .field label,html[data-theme="dark"] .tree-item small,html[data-theme="dark"] .topbar .master:before,html[data-theme="dark"] .login-form label,html[data-theme="dark"] .hgs-kpi small,html[data-theme="dark"] .hgs-panel p,html[data-theme="dark"] .hgs-client small,html[data-theme="dark"] .permission-check,html[data-theme="dark"] .email-row small,html[data-theme="dark"] .user-info small{color:var(--muted)!important}
html[data-theme="dark"] .nav-btn:hover,html[data-theme="dark"] .nav-link:hover,html[data-theme="dark"] .nav-btn.active,html[data-theme="dark"] .subnav a:hover,html[data-theme="dark"] .clickrow:hover,html[data-theme="dark"] .mrow:hover,html[data-theme="dark"] .factory-color-option:hover{background:#16233a!important;color:#fff!important}
html[data-theme="dark"] .subnav{border-left-color:#243247!important}
html[data-theme="dark"] .topbar{background:#0f172a!important}
html[data-theme="dark"] .status{background:#10261f!important;color:#7ef0b0!important;border-color:#1f8f58!important}
html[data-theme="dark"] .topbtn,html[data-theme="dark"] .btn{background:#2563eb!important;color:#fff!important}
html[data-theme="dark"] .btn.dark{background:#1e293b!important}
html[data-theme="dark"] .btn.green{background:#059669!important}
html[data-theme="dark"] .btn.red{background:#dc2626!important}
html[data-theme="dark"] .btn.yellow{background:#f59e0b!important;color:#1f1400!important}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .master input,
html[data-theme="dark"] .password-row,
html[data-theme="dark"] .login-form input,
html[data-theme="dark"] .order-add-searchbar input,
html[data-theme="dark"] .order-add-controls input,
html[data-theme="dark"] .qr-quick input:not([type=checkbox]),
html[data-theme="dark"] .cartqty{background:#0f172a!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme="dark"] .field select{background-image:linear-gradient(45deg, transparent 50%, #8ab4ff 50%),linear-gradient(135deg, #8ab4ff 50%, transparent 50%)!important}
html[data-theme="dark"] .table th{background:#16233a!important;color:#c8d6ef!important}
html[data-theme="dark"] .table td,html[data-theme="dark"] .table th,html[data-theme="dark"] .products-head,html[data-theme="dark"] .order-card summary,html[data-theme="dark"] .factory-pos-order-modal-head,html[data-theme="dark"] .factory-pos-order-modal-actions{border-color:var(--line)!important}
html[data-theme="dark"] .customer-card,html[data-theme="dark"] .brand-row,html[data-theme="dark"] .tree-item,html[data-theme="dark"] .doc-card,html[data-theme="dark"] .phone-kpi,html[data-theme="dark"] .hgs-client{background:#16233a!important}
html[data-theme="dark"] .badge,html[data-theme="dark"] .pill,html[data-theme="dark"] .movement-type,html[data-theme="dark"] .permission-chips span{background:#16233a!important;color:#8ab4ff!important}
html[data-theme="dark"] .drill-overlay,html[data-theme="dark"] .modal-overlay{background:rgba(2,6,23,.72)!important}
html[data-theme="dark"] .session-chip,html[data-theme="dark"] .search-box{background:#111a2b!important;border-color:#243247!important}
html[data-theme="dark"] .mardieli-watermark{color:rgba(219,234,254,.3)!important}

.theme-toggle{border:1px solid #cfe0ff;border-radius:16px;background:#fff;color:#0b1c72;font-weight:1000;padding:11px 14px;box-shadow:0 12px 28px rgba(15,23,42,.14);cursor:pointer;transition:transform .16s ease,background .16s ease,color .16s ease,border-color .16s ease}
.theme-toggle:hover{transform:translateY(-1px)}
.login-theme-toggle{position:fixed;top:18px;right:18px;z-index:40}
html[data-theme="dark"] .theme-toggle{background:#111a2b!important;color:#e8eefc!important;border-color:#243247!important;box-shadow:0 12px 28px rgba(0,0,0,.28)!important}
html[data-theme="dark"] .login-body{background:#0b1220!important}
html[data-theme="dark"] .login-card{background:#111a2b!important;border-color:#243247!important;box-shadow:0 28px 80px rgba(0,0,0,.36)!important}
html[data-theme="dark"] .login-card h1{color:#f8fbff!important}
html[data-theme="dark"] .password-row button{background:#16233a!important;color:#8ab4ff!important}
html[data-theme="dark"] .recaptcha-local{background:#16233a!important;border-color:#243247!important;color:var(--text)!important}
html[data-theme="dark"] .login-submit{background:#2563eb!important;box-shadow:0 14px 30px rgba(37,99,235,.28)!important}
html[data-theme="dark"] .login-link{color:#8ab4ff!important}

#stats .metric-drill-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-rows:1fr!important;align-items:stretch!important}
#stats .metric-drill-card{height:100%!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
#stats .metric-drill-card:nth-child(4){grid-column:1 / 2}
@media(max-width:980px){#stats .metric-drill-grid{grid-template-columns:1fr!important}.login-theme-toggle{top:12px;right:12px;padding:10px 12px;border-radius:14px;font-size:13px}}


/* ==== V352 DARK MODE PATCH: ESTADISTICAS + PEDIDOS + LOGOS ==== */
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .order-card[open] summary,
html[data-theme="dark"] .order-detail-grid,
html[data-theme="dark"] .detail-box,
html[data-theme="dark"] .step-chip,
html[data-theme="dark"] .customer-card,
html[data-theme="dark"] .envia-order-card,
html[data-theme="dark"] .envia-order-card.guia-generada,
html[data-theme="dark"] .envia-order-card.guia-cancelada,
html[data-theme="dark"] .order-card .table-wrap,
html[data-theme="dark"] .order-card h3,
html[data-theme="dark"] .doc-actions>div,
html[data-theme="dark"] .order-actions,
html[data-theme="dark"] .doc-actions,
html[data-theme="dark"] .status-badge,
html[data-theme="dark"] .status-select,
html[data-theme="dark"] .session-person,
html[data-theme="dark"] .selected-account-logo-box,
html[data-theme="dark"] .account-logo-library-item,
html[data-theme="dark"] .shipping-logo-library-item,
html[data-theme="dark"] .account-logo-library-form,
html[data-theme="dark"] .hgs-panel.point-panel,
html[data-theme="dark"] .hgs-point-chart,
html[data-theme="dark"] .hgs-point-chart.v316,
html[data-theme="dark"] .hgs-point-context,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-context,
html[data-theme="dark"] .hgs-point-detail-card,
html[data-theme="dark"] .hgs-detail-row,
html[data-theme="dark"] .hgs-client-orders button,
html[data-theme="dark"] .hgs-dual-lines i,
html[data-theme="dark"] .hgs-loading,
html[data-theme="dark"] .hgs-error,
html[data-theme="dark"] .overview-chip,
html[data-theme="dark"] .factory-status-card,
html[data-theme="dark"] #factoryStatusResults .factory-row,
html[data-theme="dark"] .factory-grid-pro>.card,
html[data-theme="dark"] .factory-chart-card,
html[data-theme="dark"] .factory-hero-pro,
html[data-theme="dark"] .overview-chip.is-warn,
html[data-theme="dark"] .factory-pos-product.modern,
html[data-theme="dark"] .factory-pos-detail.modern,
html[data-theme="dark"] .factory-pos-card-actions,
html[data-theme="dark"] .factory-pos-order-maker,
html[data-theme="dark"] .factory-pos-order-form,
html[data-theme="dark"] .factory-pos-inline-section,
html[data-theme="dark"] .factory-pos-hero,
html[data-theme="dark"] .factory-pos-smart-filters,
html[data-theme="dark"] .factory-pos-inline-help,
html[data-theme="dark"] .factory-selected-source,
html[data-theme="dark"] .factory-pos-detail,
html[data-theme="dark"] .inventory-process-head .logo,
html[data-theme="dark"] .inventory-process-head img,
html[data-theme="dark"] .account-logo-push-img,
html[data-theme="dark"] .shipping-logo-push-img,
html[data-theme="dark"] .mass-loading-logo-wrap{background:#111a2b!important;border-color:#243247!important;color:var(--text)!important;box-shadow:var(--shadow)!important}

html[data-theme="dark"] .order-card[open] summary,
html[data-theme="dark"] .detail-box,
html[data-theme="dark"] .step-chip,
html[data-theme="dark"] .doc-actions>div,
html[data-theme="dark"] .hgs-point-context,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-context,
html[data-theme="dark"] .hgs-point-detail-card,
html[data-theme="dark"] .hgs-detail-row,
html[data-theme="dark"] .hgs-client,
html[data-theme="dark"] .hgs-client-orders button,
html[data-theme="dark"] .overview-chip,
html[data-theme="dark"] .factory-status-card,
html[data-theme="dark"] #factoryStatusResults .factory-row,
html[data-theme="dark"] .factory-grid-pro>.card,
html[data-theme="dark"] .factory-chart-card,
html[data-theme="dark"] .factory-pos-smart-filters,
html[data-theme="dark"] .factory-pos-detail.modern,
html[data-theme="dark"] .factory-pos-order-maker,
html[data-theme="dark"] .factory-pos-order-form,
html[data-theme="dark"] .factory-pos-inline-section,
html[data-theme="dark"] .factory-pos-inline-help,
html[data-theme="dark"] .factory-selected-source{background:#16233a!important}

html[data-theme="dark"] .order-actions select,
html[data-theme="dark"] .order-actions input,
html[data-theme="dark"] .doc-actions select,
html[data-theme="dark"] .session-form input,
html[data-theme="dark"] .session-form select,
html[data-theme="dark"] .session-form textarea,
html[data-theme="dark"] .file-pill,
html[data-theme="dark"] #factoryStatusFilter{background:#0f172a!important;color:var(--text)!important;border-color:#243247!important}

html[data-theme="dark"] .hgs-point-grid,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-grid{stroke:#2a3850!important}
html[data-theme="dark"] .hgs-point-label,
html[data-theme="dark"] .hgs-point-y,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-label,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-y{fill:#9fb0ca!important;color:#9fb0ca!important}
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-value{fill:#8ab4ff!important;stroke:#111a2b!important}
html[data-theme="dark"] .hgs-point-dot{fill:#111a2b!important;stroke:#60a5fa!important}
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-dot{fill:#60a5fa!important;stroke:#111a2b!important}
html[data-theme="dark"] .hgs-point-line,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-line{stroke:#60a5fa!important}
html[data-theme="dark"] .hgs-point-area{opacity:.7!important}
html[data-theme="dark"] .hgs-point-context b,
html[data-theme="dark"] .hgs-point-chart.v316 .hgs-point-context b,
html[data-theme="dark"] .hgs-detail-row b,
html[data-theme="dark"] .hgs-client-orders b,
html[data-theme="dark"] .hgs-dual-row>b,
html[data-theme="dark"] .factory-selected-source span,
html[data-theme="dark"] .account-logo-push b{color:#cfe0ff!important}
html[data-theme="dark"] .hgs-detail-row small,
html[data-theme="dark"] .hgs-client-orders small,
html[data-theme="dark"] .hgs-dual-lines span,
html[data-theme="dark"] .account-logo-push small,
html[data-theme="dark"] .session-person small{color:#9fb0ca!important}

html[data-theme="dark"] .brand .logo,
html[data-theme="dark"] .brand-logo,
html[data-theme="dark"] .login-logo,
html[data-theme="dark"] .print-logo,
html[data-theme="dark"] .ticket-logo,
html[data-theme="dark"] .session-chip img,
html[data-theme="dark"] .session-person img,
html[data-theme="dark"] .phone-user-mini img,
html[data-theme="dark"] .phone-session-chip img,
html[data-theme="dark"] .account-mini-preview,
html[data-theme="dark"] .account-logo-push-img,
html[data-theme="dark"] .shipping-logo-push-img,
html[data-theme="dark"] .mass-loading-logo-wrap{border-radius:16px!important;padding:6px;background:#16233a!important;border:1px solid #243247!important}
html[data-theme="dark"] .brand-logo-img,
html[data-theme="dark"] .login-logo,
html[data-theme="dark"] .print-logo,
html[data-theme="dark"] .ticket-logo,
html[data-theme="dark"] .session-chip img,
html[data-theme="dark"] .session-person img,
html[data-theme="dark"] .phone-user-mini img,
html[data-theme="dark"] .phone-session-chip img,
html[data-theme="dark"] .mass-loading-logo{filter:drop-shadow(0 4px 10px rgba(0,0,0,.35))}
html[data-theme="dark"] .topbar .session-chip,
html[data-theme="dark"] .phone-session-chip{background:#111a2b!important;border:1px solid #243247!important;color:#e8eefc!important}

html[data-theme="dark"] .status-pendiente{background:#1d4ed8!important;color:#dbeafe!important}
html[data-theme="dark"] .status-confirmado,
html[data-theme="dark"] .status-entregado{background:#14532d!important;color:#dcfce7!important}
html[data-theme="dark"] .status-procesando{background:#78350f!important;color:#fde68a!important}
html[data-theme="dark"] .status-en_camino{background:#0c4a6e!important;color:#bae6fd!important}
html[data-theme="dark"] .status-devuelto,
html[data-theme="dark"] .status-cancelado{background:#7f1d1d!important;color:#fecaca!important}

html[data-theme="dark"] .chart-empty,
html[data-theme="dark"] .chart-legend,
html[data-theme="dark"] .chart-caption,
html[data-theme="dark"] .metric-head p,
html[data-theme="dark"] .metric-footer,
html[data-theme="dark"] .drill-subtitle{color:#9fb0ca!important}


/* ==== V353 DARK MODE GLOBAL: CORRECCIÓN DE RENDERS BLANCOS ==== */
html[data-theme="dark"]{
  --bg:#080f1d!important;
  --card:#111a2b!important;
  --surface:#16233a!important;
  --surface-2:#0f172a!important;
  --line:#263650!important;
  --text:#f3f7ff!important;
  --muted:#a8b7d2!important;
  --accent:#3b82f6!important;
  --soft-blue:#1d355f!important;
  --shadow:0 18px 52px rgba(0,0,0,.34)!important;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content,
html[data-theme="dark"] main,
html[data-theme="dark"] .view,
html[data-theme="dark"] .page,
html[data-theme="dark"] .factory-page,
html[data-theme="dark"] .phone-main,
html[data-theme="dark"] .home-admin-body{
  background:var(--bg)!important;
  color:var(--text)!important;
}

/* Superficies genéricas: cubre componentes nuevos/renderizados dinámicamente */
html[data-theme="dark"] body :where(
  .card,.big-card,.soft,.panel,.box,.sheet,.surface,.container,.wrapper,
  .filters,.filter-card,.bulkbar,.pagination,.page-controls,.products-head,
  .table-wrap,.table,.variation-form,.qr-quick,.scan-result,.scan-result-card,
  .customer-card,.driver-card,.brand-row,.account-card,.account-row,.account-list-row,
  .order-card,.order-row,.order-detail,.detail-box,.order-summary,.order-note,
  .doc-actions>div,.order-actions,.selection-bar,.bulk-selection,.mass-actions,
  .product-card,.product-row,.product-detail,.product-panel,.variation-row,
  .metric-panel,.metric-drill-card,.dashboard-card,.chart-host,.chart-card,.chart-wrap,
  .rank-card,.rank-row,.rank-list,.stat,.stats,.kpi,.kpi-card,.kpi-row,.overview-chip,
  .hgs-panel,.hgs-kpi,.hgs-point-chart,.hgs-point-context,.hgs-point-detail-card,
  .hgs-detail-row,.hgs-client,.hgs-client-orders,.hgs-dual-lines,.hgs-loading,
  .modal-card,.pos-modal,.phone-modal-panel,.drill-panel,.master-results,.mrow,
  .factory-card,.factory-panel,.factory-row,.factory-list,.factory-prod,.factory-orders,
  .factory-status-card,.factory-chart-card,.factory-hero-pro,.factory-pos-hero,
  .factory-pos-product,.factory-pos-detail,.factory-pos-order-maker,.factory-pos-order-form,
  .factory-pos-inline-section,.factory-pos-inline-help,.factory-pos-card-actions,
  .factory-pos-modal-product,.factory-pos-order-modal,.modern-thread-box,.thread-box,
  .factory-thread-rich-row,.factory-rich-select-menu,.factory-rich-select-btn,
  .factory-selected-source,.inventory-process-head,.inventory-process-card,
  .account-logo-library-card,.account-logo-library-form,.account-logo-library-item,
  .shipping-logo-library-item,.account-logo-push-img,.shipping-logo-push-img,
  .selected-account-logo-box,.mass-loading-card,.mass-loading-logo-wrap,
  .phone-card,.phone-panel,.phone-action,.phone-action-card,.phone-order-card,
  .phone-product-card,.phone-client-card,.phone-detail-card,.phone-gallery-card,
  .phone-photo-card,.phone-filters,.phone-search,.phone-kpi,.phone-expand
){
  background:var(--card)!important;
  background-image:none!important;
  border-color:var(--line)!important;
  color:var(--text)!important;
  box-shadow:var(--shadow)!important;
}
html[data-theme="dark"] body :where(
  .tree-item,.catalog-item,.list-item,.clickrow,.mrow,.detail-box,.doc-actions>div,
  .order-card[open] summary,.phone-expand,.customer-card,.brand-row,.account-row,
  .rank-row,.hgs-detail-row,.hgs-client,.factory-row,.factory-status-card,
  .factory-pos-smart-filters,.factory-pos-detail.modern,.factory-pos-inline-section,
  .factory-thread-rich-row,.account-logo-library-item,.shipping-logo-library-item,
  .selected-account-logo-box,.phone-product-card,.phone-order-card,.phone-client-card
){
  background:var(--surface)!important;
  background-image:none!important;
}

/* Forzar cajas que vienen con style inline blanco desde renders JS */
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background:#fff"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background: #fff"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background:white"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background: white"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background-color:#fff"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background-color: #fff"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background-color:white"],
html[data-theme="dark"] body :where(div,section,article,aside,main,header,footer,nav,form,fieldset,details,summary,li,ul,table,thead,tbody,tr,td,th)[style*="background-color: white"]{
  background:var(--card)!important;
  background-color:var(--card)!important;
  background-image:none!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}

/* Formularios, selects custom y placeholders */
html[data-theme="dark"] body :where(input,select,textarea,.search-box,.master input,.field input,.field select,.field textarea,.password-row,.cartqty,.qty-control,.qty-control input,.qty-control button,.file-pill,.status-select,.factory-rich-select-btn,.nice-select,.custom-select,.select-btn,.select-wrapper,.select-display,.select-trigger){
  background:var(--surface-2)!important;
  background-image:none!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] body :where(input,textarea)::placeholder{color:#7f91ae!important;opacity:1!important}
html[data-theme="dark"] body :where(select option){background:#111a2b!important;color:#f3f7ff!important}
html[data-theme="dark"] .field select,
html[data-theme="dark"] select{
  background-image:linear-gradient(45deg,transparent 50%,#8ab4ff 50%),linear-gradient(135deg,#8ab4ff 50%,transparent 50%)!important;
  background-position:calc(100% - 18px) 50%,calc(100% - 12px) 50%!important;
  background-size:6px 6px,6px 6px!important;
  background-repeat:no-repeat!important;
}

/* Texto: evita que quede blanco sobre blanco o azul apagado */
html[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,b,strong,label,summary,td,th,p,span,a,button,small,div){
  text-shadow:none;
}
html[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,b,strong,label,summary,td,th,.product-name,.account-logo-push b,.factory-selected-source span,.hgs-detail-row b,.hgs-client-orders b){
  color:var(--text)!important;
}
html[data-theme="dark"] body :where(p,small,.muted,.note,.field label,.metric-head p,.chart-caption,.chart-empty,.drill-subtitle,.hgs-detail-row small,.hgs-client-orders small,.factory-pos-order-head small,.account-logo-push small,.brand p){
  color:var(--muted)!important;
}
html[data-theme="dark"] body :where(a,.product-name,.open-hint,.login-link){color:#8ab4ff!important}

/* Tablas y separadores */
html[data-theme="dark"] body :where(table,.table){background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
html[data-theme="dark"] body :where(th,thead tr,.table th){background:#17253c!important;color:#cfe0ff!important;border-color:var(--line)!important}
html[data-theme="dark"] body :where(td,.table td,tr,.products-head,.order-card summary,.doc-actions,.order-actions){border-color:var(--line)!important}
html[data-theme="dark"] body :where(.clickrow:hover,.mrow:hover,.nav-btn:hover,.nav-link:hover,.subnav a:hover,.factory-color-option:hover,.account-logo-library-item:hover){background:#1b2b47!important;color:#fff!important}

/* Gráficas SVG/canvas containers */
html[data-theme="dark"] body :where(svg){background:transparent!important}
html[data-theme="dark"] body :where(.chart-host,.chart-card,.hgs-point-chart,.factory-chart-card){background:#111a2b!important;border-color:var(--line)!important}
html[data-theme="dark"] body :where(.hgs-point-grid,.chart-grid,line[stroke="#e5e7eb"],line[stroke="#e2e8f0"],line[stroke="#dbeafe"]){stroke:#2c3c56!important}
html[data-theme="dark"] body :where(.hgs-point-label,.hgs-point-y,text){fill:#a8b7d2!important;color:#a8b7d2!important}
html[data-theme="dark"] body :where(.hgs-point-line,path[stroke="#2f6df6"],polyline[stroke="#2f6df6"]){stroke:#60a5fa!important}
html[data-theme="dark"] body :where(.hgs-point-dot,circle[fill="#2f6df6"]){fill:#60a5fa!important;stroke:#111a2b!important}

/* Miniaturas y logos: el contenedor ya no queda blanco; la imagen no se altera */
html[data-theme="dark"] body :where(.logo,.brand-logo,.thumb.empty,.mini.empty,.pic,.product-card .pic,.pos-modal-image,.factory-pos-thumb,.factory-pos-modal-img,.factory-cap-thumb,.phone-img-empty,.phone-order-thumb-empty,.rank-thumb,.account-mini-preview,.account-logo-push-img,.shipping-logo-push-img,.login-logo,.print-logo,.ticket-logo,.session-chip img,.phone-user-mini img,.phone-session-chip img){
  background:#17253c!important;
  border-color:#2b3b55!important;
}
html[data-theme="dark"] body :where(img.brand-logo-img,img.login-logo,img.print-logo,img.ticket-logo,.mass-loading-logo){
  filter:drop-shadow(0 4px 10px rgba(0,0,0,.35));
}

/* Checkbox/radio sin caja blanca enorme */
html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"]{
  accent-color:#3b82f6!important;
  background:#111a2b!important;
  border-color:#55709a!important;
}
html[data-theme="dark"] label:has(input[type="checkbox"]),
html[data-theme="dark"] label:has(input[type="radio"]),
html[data-theme="dark"] .checkline,
html[data-theme="dark"] .recaptcha-local{
  background:var(--surface)!important;
  color:var(--text)!important;
  border-color:var(--line)!important;
}

/* Colores de estados y botones no se apagan */
html[data-theme="dark"] body :where(.btn,.primary,.topbtn,.small-action,.login-submit){background:#2563eb!important;color:#fff!important;border-color:#2563eb!important}
html[data-theme="dark"] body :where(.btn.green,.primary.green,.success,.btn.success){background:#059669!important;color:#fff!important;border-color:#059669!important}
html[data-theme="dark"] body :where(.btn.red,.danger,.btn.danger,.btn.delete){background:#dc2626!important;color:#fff!important;border-color:#dc2626!important}
html[data-theme="dark"] body :where(.btn.yellow,.warning,.btn.warning){background:#f59e0b!important;color:#1c1404!important;border-color:#f59e0b!important}
html[data-theme="dark"] body :where(.btn.dark,.secondary){background:#1e293b!important;color:#f3f7ff!important;border-color:#334155!important}
html[data-theme="dark"] body :where(.status-card,.status-dashboard .status-card){box-shadow:0 18px 42px rgba(0,0,0,.28)!important;color:#fff!important;border:0!important}
html[data-theme="dark"] .status-dashboard .st-pendiente{background:#2563eb!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-confirmado{background:#2563eb!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-procesando{background:#7c3aed!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-en_camino{background:#0891b2!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-entregado{background:#16a34a!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-devuelto{background:#ef4444!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-cancelado{background:#991b1b!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-sucursal{background:#0f766e!important;color:#fff!important}
html[data-theme="dark"] .status-dashboard .st-incidencia{background:#dc2626!important;color:#fff!important}
html[data-theme="dark"] body :where(.status-card b,.status-card span,.status-dashboard .status-card b,.status-dashboard .status-card span){color:#fff!important}

/* Hero y topbar */
html[data-theme="dark"] .hero,
html[data-theme="dark"] .hero-panel,
html[data-theme="dark"] .factory-hero-pro{
  background:linear-gradient(135deg,#111a2b,#17253c)!important;
  border-color:var(--line)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .topbar{background:#0b1220!important;border-bottom:1px solid var(--line)!important}
html[data-theme="dark"] .sidebar{background:#111a2b!important;border-color:var(--line)!important}
html[data-theme="dark"] .nav-btn.active,
html[data-theme="dark"] .nav-link.active{background:#1b2b47!important;color:#fff!important}
html[data-theme="dark"] .pill,.eyebrow,.badge,.small-badge,.overview-chip{background:#1d355f!important;color:#8ab4ff!important;border-color:#31537f!important}

/* Renders específicos de pedidos/productos/shopify/fábrica vistos en capturas */
html[data-theme="dark"] :where(#orderList,#ordersList,#productsList,#productRows,#factorySummary,#factoryStatusResults,#shopifySyncPanel,#shopifyProgress,#stats,#dashboardStats) > :where(div,article,section,details){
  background:#111a2b!important;
  border-color:var(--line)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] :where(#orderList,#ordersList,#productsList,#productRows,#factorySummary,#factoryStatusResults,#shopifySyncPanel,#shopifyProgress,#stats,#dashboardStats) > :where(div,article,section,details):hover{
  background:#16233a!important;
}
html[data-theme="dark"] .dashboard-analytics .chart-host,
html[data-theme="dark"] .dashboard-analytics .account-card,
html[data-theme="dark"] .dashboard-analytics .employee-card,
html[data-theme="dark"] .dashboard-analytics .color-row,
html[data-theme="dark"] .dashboard-analytics .rank-list > *,
html[data-theme="dark"] .dashboard-analytics .metric-panel{
  background:#111a2b!important;
  background-image:none!important;
  border-color:var(--line)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .dashboard-analytics .chart-empty{background:#16233a!important;border-color:#334761!important;color:var(--muted)!important}
html[data-theme="dark"] .mass-loading-overlay{background:rgba(2,6,23,.76)!important}
html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .drill-overlay,
html[data-theme="dark"] .factory-pos-order-modal-backdrop{background:rgba(2,6,23,.76)!important}

/* Excepciones: mantiene tarjetas de dinero/estatus legibles */
html[data-theme="dark"] .status,
html[data-theme="dark"] .status-pill{background:#10261f!important;color:#7ef0b0!important;border-color:#1f8f58!important}
html[data-theme="dark"] .qred{color:#fca5a5!important}.qyel{color:#fde68a!important}.qgreen{color:#86efac!important}

/* ==== V354 DARK MODE EXTRA: SELECTORES / PREVIEWS / SUCURSALES / MOVIMIENTOS / POS ==== */
/* Selectores custom que seguían blancos */
html[data-theme="dark"] .smart-select-button,
html[data-theme="dark"] .smart-select-panel,
html[data-theme="dark"] .smart-option,
html[data-theme="dark"] .smart-select-search,
html[data-theme="dark"] .smart-native-select,
html[data-theme="dark"] select.select-pro,
html[data-theme="dark"] .select-helper,
html[data-theme="dark"] .customer-combobox input[type=text],
html[data-theme="dark"] .customer-combobox .customer-dropdown,
html[data-theme="dark"] .customer-search-shell,
html[data-theme="dark"] .customer-search-popup,
html[data-theme="dark"] .field .smart-select-wrap,
html[data-theme="dark"] .field .smart-select-button,
html[data-theme="dark"] .field .smart-select-panel{
  background:#0f172a!important;
  color:#f3f7ff!important;
  border-color:#263650!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .smart-option:hover,
html[data-theme="dark"] .smart-option.active,
html[data-theme="dark"] .customer-combobox .customer-option:hover{
  background:#16233a!important;
  color:#fff!important;
}
html[data-theme="dark"] .smart-option small,
html[data-theme="dark"] .smart-select-button small,
html[data-theme="dark"] .select-helper,
html[data-theme="dark"] .customer-combobox .customer-option small{
  color:#a8b7d2!important;
}

/* POS: scanner, carrito, resumen y cajas blancas */
html[data-theme="dark"] #cartBox,
html[data-theme="dark"] .cart-summary,
html[data-theme="dark"] #cartExtras,
html[data-theme="dark"] #cartExtras > *,
html[data-theme="dark"] .cart-history-note,
html[data-theme="dark"] .order-add-scanner,
html[data-theme="dark"] .camera-box,
html[data-theme="dark"] .scan-result,
html[data-theme="dark"] .scan-result-card,
html[data-theme="dark"] .totals-box,
html[data-theme="dark"] .totals-card,
html[data-theme="dark"] .subtotal-box,
html[data-theme="dark"] .discount-box,
html[data-theme="dark"] .payment-box,
html[data-theme="dark"] .client-summary-box,
html[data-theme="dark"] .cart-client-box,
html[data-theme="dark"] .cart-note-box{
  background:#111a2b!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .cart-summary > div,
html[data-theme="dark"] #cartBox *,
html[data-theme="dark"] .cart-history-note b,
html[data-theme="dark"] .cart-history-note small{
  color:inherit!important;
}
html[data-theme="dark"] .cart-summary .grand{border-top-color:#2b3b55!important}

/* Shipping: preview y cards */
html[data-theme="dark"] .shipping-preview-card,
html[data-theme="dark"] .shipping-box-card,
html[data-theme="dark"] .shipping-box-card.inactive,
html[data-theme="dark"] .shipping-box-form,
html[data-theme="dark"] .shipping-method-card,
html[data-theme="dark"] .shipping-row,
html[data-theme="dark"] .shipping-card,
html[data-theme="dark"] .shipping-list-row,
html[data-theme="dark"] .shipping-list-card,
html[data-theme="dark"] .shipping-library-card{
  background:#111a2b!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .shipping-preview-thumb,
html[data-theme="dark"] .shipping-preview-thumb img,
html[data-theme="dark"] .shipping-box-icon,
html[data-theme="dark"] .shipping-list-preview,
html[data-theme="dark"] .shipping-list-preview img{
  background:#17253c!important;
  border-color:#2b3b55!important;
}
html[data-theme="dark"] .shipping-preview-card b,
html[data-theme="dark"] .shipping-box-head b,
html[data-theme="dark"] .shipping-row b{color:#f3f7ff!important}
html[data-theme="dark"] .shipping-preview-card small,
html[data-theme="dark"] .shipping-preview-card p,
html[data-theme="dark"] .shipping-box-info small,
html[data-theme="dark"] .shipping-row small{color:#a8b7d2!important}
html[data-theme="dark"] .shipping-preview-price,
html[data-theme="dark"] .shipping-box-measures span{
  background:#16233a!important;
  color:#cfe0ff!important;
  border-color:#31537f!important;
}

/* Cajas, movimientos y sucursales */
html[data-theme="dark"] .movement-row,
html[data-theme="dark"] .movement-row:hover,
html[data-theme="dark"] .movement-list,
html[data-theme="dark"] .sync-details,
html[data-theme="dark"] .branch-card,
html[data-theme="dark"] .branch-card.selected,
html[data-theme="dark"] #weeklyMetricsBox,
html[data-theme="dark"] #branchMetricsBox,
html[data-theme="dark"] #branchTopProductsBox,
html[data-theme="dark"] .branch-metric-card,
html[data-theme="dark"] .branch-top-card,
html[data-theme="dark"] .branch-inventory-card,
html[data-theme="dark"] .branch-info-card,
html[data-theme="dark"] .branch-activity-card,
html[data-theme="dark"] .branch-location-card,
html[data-theme="dark"] .branch-description-card,
html[data-theme="dark"] .metric-row,
html[data-theme="dark"] .weekly-row,
html[data-theme="dark"] .weekly-card{
  background:#111a2b!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .movement-type,
html[data-theme="dark"] .branch-card .badge,
html[data-theme="dark"] .sync-details summary{
  background:#16233a!important;
  color:#8ab4ff!important;
  border-color:#31537f!important;
}
html[data-theme="dark"] .movement-row small,
html[data-theme="dark"] .branch-card small,
html[data-theme="dark"] .sync-details small,
html[data-theme="dark"] #weeklyMetricsBox small,
html[data-theme="dark"] #branchMetricsBox small,
html[data-theme="dark"] #branchTopProductsBox small{color:#a8b7d2!important}
html[data-theme="dark"] .branch-card .progress,
html[data-theme="dark"] .branch-card progress{accent-color:#3b82f6!important}

/* RFC / productos / altas / catálogos */
html[data-theme="dark"] .billing-form,
html[data-theme="dark"] .products-head,
html[data-theme="dark"] .products-head > div,
html[data-theme="dark"] .products-head > section,
html[data-theme="dark"] .products-head > article,
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .page-controls,
html[data-theme="dark"] .bulkbar,
html[data-theme="dark"] .catalog-form,
html[data-theme="dark"] .catalog-side,
html[data-theme="dark"] .rules-box,
html[data-theme="dark"] .rules-list,
html[data-theme="dark"] .products-table-wrap,
html[data-theme="dark"] .inventory-table-wrap,
html[data-theme="dark"] .add-product-layout,
html[data-theme="dark"] .variation-form,
html[data-theme="dark"] .gallery-panel,
html[data-theme="dark"] .section-preview,
html[data-theme="dark"] .account-preview-wrap,
html[data-theme="dark"] .order-share-preview .preview-pane,
html[data-theme="dark"] .account-inline-preview img{
  background:#111a2b!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .section-preview,
html[data-theme="dark"] .account-preview-wrap,
html[data-theme="dark"] .order-share-preview .preview-pane{background:#16233a!important}
html[data-theme="dark"] .empty-preview{color:#a8b7d2!important}

/* Inputs file / selects puntuales que suelen venir con estilo del navegador */
html[data-theme="dark"] input[type="file"],
html[data-theme="dark"] ::file-selector-button{
  background:#0f172a!important;
  color:#f3f7ff!important;
  border-color:#263650!important;
}
html[data-theme="dark"] ::file-selector-button{
  border:1px solid #263650!important;
  border-radius:10px!important;
  margin-right:10px!important;
}

/* Fallback agresivo para tarjetas claras de listas dinámicas */
html[data-theme="dark"] :where(.shipping-box-card,.movement-row,.branch-card,.shipping-preview-card,.products-head,.pagination,.page-controls,.cart-summary,#cartBox,.sync-details,.section-preview)[style*="#f"],
html[data-theme="dark"] :where(.shipping-box-card,.movement-row,.branch-card,.shipping-preview-card,.products-head,.pagination,.page-controls,.cart-summary,#cartBox,.sync-details,.section-preview)[style*="white"]{
  background:#111a2b!important;
  background-image:none!important;
  color:#f3f7ff!important;
  border-color:#263650!important;
}

/* ===== V356 DARK MODE PATCH SAFE: sin mover empaquetado ===== */
/* POS / carrito */
html[data-theme="dark"] #cartInfoBox,
html[data-theme="dark"] #cartInfoBox > *,
html[data-theme="dark"] #cartBox,
html[data-theme="dark"] #cartBox > *,
html[data-theme="dark"] .cart-summary,
html[data-theme="dark"] .cart-summary > *,
html[data-theme="dark"] .cart-history-note,
html[data-theme="dark"] .master-key-strip,
html[data-theme="dark"] .master-key-strip.active,
html[data-theme="dark"] #masterKeyControls,
html[data-theme="dark"] .cart-client-box,
html[data-theme="dark"] .client-summary-box,
html[data-theme="dark"] .totals-box,
html[data-theme="dark"] .payment-box,
html[data-theme="dark"] .discount-box{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] #cartInfoBox *,
html[data-theme="dark"] #cartBox *,
html[data-theme="dark"] .cart-summary *,
html[data-theme="dark"] .master-key-strip *{color:inherit!important}
html[data-theme="dark"] .master-key-strip .muted,
html[data-theme="dark"] .cart-history-note small{color:#a8b7d2!important}

/* Sucursales */
html[data-theme="dark"] .branch-card,
html[data-theme="dark"] .branch-card.selected,
html[data-theme="dark"] .branch-detail,
html[data-theme="dark"] .branch-description-card,
html[data-theme="dark"] .branch-location-card,
html[data-theme="dark"] .branch-activity-card,
html[data-theme="dark"] .branch-info-card,
html[data-theme="dark"] .branch-inventory-card,
html[data-theme="dark"] .metric-row,
html[data-theme="dark"] .weekly-row,
html[data-theme="dark"] .sync-details,
html[data-theme="dark"] .sync-details > summary,
html[data-theme="dark"] .sync-details > div,
html[data-theme="dark"] .sync-details .table-wrap,
html[data-theme="dark"] .sync-details table{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .branch-card *,
html[data-theme="dark"] .branch-detail *,
html[data-theme="dark"] .sync-details *{color:inherit!important}
html[data-theme="dark"] .branch-card small,
html[data-theme="dark"] .sync-details small{color:#a8b7d2!important}
html[data-theme="dark"] .branch-card .badge,
html[data-theme="dark"] .sync-details summary{background:#16233a!important;color:#8ab4ff!important;border-color:#31537f!important}

/* Productos, paginación y acciones masivas */
html[data-theme="dark"] .products-head,
html[data-theme="dark"] .products-head > *,
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .page-controls,
html[data-theme="dark"] .bulk-selection-summary,
html[data-theme="dark"] .bulk-branch-picker-card,
html[data-theme="dark"] .bulk-branch-picker-head,
html[data-theme="dark"] .bulk-branch-picker-list,
html[data-theme="dark"] .bulk-branch-row,
html[data-theme="dark"] .bulk-branch-row.selected,
html[data-theme="dark"] #bulkPreview,
html[data-theme="dark"] .bulk-preview-table,
html[data-theme="dark"] .bulk-preview-table tr,
html[data-theme="dark"] .bulk-preview-table td,
html[data-theme="dark"] .bulk-preview-table th{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .products-head *,
html[data-theme="dark"] .pagination *,
html[data-theme="dark"] .bulk-selection-summary *,
html[data-theme="dark"] .bulk-branch-picker-card *{color:inherit!important}

/* Catálogos y árbol */
html[data-theme="dark"] .category-tree-card,
html[data-theme="dark"] .category-tree-card > summary,
html[data-theme="dark"] .tree-node,
html[data-theme="dark"] .tree-node > summary,
html[data-theme="dark"] .tree-tags,
html[data-theme="dark"] #catalogTree,
html[data-theme="dark"] #catalogTree > *{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .tree-tags span{background:#16233a!important;border:1px solid #31537f!important;color:#a8b7d2!important}

/* Shopify sync */
html[data-theme="dark"] .shopify-category-grid,
html[data-theme="dark"] .field.shopify-category-controls,
html[data-theme="dark"] #shopifyStatus,
html[data-theme="dark"] #shopifyOrderResult,
html[data-theme="dark"] #shopifyFilterHint,
html[data-theme="dark"] #shopifySyncStatus,
html[data-theme="dark"] #shopifySyncRunHistory,
html[data-theme="dark"] .shopify-progress,
html[data-theme="dark"] .shopify-error-history,
html[data-theme="dark"] .actions-row.shopify-stop-row{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .shopify-category-grid *,
html[data-theme="dark"] #shopifyStatus *,
html[data-theme="dark"] #shopifyOrderResult *{color:inherit!important}

/* Fábrica: dashboard, pedidos, inventario, tarjetas */
html[data-theme="dark"] .factory-chart-card,
html[data-theme="dark"] .goal-grid,
html[data-theme="dark"] .goal-main,
html[data-theme="dark"] .kpi-side-main,
html[data-theme="dark"] .api-health-grid,
html[data-theme="dark"] .api-health-grid span,
html[data-theme="dark"] .summary-bars,
html[data-theme="dark"] .summary-bar,
html[data-theme="dark"] .overview-chip,
html[data-theme="dark"] .rank-row,
html[data-theme="dark"] .factory-order-card,
html[data-theme="dark"] .ay-order-summary,
html[data-theme="dark"] .order-expanded,
html[data-theme="dark"] .ay-apartado-card,
html[data-theme="dark"] .factory-section-card,
html[data-theme="dark"] .section-edit-card,
html[data-theme="dark"] .factory-order-card .order-actions,
html[data-theme="dark"] .inventory-process-card,
html[data-theme="dark"] .inventory-process-head,
html[data-theme="dark"] .inventory-area-strip,
html[data-theme="dark"] .inventory-area-box,
html[data-theme="dark"] .process-stock-grid,
html[data-theme="dark"] .stock-badge{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .factory-order-card *,
html[data-theme="dark"] .ay-apartado-card *,
html[data-theme="dark"] .factory-section-card *,
html[data-theme="dark"] .inventory-process-card *{border-color:#263650!important}
html[data-theme="dark"] .factory-order-card small,
html[data-theme="dark"] .ay-apartado-card small,
html[data-theme="dark"] .inventory-process-card small{color:#a8b7d2!important}

/* Teléfono */
html[data-theme="dark"] .phone-card,
html[data-theme="dark"] .phone-action,
html[data-theme="dark"] .phone-row,
html[data-theme="dark"] .phone-list,
html[data-theme="dark"] .phone-bottom,
html[data-theme="dark"] .phone-bottom a,
html[data-theme="dark"] .phone-search-results,
html[data-theme="dark"] .phone-search-row,
html[data-theme="dark"] .phone-order-card,
html[data-theme="dark"] .phone-product-card,
html[data-theme="dark"] .phone-client-card{
  background:#111a2b!important;
  background-image:none!important;
  border-color:#263650!important;
  color:#f3f7ff!important;
}
html[data-theme="dark"] .phone-card *,
html[data-theme="dark"] .phone-action *,
html[data-theme="dark"] .phone-row *{color:inherit!important}
html[data-theme="dark"] .phone-card small,
html[data-theme="dark"] .phone-row small{color:#a8b7d2!important}

/* Fallback seguro para elementos claros con estilo inline en pantallas conocidas */
html[data-theme="dark"] :where(#cartBox,#cartInfoBox,.branch-card,.branch-detail,.products-head,.pagination,.bulk-selection-summary,.category-tree-card,.tree-node,.shopify-category-grid,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="#f"],
html[data-theme="dark"] :where(#cartBox,#cartInfoBox,.branch-card,.branch-detail,.products-head,.pagination,.bulk-selection-summary,.category-tree-card,.tree-node,.shopify-category-grid,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="white"],
html[data-theme="dark"] :where(#cartBox,#cartInfoBox,.branch-card,.branch-detail,.products-head,.pagination,.bulk-selection-summary,.category-tree-card,.tree-node,.shopify-category-grid,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="rgb(255"]{
  background:#111a2b!important;
  background-image:none!important;
  color:#f3f7ff!important;
  border-color:#263650!important;
}

/* ===== V358 DARK MODE ONLY CSS: remate consciente sin tocar JS/backend/raíz ===== */
html[data-theme="dark"]{
  --dm-bg:#0b1220;
  --dm-card:#111a2b;
  --dm-card2:#16233a;
  --dm-input:#0f172a;
  --dm-line:#263650;
  --dm-text:#f3f7ff;
  --dm-muted:#a8b7d2;
}

/* Base de lectura para módulos oscuros */
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .clean-form,
html[data-theme="dark"] .intuitive-form,
html[data-theme="dark"] .doc-grid,
html[data-theme="dark"] .qr-form-grid{
  background:var(--dm-card)!important;
  background-image:none!important;
  border-color:var(--dm-line)!important;
  color:var(--dm-text)!important;
}
html[data-theme="dark"] .card small,
html[data-theme="dark"] .panel small,
html[data-theme="dark"] .muted{color:var(--dm-muted)!important}

/* Selectores, inputs y botones internos que heredaban blanco */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .smart-select-wrap,
html[data-theme="dark"] .smart-select-button,
html[data-theme="dark"] .smart-select-panel,
html[data-theme="dark"] .smart-option,
html[data-theme="dark"] .smart-select-search,
html[data-theme="dark"] .customer-combobox,
html[data-theme="dark"] .customer-combobox input,
html[data-theme="dark"] .customer-combobox .customer-dropdown,
html[data-theme="dark"] .customer-option,
html[data-theme="dark"] .select-pro,
html[data-theme="dark"] .select-helper{
  background:var(--dm-input)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7f8faa!important}
html[data-theme="dark"] .smart-option:hover,
html[data-theme="dark"] .smart-option.active,
html[data-theme="dark"] .customer-option:hover{background:var(--dm-card2)!important;color:#fff!important}

/* POS: scanner/cámara, carrito y cajas que todavía quedaban claras */
html[data-theme="dark"] .qr-quick,
html[data-theme="dark"] .qr-panel,
html[data-theme="dark"] .qr-panel.compact,
html[data-theme="dark"] .camera-box,
html[data-theme="dark"] .scan-result,
html[data-theme="dark"] .scan-result-card,
html[data-theme="dark"] .order-add-scanner,
html[data-theme="dark"] .order-add-left,
html[data-theme="dark"] .order-add-cart-panel,
html[data-theme="dark"] .order-add-cart-panel > *,
html[data-theme="dark"] .order-add-cart-list,
html[data-theme="dark"] .cart-summary,
html[data-theme="dark"] .cart-summary > *,
html[data-theme="dark"] #cartBox,
html[data-theme="dark"] #cartBox > *,
html[data-theme="dark"] #cartInfoBox,
html[data-theme="dark"] #cartInfoBox > *,
html[data-theme="dark"] .cart-history-note,
html[data-theme="dark"] .master-key-strip,
html[data-theme="dark"] .master-key-strip.active,
html[data-theme="dark"] .cart-item-card,
html[data-theme="dark"] .cart-item-list,
html[data-theme="dark"] .client-summary-box,
html[data-theme="dark"] .cart-client-box,
html[data-theme="dark"] .payment-box,
html[data-theme="dark"] .discount-box,
html[data-theme="dark"] .totals-box{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .qr-panel.compact{border-style:dashed!important}
html[data-theme="dark"] .camera-box video{background:#020617!important}
html[data-theme="dark"] #cartBox *,
html[data-theme="dark"] #cartInfoBox *,
html[data-theme="dark"] .cart-summary *,
html[data-theme="dark"] .master-key-strip *{color:inherit!important}
html[data-theme="dark"] .cart-history-note small{color:var(--dm-muted)!important}

/* Pedidos: selección masiva, cards y filas Shopify */
html[data-theme="dark"] .order-bulk-toolbar,
html[data-theme="dark"] .order-bulk-toolbar > *,
html[data-theme="dark"] .order-select-wrap,
html[data-theme="dark"] .order-bulk-check,
html[data-theme="dark"] .orders-list,
html[data-theme="dark"] .orders-list .order-card,
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .order-card summary,
html[data-theme="dark"] .order-card[open] summary,
html[data-theme="dark"] .order-card h3,
html[data-theme="dark"] .order-detail-grid,
html[data-theme="dark"] .detail-box,
html[data-theme="dark"] .doc-actions,
html[data-theme="dark"] .doc-actions > *,
html[data-theme="dark"] .order-actions,
html[data-theme="dark"] .order-actions > *,
html[data-theme="dark"] .steps-list,
html[data-theme="dark"] .step-chip,
html[data-theme="dark"] .order-card .table-wrap,
html[data-theme="dark"] .orders-summary-kpis,
html[data-theme="dark"] .shopify-project-only-wrap{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .order-card summary *,
html[data-theme="dark"] .order-bulk-toolbar *{color:inherit!important}
html[data-theme="dark"] .order-card summary small,
html[data-theme="dark"] .step-chip small{color:var(--dm-muted)!important}
html[data-theme="dark"] .order-bulk-toolbar select{background:var(--dm-input)!important;color:var(--dm-text)!important;border-color:var(--dm-line)!important}

/* Productos: paginación y barra de acciones */
html[data-theme="dark"] .products-head-compact,
html[data-theme="dark"] .products-head-compact > *,
html[data-theme="dark"] .products-top-tools,
html[data-theme="dark"] .product-shopify-bulk-actions,
html[data-theme="dark"] .pagination-bar,
html[data-theme="dark"] .pagination-info,
html[data-theme="dark"] .pagination-buttons,
html[data-theme="dark"] #productPagination,
html[data-theme="dark"] .page-controls,
html[data-theme="dark"] .pagination{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .pagination-bar *,
html[data-theme="dark"] .products-top-tools *{color:inherit!important}

/* Shopify Sync: bloque blanco grande de cantidad/categorías */
html[data-theme="dark"] #shopifySync .clean-form,
html[data-theme="dark"] #shopifySync .clean-form > *,
html[data-theme="dark"] #shopifySync .field,
html[data-theme="dark"] #shopifySync .field > *,
html[data-theme="dark"] #shopifySync .shopify-category-controls,
html[data-theme="dark"] #shopifySync .shopify-category-grid,
html[data-theme="dark"] #shopifySync .shopify-category-grid > *,
html[data-theme="dark"] #shopifyStatus,
html[data-theme="dark"] #shopifyStatusBox,
html[data-theme="dark"] #shopifyOrderResult,
html[data-theme="dark"] #shopifyFilterHint,
html[data-theme="dark"] #shopifySyncStatus,
html[data-theme="dark"] #shopifySyncRunHistory,
html[data-theme="dark"] .shopify-progress,
html[data-theme="dark"] .shopify-error-history,
html[data-theme="dark"] .actions-row.shopify-stop-row{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #shopifySync .muted,
html[data-theme="dark"] #shopifySync small{color:var(--dm-muted)!important}

/* Sucursales: cards con gradiente blanco */
html[data-theme="dark"] .branch-list,
html[data-theme="dark"] .branch-list .order-card,
html[data-theme="dark"] .branch-list .order-card summary,
html[data-theme="dark"] .branch-list .order-card > *,
html[data-theme="dark"] .branch-card,
html[data-theme="dark"] .branch-card.selected,
html[data-theme="dark"] .branch-card summary,
html[data-theme="dark"] .branch-card header,
html[data-theme="dark"] .branch-header,
html[data-theme="dark"] .branch-detail,
html[data-theme="dark"] .branch-detail > *,
html[data-theme="dark"] .branch-description-card,
html[data-theme="dark"] .branch-location-card,
html[data-theme="dark"] .branch-activity-card,
html[data-theme="dark"] .branch-info-card,
html[data-theme="dark"] .branch-inventory-card,
html[data-theme="dark"] .metric-row,
html[data-theme="dark"] .weekly-row,
html[data-theme="dark"] .weekly-card,
html[data-theme="dark"] .sync-details,
html[data-theme="dark"] .sync-details > summary,
html[data-theme="dark"] .sync-details > div{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .branch-card *,
html[data-theme="dark"] .branch-detail *{color:inherit!important}
html[data-theme="dark"] .branch-card small,
html[data-theme="dark"] .sync-details small{color:var(--dm-muted)!important}

/* Catálogos / árbol */
html[data-theme="dark"] .category-tree-card,
html[data-theme="dark"] .category-tree-card > *,
html[data-theme="dark"] .tree-node,
html[data-theme="dark"] .tree-node > *,
html[data-theme="dark"] .tree-tags,
html[data-theme="dark"] .tree-tags > *,
html[data-theme="dark"] #catalogTree,
html[data-theme="dark"] #catalogTree > *{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}

/* Fábrica dashboard: KPIs, resumen semanal, API, accesos rápidos */
html[data-theme="dark"] .factory-summary .factory-chart-card,
html[data-theme="dark"] .factory-chart-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .kpi-card > *,
html[data-theme="dark"] .goal-grid,
html[data-theme="dark"] .goal-grid > *,
html[data-theme="dark"] .goal-main,
html[data-theme="dark"] .kpi-side-main,
html[data-theme="dark"] .kpi-side-copy,
html[data-theme="dark"] .api-health-grid,
html[data-theme="dark"] .api-health-grid > *,
html[data-theme="dark"] .summary-bars,
html[data-theme="dark"] .summary-bars > *,
html[data-theme="dark"] .summary-bar,
html[data-theme="dark"] .overview-chip,
html[data-theme="dark"] .rank-row,
html[data-theme="dark"] .dashboard-list-block,
html[data-theme="dark"] .factory-quick-link,
html[data-theme="dark"] .quick-link,
html[data-theme="dark"] .factory-summary a.card{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .factory-chart-card *,
html[data-theme="dark"] .kpi-card *,
html[data-theme="dark"] .quick-link *{color:inherit!important}
html[data-theme="dark"] .factory-chart-card small,
html[data-theme="dark"] .quick-link small{color:var(--dm-muted)!important}

/* Fábrica pedidos / apartados / nuevo pedido */
html[data-theme="dark"] .factory-order-card,
html[data-theme="dark"] .factory-order-card > summary,
html[data-theme="dark"] .factory-order-card > *,
html[data-theme="dark"] .ay-order-summary,
html[data-theme="dark"] .order-copy,
html[data-theme="dark"] .summary-tags,
html[data-theme="dark"] .order-expanded,
html[data-theme="dark"] .ay-order-general,
html[data-theme="dark"] .ay-order-fields,
html[data-theme="dark"] .editor-panel,
html[data-theme="dark"] .finish-box,
html[data-theme="dark"] .order-thumb,
html[data-theme="dark"] .ay-apartado-card,
html[data-theme="dark"] .ay-apartado-card > *,
html[data-theme="dark"] .ay-apartado-top,
html[data-theme="dark"] .ay-apartado-main,
html[data-theme="dark"] .ay-design-image,
html[data-theme="dark"] .ay-design-info,
html[data-theme="dark"] .factory-steps-list,
html[data-theme="dark"] .factory-thread-rich-row,
html[data-theme="dark"] .note-box,
html[data-theme="dark"] .download-box,
html[data-theme="dark"] .section-edit-card,
html[data-theme="dark"] .factory-section-card,
html[data-theme="dark"] .upload-card{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .factory-order-card *,
html[data-theme="dark"] .ay-apartado-card *,
html[data-theme="dark"] .factory-section-card *{border-color:var(--dm-line)!important}
html[data-theme="dark"] .factory-order-card small,
html[data-theme="dark"] .ay-apartado-card small,
html[data-theme="dark"] .factory-section-card small{color:var(--dm-muted)!important}

/* Fábrica inventario: quita pastel/blancos de cajas de proceso */
html[data-theme="dark"] .inventory-process-card,
html[data-theme="dark"] .inventory-process-card > *,
html[data-theme="dark"] .inventory-process-head,
html[data-theme="dark"] .inventory-area-strip,
html[data-theme="dark"] .inventory-area-box,
html[data-theme="dark"] .inventory-area-box > *,
html[data-theme="dark"] .process-stock-grid,
html[data-theme="dark"] .process-stock-grid > *,
html[data-theme="dark"] .stock-badge,
html[data-theme="dark"] .inventory-swatch-large{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .inventory-area-box small,
html[data-theme="dark"] .inventory-process-card small{color:var(--dm-muted)!important}

/* Dashboard móvil / teléfono */
html[data-theme="dark"] .phone-main,
html[data-theme="dark"] .phone-dashboard-main,
html[data-theme="dark"] .phone-card,
html[data-theme="dark"] .phone-card > *,
html[data-theme="dark"] .phone-action,
html[data-theme="dark"] .phone-action > *,
html[data-theme="dark"] .phone-row,
html[data-theme="dark"] .phone-row > *,
html[data-theme="dark"] .phone-list,
html[data-theme="dark"] .phone-bottom,
html[data-theme="dark"] .phone-bottom a,
html[data-theme="dark"] .phone-search-results,
html[data-theme="dark"] .phone-search-row,
html[data-theme="dark"] .phone-order-card,
html[data-theme="dark"] .phone-product-card,
html[data-theme="dark"] .phone-client-card,
html[data-theme="dark"] .phone-soft-panel,
html[data-theme="dark"] .phone-kv,
html[data-theme="dark"] .phone-cart-item{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .phone-main small,
html[data-theme="dark"] .phone-dashboard-main small{color:var(--dm-muted)!important}

/* Último fallback controlado: solo dentro de componentes detectados, no toca lógica ni estructura */
html[data-theme="dark"] :where(.order-card,.order-bulk-toolbar,.pagination-bar,.products-head-compact,.shopify-category-grid,.qr-panel,.camera-box,.branch-card,.factory-chart-card,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="background"],
html[data-theme="dark"] :where(.order-card,.order-bulk-toolbar,.pagination-bar,.products-head-compact,.shopify-category-grid,.qr-panel,.camera-box,.branch-card,.factory-chart-card,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="white"],
html[data-theme="dark"] :where(.order-card,.order-bulk-toolbar,.pagination-bar,.products-head-compact,.shopify-category-grid,.qr-panel,.camera-box,.branch-card,.factory-chart-card,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="#fff"],
html[data-theme="dark"] :where(.order-card,.order-bulk-toolbar,.pagination-bar,.products-head-compact,.shopify-category-grid,.qr-panel,.camera-box,.branch-card,.factory-chart-card,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="#f8"],
html[data-theme="dark"] :where(.order-card,.order-bulk-toolbar,.pagination-bar,.products-head-compact,.shopify-category-grid,.qr-panel,.camera-box,.branch-card,.factory-chart-card,.factory-order-card,.ay-apartado-card,.factory-section-card,.inventory-process-card,.phone-card,.phone-action,.phone-row)[style*="rgb(255"]{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}

/* ===== V359 DARK MODE REMATE FINAL: 3 blancos detectados ===== */
html[data-theme="dark"]{
  --dm-bg:#0b1220;
  --dm-card:#111a2b;
  --dm-card2:#16233a;
  --dm-input:#0f172a;
  --dm-line:#263650;
  --dm-text:#f3f7ff;
  --dm-muted:#a8b7d2;
}

/* 1) Shopify Sync: contenedor avanzado de cantidad/categorías */
html[data-theme="dark"] #shopifySync #shopifyAdvancedControls,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .field,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .shopify-category-controls,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .shopify-category-grid,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .shopify-stop-row,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .actions-row,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls label,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls small,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls div:not(.smart-status-dot):not(.swatch):not(.dot){
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #shopifySync .shopify-advanced-controls select,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls input:not([type="checkbox"]),
html[data-theme="dark"] #shopifySync .shopify-advanced-controls textarea,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-wrap,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-button,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-panel,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-option,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-search{
  background:var(--dm-input)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #shopifySync .shopify-advanced-controls *::before,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls *::after{border-color:var(--dm-line)!important}
html[data-theme="dark"] #shopifySync .shopify-advanced-controls small,
html[data-theme="dark"] #shopifySync #shopifyFilterHint{color:var(--dm-muted)!important}

/* 2) Pedidos: toolbar/selección masiva sin fondos claros en textos y select */
html[data-theme="dark"] .order-bulk-toolbar,
html[data-theme="dark"] .order-bulk-toolbar label,
html[data-theme="dark"] .order-bulk-toolbar b,
html[data-theme="dark"] .order-bulk-toolbar .order-bulk-check,
html[data-theme="dark"] .order-bulk-toolbar .order-select-wrap,
html[data-theme="dark"] .order-bulk-toolbar > :not(.btn),
html[data-theme="dark"] .order-bulk-toolbar .smart-select-wrap,
html[data-theme="dark"] .order-bulk-toolbar .smart-select-button,
html[data-theme="dark"] .order-bulk-toolbar .smart-select-panel,
html[data-theme="dark"] .order-bulk-toolbar .smart-option{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .order-bulk-toolbar select,
html[data-theme="dark"] .order-bulk-toolbar input:not([type="checkbox"]){
  background:var(--dm-input)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] .order-bulk-toolbar input[type="checkbox"],
html[data-theme="dark"] .order-card input[type="checkbox"]{
  background:var(--dm-input)!important;
  border-color:var(--dm-line)!important;
  accent-color:#2f6df6!important;
}

/* 3) Agregar producto: preview/helper de color que quedaba blanco */
html[data-theme="dark"] .color-preview,
html[data-theme="dark"] #productColorPreview,
html[data-theme="dark"] .select-helper,
html[data-theme="dark"] .select-helper .dot,
html[data-theme="dark"] .select-helper .mini-logo,
html[data-theme="dark"] #productForm .variation-form,
html[data-theme="dark"] #productForm .variation-form .field,
html[data-theme="dark"] #productForm .table-wrap,
html[data-theme="dark"] #existingVariations{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #productForm input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] #productForm textarea,
html[data-theme="dark"] #productForm select,
html[data-theme="dark"] #productForm .smart-select-button,
html[data-theme="dark"] #productForm .smart-select-panel,
html[data-theme="dark"] #productForm .smart-option,
html[data-theme="dark"] #productForm .smart-select-search{
  background:var(--dm-input)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #productForm .muted,
html[data-theme="dark"] #productForm small,
html[data-theme="dark"] #existingVariations.muted{color:var(--dm-muted)!important}

/* Remate seguro para elementos con style inline blanco dentro de esos 3 módulos */
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="background"],
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="white"],
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="#fff"],
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="#f7"],
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="#f8"],
html[data-theme="dark"] :where(#shopifySync,#productForm,.order-bulk-toolbar) :where(div,label,section,article,small,span,p)[style*="rgb(255"]{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}

/* ===== V360 DARK MODE REMATE CSS ONLY: usuarios, stats, fabrica, telefono ===== */
html[data-theme="dark"]{
  --dm-bg:#07101d;
  --dm-bg2:#0b1220;
  --dm-card:#111a2b;
  --dm-card2:#16233a;
  --dm-input:#0f172a;
  --dm-line:#263650;
  --dm-text:#f5f8ff;
  --dm-muted:#aab8d0;
  --dm-soft:#1a2941;
}

/* Texto legible en cards de pedidos: evita badges/valores lavados */
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .order-card summary,
html[data-theme="dark"] .order-card summary *,
html[data-theme="dark"] .order-card .order-copy,
html[data-theme="dark"] .order-card .order-copy *,
html[data-theme="dark"] .order-card .summary-tags,
html[data-theme="dark"] .order-card .summary-tags *,
html[data-theme="dark"] .order-card .open-hint,
html[data-theme="dark"] .order-card .order-total,
html[data-theme="dark"] .order-card .order-balance,
html[data-theme="dark"] .order-card .order-date,
html[data-theme="dark"] .order-card .order-customer{
  color:var(--dm-text)!important;
  text-shadow:none!important;
}
html[data-theme="dark"] .order-card summary small,
html[data-theme="dark"] .order-card small,
html[data-theme="dark"] .order-copy small{
  color:var(--dm-muted)!important;
}
html[data-theme="dark"] .order-card .payment-badge,
html[data-theme="dark"] .order-card .status-badge,
html[data-theme="dark"] .order-card .status-select,
html[data-theme="dark"] .order-card .pill,
html[data-theme="dark"] .order-card .badge{
  color:#f8fbff!important;
  text-shadow:none!important;
}
html[data-theme="dark"] .order-card .payment-badge.pay-paid,
html[data-theme="dark"] .order-card .pay-paid,
html[data-theme="dark"] .order-card .balance-clear{
  background:#14532d!important;
  color:#dcfce7!important;
  border-color:#22c55e!important;
}
html[data-theme="dark"] .order-card .pay-unpaid,
html[data-theme="dark"] .order-card .balance-due{
  background:#7f1d1d!important;
  color:#fecaca!important;
  border-color:#ef4444!important;
}

/* Acciones masivas: caja superior que seguía gris/blanca */
html[data-theme="dark"] #bulk .bulk-category-move-box,
html[data-theme="dark"] #bulk .bulk-category-move-box > *,
html[data-theme="dark"] #bulk .bulk-selection-summary,
html[data-theme="dark"] #bulk .bulk-preview-table,
html[data-theme="dark"] #bulk .bulk-preview-table *{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #bulk .bulk-selection-summary,
html[data-theme="dark"] #bulk .bulk-category-move-box p,
html[data-theme="dark"] #bulk .bulk-category-move-box small{color:var(--dm-muted)!important}

/* Shopify Sync: panel de cantidad/categorías sin blanco exterior */
html[data-theme="dark"] #shopifySync .shopify-advanced-controls,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls > *,
html[data-theme="dark"] #shopifySync .shopify-category-grid,
html[data-theme="dark"] #shopifySync .shopify-category-grid > *,
html[data-theme="dark"] #shopifySync .shopify-stop-row,
html[data-theme="dark"] #shopifySync .shopify-stop-row > *,
html[data-theme="dark"] #shopifySync .field.shopify-category-controls,
html[data-theme="dark"] #shopifySync .field.shopify-category-controls > *{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-button,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-select-panel,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls .smart-option,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls select,
html[data-theme="dark"] #shopifySync .shopify-advanced-controls input:not([type="checkbox"]){
  background:var(--dm-input)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}

/* Home administrador: laterales blancos y paneles claros */
html[data-theme="dark"] body.home-admin-body,
html[data-theme="dark"] .home-admin-shell,
html[data-theme="dark"] .home-admin-main{
  background:var(--dm-bg)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
}
html[data-theme="dark"] .home-admin-sidebar,
html[data-theme="dark"] .home-admin-brand,
html[data-theme="dark"] .home-admin-nav a,
html[data-theme="dark"] .home-admin-tip,
html[data-theme="dark"] .home-admin-active,
html[data-theme="dark"] .home-admin-card,
html[data-theme="dark"] .home-user-card,
html[data-theme="dark"] .home-email-row,
html[data-theme="dark"] .permission-check,
html[data-theme="dark"] .users-list-card,
html[data-theme="dark"] .email-history-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .permission-card{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .home-admin-brand img,
html[data-theme="dark"] .home-user-avatar,
html[data-theme="dark"] .home-admin-hero:after{
  background:var(--dm-card2)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] .home-admin-brand p,
html[data-theme="dark"] .home-admin-tip span,
html[data-theme="dark"] .home-user-maininfo small,
html[data-theme="dark"] .home-admin-card small,
html[data-theme="dark"] .permission-check small{
  color:var(--dm-muted)!important;
}
html[data-theme="dark"] .home-admin-nav a:hover,
html[data-theme="dark"] .home-admin-nav a.active{
  background:var(--dm-card2)!important;
  color:#fff!important;
}

/* Estadísticas generales: fondo blanco del panel y grises exteriores */
html[data-theme="dark"] body.prehome.stats-page{
  background:var(--dm-bg)!important;
  background-image:radial-gradient(circle at 15% 0%,rgba(47,109,246,.18),transparent 32%),linear-gradient(180deg,var(--dm-bg) 0%,var(--dm-bg2) 100%)!important;
  color:var(--dm-text)!important;
}
html[data-theme="dark"] .stats-shell,
html[data-theme="dark"] .stats-panel,
html[data-theme="dark"] .home-general-stats-card,
html[data-theme="dark"] .hgs-hero,
html[data-theme="dark"] .hgs-body,
html[data-theme="dark"] .hgs-filters,
html[data-theme="dark"] .hgs-kpis,
html[data-theme="dark"] .hgs-grid,
html[data-theme="dark"] .hgs-panel,
html[data-theme="dark"] .hgs-kpi,
html[data-theme="dark"] .hgs-point-chart,
html[data-theme="dark"] .hgs-point-detail-card,
html[data-theme="dark"] .hgs-detail-row,
html[data-theme="dark"] .hgs-client,
html[data-theme="dark"] .hgs-client-orders,
html[data-theme="dark"] .audit-doc,
html[data-theme="dark"] .audit-toolbar,
html[data-theme="dark"] .audit-cover{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .stats-back,
html[data-theme="dark"] .hgs-periods button,
html[data-theme="dark"] .hgs-check{
  background:var(--dm-card2)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] .hgs-filters input,
html[data-theme="dark"] .hgs-filters select{
  background:var(--dm-input)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] .hgs-panel p,
html[data-theme="dark"] .hgs-panel small,
html[data-theme="dark"] .hgs-kpi small,
html[data-theme="dark"] .hgs-detail-row small,
html[data-theme="dark"] .hgs-client small{
  color:var(--dm-muted)!important;
}
html[data-theme="dark"] .hgs-point-grid{stroke:#2a3850!important}
html[data-theme="dark"] .hgs-point-y,
html[data-theme="dark"] .hgs-point-label{fill:var(--dm-muted)!important;color:var(--dm-muted)!important}

/* Pedidos de fábrica: KPIs, accesos rápidos, meta y API */
html[data-theme="dark"] .factory-chart-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .kpi-status,
html[data-theme="dark"] .kpi-summary,
html[data-theme="dark"] .kpi-goal,
html[data-theme="dark"] .kpi-api,
html[data-theme="dark"] .goal-grid,
html[data-theme="dark"] .goal-main,
html[data-theme="dark"] .goal-side-main,
html[data-theme="dark"] .api-side-main,
html[data-theme="dark"] .kpi-side-main,
html[data-theme="dark"] .kpi-side-copy,
html[data-theme="dark"] .api-health-grid,
html[data-theme="dark"] .api-health-grid > *,
html[data-theme="dark"] .summary-bars,
html[data-theme="dark"] .summary-bar,
html[data-theme="dark"] .factory-quick-link,
html[data-theme="dark"] .quick-link,
html[data-theme="dark"] .factory-summary .btn.soft,
html[data-theme="dark"] .factory-summary .mini-btn{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .goal-ring,
html[data-theme="dark"] .goal-track{
  background:var(--dm-card2)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] .factory-summary .quick-link:hover,
html[data-theme="dark"] .factory-quick-link:hover{
  background:var(--dm-card2)!important;
}

/* Nuevo pedido / en proceso / terminados: campos y detalles blancos */
html[data-theme="dark"] .factory-order-card,
html[data-theme="dark"] .factory-order-card > *,
html[data-theme="dark"] .factory-order-card summary,
html[data-theme="dark"] .ay-order-summary,
html[data-theme="dark"] .order-expanded,
html[data-theme="dark"] .ay-order-general,
html[data-theme="dark"] .ay-order-fields,
html[data-theme="dark"] .ay-order-fields > *,
html[data-theme="dark"] .read-only-info,
html[data-theme="dark"] .ay-cap-image,
html[data-theme="dark"] .ay-design-info,
html[data-theme="dark"] .ay-design-info > *,
html[data-theme="dark"] .ay-notes-download,
html[data-theme="dark"] .note-box,
html[data-theme="dark"] .download-box,
html[data-theme="dark"] .factory-section-card,
html[data-theme="dark"] .factory-section-card > *,
html[data-theme="dark"] .section-preview,
html[data-theme="dark"] .factory-upload-grid,
html[data-theme="dark"] .upload-card,
html[data-theme="dark"] .thread-box,
html[data-theme="dark"] .factory-thread-rich-row,
html[data-theme="dark"] .factory-step-row,
html[data-theme="dark"] .factory-steps-list,
html[data-theme="dark"] .section-edit-card,
html[data-theme="dark"] .section-edit-form,
html[data-theme="dark"] .section-edit-steps,
html[data-theme="dark"] .section-edit-step,
html[data-theme="dark"] .section-edit-step-selectors,
html[data-theme="dark"] .metric-mini,
html[data-theme="dark"] .metric-pill,
html[data-theme="dark"] .eva-badge,
html[data-theme="dark"] .pill.small,
html[data-theme="dark"] .fpo-file-saved{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .factory-form input,
html[data-theme="dark"] .factory-form select,
html[data-theme="dark"] .factory-form textarea,
html[data-theme="dark"] .factory-page input,
html[data-theme="dark"] .factory-page select,
html[data-theme="dark"] .factory-page textarea,
html[data-theme="dark"] .factory-section-card input,
html[data-theme="dark"] .factory-section-card select,
html[data-theme="dark"] .factory-section-card textarea,
html[data-theme="dark"] .factory-order-card input,
html[data-theme="dark"] .factory-order-card select,
html[data-theme="dark"] .factory-order-card textarea,
html[data-theme="dark"] .read-only-info input,
html[data-theme="dark"] .read-only-info select,
html[data-theme="dark"] .read-only-info textarea,
html[data-theme="dark"] .section-edit-step-selectors input,
html[data-theme="dark"] .section-edit-step-selectors select,
html[data-theme="dark"] .section-edit-step-selectors textarea{
  background:var(--dm-input)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  -webkit-text-fill-color:var(--dm-text)!important;
  opacity:1!important;
}
html[data-theme="dark"] .factory-page input[disabled],
html[data-theme="dark"] .factory-page input[readonly],
html[data-theme="dark"] .factory-page textarea[disabled],
html[data-theme="dark"] .factory-page textarea[readonly],
html[data-theme="dark"] .factory-order-card input[disabled],
html[data-theme="dark"] .factory-order-card input[readonly],
html[data-theme="dark"] .factory-order-card textarea[disabled],
html[data-theme="dark"] .factory-order-card textarea[readonly]{
  background:var(--dm-card2)!important;
  color:var(--dm-muted)!important;
  -webkit-text-fill-color:var(--dm-muted)!important;
}
html[data-theme="dark"] .factory-order-card small,
html[data-theme="dark"] .factory-section-card small,
html[data-theme="dark"] .ay-order-fields small,
html[data-theme="dark"] .read-only-info small,
html[data-theme="dark"] .factory-step-row small{color:var(--dm-muted)!important}
html[data-theme="dark"] .factory-step-row .mini-code,
html[data-theme="dark"] .factory-download-chips .download-chip,
html[data-theme="dark"] .download-chip{
  background:var(--dm-card2)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}

/* Teléfono: quitar gris claro/fondo claro en toda la versión móvil */
html[data-theme="dark"] body.phone-body,
html[data-theme="dark"] .phone-shell,
html[data-theme="dark"] .phone-main,
html[data-theme="dark"] .phone-dashboard-main,
html[data-theme="dark"] .phone-search-wrap,
html[data-theme="dark"] .phone-bottom,
html[data-theme="dark"] .phone-bottom a,
html[data-theme="dark"] .phone-card,
html[data-theme="dark"] .phone-card > *,
html[data-theme="dark"] .phone-action,
html[data-theme="dark"] .phone-action > *,
html[data-theme="dark"] .phone-row,
html[data-theme="dark"] .phone-row > *,
html[data-theme="dark"] .phone-list,
html[data-theme="dark"] .phone-detail-card,
html[data-theme="dark"] .phone-order-general-card,
html[data-theme="dark"] .phone-pos-item-card,
html[data-theme="dark"] .phone-client-card,
html[data-theme="dark"] .phone-product-card,
html[data-theme="dark"] .phone-card-foot,
html[data-theme="dark"] .phone-soft-panel,
html[data-theme="dark"] .phone-kv,
html[data-theme="dark"] .phone-cart-note,
html[data-theme="dark"] .phone-totals-box,
html[data-theme="dark"] .phone-inline-note,
html[data-theme="dark"] .phone-visual-select-btn,
html[data-theme="dark"] .phone-visual-select-menu,
html[data-theme="dark"] .phone-visual-option{
  background:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] body.phone-body{background:var(--dm-bg)!important;background-image:none!important}
html[data-theme="dark"] .phone-shell{border-color:var(--dm-line)!important}
html[data-theme="dark"] .phone-bottom{background:var(--dm-bg2)!important}
html[data-theme="dark"] .phone-bottom a:hover{background:var(--dm-card2)!important}
html[data-theme="dark"] .phone-search-wrap input,
html[data-theme="dark"] .phone-gallery-filters input,
html[data-theme="dark"] .phone-gallery-filters select,
html[data-theme="dark"] .phone-filter-grid input,
html[data-theme="dark"] .phone-filter-grid select,
html[data-theme="dark"] .phone-order-card input,
html[data-theme="dark"] .phone-scan-line input,
html[data-theme="dark"] .phone-form input,
html[data-theme="dark"] .phone-modal-form input,
html[data-theme="dark"] .phone-modal-form select,
html[data-theme="dark"] .phone-order-add-panel input,
html[data-theme="dark"] .phone-order-add-panel select{
  background:var(--dm-input)!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  -webkit-text-fill-color:var(--dm-text)!important;
}
html[data-theme="dark"] .phone-muted-line,
html[data-theme="dark"] .phone-product-info small,
html[data-theme="dark"] .phone-card small,
html[data-theme="dark"] .phone-row small,
html[data-theme="dark"] .phone-inline-note small{color:var(--dm-muted)!important}
html[data-theme="dark"] .phone-product-info b,
html[data-theme="dark"] .phone-card-foot span:last-child{color:var(--dm-text)!important}

/* Catch final de fondos claros en módulos reportados, acotado a dark mode */
html[data-theme="dark"] :where(#orders,#bulk,#shopifySync,.factory-page,.factory-order-card,.factory-section-card,.home-admin-body,.stats-page,.phone-body) :where(div,section,article,aside,main,header,footer,label,details,summary,li,ul,table,tbody,thead,tr,td,th)[style*="background"]{
  background-color:var(--dm-card)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
}
html[data-theme="dark"] :where(#orders,#bulk,#shopifySync,.factory-page,.factory-order-card,.factory-section-card,.home-admin-body,.stats-page,.phone-body) :where(input,textarea,select)[style*="background"]{
  background-color:var(--dm-input)!important;
  background-image:none!important;
  color:var(--dm-text)!important;
  border-color:var(--dm-line)!important;
  -webkit-text-fill-color:var(--dm-text)!important;
}

/* ==== V362 APP MOVIL PWA ==== */
.pwa-install-card{
  position:fixed;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);
  z-index:99999;
  width:min(430px,calc(100vw - 28px));
  display:grid;
  grid-template-columns:48px 1fr auto 34px;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:22px;
  border:1px solid rgba(207,224,255,.9);
  background:rgba(255,255,255,.96);
  box-shadow:0 24px 70px rgba(8,23,76,.24);
  backdrop-filter:blur(14px);
  color:#07133a;
}
.pwa-install-logo{width:48px;height:48px;border-radius:16px;background:#0b1c72;display:grid;place-items:center;overflow:hidden}
.pwa-install-logo img{width:100%;height:100%;object-fit:cover}
.pwa-install-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.pwa-install-copy b{font-weight:1000;color:#07133a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pwa-install-copy small{font-weight:800;color:#64748b;line-height:1.25}
.pwa-install-action{border:0;border-radius:999px;background:#2563eb;color:white;font-weight:1000;padding:10px 14px;box-shadow:0 12px 28px rgba(37,99,235,.25);cursor:pointer}
.pwa-install-close{width:34px;height:34px;border:0;border-radius:12px;background:#eef4ff;color:#0b1c72;font-weight:1000;font-size:20px;cursor:pointer}
html[data-theme="dark"] .pwa-install-card,
body.phone-body .pwa-install-card{background:#111a2b;color:#f8fbff;border-color:#263650;box-shadow:0 24px 70px rgba(0,0,0,.42)}
html[data-theme="dark"] .pwa-install-copy b,
body.phone-body .pwa-install-copy b{color:#f8fbff}
html[data-theme="dark"] .pwa-install-copy small,
body.phone-body .pwa-install-copy small{color:#9fb0ca}
html[data-theme="dark"] .pwa-install-close,
body.phone-body .pwa-install-close{background:#16233a;color:#dbeafe}
@media(max-width:520px){
  .pwa-install-card{grid-template-columns:42px 1fr 84px 30px;border-radius:18px;padding:10px;gap:8px}
  .pwa-install-logo{width:42px;height:42px;border-radius:14px}
  .pwa-install-action{padding:9px 10px;font-size:12px}
  .pwa-install-copy small{font-size:11px}
}
@media(display-mode:standalone){
  .pwa-install-card{display:none!important}
  body.phone-body{min-height:100vh;min-height:100dvh;overscroll-behavior-y:none}
  .phone-bottom-nav,.phone-bottom{padding-bottom:max(10px,env(safe-area-inset-bottom,0px))!important}
}

/* ==== V363 PWA NOTIFICACIONES MOVILES ==== */
.pwa-notify-btn{
  position:fixed;
  right:14px;
  bottom:calc(82px + env(safe-area-inset-bottom,0px));
  z-index:2147483001;
  border:1px solid rgba(96,165,250,.45);
  border-radius:999px;
  padding:11px 14px;
  background:linear-gradient(135deg,#0b1c72,#2563eb);
  color:#fff;
  font-weight:1000;
  font-size:12px;
  box-shadow:0 18px 40px rgba(15,23,42,.28);
  cursor:pointer;
  max-width:210px;
}
.pwa-notify-btn.enabled{
  background:linear-gradient(135deg,#14532d,#16a34a);
  border-color:rgba(134,239,172,.65);
}
@media(max-width:520px){
  .pwa-notify-btn{right:10px;bottom:calc(76px + env(safe-area-inset-bottom,0px));padding:10px 12px;font-size:11px;max-width:178px}
}
html[data-theme="dark"] .pwa-notify-btn{box-shadow:0 18px 42px rgba(0,0,0,.42)}

/* ==== V365 PWA móvil: scroll real, swipe y configuración ==== */
html.phone-html, html.phone-html body.phone-body{
  height:auto!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior-y:contain;
}
body.phone-body.phone-scroll-enabled{
  position:relative!important;
  min-height:100dvh!important;
  height:auto!important;
  overflow-y:auto!important;
  touch-action:pan-y pan-x!important;
  padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))!important;
}
.phone-scroll-root,.phone-shell{
  min-height:100dvh!important;
  height:auto!important;
  overflow:visible!important;
}
.phone-main{
  min-height:calc(100dvh - 150px)!important;
  height:auto!important;
  overflow:visible!important;
  padding-bottom:calc(132px + env(safe-area-inset-bottom,0px))!important;
}
.phone-card,.phone-list,.phone-row,.phone-dashboard-main,.phone-settings-main{
  touch-action:pan-y!important;
}
.phone-user-mini{
  cursor:pointer!important;
  user-select:none!important;
  -webkit-tap-highlight-color:transparent;
  transition:transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.phone-user-mini:active{transform:scale(.96)}
.phone-user-mini::after{
  content:'⚙️';
  width:22px;height:22px;border-radius:999px;
  display:grid;place-items:center;
  background:#ffffff;color:#155be7;
  font-size:12px;font-weight:1000;
  margin-left:4px;
  box-shadow:0 4px 10px rgba(15,35,80,.16);
}
.phone-swipe-left .phone-shell{animation:phoneSwipeLeft .16s ease both}
.phone-swipe-right .phone-shell{animation:phoneSwipeRight .16s ease both}
@keyframes phoneSwipeLeft{from{transform:translateX(0);opacity:1}to{transform:translateX(-20px);opacity:.78}}
@keyframes phoneSwipeRight{from{transform:translateX(0);opacity:1}to{transform:translateX(20px);opacity:.78}}
.phone-settings-main{gap:14px!important}
.phone-settings-hero{background:linear-gradient(135deg,rgba(6,27,95,.96),rgba(37,99,235,.94))!important;color:#fff!important;border-color:rgba(255,255,255,.16)!important}
.phone-settings-hero .muted{color:rgba(255,255,255,.78)!important}
.phone-profile-row{display:grid;grid-template-columns:72px minmax(0,1fr);gap:14px;align-items:center}
.phone-profile-row img{width:72px;height:72px;border-radius:24px;object-fit:cover;background:#fff;border:2px solid rgba(255,255,255,.55)}
.phone-profile-row h2{margin:0 0 4px!important;color:inherit!important;line-height:1.08}
.phone-profile-row p{margin:0 0 8px!important;overflow-wrap:anywhere}
.phone-profile-pill{display:inline-flex;width:max-content;max-width:100%;padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.22);font-weight:1000;font-size:12px;color:#fff}
.phone-notif-status{display:grid;grid-template-columns:16px minmax(0,1fr);gap:8px 10px;align-items:center;background:#f5f9ff;border:1px solid #dbeafe;border-radius:18px;padding:13px 14px;margin:8px 0 14px}
.phone-notif-status b{line-height:1.1;color:#071a40}.phone-notif-status small{grid-column:2;color:#64748b;font-weight:800}.phone-status-dot{width:12px;height:12px;border-radius:999px;background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.15)}.phone-status-dot.ok{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.16)}.phone-status-dot.bad{background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.14)}.phone-status-dot.warn{background:#f59e0b}
.phone-settings-actions{display:grid;grid-template-columns:1fr;gap:10px;margin-top:14px}.phone-settings-actions .btn{width:100%;min-height:52px}.phone-notif-list .phone-row b{display:block;margin-bottom:3px}
html[data-theme="dark"] .phone-notif-status{background:#111a2b!important;border-color:#263650!important;color:#f3f7ff!important}html[data-theme="dark"] .phone-notif-status b{color:#f3f7ff!important}html[data-theme="dark"] .phone-notif-status small{color:#a8b7d2!important}
@media(max-width:520px){.phone-profile-row{grid-template-columns:60px minmax(0,1fr)}.phone-profile-row img{width:60px;height:60px;border-radius:20px}.phone-user-mini::after{width:20px;height:20px;font-size:11px}}


/* ==== V366 FIX DEFINITIVO SCROLL PWA MOVIL ==== */
html.phone-html,
html.phone-html body,
html.phone-html body.phone-body,
body.phone-body,
body.phone-body.phone-scroll-enabled{
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:scroll!important;
  -webkit-overflow-scrolling:touch!important;
  position:static!important;
  overscroll-behavior-y:auto!important;
  touch-action:auto!important;
}
body.phone-body{
  padding-bottom:calc(118px + env(safe-area-inset-bottom,0px))!important;
}
body.phone-body .phone-shell,
body.phone-body .phone-scroll-root,
body.phone-body #phoneApp{
  height:auto!important;
  min-height:100dvh!important;
  max-height:none!important;
  overflow:visible!important;
  position:relative!important;
  touch-action:auto!important;
  contain:none!important;
}
body.phone-body .phone-main,
body.phone-body main,
body.phone-body .phone-dashboard-main,
body.phone-body .phone-settings-main,
body.phone-body .phone-card,
body.phone-body .phone-list,
body.phone-body .phone-row,
body.phone-body .phone-actions,
body.phone-body .phone-gallery-grid,
body.phone-body .phone-product-grid,
body.phone-body #productsBox,
body.phone-body .phone-order-list,
body.phone-body .phone-factory-list{
  max-height:none!important;
  overflow:visible!important;
  touch-action:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
body.phone-body .phone-search-results,
body.phone-body .modal-card,
body.phone-body .phone-modal,
body.phone-body .phone-scroll-inner{
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:auto!important;
}
body.phone-body .phone-bottom,
body.phone-body .phone-bottom-nav{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(6px + env(safe-area-inset-bottom,0px))!important;
  transform:translateX(-50%)!important;
  z-index:2147483000!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}
body.phone-body.phone-swipe-left .phone-shell,
body.phone-body.phone-swipe-right .phone-shell{
  will-change:transform,opacity;
}
@media(display-mode:standalone){
  html.phone-html,html.phone-html body.phone-body,body.phone-body{overflow-y:scroll!important;overscroll-behavior-y:auto!important;height:auto!important;max-height:none!important;}
}


/* V367 - PWA iPhone/Samsung install card and safe icon handling */
@media (min-width: 921px){
  .pwa-install-mobile-only{ display:none !important; }
}
.pwa-install-card{
  position:fixed !important;
  left:12px !important;
  right:12px !important;
  bottom:calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  z-index:99999 !important;
  display:grid !important;
  grid-template-columns:52px minmax(0,1fr) auto 38px !important;
  gap:10px !important;
  align-items:center !important;
  padding:12px !important;
  border-radius:22px !important;
  background:rgba(10,18,34,.96) !important;
  border:1px solid rgba(148,163,184,.28) !important;
  box-shadow:0 22px 60px rgba(0,0,0,.42) !important;
  backdrop-filter:blur(16px) !important;
  color:#fff !important;
  max-width:560px !important;
  margin:0 auto !important;
}
.pwa-install-logo{width:52px;height:52px;border-radius:16px;overflow:hidden;background:#0b1c72;display:grid;place-items:center;}
.pwa-install-logo img{width:100%;height:100%;object-fit:cover;display:block;}
.pwa-install-copy{min-width:0;display:grid;gap:2px;}
.pwa-install-copy b{font-size:14px;line-height:1.1;color:#fff;}
.pwa-install-copy small{font-size:11px;line-height:1.25;color:#bdd2ff;font-weight:800;}
.pwa-install-action{border:0;border-radius:999px;background:#2f6df6;color:#fff;font-weight:1000;padding:10px 12px;min-height:38px;box-shadow:0 10px 22px rgba(47,109,246,.28);}
.pwa-install-close{border:0;width:34px;height:34px;border-radius:999px;background:rgba(255,255,255,.1);color:#fff;font-size:24px;line-height:1;font-weight:900;}
@media (max-width:420px){
  .pwa-install-card{grid-template-columns:46px minmax(0,1fr) auto 32px;padding:10px;border-radius:18px;}
  .pwa-install-logo{width:46px;height:46px;border-radius:14px;}
  .pwa-install-action{font-size:12px;padding:9px 10px;}
  .pwa-install-copy small{font-size:10px;}
}

/* ==== V368 - PWA install card blanco y encima del low bar ==== */
body.phone-body .pwa-install-card,
html[data-theme="dark"] body.phone-body .pwa-install-card,
html[data-theme="dark"] .pwa-install-card.pwa-install-mobile-only{
  background:#ffffff !important;
  color:#07133a !important;
  border:1px solid #dbe7ff !important;
  box-shadow:0 18px 52px rgba(15,23,42,.24) !important;
  backdrop-filter:blur(14px) !important;
  bottom:calc(92px + env(safe-area-inset-bottom,0px)) !important;
  z-index:2147483200 !important;
}
body.phone-body .pwa-install-copy b,
html[data-theme="dark"] body.phone-body .pwa-install-copy b,
html[data-theme="dark"] .pwa-install-card.pwa-install-mobile-only .pwa-install-copy b{
  color:#07133a !important;
}
body.phone-body .pwa-install-copy small,
html[data-theme="dark"] body.phone-body .pwa-install-copy small,
html[data-theme="dark"] .pwa-install-card.pwa-install-mobile-only .pwa-install-copy small{
  color:#64748b !important;
}
body.phone-body .pwa-install-close,
html[data-theme="dark"] body.phone-body .pwa-install-close,
html[data-theme="dark"] .pwa-install-card.pwa-install-mobile-only .pwa-install-close{
  background:#eef4ff !important;
  color:#0b1c72 !important;
}
body.phone-body .pwa-install-logo{
  background:#eef4ff !important;
  box-shadow:inset 0 0 0 1px #dbeafe !important;
}
@media(max-width:520px){
  body.phone-body .pwa-install-card,
  html[data-theme="dark"] body.phone-body .pwa-install-card{
    left:12px !important;
    right:12px !important;
    bottom:calc(88px + env(safe-area-inset-bottom,0px)) !important;
  }
}
@media(display-mode:standalone){
  body.phone-body .pwa-install-card{display:none!important;}
}


/* ==== V369 - PWA install card: ancho seguro dentro de pantalla móvil ==== */
body.phone-body .pwa-install-card,
html[data-theme="dark"] body.phone-body .pwa-install-card,
html[data-theme="dark"] .pwa-install-card.pwa-install-mobile-only{
  box-sizing:border-box !important;
  left:14px !important;
  right:auto !important;
  width:calc(100dvw - 28px) !important;
  max-width:calc(100dvw - 28px) !important;
  min-width:0 !important;
  margin:0 !important;
  transform:none !important;
  overflow:hidden !important;
  background:#ffffff !important;
  color:#07133a !important;
  bottom:calc(112px + env(safe-area-inset-bottom,0px)) !important;
  grid-template-columns:44px minmax(0,1fr) minmax(76px,auto) 38px !important;
  gap:8px !important;
  padding:10px !important;
}
body.phone-body .pwa-install-card *{
  box-sizing:border-box !important;
  min-width:0 !important;
}
body.phone-body .pwa-install-copy{
  overflow:hidden !important;
}
body.phone-body .pwa-install-copy b,
body.phone-body .pwa-install-copy small{
  display:block !important;
  max-width:100% !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.phone-body .pwa-install-action{
  white-space:nowrap !important;
  padding:9px 12px !important;
}
@media(max-width:390px){
  body.phone-body .pwa-install-card,
  html[data-theme="dark"] body.phone-body .pwa-install-card{
    left:10px !important;
    width:calc(100dvw - 20px) !important;
    max-width:calc(100dvw - 20px) !important;
    bottom:calc(108px + env(safe-area-inset-bottom,0px)) !important;
    grid-template-columns:minmax(0,1fr) 82px 36px !important;
    gap:7px !important;
    padding:10px !important;
    border-radius:20px !important;
  }
  body.phone-body .pwa-install-logo{
    display:none !important;
  }
  body.phone-body .pwa-install-action{
    font-size:12px !important;
    padding:9px 10px !important;
  }
  body.phone-body .pwa-install-close{
    width:36px !important;
    height:36px !important;
  }
}
@supports not (width: 100dvw){
  body.phone-body .pwa-install-card,
  html[data-theme="dark"] body.phone-body .pwa-install-card{
    width:calc(100vw - 28px) !important;
    max-width:calc(100vw - 28px) !important;
  }
}

/* V373 - POS móvil: productos rápidos dentro de caja con scroll propio (4 visibles) */
.phone-pos-block .create-product-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:10px !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  margin-top:12px !important;
  padding:10px !important;
  max-height:560px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  overscroll-behavior:contain !important;
  -webkit-overflow-scrolling:touch !important;
  touch-action:pan-y !important;
  background:linear-gradient(180deg,#f8fbff,#eef5ff) !important;
  border:1px solid #d7e6ff !important;
  border-radius:22px !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.78),0 10px 22px rgba(15,35,80,.05) !important;
  scrollbar-width:thin;
}
.phone-pos-block .create-product-grid::-webkit-scrollbar{width:7px}
.phone-pos-block .create-product-grid::-webkit-scrollbar-track{background:#e8f1ff;border-radius:999px}
.phone-pos-block .create-product-grid::-webkit-scrollbar-thumb{background:#9db9f8;border-radius:999px}
.phone-pos-block .create-product-grid .phone-product-card{
  min-height:250px !important;
  height:250px !important;
  max-height:250px !important;
  padding:8px !important;
  border-radius:18px !important;
  overflow:hidden !important;
  content-visibility:visible !important;
  contain-intrinsic-size:auto !important;
}
.phone-pos-block .create-product-grid .phone-product-card > img,
.phone-pos-block .create-product-grid .phone-product-card > .phone-img-empty{
  height:106px !important;
  min-height:106px !important;
  max-height:106px !important;
  border-radius:14px !important;
  object-fit:cover !important;
}
.phone-pos-block .create-product-grid .phone-product-card b{
  font-size:11px !important;
  line-height:1.08 !important;
  min-height:34px !important;
  display:-webkit-box !important;
  -webkit-line-clamp:3 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
}
.phone-pos-block .create-product-grid .phone-product-card small{
  font-size:9.5px !important;
  line-height:1.15 !important;
  margin:1px 0 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.phone-pos-block .create-product-grid .phone-size-pill-row{
  max-height:37px !important;
  overflow:auto !important;
  gap:3px !important;
  margin:2px 0 !important;
  scrollbar-width:none;
}
.phone-pos-block .create-product-grid .phone-size-pill-row::-webkit-scrollbar{display:none}
.phone-pos-block .create-product-grid .phone-size-pill{
  font-size:8.5px !important;
  padding:3px 5px !important;
  border-radius:8px !important;
}
.phone-pos-block .create-product-grid .phone-size-pill em{font-size:8px !important}
.phone-pos-block .create-product-grid .phone-product-card-prices,
.phone-pos-block .create-product-grid .phone-product-card div:last-child{
  font-size:10px !important;
  margin-top:auto !important;
  gap:4px !important;
}
.phone-pos-block .create-product-grid .phone-wholesale-chip{
  font-size:10px !important;
  padding:4px 6px !important;
  border-radius:10px !important;
}
@media(max-width:520px){
  .phone-pos-block .create-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    max-height:528px !important;
    padding:9px !important;
    gap:9px !important;
  }
  .phone-pos-block .create-product-grid .phone-product-card{
    min-height:244px !important;
    height:244px !important;
    max-height:244px !important;
  }
  .phone-pos-block .create-product-grid .phone-product-card > img,
  .phone-pos-block .create-product-grid .phone-product-card > .phone-img-empty{
    height:100px !important;
    min-height:100px !important;
    max-height:100px !important;
  }
}
@media(max-width:370px){
  .phone-pos-block .create-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    max-height:506px !important;
    padding:8px !important;
    gap:8px !important;
  }
  .phone-pos-block .create-product-grid .phone-product-card{
    min-height:235px !important;
    height:235px !important;
    max-height:235px !important;
  }
  .phone-pos-block .create-product-grid .phone-product-card > img,
  .phone-pos-block .create-product-grid .phone-product-card > .phone-img-empty{
    height:92px !important;
    min-height:92px !important;
    max-height:92px !important;
  }
  .phone-pos-block .create-product-grid .phone-product-card b{font-size:10.5px !important;min-height:32px !important}
  .phone-pos-block .create-product-grid .phone-product-card small{font-size:9px !important}
}

/* V374 - POS móvil: caja de productos rápidos realmente compacta (solo 4 visibles) */
body.phone-body .phone-pos-block .create-product-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  grid-auto-rows:158px !important;
  gap:8px !important;
  height:344px !important;
  max-height:344px !important;
  min-height:344px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  overscroll-behavior:contain !important;
  -webkit-overflow-scrolling:touch !important;
  touch-action:pan-y !important;
  padding:8px !important;
  margin-top:10px !important;
  border-radius:18px !important;
  box-sizing:border-box !important;
  align-content:start !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-product-card{
  min-height:158px !important;
  height:158px !important;
  max-height:158px !important;
  padding:6px !important;
  gap:3px !important;
  border-radius:14px !important;
  box-sizing:border-box !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-product-card > img,
body.phone-body .phone-pos-block .create-product-grid .phone-product-card > .phone-img-empty{
  height:74px !important;
  min-height:74px !important;
  max-height:74px !important;
  border-radius:11px !important;
  object-fit:cover !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-product-card b{
  font-size:9.5px !important;
  line-height:1.05 !important;
  min-height:20px !important;
  max-height:31px !important;
  margin:0 !important;
  -webkit-line-clamp:2 !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-product-card small{
  font-size:8px !important;
  line-height:1.05 !important;
  max-height:10px !important;
  margin:0 !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-size-pill-row{
  max-height:23px !important;
  min-height:0 !important;
  margin:0 !important;
  gap:2px !important;
  overflow:hidden !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-size-pill{
  font-size:7px !important;
  padding:2px 4px !important;
  border-radius:7px !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-size-pill em{font-size:6.5px !important;}
body.phone-body .phone-pos-block .create-product-grid .phone-product-card-prices,
body.phone-body .phone-pos-block .create-product-grid .phone-product-card div:last-child{
  font-size:8px !important;
  line-height:1 !important;
  margin-top:auto !important;
}
body.phone-body .phone-pos-block .create-product-grid .phone-wholesale-chip{
  font-size:7.5px !important;
  padding:2px 4px !important;
  border-radius:7px !important;
}
@media(max-width:390px){
  body.phone-body .phone-pos-block .create-product-grid{
    grid-auto-rows:150px !important;
    height:326px !important;
    max-height:326px !important;
    min-height:326px !important;
    gap:8px !important;
    padding:8px !important;
  }
  body.phone-body .phone-pos-block .create-product-grid .phone-product-card{
    min-height:150px !important;
    height:150px !important;
    max-height:150px !important;
  }
  body.phone-body .phone-pos-block .create-product-grid .phone-product-card > img,
  body.phone-body .phone-pos-block .create-product-grid .phone-product-card > .phone-img-empty{
    height:68px !important;
    min-height:68px !important;
    max-height:68px !important;
  }
}

/* V378 - Buscador visual por imagen */
.visual-search-open{background:#0f5fff;color:#fff;border-color:#0f5fff;box-shadow:0 10px 24px rgba(15,95,255,.18)}
.visual-search-panel{border:1px solid rgba(15,95,255,.2);background:linear-gradient(180deg,rgba(15,95,255,.06),rgba(255,255,255,.98));}
.visual-search-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}
.visual-search-head h3{margin:0 0 4px}.visual-search-head p{margin:0;max-width:780px}
.visual-search-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}.visual-search-file-label{cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.visual-search-status{font-size:13px;color:#475569;background:#f8fbff;border:1px solid #e1ecff;border-radius:12px;padding:10px 12px;margin:10px 0}
.visual-search-layout{display:grid;grid-template-columns:180px 1fr;gap:14px;align-items:start}.visual-search-query{text-align:center}.visual-query-preview{width:160px;height:160px;border-radius:20px;background:#eef4ff;border:1px dashed #9dbbff;display:flex;align-items:center;justify-content:center;font-size:42px;overflow:hidden;margin:auto}.visual-query-preview img{width:100%;height:100%;object-fit:cover}
.visual-search-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}.visual-empty{grid-column:1/-1;padding:18px;border:1px dashed #c7d7fe;border-radius:16px;text-align:center;color:#64748b;background:#fff}.visual-result-card{border:1px solid #e2e8f0;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 8px 22px rgba(15,23,42,.08);cursor:pointer;transition:.16s ease}.visual-result-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(15,23,42,.12)}.visual-result-img{height:128px;background:#eef4ff;display:flex;align-items:center;justify-content:center;overflow:hidden}.visual-result-img img{width:100%;height:100%;object-fit:cover}.visual-result-body{padding:10px}.visual-result-body b{display:block;font-size:13px;line-height:1.2;margin-bottom:4px}.visual-result-body small{display:block;color:#64748b;line-height:1.25}.visual-score{display:inline-flex;align-items:center;gap:4px;margin:6px 0;padding:4px 8px;border-radius:999px;background:#eaf2ff;color:#0f5fff;font-weight:800;font-size:12px}.visual-stock{display:inline-flex;margin-top:6px;padding:3px 7px;border-radius:999px;background:#f1f5f9;color:#334155;font-size:11px;font-weight:700}
body.dark .visual-search-panel{background:linear-gradient(180deg,rgba(37,99,235,.18),rgba(15,23,42,.98));border-color:rgba(96,165,250,.35)}body.dark .visual-search-status,body.dark .visual-empty,body.dark .visual-result-card{background:#111827;border-color:#334155;color:#cbd5e1}body.dark .visual-query-preview,.visual-result-img{background:#1f2937}body.dark .visual-result-body small{color:#94a3b8}
@media(max-width:760px){.visual-search-layout{grid-template-columns:1fr}.visual-query-preview{width:100%;height:210px}.visual-search-results{grid-template-columns:repeat(2,minmax(0,1fr))}.visual-result-img{height:118px}.visual-search-head{flex-direction:column}.visual-search-head .mini-action{align-self:flex-end}}
.visual-search-text-field{min-width:240px;max-width:360px;margin:0}.visual-search-text-field label{font-size:11px}.visual-search-text-field input{min-height:38px}
@media(max-width:760px){.visual-search-text-field{width:100%;max-width:none}.visual-search-text-field input{width:100%}}

/* V398: búsqueda visual por segmento manual. La foto se sube una vez y después el usuario decide si buscar en manga larga, manga corta, gorra, jersey o juvenil. */
.visual-segment-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0 10px;padding:10px;border:1px dashed #b7ccff;border-radius:14px;background:rgba(15,95,255,.045)}
.visual-segment-title{font-size:12px;font-weight:800;color:#334155;margin-right:4px}
.visual-segment-btn{background:#fff;color:#0f172a;border:1px solid #cbd5e1;box-shadow:0 6px 16px rgba(15,23,42,.06)}
.visual-segment-btn:hover{border-color:#0f5fff;color:#0f5fff;transform:translateY(-1px)}
.visual-segment-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
body.dark .visual-segment-actions{background:rgba(37,99,235,.12);border-color:rgba(96,165,250,.35)}
body.dark .visual-segment-title{color:#cbd5e1}body.dark .visual-segment-btn{background:#111827;color:#e5e7eb;border-color:#334155}
@media(max-width:760px){.visual-segment-actions{display:grid;grid-template-columns:1fr 1fr}.visual-segment-title{grid-column:1/-1}.visual-segment-btn{width:100%;justify-content:center}}

/* V399 - Búsqueda visual copiada a POS y POS móvil */
.phone-visual-panel{margin:12px 0;border:1px solid rgba(11,28,114,.12);background:rgba(11,28,114,.035);border-radius:18px;padding:14px;display:grid;gap:10px}
.phone-visual-panel h3{margin:0;color:#0b1c72}
.phone-visual-panel input[type="text"],.phone-visual-panel input:not([type]){width:100%;border:1px solid #d7deee;border-radius:12px;padding:11px;background:#fff}
.phone-visual-segments{display:flex;gap:8px;flex-wrap:wrap}
.phone-visual-preview{min-height:72px;border:1px dashed #c6d0e5;border-radius:14px;display:flex;align-items:center;justify-content:center;background:#fff;overflow:hidden;color:#64748b;font-size:26px}
.phone-visual-preview img{width:100%;max-height:180px;object-fit:contain;display:block}
.phone-visual-results{margin-top:6px}
.phone-visual-results .phone-product-card{text-align:left;position:relative}
.phone-visual-results .visual-score{display:inline-block;margin-top:6px;background:#e6f7ee;color:#117442;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:800}
.visual-search-panel[data-visual-context="pos"]{border:2px solid rgba(11,28,114,.18);box-shadow:0 18px 45px rgba(15,23,42,.11)}
.visual-search-panel[data-visual-context="pos"] .visual-result-card{cursor:pointer}
.visual-search-panel[data-visual-context="pos"] .visual-result-card:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(15,23,42,.12)}
@media(max-width:640px){.phone-visual-segments .btn{flex:1 1 46%;}.phone-visual-results{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* V402 - Buscador visual: limpieza visual + modal POS escritorio */
.visual-search-head{align-items:center;margin-bottom:10px}.visual-search-head h3{margin:0;font-size:18px;font-weight:900;color:#071b55}.visual-search-head p,.visual-segment-title{display:none!important}.visual-close-btn{width:38px;height:38px;border-radius:50%;border:0;background:#0f5fff;color:#fff;font-size:24px;font-weight:900;line-height:1;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 12px 28px rgba(15,95,255,.28);cursor:pointer;transition:transform .14s ease,box-shadow .14s ease,background .14s ease}.visual-close-btn:hover{transform:translateY(-1px) scale(1.04);background:#094ad1;box-shadow:0 16px 34px rgba(15,95,255,.36)}.visual-search-actions{margin-bottom:12px}.visual-segment-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px;border-radius:16px;background:#eef5ff;border:1px dashed rgba(15,95,255,.24);margin:6px 0 10px}.visual-search-status{margin:8px 0 12px;padding:8px 12px;border-radius:12px;font-weight:700}.visual-search-panel{position:relative}.visual-search-panel.visual-search-modal{position:fixed!important;z-index:9999;top:50%;left:50%;transform:translate(-50%,-50%);width:min(1380px,calc(100vw - 44px));height:min(860px,calc(100vh - 44px));overflow:auto;border-radius:24px;padding:18px 20px;background:linear-gradient(180deg,#f7fbff,#ffffff);box-shadow:0 32px 90px rgba(2,8,23,.34);border:1px solid rgba(15,95,255,.22)}body.visual-modal-open{overflow:hidden}body.visual-modal-open::before{content:"";position:fixed;inset:0;background:rgba(6,18,48,.46);backdrop-filter:blur(6px);z-index:9998}.visual-search-panel.visual-search-modal .visual-search-head{position:sticky;top:0;z-index:3;background:linear-gradient(180deg,#f7fbff,#ffffff);padding-bottom:10px}.visual-search-panel.visual-search-modal .visual-search-layout{grid-template-columns:170px 1fr}.visual-search-panel.visual-search-modal .visual-search-results{grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:12px}.visual-search-panel.visual-search-modal .visual-result-img{height:126px}.visual-search-panel.visual-search-modal .visual-query-preview{width:150px;height:150px}.visual-search-panel.visual-search-modal[data-visual-context="pos"] .visual-result-card{border-color:#dbeafe}.visual-search-panel.visual-search-modal[data-visual-context="pos"] .visual-result-card:hover{border-color:#0f5fff;box-shadow:0 14px 32px rgba(15,95,255,.18)}body.dark .visual-close-btn{background:#2563eb;color:#fff}body.dark .visual-search-panel.visual-search-modal{background:linear-gradient(180deg,#111827,#0b1220);border-color:rgba(96,165,250,.35)}body.dark .visual-search-panel.visual-search-modal .visual-search-head{background:linear-gradient(180deg,#111827,#0b1220)}body.dark .visual-search-head h3{color:#e5edff}body.dark .visual-segment-actions{background:rgba(37,99,235,.12);border-color:rgba(96,165,250,.26)}@media(max-width:760px){.visual-search-panel.visual-search-modal{width:calc(100vw - 18px);height:calc(100vh - 18px);padding:14px;border-radius:18px}.visual-search-panel.visual-search-modal .visual-search-layout{grid-template-columns:1fr}.visual-search-panel.visual-search-modal .visual-search-results{grid-template-columns:repeat(2,minmax(0,1fr))}.visual-close-btn{width:36px;height:36px;font-size:22px}}


/* V403 - Modal visual POS respeta sidebar desplegado/colapsado */
:root{--visual-sidebar-offset:0px;}
body.visual-modal-open::before{left:var(--visual-sidebar-offset)!important;right:0!important;top:0!important;bottom:0!important;inset:auto!important;}
.visual-search-panel.visual-search-modal{
  left:calc(var(--visual-sidebar-offset) + ((100vw - var(--visual-sidebar-offset)) / 2))!important;
  width:min(1380px,calc(100vw - var(--visual-sidebar-offset) - 44px))!important;
  max-width:calc(100vw - var(--visual-sidebar-offset) - 44px)!important;
  z-index:100040!important;
}
@media(max-width:1000px){
  :root{--visual-sidebar-offset:0px;}
  body.visual-modal-open::before{inset:0!important;}
  .visual-search-panel.visual-search-modal{
    left:50%!important;
    width:calc(100vw - 18px)!important;
    max-width:calc(100vw - 18px)!important;
  }
}

/* V405 categoría/auto */
.auto-rule-divider{grid-column:1/-1;display:flex;align-items:center;gap:12px;margin:8px 0;color:#0d5dff;font-weight:800;text-transform:uppercase;font-size:.78rem;letter-spacing:.05em}
.auto-rule-divider:before,.auto-rule-divider:after{content:"";height:1px;background:rgba(13,93,255,.2);flex:1}
.category-auto-table td{vertical-align:top}
.category-auto-modal{position:fixed;inset:0;background:rgba(4,12,30,.55);backdrop-filter:blur(6px);z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px}
.category-auto-modal-card{background:var(--card,#fff);color:var(--text,#101828);border-radius:24px;box-shadow:0 24px 70px rgba(0,0,0,.28);width:min(760px,calc(100vw - 32px));max-height:calc(100vh - 48px);overflow:auto;padding:24px;position:relative;border:1px solid rgba(13,93,255,.12)}
.modal-close.blue-circle{position:absolute;right:16px;top:16px;width:38px;height:38px;border-radius:999px;border:0;background:#0d5dff;color:#fff;font-size:24px;line-height:1;display:grid;place-items:center;box-shadow:0 8px 20px rgba(13,93,255,.35);cursor:pointer}
.auto-price-row{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.auto-price-row span{background:rgba(13,93,255,.08);border:1px solid rgba(13,93,255,.12);padding:8px 10px;border-radius:12px}.auto-description-full{white-space:pre-wrap;font-family:inherit;background:rgba(15,23,42,.04);border:1px solid rgba(15,23,42,.08);border-radius:16px;padding:16px;line-height:1.5}

/* V408: selector de automatizaciones múltiples por rama */
.category-auto-choice-box{margin-top:10px;border:1px solid #d7e6ff;background:#f8fbff;border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:8px}
.category-auto-choice-box small{color:#5b6b83;font-weight:700}
.category-auto-choice-list{display:flex;flex-wrap:wrap;gap:8px}
.category-auto-choice-list .btn{display:flex;flex-direction:column;align-items:flex-start;gap:3px;max-width:280px;white-space:normal;text-align:left;line-height:1.2;border-radius:14px;padding:9px 12px}
.category-auto-choice-list .btn span{font-size:12px;font-weight:800;opacity:.9}
.category-auto-choice-list .btn em{font-size:11px;font-style:normal;font-weight:700;opacity:.85}


/* V420 permisos móviles restringidos */
body.mobile-restricted .phone-header-actions > a[href="home.html"]{display:none!important}
body.mobile-restricted .phone-bottom:empty{display:none!important}
